diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java index 4c95c9d8c..a264aa895 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java @@ -39,18 +39,6 @@ public class BlockFurnaceSolar extends BlockContainerBase implements IActAddItem this.setBlockBounds(0F, 0F, 0F, 1F, 3F/16F, 1F); } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ - if(!world.isRemote){ - TileEntityFurnaceSolar generator = (TileEntityFurnaceSolar)world.getTileEntity(x, y, z); - if(generator != null){ - player.addChatComponentMessage(new ChatComponentText(generator.storage.getEnergyStored()+"/"+generator.storage.getMaxEnergyStored()+" RF")); - } - return true; - } - return true; - } - @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFurnaceSolar(); @@ -76,6 +64,18 @@ public class BlockFurnaceSolar extends BlockContainerBase implements IActAddItem return false; } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ + if(!world.isRemote){ + TileEntityFurnaceSolar generator = (TileEntityFurnaceSolar)world.getTileEntity(x, y, z); + if(generator != null){ + player.addChatComponentMessage(new ChatComponentText(generator.storage.getEnergyStored()+"/"+generator.storage.getMaxEnergyStored()+" RF")); + } + return true; + } + return true; + } + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomItemface.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomItemface.java index c2376ff34..7045d08f9 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomItemface.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomItemface.java @@ -40,40 +40,11 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return new int[0]; } - public ISidedInventory getSided(){ - return this.getInventory() instanceof ISidedInventory ? (ISidedInventory)this.getInventory() : null; - } - @Override public int getInventoryStackLimit(){ return this.isBoundThingInRange() ? this.getInventory().getInventoryStackLimit() : 0; } - @Override - public boolean isBoundThingInRange(){ - return super.isBoundThingInRange() && this.boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()) instanceof IInventory; - } - - public IInventory getInventory(){ - if(this.boundPosition != null && this.boundPosition.getWorld() != null){ - TileEntity tile = boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()); - if(tile instanceof IInventory){ - return (IInventory)tile; - } - } - return null; - } - - @Override - public boolean canInsertItem(int slot, ItemStack stack, int side){ - return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canInsertItem(slot, stack, side)); - } - - @Override - public boolean canExtractItem(int slot, ItemStack stack, int side){ - return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canExtractItem(slot, stack, side)); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return this.isBoundThingInRange() && this.getInventory().isItemValidForSlot(i, stack); @@ -112,4 +83,33 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return this.name; } + @Override + public boolean isBoundThingInRange(){ + return super.isBoundThingInRange() && this.boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()) instanceof IInventory; + } + + public ISidedInventory getSided(){ + return this.getInventory() instanceof ISidedInventory ? (ISidedInventory)this.getInventory() : null; + } + + public IInventory getInventory(){ + if(this.boundPosition != null && this.boundPosition.getWorld() != null){ + TileEntity tile = boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()); + if(tile instanceof IInventory){ + return (IInventory)tile; + } + } + return null; + } + + @Override + public boolean canInsertItem(int slot, ItemStack stack, int side){ + return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canInsertItem(slot, stack, side)); + } + + @Override + public boolean canExtractItem(int slot, ItemStack stack, int side){ + return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canExtractItem(slot, stack, side)); + } + }