2013-12-24 20:46:46 +01:00
|
|
|
package tconstruct.plugins.waila;
|
|
|
|
|
|
|
|
|
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
|
|
|
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
|
|
|
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
import net.minecraftforge.fluids.FluidStack;
|
|
|
|
|
import tconstruct.blocks.logic.CastingBasinLogic;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class BasinDataProvider implements IWailaDataProvider {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
|
|
|
|
if (accessor.getTileEntity() instanceof CastingBasinLogic)
|
|
|
|
|
{
|
|
|
|
|
return ((CastingBasinLogic)accessor.getTileEntity()).getStackInSlot(0);
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
|
|
|
|
return currenttip;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
2013-12-25 00:24:02 +01:00
|
|
|
if (accessor.getTileEntity() instanceof CastingBasinLogic && config.getConfig("tcon.basin", true))
|
2013-12-24 20:46:46 +01:00
|
|
|
{
|
|
|
|
|
CastingBasinLogic te = (CastingBasinLogic)accessor.getTileEntity();
|
|
|
|
|
if (te.getFluidAmount() != 0)
|
|
|
|
|
{
|
|
|
|
|
FluidStack fs = te.getFluid();
|
|
|
|
|
currenttip.add("Liquid: " + WailaRegistrar.fluidNameHelper(fs));
|
|
|
|
|
currenttip.add("Amount: " + fs.amount + "/" + te.getCapacity());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-12-24 23:38:14 +01:00
|
|
|
if (te.getStackInSlot(0) != null) {
|
|
|
|
|
currenttip.add("Contains: " + te.getStackInSlot(0).getDisplayName());
|
|
|
|
|
} else {
|
|
|
|
|
currenttip.add("§oEmpty"); // "§o" == Italics
|
|
|
|
|
}
|
2013-12-24 20:46:46 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return currenttip;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|