pWn3d1337 / Techguns2

1.12 Port/Rewrite of Techguns mod for Minecraft. WIP
Other
77 stars 57 forks source link

Client crash when using blacklisted item from item blacklist mod #198

Open TheSorrowX opened 4 years ago

TheSorrowX commented 4 years ago

Techguns causes minecraft client to crash when a black listed item is equipped in the Techguns inventory.

java.lang.ClassCastException: net.doubledoordev.itemblacklist.util.ItemBlacklisted cannot be cast to techguns.api.tginventory.ITGSpecialSlot at techguns.items.armors.GenericArmor.getBonusForSlot(GenericArmor.java:341) at techguns.items.armors.GenericArmor.getArmorBonusForPlayer(GenericArmor.java:331) at techguns.events.TGTickHandler.onPlayerTick(TGTickHandler.java:301) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_480_TGTickHandler_onPlayerTick_PlayerTickEvent.invoke(.dynamic) at

pWn3d1337 commented 4 years ago

Why would non TG item even be equipped there? The slot is supposed to only allow items implementing ITGSpecialSlot

TheSorrowX commented 4 years ago

Why would non TG item even be equipped there? The slot is supposed to only allow items implementing ITGSpecialSlot

The item blacklist mod works by putting a blacklisted item inside an item container. this basically locks the item and prevents the user from interacting with the original item. The black list mod allows server admins to ban items in certain dimensions.

pWn3d1337 commented 4 years ago

Techguns expects an item to be ITGSpecialSlot, this could potentially cause problems at multiple locations in the code. I don't like adding a type check for something that is not even supposed to happen.