Format sourcecode

This commit is contained in:
yueh
2017-07-20 21:17:10 +02:00
parent 66437897be
commit 621910df91
295 changed files with 2142 additions and 1562 deletions
@@ -1196,7 +1196,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
}
// Collect the number of channels used per side
// We have to do this even for non-smart cables since a glass cable can display a connection as smart if the adjacent tile requires it
// We have to do this even for non-smart cables since a glass cable can display a connection as smart if the
// adjacent tile requires it
for( EnumFacing facing : EnumFacing.values() )
{
int channels = cable.getChannelsOnSide( facing );
@@ -1209,7 +1210,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
{
FacadeRenderState facadeState = getFacadeRenderState( facing );
if ( facadeState != null )
if( facadeState != null )
{
renderState.getFacades().put( facing, facadeState );
}
@@ -1249,7 +1250,8 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
return renderState;
}
private FacadeRenderState getFacadeRenderState( EnumFacing side ) {
private FacadeRenderState getFacadeRenderState( EnumFacing side )
{
// Store the "masqueraded" itemstack for the given side, if there is a facade
IFacadePart facade = getFacade( side.ordinal() );
if( facade != null )
@@ -1333,5 +1335,4 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
return true;
}
}
@@ -177,7 +177,7 @@ public class PartPlacement
;
if( held.getCount() == 0 )
{
player.inventory.mainInventory.set(player.inventory.currentItem, ItemStack.EMPTY);
player.inventory.mainInventory.set( player.inventory.currentItem, ItemStack.EMPTY );
MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( player, held, hand ) );
}
}
@@ -352,7 +352,7 @@ public class PartPlacement
;
if( held.getCount() == 0 )
{
player.inventory.mainInventory.set(player.inventory.currentItem, ItemStack.EMPTY);
player.inventory.mainInventory.set( player.inventory.currentItem, ItemStack.EMPTY );
MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( player, held, hand ) );
}
}
@@ -292,7 +292,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
if( changed )
{
AppEng.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, this.getTile().getWorld(), new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.getSide(), false ) );
AppEng.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, this.getTile().getWorld(),
new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.getSide(), false ) );
}
}
}
@@ -456,7 +457,8 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
energy.extractAEPower( requiredPower, Actionable.MODULATE, PowerMultiplier.CONFIG );
this.breakBlockAndStoreItems( w, pos, items );
AppEng.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, w, new PacketTransitionEffect( pos.getX(), pos.getY(), pos.getZ(), this.getSide(), true ) );
AppEng.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, w,
new PacketTransitionEffect( pos.getX(), pos.getY(), pos.getZ(), this.getSide(), true ) );
}
else
{
@@ -218,7 +218,8 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
if( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
{
newItems = myAdaptor.removeSimilarItems( toSend, whatToImport == null ? ItemStack.EMPTY : whatToImport.getItemStack(), fzMode, this.configDestination( inv ) );
newItems = myAdaptor.removeSimilarItems( toSend, whatToImport == null ? ItemStack.EMPTY : whatToImport.getItemStack(), fzMode,
this.configDestination( inv ) );
}
else
{
@@ -49,8 +49,7 @@ public class PlaneBakedModel implements IBakedModel
private final List<BakedQuad> quads;
PlaneBakedModel( VertexFormat format, TextureAtlasSprite frontTexture, TextureAtlasSprite sidesTexture, TextureAtlasSprite backTexture,
PlaneConnections connections )
PlaneBakedModel( VertexFormat format, TextureAtlasSprite frontTexture, TextureAtlasSprite sidesTexture, TextureAtlasSprite backTexture, PlaneConnections connections )
{
this.frontTexture = frontTexture;
@@ -26,7 +26,8 @@ import com.google.common.base.Strings;
/**
* Models in which directions - looking at the front face - a plane (annihilation, formation, etc.) is connected to other planes of the same type.
* Models in which directions - looking at the front face - a plane (annihilation, formation, etc.) is connected to
* other planes of the same type.
*/
public final class PlaneConnections
{
@@ -108,7 +109,7 @@ public final class PlaneConnections
public String getFilenameSuffix()
{
String suffix = Integer.toBinaryString( getIndex() );
return Strings.padStart(suffix, 4, '0');
return Strings.padStart( suffix, 4, '0' );
}
@Override
@@ -90,4 +90,4 @@ public class LayerIEnergyHandler extends LayerBase implements IEnergyHandler, IE
return false;
}
}
}
@@ -202,6 +202,4 @@ public class LayerIEnergySource extends LayerBase implements IEnergySource
return 0;
}
}
@@ -172,8 +172,8 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
return null;
}
private ItemStack getItemStackInCachedSlot ( int pos ) {
private ItemStack getItemStackInCachedSlot( int pos )
{
if( pos > cachedStacks.length )
return ItemStack.EMPTY;
@@ -200,7 +200,7 @@ class ItemHandlerAdapter implements IMEInventory<IAEItemStack>, IBaseMonitor<IAE
for( int slot = 0; slot < slots; slot++ )
{
// Save the old stuff
ItemStack oldIS = getItemStackInCachedSlot(slot);
ItemStack oldIS = getItemStackInCachedSlot( slot );
IAEItemStack oldAeIS = cachedAeStacks[slot];
ItemStack newIS = itemHandler.getStackInSlot( slot );
@@ -98,13 +98,13 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
public static final ResourceLocation MODEL_BASE = new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_base" );
@PartModels
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_off" ) ) ;
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_off" ) );
@PartModels
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_on" ) ) ;
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_on" ) );
@PartModels
public static final IPartModel MODELS_HAS_CHANNEL =new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_has_channel" ) );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, new ResourceLocation( AppEng.MOD_ID, "part/storage_bus_has_channel" ) );
private final BaseActionSource mySrc;
private final AppEngInternalAEInventory Config = new AppEngInternalAEInventory( this, 63 );
@@ -530,7 +530,8 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
if( achievement != null && achievement.getActionableNode() != null )
{
// Platform.addStat( achievement.getActionableNode().getPlayerID(), Achievements.Recursive.getAchievement() );
// Platform.addStat( achievement.getActionableNode().getPlayerID(), Achievements.Recursive.getAchievement()
// );
// Platform.addStat( getActionableNode().getPlayerID(), Achievements.Recursive.getAchievement() );
}
}
+155 -152
View File
@@ -20,6 +20,7 @@
package appeng.parts.p2p;
import appeng.api.config.PowerUnits;
import appeng.api.parts.IPartModel;
import appeng.items.parts.PartModels;
@@ -36,194 +37,196 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
/**
* @author GuntherDW
*/
public class PartP2PFEPower extends PartP2PTunnel<PartP2PFEPower> implements IEnergyStorage
{
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_fe" );
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_fe" );
private boolean cachedTarget = false;
private boolean cachedTarget = false;
private IEnergyStorage outputTarget;
private IEnergyStorage outputTarget;
@PartModels
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@PartModels
public static List<IPartModel> getModels()
{
return MODELS.getModels();
}
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
}
@Override
public IPartModel getStaticModels()
{
return MODELS.getModel( isPowered(), isActive() );
}
public PartP2PFEPower( ItemStack is )
{
super( is );
}
public PartP2PFEPower( ItemStack is )
{
super( is );
}
@Override
public void onTunnelNetworkChange()
{
this.getHost().notifyNeighbors();
}
@Override
public void onTunnelNetworkChange()
{
this.getHost().notifyNeighbors();
}
@Override
public void onNeighborChanged()
{
super.onNeighborChanged();
@Override
public void onNeighborChanged()
{
super.onNeighborChanged();
this.cachedTarget = false;
}
this.cachedTarget = false;
}
@Override
public int receiveEnergy( int maxReceive, boolean simulate )
{
if( this.isOutput() )
{
return 0;
}
@Override
public int receiveEnergy( int maxReceive, boolean simulate )
{
if( this.isOutput() )
{
return 0;
}
if( this.isActive() )
{
int total = 0;
if( this.isActive() )
{
int total = 0;
try
{
for( PartP2PFEPower t : this.getOutputs() )
{
if( Platform.getRandomInt() % 2 > 0 )
{
int receiver = t.getOutput().receiveEnergy( maxReceive, simulate );
maxReceive -= receiver;
total += receiver;
try
{
for( PartP2PFEPower t : this.getOutputs() )
{
if( Platform.getRandomInt() % 2 > 0 )
{
int receiver = t.getOutput().receiveEnergy( maxReceive, simulate );
maxReceive -= receiver;
total += receiver;
if( maxReceive <= 0 )
{
break;
}
}
}
if( maxReceive <= 0 )
{
break;
}
}
}
if( maxReceive > 0 )
{
for( PartP2PFEPower t : this.getOutputs() )
{
int receiver = t.getOutput().receiveEnergy( maxReceive, simulate );
maxReceive -= receiver;
total += receiver;
if( maxReceive > 0 )
{
for( PartP2PFEPower t : this.getOutputs() )
{
int receiver = t.getOutput().receiveEnergy( maxReceive, simulate );
maxReceive -= receiver;
total += receiver;
if( maxReceive <= 0 )
{
break;
}
}
}
if( maxReceive <= 0 )
{
break;
}
}
}
this.queueTunnelDrain( PowerUnits.RF, total );
}
catch( GridAccessException ignored )
{
}
this.queueTunnelDrain( PowerUnits.RF, total );
}
catch( GridAccessException ignored )
{
}
return total;
}
return total;
}
return 0;
}
return 0;
}
@Override
public int extractEnergy( int maxExtract, boolean simulate )
{
return 0;
}
@Override
public int extractEnergy( int maxExtract, boolean simulate )
{
return 0;
}
private IEnergyStorage getOutput()
{
if( this.isOutput() )
{
if( !this.cachedTarget )
{
TileEntity self = this.getTile();
TileEntity te = self.getWorld().getTileEntity( new BlockPos( self.getPos().getX() + this.getSide().xOffset, self.getPos().getY() + this.getSide().yOffset, self.getPos().getZ() + this.getSide().zOffset ) );
this.outputTarget = te.hasCapability( CapabilityEnergy.ENERGY, this.getSide().getOpposite().getFacing() ) ? te.getCapability( CapabilityEnergy.ENERGY, this.getSide().getOpposite().getFacing() ) : null;
this.cachedTarget = true;
}
private IEnergyStorage getOutput()
{
if( this.isOutput() )
{
if( !this.cachedTarget )
{
TileEntity self = this.getTile();
TileEntity te = self.getWorld().getTileEntity( new BlockPos( self.getPos().getX() + this.getSide().xOffset, self.getPos()
.getY() + this.getSide().yOffset, self.getPos().getZ() + this.getSide().zOffset ) );
this.outputTarget = te.hasCapability( CapabilityEnergy.ENERGY, this.getSide().getOpposite().getFacing() ) ? te
.getCapability( CapabilityEnergy.ENERGY, this.getSide().getOpposite().getFacing() ) : null;
this.cachedTarget = true;
}
if( this.outputTarget == null || !this.outputTarget.canReceive() )
{
return null;
}
if( this.outputTarget == null || !this.outputTarget.canReceive() )
{
return null;
}
return this.outputTarget;
}
return null;
}
return this.outputTarget;
}
return null;
}
@Override
public int getEnergyStored()
{
if( this.isOutput() || !this.isActive() )
{
return 0;
}
@Override
public int getEnergyStored()
{
if( this.isOutput() || !this.isActive() )
{
return 0;
}
int total = 0;
int total = 0;
try
{
for( PartP2PFEPower t : this.getOutputs() )
{
total += t.getOutput().getEnergyStored();
}
}
catch( GridAccessException e )
{
return 0;
}
try
{
for( PartP2PFEPower t : this.getOutputs() )
{
total += t.getOutput().getEnergyStored();
}
}
catch( GridAccessException e )
{
return 0;
}
return total;
}
return total;
}
@Override
public int getMaxEnergyStored()
{
if( this.isOutput() || !this.isActive() )
{
return 0;
}
@Override
public int getMaxEnergyStored()
{
if( this.isOutput() || !this.isActive() )
{
return 0;
}
int total = 0;
int total = 0;
try
{
for( PartP2PFEPower t : this.getOutputs() )
{
total += t.getOutput().getMaxEnergyStored();
}
}
catch( GridAccessException e )
{
return 0;
}
try
{
for( PartP2PFEPower t : this.getOutputs() )
{
total += t.getOutput().getMaxEnergyStored();
}
}
catch( GridAccessException e )
{
return 0;
}
return total;
}
return total;
}
@Override
public boolean canExtract()
{
return false;
}
@Override
public boolean canExtract()
{
return false;
}
@Override
public boolean canReceive()
{
return true;
}
@Override
public boolean canReceive()
{
return true;
}
@Override
public boolean hasCapability( @Nonnull Capability<?> capability )
@@ -294,10 +294,11 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /* IPip
* The ItemStack should not be modified in this function!
* Note: This behaviour is subtly different from IFluidHandlers.fill()
*
* @param slot Slot to insert into.
* @param stack ItemStack to insert.
* @param slot Slot to insert into.
* @param stack ItemStack to insert.
* @param simulate If true, the insertion is only simulated
* @return The remaining ItemStack that was not inserted (if the entire stack is accepted, then return ItemStack.EMPTY).
* @return The remaining ItemStack that was not inserted (if the entire stack is accepted, then return
* ItemStack.EMPTY).
* May be the same as the input ItemStack if unchanged, otherwise a new ItemStack.
**/
@Nonnull
@@ -305,11 +306,12 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /* IPip
public ItemStack insertItem( int slot, @Nonnull ItemStack stack, boolean simulate )
{
if( isItemValidForSlot( slot, stack ) )
if( isItemValidForSlot( slot, stack ) )
{
AdaptorIInventory adaptor = new AdaptorIInventory( this.getDestination() );
if( simulate ) {
if( simulate )
{
return adaptor.simulateAdd( stack );
}
else
@@ -325,8 +327,8 @@ public class PartP2PItems extends PartP2PTunnel<PartP2PItems> implements /* IPip
* if nothing is extracted, otherwise it's stack size must not be greater than amount or the
* itemstacks getMaxStackSize().
*
* @param slot Slot to extract from.
* @param amount Amount to extract (may be greater than the current stacks max limit)
* @param slot Slot to extract from.
* @param amount Amount to extract (may be greater than the current stacks max limit)
* @param simulate If true, the extraction is only simulated
* @return ItemStack extracted from the slot, must be ItemStack.EMPTY, if nothing can be extracted
**/
@@ -19,173 +19,176 @@
package appeng.parts.p2p;
//import javax.annotation.Nullable;
// import javax.annotation.Nullable;
//
//import net.minecraft.item.ItemStack;
//import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.util.IIcon;
//import net.minecraftforge.common.util.ForgeDirection;
// import net.minecraft.item.ItemStack;
// import net.minecraft.nbt.NBTTagCompound;
// import net.minecraft.util.IIcon;
// import net.minecraftforge.common.util.ForgeDirection;
//
//import cpw.mods.fml.relauncher.Side;
//import cpw.mods.fml.relauncher.SideOnly;
// import cpw.mods.fml.relauncher.Side;
// import cpw.mods.fml.relauncher.SideOnly;
//
//import li.cil.oc.api.API;
//import li.cil.oc.api.Items;
//import li.cil.oc.api.Network;
//import li.cil.oc.api.network.Environment;
//import li.cil.oc.api.network.Message;
//import li.cil.oc.api.network.Node;
//import li.cil.oc.api.network.SidedEnvironment;
//import li.cil.oc.api.network.Visibility;
// import li.cil.oc.api.API;
// import li.cil.oc.api.Items;
// import li.cil.oc.api.Network;
// import li.cil.oc.api.network.Environment;
// import li.cil.oc.api.network.Message;
// import li.cil.oc.api.network.Node;
// import li.cil.oc.api.network.SidedEnvironment;
// import li.cil.oc.api.network.Visibility;
//
//import appeng.api.networking.events.MENetworkBootingStatusChange;
//import appeng.api.networking.events.MENetworkChannelsChanged;
//import appeng.api.networking.events.MENetworkEventSubscribe;
//import appeng.api.networking.events.MENetworkPowerStatusChange;
//import appeng.integration.IntegrationRegistry;
//import appeng.integration.IntegrationType;
//import appeng.coremod.annotations.Integration.Interface;
//import appeng.coremod.annotations.Integration.InterfaceList;
// import appeng.api.networking.events.MENetworkBootingStatusChange;
// import appeng.api.networking.events.MENetworkChannelsChanged;
// import appeng.api.networking.events.MENetworkEventSubscribe;
// import appeng.api.networking.events.MENetworkPowerStatusChange;
// import appeng.integration.IntegrationRegistry;
// import appeng.integration.IntegrationType;
// import appeng.coremod.annotations.Integration.Interface;
// import appeng.coremod.annotations.Integration.InterfaceList;
//
//
//@InterfaceList( value = { @Interface( iface = "li.cil.oc.api.network.Environment", iname = IntegrationType.OpenComputers ), @Interface( iface = "li.cil.oc.api.network.SidedEnvironment", iname = IntegrationType.OpenComputers ) } )
//public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenComputers> implements Environment, SidedEnvironment
//{
// @Nullable
// private final Node node;
// @InterfaceList( value = { @Interface( iface = "li.cil.oc.api.network.Environment", iname =
// IntegrationType.OpenComputers ), @Interface( iface = "li.cil.oc.api.network.SidedEnvironment", iname =
// IntegrationType.OpenComputers ) } )
// public final class PartP2POpenComputers extends PartP2PTunnel<PartP2POpenComputers> implements Environment,
// SidedEnvironment
// {
// @Nullable
// private final Node node;
//
// public PartP2POpenComputers( final ItemStack is )
// {
// super( is );
// public PartP2POpenComputers( final ItemStack is )
// {
// super( is );
//
// if( !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
// {
// throw new RuntimeException( "OpenComputers is not installed!" );
// }
// if( !IntegrationRegistry.INSTANCE.isEnabled( IntegrationType.OpenComputers ) )
// {
// throw new RuntimeException( "OpenComputers is not installed!" );
// }
//
// // Avoid NPE when called in pre-init phase (part population).
// if( API.network != null )
// {
// this.node = Network.newNode( this, Visibility.None ).create();
// }
// else
// {
// this.node = null; // to satisfy final
// }
// }
// // Avoid NPE when called in pre-init phase (part population).
// if( API.network != null )
// {
// this.node = Network.newNode( this, Visibility.None ).create();
// }
// else
// {
// this.node = null; // to satisfy final
// }
// }
//
// @MENetworkEventSubscribe
// public void changeStateA( final MENetworkBootingStatusChange bs )
// {
// this.updateConnections();
// }
// @MENetworkEventSubscribe
// public void changeStateA( final MENetworkBootingStatusChange bs )
// {
// this.updateConnections();
// }
//
// @MENetworkEventSubscribe
// public void changeStateB( final MENetworkChannelsChanged bs )
// {
// this.updateConnections();
// }
// @MENetworkEventSubscribe
// public void changeStateB( final MENetworkChannelsChanged bs )
// {
// this.updateConnections();
// }
//
// @MENetworkEventSubscribe
// public void changeStateC( final MENetworkPowerStatusChange bs )
// {
// this.updateConnections();
// }
// @MENetworkEventSubscribe
// public void changeStateC( final MENetworkPowerStatusChange bs )
// {
// this.updateConnections();
// }
//
// @Override
// @SideOnly( Side.CLIENT )
// public IIcon getTypeTexture()
// {
// return Items.get( "adapter" ).block().getBlockTextureFromSide( 2 );
// }
// @Override
// @SideOnly( Side.CLIENT )
// public IIcon getTypeTexture()
// {
// return Items.get( "adapter" ).block().getBlockTextureFromSide( 2 );
// }
//
// @Override
// public void removeFromWorld()
// {
// super.removeFromWorld();
// if( this.node != null )
// {
// this.node.remove();
// }
// }
// @Override
// public void removeFromWorld()
// {
// super.removeFromWorld();
// if( this.node != null )
// {
// this.node.remove();
// }
// }
//
// @Override
// public void onTunnelNetworkChange()
// {
// this.updateConnections();
// }
// @Override
// public void onTunnelNetworkChange()
// {
// this.updateConnections();
// }
//
// @Override
// public void readFromNBT( final NBTTagCompound data )
// {
// super.readFromNBT( data );
// if( this.node != null )
// {
// this.node.load( data );
// }
// }
// @Override
// public void readFromNBT( final NBTTagCompound data )
// {
// super.readFromNBT( data );
// if( this.node != null )
// {
// this.node.load( data );
// }
// }
//
// @Override
// public void writeToNBT( final NBTTagCompound data )
// {
// super.writeToNBT( data );
// if( this.node != null )
// {
// this.node.save( data );
// }
// }
// @Override
// public void writeToNBT( final NBTTagCompound data )
// {
// super.writeToNBT( data );
// if( this.node != null )
// {
// this.node.save( data );
// }
// }
//
// private void updateConnections()
// {
// if( this.getProxy().isPowered() && this.getProxy().isActive() )
// {
// // Make sure we're connected to existing OC nodes in the world.
// Network.joinOrCreateNetwork( this.getTile() );
// private void updateConnections()
// {
// if( this.getProxy().isPowered() && this.getProxy().isActive() )
// {
// // Make sure we're connected to existing OC nodes in the world.
// Network.joinOrCreateNetwork( this.getTile() );
//
// if( this.isOutput() && this.getInput() != null && this.node != null )
// {
// Network.joinOrCreateNetwork( this.getInput().getTile() );
// this.node.connect( this.getInput().node() );
// }
// }
// else if( this.node != null )
// {
// this.node.remove();
// }
// }
// if( this.isOutput() && this.getInput() != null && this.node != null )
// {
// Network.joinOrCreateNetwork( this.getInput().getTile() );
// this.node.connect( this.getInput().node() );
// }
// }
// else if( this.node != null )
// {
// this.node.remove();
// }
// }
//
// @Nullable
// @Override
// public Node node()
// {
// return this.node;
// }
// @Nullable
// @Override
// public Node node()
// {
// return this.node;
// }
//
// @Override
// public void onConnect( final Node node )
// {
// }
// @Override
// public void onConnect( final Node node )
// {
// }
//
// @Override
// public void onDisconnect( final Node node )
// {
// }
// @Override
// public void onDisconnect( final Node node )
// {
// }
//
// @Override
// public void onMessage( final Message message )
// {
// }
// @Override
// public void onMessage( final Message message )
// {
// }
//
// @Nullable
// @Override
// public Node sidedNode( final ForgeDirection side )
// {
// return side == this.getSide() ? this.node : null;
// }
// @Nullable
// @Override
// public Node sidedNode( final ForgeDirection side )
// {
// return side == this.getSide() ? this.node : null;
// }
//
// @Override
// public boolean canConnect( final ForgeDirection side )
// {
// return side == this.getSide();
// }
//}
// @Override
// public boolean canConnect( final ForgeDirection side )
// {
// return side == this.getSide();
// }
// }
@@ -18,6 +18,7 @@
package appeng.parts.p2p;
import java.util.List;
import java.util.Stack;
@@ -27,7 +28,6 @@ import cofh.redstoneflux.api.IEnergyReceiver;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import appeng.api.config.PowerUnits;
import appeng.integration.IntegrationType;
import appeng.me.GridAccessException;
@@ -141,7 +141,8 @@ public final class PartP2PRFPower extends PartP2PTunnel<PartP2PRFPower> implemen
if( !this.cachedTarget )
{
TileEntity self = this.getTile();
TileEntity te = self.getWorld().getTileEntity( new BlockPos( self.getPos().getX() + this.getSide().xOffset, self.getPos().getY() + this.getSide().yOffset, self.getPos().getZ() + this.getSide().zOffset ) );
TileEntity te = self.getWorld().getTileEntity( new BlockPos( self.getPos().getX() + this.getSide().xOffset, self.getPos()
.getY() + this.getSide().yOffset, self.getPos().getZ() + this.getSide().zOffset ) );
this.outputTarget = te instanceof IEnergyReceiver ? (IEnergyReceiver) te : null;
this.cachedTarget = true;
}
@@ -211,4 +212,4 @@ public final class PartP2PRFPower extends PartP2PTunnel<PartP2PRFPower> implemen
{
return true;
}
}
}
@@ -127,7 +127,8 @@ public class PartConversionMonitor extends AbstractPartMonitor
else
{
final IAEItemStack failedToInsert = Platform.poweredInsert( energy, cell, input, new PlayerSource( player, this ) );
player.inventory.setInventorySlotContents( player.inventory.currentItem, failedToInsert == null ? ItemStack.EMPTY : failedToInsert.getItemStack() );
player.inventory.setInventorySlotContents( player.inventory.currentItem,
failedToInsert == null ? ItemStack.EMPTY : failedToInsert.getItemStack() );
}
}
catch( final GridAccessException e )
@@ -44,9 +44,9 @@ public class PartCraftingTerminal extends AbstractPartTerminal
@PartModels
public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/crafting_terminal_on" );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
private final AppEngInternalInventory craftingGrid = new AppEngInternalInventory( this, 9 );
@@ -49,8 +49,8 @@ public class PartPatternTerminal extends AbstractPartTerminal
public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/pattern_terminal_on" );
public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF );
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON ) ;
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL ) ;
public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON );
public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL );
private final AppEngInternalInventory crafting = new AppEngInternalInventory( this, 9 );
private final AppEngInternalInventory output = new AppEngInternalInventory( this, 3 );