Basic reformat, hit once, hope never again
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.integration.modules.BCHelpers;
|
||||
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -38,11 +39,12 @@ import appeng.api.util.AEColor;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.parts.CableBusContainer;
|
||||
|
||||
|
||||
public class AECableSchematicTile extends AEGenericSchematicTile implements IPartHost
|
||||
{
|
||||
|
||||
@Override
|
||||
public void rotateLeft(IBuilderContext context)
|
||||
public void rotateLeft( IBuilderContext context )
|
||||
{
|
||||
CableBusContainer cbc = new CableBusContainer( this );
|
||||
cbc.readFromNBT( this.tileNBT );
|
||||
@@ -60,25 +62,25 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddPart(ItemStack part, ForgeDirection side)
|
||||
public boolean canAddPart( ItemStack part, ForgeDirection side )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection addPart(ItemStack is, ForgeDirection side, EntityPlayer owner)
|
||||
public ForgeDirection addPart( ItemStack is, ForgeDirection side, EntityPlayer owner )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPart getPart(ForgeDirection side)
|
||||
public IPart getPart( ForgeDirection side )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePart(ForgeDirection side, boolean suppressUpdate)
|
||||
public void removePart( ForgeDirection side, boolean suppressUpdate )
|
||||
{
|
||||
|
||||
}
|
||||
@@ -114,13 +116,13 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlocked(ForgeDirection side)
|
||||
public boolean isBlocked( ForgeDirection side )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SelectedPart selectPart(Vec3 pos)
|
||||
public SelectedPart selectPart( Vec3 pos )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -138,7 +140,7 @@ public class AECableSchematicTile extends AEGenericSchematicTile implements IPar
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasRedstone(ForgeDirection side)
|
||||
public boolean hasRedstone( ForgeDirection side )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -18,27 +18,30 @@
|
||||
|
||||
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 buildcraft.api.blueprints.IBuilderContext;
|
||||
import buildcraft.api.blueprints.SchematicTile;
|
||||
|
||||
import appeng.api.util.ICommonTile;
|
||||
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 storeRequirements(IBuilderContext context, int x, int y, int z)
|
||||
public void storeRequirements( IBuilderContext context, int x, int y, int z )
|
||||
{
|
||||
TileEntity tile = context.world().getTileEntity( x, y, z );
|
||||
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
|
||||
if ( tile instanceof AEBaseTile )
|
||||
if( tile instanceof AEBaseTile )
|
||||
{
|
||||
ICommonTile tcb = (AEBaseTile) tile;
|
||||
tcb.getDrops( tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, list );
|
||||
@@ -48,14 +51,14 @@ public class AEGenericSchematicTile extends SchematicTile
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rotateLeft(IBuilderContext context)
|
||||
public void rotateLeft( IBuilderContext context )
|
||||
{
|
||||
if ( this.tileNBT.hasKey( "orientation_forward" ) && this.tileNBT.hasKey( "orientation_up" ) )
|
||||
if( this.tileNBT.hasKey( "orientation_forward" ) && this.tileNBT.hasKey( "orientation_up" ) )
|
||||
{
|
||||
String forward = this.tileNBT.getString( "orientation_forward" );
|
||||
String up = this.tileNBT.getString( "orientation_up" );
|
||||
|
||||
if ( forward != null && up != null )
|
||||
if( forward != null && up != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -68,12 +71,11 @@ public class AEGenericSchematicTile extends SchematicTile
|
||||
this.tileNBT.setString( "orientation_forward", fdForward.name() );
|
||||
this.tileNBT.setString( "orientation_up", fdUp.name() );
|
||||
}
|
||||
catch (Throwable ignored)
|
||||
catch( Throwable ignored )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.integration.modules.BCHelpers;
|
||||
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.api.blueprints.IBuilderContext;
|
||||
@@ -25,17 +26,17 @@ import buildcraft.api.blueprints.SchematicBlock;
|
||||
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class AERotatableBlockSchematic extends SchematicBlock
|
||||
{
|
||||
|
||||
@Override
|
||||
public void rotateLeft(IBuilderContext context)
|
||||
public void rotateLeft( IBuilderContext context )
|
||||
{
|
||||
if ( this.meta < 6 )
|
||||
if( this.meta < 6 )
|
||||
{
|
||||
ForgeDirection d = Platform.rotateAround( ForgeDirection.values()[this.meta], ForgeDirection.DOWN );
|
||||
this.meta = d.ordinal();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.integration.modules.BCHelpers;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -27,21 +28,21 @@ 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)
|
||||
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)
|
||||
public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource src )
|
||||
{
|
||||
if ( chan == StorageChannel.ITEMS )
|
||||
if( chan == StorageChannel.ITEMS )
|
||||
return new BCPipeInventory( te, d );
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.integration.modules.BCHelpers;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -29,48 +30,49 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.integration.modules.BC;
|
||||
|
||||
|
||||
public class BCPipeInventory implements IMEInventory<IAEItemStack>
|
||||
{
|
||||
|
||||
final TileEntity te;
|
||||
final ForgeDirection dir;
|
||||
|
||||
public BCPipeInventory(TileEntity _te, ForgeDirection _dir) {
|
||||
public BCPipeInventory( TileEntity _te, ForgeDirection _dir )
|
||||
{
|
||||
this.te = _te;
|
||||
this.dir = _dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems( IAEItemStack input, Actionable mode, BaseActionSource src )
|
||||
{
|
||||
if( mode == Actionable.SIMULATE )
|
||||
{
|
||||
if( BC.instance.canAddItemsToPipe( this.te, input.getItemStack(), this.dir ) )
|
||||
return null;
|
||||
return input;
|
||||
}
|
||||
|
||||
if( BC.instance.addItemsToPipe( this.te, input.getItemStack(), this.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;
|
||||
}
|
||||
|
||||
@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( this.te, input.getItemStack(), this.dir ) )
|
||||
return null;
|
||||
return input;
|
||||
}
|
||||
|
||||
if ( BC.instance.addItemsToPipe( this.te, input.getItemStack(), this.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