Removed Dropped Features.
Implemented Spatial Storage. Fixed bug with ME Chest saying the cell was un-readable.
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
package appeng.tile.mac;
|
||||
|
||||
import appeng.me.cluster.IAECluster;
|
||||
import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
|
||||
public class TileMolecularAssembler extends AENetworkTile implements IAEMultiBlock
|
||||
{
|
||||
|
||||
@Override
|
||||
public void disconnect()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAECluster getCluster()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package appeng.tile.mac;
|
||||
|
||||
import appeng.me.cluster.IAECluster;
|
||||
import appeng.me.cluster.IAEMultiBlock;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
|
||||
public class TilePatternProvider extends AENetworkTile implements IAEMultiBlock
|
||||
{
|
||||
|
||||
@Override
|
||||
public void disconnect()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAECluster getCluster()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import io.netty.buffer.ByteBuf;
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@@ -108,10 +107,4 @@ public class TileInscriber extends AENetworkPowerTile
|
||||
|
||||
}
|
||||
|
||||
public void activate(EntityPlayer player)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -157,8 +157,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, IS
|
||||
@Override
|
||||
public IConfigManager getConfigManager()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
return duality.getConfigManager();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package appeng.tile.misc;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
|
||||
public class TileNetworkEmitter extends AENetworkTile
|
||||
{
|
||||
|
||||
public TileNetworkEmitter() {
|
||||
gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) );
|
||||
}
|
||||
|
||||
public void activate(EntityPlayer player)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package appeng.tile.misc;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.tile.grid.AENetworkPowerTile;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
|
||||
public class TileQuartzCrystalizer extends AENetworkPowerTile
|
||||
{
|
||||
|
||||
final int sides[] = new int[] { 0, 1 };
|
||||
AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
|
||||
int processingTime = 0;
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType(ForgeDirection dir)
|
||||
{
|
||||
return AECableType.COVERED;
|
||||
}
|
||||
|
||||
public TileQuartzCrystalizer() {
|
||||
gridProxy.setValidSides( EnumSet.noneOf( ForgeDirection.class ) );
|
||||
internalMaxPower = 1500;
|
||||
gridProxy.setIdlePowerUsage( 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOrientation(ForgeDirection inForward, ForgeDirection inUp)
|
||||
{
|
||||
super.setOrientation( inForward, inUp );
|
||||
gridProxy.setValidSides( EnumSet.of( getUp(), getUp().getOpposite() ) );
|
||||
setPowerSides( EnumSet.of( getUp(), getUp().getOpposite() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInternalInventory()
|
||||
{
|
||||
return inv;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side)
|
||||
{
|
||||
return sides;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack)
|
||||
{
|
||||
return i == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, int j)
|
||||
{
|
||||
return i == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void activate(EntityPlayer player)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,39 @@
|
||||
package appeng.tile.spatial;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.implementations.TransitionResult;
|
||||
import appeng.api.implementations.items.ISpatialStorageCell;
|
||||
import appeng.api.networking.GridFlags;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.energy.IEnergyGrid;
|
||||
import appeng.api.networking.spatial.ISpatialCache;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.items.storage.ItemSpatialStorageCell;
|
||||
import appeng.me.cache.SpatialPylonCache;
|
||||
import appeng.tile.grid.AENetworkInvTile;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class TileSpatialIOPort extends AENetworkInvTile
|
||||
public class TileSpatialIOPort extends AENetworkInvTile implements Callable
|
||||
{
|
||||
|
||||
final int sides[] = { 0, 1 };
|
||||
AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
|
||||
boolean lastRedstoneState = false;
|
||||
|
||||
public TileSpatialIOPort() {
|
||||
gridProxy.setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
}
|
||||
|
||||
public void updateRedstoneState()
|
||||
{
|
||||
boolean currentState = worldObj.isBlockIndirectlyGettingPowered( xCoord, yCoord, zCoord );
|
||||
@@ -31,8 +49,47 @@ public class TileSpatialIOPort extends AENetworkInvTile
|
||||
|
||||
private void triggerTransition()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
if ( Platform.isServer() )
|
||||
{
|
||||
ItemStack cell = getStackInSlot( 0 );
|
||||
if ( isSpatialCell( cell ) )
|
||||
{
|
||||
TickHandler.instance.addCallable( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object call() throws Exception
|
||||
{
|
||||
|
||||
ItemStack cell = getStackInSlot( 0 );
|
||||
if ( isSpatialCell( cell ) && getStackInSlot( 1 ) == null )
|
||||
{
|
||||
IGrid gi = gridProxy.getGrid();
|
||||
IEnergyGrid energy = gridProxy.getEnergy();
|
||||
|
||||
ItemSpatialStorageCell sc = (ItemSpatialStorageCell) cell.getItem();
|
||||
|
||||
SpatialPylonCache spc = (SpatialPylonCache) gi.getCache( ISpatialCache.class );
|
||||
if ( spc.hasRegion() && spc.isValidRegion() )
|
||||
{
|
||||
double req = spc.requiredPower();
|
||||
double pr = energy.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG );
|
||||
if ( Math.abs( pr - req ) < req * 0.001 )
|
||||
{
|
||||
TransitionResult tr = sc.doSpatialTransition( cell, worldObj, spc.getMin(), spc.getMax(), true );
|
||||
if ( tr.success )
|
||||
{
|
||||
energy.extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG );
|
||||
setInventorySlotContents( 0, null );
|
||||
setInventorySlotContents( 1, cell );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,6 +110,34 @@ public class TileSpatialIOPort extends AENetworkInvTile
|
||||
return inv;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack)
|
||||
{
|
||||
return (i == 0 ? isSpatialCell( itemstack ) : false);
|
||||
}
|
||||
|
||||
private boolean isSpatialCell(ItemStack cell)
|
||||
{
|
||||
if ( cell != null && cell.getItem() instanceof ISpatialStorageCell )
|
||||
{
|
||||
ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem();
|
||||
return sc != null && sc.isSpatialStorage( cell );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, int j)
|
||||
{
|
||||
return isItemValidForSlot( i, itemstack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, int j)
|
||||
{
|
||||
return i == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removed, ItemStack added)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user