Bluexin / BlueRPG

WIP
GNU General Public License v3.0
2 stars 2 forks source link

"Pick block" to copy items doesn't copy stats #59

Open Bluexin opened 5 years ago

Bluexin commented 5 years ago

For unidentified items.

Because cloning items happens on client, and server doesn't send the data about unidentified items for safety reasons.

jredfox commented 5 years ago

pickblock event is client only and sends the stack directly to server side.

Bluexin commented 5 years ago

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.

jredfox commented 5 years ago

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

Bluexin commented 5 years ago

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

Bluexin commented 5 years ago

But anyway, this is low priority compared to some other stuff on the roadmap.