Crash with JEID when hitting/destroying a chisel block with the ID 4250
Xalcon opened this issue ยท 1 comments
Disclaimer: I dont know if this really is a chisel issue, so I've also opened an issue on the JEID issue tracker. DimensionalDevelopment/JustEnoughIDs#51
When you destroy a chisel block that has the internal block id of 4250, the game client will crash with the following stack trace:
java.lang.IllegalArgumentException: Cannot set property PropertyDirection{name=facing, clazz=class net.minecraft.util.EnumFacing, values=[down, north, south, west, east]} to up on block minecraft:hopper, it is not an allowed value
at net.minecraft.block.state.BlockStateContainer$StateImplementation.func_177226_a(BlockStateContainer.java:227)
at net.minecraft.block.BlockHopper.func_176203_a(SourceFile:188)
at net.minecraft.block.Block.func_176220_d(Block.java:2717)
at net.minecraft.client.particle.ParticleDigging$Factory.func_178902_a(SourceFile:105)
at net.minecraft.client.particle.ParticleManager.func_178927_a(ParticleManager.java:142)
at team.chisel.client.util.ClientUtil.addDestroyEffects(ClientUtil.java:95)
[...]
This is a rather rare bug since a few things need to align perfectly in order for this to happen.
In order to reproduce this, i had to write a small mod that registers 3950 blocks, just so chisel will definitely occupy the block id 4250.
The code for the mod (BlockIdEater) can be found here https://gist.github.com/Xalcon/542e5f1bc16921dfb46d408b1f63ee15
The interesting thing is: 4250 - 4096 = 154
154 is the BlockId of the minecraft hopper
Something that I found out though:
Chisels last method in the stack trace is ClientUtil.addDestroyEffects()
which retrieves a block ID via Block.getIdFromBlock()
. Afterwards it calls ParticleDigging.Factory#createParticle()
(indirectly via ParticleManager#spawnEffectParticle()
) which in turn uses this ID with Block.getStateById()
. At this point, it seems JEID returns the hopper block state but with an invalid meta value. I'm not sure if this is a bug with JEID or if chisel should actually use Block#getStateId()
instead of Block.getIdFromBlock()
.
Used Mods:
| State | ID | Version | Source | Signature |
|:------ |:------------ |:----------------- |:----------------------------- |:---------------------------------------- |
| LCHIJA | minecraft | 1.12.2 | minecraft.jar | None |
| LCHIJA | mcp | 9.42 | minecraft.jar | None |
| LCHIJA | FML | 8.0.99.99 | forge-1.12.2-14.23.5.2805.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 |
| LCHIJA | forge | 14.23.5.2805 | forge-1.12.2-14.23.5.2805.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 |
| LCHIJA | blockideater | 1.0 | blockideater-1.0.jar | None |
| LCHIJA | ctm | MC1.12.2-0.3.3.22 | CTM-MC1.12.2-0.3.3.22.jar | None |
| LCHIJA | chisel | MC1.12.2-0.2.1.35 | Chisel-MC1.12.2-0.2.1.35.jar | None |
| LCHIJA | jeid | 1.0.2-26 | JustEnoughIDs-1.0.2-26.jar | None |
How to reproduce:
- Install the mods listed above (the code for the block id eater mod can be found here)
- Make sure the block Id eater mod is loaded first so it can occupy all the IDs in range up to 4050~
- Create a new world and place the block that occupies the block id 4250. In my case this was chisel:block_coal2 (either Block of Coal (Raw) or Block of Coal (Cuts)). I've used NBTExplorer to look for the block id 4250 to get the right block.
- Destroy the block
- ....
Profitcrash.