Reduces visibility of internal fields/methods
Reduces the visibility of all fields to private and create setters/getters when necessary. Exceptions are fields with GuiSync as these need to be public. Reduces the visibility of internal methods to private/protected/default when possible.
This commit is contained in:
@@ -44,6 +44,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
@@ -77,11 +78,11 @@ import appeng.util.SettingsFrom;
|
||||
public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost, IUpgradeableHost, ICustomNameObject
|
||||
{
|
||||
|
||||
protected final AENetworkProxy proxy;
|
||||
protected final ItemStack is;
|
||||
protected TileEntity tile = null;
|
||||
protected IPartHost host = null;
|
||||
protected AEPartLocation side = null;
|
||||
private final AENetworkProxy proxy;
|
||||
private final ItemStack is;
|
||||
private TileEntity tile = null;
|
||||
private IPartHost host = null;
|
||||
private AEPartLocation side = null;
|
||||
|
||||
public AEBasePart( final ItemStack is )
|
||||
{
|
||||
@@ -112,7 +113,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
@Override
|
||||
public void securityBreak()
|
||||
{
|
||||
if( this.is.stackSize > 0 )
|
||||
if( this.getItemStack().stackSize > 0 )
|
||||
{
|
||||
final List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add( this.is.copy() );
|
||||
@@ -192,7 +193,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
@Override
|
||||
public String getCustomName()
|
||||
{
|
||||
return this.is.getDisplayName();
|
||||
return this.getItemStack().getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -206,12 +207,12 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
@Override
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return this.is.hasDisplayName();
|
||||
return this.getItemStack().hasDisplayName();
|
||||
}
|
||||
|
||||
public void addEntityCrashInfo( final CrashReportCategory crashreportcategory )
|
||||
{
|
||||
crashreportcategory.addCrashSection( "Part Side", this.side );
|
||||
crashreportcategory.addCrashSection( "Part Side", this.getSide() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -314,7 +315,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
@Override
|
||||
public void setPartHostInfo( final AEPartLocation side, final IPartHost host, final TileEntity tile )
|
||||
{
|
||||
this.side = side;
|
||||
this.setSide( side );
|
||||
this.tile = tile;
|
||||
this.host = host;
|
||||
}
|
||||
@@ -374,7 +375,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
* @param from source of settings
|
||||
* @param compound compound of source
|
||||
*/
|
||||
public void uploadSettings( final SettingsFrom from, final NBTTagCompound compound )
|
||||
private void uploadSettings( final SettingsFrom from, final NBTTagCompound compound )
|
||||
{
|
||||
if( compound != null )
|
||||
{
|
||||
@@ -411,7 +412,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
*
|
||||
* @return compound of source
|
||||
*/
|
||||
public NBTTagCompound downloadSettings( final SettingsFrom from )
|
||||
private NBTTagCompound downloadSettings( final SettingsFrom from )
|
||||
{
|
||||
final NBTTagCompound output = new NBTTagCompound();
|
||||
|
||||
@@ -543,8 +544,23 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer)
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public AEPartLocation getSide()
|
||||
{
|
||||
return this.side;
|
||||
}
|
||||
|
||||
private void setSide( final AEPartLocation side )
|
||||
{
|
||||
this.side = side;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return this.is;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ import appeng.api.util.AEPartLocation;
|
||||
public class BusCollisionHelper implements IPartCollisionHelper
|
||||
{
|
||||
|
||||
final List<AxisAlignedBB> boxes;
|
||||
private final List<AxisAlignedBB> boxes;
|
||||
|
||||
private final EnumFacing x;
|
||||
private final EnumFacing y;
|
||||
|
||||
@@ -77,10 +77,10 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
|
||||
private static final ThreadLocal<Boolean> IS_LOADING = new ThreadLocal<Boolean>();
|
||||
private final EnumSet<LayerFlags> myLayerFlags = EnumSet.noneOf( LayerFlags.class );
|
||||
public YesNo hasRedstone = YesNo.UNDECIDED;
|
||||
public IPartHost tcb;
|
||||
public boolean requiresDynamicRender = false;
|
||||
boolean inWorld = false;
|
||||
private YesNo hasRedstone = YesNo.UNDECIDED;
|
||||
private IPartHost tcb;
|
||||
private boolean requiresDynamicRender = false;
|
||||
private boolean inWorld = false;
|
||||
|
||||
public CableBusContainer( final IPartHost host )
|
||||
{
|
||||
@@ -327,7 +327,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
{
|
||||
return this.getSide( AEPartLocation.fromFacing( side ) );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void removePart( final AEPartLocation side, final boolean suppressUpdate )
|
||||
{
|
||||
@@ -548,7 +548,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
this.hasRedstone = te.getWorld().isBlockIndirectlyGettingPowered( te.getPos() ) != 0 ? YesNo.YES : YesNo.NO;
|
||||
}
|
||||
|
||||
public void updateDynamicRender()
|
||||
private void updateDynamicRender()
|
||||
{
|
||||
this.requiresDynamicRender = false;
|
||||
for( final AEPartLocation s : AEPartLocation.SIDE_LOCATIONS )
|
||||
@@ -556,7 +556,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
final IPart p = this.getPart( s );
|
||||
if( p != null )
|
||||
{
|
||||
this.requiresDynamicRender = this.requiresDynamicRender || p.requireDynamicRender();
|
||||
this.setRequiresDynamicRender( this.isRequiresDynamicRender() || p.requireDynamicRender() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1021,7 +1021,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
}
|
||||
|
||||
AEPartLocation getSide( final IPart part )
|
||||
private AEPartLocation getSide( final IPart part )
|
||||
{
|
||||
if( this.getCenter() == part )
|
||||
{
|
||||
@@ -1142,4 +1142,14 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isRequiresDynamicRender()
|
||||
{
|
||||
return this.requiresDynamicRender;
|
||||
}
|
||||
|
||||
private void setRequiresDynamicRender( final boolean requiresDynamicRender )
|
||||
{
|
||||
this.requiresDynamicRender = requiresDynamicRender;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,12 +47,12 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
protected static final int POWERED_FLAG = 1;
|
||||
protected static final int CHANNEL_FLAG = 2;
|
||||
|
||||
protected int clientFlags = 0; // sent as byte.
|
||||
private int clientFlags = 0; // sent as byte.
|
||||
|
||||
public PartBasicState( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
@@ -103,28 +103,28 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
{
|
||||
super.writeToStream( data );
|
||||
|
||||
this.clientFlags = 0;
|
||||
this.setClientFlags( 0 );
|
||||
|
||||
try
|
||||
{
|
||||
if( this.proxy.getEnergy().isNetworkPowered() )
|
||||
if( this.getProxy().getEnergy().isNetworkPowered() )
|
||||
{
|
||||
this.clientFlags |= POWERED_FLAG;
|
||||
this.setClientFlags( this.getClientFlags() | POWERED_FLAG );
|
||||
}
|
||||
|
||||
if( this.proxy.getNode().meetsChannelRequirements() )
|
||||
if( this.getProxy().getNode().meetsChannelRequirements() )
|
||||
{
|
||||
this.clientFlags |= CHANNEL_FLAG;
|
||||
this.setClientFlags( this.getClientFlags() | CHANNEL_FLAG );
|
||||
}
|
||||
|
||||
this.clientFlags = this.populateFlags( this.clientFlags );
|
||||
this.setClientFlags( this.populateFlags( this.getClientFlags() ) );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// meh
|
||||
}
|
||||
|
||||
data.writeByte( (byte) this.clientFlags );
|
||||
data.writeByte( (byte) this.getClientFlags() );
|
||||
}
|
||||
|
||||
protected int populateFlags( final int cf )
|
||||
@@ -137,10 +137,10 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
{
|
||||
final boolean eh = super.readFromStream( data );
|
||||
|
||||
final int old = this.clientFlags;
|
||||
this.clientFlags = data.readByte();
|
||||
final int old = this.getClientFlags();
|
||||
this.setClientFlags( data.readByte() );
|
||||
|
||||
return eh || old != this.clientFlags;
|
||||
return eh || old != this.getClientFlags();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -153,12 +153,22 @@ public abstract class PartBasicState extends AEBasePart implements IPowerChannel
|
||||
@Override
|
||||
public boolean isPowered()
|
||||
{
|
||||
return ( this.clientFlags & POWERED_FLAG ) == POWERED_FLAG;
|
||||
return ( this.getClientFlags() & POWERED_FLAG ) == POWERED_FLAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive()
|
||||
{
|
||||
return ( this.clientFlags & CHANNEL_FLAG ) == CHANNEL_FLAG;
|
||||
return ( this.getClientFlags() & CHANNEL_FLAG ) == CHANNEL_FLAG;
|
||||
}
|
||||
|
||||
public int getClientFlags()
|
||||
{
|
||||
return this.clientFlags;
|
||||
}
|
||||
|
||||
private void setClientFlags( final int clientFlags )
|
||||
{
|
||||
this.clientFlags = clientFlags;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ import com.google.common.base.Optional;
|
||||
public class PartPlacement
|
||||
{
|
||||
|
||||
public static float eyeHeight = 0.0f;
|
||||
private static float eyeHeight = 0.0f;
|
||||
private final ThreadLocal<Object> placing = new ThreadLocal<Object>();
|
||||
private boolean wasCanceled = false;
|
||||
|
||||
@@ -100,7 +100,8 @@ public class PartPlacement
|
||||
if( !world.isRemote )
|
||||
{
|
||||
final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
|
||||
final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b );
|
||||
final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.getA(), dir.getB() );
|
||||
|
||||
if( mop != null )
|
||||
{
|
||||
final List<ItemStack> is = new LinkedList<ItemStack>();
|
||||
@@ -194,27 +195,29 @@ public class PartPlacement
|
||||
}
|
||||
|
||||
// TODO: IFMP INTEGRATION
|
||||
// TODO IIMMIBISMICROBLOCKS INTEGRATION
|
||||
|
||||
/*
|
||||
if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
||||
{
|
||||
host = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getOrCreateHost( tile );
|
||||
}
|
||||
// TODO IIMMIBISMICROBLOCKS INTEGRATION
|
||||
|
||||
/*
|
||||
* if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
||||
* {
|
||||
* host = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getOrCreateHost( tile );
|
||||
* }
|
||||
* if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled(
|
||||
* IntegrationType.ImmibisMicroblocks ) )
|
||||
* {
|
||||
* host = ( (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks )
|
||||
* ).getOrCreateHost( player, face, tile );
|
||||
* }
|
||||
*/
|
||||
|
||||
if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.ImmibisMicroblocks ) )
|
||||
{
|
||||
host = ( (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks ) ).getOrCreateHost( player, face, tile );
|
||||
}
|
||||
*/
|
||||
|
||||
// if ( held == null )
|
||||
{
|
||||
final Block block = world.getBlockState( pos ).getBlock();
|
||||
if( host != null && player.isSneaking() && block != null )
|
||||
{
|
||||
final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
|
||||
final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b );
|
||||
final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.getA(), dir.getB() );
|
||||
|
||||
if( mop != null )
|
||||
{
|
||||
mop.hitVec = mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() );
|
||||
@@ -265,20 +268,22 @@ public class PartPlacement
|
||||
}
|
||||
|
||||
// TODO: IFMP INTEGRATION
|
||||
// TODO IIMMIBISMICROBLOCKS INTEGRATION
|
||||
|
||||
/*
|
||||
if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
||||
{
|
||||
host = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getOrCreateHost( tile );
|
||||
}
|
||||
// TODO IIMMIBISMICROBLOCKS INTEGRATION
|
||||
|
||||
/*
|
||||
* if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.FMP ) )
|
||||
* {
|
||||
* host = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getOrCreateHost( tile
|
||||
* );
|
||||
* }
|
||||
* if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled(
|
||||
* IntegrationType.ImmibisMicroblocks ) )
|
||||
* {
|
||||
* host = ( (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance(
|
||||
* IntegrationType.ImmibisMicroblocks ) ).getOrCreateHost( player, side, tile );
|
||||
* }
|
||||
*/
|
||||
|
||||
if( host == null && tile != null && IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.ImmibisMicroblocks ) )
|
||||
{
|
||||
host = ( (IImmibisMicroblocks) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.ImmibisMicroblocks ) ).getOrCreateHost( player, side, tile );
|
||||
}
|
||||
*/
|
||||
|
||||
final Optional<ItemStack> maybeMultiPartStack = multiPart.maybeStack( 1 );
|
||||
final Optional<Block> maybeMultiPartBlock = multiPart.maybeBlock();
|
||||
final Optional<ItemBlock> maybeMultiPartItemBlock = multiPart.maybeItemBlock();
|
||||
@@ -287,7 +292,7 @@ public class PartPlacement
|
||||
final boolean multiPartPresent = maybeMultiPartBlock.isPresent() && maybeMultiPartStack.isPresent() && maybeMultiPartItemBlock.isPresent();
|
||||
final boolean canMultiPartBePlaced = maybeMultiPartBlock.get().canPlaceBlockAt( world, te_pos );
|
||||
|
||||
if( hostIsNotPresent && multiPartPresent && canMultiPartBePlaced && maybeMultiPartItemBlock.get().placeBlockAt( maybeMultiPartStack.get(), player, world, te_pos, side, 0.5f, 0.5f, 0.5f, maybeMultiPartBlock.get().getDefaultState() ) )
|
||||
if( hostIsNotPresent && multiPartPresent && canMultiPartBePlaced && maybeMultiPartItemBlock.get().placeBlockAt( maybeMultiPartStack.get(), player, world, te_pos, side, 0.5f, 0.5f, 0.5f, maybeMultiPartBlock.get().getDefaultState() ) )
|
||||
{
|
||||
if( !world.isRemote )
|
||||
{
|
||||
@@ -323,7 +328,7 @@ public class PartPlacement
|
||||
if( pass == PlaceType.INTERACT_FIRST_PASS || pass == PlaceType.PLACE_ITEM )
|
||||
{
|
||||
te_pos = pos.offset( side );
|
||||
|
||||
|
||||
final Block blkID = world.getBlockState( te_pos ).getBlock();
|
||||
tile = world.getTileEntity( te_pos );
|
||||
|
||||
@@ -332,7 +337,9 @@ public class PartPlacement
|
||||
host = ( (IFMP) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.FMP ) ).getOrCreateHost( tile );
|
||||
}
|
||||
|
||||
if( ( blkID == null || blkID.isReplaceable( world, te_pos ) || host != null ) ) ///&& side != AEPartLocation.INTERNAL )
|
||||
if( ( blkID == null || blkID.isReplaceable( world, te_pos ) || host != null ) ) // /&& side !=
|
||||
// AEPartLocation.INTERNAL
|
||||
// )
|
||||
{
|
||||
return place( held, te_pos, side.getOpposite(), player, world, pass == PlaceType.INTERACT_FIRST_PASS ? PlaceType.INTERACT_SECOND_PASS : PlaceType.PLACE_ITEM, depth + 1 );
|
||||
}
|
||||
@@ -344,10 +351,11 @@ public class PartPlacement
|
||||
{
|
||||
final Block block = world.getBlockState( pos ).getBlock();
|
||||
final LookDirection dir = Platform.getPlayerRay( player, getEyeOffset( player ) );
|
||||
final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.a, dir.b );
|
||||
final MovingObjectPosition mop = block.collisionRayTrace( world, pos, dir.getA(), dir.getB() );
|
||||
|
||||
if( mop != null )
|
||||
{
|
||||
final SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) );
|
||||
final SelectedPart sp = selectPart( player, host, mop.hitVec.addVector( -mop.getBlockPos().getX(), -mop.getBlockPos().getY(), -mop.getBlockPos().getZ() ) );
|
||||
|
||||
if( sp.part != null )
|
||||
{
|
||||
@@ -400,7 +408,7 @@ public class PartPlacement
|
||||
return Platform.getEyeOffset( p );
|
||||
}
|
||||
|
||||
return eyeHeight;
|
||||
return getEyeHeight();
|
||||
}
|
||||
|
||||
private static SelectedPart selectPart( final EntityPlayer player, final IPartHost host, final Vec3 pos )
|
||||
@@ -493,6 +501,16 @@ public class PartPlacement
|
||||
}
|
||||
}
|
||||
|
||||
private static float getEyeHeight()
|
||||
{
|
||||
return eyeHeight;
|
||||
}
|
||||
|
||||
public static void setEyeHeight( final float eyeHeight )
|
||||
{
|
||||
PartPlacement.eyeHeight = eyeHeight;
|
||||
}
|
||||
|
||||
public enum PlaceType
|
||||
{
|
||||
PLACE_ITEM, INTERACT_FIRST_PASS, INTERACT_SECOND_PASS
|
||||
|
||||
@@ -112,22 +112,22 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
final EnumFacing e = bch.getWorldX();
|
||||
final EnumFacing u = bch.getWorldY();
|
||||
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) )
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.getSide() ) )
|
||||
{
|
||||
minX = 0;
|
||||
}
|
||||
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.side ) )
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.getSide() ) )
|
||||
{
|
||||
maxX = 16;
|
||||
}
|
||||
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( u.getOpposite() ) ), this.side ) )
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( u.getOpposite() ) ), this.getSide() ) )
|
||||
{
|
||||
minY = 0;
|
||||
}
|
||||
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.side ) )
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.getSide() ) )
|
||||
{
|
||||
maxY = 16;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( SIDE_ICON, SIDE_ICON, BACK_ICON, renderer.getIcon( this.is ), SIDE_ICON, SIDE_ICON );
|
||||
rh.setTexture( SIDE_ICON, SIDE_ICON, BACK_ICON, renderer.getIcon( this.getItemStack() ), SIDE_ICON, SIDE_ICON );
|
||||
|
||||
rh.setBounds( 1, 1, 15, 15, 15, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -166,39 +166,37 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
|
||||
final TileEntity te = this.getHost().getTile();
|
||||
final BlockPos pos = te.getPos();
|
||||
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) )
|
||||
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.getSide() ) )
|
||||
{
|
||||
minX = 0;
|
||||
}
|
||||
|
||||
int maxX = 15;
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.side ) )
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.getSide() ) )
|
||||
{
|
||||
maxX = 16;
|
||||
}
|
||||
|
||||
int minY = 1;
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( u.getOpposite() ) ), this.side ) )
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( u.getOpposite() ) ), this.getSide() ) )
|
||||
{
|
||||
minY = 0;
|
||||
}
|
||||
|
||||
int maxY = 15;
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e) ), this.side ) )
|
||||
if( this.isAnnihilationPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.getSide() ) )
|
||||
{
|
||||
maxY = 16;
|
||||
}
|
||||
|
||||
final boolean isActive = ( this.clientFlags & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG );
|
||||
|
||||
rh.setTexture( SIDE_ICON, SIDE_ICON, BACK_ICON, isActive ? activeIcon : renderer.getIcon( this.is ), SIDE_ICON, SIDE_ICON );
|
||||
final boolean isActive = ( this.getClientFlags() & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG );
|
||||
|
||||
rh.setTexture( SIDE_ICON, SIDE_ICON, BACK_ICON, isActive ? activeIcon : renderer.getIcon( this.getItemStack() ), SIDE_ICON, SIDE_ICON );
|
||||
rh.setBounds( minX, minY, 15, maxX, maxY, 16 );
|
||||
rh.renderBlock( opos, renderer );
|
||||
|
||||
rh.setTexture( STATUS_ICON, STATUS_ICON, BACK_ICON, isActive ? activeIcon : renderer.getIcon( this.is ), STATUS_ICON, STATUS_ICON );
|
||||
|
||||
rh.setTexture( STATUS_ICON, STATUS_ICON, BACK_ICON, isActive ? activeIcon : renderer.getIcon( this.getItemStack() ), STATUS_ICON, STATUS_ICON );
|
||||
rh.setBounds( 5, 5, 14, 11, 11, 15 );
|
||||
rh.renderBlock( opos, renderer );
|
||||
|
||||
@@ -211,7 +209,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
this.isAccepting = true;
|
||||
try
|
||||
{
|
||||
this.proxy.getTick().alertDevice( this.proxy.getNode() );
|
||||
this.getProxy().getTick().alertDevice( this.getProxy().getNode() );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -222,12 +220,12 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
@Override
|
||||
public void onEntityCollision( final Entity entity )
|
||||
{
|
||||
if( this.isAccepting && entity instanceof EntityItem && !entity.isDead && Platform.isServer() && this.proxy.isActive() )
|
||||
if( this.isAccepting && entity instanceof EntityItem && !entity.isDead && Platform.isServer() && this.getProxy().isActive() )
|
||||
{
|
||||
boolean capture = false;
|
||||
final BlockPos pos = this.tile.getPos();
|
||||
final BlockPos pos = this.getTile().getPos();
|
||||
|
||||
switch( this.side )
|
||||
switch( this.getSide() )
|
||||
{
|
||||
case DOWN:
|
||||
case UP:
|
||||
@@ -235,7 +233,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
{
|
||||
if( entity.posZ > pos.getZ() && entity.posZ < pos.getZ() + 1 )
|
||||
{
|
||||
if( ( entity.posY > pos.getY() + 0.9 && this.side == AEPartLocation.UP ) || ( entity.posY < pos.getY() + 0.1 && this.side == AEPartLocation.DOWN ) )
|
||||
if( ( entity.posY > pos.getY() + 0.9 && this.getSide() == AEPartLocation.UP ) || ( entity.posY < pos.getY() + 0.1 && this.getSide() == AEPartLocation.DOWN ) )
|
||||
{
|
||||
capture = true;
|
||||
}
|
||||
@@ -248,7 +246,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
{
|
||||
if( entity.posY > pos.getY() && entity.posY < pos.getY() + 1 )
|
||||
{
|
||||
if( ( entity.posZ > pos.getZ() + 0.9 && this.side == AEPartLocation.SOUTH ) || ( entity.posZ < pos.getZ() + 0.1 && this.side == AEPartLocation.NORTH ) )
|
||||
if( ( entity.posZ > pos.getZ() + 0.9 && this.getSide() == AEPartLocation.SOUTH ) || ( entity.posZ < pos.getZ() + 0.1 && this.getSide() == AEPartLocation.NORTH ) )
|
||||
{
|
||||
capture = true;
|
||||
}
|
||||
@@ -261,7 +259,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
{
|
||||
if( entity.posY > pos.getY() && entity.posY < pos.getY() + 1 )
|
||||
{
|
||||
if( ( entity.posX > pos.getX() + 0.9 && this.side == AEPartLocation.EAST ) || ( entity.posX < pos.getX() + 0.1 && this.side == AEPartLocation.WEST ) )
|
||||
if( ( entity.posX > pos.getX() + 0.9 && this.getSide() == AEPartLocation.EAST ) || ( entity.posX < pos.getX() + 0.1 && this.getSide() == AEPartLocation.WEST ) )
|
||||
{
|
||||
capture = true;
|
||||
}
|
||||
@@ -279,7 +277,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
|
||||
if( changed )
|
||||
{
|
||||
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, this.tile.getWorld(), new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.side, false ) );
|
||||
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, this.getTile().getWorld(), new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.getSide(), false ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -319,8 +317,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
final IAEItemStack itemToStore = AEItemStack.create( item );
|
||||
try
|
||||
{
|
||||
final IStorageGrid storage = this.proxy.getStorage();
|
||||
final IEnergyGrid energy = this.proxy.getEnergy();
|
||||
final IStorageGrid storage = this.getProxy().getStorage();
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
final IAEItemStack overflow = Platform.poweredInsert( energy, storage.getItemInventory(), itemToStore, this.mySrc );
|
||||
|
||||
this.isAccepting = overflow == null;
|
||||
@@ -375,7 +373,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
|
||||
final TileEntity te = this.getTile();
|
||||
final WorldServer w = (WorldServer) te.getWorld();
|
||||
final BlockPos offset = te.getPos().offset( this.side.getFacing() );
|
||||
final BlockPos offset = te.getPos().offset( this.getSide().getFacing() );
|
||||
final BlockPos add = offset.add( .5, .5, .5 );
|
||||
final double x = add.getX();
|
||||
final double y = add.getY();
|
||||
@@ -415,18 +413,17 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
|
||||
public TickRateModulation breakBlock( final boolean modulate )
|
||||
private TickRateModulation breakBlock( final boolean modulate )
|
||||
{
|
||||
if( this.isAccepting && this.proxy.isActive() )
|
||||
if( this.isAccepting && this.getProxy().isActive() )
|
||||
{
|
||||
try
|
||||
{
|
||||
final TileEntity te = this.getTile();
|
||||
final WorldServer w = (WorldServer) te.getWorld();
|
||||
|
||||
final BlockPos pos = te.getPos().offset( this.side.getFacing() );
|
||||
|
||||
final IEnergyGrid energy = this.proxy.getEnergy();
|
||||
final BlockPos pos = te.getPos().offset( this.getSide().getFacing() );
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
|
||||
if( this.canHandleBlock( w, pos ) )
|
||||
{
|
||||
@@ -442,12 +439,12 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
{
|
||||
energy.extractAEPower( requiredPower, Actionable.MODULATE, PowerMultiplier.CONFIG );
|
||||
this.breakBlockAndStoreItems( w, pos, items );
|
||||
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(),pos.getY(),pos.getZ(), 64, w, new PacketTransitionEffect( pos.getX(),pos.getY(),pos.getZ(), this.side, true ) );
|
||||
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, w, new PacketTransitionEffect( pos.getX(), pos.getY(), pos.getZ(), this.getSide(), true ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.breaking = true;
|
||||
TickHandler.INSTANCE.addCallable( this.tile.getWorld(), this );
|
||||
TickHandler.INSTANCE.addCallable( this.getTile().getWorld(), this );
|
||||
}
|
||||
return TickRateModulation.URGENT;
|
||||
}
|
||||
@@ -466,7 +463,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.AnnihilationPlane.min, TickRates.AnnihilationPlane.max, false, true );
|
||||
return new TickingRequest( TickRates.AnnihilationPlane.getMin(), TickRates.AnnihilationPlane.getMax(), false, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -484,7 +481,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
/**
|
||||
* Checks if this plane can handle the block at the specific coordinates.
|
||||
*/
|
||||
protected boolean canHandleBlock( final WorldServer w, final BlockPos pos )
|
||||
private boolean canHandleBlock( final WorldServer w, final BlockPos pos )
|
||||
{
|
||||
final Block block = w.getBlockState( pos ).getBlock();
|
||||
final Material material = block.getMaterial();
|
||||
@@ -527,13 +524,13 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
*
|
||||
* @return true, if the network can store at least a single item of all drops or no drops are reported
|
||||
*/
|
||||
protected boolean canStoreItemStacks( final List<ItemStack> itemStacks )
|
||||
private boolean canStoreItemStacks( final List<ItemStack> itemStacks )
|
||||
{
|
||||
boolean canStore = itemStacks.isEmpty();
|
||||
|
||||
try
|
||||
{
|
||||
final IStorageGrid storage = this.proxy.getStorage();
|
||||
final IStorageGrid storage = this.getProxy().getStorage();
|
||||
|
||||
for( final ItemStack itemStack : itemStacks )
|
||||
{
|
||||
@@ -554,10 +551,10 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
|
||||
return canStore;
|
||||
}
|
||||
|
||||
protected void breakBlockAndStoreItems( final WorldServer w, final BlockPos pos, final List<ItemStack> items )
|
||||
private void breakBlockAndStoreItems( final WorldServer w, final BlockPos pos, final List<ItemStack> items )
|
||||
{
|
||||
w.setBlockToAir( pos );
|
||||
|
||||
|
||||
final AxisAlignedBB box = AxisAlignedBB.fromBounds( pos.getX() - 0.2, pos.getY() - 0.2, pos.getZ() - 0.2, pos.getX() + 1.2, pos.getY() + 1.2, pos.getZ() + 1.2 );
|
||||
for( final Object ei : w.getEntitiesWithinAABB( EntityItem.class, box ) )
|
||||
{
|
||||
|
||||
@@ -103,7 +103,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
@Override
|
||||
protected TickRateModulation doBusWork()
|
||||
{
|
||||
if( !this.proxy.isActive() || !this.canDoBusWork() )
|
||||
if( !this.getProxy().isActive() || !this.canDoBusWork() )
|
||||
{
|
||||
return TickRateModulation.IDLE;
|
||||
}
|
||||
@@ -114,9 +114,9 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
try
|
||||
{
|
||||
final InventoryAdaptor destination = this.getHandler();
|
||||
final IMEMonitor<IAEItemStack> inv = this.proxy.getStorage().getItemInventory();
|
||||
final IEnergyGrid energy = this.proxy.getEnergy();
|
||||
final ICraftingGrid cg = this.proxy.getCrafting();
|
||||
final IMEMonitor<IAEItemStack> inv = this.getProxy().getStorage().getItemInventory();
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
final ICraftingGrid cg = this.getProxy().getCrafting();
|
||||
final FuzzyMode fzMode = (FuzzyMode) this.getConfigManager().getSetting( Settings.FUZZY_MODE );
|
||||
final SchedulingMode schedulingMode = (SchedulingMode) this.getConfigManager().getSetting( Settings.SCHEDULING_MODE );
|
||||
|
||||
@@ -128,13 +128,13 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
{
|
||||
final int slotToExport = this.getStartingSlot( schedulingMode, x );
|
||||
|
||||
final IAEItemStack ais = this.config.getAEStackInSlot( slotToExport );
|
||||
final IAEItemStack ais = this.getConfig().getAEStackInSlot( slotToExport );
|
||||
|
||||
if( ais == null || this.itemToSend <= 0 || this.craftOnly() )
|
||||
{
|
||||
if( this.isCraftingEnabled() )
|
||||
{
|
||||
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.proxy.getGrid(), cg, this.mySrc ) || this.didSomething;
|
||||
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.getProxy().getGrid(), cg, this.mySrc ) || this.didSomething;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
|
||||
if( this.itemToSend == before && this.isCraftingEnabled() )
|
||||
{
|
||||
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.proxy.getGrid(), cg, this.mySrc ) || this.didSomething;
|
||||
this.didSomething = this.craftingTracker.handleCrafting( slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(), this.getProxy().getGrid(), cg, this.mySrc ) || this.didSomething;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
|
||||
|
||||
rh.setBounds( 4, 4, 12, 12, 12, 14 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -214,7 +214,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartExportSides.getIcon(), CableBusTextures.PartExportSides.getIcon() );
|
||||
|
||||
rh.setBounds( 4, 4, 12, 12, 12, 14 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -225,7 +225,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
rh.setBounds( 6, 6, 15, 10, 10, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
|
||||
rh.setBounds( 6, 6, 11, 10, 10, 12 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -249,7 +249,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
return true;
|
||||
}
|
||||
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_BUS );
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_BUS );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.ExportBus.min, TickRates.ExportBus.max, this.isSleeping(), false );
|
||||
return new TickingRequest( TickRates.ExportBus.getMin(), TickRates.ExportBus.getMax(), this.isSleeping(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -287,9 +287,9 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
|
||||
|
||||
try
|
||||
{
|
||||
if( d != null && this.proxy.isActive() )
|
||||
if( d != null && this.getProxy().isActive() )
|
||||
{
|
||||
final IEnergyGrid energy = this.proxy.getEnergy();
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
final double power = items.getStackSize();
|
||||
|
||||
if( energy.extractAEPower( power, mode, PowerMultiplier.CONFIG ) > power - 0.01 )
|
||||
|
||||
@@ -86,11 +86,11 @@ import appeng.util.prioitylist.PrecisePriorityList;
|
||||
|
||||
public class PartFormationPlane extends PartUpgradeable implements ICellContainer, IPriorityHost, IMEInventory<IAEItemStack>
|
||||
{
|
||||
final MEInventoryHandler myHandler = new MEInventoryHandler( this, StorageChannel.ITEMS );
|
||||
final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 );
|
||||
int priority = 0;
|
||||
boolean wasActive = false;
|
||||
boolean blocked = false;
|
||||
private final MEInventoryHandler myHandler = new MEInventoryHandler( this, StorageChannel.ITEMS );
|
||||
private final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 );
|
||||
private int priority = 0;
|
||||
private boolean wasActive = false;
|
||||
private boolean blocked = false;
|
||||
|
||||
public PartFormationPlane( final ItemStack is )
|
||||
{
|
||||
@@ -130,7 +130,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
|
||||
try
|
||||
{
|
||||
this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
this.getProxy().getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -148,7 +148,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
this.updateHandler();
|
||||
this.host.markForSave();
|
||||
this.getHost().markForSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -200,7 +200,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
@MENetworkEventSubscribe
|
||||
public void powerRender( final MENetworkPowerStatusChange c )
|
||||
{
|
||||
final boolean currentActive = this.proxy.isActive();
|
||||
final boolean currentActive = this.getProxy().isActive();
|
||||
if( this.wasActive != currentActive )
|
||||
{
|
||||
this.wasActive = currentActive;
|
||||
@@ -212,7 +212,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
@MENetworkEventSubscribe
|
||||
public void updateChannels( final MENetworkChannelsChanged changedChannels )
|
||||
{
|
||||
final boolean currentActive = this.proxy.isActive();
|
||||
final boolean currentActive = this.getProxy().isActive();
|
||||
if( this.wasActive != currentActive )
|
||||
{
|
||||
this.wasActive = currentActive;
|
||||
@@ -239,22 +239,22 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
final EnumFacing e = bch.getWorldX();
|
||||
final EnumFacing u = bch.getWorldY();
|
||||
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) )
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.getSide() ) )
|
||||
{
|
||||
minX = 0;
|
||||
}
|
||||
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e) ), this.side ) )
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.getSide() ) )
|
||||
{
|
||||
maxX = 16;
|
||||
}
|
||||
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( u.getOpposite() ) ), this.side ) )
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( u.getOpposite() ) ), this.getSide() ) )
|
||||
{
|
||||
minY = 0;
|
||||
}
|
||||
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( u) ), this.side ) )
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( u ) ), this.getSide() ) )
|
||||
{
|
||||
maxY = 16;
|
||||
}
|
||||
@@ -268,7 +268,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
|
||||
|
||||
rh.setBounds( 1, 1, 15, 15, 15, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -289,37 +289,37 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
final TileEntity te = this.getHost().getTile();
|
||||
final BlockPos pos = te.getPos();
|
||||
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.side ) )
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e.getOpposite() ) ), this.getSide() ) )
|
||||
{
|
||||
minX = 0;
|
||||
}
|
||||
|
||||
int maxX = 15;
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.side ) )
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( e ) ), this.getSide() ) )
|
||||
{
|
||||
maxX = 16;
|
||||
}
|
||||
|
||||
int minY = 1;
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( u.getOpposite() ) ), this.side ) )
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( u.getOpposite() ) ), this.getSide() ) )
|
||||
{
|
||||
minY = 0;
|
||||
}
|
||||
|
||||
int maxY = 15;
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( u ) ), this.side ) )
|
||||
if( this.isTransitionPlane( te.getWorld().getTileEntity( pos.offset( u ) ), this.getSide() ) )
|
||||
{
|
||||
maxY = 16;
|
||||
}
|
||||
|
||||
final boolean isActive = ( this.clientFlags & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG );
|
||||
final boolean isActive = ( this.getClientFlags() & ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG ) ) == ( PartBasicState.POWERED_FLAG | PartBasicState.CHANNEL_FLAG );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : renderer.getIcon( this.is ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : renderer.getIcon( this.getItemStack() ), CableBusTextures.PartPlaneSides.getIcon(), CableBusTextures.PartPlaneSides.getIcon() );
|
||||
|
||||
rh.setBounds( minX, minY, 15, maxX, maxY, 16 );
|
||||
rh.renderBlock( opos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : renderer.getIcon( this.is ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartTransitionPlaneBack.getIcon(), isActive ? CableBusTextures.BlockFormPlaneOn.getIcon() : renderer.getIcon( this.getItemStack() ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 14, 11, 11, 15 );
|
||||
rh.renderBlock( opos, renderer );
|
||||
@@ -330,12 +330,12 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
@Override
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
final TileEntity te = this.host.getTile();
|
||||
final TileEntity te = this.getHost().getTile();
|
||||
final World w = te.getWorld();
|
||||
final AEPartLocation side = this.side;
|
||||
final AEPartLocation side = this.getSide();
|
||||
|
||||
final BlockPos tePos = te.getPos().offset( side.getFacing() );
|
||||
|
||||
final BlockPos tePos = te.getPos().offset( side.getFacing() );
|
||||
|
||||
this.blocked = !w.getBlockState( tePos ).getBlock().isReplaceable( w, tePos );
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
return true;
|
||||
}
|
||||
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_FORMATION_PLANE );
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_FORMATION_PLANE );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
@Override
|
||||
public List<IMEInventoryHandler> getCellArray( final StorageChannel channel )
|
||||
{
|
||||
if( this.proxy.isActive() && channel == StorageChannel.ITEMS )
|
||||
if( this.getProxy().isActive() && channel == StorageChannel.ITEMS )
|
||||
{
|
||||
final List<IMEInventoryHandler> Handler = new ArrayList<IMEInventoryHandler>( 1 );
|
||||
Handler.add( this.myHandler );
|
||||
@@ -394,7 +394,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
public void setPriority( final int newValue )
|
||||
{
|
||||
this.priority = newValue;
|
||||
this.host.markForSave();
|
||||
this.getHost().markForSave();
|
||||
this.updateHandler();
|
||||
}
|
||||
|
||||
@@ -420,9 +420,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
long maxStorage = Math.min( input.getStackSize(), is.getMaxStackSize() );
|
||||
boolean worked = false;
|
||||
|
||||
final TileEntity te = this.host.getTile();
|
||||
final TileEntity te = this.getHost().getTile();
|
||||
final World w = te.getWorld();
|
||||
final AEPartLocation side = this.side;
|
||||
final AEPartLocation side = this.getSide();
|
||||
|
||||
final BlockPos tePos = te.getPos().offset( side.getFacing() );
|
||||
|
||||
@@ -431,25 +431,25 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
if( placeBlock == YesNo.YES && ( i instanceof ItemBlock || i instanceof IPlantable || i instanceof ItemSkull || i instanceof ItemFirework || i instanceof IPartItem || i instanceof ItemReed ) )
|
||||
{
|
||||
final EntityPlayer player = Platform.getPlayer( (WorldServer) w );
|
||||
Platform.configurePlayer( player, side, this.tile );
|
||||
Platform.configurePlayer( player, side, this.getTile() );
|
||||
|
||||
// TODO: LIMIT FIREWORKS
|
||||
/*
|
||||
if( i instanceof ItemFirework )
|
||||
{
|
||||
Chunk c = w.getChunkFromBlockCoords( tePos );
|
||||
int sum = 0;
|
||||
for( List Z : c.geten )
|
||||
{
|
||||
sum += Z.size();
|
||||
}
|
||||
if( sum > 32 )
|
||||
{
|
||||
return input;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
* if( i instanceof ItemFirework )
|
||||
* {
|
||||
* Chunk c = w.getChunkFromBlockCoords( tePos );
|
||||
* int sum = 0;
|
||||
* for( List Z : c.geten )
|
||||
* {
|
||||
* sum += Z.size();
|
||||
* }
|
||||
* if( sum > 32 )
|
||||
* {
|
||||
* return input;
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
|
||||
maxStorage = is.stackSize;
|
||||
worked = true;
|
||||
if( type == Actionable.MODULATE )
|
||||
@@ -497,15 +497,15 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
final Chunk c = w.getChunkFromBlockCoords( tePos );
|
||||
|
||||
final int sum = 0;
|
||||
|
||||
|
||||
// TODO: LIMIT OTHER THIGNS!
|
||||
/*
|
||||
for( List Z : c.entityLists )
|
||||
{
|
||||
sum += Z.size();
|
||||
}
|
||||
*/
|
||||
|
||||
* for( List Z : c.entityLists )
|
||||
* {
|
||||
* sum += Z.size();
|
||||
* }
|
||||
*/
|
||||
|
||||
if( sum < AEConfig.instance.formationPlaneEntityLimit )
|
||||
{
|
||||
if( type == Actionable.MODULATE )
|
||||
@@ -513,10 +513,10 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
|
||||
|
||||
is.stackSize = (int) maxStorage;
|
||||
final EntityItem ei = new EntityItem( w, // w
|
||||
( ( side.xOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.xOffset * -0.3 + tePos.getX(), // spawn
|
||||
( ( side.yOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.yOffset * -0.3 + tePos.getY(), // spawn
|
||||
( ( side.zOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.zOffset * -0.3 + tePos.getZ(), // spawn
|
||||
is.copy() );
|
||||
( ( side.xOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.xOffset * -0.3 + tePos.getX(), // spawn
|
||||
( ( side.yOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.yOffset * -0.3 + tePos.getY(), // spawn
|
||||
( ( side.zOffset != 0 ? 0.0 : 0.7 ) * ( Platform.getRandomFloat() - 0.5f ) ) + 0.5 + side.zOffset * -0.3 + tePos.getZ(), // spawn
|
||||
is.copy() );
|
||||
|
||||
Entity result = ei;
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
|
||||
|
||||
rh.setBounds( 3, 3, 15, 13, 13, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -118,7 +118,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartImportSides.getIcon(), CableBusTextures.PartImportSides.getIcon() );
|
||||
|
||||
rh.setBounds( 4, 4, 14, 12, 12, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -128,7 +128,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
|
||||
rh.setBounds( 6, 6, 12, 10, 10, 13 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
|
||||
rh.setBounds( 6, 6, 11, 10, 10, 12 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -152,7 +152,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
return true;
|
||||
}
|
||||
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_BUS );
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_BUS );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.ImportBus.min, TickRates.ImportBus.max, this.getHandler() == null, false );
|
||||
return new TickingRequest( TickRates.ImportBus.getMin(), TickRates.ImportBus.getMax(), this.getHandler() == null, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,7 +174,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
@Override
|
||||
protected TickRateModulation doBusWork()
|
||||
{
|
||||
if( !this.proxy.isActive() || !this.canDoBusWork() )
|
||||
if( !this.getProxy().isActive() || !this.canDoBusWork() )
|
||||
{
|
||||
return TickRateModulation.IDLE;
|
||||
}
|
||||
@@ -189,15 +189,15 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
|
||||
try
|
||||
{
|
||||
this.itemToSend = this.calculateItemsToSend();
|
||||
this.itemToSend = Math.min( this.itemToSend, (int) ( 0.01 + this.proxy.getEnergy().extractAEPower( this.itemToSend, Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) );
|
||||
this.itemToSend = Math.min( this.itemToSend, (int) ( 0.01 + this.getProxy().getEnergy().extractAEPower( this.itemToSend, Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) );
|
||||
|
||||
final IMEMonitor<IAEItemStack> inv = this.proxy.getStorage().getItemInventory();
|
||||
final IEnergyGrid energy = this.proxy.getEnergy();
|
||||
final IMEMonitor<IAEItemStack> inv = this.getProxy().getStorage().getItemInventory();
|
||||
final IEnergyGrid energy = this.getProxy().getEnergy();
|
||||
|
||||
boolean Configured = false;
|
||||
for( int x = 0; x < this.availableSlots(); x++ )
|
||||
{
|
||||
final IAEItemStack ais = this.config.getAEStackInSlot( x );
|
||||
final IAEItemStack ais = this.getConfig().getAEStackInSlot( x );
|
||||
if( ais != null && this.itemToSend > 0 )
|
||||
{
|
||||
Configured = true;
|
||||
|
||||
@@ -86,20 +86,19 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
|
||||
private static final int FLAG_ON = 4;
|
||||
|
||||
final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 1 );
|
||||
private final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 1 );
|
||||
|
||||
boolean prevState = false;
|
||||
private boolean prevState = false;
|
||||
|
||||
long lastReportedValue = 0;
|
||||
long reportingValue = 0;
|
||||
private long lastReportedValue = 0;
|
||||
private long reportingValue = 0;
|
||||
|
||||
IStackWatcher myWatcher;
|
||||
IEnergyWatcher myEnergyWatcher;
|
||||
ICraftingWatcher myCraftingWatcher;
|
||||
double centerX;
|
||||
double centerY;
|
||||
double centerZ;
|
||||
boolean status = false;
|
||||
private IStackWatcher myWatcher;
|
||||
private IEnergyWatcher myEnergyWatcher;
|
||||
private ICraftingWatcher myCraftingWatcher;
|
||||
private double centerX;
|
||||
private double centerY;
|
||||
private double centerZ;
|
||||
|
||||
@Reflected
|
||||
public PartLevelEmitter( final ItemStack is )
|
||||
@@ -141,11 +140,11 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
final boolean isOn = this.isLevelEmitterOn();
|
||||
if( this.prevState != isOn )
|
||||
{
|
||||
this.host.markForUpdate();
|
||||
final TileEntity te = this.host.getTile();
|
||||
this.getHost().markForUpdate();
|
||||
final TileEntity te = this.getHost().getTile();
|
||||
this.prevState = isOn;
|
||||
Platform.notifyBlocksOfNeighbors( te.getWorld(), te.getPos() );
|
||||
Platform.notifyBlocksOfNeighbors( te.getWorld(), te.getPos().offset( this.side.getFacing() ) );
|
||||
Platform.notifyBlocksOfNeighbors( te.getWorld(), te.getPos().offset( this.getSide().getFacing() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,10 +152,10 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return ( this.clientFlags & FLAG_ON ) == FLAG_ON;
|
||||
return ( this.getClientFlags() & FLAG_ON ) == FLAG_ON;
|
||||
}
|
||||
|
||||
if( !this.proxy.isActive() )
|
||||
if( !this.getProxy().isActive() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -165,7 +164,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.proxy.getCrafting().isRequesting( this.config.getAEStackInSlot( 0 ) );
|
||||
return this.getProxy().getCrafting().isRequesting( this.config.getAEStackInSlot( 0 ) );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -194,7 +193,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
@Override
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return renderer.getIcon( this.is ).getAtlas();
|
||||
return renderer.getIcon( this.getItemStack() ).getAtlas();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -211,7 +210,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
|
||||
// update the system...
|
||||
public void configureWatchers()
|
||||
private void configureWatchers()
|
||||
{
|
||||
final IAEItemStack myStack = this.config.getAEStackInSlot( 0 );
|
||||
|
||||
@@ -232,7 +231,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
|
||||
try
|
||||
{
|
||||
this.proxy.getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.proxy.getNode() ) );
|
||||
this.getProxy().getGrid().postEvent( new MENetworkCraftingPatternChange( this, this.getProxy().getNode() ) );
|
||||
}
|
||||
catch( final GridAccessException e1 )
|
||||
{
|
||||
@@ -259,11 +258,11 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
try
|
||||
{
|
||||
// update to power...
|
||||
this.lastReportedValue = (long) this.proxy.getEnergy().getStoredPower();
|
||||
this.lastReportedValue = (long) this.getProxy().getEnergy().getStoredPower();
|
||||
this.updateState();
|
||||
|
||||
// no more item stuff..
|
||||
this.proxy.getStorage().getItemInventory().removeListener( this );
|
||||
this.getProxy().getStorage().getItemInventory().removeListener( this );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -277,11 +276,11 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
{
|
||||
if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 || myStack == null )
|
||||
{
|
||||
this.proxy.getStorage().getItemInventory().addListener( this, this.proxy.getGrid() );
|
||||
this.getProxy().getStorage().getItemInventory().addListener( this, this.getProxy().getGrid() );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.proxy.getStorage().getItemInventory().removeListener( this );
|
||||
this.getProxy().getStorage().getItemInventory().removeListener( this );
|
||||
|
||||
if( this.myWatcher != null )
|
||||
{
|
||||
@@ -289,7 +288,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
}
|
||||
}
|
||||
|
||||
this.updateReportingValue( this.proxy.getStorage().getItemInventory() );
|
||||
this.updateReportingValue( this.getProxy().getStorage().getItemInventory() );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -371,7 +370,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.proxy.getGrid() == effectiveGrid;
|
||||
return this.getProxy().getGrid() == effectiveGrid;
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -390,7 +389,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
{
|
||||
try
|
||||
{
|
||||
this.updateReportingValue( this.proxy.getStorage().getItemInventory() );
|
||||
this.updateReportingValue( this.getProxy().getStorage().getItemInventory() );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -414,14 +413,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( renderer.getIcon( this.is ) );
|
||||
rh.setTexture( renderer.getIcon( this.getItemStack() ) );
|
||||
this.renderTorchAtAngle( 0, -0.5, 0, renderer );
|
||||
}
|
||||
|
||||
public void renderTorchAtAngle( double baseX, double baseY, double baseZ, final ModelGenerator renderer )
|
||||
{
|
||||
final boolean isOn = this.isLevelEmitterOn();
|
||||
final IAESprite offTexture = renderer.getIcon( this.is );
|
||||
final IAESprite offTexture = renderer.getIcon( this.getItemStack() );
|
||||
final IAESprite IIcon = ( isOn ? CableBusTextures.LevelEmitterTorchOn.getIcon() : offTexture );
|
||||
//
|
||||
this.centerX = baseX + 0.5;
|
||||
@@ -433,11 +432,15 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
// double par11 = 0;
|
||||
|
||||
/*
|
||||
* double d5 = (double)TextureAtlasSprite.func_94209_e(); double d6 = (double)TextureAtlasSprite.func_94206_g(); double d7 =
|
||||
* double d5 = (double)TextureAtlasSprite.func_94209_e(); double d6 = (double)TextureAtlasSprite.func_94206_g();
|
||||
* double d7 =
|
||||
* (double)TextureAtlasSprite.func_94212_f(); double d8 = (double)TextureAtlasSprite.func_94210_h(); double d9 =
|
||||
* (double)TextureAtlasSprite.func_94214_a(7.0D); double d10 = (double)TextureAtlasSprite.func_94207_b(6.0D); double d11 =
|
||||
* (double)TextureAtlasSprite.func_94214_a(9.0D); double d12 = (double)TextureAtlasSprite.func_94207_b(8.0D); double d13 =
|
||||
* (double)TextureAtlasSprite.func_94214_a(7.0D); double d14 = (double)TextureAtlasSprite.func_94207_b(13.0D); double d15 =
|
||||
* (double)TextureAtlasSprite.func_94214_a(7.0D); double d10 = (double)TextureAtlasSprite.func_94207_b(6.0D);
|
||||
* double d11 =
|
||||
* (double)TextureAtlasSprite.func_94214_a(9.0D); double d12 = (double)TextureAtlasSprite.func_94207_b(8.0D);
|
||||
* double d13 =
|
||||
* (double)TextureAtlasSprite.func_94214_a(7.0D); double d14 = (double)TextureAtlasSprite.func_94207_b(13.0D);
|
||||
* double d15 =
|
||||
* (double)TextureAtlasSprite.func_94214_a(9.0D); double d16 = (double)TextureAtlasSprite.func_94207_b(15.0D);
|
||||
*/
|
||||
|
||||
@@ -490,56 +493,56 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
final double var44 = 0.0625D;
|
||||
final double Zero = 0;
|
||||
final double par10 = 0;
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var20, var22 );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20, var26 );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24, var26 );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24, var22 );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var20, var22 );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20, var26 );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24, var26 );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + TorchLen - toff, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24, var22 );
|
||||
|
||||
final double var422 = 0.1915D + 1.0 / 16.0;
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24b, var22b );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24b, var26b );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20b, var26b );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var20b, var22b );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var24b, var22b );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero * ( 1.0D - TorchLen ) + var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var24b, var26b );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) + var44, var20b, var26b );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero * ( 1.0D - TorchLen ) - var44, baseY + var422, baseZ + par10 * ( 1.0D - TorchLen ) - var44, var20b, var22b );
|
||||
|
||||
this.addVertexWithUV(t,renderer, baseX + var44 + Zero, baseY, baseZ - var44 + par10, var32, var30 );
|
||||
this.addVertexWithUV(t,renderer, baseX + var44 + Zero, baseY, baseZ + var44 + par10, var32, var34 );
|
||||
this.addVertexWithUV(t,renderer, baseX - var44 + Zero, baseY, baseZ + var44 + par10, var28, var34 );
|
||||
this.addVertexWithUV(t,renderer, baseX - var44 + Zero, baseY, baseZ - var44 + par10, var28, var30 );
|
||||
this.addVertexWithUV( t, renderer, baseX + var44 + Zero, baseY, baseZ - var44 + par10, var32, var30 );
|
||||
this.addVertexWithUV( t, renderer, baseX + var44 + Zero, baseY, baseZ + var44 + par10, var32, var34 );
|
||||
this.addVertexWithUV( t, renderer, baseX - var44 + Zero, baseY, baseZ + var44 + par10, var28, var34 );
|
||||
this.addVertexWithUV( t, renderer, baseX - var44 + Zero, baseY, baseZ - var44 + par10, var28, var30 );
|
||||
|
||||
this.addVertexWithUV(t,renderer, baseX - var44, baseY + 1.0D, var40, var16, var18 );
|
||||
this.addVertexWithUV(t,renderer, baseX - var44 + Zero, baseY + 0.0D, var40 + par10, var16, var19 );
|
||||
this.addVertexWithUV(t,renderer, baseX - var44 + Zero, baseY + 0.0D, var42 + par10, var17, var19 );
|
||||
this.addVertexWithUV(t,renderer, baseX - var44, baseY + 1.0D, var42, var17, var18 );
|
||||
this.addVertexWithUV( t, renderer, baseX - var44, baseY + 1.0D, var40, var16, var18 );
|
||||
this.addVertexWithUV( t, renderer, baseX - var44 + Zero, baseY + 0.0D, var40 + par10, var16, var19 );
|
||||
this.addVertexWithUV( t, renderer, baseX - var44 + Zero, baseY + 0.0D, var42 + par10, var17, var19 );
|
||||
this.addVertexWithUV( t, renderer, baseX - var44, baseY + 1.0D, var42, var17, var18 );
|
||||
|
||||
this.addVertexWithUV(t,renderer, baseX + var44, baseY + 1.0D, var42, var16, var18 );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero + var44, baseY + 0.0D, var42 + par10, var16, var19 );
|
||||
this.addVertexWithUV(t,renderer, baseX + Zero + var44, baseY + 0.0D, var40 + par10, var17, var19 );
|
||||
this.addVertexWithUV(t,renderer, baseX + var44, baseY + 1.0D, var40, var17, var18 );
|
||||
this.addVertexWithUV( t, renderer, baseX + var44, baseY + 1.0D, var42, var16, var18 );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero + var44, baseY + 0.0D, var42 + par10, var16, var19 );
|
||||
this.addVertexWithUV( t, renderer, baseX + Zero + var44, baseY + 0.0D, var40 + par10, var17, var19 );
|
||||
this.addVertexWithUV( t, renderer, baseX + var44, baseY + 1.0D, var40, var17, var18 );
|
||||
|
||||
this.addVertexWithUV(t,renderer, var36, baseY + 1.0D, baseZ + var44, var16, var18 );
|
||||
this.addVertexWithUV(t,renderer, var36 + Zero, baseY + 0.0D, baseZ + var44 + par10, var16, var19 );
|
||||
this.addVertexWithUV(t,renderer, var38 + Zero, baseY + 0.0D, baseZ + var44 + par10, var17, var19 );
|
||||
this.addVertexWithUV(t,renderer, var38, baseY + 1.0D, baseZ + var44, var17, var18 );
|
||||
this.addVertexWithUV( t, renderer, var36, baseY + 1.0D, baseZ + var44, var16, var18 );
|
||||
this.addVertexWithUV( t, renderer, var36 + Zero, baseY + 0.0D, baseZ + var44 + par10, var16, var19 );
|
||||
this.addVertexWithUV( t, renderer, var38 + Zero, baseY + 0.0D, baseZ + var44 + par10, var17, var19 );
|
||||
this.addVertexWithUV( t, renderer, var38, baseY + 1.0D, baseZ + var44, var17, var18 );
|
||||
|
||||
this.addVertexWithUV(t,renderer, var38, baseY + 1.0D, baseZ - var44, var16, var18 );
|
||||
this.addVertexWithUV(t,renderer, var38 + Zero, baseY + 0.0D, baseZ - var44 + par10, var16, var19 );
|
||||
this.addVertexWithUV(t,renderer, var36 + Zero, baseY + 0.0D, baseZ - var44 + par10, var17, var19 );
|
||||
this.addVertexWithUV(t,renderer, var36, baseY + 1.0D, baseZ - var44, var17, var18 );
|
||||
this.addVertexWithUV( t, renderer, var38, baseY + 1.0D, baseZ - var44, var16, var18 );
|
||||
this.addVertexWithUV( t, renderer, var38 + Zero, baseY + 0.0D, baseZ - var44 + par10, var16, var19 );
|
||||
this.addVertexWithUV( t, renderer, var36 + Zero, baseY + 0.0D, baseZ - var44 + par10, var17, var19 );
|
||||
this.addVertexWithUV( t, renderer, var36, baseY + 1.0D, baseZ - var44, var17, var18 );
|
||||
}
|
||||
|
||||
public void addVertexWithUV( final EnumFacing face, final ModelGenerator renderer, double x, double y, double z, final double u, final double v )
|
||||
private void addVertexWithUV( final EnumFacing face, final ModelGenerator renderer, double x, double y, double z, final double u, final double v )
|
||||
{
|
||||
x -= this.centerX;
|
||||
y -= this.centerY;
|
||||
z -= this.centerZ;
|
||||
|
||||
if( this.side == AEPartLocation.DOWN )
|
||||
if( this.getSide() == AEPartLocation.DOWN )
|
||||
{
|
||||
y = -y;
|
||||
z = -z;
|
||||
}
|
||||
|
||||
if( this.side == AEPartLocation.EAST )
|
||||
if( this.getSide() == AEPartLocation.EAST )
|
||||
{
|
||||
final double m = x;
|
||||
x = y;
|
||||
@@ -547,14 +550,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
y = -y;
|
||||
}
|
||||
|
||||
if( this.side == AEPartLocation.WEST )
|
||||
if( this.getSide() == AEPartLocation.WEST )
|
||||
{
|
||||
final double m = x;
|
||||
x = -y;
|
||||
y = m;
|
||||
}
|
||||
|
||||
if( this.side == AEPartLocation.SOUTH )
|
||||
if( this.getSide() == AEPartLocation.SOUTH )
|
||||
{
|
||||
final double m = z;
|
||||
z = y;
|
||||
@@ -562,7 +565,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
y = -y;
|
||||
}
|
||||
|
||||
if( this.side == AEPartLocation.NORTH )
|
||||
if( this.getSide() == AEPartLocation.NORTH )
|
||||
{
|
||||
final double m = z;
|
||||
z = -y;
|
||||
@@ -580,7 +583,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( renderer.getIcon( this.is ) );
|
||||
rh.setTexture( renderer.getIcon( this.getItemStack() ) );
|
||||
// rh.setTexture( CableBusTextures.ItemPartLevelEmitterOn.getIcon() );
|
||||
|
||||
// rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
@@ -589,14 +592,14 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
// rh.setBounds( 7, 7, 10, 9, 9, 15 );
|
||||
// rh.renderBlock( x, y, z, renderer );
|
||||
|
||||
renderer.renderAllFaces = true;
|
||||
renderer.setRenderAllFaces( true );
|
||||
|
||||
renderer.setBrightness( rh.getBlock().getMixedBrightnessForBlock( this.getHost().getTile().getWorld(), pos ) );
|
||||
renderer.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
|
||||
|
||||
this.renderTorchAtAngle( pos.getX(),pos.getY(),pos.getZ(),renderer );
|
||||
this.renderTorchAtAngle( pos.getX(), pos.getY(), pos.getZ(), renderer );
|
||||
|
||||
renderer.renderAllFaces = false;
|
||||
renderer.setRenderAllFaces( false );
|
||||
|
||||
rh.setBounds( 7, 7, 11, 9, 9, 12 );
|
||||
this.renderLights( pos, rh, renderer );
|
||||
@@ -624,7 +627,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
{
|
||||
if( this.isLevelEmitterOn() )
|
||||
{
|
||||
final AEPartLocation d = this.side;
|
||||
final AEPartLocation d = this.getSide();
|
||||
|
||||
final double d0 = d.xOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
final double d1 = d.yOffset * 0.45F + ( r.nextFloat() - 0.5F ) * 0.2D;
|
||||
@@ -650,7 +653,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
|
||||
return true;
|
||||
}
|
||||
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_LEVEL_EMITTER );
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_LEVEL_EMITTER );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import appeng.util.Platform;
|
||||
public abstract class PartSharedItemBus extends PartUpgradeable implements IGridTickable
|
||||
{
|
||||
|
||||
protected final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 9 );
|
||||
private final AppEngInternalAEInventory config = new AppEngInternalAEInventory( this, 9 );
|
||||
private int adaptorHash = 0;
|
||||
private InventoryAdaptor adaptor;
|
||||
private boolean lastRedstone = false;
|
||||
@@ -57,14 +57,14 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
public void readFromNBT( final net.minecraft.nbt.NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.config.readFromNBT( extra, "config" );
|
||||
this.getConfig().readFromNBT( extra, "config" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( final net.minecraft.nbt.NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.config.writeToNBT( extra, "config" );
|
||||
this.getConfig().writeToNBT( extra, "config" );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,7 +72,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
{
|
||||
if( name.equals( "config" ) )
|
||||
{
|
||||
return this.config;
|
||||
return this.getConfig();
|
||||
}
|
||||
|
||||
return super.getInventoryByName( name );
|
||||
@@ -82,7 +82,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
this.updateState();
|
||||
if( this.lastRedstone != this.host.hasRedstone( this.side ) )
|
||||
if( this.lastRedstone != this.getHost().hasRedstone( this.getSide() ) )
|
||||
{
|
||||
this.lastRedstone = !this.lastRedstone;
|
||||
if( this.lastRedstone && this.getRSMode() == RedstoneMode.SIGNAL_PULSE )
|
||||
@@ -95,7 +95,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
protected InventoryAdaptor getHandler()
|
||||
{
|
||||
final TileEntity self = this.getHost().getTile();
|
||||
final TileEntity target = this.getTileEntity( self, self.getPos().offset( this.side.getFacing() ) );
|
||||
final TileEntity target = this.getTileEntity( self, self.getPos().offset( this.getSide().getFacing() ) );
|
||||
|
||||
final int newAdaptorHash = Platform.generateTileHash( target );
|
||||
|
||||
@@ -105,7 +105,7 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
}
|
||||
|
||||
this.adaptorHash = newAdaptorHash;
|
||||
this.adaptor = InventoryAdaptor.getAdaptor( target, this.side.getFacing().getOpposite() );
|
||||
this.adaptor = InventoryAdaptor.getAdaptor( target, this.getSide().getFacing().getOpposite() );
|
||||
|
||||
return this.adaptor;
|
||||
}
|
||||
@@ -118,13 +118,13 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
{
|
||||
return w.getTileEntity( pos );
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected int availableSlots()
|
||||
{
|
||||
return Math.min( 1 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 4, this.config.getSizeInventory() );
|
||||
return Math.min( 1 + this.getInstalledUpgrades( Upgrades.CAPACITY ) * 4, this.getConfig().getSizeInventory() );
|
||||
}
|
||||
|
||||
protected int calculateItemsToSend()
|
||||
@@ -155,10 +155,9 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
protected boolean canDoBusWork()
|
||||
{
|
||||
final TileEntity self = this.getHost().getTile();
|
||||
final BlockPos selfPos = self.getPos().offset( this.side.getFacing() );
|
||||
final BlockPos selfPos = self.getPos().offset( this.getSide().getFacing() );
|
||||
final int xCoordinate = selfPos.getX();
|
||||
final int zCoordinate = selfPos.getZ();
|
||||
|
||||
final World world = self.getWorld();
|
||||
|
||||
return world != null && world.getChunkProvider().chunkExists( xCoordinate >> 4, zCoordinate >> 4 );
|
||||
@@ -170,11 +169,11 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
{
|
||||
if( !this.isSleeping() )
|
||||
{
|
||||
this.proxy.getTick().wakeDevice( this.proxy.getNode() );
|
||||
this.getProxy().getTick().wakeDevice( this.getProxy().getNode() );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.proxy.getTick().sleepDevice( this.proxy.getNode() );
|
||||
this.getProxy().getTick().sleepDevice( this.getProxy().getNode() );
|
||||
}
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
@@ -184,4 +183,9 @@ public abstract class PartSharedItemBus extends PartUpgradeable implements IGrid
|
||||
}
|
||||
|
||||
protected abstract TickRateModulation doBusWork();
|
||||
|
||||
AppEngInternalAEInventory getConfig()
|
||||
{
|
||||
return this.config;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
public PartUpgradeable( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.upgrades = new StackUpgradeInventory( this.is, this, this.getUpgradeSlots() );
|
||||
this.upgrades = new StackUpgradeInventory( this.getItemStack(), this, this.getUpgradeSlots() );
|
||||
this.upgrades.setMaxStackSize( 1 );
|
||||
this.manager = new ConfigManager( this );
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
return false;
|
||||
|
||||
case HIGH_SIGNAL:
|
||||
if( this.host.hasRedstone( this.side ) )
|
||||
if( this.getHost().hasRedstone( this.getSide() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public abstract class PartUpgradeable extends PartBasicState implements IAEAppEn
|
||||
break;
|
||||
|
||||
case LOW_SIGNAL:
|
||||
if( !this.host.hasRedstone( this.side ) )
|
||||
if( !this.getHost().hasRedstone( this.getSide() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
public UpgradeInventory( final IAEAppEngInventory parent, final int s )
|
||||
{
|
||||
super( null, s );
|
||||
this.te = this;
|
||||
this.setTileEntity( this );
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class InvLayerData
|
||||
return this.slots != null && slot >= 0 && slot < this.slots.size();
|
||||
}
|
||||
|
||||
public int getSizeInventory()
|
||||
int getSizeInventory()
|
||||
{
|
||||
if( this.slots == null )
|
||||
{
|
||||
@@ -125,7 +125,7 @@ public class InvLayerData
|
||||
return false;
|
||||
}
|
||||
|
||||
public void markDirty()
|
||||
void markDirty()
|
||||
{
|
||||
if( this.inventories != null )
|
||||
{
|
||||
|
||||
@@ -27,8 +27,8 @@ import net.minecraft.util.EnumFacing;
|
||||
public class InvSot
|
||||
{
|
||||
|
||||
public final ISidedInventory partInv;
|
||||
public final int index;
|
||||
private final ISidedInventory partInv;
|
||||
private final int index;
|
||||
|
||||
public InvSot( ISidedInventory part, int slot )
|
||||
{
|
||||
@@ -41,7 +41,7 @@ public class InvSot
|
||||
return this.partInv.decrStackSize( this.index, j );
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot()
|
||||
ItemStack getStackInSlot()
|
||||
{
|
||||
return this.partInv.getStackInSlot( this.index );
|
||||
}
|
||||
|
||||
@@ -19,75 +19,75 @@
|
||||
package appeng.parts.layers;
|
||||
|
||||
|
||||
import cofh.api.energy.IEnergyConnection;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import cofh.api.energy.IEnergyProvider;
|
||||
import cofh.api.energy.IEnergyReceiver;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.LayerBase;
|
||||
import appeng.api.util.ForgeDirection;
|
||||
|
||||
|
||||
public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IEnergyReceiver )
|
||||
{
|
||||
return ( (IEnergyReceiver) part ).receiveEnergy( from, maxReceive, simulate );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy( ForgeDirection from, int maxExtract, boolean simulate )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IEnergyProvider )
|
||||
{
|
||||
return ( (IEnergyProvider) part ).extractEnergy( from, maxExtract, simulate );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored( ForgeDirection from )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IEnergyProvider )
|
||||
{
|
||||
return ( (IEnergyProvider) part ).getEnergyStored( from );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored( ForgeDirection from )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IEnergyProvider )
|
||||
{
|
||||
return ( (IEnergyProvider) part ).getMaxEnergyStored( from );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectEnergy( ForgeDirection from )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IEnergyConnection )
|
||||
{
|
||||
return ( (IEnergyConnection) part ).canConnectEnergy( from );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//import cofh.api.energy.IEnergyConnection;
|
||||
//import cofh.api.energy.IEnergyHandler;
|
||||
//import cofh.api.energy.IEnergyProvider;
|
||||
//import cofh.api.energy.IEnergyReceiver;
|
||||
//import appeng.api.parts.IPart;
|
||||
//import appeng.api.parts.LayerBase;
|
||||
//import appeng.api.util.ForgeDirection;
|
||||
//
|
||||
//
|
||||
//public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler
|
||||
//{
|
||||
//
|
||||
// @Override
|
||||
// public int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IEnergyReceiver )
|
||||
// {
|
||||
// return ( (IEnergyReceiver) part ).receiveEnergy( from, maxReceive, simulate );
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int extractEnergy( ForgeDirection from, int maxExtract, boolean simulate )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IEnergyProvider )
|
||||
// {
|
||||
// return ( (IEnergyProvider) part ).extractEnergy( from, maxExtract, simulate );
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getEnergyStored( ForgeDirection from )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IEnergyProvider )
|
||||
// {
|
||||
// return ( (IEnergyProvider) part ).getEnergyStored( from );
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getMaxEnergyStored( ForgeDirection from )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IEnergyProvider )
|
||||
// {
|
||||
// return ( (IEnergyProvider) part ).getMaxEnergyStored( from );
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canConnectEnergy( ForgeDirection from )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IEnergyConnection )
|
||||
// {
|
||||
// return ( (IEnergyConnection) part ).canConnectEnergy( from );
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -19,183 +19,183 @@
|
||||
package appeng.parts.layers;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import ic2.api.energy.tile.IEnergyAcceptor;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.energy.tile.IEnergyTile;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.parts.LayerBase;
|
||||
import appeng.api.parts.LayerFlags;
|
||||
import appeng.api.util.ForgeDirection;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class LayerIEnergySink extends LayerBase implements IEnergySink
|
||||
{
|
||||
|
||||
private TileEntity getEnergySinkTile()
|
||||
{
|
||||
IPartHost host = (IPartHost) this;
|
||||
return host.getTile();
|
||||
}
|
||||
|
||||
private World getEnergySinkWorld()
|
||||
{
|
||||
if( this.getEnergySinkTile() == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.getEnergySinkTile().getWorld();
|
||||
}
|
||||
|
||||
private boolean isTileValid()
|
||||
{
|
||||
TileEntity te = this.getEnergySinkTile();
|
||||
|
||||
if( te == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return !te.isInvalid() && te.getWorld().blockExists( te.xCoord, te.yCoord, te.zCoord );
|
||||
}
|
||||
|
||||
private void addToENet()
|
||||
{
|
||||
if( this.getEnergySinkWorld() == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// re-add
|
||||
this.removeFromENet();
|
||||
|
||||
if( !this.isInIC2() && Platform.isServer() && this.isTileValid() )
|
||||
{
|
||||
this.getLayerFlags().add( LayerFlags.IC2_ENET );
|
||||
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergyTile) this.getEnergySinkTile() ) );
|
||||
}
|
||||
}
|
||||
|
||||
private void removeFromENet()
|
||||
{
|
||||
if( this.getEnergySinkWorld() == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( this.isInIC2() && Platform.isServer() )
|
||||
{
|
||||
this.getLayerFlags().remove( LayerFlags.IC2_ENET );
|
||||
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergyTile) this.getEnergySinkTile() ) );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean interestedInIC2()
|
||||
{
|
||||
if( !( (IPartHost) this ).isInWorld() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int interested = 0;
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
IPart part = this.getPart( dir );
|
||||
if( part instanceof IEnergyTile )
|
||||
{
|
||||
interested++;
|
||||
}
|
||||
}
|
||||
return interested == 1;// if more then one tile is interested we need to abandon...
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partChanged()
|
||||
{
|
||||
super.partChanged();
|
||||
|
||||
if( this.interestedInIC2() )
|
||||
{
|
||||
this.addToENet();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.removeFromENet();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsEnergyFrom( TileEntity emitter, ForgeDirection direction )
|
||||
{
|
||||
if( !this.isInIC2() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
IPart part = this.getPart( direction );
|
||||
if( part instanceof IEnergySink )
|
||||
{
|
||||
return ( (IEnergyAcceptor) part ).acceptsEnergyFrom( emitter, direction );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isInIC2()
|
||||
{
|
||||
return this.getLayerFlags().contains( LayerFlags.IC2_ENET );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDemandedEnergy()
|
||||
{
|
||||
if( !this.isInIC2() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// this is a flawed implementation, that requires a change to the IC2 API.
|
||||
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
IPart part = this.getPart( dir );
|
||||
if( part instanceof IEnergySink )
|
||||
{
|
||||
// use lower number cause ic2 deletes power it sends that isn't received.
|
||||
return ( (IEnergySink) part ).getDemandedEnergy();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSinkTier()
|
||||
{
|
||||
return Integer.MAX_VALUE; // no real options here...
|
||||
}
|
||||
|
||||
@Override
|
||||
public double injectEnergy( ForgeDirection directionFrom, double amount, double voltage )
|
||||
{
|
||||
if( !this.isInIC2() )
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
IPart part = this.getPart( dir );
|
||||
if( part instanceof IEnergySink )
|
||||
{
|
||||
return ( (IEnergySink) part ).injectEnergy( directionFrom, amount, voltage );
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
//import net.minecraft.tileentity.TileEntity;
|
||||
//import net.minecraft.world.World;
|
||||
//import net.minecraftforge.common.MinecraftForge;
|
||||
//import ic2.api.energy.tile.IEnergyAcceptor;
|
||||
//import ic2.api.energy.tile.IEnergySink;
|
||||
//import ic2.api.energy.tile.IEnergyTile;
|
||||
//import appeng.api.parts.IPart;
|
||||
//import appeng.api.parts.IPartHost;
|
||||
//import appeng.api.parts.LayerBase;
|
||||
//import appeng.api.parts.LayerFlags;
|
||||
//import appeng.api.util.ForgeDirection;
|
||||
//import appeng.util.Platform;
|
||||
//
|
||||
//
|
||||
//public class LayerIEnergySink extends LayerBase implements IEnergySink
|
||||
//{
|
||||
//
|
||||
// private TileEntity getEnergySinkTile()
|
||||
// {
|
||||
// IPartHost host = (IPartHost) this;
|
||||
// return host.getTile();
|
||||
// }
|
||||
//
|
||||
// private World getEnergySinkWorld()
|
||||
// {
|
||||
// if( this.getEnergySinkTile() == null )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// return this.getEnergySinkTile().getWorld();
|
||||
// }
|
||||
//
|
||||
// private boolean isTileValid()
|
||||
// {
|
||||
// TileEntity te = this.getEnergySinkTile();
|
||||
//
|
||||
// if( te == null )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// return !te.isInvalid() && te.getWorld().blockExists( te.xCoord, te.yCoord, te.zCoord );
|
||||
// }
|
||||
//
|
||||
// private void addToENet()
|
||||
// {
|
||||
// if( this.getEnergySinkWorld() == null )
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // re-add
|
||||
// this.removeFromENet();
|
||||
//
|
||||
// if( !this.isInIC2() && Platform.isServer() && this.isTileValid() )
|
||||
// {
|
||||
// this.getLayerFlags().add( LayerFlags.IC2_ENET );
|
||||
// MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergyTile) this.getEnergySinkTile() ) );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void removeFromENet()
|
||||
// {
|
||||
// if( this.getEnergySinkWorld() == null )
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if( this.isInIC2() && Platform.isServer() )
|
||||
// {
|
||||
// this.getLayerFlags().remove( LayerFlags.IC2_ENET );
|
||||
// MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergyTile) this.getEnergySinkTile() ) );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private boolean interestedInIC2()
|
||||
// {
|
||||
// if( !( (IPartHost) this ).isInWorld() )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// int interested = 0;
|
||||
// for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
// {
|
||||
// IPart part = this.getPart( dir );
|
||||
// if( part instanceof IEnergyTile )
|
||||
// {
|
||||
// interested++;
|
||||
// }
|
||||
// }
|
||||
// return interested == 1;// if more then one tile is interested we need to abandon...
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void partChanged()
|
||||
// {
|
||||
// super.partChanged();
|
||||
//
|
||||
// if( this.interestedInIC2() )
|
||||
// {
|
||||
// this.addToENet();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this.removeFromENet();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean acceptsEnergyFrom( TileEntity emitter, ForgeDirection direction )
|
||||
// {
|
||||
// if( !this.isInIC2() )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// IPart part = this.getPart( direction );
|
||||
// if( part instanceof IEnergySink )
|
||||
// {
|
||||
// return ( (IEnergyAcceptor) part ).acceptsEnergyFrom( emitter, direction );
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// private boolean isInIC2()
|
||||
// {
|
||||
// return this.getLayerFlags().contains( LayerFlags.IC2_ENET );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double getDemandedEnergy()
|
||||
// {
|
||||
// if( !this.isInIC2() )
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// // this is a flawed implementation, that requires a change to the IC2 API.
|
||||
//
|
||||
// for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
// {
|
||||
// IPart part = this.getPart( dir );
|
||||
// if( part instanceof IEnergySink )
|
||||
// {
|
||||
// // use lower number cause ic2 deletes power it sends that isn't received.
|
||||
// return ( (IEnergySink) part ).getDemandedEnergy();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getSinkTier()
|
||||
// {
|
||||
// return Integer.MAX_VALUE; // no real options here...
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double injectEnergy( ForgeDirection directionFrom, double amount, double voltage )
|
||||
// {
|
||||
// if( !this.isInIC2() )
|
||||
// {
|
||||
// return amount;
|
||||
// }
|
||||
//
|
||||
// for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
// {
|
||||
// IPart part = this.getPart( dir );
|
||||
// if( part instanceof IEnergySink )
|
||||
// {
|
||||
// return ( (IEnergySink) part ).injectEnergy( directionFrom, amount, voltage );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return amount;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -19,188 +19,188 @@
|
||||
package appeng.parts.layers;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import ic2.api.energy.tile.IEnergyEmitter;
|
||||
import ic2.api.energy.tile.IEnergySink;
|
||||
import ic2.api.energy.tile.IEnergySource;
|
||||
import ic2.api.energy.tile.IEnergyTile;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.parts.LayerBase;
|
||||
import appeng.api.parts.LayerFlags;
|
||||
import appeng.api.util.ForgeDirection;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class LayerIEnergySource extends LayerBase implements IEnergySource
|
||||
{
|
||||
|
||||
private TileEntity getEnergySourceTile()
|
||||
{
|
||||
IPartHost host = (IPartHost) this;
|
||||
return host.getTile();
|
||||
}
|
||||
|
||||
private World getEnergySourceWorld()
|
||||
{
|
||||
if( this.getEnergySourceTile() == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return this.getEnergySourceTile().getWorld();
|
||||
}
|
||||
|
||||
private boolean isTileValid()
|
||||
{
|
||||
TileEntity te = this.getEnergySourceTile();
|
||||
if( te == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !te.isInvalid();
|
||||
}
|
||||
|
||||
private void addToENet()
|
||||
{
|
||||
if( this.getEnergySourceWorld() == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// re-add
|
||||
this.removeFromENet();
|
||||
|
||||
if( !this.isInIC2() && Platform.isServer() && this.isTileValid() )
|
||||
{
|
||||
this.getLayerFlags().add( LayerFlags.IC2_ENET );
|
||||
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergyTile) this.getEnergySourceTile() ) );
|
||||
}
|
||||
}
|
||||
|
||||
private void removeFromENet()
|
||||
{
|
||||
if( this.getEnergySourceWorld() == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if( this.isInIC2() && Platform.isServer() )
|
||||
{
|
||||
this.getLayerFlags().remove( LayerFlags.IC2_ENET );
|
||||
MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergyTile) this.getEnergySourceTile() ) );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean interestedInIC2()
|
||||
{
|
||||
if( !( (IPartHost) this ).isInWorld() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int interested = 0;
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
IPart part = this.getPart( dir );
|
||||
if( part instanceof IEnergyTile )
|
||||
{
|
||||
interested++;
|
||||
}
|
||||
}
|
||||
return interested == 1;// if more then one tile is interested we need to abandon...
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partChanged()
|
||||
{
|
||||
super.partChanged();
|
||||
|
||||
if( this.interestedInIC2() )
|
||||
{
|
||||
this.addToENet();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.removeFromENet();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean emitsEnergyTo( TileEntity receiver, ForgeDirection direction )
|
||||
{
|
||||
if( !this.isInIC2() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
IPart part = this.getPart( direction );
|
||||
if( part instanceof IEnergySink )
|
||||
{
|
||||
return ( (IEnergyEmitter) part ).emitsEnergyTo( receiver, direction );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isInIC2()
|
||||
{
|
||||
return this.getLayerFlags().contains( LayerFlags.IC2_ENET );
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getOfferedEnergy()
|
||||
{
|
||||
if( !this.isInIC2() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// this is a flawed implementation, that requires a change to the IC2 API.
|
||||
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
IPart part = this.getPart( dir );
|
||||
if( part instanceof IEnergySource )
|
||||
{
|
||||
// use lower number cause ic2 deletes power it sends that isn't received.
|
||||
return ( (IEnergySource) part ).getOfferedEnergy();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEnergy( double amount )
|
||||
{
|
||||
// this is a flawed implementation, that requires a change to the IC2 API.
|
||||
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
IPart part = this.getPart( dir );
|
||||
if( part instanceof IEnergySource )
|
||||
{
|
||||
( (IEnergySource) part ).drawEnergy( amount );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSourceTier()
|
||||
{
|
||||
// this is a flawed implementation, that requires a change to the IC2 API.
|
||||
|
||||
for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
{
|
||||
IPart part = this.getPart( dir );
|
||||
if( part instanceof IEnergySource )
|
||||
{
|
||||
return ( (IEnergySource) part ).getSourceTier();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
//import net.minecraft.tileentity.TileEntity;
|
||||
//import net.minecraft.world.World;
|
||||
//import net.minecraftforge.common.MinecraftForge;
|
||||
//import ic2.api.energy.tile.IEnergyEmitter;
|
||||
//import ic2.api.energy.tile.IEnergySink;
|
||||
//import ic2.api.energy.tile.IEnergySource;
|
||||
//import ic2.api.energy.tile.IEnergyTile;
|
||||
//import appeng.api.parts.IPart;
|
||||
//import appeng.api.parts.IPartHost;
|
||||
//import appeng.api.parts.LayerBase;
|
||||
//import appeng.api.parts.LayerFlags;
|
||||
//import appeng.api.util.ForgeDirection;
|
||||
//import appeng.util.Platform;
|
||||
//
|
||||
//
|
||||
//public class LayerIEnergySource extends LayerBase implements IEnergySource
|
||||
//{
|
||||
//
|
||||
// private TileEntity getEnergySourceTile()
|
||||
// {
|
||||
// IPartHost host = (IPartHost) this;
|
||||
// return host.getTile();
|
||||
// }
|
||||
//
|
||||
// private World getEnergySourceWorld()
|
||||
// {
|
||||
// if( this.getEnergySourceTile() == null )
|
||||
// {
|
||||
// return null;
|
||||
// }
|
||||
// return this.getEnergySourceTile().getWorld();
|
||||
// }
|
||||
//
|
||||
// private boolean isTileValid()
|
||||
// {
|
||||
// TileEntity te = this.getEnergySourceTile();
|
||||
// if( te == null )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// return !te.isInvalid();
|
||||
// }
|
||||
//
|
||||
// private void addToENet()
|
||||
// {
|
||||
// if( this.getEnergySourceWorld() == null )
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // re-add
|
||||
// this.removeFromENet();
|
||||
//
|
||||
// if( !this.isInIC2() && Platform.isServer() && this.isTileValid() )
|
||||
// {
|
||||
// this.getLayerFlags().add( LayerFlags.IC2_ENET );
|
||||
// MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileLoadEvent( (IEnergyTile) this.getEnergySourceTile() ) );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void removeFromENet()
|
||||
// {
|
||||
// if( this.getEnergySourceWorld() == null )
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if( this.isInIC2() && Platform.isServer() )
|
||||
// {
|
||||
// this.getLayerFlags().remove( LayerFlags.IC2_ENET );
|
||||
// MinecraftForge.EVENT_BUS.post( new ic2.api.energy.event.EnergyTileUnloadEvent( (IEnergyTile) this.getEnergySourceTile() ) );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private boolean interestedInIC2()
|
||||
// {
|
||||
// if( !( (IPartHost) this ).isInWorld() )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// int interested = 0;
|
||||
// for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
// {
|
||||
// IPart part = this.getPart( dir );
|
||||
// if( part instanceof IEnergyTile )
|
||||
// {
|
||||
// interested++;
|
||||
// }
|
||||
// }
|
||||
// return interested == 1;// if more then one tile is interested we need to abandon...
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void partChanged()
|
||||
// {
|
||||
// super.partChanged();
|
||||
//
|
||||
// if( this.interestedInIC2() )
|
||||
// {
|
||||
// this.addToENet();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this.removeFromENet();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean emitsEnergyTo( TileEntity receiver, ForgeDirection direction )
|
||||
// {
|
||||
// if( !this.isInIC2() )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// IPart part = this.getPart( direction );
|
||||
// if( part instanceof IEnergySink )
|
||||
// {
|
||||
// return ( (IEnergyEmitter) part ).emitsEnergyTo( receiver, direction );
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// private boolean isInIC2()
|
||||
// {
|
||||
// return this.getLayerFlags().contains( LayerFlags.IC2_ENET );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double getOfferedEnergy()
|
||||
// {
|
||||
// if( !this.isInIC2() )
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// // this is a flawed implementation, that requires a change to the IC2 API.
|
||||
//
|
||||
// for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
// {
|
||||
// IPart part = this.getPart( dir );
|
||||
// if( part instanceof IEnergySource )
|
||||
// {
|
||||
// // use lower number cause ic2 deletes power it sends that isn't received.
|
||||
// return ( (IEnergySource) part ).getOfferedEnergy();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void drawEnergy( double amount )
|
||||
// {
|
||||
// // this is a flawed implementation, that requires a change to the IC2 API.
|
||||
//
|
||||
// for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
// {
|
||||
// IPart part = this.getPart( dir );
|
||||
// if( part instanceof IEnergySource )
|
||||
// {
|
||||
// ( (IEnergySource) part ).drawEnergy( amount );
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getSourceTier()
|
||||
// {
|
||||
// // this is a flawed implementation, that requires a change to the IC2 API.
|
||||
//
|
||||
// for( ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS )
|
||||
// {
|
||||
// IPart part = this.getPart( dir );
|
||||
// if( part instanceof IEnergySource )
|
||||
// {
|
||||
// return ( (IEnergySource) part ).getSourceTier();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -19,82 +19,82 @@
|
||||
package appeng.parts.layers;
|
||||
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.LayerBase;
|
||||
import appeng.api.util.ForgeDirection;
|
||||
|
||||
|
||||
public class LayerIFluidHandler extends LayerBase implements IFluidHandler
|
||||
{
|
||||
|
||||
static final FluidTankInfo[] EMPTY_LIST = new FluidTankInfo[0];
|
||||
|
||||
@Override
|
||||
public int fill( ForgeDirection from, FluidStack resource, boolean doFill )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IFluidHandler )
|
||||
{
|
||||
return ( (IFluidHandler) part ).fill( from, resource, doFill );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain( ForgeDirection from, FluidStack resource, boolean doDrain )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IFluidHandler )
|
||||
{
|
||||
return ( (IFluidHandler) part ).drain( from, resource, doDrain );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain( ForgeDirection from, int maxDrain, boolean doDrain )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IFluidHandler )
|
||||
{
|
||||
return ( (IFluidHandler) part ).drain( from, maxDrain, doDrain );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill( ForgeDirection from, net.minecraftforge.fluids.Fluid fluid )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IFluidHandler )
|
||||
{
|
||||
return ( (IFluidHandler) part ).canFill( from, fluid );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain( ForgeDirection from, net.minecraftforge.fluids.Fluid fluid )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IFluidHandler )
|
||||
{
|
||||
return ( (IFluidHandler) part ).canDrain( from, fluid );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo( ForgeDirection from )
|
||||
{
|
||||
IPart part = this.getPart( from );
|
||||
if( part instanceof IFluidHandler )
|
||||
{
|
||||
return ( (IFluidHandler) part ).getTankInfo( from );
|
||||
}
|
||||
return EMPTY_LIST;
|
||||
}
|
||||
}
|
||||
//import net.minecraftforge.fluids.FluidStack;
|
||||
//import net.minecraftforge.fluids.FluidTankInfo;
|
||||
//import net.minecraftforge.fluids.IFluidHandler;
|
||||
//import appeng.api.parts.IPart;
|
||||
//import appeng.api.parts.LayerBase;
|
||||
//import appeng.api.util.ForgeDirection;
|
||||
//
|
||||
//
|
||||
//public class LayerIFluidHandler extends LayerBase implements IFluidHandler
|
||||
//{
|
||||
//
|
||||
// private static final FluidTankInfo[] EMPTY_LIST = new FluidTankInfo[0];
|
||||
//
|
||||
// @Override
|
||||
// public int fill( ForgeDirection from, FluidStack resource, boolean doFill )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IFluidHandler )
|
||||
// {
|
||||
// return ( (IFluidHandler) part ).fill( from, resource, doFill );
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public FluidStack drain( ForgeDirection from, FluidStack resource, boolean doDrain )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IFluidHandler )
|
||||
// {
|
||||
// return ( (IFluidHandler) part ).drain( from, resource, doDrain );
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public FluidStack drain( ForgeDirection from, int maxDrain, boolean doDrain )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IFluidHandler )
|
||||
// {
|
||||
// return ( (IFluidHandler) part ).drain( from, maxDrain, doDrain );
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canFill( ForgeDirection from, net.minecraftforge.fluids.Fluid fluid )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IFluidHandler )
|
||||
// {
|
||||
// return ( (IFluidHandler) part ).canFill( from, fluid );
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canDrain( ForgeDirection from, net.minecraftforge.fluids.Fluid fluid )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IFluidHandler )
|
||||
// {
|
||||
// return ( (IFluidHandler) part ).canDrain( from, fluid );
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public FluidTankInfo[] getTankInfo( ForgeDirection from )
|
||||
// {
|
||||
// IPart part = this.getPart( from );
|
||||
// if( part instanceof IFluidHandler )
|
||||
// {
|
||||
// return ( (IFluidHandler) part ).getTankInfo( from );
|
||||
// }
|
||||
// return EMPTY_LIST;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -19,26 +19,26 @@
|
||||
package appeng.parts.layers;
|
||||
|
||||
|
||||
import buildcraft.api.transport.IPipeConnection;
|
||||
import buildcraft.api.transport.IPipeTile.PipeType;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.LayerBase;
|
||||
import appeng.api.util.ForgeDirection;
|
||||
import appeng.helpers.Reflected;
|
||||
|
||||
|
||||
@Reflected
|
||||
public class LayerIPipeConnection extends LayerBase implements IPipeConnection
|
||||
{
|
||||
|
||||
@Override
|
||||
public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
{
|
||||
IPart part = this.getPart( with );
|
||||
if( part instanceof IPipeConnection )
|
||||
{
|
||||
return ( (IPipeConnection) part ).overridePipeConnection( type, with );
|
||||
}
|
||||
return ConnectOverride.DEFAULT;
|
||||
}
|
||||
}
|
||||
//import buildcraft.api.transport.IPipeConnection;
|
||||
//import buildcraft.api.transport.IPipeTile.PipeType;
|
||||
//import appeng.api.parts.IPart;
|
||||
//import appeng.api.parts.LayerBase;
|
||||
//import appeng.api.util.ForgeDirection;
|
||||
//import appeng.helpers.Reflected;
|
||||
//
|
||||
//
|
||||
//@Reflected
|
||||
//public class LayerIPipeConnection extends LayerBase implements IPipeConnection
|
||||
//{
|
||||
//
|
||||
// @Override
|
||||
// public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
// {
|
||||
// IPart part = this.getPart( with );
|
||||
// if( part instanceof IPipeConnection )
|
||||
// {
|
||||
// return ( (IPipeConnection) part ).overridePipeConnection( type, with );
|
||||
// }
|
||||
// return ConnectOverride.DEFAULT;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.parts.LayerBase;
|
||||
@@ -51,7 +52,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
|
||||
// a simple empty array for empty stuff..
|
||||
private static final int[] NULL_SIDES = {};
|
||||
|
||||
InvLayerData invLayer = null;
|
||||
private InvLayerData invLayer = null;
|
||||
|
||||
/**
|
||||
* Recalculate inventory wrapper cache.
|
||||
@@ -179,7 +180,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
public String getCommandSenderName()
|
||||
{
|
||||
return "AEMultiPart";
|
||||
}
|
||||
@@ -203,12 +204,12 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory(EntityPlayer player)
|
||||
public void openInventory( EntityPlayer player )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory(EntityPlayer player)
|
||||
public void closeInventory( EntityPlayer player )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -279,7 +280,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
|
||||
int id,
|
||||
int value )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -291,7 +292,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
|
||||
@Override
|
||||
public void clear()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,31 +19,31 @@
|
||||
package appeng.parts.layers;
|
||||
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import pneumaticCraft.api.tileentity.IAirHandler;
|
||||
import pneumaticCraft.api.tileentity.ISidedPneumaticMachine;
|
||||
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.LayerBase;
|
||||
|
||||
|
||||
public class LayerPressure extends LayerBase implements ISidedPneumaticMachine
|
||||
{
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IAirHandler getAirHandler( ForgeDirection side )
|
||||
{
|
||||
IPart part = this.getPart( side );
|
||||
if( part instanceof ISidedPneumaticMachine )
|
||||
{
|
||||
return ( (ISidedPneumaticMachine) part ).getAirHandler( side );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
//import javax.annotation.Nullable;
|
||||
//
|
||||
//import net.minecraftforge.common.util.ForgeDirection;
|
||||
//
|
||||
//import pneumaticCraft.api.tileentity.IAirHandler;
|
||||
//import pneumaticCraft.api.tileentity.ISidedPneumaticMachine;
|
||||
//
|
||||
//import appeng.api.parts.IPart;
|
||||
//import appeng.api.parts.LayerBase;
|
||||
//
|
||||
//
|
||||
//public class LayerPressure extends LayerBase implements ISidedPneumaticMachine
|
||||
//{
|
||||
//
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public IAirHandler getAirHandler( ForgeDirection side )
|
||||
// {
|
||||
// IPart part = this.getPart( side );
|
||||
// if( part instanceof ISidedPneumaticMachine )
|
||||
// {
|
||||
// return ( (ISidedPneumaticMachine) part ).getAirHandler( side );
|
||||
// }
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -18,44 +18,45 @@
|
||||
|
||||
package appeng.parts.layers;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import li.cil.oc.api.network.Node;
|
||||
import li.cil.oc.api.network.SidedEnvironment;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.LayerBase;
|
||||
import appeng.api.util.ForgeDirection;
|
||||
import appeng.core.Registration;
|
||||
import appeng.helpers.Reflected;
|
||||
|
||||
|
||||
/**
|
||||
* Reflected in {@link Registration#initialize(FMLInitializationEvent)}
|
||||
*/
|
||||
@Reflected
|
||||
public class LayerSidedEnvironment extends LayerBase implements SidedEnvironment
|
||||
{
|
||||
@Nullable
|
||||
@Override
|
||||
public Node sidedNode(ForgeDirection side)
|
||||
{
|
||||
final IPart part = this.getPart( side );
|
||||
if ( part instanceof SidedEnvironment )
|
||||
{
|
||||
return ( (SidedEnvironment) part ).sidedNode( side );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection side)
|
||||
{
|
||||
final IPart part = this.getPart( side );
|
||||
if ( part instanceof SidedEnvironment )
|
||||
{
|
||||
return ( (SidedEnvironment) part ).canConnect( side );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//import javax.annotation.Nullable;
|
||||
//
|
||||
//import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
//import li.cil.oc.api.network.Node;
|
||||
//import li.cil.oc.api.network.SidedEnvironment;
|
||||
//import appeng.api.parts.IPart;
|
||||
//import appeng.api.parts.LayerBase;
|
||||
//import appeng.api.util.ForgeDirection;
|
||||
//import appeng.core.Registration;
|
||||
//import appeng.helpers.Reflected;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * Reflected in {@link Registration#initialize(FMLInitializationEvent)}
|
||||
// */
|
||||
//@Reflected
|
||||
//public class LayerSidedEnvironment extends LayerBase implements SidedEnvironment
|
||||
//{
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public Node sidedNode( ForgeDirection side )
|
||||
// {
|
||||
// final IPart part = this.getPart( side );
|
||||
// if( part instanceof SidedEnvironment )
|
||||
// {
|
||||
// return ( (SidedEnvironment) part ).sidedNode( side );
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canConnect( ForgeDirection side )
|
||||
// {
|
||||
// final IPart part = this.getPart( side );
|
||||
// if( part instanceof SidedEnvironment )
|
||||
// {
|
||||
// return ( (SidedEnvironment) part ).canConnect( side );
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -52,9 +52,9 @@ import appeng.client.texture.IAESprite;
|
||||
public class PartCableAnchor implements IPart
|
||||
{
|
||||
|
||||
ItemStack is = null;
|
||||
IPartHost host = null;
|
||||
AEPartLocation mySide = AEPartLocation.UP;
|
||||
private ItemStack is = null;
|
||||
private IPartHost host = null;
|
||||
private AEPartLocation mySide = AEPartLocation.UP;
|
||||
|
||||
public PartCableAnchor( final ItemStack is )
|
||||
{
|
||||
@@ -94,7 +94,7 @@ public class PartCableAnchor implements IPart
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
final IAESprite myIcon = renderer.getIcon( this.is );
|
||||
final IAESprite myIcon = renderer.getIcon( this.is );
|
||||
rh.setTexture( myIcon );
|
||||
if( this.host != null && this.host.getFacadeContainer().getFacade( this.mySide ) != null )
|
||||
{
|
||||
@@ -116,7 +116,7 @@ public class PartCableAnchor implements IPart
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer)
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ import appeng.util.inv.IInventoryDestination;
|
||||
public class PartInterface extends PartBasicState implements IGridTickable, IStorageMonitorable, IInventoryDestination, IInterfaceHost, ISidedInventory, IAEAppEngInventory, ITileStorageMonitorable, IPriorityHost
|
||||
{
|
||||
|
||||
final DualityInterface duality = new DualityInterface( this.proxy, this );
|
||||
private final DualityInterface duality = new DualityInterface( this.getProxy(), this );
|
||||
|
||||
@Reflected
|
||||
public PartInterface( final ItemStack is )
|
||||
@@ -114,7 +114,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -136,17 +136,17 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartMonitorSides.getIcon(), CableBusTextures.PartMonitorSides.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 12, 11, 11, 13 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 13, 11, 11, 14 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -209,16 +209,16 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
Platform.openGUI( p, this.getTileEntity(), this.side, GuiBridge.GUI_INTERFACE );
|
||||
Platform.openGUI( p, this.getTileEntity(), this.getSide(), GuiBridge.GUI_INTERFACE );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer)
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return renderer.getIcon( this.is ).getAtlas();
|
||||
return renderer.getIcon( this.getItemStack() ).getAtlas();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -314,13 +314,13 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
@Override
|
||||
public void openInventory( final EntityPlayer player )
|
||||
{
|
||||
this.duality.getStorage().openInventory(player);
|
||||
this.duality.getStorage().openInventory( player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory( final EntityPlayer player )
|
||||
{
|
||||
this.duality.getStorage().closeInventory(player);
|
||||
this.duality.getStorage().closeInventory( player );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -362,7 +362,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getTargets()
|
||||
{
|
||||
return EnumSet.of( this.side.getFacing() );
|
||||
return EnumSet.of( this.getSide().getFacing() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -437,7 +437,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
final int id,
|
||||
final int value )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -449,7 +449,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
||||
@Override
|
||||
public void clear()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,10 +29,10 @@ public class PartInvertedToggleBus extends PartToggleBus
|
||||
public PartInvertedToggleBus( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setIdlePowerUsage( 0.0 );
|
||||
this.outerProxy.setIdlePowerUsage( 0.0 );
|
||||
this.proxy.setFlags();
|
||||
this.outerProxy.setFlags();
|
||||
this.getProxy().setIdlePowerUsage( 0.0 );
|
||||
this.getOuterProxy().setIdlePowerUsage( 0.0 );
|
||||
this.getProxy().setFlags();
|
||||
this.getOuterProxy().setFlags();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -87,16 +87,19 @@ import appeng.util.prioitylist.PrecisePriorityList;
|
||||
|
||||
// TODO: BC Integration
|
||||
//@Interface( iname = IntegrationType.BuildCraftTransport, iface = "buildcraft.api.transport.IPipeConnection" )
|
||||
public class PartStorageBus extends PartUpgradeable implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEItemStack> /*, IPipeConnection*/, IPriorityHost
|
||||
public class PartStorageBus extends PartUpgradeable implements IGridTickable, ICellContainer, IMEMonitorHandlerReceiver<IAEItemStack> /*
|
||||
* ,
|
||||
* IPipeConnection
|
||||
*/, IPriorityHost
|
||||
{
|
||||
final BaseActionSource mySrc;
|
||||
final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 );
|
||||
int priority = 0;
|
||||
boolean cached = false;
|
||||
MEMonitorIInventory monitor = null;
|
||||
MEInventoryHandler handler = null;
|
||||
int handlerHash = 0;
|
||||
boolean wasActive = false;
|
||||
private final BaseActionSource mySrc;
|
||||
private final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 );
|
||||
private int priority = 0;
|
||||
private boolean cached = false;
|
||||
private MEMonitorIInventory monitor = null;
|
||||
private MEInventoryHandler handler = null;
|
||||
private int handlerHash = 0;
|
||||
private boolean wasActive = false;
|
||||
private byte resetCacheLogic = 0;
|
||||
|
||||
@Reflected
|
||||
@@ -118,14 +121,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
private void updateStatus()
|
||||
{
|
||||
final boolean currentActive = this.proxy.isActive();
|
||||
final boolean currentActive = this.getProxy().isActive();
|
||||
if( this.wasActive != currentActive )
|
||||
{
|
||||
this.wasActive = currentActive;
|
||||
try
|
||||
{
|
||||
this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
this.host.markForUpdate();
|
||||
this.getProxy().getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -150,7 +153,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
public void updateSetting( final IConfigManager manager, final Enum settingName, final Enum newValue )
|
||||
{
|
||||
this.resetCache( true );
|
||||
this.host.markForSave();
|
||||
this.getHost().markForSave();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -200,7 +203,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
private void resetCache( final boolean fullReset )
|
||||
{
|
||||
if( this.host == null || this.host.getTile() == null || this.host.getTile().getWorld() == null || this.host.getTile().getWorld().isRemote )
|
||||
if( this.getHost() == null || this.getHost().getTile() == null || this.getHost().getTile().getWorld() == null || this.getHost().getTile().getWorld().isRemote )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -216,7 +219,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
try
|
||||
{
|
||||
this.proxy.getTick().alertDevice( this.proxy.getNode() );
|
||||
this.getProxy().getTick().alertDevice( this.getProxy().getNode() );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -235,9 +238,9 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
{
|
||||
try
|
||||
{
|
||||
if( this.proxy.isActive() )
|
||||
if( this.getProxy().isActive() )
|
||||
{
|
||||
this.proxy.getStorage().postAlterationOfStoredItems( StorageChannel.ITEMS, change, this.mySrc );
|
||||
this.getProxy().getStorage().postAlterationOfStoredItems( StorageChannel.ITEMS, change, this.mySrc );
|
||||
}
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
@@ -264,7 +267,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
rh.setBounds( 3, 3, 15, 13, 13, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
@@ -280,7 +283,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
rh.setBounds( 3, 3, 15, 13, 13, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -288,12 +291,12 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 15 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartStorageSides.getIcon(), CableBusTextures.PartStorageSides.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 12, 11, 11, 13 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
|
||||
rh.setBounds( 5, 5, 13, 11, 11, 14 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -323,7 +326,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
return true;
|
||||
}
|
||||
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_STORAGEBUS );
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_STORAGEBUS );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -333,7 +336,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.StorageBus.min, TickRates.StorageBus.max, this.monitor == null, true );
|
||||
return new TickingRequest( TickRates.StorageBus.getMin(), TickRates.StorageBus.getMax(), this.monitor == null, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -397,8 +400,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
this.cached = true;
|
||||
final TileEntity self = this.getHost().getTile();
|
||||
final TileEntity target = self.getWorld().getTileEntity( self.getPos().offset( this.side.getFacing() ) );
|
||||
|
||||
final TileEntity target = self.getWorld().getTileEntity( self.getPos().offset( this.getSide().getFacing() ) );
|
||||
final int newHandlerHash = Platform.generateTileHash( target );
|
||||
|
||||
if( this.handlerHash == newHandlerHash && this.handlerHash != 0 )
|
||||
@@ -409,7 +411,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
try
|
||||
{
|
||||
// force grid to update handlers...
|
||||
this.proxy.getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
this.getProxy().getGrid().postEvent( new MENetworkCellArrayUpdate() );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -421,16 +423,16 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
this.monitor = null;
|
||||
if( target != null )
|
||||
{
|
||||
final IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
final IExternalStorageHandler esh = AEApi.instance().registries().externalStorage().getHandler( target, this.getSide().getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
if( esh != null )
|
||||
{
|
||||
final IMEInventory inv = esh.getInventory( target, this.side.getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
final IMEInventory inv = esh.getInventory( target, this.getSide().getFacing().getOpposite(), StorageChannel.ITEMS, this.mySrc );
|
||||
|
||||
if( inv instanceof MEMonitorIInventory )
|
||||
{
|
||||
final MEMonitorIInventory h = (MEMonitorIInventory) inv;
|
||||
h.mode = (StorageFilter) this.getConfigManager().getSetting( Settings.STORAGE_FILTER );
|
||||
h.mySource = new MachineSource( this );
|
||||
h.setMode( (StorageFilter) this.getConfigManager().getSetting( Settings.STORAGE_FILTER ) );
|
||||
h.setActionSource( new MachineSource( this ) );
|
||||
}
|
||||
|
||||
if( inv instanceof MEMonitorIInventory )
|
||||
@@ -440,7 +442,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
if( inv != null )
|
||||
{
|
||||
this.checkInterfaceVsStorageBus( target, this.side.getOpposite() );
|
||||
this.checkInterfaceVsStorageBus( target, this.getSide().getOpposite() );
|
||||
|
||||
this.handler = new MEInventoryHandler( inv, StorageChannel.ITEMS );
|
||||
|
||||
@@ -482,14 +484,14 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
{
|
||||
try
|
||||
{
|
||||
final ITickManager tm = this.proxy.getTick();
|
||||
final ITickManager tm = this.getProxy().getTick();
|
||||
if( this.monitor == null )
|
||||
{
|
||||
tm.sleepDevice( this.proxy.getNode() );
|
||||
tm.sleepDevice( this.getProxy().getNode() );
|
||||
}
|
||||
else
|
||||
{
|
||||
tm.wakeDevice( this.proxy.getNode() );
|
||||
tm.wakeDevice( this.getProxy().getNode() );
|
||||
}
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
@@ -531,7 +533,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
{
|
||||
if( channel == StorageChannel.ITEMS )
|
||||
{
|
||||
final IMEInventoryHandler out = this.proxy.isActive() ? this.getInternalHandler() : null;
|
||||
final IMEInventoryHandler out = this.getProxy().isActive() ? this.getInternalHandler() : null;
|
||||
if( out != null )
|
||||
{
|
||||
return Collections.singletonList( out );
|
||||
@@ -550,7 +552,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
public void setPriority( final int newValue )
|
||||
{
|
||||
this.priority = newValue;
|
||||
this.host.markForSave();
|
||||
this.getHost().markForSave();
|
||||
this.resetCache( true );
|
||||
}
|
||||
|
||||
@@ -561,13 +563,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||
|
||||
// TODO: BC PIPE INTEGRATION
|
||||
/*
|
||||
@Override
|
||||
@Method( iname = IntegrationType.BuildCraftTransport )
|
||||
public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
{
|
||||
return type == PipeType.ITEM && with == this.side ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT;
|
||||
}
|
||||
*/
|
||||
* @Override
|
||||
* @Method( iname = IntegrationType.BuildCraftTransport )
|
||||
* public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
* {
|
||||
* return type == PipeType.ITEM && with == this.getSide() ? ConnectOverride.CONNECT : ConnectOverride.DISCONNECT;
|
||||
* }
|
||||
*/
|
||||
@Override
|
||||
public void saveChanges( final IMEInventory cellInventory )
|
||||
{
|
||||
|
||||
@@ -54,25 +54,25 @@ import appeng.util.Platform;
|
||||
public class PartToggleBus extends PartBasicState
|
||||
{
|
||||
private static final int REDSTONE_FLAG = 4;
|
||||
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", null, true );
|
||||
IGridConnection connection;
|
||||
boolean hasRedstone = false;
|
||||
private final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", null, true );
|
||||
private IGridConnection connection;
|
||||
private boolean hasRedstone = false;
|
||||
|
||||
@Reflected
|
||||
public PartToggleBus( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
|
||||
this.proxy.setIdlePowerUsage( 0.0 );
|
||||
this.outerProxy.setIdlePowerUsage( 0.0 );
|
||||
this.proxy.setFlags();
|
||||
this.outerProxy.setFlags();
|
||||
this.getProxy().setIdlePowerUsage( 0.0 );
|
||||
this.getOuterProxy().setIdlePowerUsage( 0.0 );
|
||||
this.getProxy().setFlags();
|
||||
this.getOuterProxy().setFlags();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setColors( final ModelGenerator renderer, final boolean hasChan, final boolean hasPower )
|
||||
{
|
||||
this.hasRedstone = ( this.clientFlags & REDSTONE_FLAG ) == REDSTONE_FLAG;
|
||||
this.hasRedstone = ( this.getClientFlags() & REDSTONE_FLAG ) == REDSTONE_FLAG;
|
||||
super.setColors( renderer, hasChan && this.hasRedstone, hasPower && this.hasRedstone );
|
||||
}
|
||||
|
||||
@@ -84,13 +84,13 @@ public class PartToggleBus extends PartBasicState
|
||||
|
||||
protected boolean getIntention()
|
||||
{
|
||||
return this.getHost().hasRedstone( this.side );
|
||||
return this.getHost().hasRedstone( this.getSide() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getBreakingTexture( final ModelGenerator renderer )
|
||||
{
|
||||
return renderer.getIcon( this.is ).getAtlas();
|
||||
return renderer.getIcon( this.getItemStack() ).getAtlas();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,13 +102,13 @@ public class PartToggleBus extends PartBasicState
|
||||
@Override
|
||||
public void securityBreak()
|
||||
{
|
||||
if( this.is.stackSize > 0 )
|
||||
if( this.getItemStack().stackSize > 0 )
|
||||
{
|
||||
final List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
items.add( this.is.copy() );
|
||||
this.host.removePart( this.side, false );
|
||||
Platform.spawnDrops( this.tile.getWorld(), this.tile.getPos(), items );
|
||||
this.is.stackSize = 0;
|
||||
items.add( this.getItemStack().copy() );
|
||||
this.getHost().removePart( this.getSide(), false );
|
||||
Platform.spawnDrops( this.getTile().getWorld(), this.getTile().getPos(), items );
|
||||
this.getItemStack().stackSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class PartToggleBus extends PartBasicState
|
||||
{
|
||||
GL11.glTranslated( -0.2, -0.3, 0.0 );
|
||||
|
||||
rh.setTexture( renderer.getIcon( this.is ) );
|
||||
rh.setTexture( renderer.getIcon( this.getItemStack() ) );
|
||||
rh.setBounds( 6, 6, 14 - 4, 10, 10, 16 - 4 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
|
||||
@@ -147,7 +147,7 @@ public class PartToggleBus extends PartBasicState
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( renderer.getIcon( this.is ) );
|
||||
rh.setTexture( renderer.getIcon( this.getItemStack() ) );
|
||||
|
||||
rh.setBounds( 6, 6, 14, 10, 10, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -155,7 +155,7 @@ public class PartToggleBus extends PartBasicState
|
||||
rh.setBounds( 6, 6, 11, 10, 10, 13 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorBack.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartMonitorSidesStatus.getIcon(), CableBusTextures.PartMonitorSidesStatus.getIcon() );
|
||||
|
||||
rh.setBounds( 6, 6, 13, 10, 10, 14 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -167,7 +167,7 @@ public class PartToggleBus extends PartBasicState
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
final boolean oldHasRedstone = this.hasRedstone;
|
||||
this.hasRedstone = this.getHost().hasRedstone( this.side );
|
||||
this.hasRedstone = this.getHost().hasRedstone( this.getSide() );
|
||||
|
||||
if( this.hasRedstone != oldHasRedstone )
|
||||
{
|
||||
@@ -180,29 +180,29 @@ public class PartToggleBus extends PartBasicState
|
||||
public void readFromNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.readFromNBT( extra );
|
||||
this.outerProxy.readFromNBT( extra );
|
||||
this.getOuterProxy().readFromNBT( extra );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( final NBTTagCompound extra )
|
||||
{
|
||||
super.writeToNBT( extra );
|
||||
this.outerProxy.writeToNBT( extra );
|
||||
this.getOuterProxy().writeToNBT( extra );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromWorld()
|
||||
{
|
||||
super.removeFromWorld();
|
||||
this.outerProxy.invalidate();
|
||||
this.getOuterProxy().invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addToWorld()
|
||||
{
|
||||
super.addToWorld();
|
||||
this.outerProxy.onReady();
|
||||
this.hasRedstone = this.getHost().hasRedstone( this.side );
|
||||
this.getOuterProxy().onReady();
|
||||
this.hasRedstone = this.getHost().hasRedstone( this.getSide() );
|
||||
this.updateInternalState();
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ public class PartToggleBus extends PartBasicState
|
||||
@Override
|
||||
public IGridNode getExternalFacingNode()
|
||||
{
|
||||
return this.outerProxy.getNode();
|
||||
return this.getOuterProxy().getNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,7 +229,7 @@ public class PartToggleBus extends PartBasicState
|
||||
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
|
||||
{
|
||||
super.onPlacement( player, held, side );
|
||||
this.outerProxy.setOwner( player );
|
||||
this.getOuterProxy().setOwner( player );
|
||||
}
|
||||
|
||||
private void updateInternalState()
|
||||
@@ -237,13 +237,13 @@ public class PartToggleBus extends PartBasicState
|
||||
final boolean intention = this.getIntention();
|
||||
if( intention == ( this.connection == null ) )
|
||||
{
|
||||
if( this.proxy.getNode() != null && this.outerProxy.getNode() != null )
|
||||
if( this.getProxy().getNode() != null && this.getOuterProxy().getNode() != null )
|
||||
{
|
||||
if( intention )
|
||||
{
|
||||
try
|
||||
{
|
||||
this.connection = AEApi.instance().createGridConnection( this.proxy.getNode(), this.outerProxy.getNode() );
|
||||
this.connection = AEApi.instance().createGridConnection( this.getProxy().getNode(), this.getOuterProxy().getNode() );
|
||||
}
|
||||
catch( final FailedConnection e )
|
||||
{
|
||||
@@ -258,4 +258,9 @@ public class PartToggleBus extends PartBasicState
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AENetworkProxy getOuterProxy()
|
||||
{
|
||||
return this.outerProxy;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ import appeng.client.texture.IAESprite;
|
||||
import appeng.client.texture.TaughtIcon;
|
||||
import appeng.items.parts.ItemMultiPart;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.helpers.AENetworkProxy;
|
||||
import appeng.parts.AEBasePart;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -70,17 +69,17 @@ import appeng.util.Platform;
|
||||
public class PartCable extends AEBasePart implements IPartCable
|
||||
{
|
||||
|
||||
final int[] channelsOnSide = { 0, 0, 0, 0, 0, 0 };
|
||||
private final int[] channelsOnSide = { 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
EnumSet<AEPartLocation> connections = EnumSet.noneOf( AEPartLocation.class );
|
||||
boolean powered = false;
|
||||
private EnumSet<AEPartLocation> connections = EnumSet.noneOf( AEPartLocation.class );
|
||||
private boolean powered = false;
|
||||
|
||||
public PartCable( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setFlags( GridFlags.PREFERRED );
|
||||
this.proxy.setIdlePowerUsage( 0.0 );
|
||||
this.proxy.myColor = AEColor.values()[( (ItemMultiPart) is.getItem() ).variantOf( is.getItemDamage() )];
|
||||
this.getProxy().setFlags( GridFlags.PREFERRED );
|
||||
this.getProxy().setIdlePowerUsage( 0.0 );
|
||||
this.getProxy().setColor( AEColor.values()[( (ItemMultiPart) is.getItem() ).variantOf( is.getItemDamage() )] );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,7 +91,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
@Override
|
||||
public AEColor getCableColor()
|
||||
{
|
||||
return this.proxy.myColor;
|
||||
return this.getProxy().getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,7 +130,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
try
|
||||
{
|
||||
hasPermission = this.proxy.getSecurity().hasPermission( who, SecurityPermissions.BUILD );
|
||||
hasPermission = this.getProxy().getSecurity().hasPermission( who, SecurityPermissions.BUILD );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -157,13 +156,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
public void setValidSides(
|
||||
final EnumSet<EnumFacing> sides )
|
||||
{
|
||||
this.proxy.setValidSides( sides );
|
||||
this.getProxy().setValidSides( sides );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected( final EnumFacing side )
|
||||
{
|
||||
return this.connections.contains( AEPartLocation.fromFacing( side ) );
|
||||
return this.getConnections().contains( AEPartLocation.fromFacing( side ) );
|
||||
}
|
||||
|
||||
public void markForUpdate()
|
||||
@@ -181,11 +180,11 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
this.setConnections( n.getConnectedSides() );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.connections.clear();
|
||||
this.getConnections().clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +229,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -263,7 +262,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
{
|
||||
GL11.glTranslated( -0.0, -0.0, 0.3 );
|
||||
|
||||
rh.setTexture( this.getTexture( this.getCableColor(),renderer ) );
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
rh.setBounds( 6.0f, 6.0f, 2.0f, 10.0f, 10.0f, 14.0f );
|
||||
rh.renderInventoryBox( renderer );
|
||||
rh.setTexture( null );
|
||||
@@ -271,7 +270,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
public IAESprite getTexture( final AEColor c, final ModelGenerator renderer )
|
||||
{
|
||||
return this.getGlassTexture( c,renderer );
|
||||
return this.getGlassTexture( c, renderer );
|
||||
}
|
||||
|
||||
public IAESprite getGlassTexture( final AEColor c, final ModelGenerator renderer )
|
||||
@@ -319,12 +318,6 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
return renderer.getIcon( glassCableStack );
|
||||
}
|
||||
|
||||
@Override
|
||||
public AENetworkProxy getProxy()
|
||||
{
|
||||
return this.proxy;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
@@ -345,9 +338,9 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if( this.connections.contains( dir ) )
|
||||
else if( this.getConnections().contains( dir ) )
|
||||
{
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( dir.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( pos.offset( dir.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
if( partHost == null && gh != null && gh.getCableConnectionType( dir ) != AECableType.GLASS )
|
||||
@@ -363,11 +356,11 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
else
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(),renderer ) );
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
}
|
||||
|
||||
final IPartHost ph = this.getHost();
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.getConnections() ) )
|
||||
{
|
||||
final IPart bp = ph.getPart( of );
|
||||
if( bp instanceof IGridHost )
|
||||
@@ -403,7 +396,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
}
|
||||
|
||||
if( this.connections.size() != 2 || !this.nonLinear( this.connections ) || useCovered || requireDetailed )
|
||||
if( this.getConnections().size() != 2 || !this.nonLinear( this.getConnections() ) || useCovered || requireDetailed )
|
||||
{
|
||||
if( useCovered )
|
||||
{
|
||||
@@ -416,7 +409,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
}
|
||||
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
this.renderGlassConnection( pos, rh, renderer, of );
|
||||
}
|
||||
@@ -426,7 +419,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
rh.setTexture( def );
|
||||
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
rh.setFacesToRender( EnumSet.complementOf( EnumSet.of( of.getFacing(), of.getFacing().getOpposite() ) ) );
|
||||
switch( of )
|
||||
@@ -437,13 +430,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
renderer.uvRotateEast = renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = renderer.uvRotateTop = 1;
|
||||
renderer.setUvRotateEast( renderer.setUvRotateWest( 1 ) );
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateTop( 1 ) );
|
||||
renderer.setRenderBounds( 0, 6 / 16.0, 6 / 16.0, 16 / 16.0, 10 / 16.0, 10 / 16.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
renderer.uvRotateNorth = renderer.uvRotateSouth = 1;
|
||||
renderer.setUvRotateNorth( renderer.setUvRotateSouth( 1 ) );
|
||||
renderer.setRenderBounds( 6 / 16.0, 6 / 16.0, 0, 10 / 16.0, 10 / 16.0, 16 / 16.0 );
|
||||
break;
|
||||
default:
|
||||
@@ -498,7 +491,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
final IReadOnlyCollection<IGridConnection> set = part.getGridNode().getConnections();
|
||||
for( final IGridConnection gc : set )
|
||||
{
|
||||
if( this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) )
|
||||
if( this.getProxy().getNode().hasFlag( GridFlags.DENSE_CAPACITY ) && gc.getOtherSide( this.getProxy().getNode() ).hasFlag( GridFlags.DENSE_CAPACITY ) )
|
||||
{
|
||||
sideOut |= ( gc.getUsedChannels() / 4 ) << ( 4 * thisSide.ordinal() );
|
||||
}
|
||||
@@ -516,8 +509,8 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
final AEPartLocation side = gc.getDirection( n );
|
||||
if( side != AEPartLocation.INTERNAL )
|
||||
{
|
||||
final boolean isTier2a = this.proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
final boolean isTier2b = gc.getOtherSide( this.proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
final boolean isTier2a = this.getProxy().getNode().hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
final boolean isTier2b = gc.getOtherSide( this.getProxy().getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );
|
||||
|
||||
if( isTier2a && isTier2b )
|
||||
{
|
||||
@@ -534,7 +527,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
|
||||
try
|
||||
{
|
||||
if( this.proxy.getEnergy().isNetworkPowered() )
|
||||
if( this.getProxy().getEnergy().isNetworkPowered() )
|
||||
{
|
||||
cs |= ( 1 << AEPartLocation.INTERNAL.ordinal() );
|
||||
}
|
||||
@@ -554,7 +547,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
final int cs = data.readByte();
|
||||
final int sideOut = data.readInt();
|
||||
|
||||
final EnumSet<AEPartLocation> myC = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> myC = this.getConnections().clone();
|
||||
final boolean wasPowered = this.powered;
|
||||
this.powered = false;
|
||||
boolean channelsChanged = false;
|
||||
@@ -564,10 +557,10 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
if( d != AEPartLocation.INTERNAL )
|
||||
{
|
||||
final int ch = ( sideOut >> ( d.ordinal() * 4 ) ) & 0xF;
|
||||
if( ch != this.channelsOnSide[d.ordinal()] )
|
||||
if( ch != this.getChannelsOnSide( d.ordinal() ) )
|
||||
{
|
||||
channelsChanged = true;
|
||||
this.channelsOnSide[d.ordinal()] = ch;
|
||||
this.setChannelsOnSide( d.ordinal(), ch );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -584,16 +577,16 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
final int id = 1 << d.ordinal();
|
||||
if( id == ( cs & id ) )
|
||||
{
|
||||
this.connections.add( d );
|
||||
this.getConnections().add( d );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.connections.remove( d );
|
||||
this.getConnections().remove( d );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return !myC.equals( this.connections ) || wasPowered != this.powered || channelsChanged;
|
||||
return !myC.equals( this.getConnections() ) || wasPowered != this.powered || channelsChanged;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -645,7 +638,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
final AEColoredItemDefinition coveredCable = AEApi.instance().definitions().parts().cableCovered();
|
||||
final ItemStack coveredCableStack = coveredCable.stack( AEColor.Transparent, 1 );
|
||||
|
||||
return renderer.getIcon( coveredCableStack );
|
||||
return renderer.getIcon( coveredCableStack );
|
||||
}
|
||||
|
||||
protected boolean nonLinear( final EnumSet<AEPartLocation> sides )
|
||||
@@ -654,9 +647,9 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderGlassConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final AEPartLocation of )
|
||||
private void renderGlassConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final AEPartLocation of )
|
||||
{
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost gh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
|
||||
@@ -730,9 +723,9 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderCoveredConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
protected void renderCoveredConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
{
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
|
||||
@@ -811,9 +804,9 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderSmartConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
protected void renderSmartConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
{
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
AEColor myColor = this.getCableColor();
|
||||
@@ -874,7 +867,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), pos, rh, renderer );
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateEast( renderer.setUvRotateNorth( renderer.setUvRotateSouth( renderer.setUvRotateTop( renderer.setUvRotateWest( 0 ) ) ) ) ) );
|
||||
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
}
|
||||
@@ -931,7 +924,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), pos, rh, renderer );
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateEast( renderer.setUvRotateNorth( renderer.setUvRotateSouth( renderer.setUvRotateTop( renderer.setUvRotateWest( 0 ) ) ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -977,7 +970,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
final IParts parts = AEApi.instance().definitions().parts();
|
||||
final ItemStack smartCableStack = parts.cableSmart().stack( AEColor.Transparent, 1 );
|
||||
|
||||
return renderer.getIcon(smartCableStack );
|
||||
return renderer.getIcon( smartCableStack );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@@ -987,27 +980,27 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
{
|
||||
case UP:
|
||||
case DOWN:
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
renderer.setUvRotateTop( 0 );
|
||||
renderer.setUvRotateBottom( 0 );
|
||||
renderer.setUvRotateSouth( 3 );
|
||||
renderer.setUvRotateEast( 3 );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.setUvRotateTop( 3 );
|
||||
renderer.setUvRotateBottom( 3 );
|
||||
renderer.setUvRotateNorth( 1 );
|
||||
renderer.setUvRotateSouth( 2 );
|
||||
renderer.setUvRotateWest( 1 );
|
||||
break;
|
||||
case EAST:
|
||||
case WEST:
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateNorth = 0;
|
||||
renderer.setUvRotateEast( 2 );
|
||||
renderer.setUvRotateWest( 1 );
|
||||
renderer.setUvRotateBottom( 2 );
|
||||
renderer.setUvRotateTop( 1 );
|
||||
renderer.setUvRotateSouth( 3 );
|
||||
renderer.setUvRotateNorth( 0 );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1058,7 +1051,7 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
@SideOnly( Side.CLIENT )
|
||||
protected void renderAllFaces( final AEBaseBlock blk, final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setBounds( (float) renderer.renderMinX * 16.0f, (float) renderer.renderMinY * 16.0f, (float) renderer.renderMinZ * 16.0f, (float) renderer.renderMaxX * 16.0f, (float) renderer.renderMaxY * 16.0f, (float) renderer.renderMaxZ * 16.0f );
|
||||
rh.setBounds( (float) renderer.getRenderMinX() * 16.0f, (float) renderer.getRenderMinY() * 16.0f, (float) renderer.getRenderMinZ() * 16.0f, (float) renderer.getRenderMaxX() * 16.0f, (float) renderer.getRenderMaxY() * 16.0f, (float) renderer.getRenderMaxZ() * 16.0f );
|
||||
rh.renderFace( pos, blk.getRendererInstance().getTexture( AEPartLocation.WEST ), EnumFacing.WEST, renderer );
|
||||
rh.renderFace( pos, blk.getRendererInstance().getTexture( AEPartLocation.EAST ), EnumFacing.EAST, renderer );
|
||||
rh.renderFace( pos, blk.getRendererInstance().getTexture( AEPartLocation.NORTH ), EnumFacing.NORTH, renderer );
|
||||
@@ -1066,4 +1059,24 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
rh.renderFace( pos, blk.getRendererInstance().getTexture( AEPartLocation.DOWN ), EnumFacing.DOWN, renderer );
|
||||
rh.renderFace( pos, blk.getRendererInstance().getTexture( AEPartLocation.UP ), EnumFacing.UP, renderer );
|
||||
}
|
||||
|
||||
int getChannelsOnSide( int i )
|
||||
{
|
||||
return this.channelsOnSide[i];
|
||||
}
|
||||
|
||||
void setChannelsOnSide( int i, int channels )
|
||||
{
|
||||
this.channelsOnSide[i] = channels;
|
||||
}
|
||||
|
||||
EnumSet<AEPartLocation> getConnections()
|
||||
{
|
||||
return this.connections;
|
||||
}
|
||||
|
||||
void setConnections( final EnumSet<AEPartLocation> connections )
|
||||
{
|
||||
this.connections = connections;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,15 +84,15 @@ public class PartCableCovered extends PartCable
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
this.setConnections( n.getConnectedSides() );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.connections.clear();
|
||||
this.getConnections().clear();
|
||||
}
|
||||
}
|
||||
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -167,11 +167,11 @@ public class PartCableCovered extends PartCable
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
|
||||
final EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> sides = this.getConnections().clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
final IPartHost ph = this.getHost();
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.getConnections() ) )
|
||||
{
|
||||
final IPart bp = ph.getPart( of );
|
||||
if( bp instanceof IGridHost )
|
||||
@@ -215,9 +215,9 @@ public class PartCableCovered extends PartCable
|
||||
|
||||
if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
this.renderCoveredConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
this.renderCoveredConnection( pos, rh, renderer, this.getChannelsOnSide( of.ordinal() ), of );
|
||||
}
|
||||
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
@@ -228,7 +228,7 @@ public class PartCableCovered extends PartCable
|
||||
{
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -240,14 +240,14 @@ public class PartCableCovered extends PartCable
|
||||
case EAST:
|
||||
case WEST:
|
||||
rh.setTexture( off, off, off, off, def, def );
|
||||
renderer.uvRotateEast = renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = renderer.uvRotateTop = 1;
|
||||
renderer.setUvRotateEast( renderer.setUvRotateWest( 1 ) );
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateTop( 1 ) );
|
||||
renderer.setRenderBounds( 0, 5 / 16.0, 5 / 16.0, 16 / 16.0, 11 / 16.0, 11 / 16.0 );
|
||||
break;
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
rh.setTexture( off, off, def, def, off, off );
|
||||
renderer.uvRotateNorth = renderer.uvRotateSouth = 1;
|
||||
renderer.setUvRotateNorth( renderer.setUvRotateSouth( 1 ) );
|
||||
renderer.setRenderBounds( 5 / 16.0, 5 / 16.0, 0, 11 / 16.0, 11 / 16.0, 16 / 16.0 );
|
||||
break;
|
||||
default:
|
||||
@@ -257,7 +257,7 @@ public class PartCableCovered extends PartCable
|
||||
rh.renderBlockCurrentBounds( pos, renderer );
|
||||
}
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateEast( renderer.setUvRotateNorth( renderer.setUvRotateSouth( renderer.setUvRotateTop( renderer.setUvRotateWest( 0 ) ) ) ) ) );
|
||||
rh.setTexture( null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,15 +87,15 @@ public class PartCableSmart extends PartCable
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
this.setConnections( n.getConnectedSides() );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.connections.clear();
|
||||
this.getConnections().clear();
|
||||
}
|
||||
}
|
||||
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
switch( of )
|
||||
{
|
||||
@@ -184,11 +184,11 @@ public class PartCableSmart extends PartCable
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
|
||||
final EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> sides = this.getConnections().clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
final IPartHost ph = this.getHost();
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.connections ) )
|
||||
for( final AEPartLocation of : EnumSet.complementOf( this.getConnections() ) )
|
||||
{
|
||||
final IPart bp = ph.getPart( of );
|
||||
if( bp instanceof IGridHost )
|
||||
@@ -228,8 +228,8 @@ public class PartCableSmart extends PartCable
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
this.setSmartConnectionRotations( of, renderer );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( this.channelsOnSide[of.ordinal()], true ).getIcon(), -0.2f );
|
||||
final IAESprite firstIcon = new TaughtIcon( this.getChannelTex( this.getChannelsOnSide( of.ordinal() ), false ).getIcon(), -0.2f );
|
||||
final IAESprite secondIcon = new TaughtIcon( this.getChannelTex( this.getChannelsOnSide( of.ordinal() ), true ).getIcon(), -0.2f );
|
||||
|
||||
if( of == AEPartLocation.EAST || of == AEPartLocation.WEST )
|
||||
{
|
||||
@@ -247,7 +247,7 @@ public class PartCableSmart extends PartCable
|
||||
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), pos, rh, renderer );
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateEast( renderer.setUvRotateNorth( renderer.setUvRotateSouth( renderer.setUvRotateTop( renderer.setUvRotateWest( 0 ) ) ) ) ) );
|
||||
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
}
|
||||
@@ -256,9 +256,9 @@ public class PartCableSmart extends PartCable
|
||||
|
||||
if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
this.renderSmartConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
this.renderSmartConnection( pos, rh, renderer, this.getChannelsOnSide( of.ordinal() ), of );
|
||||
}
|
||||
|
||||
rh.setTexture( this.getCoveredTexture( this.getCableColor(), renderer ) );
|
||||
@@ -269,13 +269,13 @@ public class PartCableSmart extends PartCable
|
||||
{
|
||||
AEPartLocation selectedSide = AEPartLocation.INTERNAL;
|
||||
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
selectedSide = of;
|
||||
break;
|
||||
}
|
||||
|
||||
final int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
final int channels = this.getChannelsOnSide( selectedSide.ordinal() );
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
|
||||
@@ -293,10 +293,10 @@ public class PartCableSmart extends PartCable
|
||||
rh.setTexture( def, def, off, off, off, off );
|
||||
rh.renderBlockCurrentBounds( pos, renderer );
|
||||
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
renderer.setUvRotateTop( 0 );
|
||||
renderer.setUvRotateBottom( 0 );
|
||||
renderer.setUvRotateSouth( 3 );
|
||||
renderer.setUvRotateEast( 3 );
|
||||
|
||||
renderer.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
@@ -311,12 +311,12 @@ public class PartCableSmart extends PartCable
|
||||
case EAST:
|
||||
case WEST:
|
||||
rh.setTexture( off, off, off, off, def, def );
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
renderer.setUvRotateEast( 2 );
|
||||
renderer.setUvRotateWest( 1 );
|
||||
renderer.setUvRotateBottom( 2 );
|
||||
renderer.setUvRotateTop( 1 );
|
||||
renderer.setUvRotateSouth( 0 );
|
||||
renderer.setUvRotateNorth( 0 );
|
||||
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
@@ -347,11 +347,11 @@ public class PartCableSmart extends PartCable
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
rh.setTexture( off, off, def, def, off, off );
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.setUvRotateTop( 3 );
|
||||
renderer.setUvRotateBottom( 3 );
|
||||
renderer.setUvRotateNorth( 1 );
|
||||
renderer.setUvRotateSouth( 2 );
|
||||
renderer.setUvRotateWest( 1 );
|
||||
renderer.setRenderBounds( 5 / 16.0, 5 / 16.0, 0, 11 / 16.0, 11 / 16.0, 16 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( pos, renderer );
|
||||
|
||||
@@ -370,7 +370,7 @@ public class PartCableSmart extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateEast( renderer.setUvRotateNorth( renderer.setUvRotateSouth( renderer.setUvRotateTop( renderer.setUvRotateWest( 0 ) ) ) ) ) );
|
||||
rh.setTexture( null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class PartDenseCable extends PartCable
|
||||
{
|
||||
super( is );
|
||||
|
||||
this.proxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.PREFERRED );
|
||||
this.getProxy().setFlags( GridFlags.DENSE_CAPACITY, GridFlags.PREFERRED );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,15 +91,15 @@ public class PartDenseCable extends PartCable
|
||||
final IGridNode n = this.getGridNode();
|
||||
if( n != null )
|
||||
{
|
||||
this.connections = n.getConnectedSides();
|
||||
this.setConnections( n.getConnectedSides() );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.connections.clear();
|
||||
this.getConnections().clear();
|
||||
}
|
||||
}
|
||||
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
if( this.isDense( of ) )
|
||||
{
|
||||
@@ -219,10 +219,10 @@ public class PartDenseCable extends PartCable
|
||||
{
|
||||
rh.setTexture( this.getTexture( this.getCableColor(), renderer ) );
|
||||
|
||||
final EnumSet<AEPartLocation> sides = this.connections.clone();
|
||||
final EnumSet<AEPartLocation> sides = this.getConnections().clone();
|
||||
|
||||
boolean hasBuses = false;
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
if( !this.isDense( of ) )
|
||||
{
|
||||
@@ -232,19 +232,19 @@ public class PartDenseCable extends PartCable
|
||||
|
||||
if( sides.size() != 2 || !this.nonLinear( sides ) || hasBuses )
|
||||
{
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
if( this.isDense( of ) )
|
||||
{
|
||||
this.renderDenseConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
this.renderDenseConnection( pos, rh, renderer, this.getChannelsOnSide( of.ordinal() ), of );
|
||||
}
|
||||
else if( this.isSmart( of ) )
|
||||
{
|
||||
this.renderSmartConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
this.renderSmartConnection( pos, rh, renderer, this.getChannelsOnSide( of.ordinal() ), of );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.renderCoveredConnection( pos, rh, renderer, this.channelsOnSide[of.ordinal()], of );
|
||||
this.renderCoveredConnection( pos, rh, renderer, this.getChannelsOnSide( of.ordinal() ), of );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,13 +256,13 @@ public class PartDenseCable extends PartCable
|
||||
{
|
||||
AEPartLocation selectedSide = AEPartLocation.INTERNAL;
|
||||
|
||||
for( final AEPartLocation of : this.connections )
|
||||
for( final AEPartLocation of : this.getConnections() )
|
||||
{
|
||||
selectedSide = of;
|
||||
break;
|
||||
}
|
||||
|
||||
final int channels = this.channelsOnSide[selectedSide.ordinal()];
|
||||
final int channels = this.getChannelsOnSide( selectedSide.ordinal() );
|
||||
final IAESprite def = this.getTexture( this.getCableColor(), renderer );
|
||||
final IAESprite off = new OffsetIcon( def, 0, -12 );
|
||||
|
||||
@@ -280,10 +280,10 @@ public class PartDenseCable extends PartCable
|
||||
rh.setTexture( def, def, off, off, off, off );
|
||||
rh.renderBlockCurrentBounds( pos, renderer );
|
||||
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateSouth = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
renderer.setUvRotateTop( 0 );
|
||||
renderer.setUvRotateBottom( 0 );
|
||||
renderer.setUvRotateSouth( 3 );
|
||||
renderer.setUvRotateEast( 3 );
|
||||
|
||||
renderer.setBrightness( 15 << 20 | 15 << 4 );
|
||||
|
||||
@@ -298,12 +298,12 @@ public class PartDenseCable extends PartCable
|
||||
case EAST:
|
||||
case WEST:
|
||||
rh.setTexture( off, off, off, off, def, def );
|
||||
renderer.uvRotateEast = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
renderer.setUvRotateEast( 2 );
|
||||
renderer.setUvRotateWest( 1 );
|
||||
renderer.setUvRotateBottom( 2 );
|
||||
renderer.setUvRotateTop( 1 );
|
||||
renderer.setUvRotateSouth( 0 );
|
||||
renderer.setUvRotateNorth( 0 );
|
||||
|
||||
final AEBaseBlock blk = (AEBaseBlock) rh.getBlock();
|
||||
final FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST );
|
||||
@@ -331,11 +331,11 @@ public class PartDenseCable extends PartCable
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
rh.setTexture( off, off, def, def, off, off );
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateNorth = 1;
|
||||
renderer.uvRotateSouth = 2;
|
||||
renderer.uvRotateWest = 1;
|
||||
renderer.setUvRotateTop( 3 );
|
||||
renderer.setUvRotateBottom( 3 );
|
||||
renderer.setUvRotateNorth( 1 );
|
||||
renderer.setUvRotateSouth( 2 );
|
||||
renderer.setUvRotateWest( 1 );
|
||||
renderer.setRenderBounds( 3 / 16.0, 3 / 16.0, 0, 13 / 16.0, 13 / 16.0, 16 / 16.0 );
|
||||
rh.renderBlockCurrentBounds( pos, renderer );
|
||||
|
||||
@@ -354,45 +354,45 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateEast( renderer.setUvRotateNorth( renderer.setUvRotateSouth( renderer.setUvRotateTop( renderer.setUvRotateWest( 0 ) ) ) ) ) );
|
||||
rh.setTexture( null );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderDenseConnection( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer, final int channels, final AEPartLocation of )
|
||||
{
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( pos.offset( of.getFacing() ) );
|
||||
final IPartHost partHost = te instanceof IPartHost ? (IPartHost) te : null;
|
||||
final IGridHost ghh = te instanceof IGridHost ? (IGridHost) te : null;
|
||||
AEColor myColor = this.getCableColor();
|
||||
/*
|
||||
* ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS && partHost.getPart(
|
||||
* of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = partHost.getColor() ) );
|
||||
* ( ghh != null && partHost != null && ghh.getCableConnectionType( of ) == AECableType.GLASS &&
|
||||
* partHost.getPart(
|
||||
* of.getOpposite() ) == null ) { isGlass = true; rh.setTexture( getGlassTexture( myColor = partHost.getColor()
|
||||
* ) );
|
||||
* } else if ( partHost == null && ghh != null && ghh.getCableConnectionType( of ) != AECableType.GLASS ) {
|
||||
* rh.setTexture( getSmartTexture( myColor ) ); switch (of) { case DOWN: rh.setBounds( 3, 0, 3, 13, 4, 13 );
|
||||
* break; case EAST: rh.setBounds( 12, 3, 3, 16, 13, 13 ); break; case NORTH: rh.setBounds( 3, 3, 0, 13, 13, 4
|
||||
* ); break; case SOUTH: rh.setBounds( 3, 3, 12, 13, 13, 16 ); break; case UP: rh.setBounds( 3, 12, 3, 13, 16,
|
||||
* 13 ); break; case WEST: rh.setBounds( 0, 3, 3, 4, 13, 13 ); break; default: return; } rh.renderBlock( x, y,
|
||||
* z, renderer );
|
||||
*
|
||||
* if ( true ) { setSmartConnectionRotations( of, renderer ); TextureAtlasSprite firstIcon = new TaughtIcon( getChannelTex(
|
||||
* channels, false ).getIcon(), -0.2f ); TextureAtlasSprite secondIcon = new TaughtIcon( getChannelTex( channels, true ).getIcon(),
|
||||
* if ( true ) { setSmartConnectionRotations( of, renderer ); TextureAtlasSprite firstIcon = new TaughtIcon(
|
||||
* getChannelTex(
|
||||
* channels, false ).getIcon(), -0.2f ); TextureAtlasSprite secondIcon = new TaughtIcon( getChannelTex(
|
||||
* channels, true ).getIcon(),
|
||||
* -0.2f );
|
||||
*
|
||||
* if ( of == AEPartLocation.EAST || of == AEPartLocation.WEST ) { AEBaseBlock blk = (AEBaseBlock)
|
||||
* rh.getBlock(); FlippableIcon ico = blk.getRendererInstance().getTexture( AEPartLocation.EAST ); ico.setFlip(
|
||||
* false, true ); }
|
||||
*
|
||||
* Tessellator.INSTANCE.setBrightness( 15 << 20 | 15 << 5 ); Tessellator.INSTANCE.setColorOpaque_I(
|
||||
* myColor.mediumVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon ); renderAllFaces( (AEBaseBlock)
|
||||
* myColor.mediumVariant ); rh.setTexture( firstIcon, firstIcon, firstIcon, firstIcon, firstIcon, firstIcon );
|
||||
* renderAllFaces( (AEBaseBlock)
|
||||
* rh.getBlock(), x, y, z, renderer );
|
||||
*
|
||||
* Tessellator.INSTANCE.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon,
|
||||
* Tessellator.INSTANCE.setColorOpaque_I( myColor.whiteVariant ); rh.setTexture( secondIcon, secondIcon,
|
||||
* secondIcon, secondIcon, secondIcon,
|
||||
* secondIcon ); renderAllFaces( (AEBaseBlock) rh.getBlock(), x, y, z, renderer );
|
||||
*
|
||||
* renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth =
|
||||
* renderer.uvRotateTop = renderer.uvRotateWest = 0; }
|
||||
*
|
||||
* rh.setTexture( getTexture( getCableColor() ) ); }
|
||||
*/
|
||||
|
||||
@@ -450,13 +450,13 @@ public class PartDenseCable extends PartCable
|
||||
rh.setTexture( secondIcon, secondIcon, secondIcon, secondIcon, secondIcon, secondIcon );
|
||||
this.renderAllFaces( (AEBaseBlock) rh.getBlock(), pos, rh, renderer );
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateEast( renderer.setUvRotateNorth( renderer.setUvRotateSouth( renderer.setUvRotateTop( renderer.setUvRotateWest( 0 ) ) ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSmart( final AEPartLocation of )
|
||||
{
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( this.getTile().getPos().offset( of.getFacing() ) );
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
@@ -504,12 +504,12 @@ public class PartDenseCable extends PartCable
|
||||
default:
|
||||
}
|
||||
|
||||
return renderer.getIcon( this.is );
|
||||
return renderer.getIcon( this.getItemStack() );
|
||||
}
|
||||
|
||||
private boolean isDense( final AEPartLocation of )
|
||||
{
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( of.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( this.getTile().getPos().offset( of.getFacing() ) );
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
|
||||
@@ -52,13 +52,13 @@ import appeng.parts.AEBasePart;
|
||||
public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
{
|
||||
|
||||
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.proxy.getMachineRepresentation(), true );
|
||||
private final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", this.getProxy().getMachineRepresentation(), true );
|
||||
|
||||
public PartQuartzFiber( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setIdlePowerUsage( 0 );
|
||||
this.proxy.setFlags( GridFlags.CANNOT_CARRY );
|
||||
this.getProxy().setIdlePowerUsage( 0 );
|
||||
this.getProxy().setFlags( GridFlags.CANNOT_CARRY );
|
||||
this.outerProxy.setIdlePowerUsage( 0 );
|
||||
this.outerProxy.setFlags( GridFlags.CANNOT_CARRY );
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
{
|
||||
GL11.glTranslated( -0.2, -0.3, 0.0 );
|
||||
|
||||
rh.setTexture( renderer.getIcon( this.is ) );
|
||||
rh.setTexture( renderer.getIcon( this.getItemStack() ) );
|
||||
rh.setBounds( 6.0f, 6.0f, 5.0f, 10.0f, 10.0f, 11.0f );
|
||||
rh.renderInventoryBox( renderer );
|
||||
rh.setTexture( null );
|
||||
@@ -91,7 +91,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
final IAESprite myIcon = renderer.getIcon( this.is );
|
||||
final IAESprite myIcon = renderer.getIcon( this.getItemStack() );
|
||||
rh.setTexture( myIcon );
|
||||
rh.setBounds( 6, 6, 10, 10, 10, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -159,7 +159,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
|
||||
try
|
||||
{
|
||||
final IEnergyGrid eg = this.proxy.getEnergy();
|
||||
final IEnergyGrid eg = this.getProxy().getEnergy();
|
||||
acquiredPower += eg.extractAEPower( amt - acquiredPower, mode, seen );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
@@ -186,7 +186,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
|
||||
try
|
||||
{
|
||||
final IEnergyGrid eg = this.proxy.getEnergy();
|
||||
final IEnergyGrid eg = this.getProxy().getEnergy();
|
||||
if( !seen.contains( eg ) )
|
||||
{
|
||||
return eg.injectAEPower( amt, mode, seen );
|
||||
@@ -220,7 +220,7 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
|
||||
|
||||
try
|
||||
{
|
||||
final IEnergyGrid eg = this.proxy.getEnergy();
|
||||
final IEnergyGrid eg = this.getProxy().getEnergy();
|
||||
demand += eg.getEnergyDemand( amt - demand, seen );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
|
||||
@@ -262,4 +262,4 @@ package appeng.parts.p2p;
|
||||
// {
|
||||
// return ic2.api.energy.EnergyNet.instance.getTierFromPower( voltage );
|
||||
// }
|
||||
//}
|
||||
// }
|
||||
|
||||
@@ -54,13 +54,13 @@ import appeng.util.inv.WrapperMCISidedInventory;
|
||||
|
||||
// TODO: BC Integration
|
||||
//@Interface( iface = "buildcraft.api.transport.IPipeConnection", iname = IntegrationType.BuildCraftTransport )
|
||||
public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipeConnection,*/ ISidedInventory, IGridTickable
|
||||
public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /* IPipeConnection, */ISidedInventory, IGridTickable
|
||||
{
|
||||
|
||||
final LinkedList<IInventory> which = new LinkedList<IInventory>();
|
||||
int oldSize = 0;
|
||||
boolean requested;
|
||||
IInventory cachedInv;
|
||||
private final LinkedList<IInventory> which = new LinkedList<IInventory>();
|
||||
private int oldSize = 0;
|
||||
private boolean requested;
|
||||
private IInventory cachedInv;
|
||||
|
||||
public PartP2PItems( final ItemStack is )
|
||||
{
|
||||
@@ -72,13 +72,13 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
{
|
||||
this.cachedInv = null;
|
||||
final PartP2PItems input = this.getInput();
|
||||
if( input != null && this.output )
|
||||
if( input != null && this.isOutput() )
|
||||
{
|
||||
input.onTunnelNetworkChange();
|
||||
}
|
||||
}
|
||||
|
||||
IInventory getDestination()
|
||||
private IInventory getDestination()
|
||||
{
|
||||
this.requested = true;
|
||||
|
||||
@@ -118,13 +118,13 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
return this.cachedInv = new WrapperChainedInventory( outs );
|
||||
}
|
||||
|
||||
IInventory getOutputInv()
|
||||
private IInventory getOutputInv()
|
||||
{
|
||||
IInventory output = null;
|
||||
|
||||
if( this.proxy.isActive() )
|
||||
if( this.getProxy().isActive() )
|
||||
{
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( this.side.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( this.getTile().getPos().offset( this.getSide().getFacing() ) );
|
||||
|
||||
if( this.which.contains( this ) )
|
||||
{
|
||||
@@ -136,18 +136,18 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
if( IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.BuildCraftTransport ) )
|
||||
{
|
||||
final IBuildCraftTransport buildcraft = (IBuildCraftTransport) IntegrationRegistry.INSTANCE.getInstance( IntegrationType.BuildCraftTransport );
|
||||
if( buildcraft.isPipe( te, this.side.getOpposite().getFacing() ) )
|
||||
if( buildcraft.isPipe( te, this.getSide().getOpposite().getFacing() ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
output = new WrapperBCPipe( te, this.side.getFacing().getOpposite() );
|
||||
output = new WrapperBCPipe( te, this.getSide().getFacing().getOpposite() );
|
||||
}
|
||||
catch( final Throwable ignore )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* if ( AppEng.INSTANCE.isIntegrationEnabled( "TE" ) ) { ITE thermal = (ITE) AppEng.INSTANCE.getIntegration(
|
||||
* "TE" ); if ( thermal != null ) { if ( thermal.isPipe( te, side.getOpposite() ) ) { try { output = new
|
||||
@@ -162,7 +162,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
else if( te instanceof ISidedInventory )
|
||||
{
|
||||
output = new WrapperMCISidedInventory( (ISidedInventory) te, this.side.getFacing().getOpposite() );
|
||||
output = new WrapperMCISidedInventory( (ISidedInventory) te, this.getSide().getFacing().getOpposite() );
|
||||
}
|
||||
else if( te instanceof IInventory )
|
||||
{
|
||||
@@ -179,7 +179,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.ItemTunnel.min, TickRates.ItemTunnel.max, false, false );
|
||||
return new TickingRequest( TickRates.ItemTunnel.getMin(), TickRates.ItemTunnel.getMax(), false, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -199,7 +199,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateA( final MENetworkBootingStatusChange bs )
|
||||
{
|
||||
if( !this.output )
|
||||
if( !this.isOutput() )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
final int olderSize = this.oldSize;
|
||||
@@ -214,7 +214,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateB( final MENetworkChannelsChanged bs )
|
||||
{
|
||||
if( !this.output )
|
||||
if( !this.isOutput() )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
final int olderSize = this.oldSize;
|
||||
@@ -229,7 +229,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
@MENetworkEventSubscribe
|
||||
public void changeStateC( final MENetworkPowerStatusChange bs )
|
||||
{
|
||||
if( !this.output )
|
||||
if( !this.isOutput() )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
final int olderSize = this.oldSize;
|
||||
@@ -244,7 +244,7 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
@Override
|
||||
public void onTunnelNetworkChange()
|
||||
{
|
||||
if( !this.output )
|
||||
if( !this.isOutput() )
|
||||
{
|
||||
this.cachedInv = null;
|
||||
final int olderSize = this.oldSize;
|
||||
@@ -337,12 +337,12 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory( final EntityPlayer p)
|
||||
public void openInventory( final EntityPlayer p )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory( final EntityPlayer p)
|
||||
public void closeInventory( final EntityPlayer p )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -375,12 +375,12 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
return 0;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @Method( iname = IntegrationType.BuildCraftTransport )
|
||||
// public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
// @Override
|
||||
// @Method( iname = IntegrationType.BuildCraftTransport )
|
||||
// public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void setField(
|
||||
@@ -409,10 +409,10 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /*IPipe
|
||||
}
|
||||
|
||||
// TODO: BC Integration
|
||||
// @Override
|
||||
// @Method( iname = "BuildCraftTransport" )
|
||||
// public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
// {
|
||||
// return this.side == with && type == PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT;
|
||||
// }
|
||||
// @Override
|
||||
// @Method( iname = "BuildCraftTransport" )
|
||||
// public ConnectOverride overridePipeConnection( PipeType type, ForgeDirection with )
|
||||
// {
|
||||
// return this.side == with && type == PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ import appeng.me.GridAccessException;
|
||||
public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTickable
|
||||
{
|
||||
|
||||
int lastValue = 0;
|
||||
float opacity = -1;
|
||||
private int lastValue = 0;
|
||||
private float opacity = -1;
|
||||
|
||||
public PartP2PLight( final ItemStack is )
|
||||
{
|
||||
@@ -66,7 +66,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
public void writeToStream( final ByteBuf data ) throws IOException
|
||||
{
|
||||
super.writeToStream( data );
|
||||
data.writeInt( this.output ? this.lastValue : 0 );
|
||||
data.writeInt( this.isOutput() ? this.lastValue : 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,13 +74,13 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
{
|
||||
super.readFromStream( data );
|
||||
this.lastValue = data.readInt();
|
||||
this.output = this.lastValue > 0;
|
||||
this.setOutput( this.lastValue > 0 );
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean doWork()
|
||||
{
|
||||
if( this.output )
|
||||
if( this.isOutput() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -88,9 +88,9 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
final TileEntity te = this.getTile();
|
||||
final World w = te.getWorld();
|
||||
|
||||
final int newLevel = w.getLight( te.getPos().offset( this.side.getFacing() ) );
|
||||
final int newLevel = w.getLight( te.getPos().offset( this.getSide().getFacing() ) );
|
||||
|
||||
if( this.lastValue != newLevel && this.proxy.isActive() )
|
||||
if( this.lastValue != newLevel && this.getProxy().isActive() )
|
||||
{
|
||||
this.lastValue = newLevel;
|
||||
try
|
||||
@@ -116,7 +116,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
|
||||
this.doWork();
|
||||
|
||||
if( this.output )
|
||||
if( this.isOutput() )
|
||||
{
|
||||
this.getHost().markForUpdate();
|
||||
}
|
||||
@@ -125,7 +125,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
@Override
|
||||
public int getLightLevel()
|
||||
{
|
||||
if( this.output && this.isPowered() )
|
||||
if( this.isOutput() && this.isPowered() )
|
||||
{
|
||||
return this.blockLight( this.lastValue );
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setLightLevel( final int out )
|
||||
private void setLightLevel( final int out )
|
||||
{
|
||||
this.lastValue = out;
|
||||
this.getHost().markForUpdate();
|
||||
@@ -144,7 +144,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
if( this.opacity < 0 )
|
||||
{
|
||||
final TileEntity te = this.getTile();
|
||||
this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( this.side.getFacing() ) );
|
||||
this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( this.getSide().getFacing() ) );
|
||||
}
|
||||
|
||||
return (int) ( emit * ( this.opacity / 255.0f ) );
|
||||
@@ -178,10 +178,10 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
@Override
|
||||
public void onTunnelNetworkChange()
|
||||
{
|
||||
if( this.output )
|
||||
if( this.isOutput() )
|
||||
{
|
||||
final PartP2PLight src = this.getInput();
|
||||
if( src != null && src.proxy.isActive() )
|
||||
if( src != null && src.getProxy().isActive() )
|
||||
{
|
||||
this.setLightLevel( src.lastValue );
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public class PartP2PLight extends PartP2PTunnel<PartP2PLight> implements IGridTi
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.LightTunnel.min, TickRates.LightTunnel.max, false, false );
|
||||
return new TickingRequest( TickRates.LightTunnel.getMin(), TickRates.LightTunnel.getMax(), false, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,10 +37,10 @@ import appeng.me.GridAccessException;
|
||||
public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFluidHandler
|
||||
{
|
||||
|
||||
static final ThreadLocal<Stack<PartP2PLiquids>> DEPTH = new ThreadLocal<Stack<PartP2PLiquids>>();
|
||||
private static final ThreadLocal<Stack<PartP2PLiquids>> DEPTH = new ThreadLocal<Stack<PartP2PLiquids>>();
|
||||
private static final FluidTankInfo[] ACTIVE_TANK = { new FluidTankInfo( null, 10000 ) };
|
||||
private static final FluidTankInfo[] INACTIVE_TANK = { new FluidTankInfo( null, 0 ) };
|
||||
IFluidHandler cachedTank;
|
||||
private IFluidHandler cachedTank;
|
||||
private int tmpUsed;
|
||||
|
||||
public PartP2PLiquids( final ItemStack is )
|
||||
@@ -63,7 +63,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
this.cachedTank = null;
|
||||
if( this.output )
|
||||
if( this.isOutput() )
|
||||
{
|
||||
final PartP2PLiquids in = this.getInput();
|
||||
if( in != null )
|
||||
@@ -98,7 +98,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
final IFluidHandler tank = l.getTarget();
|
||||
if( tank != null )
|
||||
{
|
||||
l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), resource.copy(), false );
|
||||
l.tmpUsed = tank.fill( l.getSide().getFacing().getOpposite(), resource.copy(), false );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -153,7 +153,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
final IFluidHandler tank = l.getTarget();
|
||||
if( tank != null )
|
||||
{
|
||||
l.tmpUsed = tank.fill( l.side.getFacing().getOpposite(), insert.copy(), true );
|
||||
l.tmpUsed = tank.fill( l.getSide().getFacing().getOpposite(), insert.copy(), true );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -184,7 +184,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return s;
|
||||
}
|
||||
|
||||
List<PartP2PLiquids> getOutputs( final Fluid input )
|
||||
private List<PartP2PLiquids> getOutputs( final Fluid input )
|
||||
{
|
||||
final List<PartP2PLiquids> outs = new LinkedList<PartP2PLiquids>();
|
||||
|
||||
@@ -195,7 +195,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
final IFluidHandler handler = l.getTarget();
|
||||
if( handler != null )
|
||||
{
|
||||
if( handler.canFill( l.side.getFacing().getOpposite(), input ) )
|
||||
if( handler.canFill( l.getSide().getFacing().getOpposite(), input ) )
|
||||
{
|
||||
outs.add( l );
|
||||
}
|
||||
@@ -210,9 +210,9 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return outs;
|
||||
}
|
||||
|
||||
IFluidHandler getTarget()
|
||||
private IFluidHandler getTarget()
|
||||
{
|
||||
if( !this.proxy.isActive() )
|
||||
if( !this.getProxy().isActive() )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
return this.cachedTank;
|
||||
}
|
||||
|
||||
final TileEntity te = this.tile.getWorld().getTileEntity( this.tile.getPos().offset( this.side.getFacing() ) );
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( this.getTile().getPos().offset( this.getSide().getFacing() ) );
|
||||
if( te instanceof IFluidHandler )
|
||||
{
|
||||
return this.cachedTank = (IFluidHandler) te;
|
||||
@@ -246,7 +246,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
@Override
|
||||
public boolean canFill( final EnumFacing from, final Fluid fluid )
|
||||
{
|
||||
return !this.output && from == this.side.getFacing() && !this.getOutputs( fluid ).isEmpty();
|
||||
return !this.isOutput() && from == this.getSide().getFacing() && !this.getOutputs( fluid ).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -258,7 +258,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo( final EnumFacing from )
|
||||
{
|
||||
if( from == this.side.getFacing() )
|
||||
if( from == this.getSide().getFacing() )
|
||||
{
|
||||
return this.getTank();
|
||||
}
|
||||
@@ -267,7 +267,7 @@ public class PartP2PLiquids extends PartP2PTunnel<PartP2PLiquids> implements IFl
|
||||
|
||||
private FluidTankInfo[] getTank()
|
||||
{
|
||||
if( this.output )
|
||||
if( this.isOutput() )
|
||||
{
|
||||
final PartP2PLiquids tun = this.getInput();
|
||||
if( tun != null )
|
||||
|
||||
@@ -250,4 +250,4 @@ package appeng.parts.p2p;
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// }
|
||||
|
||||
@@ -171,4 +171,4 @@ package appeng.parts.p2p;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//}
|
||||
// }
|
||||
|
||||
@@ -38,8 +38,8 @@ import appeng.util.Platform;
|
||||
public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
{
|
||||
|
||||
int power;
|
||||
boolean recursive = false;
|
||||
private int power;
|
||||
private boolean recursive = false;
|
||||
|
||||
public PartP2PRedstone( final ItemStack is )
|
||||
{
|
||||
@@ -52,9 +52,9 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
this.setNetworkReady();
|
||||
}
|
||||
|
||||
public void setNetworkReady()
|
||||
private void setNetworkReady()
|
||||
{
|
||||
if( this.output )
|
||||
if( this.isOutput() )
|
||||
{
|
||||
final PartP2PRedstone in = this.getInput();
|
||||
if( in != null )
|
||||
@@ -64,7 +64,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
}
|
||||
}
|
||||
|
||||
protected void putInput( final Object o )
|
||||
private void putInput( final Object o )
|
||||
{
|
||||
if( this.recursive )
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
}
|
||||
|
||||
this.recursive = true;
|
||||
if( this.output && this.proxy.isActive() )
|
||||
if( this.isOutput() && this.getProxy().isActive() )
|
||||
{
|
||||
final int newPower = (Integer) o;
|
||||
if( this.power != newPower )
|
||||
@@ -84,15 +84,15 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
this.recursive = false;
|
||||
}
|
||||
|
||||
public void notifyNeighbors()
|
||||
private void notifyNeighbors()
|
||||
{
|
||||
final World worldObj = this.tile.getWorld();
|
||||
final World worldObj = this.getTile().getWorld();
|
||||
|
||||
Platform.notifyBlocksOfNeighbors( worldObj, this.tile.getPos());
|
||||
Platform.notifyBlocksOfNeighbors( worldObj, this.getTile().getPos() );
|
||||
|
||||
// and this cause sometimes it can go thought walls.
|
||||
for ( final EnumFacing face : EnumFacing.VALUES )
|
||||
Platform.notifyBlocksOfNeighbors( worldObj, this.tile.getPos().offset( face ) );
|
||||
for( final EnumFacing face : EnumFacing.VALUES )
|
||||
Platform.notifyBlocksOfNeighbors( worldObj, this.getTile().getPos().offset( face ) );
|
||||
}
|
||||
|
||||
@MENetworkEventSubscribe
|
||||
@@ -135,22 +135,22 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
@Override
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
if( !this.output )
|
||||
if( !this.isOutput() )
|
||||
{
|
||||
final BlockPos target = this.tile.getPos().offset( this.side.getFacing() );
|
||||
final BlockPos target = this.getTile().getPos().offset( this.getSide().getFacing() );
|
||||
|
||||
final IBlockState state = this.tile.getWorld().getBlockState( target );
|
||||
final IBlockState state = this.getTile().getWorld().getBlockState( target );
|
||||
final Block b = state.getBlock();
|
||||
if( b != null && !this.output )
|
||||
if( b != null && !this.isOutput() )
|
||||
{
|
||||
EnumFacing srcSide = this.side.getFacing();
|
||||
EnumFacing srcSide = this.getSide().getFacing();
|
||||
if( b instanceof BlockRedstoneWire )
|
||||
{
|
||||
srcSide = EnumFacing.UP;
|
||||
}
|
||||
|
||||
this.power = b.isProvidingStrongPower( this.tile.getWorld(), target,state, srcSide );
|
||||
this.power = Math.max( this.power, b.isProvidingWeakPower( this.tile.getWorld(), target, state, srcSide ) );
|
||||
|
||||
this.power = b.isProvidingStrongPower( this.getTile().getWorld(), target, state, srcSide );
|
||||
this.power = Math.max( this.power, b.isProvidingWeakPower( this.getTile().getWorld(), target, state, srcSide ) );
|
||||
this.sendToOutput( this.power );
|
||||
}
|
||||
else
|
||||
@@ -169,13 +169,13 @@ public class PartP2PRedstone extends PartP2PTunnel<PartP2PRedstone>
|
||||
@Override
|
||||
public int isProvidingStrongPower()
|
||||
{
|
||||
return this.output ? this.power : 0;
|
||||
return this.isOutput() ? this.power : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingWeakPower()
|
||||
{
|
||||
return this.output ? this.power : 0;
|
||||
return this.isOutput() ? this.power : 0;
|
||||
}
|
||||
|
||||
private void sendToOutput( final int power )
|
||||
|
||||
@@ -62,8 +62,8 @@ import com.google.common.base.Optional;
|
||||
public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicState
|
||||
{
|
||||
private final TunnelCollection type = new TunnelCollection<T>( null, this.getClass() );
|
||||
public boolean output;
|
||||
public long freq;
|
||||
private boolean output;
|
||||
private long freq;
|
||||
|
||||
public PartP2PTunnel( final ItemStack is )
|
||||
{
|
||||
@@ -81,16 +81,16 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
return null;
|
||||
}
|
||||
|
||||
public T getInput()
|
||||
T getInput()
|
||||
{
|
||||
if( this.freq == 0 )
|
||||
if( this.getFrequency() == 0 )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
final PartP2PTunnel tunnel = this.proxy.getP2P().getInput( this.freq );
|
||||
final PartP2PTunnel tunnel = this.getProxy().getP2P().getInput( this.getFrequency() );
|
||||
if( this.getClass().isInstance( tunnel ) )
|
||||
{
|
||||
return (T) tunnel;
|
||||
@@ -103,11 +103,11 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
return null;
|
||||
}
|
||||
|
||||
public TunnelCollection<T> getOutputs() throws GridAccessException
|
||||
TunnelCollection<T> getOutputs() throws GridAccessException
|
||||
{
|
||||
if( this.proxy.isActive() )
|
||||
if( this.getProxy().isActive() )
|
||||
{
|
||||
return (TunnelCollection<T>) this.proxy.getP2P().getOutputs( this.freq, this.getClass() );
|
||||
return (TunnelCollection<T>) this.getProxy().getP2P().getOutputs( this.getFrequency(), this.getClass() );
|
||||
}
|
||||
return new TunnelCollection( new ArrayList(), this.getClass() );
|
||||
}
|
||||
@@ -124,19 +124,19 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderInventory( final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTypeTexture(renderer) );
|
||||
rh.setTexture( this.getTypeTexture( renderer ) );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderInventoryBox( renderer );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param renderer
|
||||
* @param renderer
|
||||
* @return If enabled it returns the icon of an AE quartz block, else vanilla quartz block icon
|
||||
*/
|
||||
protected IAESprite getTypeTexture( final ModelGenerator renderer )
|
||||
@@ -144,11 +144,11 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
final Optional<Block> maybeBlock = AEApi.instance().definitions().blocks().quartz().maybeBlock();
|
||||
if( maybeBlock.isPresent() )
|
||||
{
|
||||
return renderer.getIcon( new ItemStack(maybeBlock.get()) );
|
||||
return renderer.getIcon( new ItemStack( maybeBlock.get() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return renderer.getIcon( new ItemStack(Blocks.quartz_block) );
|
||||
return renderer.getIcon( new ItemStack( Blocks.quartz_block ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,12 +156,12 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void renderStatic( final BlockPos pos, final IPartRenderHelper rh, final ModelGenerator renderer )
|
||||
{
|
||||
rh.setTexture( this.getTypeTexture(renderer) );
|
||||
rh.setTexture( this.getTypeTexture( renderer ) );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(), renderer.getIcon( this.is ), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
|
||||
rh.setTexture( CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.BlockP2PTunnel2.getIcon(), renderer.getIcon( this.getItemStack() ), CableBusTextures.PartTunnelSides.getIcon(), CableBusTextures.PartTunnelSides.getIcon() );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -201,16 +201,16 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
public void readFromNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.output = data.getBoolean( "output" );
|
||||
this.freq = data.getLong( "freq" );
|
||||
this.setOutput( data.getBoolean( "output" ) );
|
||||
this.setFrequency( data.getLong( "freq" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT( final NBTTagCompound data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setBoolean( "output", this.output );
|
||||
data.setLong( "freq", this.freq );
|
||||
data.setBoolean( "output", this.isOutput() );
|
||||
data.setLong( "freq", this.getFrequency() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -249,18 +249,18 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
final IPart testPart = ( (IPartItem) newType.getItem() ).createPartFromItemStack( newType );
|
||||
if( testPart instanceof PartP2PTunnel )
|
||||
{
|
||||
this.getHost().removePart( this.side, true );
|
||||
final AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
this.getHost().removePart( this.getSide(), true );
|
||||
final AEPartLocation dir = this.getHost().addPart( newType, this.getSide(), player );
|
||||
final IPart newBus = this.getHost().getPart( dir );
|
||||
|
||||
if( newBus instanceof PartP2PTunnel )
|
||||
{
|
||||
final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
newTunnel.output = true;
|
||||
newTunnel.setOutput( true );
|
||||
|
||||
try
|
||||
{
|
||||
final P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
final P2PCache p2p = newTunnel.getProxy().getP2P();
|
||||
p2p.updateFreq( newTunnel, freq );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
@@ -293,31 +293,31 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
case RF_POWER:
|
||||
for( ItemStack stack : parts.p2PTunnelRF().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
*/
|
||||
|
||||
/*
|
||||
* case RF_POWER:
|
||||
* for( ItemStack stack : parts.p2PTunnelRF().maybeStack( 1 ).asSet() )
|
||||
* {
|
||||
* newType = stack;
|
||||
* }
|
||||
* break;
|
||||
*/
|
||||
|
||||
case FLUID:
|
||||
for( final ItemStack stack : parts.p2PTunnelLiquids().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
case IC2_POWER:
|
||||
for( ItemStack stack : parts.p2PTunnelEU().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* case IC2_POWER:
|
||||
* for( ItemStack stack : parts.p2PTunnelEU().maybeStack( 1 ).asSet() )
|
||||
* {
|
||||
* newType = stack;
|
||||
* }
|
||||
* break;
|
||||
*/
|
||||
|
||||
case ITEM:
|
||||
for( final ItemStack stack : parts.p2PTunnelItems().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
@@ -338,46 +338,44 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
case COMPUTER_MESSAGE:
|
||||
for( ItemStack stack : parts.p2PTunnelOpenComputers().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
|
||||
case PRESSURE:
|
||||
for( ItemStack stack : parts.p2PTunnelPneumaticCraft().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
newType = stack;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
* case COMPUTER_MESSAGE:
|
||||
* for( ItemStack stack : parts.p2PTunnelOpenComputers().maybeStack( 1 ).asSet() )
|
||||
* {
|
||||
* newType = stack;
|
||||
* }
|
||||
* break;
|
||||
* case PRESSURE:
|
||||
* for( ItemStack stack : parts.p2PTunnelPneumaticCraft().maybeStack( 1 ).asSet() )
|
||||
* {
|
||||
* newType = stack;
|
||||
* }
|
||||
* break;
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if( newType != null && !Platform.isSameItem( newType, this.is ) )
|
||||
if( newType != null && !Platform.isSameItem( newType, this.getItemStack() ) )
|
||||
{
|
||||
final boolean oldOutput = this.output;
|
||||
final long myFreq = this.freq;
|
||||
final boolean oldOutput = this.isOutput();
|
||||
final long myFreq = this.getFrequency();
|
||||
|
||||
this.getHost().removePart( this.side, false );
|
||||
final AEPartLocation dir = this.getHost().addPart( newType, this.side, player );
|
||||
this.getHost().removePart( this.getSide(), false );
|
||||
final AEPartLocation dir = this.getHost().addPart( newType, this.getSide(), player );
|
||||
final IPart newBus = this.getHost().getPart( dir );
|
||||
|
||||
if( newBus instanceof PartP2PTunnel )
|
||||
{
|
||||
final PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
|
||||
newTunnel.output = oldOutput;
|
||||
newTunnel.setOutput( oldOutput );
|
||||
newTunnel.onTunnelNetworkChange();
|
||||
|
||||
try
|
||||
{
|
||||
final P2PCache p2p = newTunnel.proxy.getP2P();
|
||||
final P2PCache p2p = newTunnel.getProxy().getP2P();
|
||||
p2p.updateFreq( newTunnel, myFreq );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
@@ -386,7 +384,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
}
|
||||
}
|
||||
|
||||
Platform.notifyBlocksOfNeighbors( this.tile.getWorld(), this.tile.getPos() );
|
||||
Platform.notifyBlocksOfNeighbors( this.getTile().getWorld(), this.getTile().getPos() );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -403,18 +401,18 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
final IMemoryCard mc = (IMemoryCard) is.getItem();
|
||||
final NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
long newFreq = this.freq;
|
||||
final boolean wasOutput = this.output;
|
||||
this.output = false;
|
||||
long newFreq = this.getFrequency();
|
||||
final boolean wasOutput = this.isOutput();
|
||||
this.setOutput( false );
|
||||
|
||||
if( wasOutput || this.freq == 0 )
|
||||
if( wasOutput || this.getFrequency() == 0 )
|
||||
{
|
||||
newFreq = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
this.proxy.getP2P().updateFreq( this, newFreq );
|
||||
this.getProxy().getP2P().updateFreq( this, newFreq );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -427,7 +425,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
final String type = p2pItem.getUnlocalizedName();
|
||||
|
||||
p2pItem.writeToNBT( data );
|
||||
data.setLong( "freq", this.freq );
|
||||
data.setLong( "freq", this.getFrequency() );
|
||||
|
||||
mc.setMemoryCardContents( is, type + ".name", data );
|
||||
mc.notifyUser( player, MemoryCardMessages.SETTINGS_SAVED );
|
||||
@@ -458,11 +456,31 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
|
||||
|
||||
try
|
||||
{
|
||||
this.proxy.getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE );
|
||||
this.getProxy().getEnergy().extractAEPower( ae_to_tax, Actionable.MODULATE, PowerMultiplier.ONE );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
// :P
|
||||
}
|
||||
}
|
||||
|
||||
public long getFrequency()
|
||||
{
|
||||
return this.freq;
|
||||
}
|
||||
|
||||
public void setFrequency( final long freq )
|
||||
{
|
||||
this.freq = freq;
|
||||
}
|
||||
|
||||
public boolean isOutput()
|
||||
{
|
||||
return this.output;
|
||||
}
|
||||
|
||||
void setOutput( final boolean output )
|
||||
{
|
||||
this.output = output;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,13 +49,13 @@ import appeng.me.helpers.AENetworkProxy;
|
||||
public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements IGridTickable
|
||||
{
|
||||
|
||||
public final Connections connection = new Connections( this );
|
||||
final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", null, true );
|
||||
private final Connections connection = new Connections( this );
|
||||
private final AENetworkProxy outerProxy = new AENetworkProxy( this, "outer", null, true );
|
||||
|
||||
public PartP2PTunnelME( final ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL );
|
||||
this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL, GridFlags.COMPRESSED_CHANNEL );
|
||||
this.outerProxy.setFlags( GridFlags.DENSE_CAPACITY, GridFlags.CANNOT_CARRY_COMPRESSED );
|
||||
}
|
||||
|
||||
@@ -77,11 +77,11 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
public void onTunnelNetworkChange()
|
||||
{
|
||||
super.onTunnelNetworkChange();
|
||||
if( !this.output )
|
||||
if( !this.isOutput() )
|
||||
{
|
||||
try
|
||||
{
|
||||
this.proxy.getTick().wakeDevice( this.proxy.getNode() );
|
||||
this.getProxy().getTick().wakeDevice( this.getProxy().getNode() );
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -133,7 +133,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
@Override
|
||||
public TickingRequest getTickingRequest( final IGridNode node )
|
||||
{
|
||||
return new TickingRequest( TickRates.METunnel.min, TickRates.METunnel.max, true, false );
|
||||
return new TickingRequest( TickRates.METunnel.getMin(), TickRates.METunnel.getMax(), true, false );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,24 +142,24 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
// just move on...
|
||||
try
|
||||
{
|
||||
if( !this.proxy.getPath().isNetworkBooting() )
|
||||
if( !this.getProxy().getPath().isNetworkBooting() )
|
||||
{
|
||||
if( !this.proxy.getEnergy().isNetworkPowered() )
|
||||
if( !this.getProxy().getEnergy().isNetworkPowered() )
|
||||
{
|
||||
this.connection.markDestroy();
|
||||
TickHandler.INSTANCE.addCallable( this.tile.getWorld(), this.connection );
|
||||
TickHandler.INSTANCE.addCallable( this.getTile().getWorld(), this.connection );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( this.proxy.isActive() )
|
||||
if( this.getProxy().isActive() )
|
||||
{
|
||||
this.connection.markCreate();
|
||||
TickHandler.INSTANCE.addCallable( this.tile.getWorld(), this.connection );
|
||||
TickHandler.INSTANCE.addCallable( this.getTile().getWorld(), this.connection );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.connection.markDestroy();
|
||||
TickHandler.INSTANCE.addCallable( this.tile.getWorld(), this.connection );
|
||||
TickHandler.INSTANCE.addCallable( this.getTile().getWorld(), this.connection );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,32 +176,32 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
|
||||
public void updateConnections( final Connections connections )
|
||||
{
|
||||
if( connections.destroy )
|
||||
if( connections.isDestroy() )
|
||||
{
|
||||
for( final TunnelConnection cw : this.connection.connections.values() )
|
||||
for( final TunnelConnection cw : this.connection.getConnections().values() )
|
||||
{
|
||||
cw.c.destroy();
|
||||
cw.getConnection().destroy();
|
||||
}
|
||||
|
||||
this.connection.connections.clear();
|
||||
this.connection.getConnections().clear();
|
||||
}
|
||||
else if( connections.create )
|
||||
else if( connections.isCreate() )
|
||||
{
|
||||
|
||||
final Iterator<TunnelConnection> i = this.connection.connections.values().iterator();
|
||||
final Iterator<TunnelConnection> i = this.connection.getConnections().values().iterator();
|
||||
while( i.hasNext() )
|
||||
{
|
||||
final TunnelConnection cw = i.next();
|
||||
try
|
||||
{
|
||||
if( cw.tunnel.proxy.getGrid() != this.proxy.getGrid() )
|
||||
if( cw.getTunnel().getProxy().getGrid() != this.getProxy().getGrid() )
|
||||
{
|
||||
cw.c.destroy();
|
||||
cw.getConnection().destroy();
|
||||
i.remove();
|
||||
}
|
||||
else if( !cw.tunnel.proxy.isActive() )
|
||||
else if( !cw.getTunnel().getProxy().isActive() )
|
||||
{
|
||||
cw.c.destroy();
|
||||
cw.getConnection().destroy();
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
{
|
||||
for( final PartP2PTunnelME me : this.getOutputs() )
|
||||
{
|
||||
if( me.proxy.isActive() && connections.connections.get( me.getGridNode() ) == null )
|
||||
if( me.getProxy().isActive() && connections.getConnections().get( me.getGridNode() ) == null )
|
||||
{
|
||||
newSides.add( me );
|
||||
}
|
||||
@@ -226,15 +226,15 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
|
||||
{
|
||||
try
|
||||
{
|
||||
connections.connections.put( me.getGridNode(), new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) );
|
||||
connections.getConnections().put( me.getGridNode(), new TunnelConnection( me, AEApi.instance().createGridConnection( this.outerProxy.getNode(), me.outerProxy.getNode() ) ) );
|
||||
}
|
||||
catch( final FailedConnection e )
|
||||
{
|
||||
final TileEntity start = this.getTile();
|
||||
final TileEntity end = me.getTile();
|
||||
AELog.warning( "Failed to establish a ME P2P Tunnel between the tunnels at [x=%d, y=%d, z=%d] and [x=%d, y=%d, z=%d]",
|
||||
start.getPos().getX(), start.getPos().getY(), start.getPos().getZ(),
|
||||
end.getPos().getX(), end.getPos().getY(), end.getPos().getZ() );
|
||||
AELog.warning( "Failed to establish a ME P2P Tunnel between the tunnels at [x=%d, y=%d, z=%d] and [x=%d, y=%d, z=%d]",
|
||||
start.getPos().getX(), start.getPos().getY(), start.getPos().getZ(),
|
||||
end.getPos().getX(), end.getPos().getY(), end.getPos().getZ() );
|
||||
// :(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public abstract class AbstractPartDisplay extends AbstractPartReporting
|
||||
final IAESprite sideTexture = CableBusTextures.PartMonitorSides.getIcon();
|
||||
final IAESprite backTexture = CableBusTextures.PartMonitorBack.getIcon();
|
||||
|
||||
rh.setTexture( sideTexture, sideTexture, backTexture, renderer.getIcon( this.is ), sideTexture, sideTexture );
|
||||
rh.setTexture( sideTexture, sideTexture, backTexture, renderer.getIcon( this.getItemStack() ), sideTexture, sideTexture );
|
||||
rh.renderInventoryBox( renderer );
|
||||
|
||||
rh.setInvColor( this.getColor().whiteVariant );
|
||||
@@ -82,7 +82,7 @@ public abstract class AbstractPartDisplay extends AbstractPartReporting
|
||||
final IAESprite sideTexture = CableBusTextures.PartMonitorSides.getIcon();
|
||||
final IAESprite backTexture = CableBusTextures.PartMonitorBack.getIcon();
|
||||
|
||||
rh.setTexture( sideTexture, sideTexture, backTexture, renderer.getIcon( this.is ), sideTexture, sideTexture );
|
||||
rh.setTexture( sideTexture, sideTexture, backTexture, renderer.getIcon( this.getItemStack() ), sideTexture, sideTexture );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
@@ -93,7 +93,7 @@ public abstract class AbstractPartDisplay extends AbstractPartReporting
|
||||
renderer.setBrightness( l << 20 | l << 4 );
|
||||
}
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = this.getSpin();
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateEast( renderer.setUvRotateNorth( renderer.setUvRotateSouth( renderer.setUvRotateTop( renderer.setUvRotateWest( this.getSpin() ) ) ) ) ) );
|
||||
|
||||
renderer.setColorOpaque_I( this.getColor().whiteVariant );
|
||||
rh.renderFace( pos, this.getFrontBright().getIcon(), EnumFacing.SOUTH, renderer );
|
||||
@@ -104,11 +104,11 @@ public abstract class AbstractPartDisplay extends AbstractPartReporting
|
||||
renderer.setColorOpaque_I( this.getColor().blackVariant );
|
||||
rh.renderFace( pos, this.getFrontColored().getIcon(), EnumFacing.SOUTH, renderer );
|
||||
|
||||
renderer.uvRotateBottom = renderer.uvRotateEast = renderer.uvRotateNorth = renderer.uvRotateSouth = renderer.uvRotateTop = renderer.uvRotateWest = 0;
|
||||
renderer.setUvRotateBottom( renderer.setUvRotateEast( renderer.setUvRotateNorth( renderer.setUvRotateSouth( renderer.setUvRotateTop( renderer.setUvRotateWest( 0 ) ) ) ) ) );
|
||||
|
||||
final IAESprite sideStatusTexture = CableBusTextures.PartMonitorSidesStatus.getIcon();
|
||||
|
||||
rh.setTexture( sideStatusTexture, sideStatusTexture, backTexture, renderer.getIcon( this.is ), sideStatusTexture, sideStatusTexture );
|
||||
rh.setTexture( sideStatusTexture, sideStatusTexture, backTexture, renderer.getIcon( this.getItemStack() ), sideStatusTexture, sideStatusTexture );
|
||||
|
||||
rh.setBounds( 4, 4, 13, 12, 12, 14 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
@@ -166,7 +166,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
return true;
|
||||
}
|
||||
|
||||
if( !this.proxy.isActive() )
|
||||
if( !this.getProxy().isActive() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
return false;
|
||||
}
|
||||
|
||||
final TileEntity te = this.tile;
|
||||
final TileEntity te = this.getTile();
|
||||
final ItemStack eq = player.getCurrentEquippedItem();
|
||||
|
||||
if( Platform.isWrench( player, eq, te.getPos() ) )
|
||||
@@ -200,7 +200,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
}
|
||||
|
||||
// update the system...
|
||||
public void configureWatchers()
|
||||
private void configureWatchers()
|
||||
{
|
||||
if( this.myWatcher != null )
|
||||
{
|
||||
@@ -216,7 +216,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
this.myWatcher.add( this.configuredItem );
|
||||
}
|
||||
|
||||
this.updateReportingValue( this.proxy.getStorage().getItemInventory() );
|
||||
this.updateReportingValue( this.getProxy().getStorage().getItemInventory() );
|
||||
}
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
@@ -314,7 +314,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
{
|
||||
// GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
|
||||
|
||||
final AEPartLocation d = this.side;
|
||||
final AEPartLocation d = this.getSide();
|
||||
GL11.glTranslated( d.xOffset * 0.77, d.yOffset * 0.77, d.zOffset * 0.77 );
|
||||
|
||||
switch( d ) {
|
||||
@@ -323,27 +323,27 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
GL11.glRotatef( 90.0f, 1.0f, 0.0f, 0.0f );
|
||||
GL11.glRotatef( this.getSpin() * 90.0F, 0, 0, 1 );
|
||||
break;
|
||||
|
||||
|
||||
case DOWN:
|
||||
GL11.glScalef( 1.0f, -1.0f, 1.0f );
|
||||
GL11.glRotatef( -90.0f, 1.0f, 0.0f, 0.0f );
|
||||
GL11.glRotatef( this.getSpin() * -90.0F, 0, 0, 1 );
|
||||
break;
|
||||
|
||||
|
||||
case EAST:
|
||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||
GL11.glRotatef( -90.0f, 0.0f, 1.0f, 0.0f );
|
||||
break;
|
||||
|
||||
|
||||
case WEST:
|
||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||
GL11.glRotatef( 90.0f, 0.0f, 1.0f, 0.0f );
|
||||
break;
|
||||
|
||||
|
||||
case NORTH:
|
||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||
break;
|
||||
|
||||
|
||||
case SOUTH:
|
||||
GL11.glScalef( -1.0f, -1.0f, -1.0f );
|
||||
GL11.glRotatef( 180.0f, 0.0f, 1.0f, 0.0f );
|
||||
@@ -352,7 +352,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
final ItemStack sis = ais.getItemStack();
|
||||
@@ -370,7 +370,7 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
|
||||
// RenderHelper.enableGUIStandardItemLighting();
|
||||
wr.setColorOpaque_F( 1.0f, 1.0f, 1.0f );
|
||||
|
||||
ClientHelper.proxy.doRenderItem( sis, this.tile.getWorld() );
|
||||
ClientHelper.proxy.doRenderItem( sis, this.getTile().getWorld() );
|
||||
}
|
||||
catch( final Exception e )
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting
|
||||
final IAESprite sideTexture = CableBusTextures.PartMonitorSides.getIcon();
|
||||
final IAESprite backTexture = CableBusTextures.PartMonitorBack.getIcon();
|
||||
|
||||
rh.setTexture( sideTexture, sideTexture, backTexture, renderer.getIcon( this.is ), sideTexture, sideTexture );
|
||||
rh.setTexture( sideTexture, sideTexture, backTexture, renderer.getIcon( this.getItemStack() ), sideTexture, sideTexture );
|
||||
rh.renderInventoryBox( renderer );
|
||||
|
||||
rh.setInvColor( this.getBrightnessColor() );
|
||||
@@ -103,7 +103,7 @@ public abstract class AbstractPartPanel extends AbstractPartReporting
|
||||
final IAESprite sideTexture = CableBusTextures.PartMonitorSides.getIcon();
|
||||
final IAESprite backTexture = CableBusTextures.PartMonitorBack.getIcon();
|
||||
|
||||
rh.setTexture( sideTexture, sideTexture, backTexture, renderer.getIcon( this.is ), sideTexture, sideTexture );
|
||||
rh.setTexture( sideTexture, sideTexture, backTexture, renderer.getIcon( this.getItemStack() ), sideTexture, sideTexture );
|
||||
|
||||
rh.setBounds( 2, 2, 14, 14, 14, 16 );
|
||||
rh.renderBlock( pos, renderer );
|
||||
|
||||
@@ -80,12 +80,12 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
|
||||
if( requireChannel )
|
||||
{
|
||||
this.proxy.setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
this.proxy.setIdlePowerUsage( 1.0 / 2.0 );
|
||||
this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
this.getProxy().setIdlePowerUsage( 1.0 / 2.0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.proxy.setIdlePowerUsage( 1.0 / 16.0 ); // lights drain a little bit.
|
||||
this.getProxy().setIdlePowerUsage( 1.0 / 16.0 ); // lights drain a little bit.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,17 +145,17 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
|
||||
try
|
||||
{
|
||||
if( this.proxy.getEnergy().isNetworkPowered() )
|
||||
if( this.getProxy().getEnergy().isNetworkPowered() )
|
||||
{
|
||||
this.clientFlags = this.getClientFlags() | AbstractPartReporting.POWERED_FLAG;
|
||||
}
|
||||
|
||||
if( this.proxy.getPath().isNetworkBooting() )
|
||||
if( this.getProxy().getPath().isNetworkBooting() )
|
||||
{
|
||||
this.clientFlags = this.getClientFlags() | AbstractPartReporting.BOOTING_FLAG;
|
||||
}
|
||||
|
||||
if( this.proxy.getNode().meetsChannelRequirements() )
|
||||
if( this.getProxy().getNode().meetsChannelRequirements() )
|
||||
{
|
||||
this.clientFlags = this.getClientFlags() | AbstractPartReporting.CHANNEL_FLAG;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
break;
|
||||
}
|
||||
|
||||
this.host.markForUpdate();
|
||||
this.getHost().markForUpdate();
|
||||
this.saveChanges();
|
||||
}
|
||||
return true;
|
||||
@@ -250,7 +250,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
if( this.opacity < 0 )
|
||||
{
|
||||
final TileEntity te = this.getTile();
|
||||
this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( this.side.getFacing() ) );
|
||||
this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( this.getSide().getFacing() ) );
|
||||
}
|
||||
|
||||
return (int) ( emit * ( this.opacity / 255.0f ) );
|
||||
@@ -263,7 +263,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
return this.proxy.getEnergy().isNetworkPowered();
|
||||
return this.getProxy().getEnergy().isNetworkPowered();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -121,7 +121,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
return true;
|
||||
}
|
||||
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.side, this.getGui( player ) );
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), this.getGui( player ) );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.proxy.getStorage().getItemInventory();
|
||||
return this.getProxy().getStorage().getItemInventory();
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -153,7 +153,7 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
{
|
||||
try
|
||||
{
|
||||
return this.proxy.getStorage().getFluidInventory();
|
||||
return this.getProxy().getStorage().getFluidInventory();
|
||||
}
|
||||
catch( final GridAccessException e )
|
||||
{
|
||||
@@ -177,6 +177,6 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
|
||||
@Override
|
||||
public void onChangeInventory( final IInventory inv, final int slot, final InvOperation mc, final ItemStack removedStack, final ItemStack newStack )
|
||||
{
|
||||
this.host.markForSave();
|
||||
this.getHost().markForSave();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class PartConversionMonitor extends AbstractPartMonitor
|
||||
return true;
|
||||
}
|
||||
|
||||
if( !this.proxy.isActive() )
|
||||
if( !this.getProxy().isActive() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -83,13 +83,13 @@ public class PartConversionMonitor extends AbstractPartMonitor
|
||||
{
|
||||
try
|
||||
{
|
||||
if( !this.proxy.isActive() )
|
||||
if( !this.getProxy().isActive() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final IEnergySource energy = this.proxy.getEnergy();
|
||||
final IMEMonitor<IAEItemStack> cell = this.proxy.getStorage().getItemInventory();
|
||||
final IEnergySource energy = this.getProxy().getEnergy();
|
||||
final IMEMonitor<IAEItemStack> cell = this.getProxy().getStorage().getItemInventory();
|
||||
final IAEItemStack input = AEItemStack.create( item );
|
||||
|
||||
if( ModeB )
|
||||
@@ -128,13 +128,13 @@ public class PartConversionMonitor extends AbstractPartMonitor
|
||||
{
|
||||
try
|
||||
{
|
||||
if( !this.proxy.isActive() )
|
||||
if( !this.getProxy().isActive() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final IEnergySource energy = this.proxy.getEnergy();
|
||||
final IMEMonitor<IAEItemStack> cell = this.proxy.getStorage().getItemInventory();
|
||||
final IEnergySource energy = this.getProxy().getEnergy();
|
||||
final IMEMonitor<IAEItemStack> cell = this.getProxy().getStorage().getItemInventory();
|
||||
|
||||
final ItemStack is = input.getItemStack();
|
||||
input.setStackSize( is.getMaxStackSize() );
|
||||
@@ -147,9 +147,9 @@ public class PartConversionMonitor extends AbstractPartMonitor
|
||||
newItems = adaptor.addItems( newItems );
|
||||
if( newItems != null )
|
||||
{
|
||||
final TileEntity te = this.tile;
|
||||
final TileEntity te = this.getTile();
|
||||
final List<ItemStack> list = Collections.singletonList( newItems );
|
||||
Platform.spawnDrops( player.worldObj, te.getPos().offset( this.side.getFacing() ), list );
|
||||
Platform.spawnDrops( player.worldObj, te.getPos().offset( this.getSide().getFacing() ), list );
|
||||
}
|
||||
|
||||
if( player.openContainer != null )
|
||||
|
||||
@@ -81,12 +81,12 @@ public class PartCraftingTerminal extends AbstractPartTerminal
|
||||
int z = (int) p.posZ;
|
||||
if( this.getHost().getTile() != null )
|
||||
{
|
||||
x = this.tile.getPos().getX();
|
||||
y = this.tile.getPos().getY();
|
||||
z = this.tile.getPos().getZ();
|
||||
x = this.getTile().getPos().getX();
|
||||
y = this.getTile().getPos().getY();
|
||||
z = this.getTile().getPos().getZ();
|
||||
}
|
||||
|
||||
if( GuiBridge.GUI_CRAFTING_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.side, p ) )
|
||||
if( GuiBridge.GUI_CRAFTING_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.getSide(), p ) )
|
||||
{
|
||||
return GuiBridge.GUI_CRAFTING_TERMINAL;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class PartInterfaceTerminal extends AbstractPartDisplay
|
||||
return true;
|
||||
}
|
||||
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.side, GuiBridge.GUI_INTERFACE_TERMINAL );
|
||||
Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_INTERFACE_TERMINAL );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,12 +96,12 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
int z = (int) p.posZ;
|
||||
if( this.getHost().getTile() != null )
|
||||
{
|
||||
x = this.tile.getPos().getX();
|
||||
y = this.tile.getPos().getY();
|
||||
z = this.tile.getPos().getZ();
|
||||
x = this.getTile().getPos().getX();
|
||||
y = this.getTile().getPos().getY();
|
||||
z = this.getTile().getPos().getZ();
|
||||
}
|
||||
|
||||
if( GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.side, p ) )
|
||||
if( GuiBridge.GUI_PATTERN_TERMINAL.hasPermissions( this.getHost().getTile(), x, y, z, this.getSide(), p ) )
|
||||
{
|
||||
return GuiBridge.GUI_PATTERN_TERMINAL;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
this.fixCraftingRecipes();
|
||||
}
|
||||
|
||||
this.host.markForSave();
|
||||
this.getHost().markForSave();
|
||||
}
|
||||
|
||||
private void fixCraftingRecipes()
|
||||
|
||||
Reference in New Issue
Block a user