Added Bottom Texture for Coal Generator & Oil Generator

This commit is contained in:
Ellpeck 2015-07-02 01:26:37 +02:00
parent 0030adb2b0
commit cdcf20845b
7 changed files with 27 additions and 17 deletions

View file

@ -25,6 +25,7 @@ import java.util.Random;
public class BlockCoalGenerator extends BlockContainerBase implements INameableItem{ public class BlockCoalGenerator extends BlockContainerBase implements INameableItem{
private IIcon topIcon; private IIcon topIcon;
private IIcon bottomIcon;
public BlockCoalGenerator(){ public BlockCoalGenerator(){
super(Material.rock); super(Material.rock);
@ -58,7 +59,7 @@ public class BlockCoalGenerator extends BlockContainerBase implements INameableI
@Override @Override
public IIcon getIcon(int side, int meta){ public IIcon getIcon(int side, int meta){
return side <= 1 ? this.topIcon : this.blockIcon; return side <= 1 ? (side == 0 ? this.bottomIcon : this.topIcon) : this.blockIcon;
} }
@Override @Override
@ -66,6 +67,7 @@ public class BlockCoalGenerator extends BlockContainerBase implements INameableI
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom");
} }
@Override @Override

View file

@ -25,6 +25,7 @@ import java.util.Random;
public class BlockOilGenerator extends BlockContainerBase implements INameableItem{ public class BlockOilGenerator extends BlockContainerBase implements INameableItem{
private IIcon topIcon; private IIcon topIcon;
private IIcon bottomIcon;
public BlockOilGenerator(){ public BlockOilGenerator(){
super(Material.rock); super(Material.rock);
@ -58,7 +59,7 @@ public class BlockOilGenerator extends BlockContainerBase implements INameableIt
@Override @Override
public IIcon getIcon(int side, int meta){ public IIcon getIcon(int side, int meta){
return side <= 1 ? this.topIcon : this.blockIcon; return side <= 1 ? (side == 0 ? this.bottomIcon : this.topIcon) : this.blockIcon;
} }
@Override @Override
@ -66,6 +67,7 @@ public class BlockOilGenerator extends BlockContainerBase implements INameableIt
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName());
this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top");
this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom");
} }
@Override @Override

View file

@ -54,8 +54,9 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
WorldUtil.fillBucket(tank, slots, 1, 2); WorldUtil.fillBucket(tank, slots, 1, 2);
if(this.tank.getFluidAmount() > 0 && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ if(this.tank.getFluidAmount() > 0){
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank); WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank);
if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, 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.EAST, this.tank);
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, this.tank); WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, this.tank);
@ -63,6 +64,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE
} }
} }
} }
}
public boolean isCanola(int slot){ public boolean isCanola(int slot){
return this.slots[slot] != null && this.slots[slot].getItem() == InitItems.itemMisc && this.slots[slot].getItemDamage() == TheMiscItems.CANOLA.ordinal(); return this.slots[slot] != null && this.slots[slot].getItem() == InitItems.itemMisc && this.slots[slot].getItemDamage() == TheMiscItems.CANOLA.ordinal();

View file

@ -44,8 +44,9 @@ 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 && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ if(this.oilTank.getFluidAmount() > 0){
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.oilTank); WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.oilTank);
if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, 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.EAST, this.oilTank);
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, this.oilTank); WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, this.oilTank);
@ -53,6 +54,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen
} }
} }
} }
}
@Override @Override
public void writeToNBT(NBTTagCompound compound){ public void writeToNBT(NBTTagCompound compound){

View file

@ -139,13 +139,15 @@ 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.isPlacer && this.tank.getFluidAmount() > 0 && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ if(!this.isPlacer && this.tank.getFluidAmount() > 0){
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank); WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank);
if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.NORTH, 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.EAST, this.tank);
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, this.tank); WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.SOUTH, this.tank);
WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.WEST, this.tank); WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.WEST, this.tank);
} }
}
if(amountBefore != this.tank.getFluidAmount()){ if(amountBefore != this.tank.getFluidAmount()){
this.sendPacket(); this.sendPacket();

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B