blob: aa502439144089f5282e7e115603e98816f98661 (
plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
package gtPlusPlus.xmod.ic2.block.RTGGenerator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import gtPlusPlus.xmod.ic2.block.RTGGenerator.gui.CONTAINER_RTG;
import gtPlusPlus.xmod.ic2.block.RTGGenerator.gui.GUI_RTG;
import ic2.core.ContainerBase;
import ic2.core.Ic2Items;
import ic2.core.block.generator.tileentity.TileEntityRTGenerator;
import ic2.core.block.invslot.InvSlotConsumable;
import ic2.core.block.invslot.InvSlotConsumableId;
public class TileEntityRTG
extends TileEntityRTGenerator
{
public final InvSlotConsumable fuelSlot;
public TileEntityRTG()
{
this.fuelSlot = new InvSlotConsumableId(this, "fuelSlot", 0, 12, new Item[] { Ic2Items.RTGPellets.getItem() });
}
@Override
public int gaugeFuelScaled(final int i)
{
return i;
}
@Override
public boolean gainEnergy()
{
int counter = 0;
for (int i = 0; i < this.fuelSlot.size(); i++) {
if (this.fuelSlot.get(i) != null) {
counter++;
}
}
if (counter == 0) {
return false;
}
this.storage += (int)Math.pow(2.0D, counter - 1);
return true;
}
@Override
public boolean gainFuel()
{
return false;
}
@Override
public boolean needsFuel()
{
return true;
}
@Override
public String getInventoryName()
{
return "RTG";
}
@Override
public ContainerBase<TileEntityRTGenerator> getGuiContainer(final EntityPlayer entityPlayer)
{
return new CONTAINER_RTG(entityPlayer, this);
}
@Override
@SideOnly(Side.CLIENT)
public GuiScreen getGui(final EntityPlayer entityPlayer, final boolean isAdmin)
{
return new GUI_RTG(new CONTAINER_RTG(entityPlayer, this));
}
@Override
public boolean delayActiveUpdate()
{
return true;
}
}
|