BuiltBrokenModding / MilitaryBaseDecor

Military Style blocks, and tiles to create themed bases
MIT License
8 stars 6 forks source link

Server crashes when using wire cutters #20

Closed Hennamann closed 7 years ago

Hennamann commented 7 years ago

Upon using wire cutters on any type of wired fence in survival, the server crashes with a nosuchmethoderror. Probably due to a reference to non-server code.

Notably the crash does not occur in creative mode.

DarkGuardsman commented 7 years ago

Crash would be useful but your most likely right.

Hennamann commented 7 years ago

https://gist.github.com/Hennamann/c13151ec76aed78c6f2f1adf0fcc2d9a

DarkGuardsman commented 7 years ago

Block.getItem(World, int, int, int) is a client side only method

https://github.com/BuiltBrokenModding/MilitaryBaseDecor/blob/master/src/main/java/com/builtbroken/militarybasedecor/modules/worldwar1/content/block/BlockWireFence.java#L94

Hennamann commented 7 years ago

Yup noticed that as well, changing it to Item.getitemfromblock instead, just need to work metadata into it.

DarkGuardsman commented 7 years ago

no, just pass in 'this'. The ItemStack constructor can take a block as a param.

Hennamann commented 7 years ago

That's true, I'll test it and then commit the changes