-
Notifications
You must be signed in to change notification settings - Fork 755
/
SmelteryDataProvider.java
64 lines (55 loc) · 1.95 KB
/
SmelteryDataProvider.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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.SmelteryLogic;
import java.util.List;
public class SmelteryDataProvider implements IWailaDataProvider
{
@Override
public ItemStack getWailaStack (IWailaDataAccessor accessor, IWailaConfigHandler config)
{
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)
{
if (accessor.getTileEntity() instanceof SmelteryLogic && config.getConfig("tcon.smeltery", true))
{
SmelteryLogic te = (SmelteryLogic) accessor.getTileEntity();
if (te.validStructure)
{
List<FluidStack> fls = te.moltenMetal;
if (fls.size() <= 0)
{
currenttip.add("§oEmpty"); // "§o" == Italics
}
else
{
for (int i = 0; i < fls.size(); i++)
{
FluidStack st = fls.get(i);
currenttip.add(WailaRegistrar.fluidNameHelper(st) + " (" + st.amount + "mB)");
}
}
}
else
{
currenttip.add("§oInvalid structure");
}
}
return currenttip;
}
@Override
public List<String> getWailaTail (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
{
return currenttip;
}
}