From 65619a41f5e51d2489342bd9a07d94adbc051774 Mon Sep 17 00:00:00 2001 From: Alex Roper Date: Fri, 26 Jan 2018 22:15:24 -0800 Subject: [PATCH] Register full mirrored jars with their network once. Currently, full mirrored jars will never register themselves with their network, meaning that if the server is restarted while a full mirrored jar is in the world (or if a player places a full mirrored jar for the first time since the server has started), the jar will be unable to share essentia with the rest of its network. This adds a check to register the jar even if it is full. The performance impact should be minimal since we only check each jar once per run. --- .../makeo/gadomancy/common/blocks/tiles/TileRemoteJar.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileRemoteJar.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileRemoteJar.java index f3812e8b..85c1002b 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileRemoteJar.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileRemoteJar.java @@ -26,14 +26,17 @@ public class TileRemoteJar extends TileJarFillable { private int count = 0; + private boolean registered_to_network = false; + @Override public void updateEntity() { super.updateEntity(); - if (count % 3 == 0 && !getWorldObj().isRemote && networkId != null && amount < maxAmount) { + if (count % 3 == 0 && !getWorldObj().isRemote && networkId != null && (!registered_to_network || amount < maxAmount)) { count = 0; JarNetwork network = getNetwork(networkId); + registered_to_network = true; if(!network.jars.contains(this)) { network.jars.add((TileJarFillable) worldObj.getTileEntity(xCoord, yCoord, zCoord)); }