-Made fluid pushers be able to push Fluid in more directions if not powered

This commit is contained in:
Ellpeck 2015-07-02 01:14:22 +02:00
parent b8171f20b8
commit 0030adb2b0
5 changed files with 19 additions and 7 deletions

View file

@ -168,7 +168,7 @@ public class BlockCrafting{
"CRC", "CBC", "CRC", "CRC", "CBC", "CRC",
'C', "cobblestone", 'C', "cobblestone",
'R', TheMiscBlocks.STONE_CASING.getOredictName(), 'R', TheMiscBlocks.STONE_CASING.getOredictName(),
'B', InitItems.itemBucketOil)); 'B', TheMiscItems.CANOLA.getOredictName()));
//Coal Generator //Coal Generator
if(ConfigCrafting.COAL_GENERATOR.isEnabled()) if(ConfigCrafting.COAL_GENERATOR.isEnabled())

View file

@ -16,7 +16,7 @@ public class TileEntityBase extends TileEntity{
public Packet getDescriptionPacket(){ public Packet getDescriptionPacket(){
NBTTagCompound tag = new NBTTagCompound(); NBTTagCompound tag = new NBTTagCompound();
this.writeToNBT(tag); this.writeToNBT(tag);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag); return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tag);
} }
@Override @Override

View file

@ -54,8 +54,12 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
WorldUtil.fillBucket(tank, slots, 1, 2); 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.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);
} }
} }
} }

View file

@ -44,8 +44,12 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitBlocks.fluidCanolaOil); WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitBlocks.fluidCanolaOil);
WorldUtil.fillBucket(oilTank, slots, 2, 3); 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.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 @Override
public boolean canExtractItem(int slot, ItemStack stack, int side){ 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 @Override

View file

@ -139,8 +139,12 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
if(!this.isPlacer) WorldUtil.fillBucket(tank, slots, 0, 1); if(!this.isPlacer) WorldUtil.fillBucket(tank, slots, 0, 1);
else WorldUtil.emptyBucket(tank, slots, 0, 1); else WorldUtil.emptyBucket(tank, slots, 0, 1);
if(this.tank.getFluidAmount() > 0 && !this.isPlacer){ if(!this.isPlacer && this.tank.getFluidAmount() > 0 && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.getOrientation(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)).getOpposite(), this.tank); 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()){ if(amountBefore != this.tank.getFluidAmount()){