Relocate Source to proper directory.
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
package appeng.integration.modules.BCHelpers;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.parts.IFacadeContainer;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.parts.LayerFlags;
|
||||
import appeng.api.parts.SelectedPart;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.parts.CableBusContainer;
|
||||
import buildcraft.api.blueprints.IBuilderContext;
|
||||
|
||||
public class AECableSchematicTile extends AEGenericSchematicTile implements IPartHost
|
||||
{
|
||||
|
||||
@Override
|
||||
public void rotateLeft(IBuilderContext context)
|
||||
{
|
||||
CableBusContainer cbc = new CableBusContainer( this );
|
||||
cbc.readFromNBT( tileNBT );
|
||||
|
||||
cbc.rotateLeft();
|
||||
|
||||
tileNBT = new NBTTagCompound();
|
||||
cbc.writeToNBT( tileNBT );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFacadeContainer getFacadeContainer()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddPart(ItemStack part, ForgeDirection side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer owner)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPart getPart(ForgeDirection side)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePart(ForgeDirection side, boolean suppressUpdate)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markForUpdate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public DimensionalCoord getLocation()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTile()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AEColor getColor()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearContainer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlocked(ForgeDirection side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SelectedPart selectPart(Vec3 pos)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markForSave()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partChanged()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRedstone(ForgeDirection side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<LayerFlags> getLayerFlags()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyNeighbors()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInWorld()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package appeng.integration.modules.BCHelpers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.util.Platform;
|
||||
import buildcraft.api.blueprints.IBuilderContext;
|
||||
import buildcraft.api.blueprints.SchematicTile;
|
||||
|
||||
public class AEGenericSchematicTile extends SchematicTile
|
||||
{
|
||||
|
||||
@Override
|
||||
public void writeRequirementsToBlueprint(IBuilderContext context, int x, int y, int z)
|
||||
{
|
||||
TileEntity tile = context.world().getTileEntity( x, y, z );
|
||||
ArrayList<ItemStack> list = new ArrayList();
|
||||
if ( tile instanceof AEBaseTile )
|
||||
{
|
||||
AEBaseTile tcb = (AEBaseTile) tile;
|
||||
tcb.getDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, list );
|
||||
}
|
||||
|
||||
storedRequirements = list.toArray( new ItemStack[list.size()] );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rotateLeft(IBuilderContext context)
|
||||
{
|
||||
if ( tileNBT.hasKey( "orientation_forward" ) && tileNBT.hasKey( "orientation_up" ) )
|
||||
{
|
||||
String forward = tileNBT.getString( "orientation_forward" );
|
||||
String up = tileNBT.getString( "orientation_up" );
|
||||
|
||||
if ( forward != null && up != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
ForgeDirection fdForward = ForgeDirection.valueOf( forward );
|
||||
ForgeDirection fdUp = ForgeDirection.valueOf( up );
|
||||
|
||||
fdForward = Platform.rotateAround( fdForward, ForgeDirection.DOWN );
|
||||
fdUp = Platform.rotateAround( fdUp, ForgeDirection.DOWN );
|
||||
|
||||
tileNBT.setString( "orientation_forward", fdForward.name() );
|
||||
tileNBT.setString( "orientation_up", fdUp.name() );
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package appeng.integration.modules.BCHelpers;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.util.Platform;
|
||||
import buildcraft.api.blueprints.IBuilderContext;
|
||||
import buildcraft.api.blueprints.SchematicBlock;
|
||||
|
||||
public class AERotatableBlockSchematic extends SchematicBlock
|
||||
{
|
||||
|
||||
@Override
|
||||
public void rotateLeft(IBuilderContext context)
|
||||
{
|
||||
if ( meta < 6 )
|
||||
{
|
||||
ForgeDirection d = Platform.rotateAround( ForgeDirection.values()[meta], ForgeDirection.DOWN );
|
||||
meta = d.ordinal();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package appeng.integration.modules.BCHelpers;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.integration.modules.BC;
|
||||
|
||||
public class BCPipeHandler implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle(TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc)
|
||||
{
|
||||
return chan == StorageChannel.ITEMS && BC.instance.isPipe( te, d );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory(TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src)
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
return new BCPipeInventory( te, d );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package appeng.integration.modules.BCHelpers;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.integration.modules.BC;
|
||||
|
||||
public class BCPipeInventory implements IMEInventory<IAEItemStack>
|
||||
{
|
||||
|
||||
TileEntity te;
|
||||
ForgeDirection dir;
|
||||
|
||||
public BCPipeInventory(TileEntity _te, ForgeDirection _dir) {
|
||||
te = _te;
|
||||
dir = _dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel()
|
||||
{
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
if ( mode == Actionable.SIMULATE )
|
||||
{
|
||||
if ( BC.instance.canAddItemsToPipe( te, input.getItemStack(), dir ) )
|
||||
return null;
|
||||
return input;
|
||||
}
|
||||
|
||||
if ( BC.instance.addItemsToPipe( te, input.getItemStack(), dir ) )
|
||||
return null;
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out)
|
||||
{
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user