From 3cd0106c6fe63d8812bff63de2caeaa82b52a57b Mon Sep 17 00:00:00 2001 From: Aidan Date: Sat, 27 Jul 2013 21:58:40 -0400 Subject: [PATCH 01/12] Welcome to the team, @unpairedbracket! --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c1f7d50c2..8affe3cbd 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI # Developers & Credits # -**Head Developer:** aidancbrady +**Lead Developer:** aidancbrady -**Contributors:** viper283, Condo97 +**Co-developer:** unpairedbracket + +**Contributors:** micdoodle, Calclavia **Credits:** From 0188882688011e9890cc4897a0020fca3ee5d549 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Sat, 27 Jul 2013 22:49:11 +0100 Subject: [PATCH 02/12] Fix the Electric Pump's render texture --- .../assets/mekanism/render/ElectricPump.png | Bin 2343 -> 728 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/resources/assets/mekanism/render/ElectricPump.png b/resources/assets/mekanism/render/ElectricPump.png index 0cf809d596ad44bf10dd9cdc40400dada229cf03..e8da2706df39cf3b99ab8cd9319ccfe75731f873 100644 GIT binary patch literal 728 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)yR@hXLo&a-AOizas;7%%NX4zUcMK;f21*?G_}({H z%k1GD$BpKS1)`GSf;+k%@d*c+&Sd_=ws_f#OC`}g*X#BlNvh7u{=4`6)@`%97Imn( zEe_nwEET0Aw(_On`}gnN>zAEPn|$iLtXDAG_-G8~|xnk?J#%gzdJXbV{gCxR`D%;8@~Zl-cI(8KW2^jaeJlb zbKPQj_I>BUmCv*Kn?FsOAIaj!ti9&?>!{f$Lf0sTEoI-YbS?gC-}|pso(%pkw#UzK z_dNX2;PvID+3REzggY1n7?^;_fq{d8QGtQw0Jmr8f4u|)2^rgsF?#3gp2hw9J3Z!C zWdvhI!~cCUcfQPxw>#%Gp^~A!Z1>%ZfBlwUeo@&2)aLB&a96VK?HcuF+XHLUzAv4b z_iTHCaE5q3e*?pbDwY{{*K3>pwQn*&vTIXlrS5_9KXEn<9j{h5?7NxF0<_;@_jiWt zb)Va7melR9zka&$9A6K^yh_#;zw8d=m}PG<@=+6h|7F`-#%G^@Ui|y9qUKv6(Dnv~ zjN@_(vbN3sscXeO!*6-{Uzr0p8wDNu<})X-!hF^M@+oaO4V(Wlem$~Sky-VH0|O9v My85}Sb4q9e0B8pp2mk;8 literal 2343 zcmeHH`8(8&9{rAGEEPA)*wU1J356^(vP3b+HWU|4RD^698jXocgxf15*?a90Gg8FZ zUmB6@*O+<7)>y_68OvB^=DPpD{R{37=bWF;d7krmp3g~fak4!jDlZBEzzKw%joXnX z{1?LDBmT?WZvX%URD!InT@cpRXIvhH2L#=}3jii3pL@)NQ{AP^Q^MWKAQoplZIe@b z@g7L;W(E1$uV6%0`IHC>pj8_yWAswR&7ntV~!Z(ua4~T+1?*8oiSa4FWsctTtWqX&Xe~x2ub~t(^(6VKZdoK(zU{^V6#?o zfL@ayieI)bYtAD~p+zYmqoFp_@4?WVUV3EH1)jKWe)QI=?=#PXg7W6uU&K?UwRhax zQ!FMwZ=Kq3AfWKg2)}qicKZHk93KYix>cQtLr*W+qENL`)8J`A>_|lAv1DWD?e|vpB-% zoPMXHa*&=Nlwk3xwzW!da1>^2Py*R>xDgUoS8YY9%ky$Q#?jA(-%Rh*3?*iFzlIKo zwZ!}>HvqB!I>JzkuMKz%+hnKk&>A&u2yJ}>ns^6FR{I3DO3rfzT68CAbrs+RPiU0a2)2376S`H`S zBRam-ds-l;K!;HOhSl>5fs$neV{-ngutOKDOH5GoK`2aGYYeBc&1!Xyc89>6Ts99a zaT+gNe@v~*?+>PPlkx}-+FQ!b!xs#_*CfvfN#2V#9yPBF39(oeGwTNv*+16WLqgDp zk*t@rv`~@}A?#~oH=B&F*EtMzIr7}tk*EbjZ$A) zzOwgZSXr&hqR;&MX!G3gdu|E0I;;v+B{Mz)4^EVWSE%5$aM~OVoH|aAyfgsh4I-ONXZ`)WE z*%>^}QEZb%i#7yb`;683Eg)+st_m&$PkwdpO{_sfyr{)l6>dg-U&&j_l`%dA3vW^} zu%c9TyOi}b=N{6$0bf&5EBhu}jZneA&CQZL4};Byo^w>~Gng-gMP9$MC5p};9`t<- zo)IfS)WrPTs9*ZV6#hM4QzWkci@xuKZL;*Bq4dy#hS9?>ZQW_5D(%md{#dq}K4`xZ zLpvV&%iAWI*9~W0zvo>giCg=}c85GAX~QXQ(V!$vXuG9teyP-s4$eTr2r~zY42O9d zx@iQHu4qL9%SS$%fbtY#N1cVmOR>vc7%qaROeVg!``qkb)O025X_6TPs@a-=TIAITsEtH zXB}U`n0|;4Z+?tv$i5vhE`9`@uXM^S1ELOU-ECXyAiy4}-xV($_2YrrK~=8Yh(70pa?K zTdqhdIxRe3ibrF2fHDckCnHd(wSHhRmrFay$;nBF^TMXq%x4GqhO;x6dVlkySMnb8 zQD7jUU$W|O!;~MeTo7@8%q{={?=}UrEaH9ufJ-c2HuUjk&}?sS@2p%Gi^W<-)?g0Z z>yVF-2MxGFfiD6dvPx_FE1^Pq9C~tD_u~SQ%SxnJjv;`f;_-M+?;@RkhhX*@cmD13 zb0QHUeG*a4S%76T?M~#*C7-m)fP8qEee&8}RRU4yEjF}BUIxYbX_gSE^ngAoboCfuSv`1XGyBN3#efb8=wEEyG(-R`v2M;h zH|C96*YhdW=4XKjHY<9JAi#OO`7PR50$FP-+uLifZt7s)Zg8 z=u!gdf*=I!Ty?B}HbmHPb`d Date: Sat, 27 Jul 2013 22:53:30 +0100 Subject: [PATCH 03/12] Fix ArrayIndexOutOfBoundsException in Electric Chest when attached to AE import buses and presumably other things. --- common/mekanism/common/TileEntityElectricChest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/mekanism/common/TileEntityElectricChest.java b/common/mekanism/common/TileEntityElectricChest.java index 651e5a152..1313840fb 100644 --- a/common/mekanism/common/TileEntityElectricChest.java +++ b/common/mekanism/common/TileEntityElectricChest.java @@ -146,7 +146,7 @@ public class TileEntityElectricChest extends TileEntityElectricBlock return new int[] {54}; } else { - int[] ret = new int[54]; + int[] ret = new int[55]; for(int i = 0; i <= ret.length; i++) { From 735b281341b76c5dcc59eceea87f7f6f5f0ff411 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Sun, 28 Jul 2013 20:49:11 +0100 Subject: [PATCH 04/12] Fix a little derp in getPower() --- common/mekanism/common/EnergyNetwork.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/mekanism/common/EnergyNetwork.java b/common/mekanism/common/EnergyNetwork.java index b312c6f56..1b8d0081c 100644 --- a/common/mekanism/common/EnergyNetwork.java +++ b/common/mekanism/common/EnergyNetwork.java @@ -358,6 +358,6 @@ public class EnergyNetwork public double getPower() { - return joulesTransmitted * 20; + return joulesLastTick * 20; } } \ No newline at end of file From c2c031ef2ab9fae7a4a12ed6e0d982a8c0873845 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Sat, 27 Jul 2013 22:53:54 +0100 Subject: [PATCH 05/12] Clean up a bit of unnecessary logic --- common/mekanism/common/Mekanism.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/mekanism/common/Mekanism.java b/common/mekanism/common/Mekanism.java index d0fc0df17..1228bd790 100644 --- a/common/mekanism/common/Mekanism.java +++ b/common/mekanism/common/Mekanism.java @@ -731,7 +731,7 @@ public class Mekanism System.out.println("[Mekanism] Hooked into Thermal Expansion successfully."); } catch(Exception e) {} - if(controlCircuitOreDict || (!controlCircuitOreDict && !hooks.BasicComponentsLoaded)) + if(controlCircuitOreDict || !hooks.BasicComponentsLoaded) { OreDictionary.registerOre("circuitBasic", new ItemStack(ControlCircuit)); } From 18519b5fa67c1c6aa76afde47c1723684a88c53c Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Sun, 28 Jul 2013 03:32:41 +0100 Subject: [PATCH 06/12] Fix the EnergyNetwork memory leak. --- common/mekanism/common/EnergyNetwork.java | 112 ++++++++++++++---- .../common/EnergyNetworkRegistry.java | 21 +++- common/mekanism/common/IUniversalCable.java | 22 ++++ .../common/TileEntityUniversalCable.java | 56 ++++++++- 4 files changed, 185 insertions(+), 26 deletions(-) diff --git a/common/mekanism/common/EnergyNetwork.java b/common/mekanism/common/EnergyNetwork.java index 1b8d0081c..0a77c4e91 100644 --- a/common/mekanism/common/EnergyNetwork.java +++ b/common/mekanism/common/EnergyNetwork.java @@ -23,13 +23,15 @@ import buildcraft.api.power.IPowerReceptor; public class EnergyNetwork { - public Set cables = new HashSet(); + public HashSet cables = new HashSet(); public Set possibleAcceptors = new HashSet(); public Map acceptorDirections = new HashMap(); private double joulesTransmitted = 0; private double joulesLastTick = 0; + private int ticksSinceCreate = 0; + private boolean fixed = false; public EnergyNetwork(IUniversalCable... varCables) { @@ -37,6 +39,20 @@ public class EnergyNetwork EnergyNetworkRegistry.getInstance().registerNetwork(this); } + public EnergyNetwork(Set networks) + { + for (EnergyNetwork net : networks) + { + if(net != null) + { + addAllCables(net.cables); + net.deregister(); + } + } + refresh(); + EnergyNetworkRegistry.getInstance().registerNetwork(this); + } + public double getEnergyNeeded(ArrayList ignored) { double totalNeeded = 0; @@ -155,7 +171,8 @@ public class EnergyNetwork public void refresh() { - Iterator it = cables.iterator(); + Set iterCables = (Set) cables.clone(); + Iterator it = iterCables.iterator(); possibleAcceptors.clear(); acceptorDirections.clear(); @@ -164,20 +181,17 @@ public class EnergyNetwork { IUniversalCable conductor = (IUniversalCable)it.next(); - if(conductor == null) - { - it.remove(); - } - else if(((TileEntity)conductor).isInvalid()) + if(conductor == null || ((TileEntity)conductor).isInvalid()) { it.remove(); + cables.remove(conductor); } else { conductor.setNetwork(this); } } - for(IUniversalCable cable : cables) + for(IUniversalCable cable : iterCables) { TileEntity[] acceptors = CableUtils.getConnectedEnergyAcceptors((TileEntity)cable); @@ -194,24 +208,26 @@ public class EnergyNetwork public void merge(EnergyNetwork network) { - EnergyNetworkRegistry registry = EnergyNetworkRegistry.getInstance(); - if(network != null && network != this) { - EnergyNetwork newNetwork = new EnergyNetwork(); - newNetwork.cables.addAll(cables); - registry.removeNetwork(this); - newNetwork.cables.addAll(network.cables); - registry.removeNetwork(network); + Set networks = new HashSet(); + networks.add(this); + networks.add(network); + EnergyNetwork newNetwork = new EnergyNetwork(networks); newNetwork.refresh(); } } + + public void addAllCables(Set newCables) + { + cables.addAll(newCables); + } public void split(IUniversalCable splitPoint) { if(splitPoint instanceof TileEntity) { - cables.remove(splitPoint); + removeCable(splitPoint); TileEntity[] connectedBlocks = new TileEntity[6]; boolean[] dealtWith = {false, false, false, false, false, false}; @@ -233,7 +249,7 @@ public class EnergyNetwork if(connectedBlockA instanceof IUniversalCable && !dealtWith[countOne]) { NetworkFinder finder = new NetworkFinder(((TileEntity)splitPoint).worldObj, Object3D.get(connectedBlockA), Object3D.get((TileEntity)splitPoint)); - List partNetwork = finder.findNetwork(); + List partNetwork = finder.exploreNetwork(); for(int countTwo = countOne + 1; countTwo < connectedBlocks.length; countTwo++) { @@ -267,10 +283,50 @@ public class EnergyNetwork } } - EnergyNetworkRegistry.getInstance().removeNetwork(this); + deregister(); } } + public void fixMessedUpNetwork(IUniversalCable cable) + { + System.out.println("Fixing Network"); + if(cable instanceof TileEntity) + { + NetworkFinder finder = new NetworkFinder(((TileEntity) cable).getWorldObj(), Object3D.get((TileEntity)cable), null); + List partNetwork = finder.exploreNetwork(); + Set newCables = new HashSet(); + for(Object3D node : partNetwork) + { + TileEntity nodeTile = node.getTileEntity(((TileEntity)cable).worldObj); + + if(nodeTile instanceof IUniversalCable) + { + ((IUniversalCable) nodeTile).removeFromNetwork(); + newCables.add((IUniversalCable)nodeTile); + } + } + EnergyNetwork newNetwork = new EnergyNetwork(newCables.toArray(new IUniversalCable[0])); + newNetwork.refresh(); + newNetwork.fixed = true; + deregister(); + } + } + + public void removeCable(IUniversalCable cable) + { + cables.remove(cable); + if(cables.size() == 0) + { + deregister(); + } + } + + public void deregister() + { + cables.clear(); + EnergyNetworkRegistry.getInstance().removeNetwork(this); + } + public static class NetworkFinder { public World worldObj; @@ -313,7 +369,7 @@ public class EnergyNetwork } } - public List findNetwork() + public List exploreNetwork() { loopAll(start); @@ -350,6 +406,22 @@ public class EnergyNetwork return "[EnergyNetwork] " + cables.size() + " cables, " + possibleAcceptors.size() + " acceptors."; } + + public void tick() + { + clearJoulesTransmitted(); + //Fix weird behaviour periodically. + if(!fixed) + { + ++ticksSinceCreate; + if(ticksSinceCreate > 1200) + { + ticksSinceCreate = 0; + fixMessedUpNetwork(cables.toArray(new IUniversalCable[0])[0]); + } + } + } + public void clearJoulesTransmitted() { joulesLastTick = joulesTransmitted; @@ -360,4 +432,4 @@ public class EnergyNetwork { return joulesLastTick * 20; } -} \ No newline at end of file +} diff --git a/common/mekanism/common/EnergyNetworkRegistry.java b/common/mekanism/common/EnergyNetworkRegistry.java index d6fcac04c..de562173c 100644 --- a/common/mekanism/common/EnergyNetworkRegistry.java +++ b/common/mekanism/common/EnergyNetworkRegistry.java @@ -13,7 +13,7 @@ public class EnergyNetworkRegistry implements ITickHandler { private static EnergyNetworkRegistry INSTANCE = new EnergyNetworkRegistry(); - private Set networks = new HashSet(); + private HashSet networks = new HashSet(); public EnergyNetworkRegistry() { @@ -38,6 +38,17 @@ public class EnergyNetworkRegistry implements ITickHandler } } + public void pruneEmptyNetworks() { + for(EnergyNetwork e : networks) + { + if(e.cables.size() == 0) + { + removeNetwork(e); + } + } + + } + @Override public void tickStart(EnumSet type, Object... tickData) { @@ -47,9 +58,13 @@ public class EnergyNetworkRegistry implements ITickHandler @Override public void tickEnd(EnumSet type, Object... tickData) { - for(EnergyNetwork net : networks) + Set iterNetworks = (Set) networks.clone(); + for(EnergyNetwork net : iterNetworks) { - net.clearJoulesTransmitted(); + if(networks.contains(net)) + { + net.tick(); + } } } diff --git a/common/mekanism/common/IUniversalCable.java b/common/mekanism/common/IUniversalCable.java index 42e1f7985..9315abcea 100644 --- a/common/mekanism/common/IUniversalCable.java +++ b/common/mekanism/common/IUniversalCable.java @@ -9,10 +9,20 @@ public interface IUniversalCable { /** * Gets the EnergyNetwork currently in use by this cable segment. + * Will try to connect to adjacent networks or create a new one * @return EnergyNetwork this cable is using */ public EnergyNetwork getNetwork(); + /** + * Gets the EnergyNetwork currently in use by this cable segment. + * @param createIfNull - If true, the cable will try and connect to an + * adjacent network, merging several if necessary, or creating a new one + * if none is available + * @return EnergyNetwork this cable is using + */ + public EnergyNetwork getNetwork(boolean createIfNull); + /** * Sets this cable segment's EnergyNetwork to a new value. * @param network - EnergyNetwork to set to @@ -23,4 +33,16 @@ public interface IUniversalCable * Refreshes the cable's EnergyNetwork. */ public void refreshNetwork(); + + /** + * Remove a cable from its network. + */ + public void removeFromNetwork(); + + /** + * Call this if you're worried a cable's network is messed up and you want + * it to try and fix itself. + */ + public void fixNetwork(); + } diff --git a/common/mekanism/common/TileEntityUniversalCable.java b/common/mekanism/common/TileEntityUniversalCable.java index 70c03cbe0..9acff79c8 100644 --- a/common/mekanism/common/TileEntityUniversalCable.java +++ b/common/mekanism/common/TileEntityUniversalCable.java @@ -1,6 +1,7 @@ package mekanism.common; import java.util.ArrayList; +import java.util.HashSet; import mekanism.api.Object3D; import net.minecraft.tileentity.TileEntity; @@ -35,14 +36,47 @@ public class TileEntityUniversalCable extends TileEntity implements IUniversalCa @Override public EnergyNetwork getNetwork() { - if(energyNetwork == null) + return getNetwork(true); + } + + @Override + public EnergyNetwork getNetwork(boolean createIfNull) + { + if(energyNetwork == null && createIfNull) { - energyNetwork = new EnergyNetwork(this); + TileEntity[] adjacentCables = CableUtils.getConnectedCables(this); + HashSet connectedNets = new HashSet(); + for(TileEntity cable : adjacentCables) + { + if(cable instanceof IUniversalCable && ((IUniversalCable)cable).getNetwork(false) != null) + { + connectedNets.add(((IUniversalCable)cable).getNetwork()); + } + } + if(connectedNets.size() == 0) + { + energyNetwork = new EnergyNetwork(this); + } + else if(connectedNets.size() == 1) + { + energyNetwork = (EnergyNetwork)connectedNets.toArray()[0]; + energyNetwork.cables.add(this); + } + else { + energyNetwork = new EnergyNetwork(connectedNets); + energyNetwork.cables.add(this); + } } return energyNetwork; } + @Override + public void fixNetwork() + { + getNetwork().fixMessedUpNetwork(this); + } + @Override public void invalidate() { @@ -57,7 +91,17 @@ public class TileEntityUniversalCable extends TileEntity implements IUniversalCa @Override public void setNetwork(EnergyNetwork network) { - energyNetwork = network; + if(network != energyNetwork) + { + removeFromNetwork(); + energyNetwork = network; + } + } + + @Override + public void removeFromNetwork() + { + energyNetwork.removeCable(this); } @Override @@ -105,6 +149,12 @@ public class TileEntityUniversalCable extends TileEntity implements IUniversalCa { return INFINITE_EXTENT_AABB; } + + @Override + public void onChunkUnload() { + invalidate(); + EnergyNetworkRegistry.getInstance().pruneEmptyNetworks(); + } } class CablePowerProvider extends PowerProvider From b01cf3b8f76a0ce3d387071c8648cccf665cd7a1 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 29 Jul 2013 21:38:10 +0100 Subject: [PATCH 07/12] Make it so that /mk is always available in SSP --- common/mekanism/common/CommandMekanism.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/mekanism/common/CommandMekanism.java b/common/mekanism/common/CommandMekanism.java index 785461876..7f78cdff2 100644 --- a/common/mekanism/common/CommandMekanism.java +++ b/common/mekanism/common/CommandMekanism.java @@ -8,10 +8,17 @@ import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatMessageComponent; +import net.minecraft.server.MinecraftServer; public class CommandMekanism extends CommandBase { @Override + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(sender); + } + + @Override public String getCommandName() { return "mk"; From 30ca7d82d64ce4e6d3715ef403cdec4183745fb9 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 29 Jul 2013 04:57:56 +0100 Subject: [PATCH 08/12] Add ability to manually force-fix a network using a configurator --- common/mekanism/common/ItemConfigurator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/mekanism/common/ItemConfigurator.java b/common/mekanism/common/ItemConfigurator.java index d9e507fd7..fc7edc113 100644 --- a/common/mekanism/common/ItemConfigurator.java +++ b/common/mekanism/common/ItemConfigurator.java @@ -60,6 +60,10 @@ public class ItemConfigurator extends ItemEnergized return true; } } + else if(world.getBlockTileEntity(x, y, z) instanceof IUniversalCable) + { + ((IUniversalCable)world.getBlockTileEntity(x, y, z)).fixNetwork(); + } if(getState(stack) == 0) { From b3909b7e6e6a6373244ec870ed901ed0c940bd38 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 29 Jul 2013 22:52:31 +0100 Subject: [PATCH 09/12] Add debug info to EnergyMeter --- common/mekanism/common/ItemEnergyMeter.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/mekanism/common/ItemEnergyMeter.java b/common/mekanism/common/ItemEnergyMeter.java index 7cc9713bb..ebdb1426d 100644 --- a/common/mekanism/common/ItemEnergyMeter.java +++ b/common/mekanism/common/ItemEnergyMeter.java @@ -44,6 +44,11 @@ public class ItemEnergyMeter extends ItemEnergized player.sendChatToPlayer(ChatMessageComponent.func_111066_d(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------")); } } + if(player.isSneaking() && Mekanism.debug){ + player.sendChatToPlayer(ChatMessageComponent.func_111066_d(EnumColor.GREY + "---------- " + EnumColor.DARK_BLUE + "[Mekanism Debug]" + EnumColor.GREY + " ----------")); + player.sendChatToPlayer(ChatMessageComponent.func_111066_d(EnumColor.GREY + " *Networks: " + EnumColor.DARK_GREY + EnergyNetworkRegistry.getInstance().toString())); + player.sendChatToPlayer(ChatMessageComponent.func_111066_d(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------")); + } } return false; From 60d9ac6d01cf73d6a13c02ef67bfca8c2b99630b Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 29 Jul 2013 23:17:52 +0100 Subject: [PATCH 10/12] Oops. --- common/mekanism/common/EnergyNetwork.java | 1 - 1 file changed, 1 deletion(-) diff --git a/common/mekanism/common/EnergyNetwork.java b/common/mekanism/common/EnergyNetwork.java index 0a77c4e91..d24097b82 100644 --- a/common/mekanism/common/EnergyNetwork.java +++ b/common/mekanism/common/EnergyNetwork.java @@ -289,7 +289,6 @@ public class EnergyNetwork public void fixMessedUpNetwork(IUniversalCable cable) { - System.out.println("Fixing Network"); if(cable instanceof TileEntity) { NetworkFinder finder = new NetworkFinder(((TileEntity) cable).getWorldObj(), Object3D.get((TileEntity)cable), null); From 04a3d0f50506c29fb2c4e58a5dc8c90a50505499 Mon Sep 17 00:00:00 2001 From: ruifung Date: Tue, 30 Jul 2013 13:06:45 +0800 Subject: [PATCH 11/12] Update README.md You forgot to update README.md to say Minecraft 1.6.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8affe3cbd..b7aed250a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mekanism for Minecraft 1.5.2 # +# Mekanism for Minecraft 1.6.2 # Source code. More information can be found on the mod's forum post. From 248a97659316519e43c9208d606fcaf0117e3929 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Wed, 31 Jul 2013 03:28:46 +0100 Subject: [PATCH 12/12] Possible hotfix for optifine crash --- common/mekanism/client/MekanismRenderer.java | 25 ++++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/common/mekanism/client/MekanismRenderer.java b/common/mekanism/client/MekanismRenderer.java index c29eff632..c6768bc7a 100644 --- a/common/mekanism/client/MekanismRenderer.java +++ b/common/mekanism/client/MekanismRenderer.java @@ -31,7 +31,8 @@ public class MekanismRenderer private static float lightmapLastX; private static float lightmapLastY; - + private static boolean optifineBreak = false; + public static class Model3D { public double minX; @@ -145,15 +146,29 @@ public class MekanismRenderer public static void glowOn() { GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); - lightmapLastX = OpenGlHelper.lastBrightnessX; - lightmapLastY = OpenGlHelper.lastBrightnessY; + try + { + lightmapLastX = OpenGlHelper.lastBrightnessX; + lightmapLastY = OpenGlHelper.lastBrightnessY; + } + catch(NoSuchFieldError e) + { + optifineBreak = true; + } RenderHelper.disableStandardItemLighting(); - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F); + if(!optifineBreak) + { + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F); + } + } public static void glowOff() { - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapLastX, lightmapLastY); + if(!optifineBreak) + { + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapLastX, lightmapLastY); + } GL11.glPopAttrib(); }