Log for #paper-dev on SpigotMC - 2020/01/25

Topic -- Topic: Paper plugin/server development channel | Source: https://github.com/PaperMC/Paper/ | Maven: https://papermc.io/repo/repository/maven-public/ | Download: https://papermc.io/downloads
Topic -- Topic set on May 16, 2019 05:28:23 am by Z750
00:23:07 DiscordBot <m​ov​51​> Very basic question here. I'm trying to move the drops from a block to the players inventory, and I'... https://paste.gg/p/anonymous/2f01d3a11d624de9b396993158e96da4
00:45:45 DiscordBot <w​iz​ja​ny​> monitor is literally just the next up from highest
00:45:54 DiscordBot <w​iz​ja​ny​> it has no technically special meaning
00:46:37 DiscordBot <w​iz​ja​ny​> you are supposed to not cancel at monitor as a courtesy but there is no actual restriction
00:46:59 DiscordBot <w​iz​ja​ny​> that said...isnt there a block drops event or something after the break?
00:47:31 DiscordBot <w​iz​ja​ny​> might be thinking of something else tho idk
00:48:53 DiscordBot <m​ov​51​> hmm, not sure on that. there might be, the way i'm having to do it is get the block that was broken, then the item that the player was holding and then use getDrops() to figure out what would have dropped
00:49:44 DiscordBot <o​kd​ud​e> how long would forceupgrade 1.14.4 to 1.15.2 take on 500gb world?
00:50:17 DiscordBot <m​ov​51​> it took about 14 hours on a 200gb world, so nearly 3 times that?
00:50:30 DiscordBot <o​kd​ud​e> oh damn
00:50:32 DiscordBot <o​kd​ud​e> a few days
00:50:33 DiscordBot <m​ov​51​> yeah :/
00:50:50 DiscordBot <e​le​ct​ro​ni​cc​at​> depends
00:50:55 DiscordBot <e​le​ct​ro​ni​cc​at​> but it's really not needed
00:51:21 DiscordBot <o​kd​ud​e> bro ima remove chunks with inhabitedtime under 10 mins with mcaselector
00:51:28 DiscordBot <o​kd​ud​e> and over 2 weeks old
00:51:47 DiscordBot <o​kd​ud​e> tried it on 50gb file bam 22gb
02:06:33 DiscordBot <o​kd​ud​e> YOOO GG THANK YOU GUYS SO MUCH
02:06:39 DiscordBot <o​kd​ud​e> GAMER MOMENT
02:45:06 DiscordBot <z​bk​> how do you guys handle configurable messages
02:45:27 DiscordBot <n​os​sr​50​☃> locale files
02:45:50 DiscordBot <z​bk​> is there official api support for them or do you just treat them as config files
02:46:09 DiscordBot <n​os​sr​50​☃> Java has it built in
02:46:24 DiscordBot <z​bk​> oh, learn something new every day eh?
02:46:26 DiscordBot <Z​75​0> You can pretty much handle them however you want
02:46:51 DiscordBot <z​bk​> i was just gonna throw everything in a yml file
02:47:19 DiscordBot <n​os​sr​50​☃> I don't recommend using Java's built in system as prior to Java 9 it doesn't support unicode characters without using stuff like UTF16
02:47:26 DiscordBot <z​bk​> oh
02:47:27 DiscordBot <n​os​sr​50​☃> and if you're making MC shit you're working in Java 8
02:47:34 DiscordBot <z​bk​> yeah
02:47:56 DiscordBot <z​bk​> if you using yml configurations, should you load all of the values into RAM or just config.getString() each time
02:48:04 DiscordBot <n​os​sr​50​☃> I wouldn't use yaml
02:48:09 DiscordBot <n​os​sr​50​☃> too easy for users to break
02:48:30 DiscordBot <n​os​sr​50​☃> fragile af
02:48:34 DiscordBot <z​bk​> alternative being?
02:48:44 DiscordBot <n​os​sr​50​☃> a simple properties file works
02:49:07 DiscordBot <z​bk​> oh yeah forgot about those
02:49:55 DiscordBot <z​bk​> now would having a field for each method make sense
02:50:15 DiscordBot <z​bk​> so you can do Msg.NO_PERMS or whatever
02:51:02 DiscordBot <n​os​sr​50​☃> well hopefully that stuff gets loaded into a hash map
02:53:24 DiscordBot <z​bk​> oh
02:53:26 DiscordBot <z​bk​> i am
02:53:31 DiscordBot <z​bk​> very dumb
02:53:51 DiscordBot <z​bk​> nevermind
03:12:28 <-- Lur (Lur!~d2362397@SpigotMC-fm7.hsb.54.210.IP) has quit (Ping timeout: 121 seconds)
04:19:24 DiscordBot .flags
04:24:07 --> Lur (Lur!~d2362397@SpigotMC-fm7.hsb.54.210.IP) joined the channel
04:47:48 <-- Streamfrost (Streamfrost!~Spottedleaf@SpigotMC-ftjq9u.ipv6.telus.net) has quit (Killed (NickServ (GHOST command used by Streamfrost_!~Spottedleaf@SpigotMC-imolc6.ipv6.telus.net)))
04:47:54 --> Streamfrost (Streamfrost!~Spottedleaf@SpigotMC-imolc6.ipv6.telus.net) joined the channel
04:52:05 <-- Streamfrost (Streamfrost!~Spottedleaf@SpigotMC-imolc6.ipv6.telus.net) has quit (Killed (NickServ (GHOST command used by Streamfrost_!~Spottedleaf@SpigotMC-002nkm.ipv6.telus.net)))
04:52:13 --> Streamfrost (Streamfrost!~Spottedleaf@SpigotMC-002nkm.ipv6.telus.net) joined the channel
05:24:09 <-- Lur (Lur!~d2362397@SpigotMC-fm7.hsb.54.210.IP) has quit (Quit: Ping timeout (120 seconds))
05:24:27 --> Lur (Lur!~d2362397@SpigotMC-fm7.hsb.54.210.IP) joined the channel
05:26:30 DiscordBot <B​ab​bu​dh​as​br​o> So I have an issue. Whenever a player trades for glass panes from a cartographer I get an error and the server times out. Why?
05:26:52 DiscordBot <w​iz​ja​ny​> 2312?
05:27:00 DiscordBot <w​iz​ja​ny​> #paper-help
05:27:38 DiscordBot <C​al​la​ha​n> upddate
05:27:42 DiscordBot <B​ab​bu​dh​as​br​o> Sorry I'm new, DK where things go
05:27:53 DiscordBot <B​ab​bu​dh​as​br​o> I am on the most recent .jar
05:27:58 DiscordBot <B​ab​bu​dh​as​br​o> I updated yesterday
05:28:01 DiscordBot <S​tr​ea​mf​ro​st​> paste /version
05:28:08 DiscordBot <C​al​la​ha​n> thats not the most recent
05:28:09 DiscordBot <S​tr​ea​mf​ro​st​> latest is never latest :>
05:28:24 DiscordBot <B​ab​bu​dh​as​br​o> Is there a new version out today?
05:28:39 DiscordBot <C​al​la​ha​n> paste /version
05:33:00 DiscordBot <B​ab​bu​dh​as​br​o> Ok, I'm behind, but I want to point out that this problem has lasted across several different versions
05:33:23 DiscordBot <S​tr​ea​mf​ro​st​> the reason we want /version is to see if you're on the build that supposedly fixes it
05:33:43 DiscordBot <S​tr​ea​mf​ro​st​> at this point can you just give the crash log
05:35:21 DiscordBot <B​ab​bu​dh​as​br​o> I just updated, I'm testing to see if it crashes again.
05:35:52 DiscordBot <B​ab​bu​dh​as​br​o> So you guys knew about the villager trade crash problem?
05:36:41 DiscordBot <C​al​la​ha​n> https://github.com/PaperMC/Paper/issues/2312 since july 2019
05:38:45 DiscordBot <B​ab​bu​dh​as​br​o> Oopsy poopsy
05:38:56 DiscordBot <B​ab​bu​dh​as​br​o> I just updated to the latest release
05:39:01 DiscordBot <B​ab​bu​dh​as​br​o> Down the server goes
05:39:59 DiscordBot <B​ab​bu​dh​as​br​o> I shall paste the log tomorrow. In the correct channrl
05:40:16 DiscordBot <B​ab​bu​dh​as​br​o> I don't see why that one particular trade can time out a whole server
05:40:59 DiscordBot <S​tr​ea​mf​ro​st​> maybe reading the issue would give some insight
05:41:52 DiscordBot <B​ab​bu​dh​as​br​o> Which issue? The one previously posted?
05:44:40 DiscordBot <B​ab​bu​dh​as​br​o> I'm assuming so.
06:07:25 DiscordBot <T​yr​ri​el​> Calling ItemStack#clone(); creates a new ItemStack right?
06:12:42 <-- Streamfrost (Streamfrost!~Spottedleaf@SpigotMC-002nkm.ipv6.telus.net) has quit (Killed (NickServ (GHOST command used by Streamfrost_!~Spottedleaf@SpigotMC-7vbihe.ipv6.telus.net)))
06:12:48 --> Streamfrost (Streamfrost!~Spottedleaf@SpigotMC-7vbihe.ipv6.telus.net) joined the channel
06:12:57 DiscordBot <T​yr​ri​el​> Basically what I'm trying to do is have a "GUI item" that has special Persistent Data that the original item does not have:
06:12:58 DiscordBot <T​yr​ri​el​> https://hastebin.com/zafulayoka.csCurrently with this code even the original item has that special Persistent Data
06:13:26 DiscordBot <T​yr​ri​el​> (Excuse the bad variable naming)
06:16:08 DiscordBot <T​yr​ri​el​> If anyone has some insight on this it would be much appreciated
09:06:46 DiscordBot <F​lo​ |​ G​es​ta​nk​br​at​wu​rs​t> A question regarding reflections.
09:06:47 DiscordBot <F​lo​ |​ G​es​ta​nk​br​at​wu​rs​t> If i want to maintain a Method and an instance to invoke on in a single place would i have to just wrap them like this: https://media.discordapp.net/attachments/555462289851940864/670555143770603520/Screenshot_4.png
09:08:06 KennyTV > lombok
09:08:11 DiscordBot .lombok
09:08:20 KennyTV why do you need to wrap it / put it into an object if it's only single place usage?
09:10:12 DiscordBot <F​lo​ |​ G​es​ta​nk​br​at​wu​rs​t> Im getting the method from the exact instance i want to invoke the method on. https://media.discordapp.net/attachments/555462289851940864/670556011702124564/Screenshot_5.png
09:10:15 DiscordBot <F​lo​ |​ G​es​ta​nk​br​at​wu​rs​t> https://media.discordapp.net/attachments/555462289851940864/670556023907418123/Screenshot_6.png
09:11:00 DiscordBot <F​lo​ |​ G​es​ta​nk​br​at​wu​rs​t> And the method might only have one parameter that extends Event
09:13:40 DiscordBot <K​en​ny​TV​> what's the annotation parameter? the eventclass?
09:14:46 KennyTV seems alright. not sure about the why, but it's functional :D
10:26:09 DiscordBot <F​ab​ri​ce​> hello, someone can help me about how setup PaperMC for editing source code ?
10:28:09 DiscordBot .ask
10:28:26 KennyTV read the... readme
10:28:29 KennyTV and contributing
11:21:11 DiscordBot <o​kd​ud​e> hello, does protocollib have a discord? I need help spawning a hologram that only 1 player can see with protocollib
11:22:08 DiscordBot <o​kd​ud​e> i tried using this https://gist.github.com/aadnk/4286005 but it doesnt seem to work anymore
11:29:02 KennyTV spawn_entity_living packet, after that an entity_metadata packet filled with the datawatcher list https://wiki.vg/Entity_metadata#ArmorStand (you prolly just need index 0, 2, 3, and 5)
11:35:18 DiscordBot <o​kd​ud​e> Would i need to use nms to get datawatcher list?
11:37:08 DiscordBot <o​kd​ud​e> and also why do i have to use the datawatcher when i just want to spawn an invisible armorstand for about 10 seconds?
11:37:29 KennyTV because the entitiy needs metadata?
11:37:50 KennyTV not sure if this is the only/best way, but it is one: https://hasteb.in/ezuxuyap.gradle
11:38:46 KennyTV also depending on the version this may be highly different
11:39:00 KennyTV in 1.15 you need to send a separate metadata packet, in 1.14 the metadata is included in the spawn packet
11:39:39 DiscordBot <o​kd​ud​e> darn
11:40:17 DiscordBot <o​kd​ud​e> i thought it would be as simple as this lol: https://pastebin.com/jcmnhRSh
11:41:28 KennyTV you asked how to do it with protocollib, so you got your answer :p
11:41:52 DiscordBot <o​kd​ud​e> okay yeah ima use nms lol
11:41:53 KennyTV which means manually constructing packets, yeah
12:04:57 DiscordBot <f​ra​me​sh​if​t> What is the preferred way to setup custom logging?
12:04:58 DiscordBot <f​ra​me​sh​if​t> For example, I need to setup multiple log files in plugin folder, can I do it with Spigot/Paper API or do I have to implement it on my own?
12:28:49 DiscordBot <S​ys​te​m> You do that via Log4j2 API
12:31:29 DiscordBot <M​eF​is​to​94​> Any Event you can recommend to set the resource pack? PlayerJoin is too early, using a scheduled delay is russian roulette (slow pc: still too early, fast pc: after 30 seconds suddenly a resource pack tf)
12:35:01 DiscordBot <j​et​p2​50​> scheduler doesn't depend on PC speed
12:35:24 DiscordBot <j​et​p2​50​> a single tick takes the same amount of time on all PCs, unless you have a very slow PC and your server can't keep up anywhere near 20 TPS
12:36:26 DiscordBot <f​ra​me​sh​if​t> > You do that via Log4j2 API
12:36:28 DiscordBot <f​ra​me​sh​if​t> @System any further info? I couldn't find how I can reconfigure built-in logger and use it later inside my plugin to write to custom files.
12:36:29 DiscordBot <f​ra​me​sh​if​t> I also tried to include Log4j2 into my plugin with its own configuration but it still uses built-in config
12:36:34 DiscordBot <B​en​di​> how can i create a plugin that loads other plugins(like bukkits plugin loader)
12:36:51 DiscordBot <j​et​p2​50​> Why do you want to load other plugins?
12:37:29 DiscordBot <T​ri​ga​ry​> Skript masterrace!
12:37:32 DiscordBot <S​ys​te​m> what do you want to do exactly?
12:39:08 DiscordBot <f​ra​me​sh​if​t> Me?
12:39:11 DiscordBot <S​ys​te​m> yes
12:42:11 DiscordBot <f​ra​me​sh​if​t> I want to write multiple logs to my plugin's folder. Also I need to rotate them on daily basis. That's why I looked into logging libs instead of using standard Java IO for that
12:48:08 DiscordBot <S​ys​te​m> Good, you want to supply a custom Log4j2 configuration via the system property, then define new loggers as needed with additivity set to false and their relative appenders, which may be RollingRandomAccessFiles
12:50:38 DiscordBot <S​ys​te​m> You don't need/want to bundle Log4j2 with your plugin
12:51:07 DiscordBot <S​ys​te​m> -Dlog4j.configurationFile=log4j2.xml
12:53:04 DiscordBot <S​ys​te​m> private static final Logger logger = LogManager.getLogger("MyLogger");
12:54:34 DiscordBot <S​ys​te​m> xml <Loggers> <Logger name="MyLogger" additivity="false"> <AppenderRef ref="MyAppender"/> </... https://paste.gg/p/anonymous/caff673b4f2847f98d19c2556dd89d88
12:54:47 DiscordBot <f​ra​me​sh​if​t> So basically I should overwrite default log4j2 config and add my own loggers here?
12:54:48 DiscordBot <f​ra​me​sh​if​t> Thanks for examples
12:55:47 DiscordBot <f​ra​me​sh​if​t> But actually it means that if my plugin uses it like that then I need to manually change 'global' log4j2 config
12:55:48 DiscordBot <f​ra​me​sh​if​t> I guess I can try to add new loggers programmatically
12:57:49 DiscordBot <S​ys​te​m> Yes, if you are making a public plugin, you should try to do that programmatically
12:59:59 DiscordBot <o​kd​ud​e> i have no idea what to put for entity metadata, its asking for variables and datawatcher?? https://media.discordapp.net/attachments/555462289851940864/670613837057097738/unknown.png
13:00:08 DiscordBot <o​kd​ud​e> wait
13:02:02 DiscordBot <o​kd​ud​e> okay im confused as to what to put in this PacketPlayOutEntityMetadata constructor https://media.discordapp.net/attachments/555462289851940864/670614350213545997/unknown.png
13:04:51 DiscordBot <o​kd​ud​e> yay i got it to work: java PacketPlayOutEntityMetadata packet2 = new PacketPlayOutEntityMetadata(sta... https://paste.gg/p/anonymous/0f9204087cbb456696edde6195869333
13:10:03 <-- Streamfrost (Streamfrost!~Spottedleaf@SpigotMC-7vbihe.ipv6.telus.net) has quit (Connection closed)
13:30:27 DiscordBot <T​HA​NK​ Y​OU​> how can i call craftbukkit's main from external jar? i can't figure out how i can spec arguments
13:31:06 DiscordBot <e​le​ct​ro​ni​cc​at​> it's a method? You call it like any other method?
13:31:13 DiscordBot <e​le​ct​ro​ni​cc​at​> if you mean things like Xmx, that won't work
13:32:54 DiscordBot <o​kd​ud​e> i spawned this item packet and it shows up fine but it floats away how do i stop it from doing that lol https://media.discordapp.net/attachments/555462289851940864/670622112653901854/unknown.png
13:44:21 DiscordBot <T​he​Vi​pe​rS​ho​w> I've found a way to reduce 9 lines of code to 1
13:44:24 DiscordBot <T​he​Vi​pe​rS​ho​w> damn so cool
13:45:02 DiscordBot <T​he​Vi​pe​rS​ho​w> java Bukkit.getScheduler().runTaskLater(QuietChat.plugin, () -> messages.forEach((String s) -> Strin... https://paste.gg/p/anonymous/2b0fff32b99f4ca3b9541110855d5cfe
13:45:19 DiscordBot <o​kd​ud​e> ok
13:46:55 DiscordBot <T​HA​NK​ Y​OU​> @electroniccat not intended spec xmx, i know that its java command not craftbukkit's main argument
13:46:57 DiscordBot <T​HA​NK​ Y​OU​> im trying to call main in MinecraftServer.main(String[]); https://media.discordapp.net/attachments/555462289851940864/670625649701945364/unknown.png
13:47:13 DiscordBot <e​le​ct​ro​ni​cc​at​> Please don't ping
13:47:16 DiscordBot <T​HA​NK​ Y​OU​> sry
13:47:24 DiscordBot <e​le​ct​ro​ni​cc​at​> it's a string array
13:47:31 DiscordBot <e​le​ct​ro​ni​cc​at​> if you wanna pass args, throw them in an array
13:47:39 DiscordBot <T​HA​NK​ Y​OU​> lmao
13:48:03 DiscordBot <T​HA​NK​ Y​OU​> i was trying call main(OptionSet) :c
13:48:05 DiscordBot <T​HA​NK​ Y​OU​> anyway, thank you!
13:49:57 DiscordBot <T​HA​NK​ Y​OU​> misreading with MinecraftServer https://cdn.discordapp.com/emojis/522231526570852370.png
13:52:27 frostalf @okdude it looks like it might be floating away because you gave it no gravity
14:05:58 DiscordBot <o​kd​ud​e> frostaf if i give it gravity it falls down
14:06:04 DiscordBot <o​kd​ud​e> i want it to be frozen in the air
14:30:56 frostalf looks like you are going to have to trick the server into thinking its on the ground @okdude
14:32:34 frostalf actually onGround boolean is public, so just set that to true and it should cause the server to not move it....hopefully
14:33:36 KennyTV set 0 0 0 velocity
14:34:24 frostalf already is in there, under item.setMot
14:34:34 DiscordBot <T​he​Vi​pe​rS​ho​w> Hi KennyTV
14:34:41 frostalf but it keeps floating away because of the no gravity and the item isn't on the ground
14:35:28 KennyTV the server won't be doing anything with it, "nogravity" just means the velocity isn't changed
14:35:32 frostalf the only other way I could think of doing it, is to give it motion upwards equal to the gravity on it
14:35:38 KennyTV might be that the client just makes the item pop up on spawn in general
14:35:47 KennyTV so you'd need to send a separate velocity packet right after spawning
14:37:54 KennyTV yep, found a place where we have to do the same: spawn and then set 0 velocity https://i.imgur.com/LHmGvQg.png
14:43:12 KennyTV ^... because this is done in the client https://i.imgur.com/QXA9NFg.png
14:49:28 DiscordBot <E​du​du​Ga​me​r> https://wiki.citizensnpcs.co/Plugin_Conflict
14:49:29 DiscordBot <E​du​du​Ga​me​r> Plugin Conflict
14:49:30 DiscordBot <E​du​du​Ga​me​r> i need to solve this plugin conflict, but i don´t know how solve
14:49:31 DiscordBot <E​du​du​Ga​me​r> its a plugin conflict with scoreboards
14:50:01 DiscordBot <E​du​du​Ga​me​r> anyone can help me?
14:54:15 DiscordBot <o​kd​ud​e> i fixed it PacketPlayOutEntityVelocity packet3 = new PacketPlayOutEntityVelocity(item.getId(),new Ve... https://paste.gg/p/anonymous/523b56185c1f46969e449320d802ddd9
15:01:02 KennyTV how about you ask on the citizens discord? :aaa:
15:01:19 DiscordBot <T​he​Vi​pe​rS​ho​w> hi Kennyyyyyyyyy
15:01:58 KennyTV hai
15:02:43 DiscordBot <T​he​Vi​pe​rS​ho​w> can you give me an opinion?
15:03:06 KennyTV I don't have opinions, I have objective facts and logic
15:03:21 DiscordBot <T​he​Vi​pe​rS​ho​w> the code above is the improved version of the commented one, do you think its better to do it that way? https://media.discordapp.net/attachments/555462289851940864/670644884566441994/unknown.png
15:05:16 KennyTV hmm usually if normal for loops > streams/foreach. and if you have a condition to be met for 100% of the following code to be executed, returning early makes the code look nicer
15:05:47 DiscordBot <T​he​Vi​pe​rS​ho​w> ok ill remember this
15:05:54 KennyTV so instead of
15:05:55 KennyTV }
15:05:55 KennyTV you do
15:05:55 KennyTV if (!"".equals("") {
15:05:55 KennyTV continue
15:05:55 KennyTV }
15:05:55 KennyTV if ("".equals("")) {
15:06:08 KennyTV and then the rest of the code below that
15:06:34 KennyTV and again, you should load out your config values into fields somewhere, so that you don't have to do the map/config lookups everytime :p
15:06:51 DiscordBot <T​he​Vi​pe​rS​ho​w> yeah i know i'll prob make an hashMap ?
15:06:57 KennyTV nope
15:07:03 DiscordBot <s​te​fv​an​sc​hi​e> YamlConfiguration internally already uses a HashMap
15:07:12 KennyTV make an object called ConfigValues, Settings, or whatever you want, that just contains the hard fields
15:07:32 KennyTV so an object having the List<String>, ints, booleans, Sound, as proper fields
15:07:40 DiscordBot <T​he​Vi​pe​rS​ho​w> I had some hard times doing reload when I saved values tho
15:08:00 KennyTV make a load method you call to .. load those values
15:08:18 DiscordBot <T​he​Vi​pe​rS​ho​w> ok
15:08:19 KennyTV then if you have a reload command or whatever, you reload the file and call the load method
15:08:33 DiscordBot <T​he​Vi​pe​rS​ho​w> ❤️
15:09:36 frostalf just keep in mind that just because the code looks nicer, doesn't it mean its the best way either ;)
15:12:02 KennyTV (btw you can also just put those fields into your main class or whatever, I personally just have an extra one called Settings specifically to hold my config values)
15:53:43 DiscordBot <A​sV​ai​da​s>  Damageable item = (Damageable) e.getItem().getItemMeta(); item.setD... https://paste.gg/p/anonymous/f7ed96c145c54bfb9aa424f2cbc0ace5
15:53:44 DiscordBot <A​sV​ai​da​s> 
15:58:05 DiscordBot <T​he​Vi​pe​rS​ho​w> which limit?
16:04:45 DiscordBot <A​sV​ai​da​s> Something wrong, yea?
16:08:19 DiscordBot <T​he​Vi​pe​rS​ho​w> if(ItemStack#getMaxItemUseDuration() >0)
16:08:35 DiscordBot <T​he​Vi​pe​rS​ho​w> that should return durability if im correct
16:12:07 DiscordBot <T​he​Vi​pe​rS​ho​w> not 100% sure but this? https://papermc.io/javadocs/paper/1.13/org/bukkit/inventory/ItemStack.html#getMaxItemUseDuration--
17:08:02 DiscordBot <T​he​Vi​pe​rS​ho​w> Guys i'm having a small issue
17:10:36 DiscordBot <T​he​Vi​pe​rS​ho​w> Guys I have a small issue, basically im trying to get if someone is standing still using:
17:10:38 DiscordBot <T​he​Vi​pe​rS​ho​w> float speed = player.getWalkSpeed();
17:10:39 DiscordBot <T​he​Vi​pe​rS​ho​w> but when standing still speed != 0
17:12:25 DiscordBot <w​iz​ja​ny​> walk speed is their walking speed
17:12:29 DiscordBot <w​iz​ja​ny​> not their current velocity
17:12:38 DiscordBot <T​he​Vi​pe​rS​ho​w> so i get Velocity Vector
17:12:40 DiscordBot <T​he​Vi​pe​rS​ho​w> im idiot xd
17:24:07 DiscordBot <T​he​Vi​pe​rS​ho​w> there's a thing im not understanding about the vector...
17:25:00 DiscordBot <T​he​Vi​pe​rS​ho​w> why if I walk X and Z do not change? https://media.discordapp.net/attachments/555462289851940864/670680531037323264/unknown.png
17:25:43 KennyTV code?
17:26:56 DiscordBot <T​he​Vi​pe​rS​ho​w> > > > Bukkit.broadcastMessage(String.valueOf(player.getVelocity()));
17:28:53 DiscordBot <T​he​Vi​pe​rS​ho​w> this is inside a runnable that runs about 5 times per sec
17:31:51 DiscordBot <K​en​ny​TV​> full code block plz
17:32:17 DiscordBot <w​iz​ja​ny​> why would they change
17:32:29 DiscordBot <w​iz​ja​ny​> velocity is change in position
17:32:41 DiscordBot <w​iz​ja​ny​> if you move at a constant rate your velocity should be constant
17:32:47 DiscordBot <T​he​Vi​pe​rS​ho​w> https://paste.gg/p/thevipershow/6eb6ac6a2132445a8714e657f5667702
17:32:48 DiscordBot <T​he​Vi​pe​rS​ho​w> if u really need it Kenny
17:33:11 DiscordBot <T​he​Vi​pe​rS​ho​w> so how can i check if someone is not moving?
17:33:38 DiscordBot <T​he​Vi​pe​rS​ho​w> there's no methods from Spigot/Bukkit/Paper? I'll have to make my own then
17:33:49 DiscordBot <w​iz​ja​ny​> ?????
17:34:01 DiscordBot <w​iz​ja​ny​> what the fuck are you smoking
17:36:02 DiscordBot <T​he​Vi​pe​rS​ho​w> wdym
17:37:39 DiscordBot <T​ri​ga​ry​> that you are high
17:42:22 DiscordBot <S​we​dz​> Will Player#eject() call VehicleExitEvent, and then also be cancelled if the event was cancelled? Also, will calling Entity#remove() on the vehicle of a player cause issues before the player has dismounted it?
17:43:56 DiscordBot <l​im​a> TheViperShow, it is common sense that if something is not moving, its velocity is 0 in all directions
17:44:35 DiscordBot <S​we​dz​> However that is not how things seem to work in minecraft. Velocity, when not moving, at least the y value approximates to -0.08 if I recall correctly.
17:45:11 DiscordBot <S​we​dz​> I think the X/Z values do work in some cases, but I'm iffy on that.
17:46:00 DiscordBot <S​we​dz​> I believe the Y val for velocity is -0.08 because that is what the downward velocity of gravity is.
17:46:21 DiscordBot <S​we​dz​> It's some long decimal that I could not possibly remember, but rounding to two decimals gives -0.08
17:47:26 DiscordBot <l​im​a> Gravity does not have a velocity, but I get what you mean. Yeah, that's probably it
17:47:44 DiscordBot <S​we​dz​> I mean the force of gravity equated out to the velocity of the object
17:48:24 KennyTV will y then be 0 if the player is flying (and not moving)?
17:48:27 KennyTV :thonk:
17:48:34 DiscordBot <S​we​dz​> I don't think so
17:48:57 DiscordBot <S​we​dz​> It keeps subtracting to it as time goes on and maxes out at some point (iirc)
17:49:09 KennyTV flying, not falling
17:49:12 DiscordBot <S​we​dz​> Yep
17:49:18 DiscordBot <S​we​dz​> I know
17:49:23 DiscordBot <S​we​dz​> Flying does it I'm pretty sure
17:49:41 DiscordBot <S​we​dz​> It recognizes flying as falling (at least in 1.8, which was the last time I messed with velocity)
17:49:53 KennyTV :outdated:
17:49:55 DiscordBot <S​we​dz​> Yes
17:50:12 DiscordBot <S​we​dz​> I don't use 1.15, just saying last time I used velocity, which I presume it hasn't changed, this is what it did
17:51:24 DiscordBot <S​we​dz​> lima: The velocity equation for gravity is g * t where t is time and g is the force of gravity (-9.81m/s^2 on earth). Which is what I was referring to, just in minecraftian terms instead.
17:52:00 KennyTV flying does indeed give you 0 y velocity
17:52:04 DiscordBot <l​im​a> It is actually g * t^2
17:52:05 KennyTV everything wouldn't make sense anyways
17:52:09 KennyTV anything else*
17:52:11 DiscordBot <T​he​Vi​pe​rS​ho​w> i cant find a decent way to get if someone is not moving..
17:52:30 DiscordBot <S​we​dz​> Y velocity = -0.08 and x = 0 and z = 0
17:52:32 DiscordBot <S​we​dz​> ^
17:52:54 DiscordBot <S​we​dz​> be careful using isOnGround though, because that is defined by the player in move packets
17:52:58 DiscordBot <S​we​dz​> so it can be spoofed
17:53:30 DiscordBot <S​am​B4​40​> I added the patched jar to le gradle but I no longer seem to have paper-specific things?
17:53:31 DiscordBot <T​he​Vi​pe​rS​ho​w> isOnGround doesen't return if someone is moving or not
17:53:34 DiscordBot <T​he​Vi​pe​rS​ho​w> someone could be just walking
17:53:52 DiscordBot <S​we​dz​> https://wiki.vg/Protocol#Entity_Relative_Move
17:53:55 DiscordBot <S​we​dz​> Don't use isOnGround
17:53:57 DiscordBot <S​we​dz​> It can be spoofed
17:54:01 DiscordBot <S​we​dz​> Unless you don't care about cheaters
17:54:06 DiscordBot <T​he​Vi​pe​rS​ho​w> im not making an anticheat
17:54:07 DiscordBot <S​we​dz​> And again, like I said
17:54:11 DiscordBot <S​we​dz​> Y velocity = -0.08 and x = 0 and z = 0
17:54:17 KennyTV don't check y against an arbitrary float
17:54:19 KennyTV that's stupid
17:54:23 DiscordBot <S​we​dz​> obviously
17:54:26 DiscordBot <S​we​dz​> round it first 😉
17:54:28 DiscordBot <T​he​Vi​pe​rS​ho​w> that would not work,
17:54:51 KennyTV it would work most of the time, but it's stupid
17:54:58 DiscordBot <S​we​dz​> It would work all of the time.
17:55:02 KennyTV no
17:55:12 KennyTV if you start falling and round, it's still ~-0.8
17:55:34 KennyTV just don't
17:55:35 DiscordBot <S​we​dz​> Falling is never equal to -0.08, unless it was literally the first tick.
17:55:47 DiscordBot <S​we​dz​> Only case it wouldn't recognize movement is if you are flying
17:55:58 KennyTV ...
17:56:16 DiscordBot <S​am​B4​40​> okay what fuck decided to put bukkit shaded into worldguard
17:56:25 DiscordBot <w​iz​ja​ny​> wut
17:56:35 DiscordBot <S​we​dz​> Lol
17:56:44 DiscordBot <w​iz​ja​ny​> r u retarded
17:56:46 DiscordBot <T​he​Vi​pe​rS​ho​w> dude im walking and these values DO NOT change https://media.discordapp.net/attachments/555462289851940864/670688525271826472/unknown.png
17:56:48 DiscordBot <S​am​B4​40​> when I have worldguard in my gradle, I cannot use paper methods
17:56:53 DiscordBot <S​am​B4​40​> and it has under it "bukkit"
17:56:54 KennyTV viper
17:56:58 KennyTV check against x and z if on ground
17:56:59 DiscordBot <S​am​B4​40​> and when I remove it, everything works fine
17:57:06 KennyTV if not on ground, go figure
17:57:06 DiscordBot <T​he​Vi​pe​rS​ho​w> ok
17:57:13 DiscordBot <w​iz​ja​ny​> worldguard exposes bukkit
17:57:18 DiscordBot <w​iz​ja​ny​> just move paper higher up in your deps
17:57:27 DiscordBot <w​iz​ja​ny​> it's not shading
17:57:30 DiscordBot <S​am​B4​40​> it's at the top
17:57:32 DiscordBot <w​iz​ja​ny​> that's how maven dependency resolution works
17:57:35 DiscordBot <l​im​a> Yeah, I am getting rhe same results as TheViperShow
17:57:43 KennyTV I need to exclude bukkit from we too btw
17:57:46 DiscordBot <w​iz​ja​ny​> are you including transitive deps?
17:57:49 DiscordBot <S​we​dz​> Yeah like I thought X/Z doesn't get changed by player movement.
17:57:55 DiscordBot <S​we​dz​> velocity, that is
17:57:58 DiscordBot <w​iz​ja​ny​> like, the -bukkit artifacts use bukkit types
17:58:03 DiscordBot <w​iz​ja​ny​> so they have to say that they depend on bukkit api
17:58:11 DiscordBot <w​iz​ja​ny​> just includeTransitive = false
17:58:20 DiscordBot <S​am​B4​40​> i'm using local patched jar from paper cache
17:58:57 DiscordBot <w​iz​ja​ny​> i mean, don't do that either
17:58:58 DiscordBot <S​we​dz​> You're going to have to check player move events and just check if they moved from a location not equal to the current location.
17:59:03 DiscordBot <S​am​B4​40​> I need NMS
17:59:12 DiscordBot <w​iz​ja​ny​> right, but use maven...
17:59:19 DiscordBot <S​am​B4​40​> I'm using gradle
17:59:22 DiscordBot <w​iz​ja​ny​> when you run paper j it installs to local repo
17:59:25 DiscordBot <w​iz​ja​ny​> don't depend on jars
17:59:35 DiscordBot <T​he​Vi​pe​rS​ho​w> yeah i know that , i was if there was a simpler way. Sadly not
17:59:53 DiscordBot <S​am​B4​40​> wut
18:00:27 DiscordBot <S​am​B4​40​> i ran the server and put the patched_1.15.2 jar from cache folder into a libraries folder in my project for gradle
18:00:35 DiscordBot <w​iz​ja​ny​> sigh
18:01:07 DiscordBot <l​im​a> Player velocity seems to bugged :o
18:01:09 DiscordBot <J​Ro​y> paper-dev has been extra cancer today
18:01:18 DiscordBot <T​he​Vi​pe​rS​ho​w> yeah Velocity has never worked correctly for me...
18:01:52 DiscordBot <S​we​dz​> lima: It is not bugged. X/Z velocity is only used client side. X/Z velocity is used for elytra flying, slime block bouncing, and custom setVelocity calls on the entity.
18:02:27 DiscordBot <S​we​dz​> I wish they were synchronized together, but it is what it is
18:02:34 DiscordBot <S​we​dz​> Client just doesn't send that data
18:03:56 DiscordBot <l​im​a> Slime block bouncing is not included in those
18:04:01 DiscordBot <l​im​a> Just tested it
18:04:10 DiscordBot <S​we​dz​> I'm talking slime block bouncing horizontally.
18:04:13 DiscordBot <T​he​Vi​pe​rS​ho​w> excuse me, why would someone location be null https://media.discordapp.net/attachments/555462289851940864/670690400050216970/unknown.png
18:04:14 DiscordBot <D​ef​in​e ​Ou​ts​id​e> You have to multiply the double by 8000 before sending velocity to the client, check the wiki.
18:04:29 DiscordBot <S​we​dz​> LOL
18:04:38 DiscordBot <S​we​dz​> Literally what
18:04:53 DiscordBot <S​we​dz​> Dunno where the troll came from but whatever lmfao
18:05:28 DiscordBot <T​he​Vi​pe​rS​ho​w> multiply *8000?
18:05:32 DiscordBot <S​we​dz​> No
18:05:36 DiscordBot <S​we​dz​> They are trolling lmfao
18:05:37 DiscordBot <D​ef​in​e ​Ou​ts​id​e> If you are using packets.
18:06:09 DiscordBot <D​ef​in​e ​Ou​ts​id​e> At least with protocollib
18:06:16 DiscordBot <T​he​Vi​pe​rS​ho​w> no im not using Packets. anyway I've abandoned the Velocity and i'll just use PlayerMoveEvent and HashMaps
18:06:28 DiscordBot <S​we​dz​> You don't multiply by 8000 on velocity in packets even
18:06:45 DiscordBot <S​we​dz​> I don't even know where this baffoonery is coming from.
18:07:11 DiscordBot <S​we​dz​> I believe its 128?
18:07:14 DiscordBot <S​we​dz​> Could be wrong
18:07:44 DiscordBot <S​am​B4​40​> ok fuck gradle
18:09:45 DiscordBot <D​ef​in​e ​Ou​ts​id​e> “Velocity is believed to be in units of 1/8000 of a block per server tick” -Protocol wiki
18:10:51 DiscordBot <D​ef​in​e ​Ou​ts​id​e> Server velocity doesn’t matter much, except for maybe anticheat stuff.
18:12:28 DiscordBot <S​we​dz​> Tf?
18:12:32 DiscordBot <S​we​dz​> Coulda sworn it was 128
18:12:55 DiscordBot <D​ef​in​e ​Ou​ts​id​e> Nope, I’ve been having fun with velocity for the past two days, with PvP knockback.
18:14:00 DiscordBot <D​ef​in​e ​Ou​ts​id​e> I might have to use move event and hashmaps also.
18:15:20 DiscordBot <S​we​dz​> Server velocity is pretty useful, especially the Y value. At least for anticheats, like you said.
18:16:12 DiscordBot <S​we​dz​> I always used a custom on ground method simply checking if the player's y velocity was (rounded to 2 points) equaled -0.08
18:16:29 DiscordBot <S​we​dz​> Really useful for catching onGround spoofing as well as validing actual on ground states
18:22:21 DiscordBot <P​as​ca​l> I want to check whether a certain block can connect to a fence. For example, glass blocks cannot connect to fences, but stone blocks can. Is there an easy way to do this?
18:22:55 DiscordBot <S​we​dz​> Grass blocks can connect to fences
18:23:28 DiscordBot <S​we​dz​> However it cannot connect to grass
18:23:39 DiscordBot <B​il​ly​> @Pascal block.getType().isSolid()?
18:23:43 DiscordBot <S​we​dz​> I would just say whether it is opaque or not
18:23:53 DiscordBot <B​il​ly​> not sure how well that API aligns with NMS' "isSolid"
18:24:51 DiscordBot <S​we​dz​> I think isSolid() would do it...
18:25:01 DiscordBot <S​we​dz​> Docs say that it just checks if the block can be placed upon
18:25:18 DiscordBot <S​we​dz​> That wouldn't work
18:25:22 DiscordBot <S​we​dz​> Since chests can be placed on
18:25:26 DiscordBot <S​we​dz​> But fences dont connect to chests
18:25:29 DiscordBot <B​il​ly​> chests arent blocks
18:25:37 DiscordBot <w​iz​ja​ny​> i mean, they ar
18:25:41 DiscordBot <S​we​dz​> They are??
18:25:46 DiscordBot <P​as​ca​l> I tried isSolid glass blocks are consired as solid too
18:25:47 DiscordBot <w​iz​ja​ny​> just because they are also blockentities...
18:25:51 DiscordBot <B​il​ly​> chests are tileentities
18:25:52 DiscordBot <w​iz​ja​ny​> doesn't make them not blocks
18:25:58 DiscordBot <S​we​dz​> Fences connect to glass blocks, Pascal
18:26:47 DiscordBot <B​il​ly​> glass is a solid block
18:26:49 DiscordBot <S​we​dz​> Yes
18:26:54 DiscordBot <S​we​dz​> That is what was just said
18:28:39 DiscordBot <S​we​dz​> I think isSolid will be true for leaves, however fences do not connect to them
18:28:51 DiscordBot <B​il​ly​> dont think. check
18:28:53 DiscordBot <P​as​ca​l> And trapdoor for example
18:29:00 DiscordBot <B​il​ly​> isSolid is just a switch in the Material class
18:29:08 DiscordBot <S​we​dz​> Yep
18:30:25 DiscordBot <B​il​ly​> looks like NMS is calling your name
18:35:58 DiscordBot <T​he​Vi​pe​rS​ho​w> should i use RunTaskTimer if I want to run a Runnable every X seconds?
18:36:32 DiscordBot <S​we​dz​> Probably
18:36:47 DiscordBot <S​we​dz​> I'd use BukkitRunnable, though.
18:37:20 DiscordBot <T​he​Vi​pe​rS​ho​w> ehm runTaskTimer() is from BukkitScheduler
18:39:49 DiscordBot <S​we​dz​> They both have that method.
18:40:09 DiscordBot <S​we​dz​> Before you say it, no, BukkitRunnable doesn't implement BukkitSchedule
18:44:13 DiscordBot <A​ai​ma​l> Fence connects to all blocks which are full blocks and fills the entire parameter of one block space, it doesn’t connect to blocks which only fills half that block space
18:45:45 DiscordBot <B​il​ly​> not entirely true @Aaimal look at leaves
18:46:20 DiscordBot <P​as​ca​l> Billy, I have never used NMS before. Where do I start?
18:46:22 DiscordBot <B​il​ly​> leaves are not a solid block according to nms, but to the bukkit api they are. thats why this becomes so difficult
18:46:46 DiscordBot <A​ai​ma​l> Oh
18:46:54 DiscordBot <S​we​dz​> Leaves fill the entire perimeter of a block space.
18:47:06 DiscordBot <A​ai​ma​l> Yeah
18:47:08 DiscordBot <S​we​dz​> Just as Aaimal said.
18:47:26 DiscordBot <A​ai​ma​l> U learn every day 🙂
18:47:30 DiscordBot <S​we​dz​> One solution to this question regarding fences, is to check the BoundingBox of a block and if it equals a certain type.
18:47:47 DiscordBot <S​we​dz​> X, Y, Z = 1, 1, 1? I think
18:48:13 DiscordBot <S​we​dz​> widthX, widthY, widthZ should all be 1 for a full block
18:54:49 DiscordBot <B​il​ly​> java Block bukkitBlock; // some Bukkit Block gotten from somewhere BlockData bukkit... https://paste.gg/p/anonymous/9e64b83ad424477cbcc43a31ef05a49c
18:59:08 DiscordBot <a​ec​so​ck​et​> can I damage an entity for a specific amount, without taking into consideration armor?
18:59:24 DiscordBot <B​il​ly​> setHealth()
18:59:47 DiscordBot <a​ec​so​ck​et​> that doesn't show the damage flash
19:01:34 DiscordBot <P​as​ca​l> Billy, that code block still returns true for leaves
19:01:48 DiscordBot <B​il​ly​> interesting
19:02:36 DiscordBot <S​we​dz​> Theres two ways to do that that I can think of, aecsocket
19:02:44 DiscordBot <a​ec​so​ck​et​> I'm listening
19:02:52 DiscordBot <a​ec​so​ck​et​> I tried running an event, it doesn't change the health
19:03:24 DiscordBot <S​we​dz​> Either do some stupid ass math that accounts for the armor the player is wearing (unpreferrable)
19:03:36 DiscordBot <S​we​dz​> or just do setHealth() and send a damage animation packet
19:03:41 DiscordBot <S​we​dz​> actually
19:03:47 DiscordBot <S​we​dz​> I think you can do setHealth
19:03:50 DiscordBot <S​we​dz​> and then damage for 0 points
19:03:52 DiscordBot <S​we​dz​> and that would work?
19:04:02 DiscordBot <a​ec​so​ck​et​> trying it
19:04:41 DiscordBot <a​ec​so​ck​et​> Okay
19:04:43 DiscordBot <a​ec​so​ck​et​> yeah, it works fine
19:04:48 DiscordBot <S​we​dz​> lol 👍
19:04:51 DiscordBot <a​ec​so​ck​et​> No knockback but I'll just sell it as a feature ;)
19:05:26 DiscordBot <S​we​dz​> you can always simulate knockback using setVelocity
19:05:33 DiscordBot <a​ec​so​ck​et​> I don't need to
19:05:37 DiscordBot <S​we​dz​> Then don't 😉
19:11:49 DiscordBot <B​il​ly​> @Pascal there seems to be a special casing of indivisual blocks in nms. its not just checking if solid
19:11:51 DiscordBot <B​il​ly​> fun stuff
19:12:01 DiscordBot <B​il​ly​> java public static boolean a(Block block) { return block instanceof BlockLeaves || block... https://paste.gg/p/anonymous/1ffa8518ffa94cc6b92a6b6d826b0969
19:12:41 DiscordBot <B​il​ly​> that's checked in the BlockFence class on line 28
19:19:27 DiscordBot <a​ec​so​ck​et​> is there a way to determine which BlockFace a dispenser dispenses out of?
19:19:53 DiscordBot <T​he​Vi​pe​rS​ho​w> I think you can get the orientation of the Block or something
19:22:22 DiscordBot <a​ec​so​ck​et​> I want to get the location an item spawns in when fired from a dispenser
19:22:34 DiscordBot <j​et​p2​50​> I've figured you definitely won't care, @Swedz, but a heads up, you managed to give a pretty bad fir... https://paste.gg/p/anonymous/f9b0de9675874b9c9f5d89dcd2bfb6ee https://media.discordapp.net/attachments/555462289851940864/670710112465453066/unknown.png
19:25:01 DiscordBot <j​et​p2​50​> I mean that was very far from the worst reaction but still unnecessarily exaggerated assumption that they were a troll :^)
19:29:26 DiscordBot <P​as​ca​l> Billy, what is that code that you sent? Are that the blocks that are considered as solid or?
19:37:13 DiscordBot <B​il​ly​> Those are exceptions @Pascal that nothing will connect to
19:38:20 DiscordBot <S​we​dz​> @jetp250 Thank you this is very kind! Wholesome 1000
19:40:06 DiscordBot <P​as​ca​l> Billy, can you give me al link to where you found that?
19:40:22 DiscordBot <B​il​ly​> It's in nms
19:40:28 DiscordBot <B​il​ly​> In the Block class