diff --git a/build.gradle b/build.gradle index e11669df2..d3de05396 100644 --- a/build.gradle +++ b/build.gradle @@ -55,7 +55,7 @@ sourceCompatibility = '1.7' targetCompatibility = '1.7' minecraft { - version = config.minecraft_version + "-" + config.forge_version + version = config.minecraft_version + "-" + config.forge_version// + "-" + config.minecraft_version } processResources diff --git a/build.properties b/build.properties index ea0dbd3b3..bf1c6dc5d 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft_version=1.7.10 forge_version=10.13.2.1291 -FMP_version=1.1.1.320 -CCLIB_version=1.1.1.110 -NEI_version=1.0.4.83 +FMP_version=1.1.2.331 +CCLIB_version=1.1.3.127 +NEI_version=1.0.4.95 CCC_version=1.0.4.35 mod_version=8.1.1 diff --git a/src/main/java/mekanism/api/transmitters/DynamicNetwork.java b/src/main/java/mekanism/api/transmitters/DynamicNetwork.java index 6a92bbe46..fd78b865c 100644 --- a/src/main/java/mekanism/api/transmitters/DynamicNetwork.java +++ b/src/main/java/mekanism/api/transmitters/DynamicNetwork.java @@ -35,8 +35,6 @@ public abstract class DynamicNetwork> implemen protected Range4D packetRange = null; - protected int ticksSinceCreate = 0; - protected int capacity = 0; protected double meanCapacity = 0; @@ -63,27 +61,10 @@ public abstract class DynamicNetwork> implemen { worldObj = transmitter.world(); } - - Coord4D coord = transmitter.coord(); - + for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - A acceptor = transmitter.getAcceptor(side); - - if(acceptor != null) - { - Coord4D acceptorCoord = coord.getFromSide(side); - possibleAcceptors.put(acceptorCoord, acceptor); - EnumSet directions = acceptorDirections.get(acceptorCoord); - - if(directions != null) - { - directions.add(side.getOpposite()); - } - else { - acceptorDirections.put(acceptorCoord, EnumSet.of(side.getOpposite())); - } - } + updateTransmitterOnSide(transmitter, side); } transmitter.setTransmitterNetwork((N)this); @@ -103,37 +84,13 @@ public abstract class DynamicNetwork> implemen for(Entry, EnumSet> entry : changedAcceptors.entrySet()) { IGridTransmitter transmitter = entry.getKey(); - EnumSet directionsChanged = entry.getValue(); - - for(ForgeDirection side : directionsChanged) + if(transmitter.isValid()) { - A acceptor = transmitter.getAcceptor(side); - Coord4D acceptorCoord = transmitter.coord().getFromSide(side); - EnumSet directions = acceptorDirections.get(acceptorCoord); - - if(acceptor != null) + EnumSet directionsChanged = entry.getValue(); + + for(ForgeDirection side : directionsChanged) { - possibleAcceptors.put(acceptorCoord, acceptor); - - if(directions != null) - { - directions.add(side.getOpposite()); - } - else { - acceptorDirections.put(acceptorCoord, EnumSet.of(side.getOpposite())); - } - } - else { - if(directions != null) - { - directions.remove(side.getOpposite()); - - if(directions.isEmpty()) - { - possibleAcceptors.remove(acceptorCoord); - acceptorDirections.remove(acceptorCoord); - } - } + updateTransmitterOnSide(transmitter, side); } } } @@ -142,6 +99,45 @@ public abstract class DynamicNetwork> implemen } } + public void updateTransmitterOnSide(IGridTransmitter transmitter, ForgeDirection side) + { + A acceptor = transmitter.getAcceptor(side); + Coord4D acceptorCoord = transmitter.coord().getFromSide(side); + EnumSet directions = acceptorDirections.get(acceptorCoord); + + if(acceptor != null) + { + possibleAcceptors.put(acceptorCoord, acceptor); + + if(directions != null) + { + directions.add(side.getOpposite()); + } + else { + acceptorDirections.put(acceptorCoord, EnumSet.of(side.getOpposite())); + } + } + else { + if(directions != null) + { + directions.remove(side.getOpposite()); + + if(directions.isEmpty()) + { + possibleAcceptors.remove(acceptorCoord); + acceptorDirections.remove(acceptorCoord); + } + } + else + { + possibleAcceptors.remove(acceptorCoord); + acceptorDirections.remove(acceptorCoord); + } + } + + } + + public abstract void absorbBuffer(IGridTransmitter transmitter); public abstract void clampBuffer(); diff --git a/src/main/java/mekanism/api/transmitters/TransmitterNetworkRegistry.java b/src/main/java/mekanism/api/transmitters/TransmitterNetworkRegistry.java index ee2acb380..6992af8ef 100644 --- a/src/main/java/mekanism/api/transmitters/TransmitterNetworkRegistry.java +++ b/src/main/java/mekanism/api/transmitters/TransmitterNetworkRegistry.java @@ -260,7 +260,8 @@ public class TransmitterNetworkRegistry public void addNetworkToIterated(Coord4D from) { - networksFound.add(startPoint.getExternalNetwork(from)); + N net = startPoint.getExternalNetwork(from); + if(net != null) networksFound.add(net); } } } diff --git a/src/main/java/mekanism/common/EnergyNetwork.java b/src/main/java/mekanism/common/EnergyNetwork.java index 034fae8f9..61daf323f 100644 --- a/src/main/java/mekanism/common/EnergyNetwork.java +++ b/src/main/java/mekanism/common/EnergyNetwork.java @@ -76,6 +76,10 @@ public class EnergyNetwork extends DynamicNetwork 0 && sent-prev > 0 && i < 100; @@ -139,7 +143,7 @@ public class EnergyNetwork extends DynamicNetwork getCache(Coord4D start, Coord4D end, EnumSet sides) + public static List getCache(Coord4D start, Coord4D end, EnumSet sides) { - ArrayList ret = null; + List ret = null; - for(Map.Entry> entry : cachedPaths.entrySet()) + for(ForgeDirection side : sides) { - PathData data = entry.getKey(); + PathData data = new PathData(start, end, side); + + List test = cachedPaths.get(data); - if(data.startTransporter.equals(start) && data.end.equals(end) && sides.contains(data.endSide)) + if(ret == null || (test != null && test.size() < ret.size())) { - if(ret == null || entry.getValue().size() < ret.size()) - { - ret = (ArrayList)entry.getValue(); - } + ret = test; } } diff --git a/src/main/java/mekanism/common/content/transporter/TransporterPathfinder.java b/src/main/java/mekanism/common/content/transporter/TransporterPathfinder.java index de002b6bb..d88b8944f 100644 --- a/src/main/java/mekanism/common/content/transporter/TransporterPathfinder.java +++ b/src/main/java/mekanism/common/content/transporter/TransporterPathfinder.java @@ -151,14 +151,14 @@ public final class TransporterPathfinder public static class Destination implements Comparable { - public List path = new ArrayList(); + public List path; public Path pathType; public ItemStack rejected; public double score; - public Destination(ArrayList list, boolean inv, ItemStack rejects, double gScore) + public Destination(List list, boolean inv, ItemStack rejects, double gScore) { - path = (List)list.clone(); + path = new ArrayList<>(list); if(inv) { @@ -253,7 +253,7 @@ public final class TransporterPathfinder public static Destination getPath(DestChecker checker, EnumSet sides, ILogisticalTransporter start, Coord4D dest, TransporterStack stack, ItemStack rejects, int min) { - ArrayList test = PathfinderCache.getCache(start.coord(), dest, sides); + List test = PathfinderCache.getCache(start.coord(), dest, sides); if(test != null) { @@ -489,7 +489,7 @@ public final class TransporterPathfinder { ArrayList path = new ArrayList(); path.add(finalNode); - path.addAll((ArrayList)results.clone()); + path.addAll(results); return path; } diff --git a/src/main/java/mekanism/common/multipart/MultipartTransmitter.java b/src/main/java/mekanism/common/multipart/MultipartTransmitter.java index a6d200b44..03265e0b1 100644 --- a/src/main/java/mekanism/common/multipart/MultipartTransmitter.java +++ b/src/main/java/mekanism/common/multipart/MultipartTransmitter.java @@ -37,7 +37,7 @@ public class MultipartTransmitter> extends Tran @Override public Coord4D coord() { - return new Coord4D(getPart().x(), getPart().y(), getPart().z()); + return new Coord4D(getPart().x(), getPart().y(), getPart().z(), getPart().world().provider.dimensionId); } @Override diff --git a/src/main/java/mekanism/common/multipart/PartPressurizedTube.java b/src/main/java/mekanism/common/multipart/PartPressurizedTube.java index 8e45a17f9..44f532152 100644 --- a/src/main/java/mekanism/common/multipart/PartPressurizedTube.java +++ b/src/main/java/mekanism/common/multipart/PartPressurizedTube.java @@ -295,4 +295,16 @@ public class PartPressurizedTube extends PartTransmitter allSides = EnumSet.complementOf(EnumSet.of(ForgeDirection.UNKNOWN)); - - /** - * Gets all the connected energy acceptors, whether IC2-based or BuildCraft-based, surrounding a specific tile entity. - * @param tileEntity - center tile entity - * @return TileEntity[] of connected acceptors - */ - public static TileEntity[] getConnectedEnergyAcceptors(TileEntity tileEntity) - { - TileEntity[] acceptors = new TileEntity[] {null, null, null, null, null, null}; - - for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity acceptor = Coord4D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.getWorldObj()); - - if(isEnergyAcceptor(acceptor)) - { - acceptors[orientation.ordinal()] = acceptor; - } - } - - return acceptors; - } - public static boolean isEnergyAcceptor(TileEntity tileEntity) { return (tileEntity instanceof IStrictEnergyAcceptor || @@ -56,28 +32,6 @@ public final class CableUtils (MekanismUtils.useRF() && tileEntity instanceof IEnergyReceiver)); } - /** - * Gets all the connected cables around a specific tile entity. - * @param tileEntity - center tile entity - * @return TileEntity[] of connected cables - */ - public static TileEntity[] getConnectedCables(TileEntity tileEntity) - { - TileEntity[] cables = new TileEntity[] {null, null, null, null, null, null}; - - for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS) - { - TileEntity cable = Coord4D.get(tileEntity).getFromSide(orientation).getTileEntity(tileEntity.getWorldObj()); - - if(isCable(cable)) - { - cables[orientation.ordinal()] = cable; - } - } - - return cables; - } - public static boolean isCable(TileEntity tileEntity) { if(tileEntity instanceof ITransmitterTile) @@ -87,16 +41,6 @@ public final class CableUtils return false; } - /** - * Gets all the adjacent connections to a TileEntity. - * @param tileEntity - center TileEntity - * @return boolean[] of adjacent connections - */ - public static boolean[] getConnections(TileEntity tileEntity) - { - return getConnections(tileEntity, allSides); - } - /** * Gets the adjacent connections to a TileEntity, from a subset of its sides. * @param tileEntity - center TileEntity @@ -127,6 +71,11 @@ public final class CableUtils */ public static boolean isValidAcceptorOnSide(TileEntity cableEntity, TileEntity tile, ForgeDirection side) { + if(isCable(tile)) + { + return false; + } + if(isEnergyAcceptor(tile) && isConnectable(cableEntity, tile, side)) { return true; @@ -164,24 +113,6 @@ public final class CableUtils (MekanismUtils.useRF() && tileEntity instanceof IEnergyProvider && ((IEnergyConnection)tileEntity).canConnectEnergy(side.getOpposite())); } - /** - * Whether or not a cable can connect to a specific acceptor. - * @param side - side to check - * @param tile - cable TileEntity - * @return whether or not the cable can connect to the specific side - */ - public static boolean canConnectToAcceptor(ForgeDirection side, TileEntity tile) - { - if(tile == null) - { - return false; - } - - TileEntity tileEntity = Coord4D.get(tile).getFromSide(side).getTileEntity(tile.getWorldObj()); - - return isConnectable(tile, tileEntity, side); - } - public static boolean isConnectable(TileEntity orig, TileEntity tileEntity, ForgeDirection side) { if(tileEntity instanceof ITransmitterTile) diff --git a/src/main/resources/assets/mekanism/lang/de_DE.lang b/src/main/resources/assets/mekanism/lang/de_DE.lang index 6a88281ba..870a9216d 100644 --- a/src/main/resources/assets/mekanism/lang/de_DE.lang +++ b/src/main/resources/assets/mekanism/lang/de_DE.lang @@ -246,7 +246,7 @@ item.dirtySilverDust.name=Dreckiger Silberstaub item.dirtyLeadDust.name=Dreckiger Bleistaub //Ingots -item.obsidianIngot.name=Obsidianbarren +item.obsidianIngot.name=Raffinierter Obsidianbarren item.osmiumIngot.name=Osmiumbarren item.bronzeIngot.name=Bronzebarren item.glowstoneIngot.name=Glowstonebarren @@ -477,6 +477,8 @@ gui.toggleCooling=Kühlmessungen umschalten gui.coolingMeasurements=Aktive Kühlung gui.redstoneOutputMode=Redstone-Modus gui.entityDetection=Entity-Erkennung +gui.moveUp=Nach oben +gui.moveDown=Nach unten gui.reactor.injectionRate=Injektionsrate @@ -731,6 +733,7 @@ tooltip.ReactorController=Der alles kontrollierende Block für !nden gesamten Fu tooltip.ReactorFrame=Verstärkte Hülle, welche im !nFusionsreaktor-Multiblock verwendet werden kann. tooltip.ReactorNeutronCapturePlate=Ein Block, der zum Blockieren der Strahlung !naus einem Fusionsreaktors verwendet werden kann !nund bei der Produktion von Tritium hilft. tooltip.ReactorPort=Ein Block aus verstärktem Material, welcher sowohl den Gas- als auch den Energietransfer des Fusionsreaktors regeln kann. +tooltip.ReactorLogicAdapter=Ein Block, welcher verwendet werden kann, !num einen Reaktor mit Redstone zu überwachen. tooltip.OsmiumOre=Ein hartes Mineral, dass in fast jeder !nHöhenlage der Welt gefunden werden kann. !nEs ist für seine zahlreichen Verwendungszwecke !nin der Konstruktion von Maschinen bekannt. tooltip.CopperOre=Ein häufig vorkommendes, leitfähiges Material, dass !nfür die Produktion von Kabeln verwendet werden kann. !nSeine Fähigkeit, großer Hitze zu widerstehen, !nmacht es auch essentiell für fortgeschrittene Maschinen.