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

Division by Zero when trying to access storage crate #262

Open
MPoppinga opened this issue Nov 21, 2014 · 4 comments
Open

Division by Zero when trying to access storage crate #262

MPoppinga opened this issue Nov 21, 2014 · 4 comments

Comments

@MPoppinga
Copy link

Hello,
when I try to access a specific storage crate I get an internal Server Error:

java.lang.ArithmeticException: / by zero
at net.mcft.copy.betterstorage.container.ContainerCrate.(ContainerCrate.java:27) ~[ContainerCrate.class:?]
at net.mcft.copy.betterstorage.tile.crate.TileEntityCrate.createContainer(TileEntityCrate.java:213) ~[TileEntityCrate.class:?]
at net.mcft.copy.betterstorage.tile.crate.TileEntityCrate.openGui(TileEntityCrate.java:207) ~[TileEntityCrate.class:?]
at net.mcft.copy.betterstorage.tile.crate.TileCrate.func_149727_a(TileCrate.java:73) ~[TileCrate.class:?]
at net.minecraft.server.management.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:376) ~[mx.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:556) ~[nh.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:60) ~[jo.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:9) ~[jo.class:?]
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212) ~[ej.class:?]
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165) [nc.class:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659) [MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:334) [lt.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [li.class:?]

It affects only the one crate, other crates work properly.
Access by Pipes and ME do not work, too.
Its not possible to add new crates(won't connect).

Also, I saw an negative array size exception before, but was not able to reproduce it.

I'm using Build 117.

@copygirl
Copy link
Owner

One known cause of this is crates being moved / teleported or similar which removes crates but doesn't correctly readd them (sounds plausible since you mentioned negative array size). There really is no easy way to fix this, because it would need a complete rewrite of how crates work. I could hide the error but I'm not the kind of person to do that.

If that's not it, there's really not much I can do without information on how to reproduce it.

@MPoppinga
Copy link
Author

As far I know the crate was not altered.
It happened on a server, so maybe it was caused by an unecpected restart or server error where the number of crate elements got lost. (And the calculation of the fullness failed.)

@copygirl
Copy link
Owner

fullness = data.getOccupiedSlots() * 255 / data.getCapacity();

This is the line in question. getCapacity() returns (numCrates * slotsPerCrate), so for some reason the number of crates in the crate pile is incorrect. This could be caused by a number of different things, and debugging this issue knowing the cause or any way to reproduce it is pure guess-work.

Can you make a Gist of the list of mods you're using?

@MPoppinga
Copy link
Author

https://gist.github.com/MrSunday334/9ee3a930be4879011527

its a long list, so I'm not quite sure it will help. Unfortunately I have no idea how to reproduce it with another crate, so other crates work properly and this has not happened again(or before).
Connected to the crate are:

  • BuildCraft Transport Pipe
  • Applied Energistics 2 Storage and Export Bus

Items in it where of all kind of mods

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

No branches or pull requests

2 participants