Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with some techguns items: Client Crash #36

Open
TheSorrowX opened this issue Apr 17, 2020 · 4 comments
Open

Incompatible with some techguns items: Client Crash #36

TheSorrowX opened this issue Apr 17, 2020 · 4 comments

Comments

@TheSorrowX
Copy link

Client gets locked up and crashes when banning techgun Items. in particular, jetpacks. if the techguns jetpack is in the regular minecraft inventory it will lock fine, however if the jetpack is being worn in the techguns inventory the game crashes

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 net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) at net.minecraftforge.fml.common.FMLCommonHandler.onPlayerPostTick(FMLCommonHandler.java:370) at net.minecraft.entity.player.EntityPlayer.func_184808_cD(EntityPlayer.java:378) at net.minecraft.entity.player.EntityPlayer.func_70071_h_(EntityPlayer.java:288) at net.minecraft.client.entity.EntityPlayerSP.func_70071_h_(EntityPlayerSP.java:181) at micdoodle8.mods.galacticraft.core.entities.player.GCEntityClientPlayerMP.func_70071_h_(GCEntityClientPlayerMP.java:388) at net.minecraft.world.World.func_72866_a(World.java:1996) at net.minecraft.world.World.func_72870_g(World.java:1958) at net.minecraft.world.World.func_72939_s(World.java:1762) at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1847) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398) at net.minecraft.client.main.Main.main(SourceFile:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

@Claycorp
Copy link
Member

Looked at there code quick as I didn't understand why this would ever happen from the crash. Now I get why...
I assume they use some sort of limited slot as in you can't put anything but specific items but that doesn't stop the data for that slot from being changed outside of there control. They really shouldn't be assuming that there item will always be in that slot.

https://github.com/pWn3d1337/Techguns2/blob/4e26523cb0556ad56fefbee83c4df3fe94a426be/src/main/java/techguns/items/armors/GenericArmor.java#L340-L341

They don't check that the item there is valid before trying to cast it.

TechGuns needs to fix this, I'm not adding special cases. I'll leave this issue open till it's fixed.

@TheSorrowX
Copy link
Author

Yea after looking at the code it does seem to be problem with their side. Thank you for your replay, Ill see if tech guns can fix it, otherwise ill do it myself.

@TheSorrowX
Copy link
Author

Hi,
I have fixed the error in techguns and submitted a PR.

I am not sure if this should be in a new issue but is it possible to have the containerban happen when a player enters a dimension?

With the changes I made the container ban works. however, the item doesn't get banned until the user opens their inventory.
In my case, even if I ban the jetpack, it remains unlocked and usable in a banned dimension as long as the user does not open their inventory.

@Claycorp
Copy link
Member

Sorry for the late reply.

It already does dim switching bans it should be catching that. I assume that it's not technically part of the players inventory then as IIRC that's whats checked.
You could try enabling the aggressive ban mode to see if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants