diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-27 01:34:08 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-27 01:34:08 +1000 |
commit | 072f6322fb789703f163030edf4b60bf5a0201af (patch) | |
tree | 9d2d9c2ba6fe3bc5139a9868ee4eca95629fdd95 /src/Java/miscutil/xmod/ic2/block/RTGGenerator/TileEntityRTG.java | |
parent | f555ac2e146e572155e176131c23e73cd74684f1 (diff) | |
download | GT5-Unofficial-072f6322fb789703f163030edf4b60bf5a0201af.tar.gz GT5-Unofficial-072f6322fb789703f163030edf4b60bf5a0201af.tar.bz2 GT5-Unofficial-072f6322fb789703f163030edf4b60bf5a0201af.zip |
+ Attempted to add custom IC2 generators.
% Refactored the xmod package to be a parent, beside core. No longer is it a child, it needs room to grow.
Diffstat (limited to 'src/Java/miscutil/xmod/ic2/block/RTGGenerator/TileEntityRTG.java')
-rw-r--r-- | src/Java/miscutil/xmod/ic2/block/RTGGenerator/TileEntityRTG.java | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/Java/miscutil/xmod/ic2/block/RTGGenerator/TileEntityRTG.java b/src/Java/miscutil/xmod/ic2/block/RTGGenerator/TileEntityRTG.java new file mode 100644 index 0000000000..f3b7949db2 --- /dev/null +++ b/src/Java/miscutil/xmod/ic2/block/RTGGenerator/TileEntityRTG.java @@ -0,0 +1,94 @@ +package miscutil.xmod.ic2.block.RTGGenerator; + +import ic2.core.ContainerBase; +import ic2.core.block.generator.tileentity.TileEntityBaseGenerator; +import ic2.core.block.invslot.InvSlot; +import miscutil.xmod.ic2.block.RTGGenerator.gui.CONTAINER_RadioThermalGenerator; +import miscutil.xmod.ic2.block.RTGGenerator.gui.GUI_RadioThermalGenerator; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; + +public class TileEntityRTG +extends TileEntityBaseGenerator +{ + public final InvSlot fuelSlot; + + public TileEntityRTG() + { + super(Math.round(16.0F * efficiency), 1, 20000); + + this.fuelSlot = this.invSlots.get(0); + } + + @Override + public int gaugeFuelScaled(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) * efficiency); + return true; + } + + @Override + public boolean gainFuel() + { + return false; + } + + @Override + public boolean needsFuel() + { + return true; + } + + @Override + public String getInventoryName() + { + return "RTGenerator"; + } + + + public Object getGui(EntityPlayer player, int data) + { + return new GUI_RadioThermalGenerator(this, player); + } + + + public Object getGuiContainer(EntityPlayer player, int data) + { + return new CONTAINER_RadioThermalGenerator(this, player); + } + + @Override + public boolean delayActiveUpdate() + { + return true; + } + + private static final float efficiency = 100; + + @Override + public GuiScreen getGui(EntityPlayer arg0, boolean arg1) { + getGui(arg0, 1); + return null; + } + + @Override + public ContainerBase<?> getGuiContainer(EntityPlayer arg0) { + getGuiContainer(arg0, 1); + return null; + } +} |