diff --git a/block/solids/BlockMatrixFrame.java b/block/spatial/BlockMatrixFrame.java similarity index 54% rename from block/solids/BlockMatrixFrame.java rename to block/spatial/BlockMatrixFrame.java index f9853084..2b336bac 100644 --- a/block/solids/BlockMatrixFrame.java +++ b/block/spatial/BlockMatrixFrame.java @@ -1,18 +1,23 @@ -package appeng.block.solids; +package appeng.block.spatial; +import java.util.Arrays; import java.util.EnumSet; import java.util.List; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; import appeng.block.AEBaseBlock; import appeng.client.render.BaseBlockRender; import appeng.client.render.blocks.RenderNull; import appeng.core.features.AEFeature; +import appeng.helpers.ICustomCollision; -public class BlockMatrixFrame extends AEBaseBlock +public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision { public BlockMatrixFrame() { @@ -42,4 +47,17 @@ public class BlockMatrixFrame extends AEBaseBlock } + @Override + public Iterable getSelectedBoundingBoxsFromPool(World w, int x, int y, int z, Entity e, boolean isVisual) + { + return Arrays.asList( new AxisAlignedBB[] {} );// AxisAlignedBB.getBoundingBox( 0.25, 0, 0.25, 0.75, 0.5, 0.75 ) + // } ); + } + + @Override + public void addCollidingBlockToList(World w, int x, int y, int z, AxisAlignedBB bb, List out, Entity e) + { + out.add( AxisAlignedBB.getAABBPool().getAABB( 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 ) ); + } + } diff --git a/core/Registration.java b/core/Registration.java index 9e3991a6..ca96efca 100644 --- a/core/Registration.java +++ b/core/Registration.java @@ -51,7 +51,6 @@ import appeng.block.networking.BlockWireless; import appeng.block.qnb.BlockQuantumLinkChamber; import appeng.block.qnb.BlockQuantumRing; import appeng.block.solids.BlockFluix; -import appeng.block.solids.BlockMatrixFrame; import appeng.block.solids.BlockQuartz; import appeng.block.solids.BlockQuartzChiseled; import appeng.block.solids.BlockQuartzGlass; @@ -60,6 +59,7 @@ import appeng.block.solids.BlockQuartzPillar; import appeng.block.solids.BlockSkyStone; import appeng.block.solids.OreQuartz; import appeng.block.solids.OreQuartzCharged; +import appeng.block.spatial.BlockMatrixFrame; import appeng.block.spatial.BlockSpatialIOPort; import appeng.block.spatial.BlockSpatialPylon; import appeng.block.storage.BlockChest; diff --git a/me/cluster/implementations/QuantumCluster.java b/me/cluster/implementations/QuantumCluster.java index a1f67b19..1300dac5 100644 --- a/me/cluster/implementations/QuantumCluster.java +++ b/me/cluster/implementations/QuantumCluster.java @@ -3,7 +3,9 @@ package appeng.me.cluster.implementations; import java.util.Iterator; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.world.WorldEvent; @@ -61,13 +63,17 @@ public class QuantumCluster implements ILocatable, IAECluster QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locateable().findLocateableBySerial( qe ); if ( qc != null && qc.center instanceof TileQuantumBridge ) { + World theWorld = qc.getCenter().getWorldObj(); if ( !qc.isDestroyed ) { - Chunk c = qc.center.getWorldObj().getChunkFromBlockCoords( qc.center.xCoord, qc.center.zCoord ); + Chunk c = theWorld.getChunkFromBlockCoords( qc.center.xCoord, qc.center.zCoord ); if ( c.isChunkLoaded ) { - TileEntity te = qc.center.getWorldObj().getTileEntity( qc.center.xCoord, qc.center.yCoord, qc.center.zCoord ); - return te != qc.center; + int id = theWorld.provider.dimensionId; + World cur = DimensionManager.getWorld( id ); + + TileEntity te = theWorld.getTileEntity( qc.center.xCoord, qc.center.yCoord, qc.center.zCoord ); + return te != qc.center || theWorld != cur; } } } @@ -142,6 +148,24 @@ public class QuantumCluster implements ILocatable, IAECluster try { + if ( sideA.connection != null ) + { + if ( sideA.connection.connection != null ) + { + sideA.connection.connection.destroy(); + sideA.connection = new ConnectionWrapper( null ); + } + } + + if ( sideB.connection != null ) + { + if ( sideB.connection.connection != null ) + { + sideB.connection.connection.destroy(); + sideB.connection = new ConnectionWrapper( null ); + } + } + sideA.connection = sideB.connection = new ConnectionWrapper( AEApi.instance().createGridConnection( sideA.getNode(), sideB.getNode() ) ); } catch (FailedConnection e) diff --git a/me/helpers/AENetworkProxyMultiblock.java b/me/helpers/AENetworkProxyMultiblock.java index f4798d94..18342799 100644 --- a/me/helpers/AENetworkProxyMultiblock.java +++ b/me/helpers/AENetworkProxyMultiblock.java @@ -2,6 +2,7 @@ package appeng.me.helpers; import java.util.Iterator; +import net.minecraft.item.ItemStack; import appeng.api.networking.IGridMultiblock; import appeng.api.networking.IGridNode; import appeng.me.cluster.IAECluster; @@ -17,8 +18,8 @@ public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMul return ((IAEMultiBlock) getMachine()).getCluster(); } - public AENetworkProxyMultiblock(IGridProxyable te, String nbtName, boolean inWorld) { - super( te, nbtName, null, inWorld ); + public AENetworkProxyMultiblock(IGridProxyable te, String nbtName, ItemStack itemStack, boolean inWorld) { + super( te, nbtName, itemStack, inWorld ); } @Override diff --git a/spatial/StorageHelper.java b/spatial/StorageHelper.java index fd33cc29..b36239a4 100644 --- a/spatial/StorageHelper.java +++ b/spatial/StorageHelper.java @@ -15,7 +15,7 @@ import net.minecraft.world.World; import net.minecraft.world.WorldServer; import appeng.api.AEApi; import appeng.api.util.WorldCoord; -import appeng.block.solids.BlockMatrixFrame; +import appeng.block.spatial.BlockMatrixFrame; import appeng.core.AELog; import appeng.util.Platform; import cpw.mods.fml.relauncher.ReflectionHelper; diff --git a/spatial/StorageWorldProvider.java b/spatial/StorageWorldProvider.java index 03198c09..a465c070 100644 --- a/spatial/StorageWorldProvider.java +++ b/spatial/StorageWorldProvider.java @@ -48,6 +48,12 @@ public class StorageWorldProvider extends WorldProvider return false; } + @Override + public boolean canSnowAt(int x, int y, int z, boolean checkLight) + { + return false; + } + @Override public boolean canDoLightning(Chunk chunk) { diff --git a/tile/spatial/TileSpatialPylon.java b/tile/spatial/TileSpatialPylon.java index eb39b644..62014749 100644 --- a/tile/spatial/TileSpatialPylon.java +++ b/tile/spatial/TileSpatialPylon.java @@ -44,7 +44,7 @@ public class TileSpatialPylon extends AENetworkTile implements IAEMultiBlock @Override protected AENetworkProxy createProxy() { - return new AENetworkProxyMultiblock( this, "proxy", true ); + return new AENetworkProxyMultiblock( this, "proxy", getItemFromTile( this ), true ); } @Override