MineMaarten / PneumaticCraft

PneumaticCraft source
Other
84 stars 50 forks source link

Persistently trying to put a puzzle piece where it shouldn't go lets you put it there #816

Closed Hexicube closed 8 years ago

Hexicube commented 8 years ago

Happens on V1.12.5-148, I think that's the latest version.

Trying to put pieces where they don't go (such as jump -> string -> I-export) causes any client that then views the programmer to immediately crash with a ClassCastException. The world is otherwise intact, you can remove the programmer and place it back to clear out the program and all is well.

In order to put a piece where it shouldn't be, you have to repeatedly attempt to put it in the exact location it would snap to, the first time I tried it moved off and the second time caused the issue. Alternatively, it could be a race condition, where the second time it tried to render before it was able to check it could go there.

Here's the error:

java.lang.ClassCastException: pneumaticCraft.common.progwidgets.ProgWidgetJump cannot be cast to pneumaticCraft.common.progwidgets.ProgWidgetString
    at pneumaticCraft.common.progwidgets.ProgWidgetConditionBase.getPossibleJumpLocations(ProgWidgetConditionBase.java:43)
    at pneumaticCraft.client.gui.GuiUnitProgrammer.showFlow(GuiUnitProgrammer.java:240)
    at pneumaticCraft.client.gui.GuiUnitProgrammer.render(GuiUnitProgrammer.java:164)
    at pneumaticCraft.client.gui.GuiProgrammer.func_146976_a(GuiProgrammer.java:340)
    at net.minecraft.client.gui.inventory.GuiContainer.func_73863_a(GuiContainer.java:78)
    at pneumaticCraft.client.gui.GuiPneumaticContainerBase.func_73863_a(GuiPneumaticContainerBase.java:262)
    at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1061)
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1001)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
MineMaarten commented 8 years ago

Fixed, for 1.8 only. For 1.7, just be... less persistent ;). Thanks for reporting anyways :)