From 5dec6e7003064526632b00d2fb41baee9d82f5b3 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Thu, 12 Jun 2014 09:37:08 -0500 Subject: [PATCH 1/5] Cell Type Usage Fixed. --- items/storage/ItemBasicStorageCell.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/items/storage/ItemBasicStorageCell.java b/items/storage/ItemBasicStorageCell.java index 73d630d6..223a7b1c 100644 --- a/items/storage/ItemBasicStorageCell.java +++ b/items/storage/ItemBasicStorageCell.java @@ -34,6 +34,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II final MaterialType component; final int totalBytes; + final int perType; final double idleDrain; public ItemBasicStorageCell(MaterialType whichCell, int Kilobytes) { @@ -47,18 +48,23 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II { case Cell1kPart: idleDrain = 0.5; + perType = 8; break; case Cell4kPart: idleDrain = 1.0; + perType = 32; break; case Cell16kPart: idleDrain = 1.5; + perType = 128; break; case Cell64kPart: idleDrain = 2.0; + perType = 512; break; default: idleDrain = 0.0; + perType = 8; } } From 4763069fabde4084d59c948e32f44e4314829980 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Fri, 13 Jun 2014 12:42:09 -0500 Subject: [PATCH 2/5] Removed Vec3Pool --- block/networking/BlockCableBus.java | 2 +- items/tools/powered/ToolMassCannon.java | 4 ++-- spatial/StorageWorldProvider.java | 4 ++-- util/Platform.java | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/block/networking/BlockCableBus.java b/block/networking/BlockCableBus.java index ee97652e..e000b679 100644 --- a/block/networking/BlockCableBus.java +++ b/block/networking/BlockCableBus.java @@ -334,7 +334,7 @@ public class BlockCableBus extends AEBaseBlock @Override public boolean onActivated(World w, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - return cb( w, x, y, z ).activate( player, w.getWorldVec3Pool().getVecFromPool( hitX, hitY, hitZ ) ); + return cb( w, x, y, z ).activate( player, Vec3.createVectorHelper( hitX, hitY, hitZ ) ); } @Override diff --git a/items/tools/powered/ToolMassCannon.java b/items/tools/powered/ToolMassCannon.java index db96e7ec..260a0b46 100644 --- a/items/tools/powered/ToolMassCannon.java +++ b/items/tools/powered/ToolMassCannon.java @@ -121,7 +121,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell double d0 = p.prevPosX + (p.posX - p.prevPosX) * (double) f; double d1 = p.prevPosY + (p.posY - p.prevPosY) * (double) f + 1.62D - (double) p.yOffset; double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * (double) f; - Vec3 vec3 = w.getWorldVec3Pool().getVecFromPool( d0, d1, d2 ); + Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 ); float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); float f5 = -MathHelper.cos( -f1 * 0.017453292F ); @@ -177,7 +177,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell } } - Vec3 Srec = w.getWorldVec3Pool().getVecFromPool( d0, d1, d2 ); + Vec3 Srec = Vec3.createVectorHelper( d0, d1, d2 ); MovingObjectPosition pos = w.rayTraceBlocks( vec3, vec31, true ); if ( entity != null && pos != null && pos.hitVec.squareDistanceTo( Srec ) > Closeest ) { diff --git a/spatial/StorageWorldProvider.java b/spatial/StorageWorldProvider.java index bf312277..adb81085 100644 --- a/spatial/StorageWorldProvider.java +++ b/spatial/StorageWorldProvider.java @@ -77,7 +77,7 @@ public class StorageWorldProvider extends WorldProvider @Override public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) { - return this.worldObj.getWorldVec3Pool().getVecFromPool( 0.0, 0.0, 0.0 ); + return Vec3.createVectorHelper( 0.0, 0.0, 0.0 ); } @Override @@ -102,7 +102,7 @@ public class StorageWorldProvider extends WorldProvider @Override public Vec3 getFogColor(float par1, float par2) { - return this.worldObj.getWorldVec3Pool().getVecFromPool( 0.0, 0.0, 0.0 ); + return Vec3.createVectorHelper( 0.0, 0.0, 0.0 ); } @Override diff --git a/util/Platform.java b/util/Platform.java index 8857301d..35140c90 100644 --- a/util/Platform.java +++ b/util/Platform.java @@ -1195,7 +1195,7 @@ public class Platform + (double) (player.worldObj.isRemote ? player.getEyeHeight() - player.getDefaultEyeHeight() : player.getEyeHeight()); // isRemote double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f; - Vec3 vec3 = player.worldObj.getWorldVec3Pool().getVecFromPool( d0, d1, d2 ); + Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 ); float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); float f5 = -MathHelper.cos( -f1 * 0.017453292F ); @@ -1222,7 +1222,7 @@ public class Platform double d0 = p.prevPosX + (p.posX - p.prevPosX) * (double) f; double d1 = p.prevPosY + (p.posY - p.prevPosY) * (double) f + 1.62D - (double) p.yOffset; double d2 = p.prevPosZ + (p.posZ - p.prevPosZ) * (double) f; - Vec3 vec3 = w.getWorldVec3Pool().getVecFromPool( d0, d1, d2 ); + Vec3 vec3 = Vec3.createVectorHelper( d0, d1, d2 ); float f3 = MathHelper.cos( -f2 * 0.017453292F - (float) Math.PI ); float f4 = MathHelper.sin( -f2 * 0.017453292F - (float) Math.PI ); float f5 = -MathHelper.cos( -f1 * 0.017453292F ); @@ -1281,7 +1281,7 @@ public class Platform if ( hitBlocks ) { - Srec = w.getWorldVec3Pool().getVecFromPool( d0, d1, d2 ); + Srec = Vec3.createVectorHelper( d0, d1, d2 ); pos = w.rayTraceBlocks( vec3, vec31, true ); } From 0324dc62b9a96f44df82231da274507dcab28fc9 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Fri, 13 Jun 2014 13:41:50 -0500 Subject: [PATCH 3/5] Creative Tab now available server side; fixes https://github.com/Dynious/RefinedRelocation/issues/83 --- core/AppEng.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/AppEng.java b/core/AppEng.java index 27348252..248cc503 100644 --- a/core/AppEng.java +++ b/core/AppEng.java @@ -111,13 +111,12 @@ public class AppEng AELog.info( "Starting ( PreInit )" ); + CreativeTab.init(); + if ( AEConfig.instance.isFeatureEnabled( AEFeature.Facades ) ) + CreativeTabFacade.init(); + if ( Platform.isClient() ) - { - CreativeTab.init(); - if ( AEConfig.instance.isFeatureEnabled( AEFeature.Facades ) ) - CreativeTabFacade.init(); CommonHelper.proxy.init(); - } Registration.instance.PreInit( event ); From ed85b174c6b3274249f912b8237fd6dccd0bcdc0 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Fri, 13 Jun 2014 13:42:38 -0500 Subject: [PATCH 4/5] Fuzzy no longer matches ore dictionary less items as the same. aka Bug: #0534 - Import Bus with Fuzzy Card does not work with damaged items --- util/item/OreHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/item/OreHelper.java b/util/item/OreHelper.java index 802b7f25..dcc05341 100644 --- a/util/item/OreHelper.java +++ b/util/item/OreHelper.java @@ -129,12 +129,12 @@ public class OreHelper public boolean sameOre(OreRefrence a, OreRefrence b) { - if ( a == b ) - return true; - if ( a == null || b == null ) return false; + if ( a == b ) + return true; + Collection bOres = b.getOres(); for (Integer ore : a.ores) { From 730200ed8deadfb22e79e98843cf948a6b36fc66 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Fri, 13 Jun 2014 14:39:36 -0500 Subject: [PATCH 5/5] Multi-block clean up should be cleaner now. --- me/cluster/IAEMultiBlock.java | 3 +- .../implementations/QuantumCalculator.java | 4 +- .../implementations/QuantumCluster.java | 13 ++--- .../SpatialPylonCalculator.java | 2 +- tile/qnb/TileQuantumBridge.java | 51 ++++++++++++++----- tile/spatial/TileSpatialPylon.java | 6 +-- 6 files changed, 51 insertions(+), 28 deletions(-) diff --git a/me/cluster/IAEMultiBlock.java b/me/cluster/IAEMultiBlock.java index 28bd256f..9384caea 100644 --- a/me/cluster/IAEMultiBlock.java +++ b/me/cluster/IAEMultiBlock.java @@ -3,10 +3,11 @@ package appeng.me.cluster; public interface IAEMultiBlock { - void disconnect(); + void disconnect(boolean b); IAECluster getCluster(); boolean isValid(); + } diff --git a/me/cluster/implementations/QuantumCalculator.java b/me/cluster/implementations/QuantumCalculator.java index 55068f93..7c730424 100644 --- a/me/cluster/implementations/QuantumCalculator.java +++ b/me/cluster/implementations/QuantumCalculator.java @@ -73,7 +73,7 @@ public class QuantumCalculator extends MBCalculator c.Ring[ringNum++] = te; } - te.updateStatus( c, flags ); + te.updateStatus( c, flags, true ); } } } @@ -89,7 +89,7 @@ public class QuantumCalculator extends MBCalculator @Override public void disconnect() { - tqb.disconnect(); + tqb.disconnect(true); } @Override diff --git a/me/cluster/implementations/QuantumCluster.java b/me/cluster/implementations/QuantumCluster.java index e9b9831a..8d3525e8 100644 --- a/me/cluster/implementations/QuantumCluster.java +++ b/me/cluster/implementations/QuantumCluster.java @@ -29,7 +29,7 @@ public class QuantumCluster implements ILocatable, IAECluster public WorldCoord min; public WorldCoord max; public boolean isDestroyed = false; - private boolean updateStatus = true; + public boolean updateStatus = true; boolean registered = false; private long thisSide; @@ -211,14 +211,11 @@ public class QuantumCluster implements ILocatable, IAECluster MinecraftForge.EVENT_BUS.post( new LocatableEventAnnounce( this, LocatableEvent.Unregister ) ); } - if ( updateStatus ) - { - center.updateStatus( null, (byte) -1 ); + center.updateStatus( null, (byte) -1, updateStatus ); - for (TileQuantumBridge r : Ring) - { - r.updateStatus( null, (byte) -1 ); - } + for (TileQuantumBridge r : Ring) + { + r.updateStatus( null, (byte) -1, updateStatus ); } center = null; diff --git a/me/cluster/implementations/SpatialPylonCalculator.java b/me/cluster/implementations/SpatialPylonCalculator.java index c9205cec..a7f8aeff 100644 --- a/me/cluster/implementations/SpatialPylonCalculator.java +++ b/me/cluster/implementations/SpatialPylonCalculator.java @@ -60,7 +60,7 @@ public class SpatialPylonCalculator extends MBCalculator @Override public void disconnect() { - tqb.disconnect(); + tqb.disconnect(true); } @Override diff --git a/tile/qnb/TileQuantumBridge.java b/tile/qnb/TileQuantumBridge.java index 201f9192..6e9e59cb 100644 --- a/tile/qnb/TileQuantumBridge.java +++ b/tile/qnb/TileQuantumBridge.java @@ -130,12 +130,20 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock } @Override - public void disconnect() + public void disconnect(boolean affectWorld) { if ( clust != null ) + { + if ( ! affectWorld ) + clust.updateStatus = false; + clust.destroy(); + } + clust = null; - gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); + + if ( affectWorld ) + gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) ); } @Override @@ -158,22 +166,39 @@ public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock gridProxy.setVisualRepresentation( ring ); } - public void updateStatus(QuantumCluster c, byte flags) + @Override + public void invalidate() + { + disconnect(false); + super.invalidate(); + } + + @Override + public void onChunkUnload() + { + disconnect(false); + super.onChunkUnload(); + } + + public void updateStatus(QuantumCluster c, byte flags, boolean affectWorld) { clust = c; - if ( xdex != flags ) + if ( affectWorld ) { - xdex = flags; - markForUpdate(); + if ( xdex != flags ) + { + xdex = flags; + markForUpdate(); + } + + if ( isCorner() || isCenter() ) + { + gridProxy.setValidSides( getConnections() ); + } + else + gridProxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); } - - if ( isCorner() || isCenter() ) - { - gridProxy.setValidSides( getConnections() ); - } - else - gridProxy.setValidSides( EnumSet.allOf( ForgeDirection.class ) ); } public long getQEDest() diff --git a/tile/spatial/TileSpatialPylon.java b/tile/spatial/TileSpatialPylon.java index 62014749..6db11c32 100644 --- a/tile/spatial/TileSpatialPylon.java +++ b/tile/spatial/TileSpatialPylon.java @@ -127,15 +127,15 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock @Override public void invalidate() { + disconnect(false); super.invalidate(); - disconnect(); } @Override public void onChunkUnload() { + disconnect(false); super.onChunkUnload(); - disconnect(); } public void onNeighborBlockChange() @@ -207,7 +207,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock } @Override - public void disconnect() + public void disconnect(boolean b) { if ( clust != null ) {