From dccac5415d2847d80596bb0c6cd7b8eaf949b9a4 Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Fri, 13 Sep 2013 07:54:55 -0400 Subject: [PATCH] sync --- src/dark/core/common/DarkMain.java | 3 ++- src/dark/core/network/PacketHandler.java | 6 ++--- src/dark/core/prefab/helpers/FluidHelper.java | 6 +++-- .../tilenetwork/NetworkTileEntities.java | 22 ++++++++++--------- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/dark/core/common/DarkMain.java b/src/dark/core/common/DarkMain.java index 90e98d16..64d1c134 100644 --- a/src/dark/core/common/DarkMain.java +++ b/src/dark/core/common/DarkMain.java @@ -65,11 +65,12 @@ public class DarkMain extends ModPrefab public static final String MINOR_VERSION = "@MINOR@"; public static final String REVIS_VERSION = "@REVIS@"; public static final String BUILD_VERSION = "@BUILD@"; + public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVIS_VERSION + "." + BUILD_VERSION; // @Mod public static final String MOD_ID = "DarkCore"; public static final String MOD_NAME = "Darks CoreMachine"; - public static final String VERSION = MAJOR_VERSION + "." + MINOR_VERSION + "." + REVIS_VERSION + "." + BUILD_VERSION; + @SidedProxy(clientSide = "dark.core.client.ClientProxy", serverSide = "dark.core.common.CommonProxy") public static CommonProxy proxy; diff --git a/src/dark/core/network/PacketHandler.java b/src/dark/core/network/PacketHandler.java index c5d9d9b4..80200a20 100644 --- a/src/dark/core/network/PacketHandler.java +++ b/src/dark/core/network/PacketHandler.java @@ -26,13 +26,13 @@ import cpw.mods.fml.common.network.PacketDispatcher; import cpw.mods.fml.common.network.Player; /** Packet manager based off the PacketManager from UE created by Calclavia - * + * * @author DarkGuardsman */ public class PacketHandler implements IPacketHandler, IPacketReceiver { public static PacketHandler instance; - public static HashMap packetTypes = new HashMap(); + public static HashMap packetTypes = new HashMap(); public static PacketManagerTile tile = new PacketManagerTile(); public static PacketManagerEffects effects = new PacketManagerEffects(); @@ -169,7 +169,7 @@ public class PacketHandler implements IPacketHandler, IPacketReceiver } /** Gets a packet for the tile entity. - * + * * @return */ @SuppressWarnings("resource") public Packet getPacket(String channelName, TileEntity sender, Object... sendData) diff --git a/src/dark/core/prefab/helpers/FluidHelper.java b/src/dark/core/prefab/helpers/FluidHelper.java index 19116172..ef48998c 100644 --- a/src/dark/core/prefab/helpers/FluidHelper.java +++ b/src/dark/core/prefab/helpers/FluidHelper.java @@ -88,9 +88,11 @@ public class FluidHelper public static FluidStack getStack(FluidStack stack, int amount) { - if (stack != null && stack.getFluid() != null) + if (stack != null) { - return new FluidStack(stack.getFluid().getID(), amount, stack.tag); + FluidStack newStack = stack.copy(); + newStack.amount = amount; + return newStack; } return stack; } diff --git a/src/dark/core/prefab/tilenetwork/NetworkTileEntities.java b/src/dark/core/prefab/tilenetwork/NetworkTileEntities.java index f93684a6..592dee25 100644 --- a/src/dark/core/prefab/tilenetwork/NetworkTileEntities.java +++ b/src/dark/core/prefab/tilenetwork/NetworkTileEntities.java @@ -2,8 +2,10 @@ package dark.core.prefab.tilenetwork; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Set; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -18,7 +20,7 @@ import dark.core.prefab.helpers.ConnectionHelper; public abstract class NetworkTileEntities { /* BLOCK THAT ACT AS FLUID CONVEYORS ** */ - public final List networkMember = new ArrayList(); + public final Set networkMember = new HashSet(); public NetworkTileEntities(INetworkPart... parts) { @@ -33,13 +35,13 @@ public abstract class NetworkTileEntities /** Creates a new instance of this network to be used to merge or split networks while still * maintaining each class that extends the base network class - * + * * @return - new network instance using the current networks properties */ public abstract NetworkTileEntities newInstance(); /** Adds a TileEntity to the network. extends this to catch non-network parts and add them to * other tile lists - * + * * @param tileEntity - tileEntity instance * @param member - add to network member list * @return */ @@ -128,7 +130,7 @@ public abstract class NetworkTileEntities } /** Gets the list of network members */ - public List getNetworkMemebers() + public Set getNetworkMemebers() { return this.networkMember; } @@ -149,7 +151,7 @@ public abstract class NetworkTileEntities /** Combines two networks together into one. Calls to preMerge and doMerge instead of doing the * merge process itself - * + * * @param network * @param mergePoint */ public void merge(NetworkTileEntities network, INetworkPart mergePoint) @@ -165,17 +167,17 @@ public abstract class NetworkTileEntities /** Processing that needs too be done before the network merges. Use this to do final network * merge calculations and to cause network merge failure - * + * * @param network the network that is to merge with this one * @param part the part at which started the network merge. Use this to cause damage if two * networks merge with real world style failures - * + * * @return false if the merge needs to be canceled. - * + * * Cases in which the network should fail to merge are were the two networks merge with error. * Or, in the case of pipes the two networks merge and the merge point was destroyed by * combination of liquids. - * + * * Ex Lava and water */ public boolean preMergeProcessing(NetworkTileEntities network, INetworkPart part) { @@ -267,7 +269,7 @@ public abstract class NetworkTileEntities } /** invalidates/remove a tile from the networks that surround and connect to it - * + * * @param tileEntity - tile */ public static void invalidate(TileEntity tileEntity) {