Compare commits

..

17 Commits

Author SHA1 Message Date
yueh 0ee2ca72ac Merge pull request #1206 from yueh/fix-1068
Stops AEBaseItemBlock from modifying the metadata before placing.
2015-04-05 20:47:31 +02:00
thatsIch 881bb919da Merge pull request #1205 from thatsIch/b-npe-on-random-smashing-button
Fixes NPE on random button smashing
2015-04-05 20:18:10 +02:00
thatsIch 5ecd68d5b6 Merge pull request #1209 from thatsIch/b-integration-with-gradle
Fixes integration bug for Resources between Gradle and IntelliJ, does not affect Eclipse
2015-04-05 20:18:03 +02:00
thatsIch e2d0e5d424 Dont use instance reference for static references 2015-04-05 15:59:23 +02:00
thatsIch e3bf7d63c0 Split one liner declarations 2015-04-05 15:57:37 +02:00
thatsIch 3fedcf273b Remove random semicolons 2015-04-05 15:56:10 +02:00
thatsIch 8042dbb3db Fixes integration bug for Resources between Gradle and IntelliJ, does not affect Eclipse 2015-04-05 15:25:26 +02:00
yueh e7e397c412 Stops AEBaseItemBlock from modifying the metadata before placing. 2015-04-05 14:01:42 +02:00
thatsIch ecc472a692 Fixes NPE on random button smashing 2015-04-05 13:07:19 +02:00
thatsIch 9790d9fd93 Merge pull request #1187 from thatsIch/b-1059-fmp-disables-interfaces
Fixes #1059 FMP like TileEntities are not valid Interface targets anymore
2015-04-04 14:55:21 +02:00
yueh f3f89344b4 Merge pull request #1192 from yueh/fix-1191
Moved AEBaseBlock.setFeature() to the end of any constructor.
2015-04-04 14:40:35 +02:00
thatsIch bac94b67b8 Merge pull request #1199 from thatsIch/b-skychest-invtweaks-interaction
Fixes interaction bug between Sky Stone Chest and Inventory Tweaks
2015-04-04 14:33:06 +02:00
thatsIch ba1afcca38 Merge pull request #1198 from thatsIch/e-1197-ae-vibration
Fixes #1197 Vibration Chamber does produce AE, not ae
2015-04-04 14:32:54 +02:00
thatsIch bb1c341c95 Fixes #1059 FMP Blocks don't disturb the ME Interface identifier 2015-04-04 14:32:17 +02:00
thatsIch 2ef04f1303 Fixes interaction bug between Sky Stone Chest and Inventory Tweaks upon sort via space + click 2015-04-04 12:56:42 +02:00
thatsIch 632d048ee2 Fixes #1197 Vibration Chamber does produce AE, not ae 2015-04-04 12:26:15 +02:00
yueh adea6b3dec Moved AEBaseBlock.setFeature() to the end of any constructor.
Otherwise it can cause a registration of incomplete blocks, like missing
subtypes.
2015-04-04 01:31:51 +02:00
51 changed files with 118 additions and 113 deletions
+3
View File
@@ -103,6 +103,9 @@ sourceSets {
"assets/appliedenergistics2/textures/models/*",
"assets/appliedenergistics2/textures/items/*"
}
// IntelliJ and Gradle interaction bug
output.resourcesDir = output.classesDir
}
}
@@ -162,8 +162,6 @@ public class AEBaseItemBlock extends ItemBlock
forward = ForgeDirection.SOUTH;
if( up.offsetY == 0 )
forward = ForgeDirection.UP;
ori.setOrientation( forward, up );
}
if( !this.blockType.isValidOrientation( w, x, y, z, forward, up ) )
@@ -46,10 +46,10 @@ public class BlockMolecularAssembler extends AEBaseBlock
public BlockMolecularAssembler()
{
super( BlockMolecularAssembler.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.MolecularAssembler ) );
this.setTileEntity( TileMolecularAssembler.class );
this.isOpaque = false;
this.lightOpacity = 1;
this.setFeature( EnumSet.of( AEFeature.MolecularAssembler ) );
}
@Override
@@ -47,11 +47,11 @@ public class BlockCrank extends AEBaseBlock
public BlockCrank()
{
super( BlockCrank.class, Material.wood );
this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
this.setTileEntity( TileCrank.class );
this.setLightOpacity( 0 );
this.setHarvestLevel( "axe", 0 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
}
@Override
@@ -39,9 +39,9 @@ public class BlockGrinder extends AEBaseBlock
public BlockGrinder()
{
super( BlockGrinder.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
this.setTileEntity( TileGrinder.class );
this.setHardness( 3.2F );
this.setFeature( EnumSet.of( AEFeature.GrindStone ) );
}
@Override
@@ -39,8 +39,8 @@ public class BlockCellWorkbench extends AEBaseBlock
public BlockCellWorkbench()
{
super( BlockCellWorkbench.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.StorageCells ) );
this.setTileEntity( TileCellWorkbench.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells ) );
}
@Override
@@ -55,10 +55,10 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
public BlockCharger()
{
super( BlockCharger.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setTileEntity( TileCharger.class );
this.setLightOpacity( 2 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
@@ -39,8 +39,8 @@ public class BlockCondenser extends AEBaseBlock
public BlockCondenser()
{
super( BlockCondenser.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setTileEntity( TileCondenser.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
@@ -41,10 +41,10 @@ public class BlockInscriber extends AEBaseBlock
public BlockInscriber()
{
super( BlockInscriber.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.Inscriber ) );
this.setTileEntity( TileInscriber.class );
this.setLightOpacity( 2 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.Inscriber ) );
}
@Override
@@ -42,8 +42,8 @@ public class BlockInterface extends AEBaseBlock
public BlockInterface()
{
super( BlockInterface.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setTileEntity( TileInterface.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
@@ -38,8 +38,8 @@ public class BlockLightDetector extends BlockQuartzTorch
public BlockLightDetector()
{
super( BlockLightDetector.class );
this.setFeature( EnumSet.of( AEFeature.LightDetector ) );
this.setTileEntity( TileLightDetector.class );
this.setFeature( EnumSet.of( AEFeature.LightDetector ) );
}
@Override
@@ -50,11 +50,11 @@ public class BlockPaint extends AEBaseBlock
public BlockPaint()
{
super( BlockPaint.class, new MaterialLiquid( MapColor.airColor ) );
this.setFeature( EnumSet.of( AEFeature.PaintBalls ) );
this.setTileEntity( TilePaint.class );
this.setLightOpacity( 0 );
this.isFullSize = false;
this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.PaintBalls ) );
}
@Override
@@ -53,8 +53,8 @@ public class BlockQuartzGrowthAccelerator extends AEBaseBlock implements IOrient
{
super( BlockQuartzGrowthAccelerator.class, Material.rock );
this.setStepSound( Block.soundTypeMetal );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setTileEntity( TileQuartzGrowthAccelerator.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
@@ -55,8 +55,8 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
public BlockQuartzTorch()
{
this( BlockQuartzTorch.class );
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
this.setLightLevel( 0.9375F );
this.setFeature( EnumSet.of( AEFeature.DecorativeLights ) );
}
protected BlockQuartzTorch( Class which )
@@ -41,8 +41,8 @@ public class BlockSecurity extends AEBaseBlock
public BlockSecurity()
{
super( BlockSecurity.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.Security ) );
this.setTileEntity( TileSecurity.class );
this.setFeature( EnumSet.of( AEFeature.Security ) );
}
@Override
@@ -50,10 +50,10 @@ public class BlockSkyCompass extends AEBaseBlock implements ICustomCollision
public BlockSkyCompass()
{
super( BlockSkyCompass.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.MeteoriteCompass ) );
this.setTileEntity( TileSkyCompass.class );
this.isOpaque = this.isFullSize = false;
this.lightOpacity = 0;
this.setFeature( EnumSet.of( AEFeature.MeteoriteCompass ) );
}
@Override
@@ -59,12 +59,12 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
public BlockTinyTNT()
{
super( BlockTinyTNT.class, Material.tnt );
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
this.setLightOpacity( 1 );
this.setBlockBounds( 0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f );
this.isFullSize = this.isOpaque = false;
this.setStepSound( soundTypeGrass );
this.setHardness( 0F );
this.setFeature( EnumSet.of( AEFeature.TinyTNT ) );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.TINY_TNT, AppEng.instance, 16, 4, true );
}
@@ -45,9 +45,9 @@ public class BlockVibrationChamber extends AEBaseBlock
public BlockVibrationChamber()
{
super( BlockVibrationChamber.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.PowerGen ) );
this.setTileEntity( TileVibrationChamber.class );
this.setHardness( 4.2F );
this.setFeature( EnumSet.of( AEFeature.PowerGen ) );
}
@Override
@@ -92,9 +92,9 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
public BlockCableBus()
{
super( BlockCableBus.class, AEGlassMaterial.INSTANCE );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
@@ -38,9 +38,9 @@ public class BlockController extends AEBaseBlock
public BlockController()
{
super( BlockController.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.Channels ) );
this.setTileEntity( TileController.class );
this.setHardness( 6 );
this.setFeature( EnumSet.of( AEFeature.Channels ) );
}
@Override
@@ -33,7 +33,7 @@ public class BlockCreativeEnergyCell extends AEBaseBlock
public BlockCreativeEnergyCell()
{
super( BlockCreativeEnergyCell.class, AEGlassMaterial.INSTANCE );
this.setFeature( EnumSet.of( AEFeature.Creative ) );
this.setTileEntity( TileCreativeEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.Creative ) );
}
}
@@ -34,8 +34,8 @@ public class BlockDenseEnergyCell extends BlockEnergyCell
public BlockDenseEnergyCell()
{
super( BlockDenseEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) );
this.setTileEntity( TileDenseEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.DenseEnergyCells ) );
}
@Override
@@ -34,7 +34,7 @@ public class BlockEnergyAcceptor extends AEBaseBlock
public BlockEnergyAcceptor()
{
super( BlockEnergyAcceptor.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setTileEntity( TileEnergyAcceptor.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
}
@@ -49,8 +49,8 @@ public class BlockEnergyCell extends AEBaseBlock
public BlockEnergyCell()
{
this( BlockEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setTileEntity( TileEnergyCell.class );
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
public BlockEnergyCell( Class c )
@@ -46,11 +46,11 @@ public class BlockWireless extends AEBaseBlock implements ICustomCollision
public BlockWireless()
{
super( BlockWireless.class, AEGlassMaterial.INSTANCE );
this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.WirelessAccessTerminal ) );
this.setTileEntity( TileWireless.class );
this.setLightOpacity( 0 );
this.isFullSize = false;
this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.WirelessAccessTerminal ) );
}
@Override
@@ -53,12 +53,12 @@ public class BlockQuantumLinkChamber extends AEBaseBlock implements ICustomColli
public BlockQuantumLinkChamber()
{
super( BlockQuantumLinkChamber.class, AEGlassMaterial.INSTANCE );
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 0 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
}
@Override
@@ -43,12 +43,12 @@ public class BlockQuantumRing extends AEBaseBlock implements ICustomCollision
public BlockQuantumRing()
{
super( BlockQuantumRing.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
this.setTileEntity( TileQuantumBridge.class );
float shave = 2.0f / 16.0f;
this.setBlockBounds( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 1 );
this.isFullSize = this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.QuantumNetworkBridge ) );
}
@Override
@@ -45,9 +45,9 @@ public class BlockQuartzGlass extends AEBaseBlock
public BlockQuartzGlass( Class c )
{
super( c, Material.glass );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
this.setLightOpacity( 0 );
this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
}
@Override
@@ -40,9 +40,9 @@ public class BlockQuartzLamp extends BlockQuartzGlass
public BlockQuartzLamp()
{
super( BlockQuartzLamp.class );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
this.setLightLevel( 1.0f );
this.setBlockTextureName( "BlockQuartzGlass" );
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks, AEFeature.DecorativeLights ) );
}
@Override
@@ -72,11 +72,12 @@ public class BlockSkyStone extends AEBaseBlock implements IOrientableBlock
public BlockSkyStone()
{
super( BlockSkyStone.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setHardness( 50 );
this.hasSubtypes = true;
this.blockResistance = 150.0f;
this.setHarvestLevel( "pickaxe", 3, 0 );
this.setFeature( EnumSet.of( AEFeature.Core ) );
MinecraftForge.EVENT_BUS.register( this );
}
@@ -53,12 +53,12 @@ public class OreQuartz extends AEBaseBlock
public OreQuartz( Class<? extends OreQuartz> self )
{
super( self, Material.rock );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setHardness( 3.0F );
this.setResistance( 5.0F );
this.boostBrightnessLow = 0;
this.boostBrightnessHigh = 1;
this.enhanceBrightness = false;
this.setFeature( EnumSet.of( AEFeature.Core ) );
}
@Override
@@ -50,11 +50,11 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
public BlockMatrixFrame()
{
super( BlockMatrixFrame.class, Material.anvil );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
this.setResistance( 6000000.0F );
this.setBlockUnbreakable();
this.setLightOpacity( 0 );
this.isOpaque = false;
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
}
@Override
@@ -40,8 +40,8 @@ public class BlockSpatialIOPort extends AEBaseBlock
public BlockSpatialIOPort()
{
super( BlockSpatialIOPort.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
this.setTileEntity( TileSpatialIOPort.class );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
}
@Override
@@ -39,8 +39,8 @@ public class BlockSpatialPylon extends AEBaseBlock
public BlockSpatialPylon()
{
super( BlockSpatialPylon.class, AEGlassMaterial.INSTANCE );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
this.setTileEntity( TileSpatialPylon.class );
this.setFeature( EnumSet.of( AEFeature.SpatialIO ) );
}
@Override
@@ -45,8 +45,8 @@ public class BlockChest extends AEBaseBlock
public BlockChest()
{
super( BlockChest.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) );
this.setTileEntity( TileChest.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEChest ) );
}
@Override
@@ -41,8 +41,8 @@ public class BlockDrive extends AEBaseBlock
public BlockDrive()
{
super( BlockDrive.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) );
this.setTileEntity( TileDrive.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.MEDrive ) );
}
@Override
@@ -40,8 +40,8 @@ public class BlockIOPort extends AEBaseBlock
public BlockIOPort()
{
super( BlockIOPort.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) );
this.setTileEntity( TileIOPort.class );
this.setFeature( EnumSet.of( AEFeature.StorageCells, AEFeature.IOPort ) );
}
@Override
@@ -58,13 +58,13 @@ public class BlockSkyChest extends AEBaseBlock implements ICustomCollision
public BlockSkyChest()
{
super( BlockSkyChest.class, Material.rock );
this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) );
this.setTileEntity( TileSkyChest.class );
this.isOpaque = this.isFullSize = false;
this.lightOpacity = 0;
this.hasSubtypes = true;
this.setHardness( 50 );
this.blockResistance = 150.0f;
this.setFeature( EnumSet.of( AEFeature.Core, AEFeature.SkyStoneChests ) );
}
@Override
@@ -62,7 +62,7 @@ public class GuiVibrationChamber extends AEBaseGui
int k = 25;
int l = -15;
this.pb.setFullMsg( this.cvc.aePerTick * this.cvc.getCurrentProgress() / 100 + " ae/t" );
this.pb.setFullMsg( this.cvc.aePerTick * this.cvc.getCurrentProgress() / 100 + " AE/t" );
if( this.cvc.getCurrentProgress() > 0 )
{
@@ -348,14 +348,7 @@ public abstract class AEBaseContainer extends Container
protected void bindPlayerInventory( InventoryPlayer inventoryPlayer, int offset_x, int offset_y )
{
for( int i = 0; i < 9; i++ )
{
if( this.locked.contains( i ) )
this.addSlotToContainer( new SlotDisabled( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) );
else
this.addSlotToContainer( new SlotPlayerHotBar( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) );
}
// bind player inventory
for( int i = 0; i < 3; i++ )
{
for( int j = 0; j < 9; j++ )
@@ -366,6 +359,15 @@ public abstract class AEBaseContainer extends Container
this.addSlotToContainer( new SlotPlayerInv( inventoryPlayer, j + i * 9 + 9, 8 + j * 18 + offset_x, offset_y + i * 18 ) );
}
}
// bind player hotbar
for( int i = 0; i < 9; i++ )
{
if( this.locked.contains( i ) )
this.addSlotToContainer( new SlotDisabled( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) );
else
this.addSlotToContainer( new SlotPlayerHotBar( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) );
}
}
@Override
@@ -54,17 +54,17 @@ import appeng.util.inv.AdaptorPlayerHand;
import appeng.util.inv.WrapperInvSlot;
public class ContainerInterfaceTerminal extends AEBaseContainer
public final class ContainerInterfaceTerminal extends AEBaseContainer
{
/**
* this stuff is all server side..
*/
static private long autoBase = Long.MIN_VALUE;
private static long autoBase = Long.MIN_VALUE;
final Map<IInterfaceHost, InvTracker> diList = new HashMap<IInterfaceHost, InvTracker>();
final Map<Long, InvTracker> byId = new HashMap<Long, InvTracker>();
IGrid g;
IGrid grid;
NBTTagCompound data = new NBTTagCompound();
public ContainerInterfaceTerminal( InventoryPlayer ip, PartMonitor anchor )
@@ -72,7 +72,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
super( ip, anchor );
if( Platform.isServer() )
this.g = anchor.getActionableNode().getGrid();
this.grid = anchor.getActionableNode().getGrid();
this.bindPlayerInventory( ip, 0, 222 - /* height of player inventory */82 );
}
@@ -85,7 +85,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
super.detectAndSendChanges();
if( this.g == null )
if( this.grid == null )
return;
int total = 0;
@@ -97,7 +97,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
IGridNode agn = host.getActionableNode();
if( agn != null && agn.isActive() )
{
for( IGridNode gn : this.g.getMachines( TileInterface.class ) )
for( IGridNode gn : this.grid.getMachines( TileInterface.class ) )
{
if( gn.isActive() )
{
@@ -120,7 +120,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
}
}
for( IGridNode gn : this.g.getMachines( PartInterface.class ) )
for( IGridNode gn : this.grid.getMachines( PartInterface.class ) )
{
if( gn.isActive() )
{
@@ -289,7 +289,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
IGridNode agn = host.getActionableNode();
if( agn != null && agn.isActive() )
{
for( IGridNode gn : this.g.getMachines( TileInterface.class ) )
for( IGridNode gn : this.grid.getMachines( TileInterface.class ) )
{
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
DualityInterface dual = ih.getInterfaceDuality();
@@ -297,7 +297,7 @@ public class ContainerInterfaceTerminal extends AEBaseContainer
this.diList.put( ih, new InvTracker( dual, dual.getPatterns(), dual.getTermName() ) );
}
for( IGridNode gn : this.g.getMachines( PartInterface.class ) )
for( IGridNode gn : this.grid.getMachines( PartInterface.class ) )
{
IInterfaceHost ih = (IInterfaceHost) gn.getMachine();
DualityInterface dual = ih.getInterfaceDuality();
@@ -40,9 +40,9 @@ public class BlockChunkloader extends AEBaseBlock implements LoadingCallback
public BlockChunkloader()
{
super( BlockChunkloader.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
this.setTileEntity( TileChunkLoader.class );
ForgeChunkManager.setForcedChunkLoadingCallback( AppEng.instance, this );
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
}
@Override
@@ -36,8 +36,8 @@ public class BlockCubeGenerator extends AEBaseBlock
public BlockCubeGenerator()
{
super( BlockCubeGenerator.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
this.setTileEntity( TileCubeGenerator.class );
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
}
@Override
+1 -1
View File
@@ -34,8 +34,8 @@ public class BlockItemGen extends AEBaseBlock
public BlockItemGen()
{
super( BlockItemGen.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
this.setTileEntity( TileItemGen.class );
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
}
@Override
@@ -36,8 +36,8 @@ public class BlockPhantomNode extends AEBaseBlock
public BlockPhantomNode()
{
super( BlockPhantomNode.class, Material.iron );
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
this.setTileEntity( TilePhantomNode.class );
this.setFeature( EnumSet.of( AEFeature.UnsupportedDeveloperTools, AEFeature.Creative ) );
}
@Override
@@ -981,32 +981,28 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
public String getTermName()
{
TileEntity tile = this.iHost.getTileEntity();
World w = tile.getWorldObj();
final TileEntity hostTile = this.iHost.getTileEntity();
final World hostWorld = hostTile.getWorldObj();
if( ( (ICustomNameObject) this.iHost ).hasCustomName() )
return ( (ICustomNameObject) this.iHost ).getCustomName();
EnumSet<ForgeDirection> possibleDirections = this.iHost.getTargets();
for( ForgeDirection s : possibleDirections )
final EnumSet<ForgeDirection> possibleDirections = this.iHost.getTargets();
for( ForgeDirection direction : possibleDirections )
{
Vec3 from = Vec3.createVectorHelper( tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5 );
from = from.addVector( s.offsetX * 0.501, s.offsetY * 0.501, s.offsetZ * 0.501 );
Vec3 to = from.addVector( s.offsetX, s.offsetY, s.offsetZ );
final int xPos = hostTile.xCoord + direction.offsetX;
final int yPos = hostTile.yCoord + direction.offsetY;
final int zPos = hostTile.zCoord + direction.offsetZ;
final TileEntity directedTile = hostWorld.getTileEntity( xPos, yPos, zPos );
Block blk = w.getBlock( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ );
MovingObjectPosition mop = w.rayTraceBlocks( from, to, true );
TileEntity te = w.getTileEntity( tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ );
if( te == null )
if( directedTile == null )
continue;
if( te instanceof IInterfaceHost )
if( directedTile instanceof IInterfaceHost )
{
try
{
if( ( (IInterfaceHost) te ).getInterfaceDuality().sameGrid( this.gridProxy.getGrid() ) )
if( ( (IInterfaceHost) directedTile ).getInterfaceDuality().sameGrid( this.gridProxy.getGrid() ) )
continue;
}
catch( GridAccessException e )
@@ -1015,35 +1011,33 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
}
}
Item item = Item.getItemFromBlock( blk );
if( item == null )
final InventoryAdaptor adaptor = InventoryAdaptor.getAdaptor( directedTile, direction.getOpposite() );
if( directedTile instanceof ICraftingMachine || adaptor != null )
{
return blk.getUnlocalizedName();
}
ItemStack what = new ItemStack( item, 1, blk.getDamageValue( w, tile.xCoord + s.offsetX, tile.yCoord + s.offsetY, tile.zCoord + s.offsetZ ) );
if( te instanceof ICraftingMachine || InventoryAdaptor.getAdaptor( te, s.getOpposite() ) != null )
{
if( te instanceof IInventory && ( (IInventory) te ).getSizeInventory() == 0 )
if( directedTile instanceof IInventory && ( (IInventory) directedTile ).getSizeInventory() == 0 )
continue;
if( te instanceof ISidedInventory )
if( directedTile instanceof ISidedInventory )
{
int[] sides = ( (ISidedInventory) te ).getAccessibleSlotsFromSide( s.getOpposite().ordinal() );
int[] sides = ( (ISidedInventory) directedTile ).getAccessibleSlotsFromSide( direction.getOpposite().ordinal() );
if( sides == null || sides.length == 0 )
continue;
}
final Block directedBlock = hostWorld.getBlock( xPos, yPos, zPos );
ItemStack what = new ItemStack( directedBlock, 1, directedBlock.getDamageValue( hostWorld, xPos, yPos, zPos ) );
try
{
if( mop != null && !badBlocks.contains( blk ) )
Vec3 from = Vec3.createVectorHelper( hostTile.xCoord + 0.5, hostTile.yCoord + 0.5, hostTile.zCoord + 0.5 );
from = from.addVector( direction.offsetX * 0.501, direction.offsetY * 0.501, direction.offsetZ * 0.501 );
Vec3 to = from.addVector( direction.offsetX, direction.offsetY, direction.offsetZ );
MovingObjectPosition mop = hostWorld.rayTraceBlocks( from, to, true );
if( mop != null && !badBlocks.contains( directedBlock ) )
{
if( mop.blockX == te.xCoord && mop.blockY == te.yCoord && mop.blockZ == te.zCoord )
if( mop.blockX == directedTile.xCoord && mop.blockY == directedTile.yCoord && mop.blockZ == directedTile.zCoord )
{
ItemStack g = blk.getPickBlock( mop, w, te.xCoord, te.yCoord, te.zCoord, null );
ItemStack g = directedBlock.getPickBlock( mop, hostWorld, directedTile.xCoord, directedTile.yCoord, directedTile.zCoord, null );
if( g != null )
what = g;
}
@@ -1051,11 +1045,17 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
}
catch( Throwable t )
{
badBlocks.add( blk ); // nope!
badBlocks.add( directedBlock ); // nope!
}
if( what.getItem() != null )
return what.getUnlocalizedName();
Item item = Item.getItemFromBlock( directedBlock );
if( item == null )
{
return directedBlock.getUnlocalizedName();
}
}
}
@@ -301,19 +301,22 @@ public class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
if( stack.getItem() == this )
{
PartType pt = this.getTypeByStack( stack );
switch( pt )
if ( pt != null )
{
case ImportBus:
importBus = true;
if( u == pt )
group = true;
break;
case ExportBus:
exportBus = true;
if( u == pt )
group = true;
break;
default:
switch( pt )
{
case ImportBus:
importBus = true;
if( u == pt )
group = true;
break;
case ExportBus:
exportBus = true;
if( u == pt )
group = true;
break;
default:
}
}
}
}
@@ -116,7 +116,7 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
{
NBTTagCompound data = Platform.openNbtData( is );
double currentStorage = data.getDouble( this.POWER_NBT_KEY );
double currentStorage = data.getDouble( POWER_NBT_KEY );
double maxStorage = this.getAEMaxPower( is );
switch( op )
@@ -126,19 +126,19 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
if( currentStorage > maxStorage )
{
double diff = currentStorage - maxStorage;
data.setDouble( this.POWER_NBT_KEY, maxStorage );
data.setDouble( POWER_NBT_KEY, maxStorage );
return diff;
}
data.setDouble( this.POWER_NBT_KEY, currentStorage );
data.setDouble( POWER_NBT_KEY, currentStorage );
return 0;
case EXTRACT:
if( currentStorage > adjustment )
{
currentStorage -= adjustment;
data.setDouble( this.POWER_NBT_KEY, currentStorage );
data.setDouble( POWER_NBT_KEY, currentStorage );
return adjustment;
}
data.setDouble( this.POWER_NBT_KEY, 0 );
data.setDouble( POWER_NBT_KEY, 0 );
return currentStorage;
default:
break;
@@ -103,7 +103,6 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
private void updateHandler()
{
this.myHandler.setBaseAccess( AccessRestriction.WRITE );
;
this.myHandler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
this.myHandler.setPriority( this.priority );
@@ -508,6 +508,4 @@ public final class MeteoritePlacer
{
return this.settings;
}
;
}
@@ -12,7 +12,8 @@ public class ChunkOnly extends StandardWorld
{
final Chunk target;
final int cx, cz;
final int cx;
final int cz;
int verticalBits = 0;
public ChunkOnly( World w, int cx, int cz )