Removed 2 PreInits, added waila support

This commit is contained in:
modmuss50 2015-04-12 11:39:06 +01:00
parent 6f75bd48e0
commit ee14540196
9 changed files with 147 additions and 21 deletions

View file

@ -0,0 +1,15 @@
package techreborn.tiles;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import java.util.List;
public class TileMachineBase extends TileEntity {
@SideOnly(Side.CLIENT)
public void addWailaInfo(List<String> info) {
}
}

View file

@ -14,8 +14,10 @@ import techreborn.util.FluidUtils;
import techreborn.util.Inventory;
import techreborn.util.ItemUtils;
import java.util.List;
public class TileQuantumChest extends TileEntity implements IInventory ,IWrenchable{
public class TileQuantumChest extends TileMachineBase implements IInventory ,IWrenchable{
//Slot 0 = Input
//Slot 1 = Output
@ -214,4 +216,13 @@ public class TileQuantumChest extends TileEntity implements IInventory ,IWrencha
return dropStack;
}
@Override
public void addWailaInfo(List<String> info) {
super.addWailaInfo(info);
if(storedItem != null){
info.add(storedItem.stackSize + " of " + storedItem.getItem().getItemStackDisplayName(storedItem));
} else {
info.add("Empty");
}
}
}

View file

@ -19,7 +19,9 @@ import techreborn.util.FluidUtils;
import techreborn.util.Inventory;
import techreborn.util.Tank;
public class TileQuantumTank extends TileEntity implements IFluidHandler, IInventory, IWrenchable {
import java.util.List;
public class TileQuantumTank extends TileMachineBase implements IFluidHandler, IInventory, IWrenchable {
public Tank tank = new Tank("TileQuantumTank", Integer.MAX_VALUE, this);
public Inventory inventory = new Inventory(3, "TileQuantumTank", 64);
@ -200,4 +202,14 @@ public class TileQuantumTank extends TileEntity implements IFluidHandler, IInven
dropStack.stackTagCompound.setTag("tileEntity", tileEntity);
return dropStack;
}
@Override
public void addWailaInfo(List<String> info) {
super.addWailaInfo(info);
if(tank.getFluid() != null){
info.add(tank.getFluidAmount() + " of " + tank.getFluidType().getName());
} else {
info.add("Empty");
}
}
}