Most of the 1.8 Port.
This commit is contained in:
@@ -22,14 +22,13 @@ package appeng.me;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.exceptions.FailedConnection;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
import appeng.api.networking.pathing.IPathingGrid;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IReadOnlyCollection;
|
||||
import appeng.core.AEConfig;
|
||||
@@ -47,10 +46,10 @@ public class GridConnection implements IGridConnection, IPathItem
|
||||
public int channelData = 0;
|
||||
Object visitorIterationNumber = null;
|
||||
private GridNode sideA;
|
||||
private ForgeDirection fromAtoB;
|
||||
private AEPartLocation fromAtoB;
|
||||
private GridNode sideB;
|
||||
|
||||
public GridConnection( IGridNode aNode, IGridNode bNode, ForgeDirection fromAtoB ) throws FailedConnection
|
||||
public GridConnection( IGridNode aNode, IGridNode bNode, AEPartLocation fromAtoB ) throws FailedConnection
|
||||
{
|
||||
|
||||
GridNode a = (GridNode) aNode;
|
||||
@@ -143,9 +142,9 @@ public class GridConnection implements IGridConnection, IPathItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection getDirection( IGridNode side )
|
||||
public AEPartLocation getDirection( IGridNode side )
|
||||
{
|
||||
if( this.fromAtoB == ForgeDirection.UNKNOWN )
|
||||
if( this.fromAtoB == AEPartLocation.INTERNAL )
|
||||
{
|
||||
return this.fromAtoB;
|
||||
}
|
||||
@@ -189,7 +188,7 @@ public class GridConnection implements IGridConnection, IPathItem
|
||||
@Override
|
||||
public boolean hasDirection()
|
||||
{
|
||||
return this.fromAtoB != ForgeDirection.UNKNOWN;
|
||||
return this.fromAtoB != AEPartLocation.INTERNAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,9 +29,9 @@ import java.util.concurrent.Callable;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.exceptions.FailedConnection;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.GridNotification;
|
||||
@@ -47,6 +47,7 @@ import appeng.api.networking.energy.IEnergyGrid;
|
||||
import appeng.api.networking.events.MENetworkChannelsChanged;
|
||||
import appeng.api.networking.pathing.IPathingGrid;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IReadOnlyCollection;
|
||||
import appeng.core.WorldSettings;
|
||||
@@ -208,7 +209,7 @@ public class GridNode implements IGridNode, IPathItem
|
||||
|
||||
this.compressedData |= ( this.gridProxy.getGridColor().ordinal() << 3 );
|
||||
|
||||
for( ForgeDirection dir : this.gridProxy.getConnectableSides() )
|
||||
for( EnumFacing dir : this.gridProxy.getConnectableSides() )
|
||||
{
|
||||
this.compressedData |= ( 1 << ( dir.ordinal() + 8 ) );
|
||||
}
|
||||
@@ -285,9 +286,9 @@ public class GridNode implements IGridNode, IPathItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getConnectedSides()
|
||||
public EnumSet<AEPartLocation> getConnectedSides()
|
||||
{
|
||||
EnumSet<ForgeDirection> set = EnumSet.noneOf( ForgeDirection.class );
|
||||
EnumSet<AEPartLocation> set = EnumSet.noneOf( AEPartLocation.class );
|
||||
for( IGridConnection gc : this.connections )
|
||||
{
|
||||
set.add( gc.getDirection( this ) );
|
||||
@@ -394,12 +395,12 @@ public class GridNode implements IGridNode, IPathItem
|
||||
return;
|
||||
}
|
||||
|
||||
EnumSet<ForgeDirection> newSecurityConnections = EnumSet.noneOf( ForgeDirection.class );
|
||||
EnumSet<AEPartLocation> newSecurityConnections = EnumSet.noneOf( AEPartLocation.class );
|
||||
|
||||
DimensionalCoord dc = this.gridProxy.getLocation();
|
||||
for( ForgeDirection f : ForgeDirection.VALID_DIRECTIONS )
|
||||
for( AEPartLocation f : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.offsetX, dc.y + f.offsetY, dc.z + f.offsetZ );
|
||||
IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.xOffset, dc.y + f.yOffset, dc.z + f.zOffset );
|
||||
if( te != null )
|
||||
{
|
||||
GridNode node = (GridNode) te.getGridNode( f.getOpposite() );
|
||||
@@ -462,9 +463,9 @@ public class GridNode implements IGridNode, IPathItem
|
||||
}
|
||||
}
|
||||
|
||||
for( ForgeDirection f : newSecurityConnections )
|
||||
for( AEPartLocation f : newSecurityConnections )
|
||||
{
|
||||
IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.offsetX, dc.y + f.offsetY, dc.z + f.offsetZ );
|
||||
IGridHost te = this.findGridHost( dc.getWorld(), dc.x + f.xOffset, dc.y + f.yOffset, dc.z + f.zOffset );
|
||||
if( te != null )
|
||||
{
|
||||
GridNode node = (GridNode) te.getGridNode( f.getOpposite() );
|
||||
@@ -490,9 +491,10 @@ public class GridNode implements IGridNode, IPathItem
|
||||
|
||||
private IGridHost findGridHost( World world, int x, int y, int z )
|
||||
{
|
||||
if( world.blockExists( x, y, z ) )
|
||||
BlockPos pos = new BlockPos(x,y,z);
|
||||
if( world.isBlockLoaded( pos ) )
|
||||
{
|
||||
TileEntity te = world.getTileEntity( x, y, z );
|
||||
TileEntity te = world.getTileEntity( pos );
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
return (IGridHost) te;
|
||||
@@ -501,7 +503,7 @@ public class GridNode implements IGridNode, IPathItem
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canConnect( GridNode from, ForgeDirection dir )
|
||||
public boolean canConnect( GridNode from, AEPartLocation dir )
|
||||
{
|
||||
if( !this.isValidDirection( dir ) )
|
||||
{
|
||||
@@ -516,7 +518,7 @@ public class GridNode implements IGridNode, IPathItem
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isValidDirection( ForgeDirection dir )
|
||||
private boolean isValidDirection( AEPartLocation dir )
|
||||
{
|
||||
return ( this.compressedData & ( 1 << ( 8 + dir.ordinal() ) ) ) > 0;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import java.util.WeakHashMap;
|
||||
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridStorage;
|
||||
import appeng.core.AELog;
|
||||
|
||||
+6
-7
@@ -36,14 +36,7 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.ImmutableCollection;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.IGrid;
|
||||
@@ -85,6 +78,12 @@ import appeng.tile.crafting.TileCraftingStorageTile;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.util.ItemSorters;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.ImmutableCollection;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
|
||||
public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper, ICellProvider, IMEInventoryHandler<IAEStack>
|
||||
{
|
||||
|
||||
+3
-3
@@ -26,9 +26,6 @@ import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.Multiset;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
@@ -54,6 +51,9 @@ import appeng.me.GridNode;
|
||||
import appeng.me.energy.EnergyThreshold;
|
||||
import appeng.me.energy.EnergyWatcher;
|
||||
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.Multiset;
|
||||
|
||||
|
||||
public class EnergyGridCache implements IEnergyGrid
|
||||
{
|
||||
|
||||
+3
-3
@@ -24,9 +24,6 @@ import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
@@ -54,6 +51,9 @@ import appeng.me.helpers.GenericInterestManager;
|
||||
import appeng.me.storage.ItemWatcher;
|
||||
import appeng.me.storage.NetworkInventoryHandler;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
|
||||
|
||||
public class GridStorageCache implements IStorageGrid
|
||||
{
|
||||
|
||||
+3
-3
@@ -21,9 +21,6 @@ package appeng.me.cache;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.google.common.collect.LinkedHashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridCache;
|
||||
@@ -38,6 +35,9 @@ import appeng.me.cache.helpers.TunnelCollection;
|
||||
import appeng.parts.p2p.PartP2PTunnel;
|
||||
import appeng.parts.p2p.PartP2PTunnelME;
|
||||
|
||||
import com.google.common.collect.LinkedHashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
|
||||
public class P2PCache implements IGridCache
|
||||
{
|
||||
|
||||
+3
-4
@@ -26,8 +26,6 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridBlock;
|
||||
@@ -42,6 +40,7 @@ import appeng.api.networking.events.MENetworkControllerChange;
|
||||
import appeng.api.networking.events.MENetworkEventSubscribe;
|
||||
import appeng.api.networking.pathing.ControllerState;
|
||||
import appeng.api.networking.pathing.IPathingGrid;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -187,7 +186,7 @@ public class PathGridCache implements IPathingGrid
|
||||
if( controllerIterator.hasNext() )
|
||||
{
|
||||
final TileController controller = controllerIterator.next();
|
||||
controller.getGridNode( ForgeDirection.UNKNOWN ).beginVisit( new ControllerChannelUpdater() );
|
||||
controller.getGridNode( AEPartLocation.INTERNAL ).beginVisit( new ControllerChannelUpdater() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +277,7 @@ public class PathGridCache implements IPathingGrid
|
||||
}
|
||||
else
|
||||
{
|
||||
IGridNode startingNode = this.controllers.iterator().next().getGridNode( ForgeDirection.UNKNOWN );
|
||||
IGridNode startingNode = this.controllers.iterator().next().getGridNode( AEPartLocation.INTERNAL );
|
||||
if( startingNode == null )
|
||||
{
|
||||
this.controllerState = ControllerState.CONTROLLER_CONFLICT;
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.PriorityQueue;
|
||||
import net.minecraft.crash.CrashReport;
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
import net.minecraft.util.ReportedException;
|
||||
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.me.cache.helpers;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.crash.CrashReportCategory;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.ticking.IGridTickable;
|
||||
import appeng.api.networking.ticking.TickingRequest;
|
||||
|
||||
@@ -20,9 +20,9 @@ package appeng.me.cluster;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.core.AELog;
|
||||
import appeng.util.Platform;
|
||||
@@ -124,7 +124,7 @@ public abstract class MBCalculator
|
||||
|
||||
public boolean isValidTileAt( World w, int x, int y, int z )
|
||||
{
|
||||
return this.isValidTile( w.getTileEntity( x, y, z ) );
|
||||
return this.isValidTile( w.getTileEntity( new BlockPos( x, y, z ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,7 +139,7 @@ public abstract class MBCalculator
|
||||
|
||||
public boolean verifyUnownedRegion( World w, WorldCoord min, WorldCoord max )
|
||||
{
|
||||
for( ForgeDirection side : ForgeDirection.VALID_DIRECTIONS )
|
||||
for( AEPartLocation side : AEPartLocation.SIDE_LOCATIONS )
|
||||
{
|
||||
if( this.verifyUnownedRegionInner( w, min.x, min.y, min.z, max.x, max.y, max.z, side ) )
|
||||
{
|
||||
@@ -187,7 +187,7 @@ public abstract class MBCalculator
|
||||
*/
|
||||
public abstract boolean isValidTile( TileEntity te );
|
||||
|
||||
public boolean verifyUnownedRegionInner( World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, ForgeDirection side )
|
||||
public boolean verifyUnownedRegionInner( World w, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, AEPartLocation side )
|
||||
{
|
||||
switch( side )
|
||||
{
|
||||
@@ -215,7 +215,7 @@ public abstract class MBCalculator
|
||||
maxY += 1;
|
||||
minY = maxY;
|
||||
break;
|
||||
case UNKNOWN:
|
||||
case INTERNAL:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ public abstract class MBCalculator
|
||||
{
|
||||
for( int z = minZ; z <= maxZ; z++ )
|
||||
{
|
||||
TileEntity te = w.getTileEntity( x, y, z );
|
||||
TileEntity te = w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
if( this.isValidTile( te ) )
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -22,13 +22,13 @@ package appeng.me.cluster.implementations;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.events.MENetworkCraftingCpuChange;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.me.cluster.IAECluster;
|
||||
import appeng.me.cluster.IAEMultiBlock;
|
||||
@@ -85,7 +85,7 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z );
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
|
||||
if( !te.isValid() )
|
||||
{
|
||||
@@ -120,7 +120,7 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
TileCraftingTile te = (TileCraftingTile) w.getTileEntity( x, y, z );
|
||||
TileCraftingTile te = (TileCraftingTile) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
te.updateStatus( c );
|
||||
c.addTile( te );
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class CraftingCPUCalculator extends MBCalculator
|
||||
while( i.hasNext() )
|
||||
{
|
||||
IGridHost gh = i.next();
|
||||
IGridNode n = gh.getGridNode( ForgeDirection.UNKNOWN );
|
||||
IGridNode n = gh.getGridNode( AEPartLocation.INTERNAL );
|
||||
if( n != null )
|
||||
{
|
||||
IGrid g = n.getGrid();
|
||||
|
||||
@@ -26,18 +26,13 @@ import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -79,6 +74,9 @@ import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
|
||||
public class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
{
|
||||
@@ -1245,7 +1243,7 @@ public class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
|
||||
private World getWorld()
|
||||
{
|
||||
return this.getCore().getWorldObj();
|
||||
return this.getCore().getWorld();
|
||||
}
|
||||
|
||||
public boolean isMaking( IAEItemStack what )
|
||||
|
||||
@@ -21,9 +21,9 @@ package appeng.me.cluster.implementations;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
@@ -78,7 +78,8 @@ public class QuantumCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z );
|
||||
BlockPos p = new BlockPos( x, y, z );
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( p );
|
||||
|
||||
if( !te.isValid() )
|
||||
{
|
||||
@@ -89,14 +90,14 @@ public class QuantumCalculator extends MBCalculator
|
||||
final IBlocks blocks = AEApi.instance().definitions().blocks();
|
||||
if( num == 5 )
|
||||
{
|
||||
if( !this.isBlockAtLocation( w, x, y, z, blocks.quantumLink() ) )
|
||||
if( !this.isBlockAtLocation( w, p, blocks.quantumLink() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !this.isBlockAtLocation( w, x, y, z, blocks.quantumRing() ) )
|
||||
if( !this.isBlockAtLocation( w, p, blocks.quantumRing() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -126,7 +127,7 @@ public class QuantumCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z );
|
||||
TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
|
||||
byte flags;
|
||||
|
||||
@@ -162,11 +163,11 @@ public class QuantumCalculator extends MBCalculator
|
||||
return te instanceof TileQuantumBridge;
|
||||
}
|
||||
|
||||
private boolean isBlockAtLocation( IBlockAccess w, int x, int y, int z, IBlockDefinition def )
|
||||
private boolean isBlockAtLocation( IBlockAccess w, BlockPos pos, IBlockDefinition def )
|
||||
{
|
||||
for( Block block : def.maybeBlock().asSet() )
|
||||
{
|
||||
return block == w.getBlock( x, y, z );
|
||||
return block == w.getBlockState( pos ).getBlock();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -26,11 +26,8 @@ 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;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.events.LocatableEventAnnounce;
|
||||
import appeng.api.events.LocatableEventAnnounce.LocatableEvent;
|
||||
@@ -38,6 +35,7 @@ import appeng.api.exceptions.FailedConnection;
|
||||
import appeng.api.features.ILocatable;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.me.cache.helpers.ConnectionWrapper;
|
||||
import appeng.me.cluster.IAECluster;
|
||||
@@ -69,7 +67,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
@SubscribeEvent
|
||||
public void onUnload( WorldEvent.Unload e )
|
||||
{
|
||||
if( this.center.getWorldObj() == e.world )
|
||||
if( this.center.getWorld() == e.world )
|
||||
{
|
||||
this.updateStatus = false;
|
||||
this.destroy();
|
||||
@@ -190,16 +188,16 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
QuantumCluster qc = (QuantumCluster) AEApi.instance().registries().locatable().getLocatableBy( qe );
|
||||
if( qc != null )
|
||||
{
|
||||
World theWorld = qc.center.getWorldObj();
|
||||
World theWorld = qc.center.getWorld();
|
||||
if( !qc.isDestroyed )
|
||||
{
|
||||
Chunk c = theWorld.getChunkFromBlockCoords( qc.center.xCoord, qc.center.zCoord );
|
||||
if( c.isChunkLoaded )
|
||||
Chunk c = theWorld.getChunkFromBlockCoords( qc.center.getPos() );
|
||||
if( c.isLoaded() )
|
||||
{
|
||||
int id = theWorld.provider.dimensionId;
|
||||
int id = theWorld.provider.getDimensionId();
|
||||
World cur = DimensionManager.getWorld( id );
|
||||
|
||||
TileEntity te = theWorld.getTileEntity( qc.center.xCoord, qc.center.yCoord, qc.center.zCoord );
|
||||
TileEntity te = theWorld.getTileEntity( qc.center.getPos() );
|
||||
return te != qc.center || theWorld != cur;
|
||||
}
|
||||
}
|
||||
@@ -219,7 +217,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
|
||||
private IGridNode getNode()
|
||||
{
|
||||
return this.center.getGridNode( ForgeDirection.UNKNOWN );
|
||||
return this.center.getGridNode( AEPartLocation.INTERNAL );
|
||||
}
|
||||
|
||||
public boolean hasQES()
|
||||
|
||||
@@ -20,8 +20,8 @@ package appeng.me.cluster.implementations;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.me.cluster.IAECluster;
|
||||
@@ -63,7 +63,7 @@ public class SpatialPylonCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( x, y, z );
|
||||
IAEMultiBlock te = (IAEMultiBlock) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
|
||||
if( !te.isValid() )
|
||||
{
|
||||
@@ -93,7 +93,7 @@ public class SpatialPylonCalculator extends MBCalculator
|
||||
{
|
||||
for( int z = min.z; z <= max.z; z++ )
|
||||
{
|
||||
TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( x, y, z );
|
||||
TileSpatialPylon te = (TileSpatialPylon) w.getTileEntity( new BlockPos( x, y, z ) );
|
||||
te.updateStatus( c );
|
||||
c.line.add( ( te ) );
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ import java.util.EnumSet;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.GridNotification;
|
||||
@@ -64,7 +63,7 @@ public class AENetworkProxy implements IGridBlock
|
||||
private ItemStack myRepInstance;
|
||||
private boolean isReady = false;
|
||||
private IGridNode node = null;
|
||||
private EnumSet<ForgeDirection> validSides;
|
||||
private EnumSet<EnumFacing> validSides;
|
||||
private EnumSet<GridFlags> flags = EnumSet.noneOf( GridFlags.class );
|
||||
private double idleDraw = 1.0;
|
||||
private EntityPlayer owner;
|
||||
@@ -75,7 +74,7 @@ public class AENetworkProxy implements IGridBlock
|
||||
this.nbtName = nbtName;
|
||||
this.worldNode = inWorld;
|
||||
this.myRepInstance = visual;
|
||||
this.validSides = EnumSet.allOf( ForgeDirection.class );
|
||||
this.validSides = EnumSet.allOf( EnumFacing.class );
|
||||
}
|
||||
|
||||
public void setVisualRepresentation( ItemStack is )
|
||||
@@ -91,7 +90,7 @@ public class AENetworkProxy implements IGridBlock
|
||||
}
|
||||
}
|
||||
|
||||
public void setValidSides( EnumSet<ForgeDirection> validSides )
|
||||
public void setValidSides( EnumSet<EnumFacing> validSides )
|
||||
{
|
||||
this.validSides = validSides;
|
||||
if( this.node != null )
|
||||
@@ -337,7 +336,7 @@ public class AENetworkProxy implements IGridBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<ForgeDirection> getConnectableSides()
|
||||
public EnumSet<EnumFacing> getConnectableSides()
|
||||
{
|
||||
return this.validSides;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ 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;
|
||||
|
||||
@@ -22,10 +22,10 @@ package appeng.me.helpers;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
|
||||
public class GenericInterestManager<T>
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package appeng.me.pathfinding;
|
||||
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.IGridVisitor;
|
||||
@@ -40,10 +41,10 @@ public class ControllerValidator implements IGridVisitor
|
||||
public ControllerValidator( int x, int y, int z )
|
||||
{
|
||||
this.minX = x;
|
||||
this.minY = y;
|
||||
this.minZ = z;
|
||||
this.maxX = x;
|
||||
this.minY = y;
|
||||
this.maxY = y;
|
||||
this.minZ = z;
|
||||
this.maxZ = z;
|
||||
}
|
||||
|
||||
@@ -55,12 +56,14 @@ public class ControllerValidator implements IGridVisitor
|
||||
{
|
||||
TileController c = (TileController) host;
|
||||
|
||||
this.minX = Math.min( c.xCoord, this.minX );
|
||||
this.maxX = Math.max( c.xCoord, this.maxX );
|
||||
this.minY = Math.min( c.yCoord, this.minY );
|
||||
this.maxY = Math.max( c.yCoord, this.maxY );
|
||||
this.minZ = Math.min( c.zCoord, this.minZ );
|
||||
this.maxZ = Math.max( c.zCoord, this.maxZ );
|
||||
BlockPos pos = c.getPos();
|
||||
|
||||
this.minX = Math.min( pos.getX(), this.minX );
|
||||
this.maxX = Math.max( pos.getX(), this.maxX );
|
||||
this.minY = Math.min( pos.getY(), this.minY );
|
||||
this.maxY = Math.max( pos.getY(), this.maxY );
|
||||
this.minZ = Math.min( pos.getZ(), this.minZ );
|
||||
this.maxZ = Math.max( pos.getZ(), this.maxZ );
|
||||
|
||||
if( this.maxX - this.minX < 7 && this.maxY - this.minY < 7 && this.maxZ - this.minZ < 7 )
|
||||
{
|
||||
|
||||
@@ -20,8 +20,7 @@ package appeng.me.storage;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import appeng.api.implementations.tiles.ITileStorageMonitorable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
@@ -37,7 +36,7 @@ public class AEExternalHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource mySrc )
|
||||
public boolean canHandle( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource mySrc )
|
||||
{
|
||||
if( channel == StorageChannel.ITEMS && te instanceof ITileStorageMonitorable )
|
||||
{
|
||||
@@ -48,7 +47,7 @@ public class AEExternalHandler implements IExternalStorageHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src )
|
||||
public IMEInventory getInventory( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource src )
|
||||
{
|
||||
if( te instanceof TileCondenser )
|
||||
{
|
||||
|
||||
@@ -27,7 +27,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.me.storage;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.IncludeExclude;
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.me.storage;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.me.storage;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.me.storage;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
|
||||
@@ -27,7 +27,6 @@ import java.util.NavigableMap;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
package appeng.me.storage;
|
||||
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -35,6 +33,8 @@ import appeng.api.storage.data.IItemList;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.tile.misc.TileSecurity;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
|
||||
public class SecurityInventory implements IMEInventoryHandler<IAEItemStack>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user