Open Bluexin opened 5 years ago
pickblock event is client only and sends the stack directly to server side.
Yeah I know, problem is because we don't send unidentified item data to clients (to prevent hax), the data doesn't get cloned either.
I made pickblock event on server side only client can't hack the server's code and converted it to forge events found here and here: https://github.com/jredfox/evilnotchlib/blob/master/src/main/java/com/evilnotch/lib/asm/transformer/GeneralTransformer.java#L28 https://github.com/jredfox/evilnotchlib/blob/master/src/main/java/com/evilnotch/lib/main/eventhandler/PickBlock.java
However don't do what I did or our mods would remain.Is there a way multple overrides of pickblock event could exist?
I did this so silkspawners could properly fetch spawnpotentials while middle clicking a spawner block
Thanks. The server is already notified of the player using "pick block" in a gui though, so I'd rather hook into that directly, see https://github.com/Bluexin/BlueRPG/blob/9398970a2333a6d05481b711279ec58b936d926b/src/main/kotlin/be/bluexin/rpg/containers/RPGContainer.kt#L222-L239
But anyway, this is low priority compared to some other stuff on the roadmap.
For unidentified items.
Because cloning items happens on client, and server doesn't send the data about unidentified items for safety reasons.