From 0030adb2b04e964092678af93031f92ff48868da Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 2 Jul 2015 01:14:22 +0200 Subject: [PATCH] -Made fluid pushers be able to push Fluid in more directions if not powered --- .../ellpeck/actuallyadditions/crafting/BlockCrafting.java | 2 +- .../ellpeck/actuallyadditions/tile/TileEntityBase.java | 2 +- .../actuallyadditions/tile/TileEntityCanolaPress.java | 6 +++++- .../tile/TileEntityFermentingBarrel.java | 8 ++++++-- .../actuallyadditions/tile/TileEntityFluidCollector.java | 8 ++++++-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java index c4e8661dc..b8e39898e 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java @@ -168,7 +168,7 @@ public class BlockCrafting{ "CRC", "CBC", "CRC", 'C', "cobblestone", 'R', TheMiscBlocks.STONE_CASING.getOredictName(), - 'B', InitItems.itemBucketOil)); + 'B', TheMiscItems.CANOLA.getOredictName())); //Coal Generator if(ConfigCrafting.COAL_GENERATOR.isEnabled()) diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java index cc1160843..0ea846077 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java @@ -16,7 +16,7 @@ public class TileEntityBase extends TileEntity{ public Packet getDescriptionPacket(){ NBTTagCompound tag = new NBTTagCompound(); this.writeToNBT(tag); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tag); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java index b941c70ed..4fb755d34 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java @@ -54,8 +54,12 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE WorldUtil.fillBucket(tank, slots, 1, 2); - if(this.tank.getFluidAmount() > 0){ + if(this.tank.getFluidAmount() > 0 && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, this.tank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.EAST, this.tank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, this.tank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.WEST, this.tank); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java index 276bb5b47..d88556c17 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java @@ -44,8 +44,12 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitBlocks.fluidCanolaOil); WorldUtil.fillBucket(oilTank, slots, 2, 3); - if(this.oilTank.getFluidAmount() > 0){ + if(this.oilTank.getFluidAmount() > 0 && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.oilTank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, this.oilTank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.EAST, this.oilTank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, this.oilTank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.WEST, this.oilTank); } } } @@ -95,7 +99,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public boolean canExtractItem(int slot, ItemStack stack, int side){ - return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))); + return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitBlocks.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java index 0b2c0bc16..f8c0337b1 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java @@ -139,8 +139,12 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements if(!this.isPlacer) WorldUtil.fillBucket(tank, slots, 0, 1); else WorldUtil.emptyBucket(tank, slots, 0, 1); - if(this.tank.getFluidAmount() > 0 && !this.isPlacer){ - WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.getOrientation(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)).getOpposite(), this.tank); + if(!this.isPlacer && this.tank.getFluidAmount() > 0 && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, this.tank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.EAST, this.tank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, this.tank); + WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.WEST, this.tank); } if(amountBefore != this.tank.getFluidAmount()){