Chicken-Bones / ForgeMultipart

An API for dynamically handling different functional parts in the one block space.
Other
119 stars 56 forks source link

ArrayIndexOutOfBounds with cover (Inverted Lamp from ProjectedRed) on attempt to break. #406

Open winterroberts opened 6 years ago

winterroberts commented 6 years ago

Basically, you hit the microblock with anything and getStrength method of Microblock is called, as then is the getStrength method of BlockMicroMaterial which in turn calls player.getBreakSpeed (an internal Minecraft method). Several more steps down the track An ArrayIndexOutOfBounds Exception occurs looking for the element at index 16 which does not exist.

Here is a complete error stack trace as removed from the Minecraft crash-report: java.lang.ArrayIndexOutOfBoundsException: 16 at net.minecraft.block.Block.isToolEffective(Block.java:2226) at net.minecraftforge.common.ForgeHooks.isToolEffective(ForgeHooks.java:146) at net.minecraft.item.ItemTool.getDigSpeed(ItemTool.java:128) at net.minecraft.entity.player.EntityPlayer.getBreakSpeed(EntityPlayer.java:811) at codechicken.microblock.BlockMicroMaterial.getStrength(BlockMicroMaterial.scala:98) at codechicken.microblock.Microblock.getStrength(Microblock.scala:44) at codechicken.multipart.BlockMultipart.func_149737_a(BlockMultipart.scala:205) at net.minecraft.client.multiplayer.PlayerControllerMP.func_78743_b(PlayerControllerMP.java:177) at net.minecraft.client.Minecraft.func_147116_af(Minecraft.java:1409) at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1948) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:973) 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) 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 org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196) at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231) at org.multimc.EntryPoint.listen(EntryPoint.java:143) at org.multimc.EntryPoint.main(EntryPoint.java:34)

I wish I could blame ProjectRed but nothing is noted to have run through any of its classes.

winterroberts commented 6 years ago

To be clear: The error does not occur when the block is facing any other direction but 'down' as in placed from below a solid block.

Like: image

cheesealmighty commented 6 years ago

The same happened to me, but it was placed on a block (I don't think this is relevant).

Crash log is as follows: https://paste.ubuntu.com/p/KjppkNKvgB/