copygirl / BetterStorage

A Minecraft mod aimed at offering more storage options.
http://copy.mcft.net/mc/BetterStorage/
MIT License
57 stars 33 forks source link

Crate piles don't split, issues with BC pipes and ArtihmeticException #218

Closed Slind14 closed 10 years ago

Slind14 commented 10 years ago

Single-player Latest 1.6.4 Version (0.8.0.47) Region File: http://www.mediafire.com/download/jwmwdw44qp0d90m/r.4.-8.mca Coordinates: 2381,102,-3652 Modpack: FTB Monster with up to date Mods

java.lang.ArithmeticException: / by zero
    at net.mcft.copy.betterstorage.container.ContainerCrate.<init>(ContainerCrate.java:26)
    at net.mcft.copy.betterstorage.tile.crate.TileEntityCrate.createContainer(TileEntityCrate.java:206)
    at net.mcft.copy.betterstorage.tile.crate.TileEntityCrate.openGui(TileEntityCrate.java:200)
    at net.mcft.copy.betterstorage.tile.crate.TileCrate.func_71903_a(TileCrate.java:72)
    at net.minecraft.item.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:421)
    at net.minecraft.network.NetServerHandler.func_72472_a(NetServerHandler.java:556)
    at net.minecraft.network.packet.Packet15Place.func_73279_a(SourceFile:58)
    at net.minecraft.network.MemoryConnection.func_74428_b(MemoryConnection.java:89)
    at net.minecraft.network.NetServerHandler.func_72570_d(NetServerHandler.java:141)
    at net.minecraft.network.NetworkListenThread.func_71747_b(NetworkListenThread.java:54)
    at net.minecraft.server.integrated.IntegratedServerListenThread.func_71747_b(IntegratedServerListenThread.java:109)
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:691)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:587)
    at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:129)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484)
    at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
    at net.mcft.copy.betterstorage.container.ContainerCrate.<init>(ContainerCrate.java:26)
    at net.mcft.copy.betterstorage.tile.crate.TileEntityCrate.createContainer(TileEntityCrate.java:206)
    at net.mcft.copy.betterstorage.tile.crate.TileEntityCrate.openGui(TileEntityCrate.java:200)
    at net.mcft.copy.betterstorage.tile.crate.TileCrate.func_71903_a(TileCrate.java:72)
    at net.minecraft.item.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:421)
    at net.minecraft.network.NetServerHandler.func_72472_a(NetServerHandler.java:556)
    at net.minecraft.network.packet.Packet15Place.func_73279_a(SourceFile:58)
    at net.minecraft.network.MemoryConnection.func_74428_b(MemoryConnection.java:89)
    at net.minecraft.network.NetServerHandler.func_72570_d(NetServerHandler.java:141)

-- Ticking connection --
Details:
    Connection: net.minecraft.network.NetServerHandler@3c9f8196
Stacktrace:
    at net.minecraft.network.NetworkListenThread.func_71747_b(NetworkListenThread.java:54)
    at net.minecraft.server.integrated.IntegratedServerListenThread.func_71747_b(IntegratedServerListenThread.java:109)
    at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:691)
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:587)
    at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:129)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484)
    at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)
copygirl commented 10 years ago

Saw this a day or two ago. This happens for example when mods do weird things with crates, like move / teleport them. They're not made with that in mind, and there's no common way to tell mods how to deal with them. Also it could be from the crate data just being completely lost, which I haven't seen happen before.

Can you provide more information or find out how to reproduce the issue? If it's from a mod moving it, I suggest adding them to their blacklist, if they do provide one.

Slind14 commented 10 years ago

I know that they haven't been moved, but for further information I have to ask the player for whom I reported it.

Another thing I know. In this case it has been only two blocks and can't be the same issue but: If you have two separated crates in the b-team modpack and you connect them together you run into the same issue. This should help to reproduce it. But in how it happend in this case with only 2 blocks I have no idea.

copygirl commented 10 years ago

You can't connect two separate crate piles, since placed crates will only (try to) attach to the crate you placed them against - by clicking on the side of an existing crate, that is. If you can't help us reproduce it on our end, it could be a very difficult task to find the problem and then also fix it. It might also be very obvious, but that'd just mean you'd find it quicker. I'm asking for help because last time I checked, crates were disconnecting correctly and this error appeared only in the case I mentioned above.

Slind14 commented 10 years ago

I just tested the second thing again. If you have two crates next to each other with one block space in between everything is fine. But as soon as you place a crate in between that would connect both crates you run into this issue. This is at least the case with the B-Team Modpack and should be easy to reproduce. Maybe it is connected to the issue of this ticket, too and helps solve it.

Slind14 commented 10 years ago

The respond from the person I reported this for:

They functioned perfectly for weeks, but then suddenly half of them seemed to be afflicted by this bug. What's interesting, is that only one of the six bugged crates wasn't completely full. In fact, nearly every other chest that wasn't full seemed to be just fine. It might be coincidence, but this bug might have something to do with full crates.

Using build craft pipes, I could make items go into the crate, but nothing could be sucked out. All items that went in are assumed to be deleted. I placed 36 stacks of cobble into the chest(using buildcraft), and it ate it all up.

copygirl commented 10 years ago

I can confirm the crates don't disconnect. They stay "connected", part of the same crate pile, even if the crate connecting them both has been destroyed. There's code that's supposed to prevent this but it's currently not working it seems. Can't reproduce the ArtihmeticException, but it might be related.

Regarding BuildCraft pipes, they might just be acting stupid, or it's related to recent / upcoming changes with the way inventories are interacted with. I suggest either disabling crate interaction completely, preventing any issues from happening that way, or using a hopper inbetween. Those should work.

Slind14 commented 10 years ago

ok, thanks copygirl

copygirl commented 10 years ago

Crate splitting issue fixed in 49dc5787df887d9c68f25d372810df1ee80b010a. If the two other issues are still present (with new crates), please open another issue.

Slind14 commented 10 years ago

@copygirl will you push a 1.6.4 build with this fix?

copygirl commented 10 years ago

No, these changes are only going to be in 1.7.10 and onward. We've already decided not to provide a 1.7.2 build (because mods should update. not backport), and backporting all the changes so far to 1.6.4 would be too much work and probably not worth it. Mods and modpacks still on 1.6.4 and the people using them should really move onward, in my opinion.

Slind14 commented 10 years ago

I understand dropping support for older builds but for good gameplay experience stability and performance is worth more than a bit new content and experimental changes. <- in my opinion

As you still have the 1.6.4 branch, would it require more than this small commit to fix it in 1.6.4? I mean it is not a small bug, people loose their entire resources because of it. :)

copygirl commented 10 years ago

We've renamed variables and the way tile entity inventories are interacted with by machines has changed as well. Seeing if backporting this change is not too difficult would probably mean doing half the work anyway. And I don't know how many changes this crate commit (or commits?) are based on previous 1.7+ commits. And who knows if this actually fixes any of the problems..? Other than crates splitting, that was a pretty obvious, super easy to fix one.

Slind14 commented 10 years ago

alrigth