Storage Network

Storage Network

340k Downloads

Client Crash: Cover Stick allows invalid items to be applied to covers

codewarrior0 opened this issue ยท 3 comments

commented

The Cover Stick can be used to apply items that aren't blocks to covers. For example, I used it to apply a Thaumometer to a cover, which changed it to look like a different metal block.

Even worse, I applied an Infernal Chalice (a Reliquary item that also isn't a block) to a cover, which immediately crashed me with a rendering error.

The cover previously looked like an EnderIO Alloy block. The crash details indicated that the cover was trying to render the same alloy block, only with a meta value that was out of bounds of the alloy block's allowed values.

Description: Rendering Block Entity

java.lang.ArrayIndexOutOfBoundsException: 8
    at crazypants.enderio.material.BlockIngotStorage.func_176203_a(BlockIngotStorage.java:63)
    at mrriegel.storagenetwork.render.CableRenderer.renderTileEntityAt(CableRenderer.java:52)
    at mrriegel.storagenetwork.render.CableRenderer.func_180535_a(CableRenderer.java:26)
    at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.func_178469_a(TileEntityRendererDispatcher.java:136)
    at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.func_180546_a(TileEntityRendererDispatcher.java:114)
    at net.minecraft.client.renderer.RenderGlobal.func_180446_a(RenderGlobal.java:678)
    at net.minecraft.client.renderer.EntityRenderer.func_175068_a(EntityRenderer.java:1316)
    at net.minecraft.client.renderer.EntityRenderer.func_78471_a(EntityRenderer.java:1230)
    at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1058)

Any player who came near this block had the same crash. We had to ask the server admin to remove the block using its coordinates.

commented

This looks like it is related to the "meta cycling" feature in the code block at ItemCoverStick.java:42

Steps to reproduce:

  • Place a cable
  • Put an EIO Soularium Block in the hotbar to the right of the cover stick
  • Apply a cover to the cable so it looks like Soularium Block
  • Remove the block from your hotbar so there is an empty slot to the right of the cover stick
  • Right-click the covered cable again with the cover stick
commented

I cannot reproduce the problem with the thaumometer. If I try to cover a cable with it, nothing happens (as expected).
And the ender IO blocks work fine too. I can cover the cables and nothing happens

commented

ok, fixed the EIO blocks.
but I cannot understand why the thaumometer 'works' as cover