more PWR crap
@ -883,9 +883,9 @@ public class ModBlocks {
|
||||
public static Block pwr_neutron_source;
|
||||
public static Block pwr_reflector;
|
||||
public static Block pwr_casing;
|
||||
public static Block pwr_port;
|
||||
public static Block pwr_controller;
|
||||
public static Block pwr_block;
|
||||
public static Block pwr_port;
|
||||
|
||||
public static Block reactor_element;
|
||||
public static Block reactor_control;
|
||||
|
||||
@ -1,20 +1,29 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.ct.CT;
|
||||
import com.hbm.render.block.ct.CTStitchReceiver;
|
||||
import com.hbm.render.block.ct.IBlockCT;
|
||||
import com.hbm.tileentity.machine.TileEntityPWRController;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPWR extends Block implements IBlockCT {
|
||||
public class BlockPWR extends BlockContainer implements IBlockCT {
|
||||
|
||||
@SideOnly(Side.CLIENT) protected IIcon iconPort;
|
||||
|
||||
@ -26,6 +35,11 @@ public class BlockPWR extends Block implements IBlockCT {
|
||||
public int getRenderType() {
|
||||
return CT.renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT) public CTStitchReceiver rec;
|
||||
@SideOnly(Side.CLIENT) public CTStitchReceiver recPort;
|
||||
@ -49,4 +63,96 @@ public class BlockPWR extends Block implements IBlockCT {
|
||||
public boolean canConnect(IBlockAccess world, int x, int y, int z, Block block) {
|
||||
return block == ModBlocks.pwr_block || block == ModBlocks.pwr_controller;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityBlockPWR();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile instanceof TileEntityBlockPWR) {
|
||||
TileEntityBlockPWR pwr = (TileEntityBlockPWR) tile;
|
||||
world.removeTileEntity(x, y, z);
|
||||
if(pwr.block != null) {
|
||||
world.setBlock(x, y, z, pwr.block);
|
||||
TileEntity controller = world.getTileEntity(pwr.coreX, pwr.coreY, pwr.coreZ);
|
||||
|
||||
if(controller instanceof TileEntityPWRController) {
|
||||
((TileEntityPWRController) controller).assembled = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
public static class TileEntityBlockPWR extends TileEntity {
|
||||
|
||||
public Block block;
|
||||
public int coreX;
|
||||
public int coreY;
|
||||
public int coreZ;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0 && block != null) {
|
||||
|
||||
if(worldObj.getChunkProvider().chunkExists(coreX >> 4, coreZ >> 4)) {
|
||||
|
||||
TileEntity tile = worldObj.getTileEntity(coreX, coreY, coreZ);
|
||||
|
||||
if(tile instanceof TileEntityPWRController) {
|
||||
TileEntityPWRController controller = (TileEntityPWRController) tile;
|
||||
if(!controller.assembled) {
|
||||
this.getBlockType().breakBlock(worldObj, xCoord, yCoord, zCoord, this.getBlockType(), this.getBlockMetadata());
|
||||
}
|
||||
} else {
|
||||
this.getBlockType().breakBlock(worldObj, xCoord, yCoord, zCoord, this.getBlockType(), this.getBlockMetadata());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
block = Block.getBlockById(nbt.getInteger("block"));
|
||||
if(block != Blocks.air) {
|
||||
coreX = nbt.getInteger("cX");
|
||||
coreY = nbt.getInteger("cY");
|
||||
coreZ = nbt.getInteger("cZ");
|
||||
} else {
|
||||
block = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
if(block != null) {
|
||||
nbt.setInteger("block", Block.getIdFromBlock(block));
|
||||
nbt.setInteger("cX", coreX);
|
||||
nbt.setInteger("cY", coreY);
|
||||
nbt.setInteger("cZ", coreZ);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
if(this.worldObj != null) {
|
||||
this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,8 +4,10 @@ import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityPWRController;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
@ -35,7 +37,7 @@ public class MachinePWRController extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return null;
|
||||
return new TileEntityPWRController();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -67,10 +69,15 @@ public class MachinePWRController extends BlockContainer {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
|
||||
TileEntityPWRController controller = (TileEntityPWRController) world.getTileEntity(x, y, z);
|
||||
|
||||
assemble(world, x, y, z);
|
||||
if(!controller.assembled) {
|
||||
assemble(world, x, y, z);
|
||||
} else {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -87,29 +94,39 @@ public class MachinePWRController extends BlockContainer {
|
||||
assembly.put(new BlockPos(x, y, z), this);
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z)).getOpposite();
|
||||
x += dir.offsetX;
|
||||
z += dir.offsetZ;
|
||||
|
||||
errored = false;
|
||||
floodFill(world, x, y, z);
|
||||
floodFill(world, x + dir.offsetX, y, z + dir.offsetZ);
|
||||
|
||||
if(fuelRods.size() == 0) errored = true;
|
||||
|
||||
if(!errored) {
|
||||
for(Entry<BlockPos, Block> entry : assembly.entrySet()) {
|
||||
|
||||
BlockPos pos = entry.getKey();
|
||||
Block block = entry.getValue();
|
||||
|
||||
if(block != ModBlocks.pwr_controller) {
|
||||
|
||||
if(block == ModBlocks.pwr_port) {
|
||||
world.setBlock(entry.getKey().getX(), entry.getKey().getY(), entry.getKey().getZ(), ModBlocks.pwr_block, 1, 3);
|
||||
world.setBlock(pos.getX(), pos.getY(), pos.getZ(), ModBlocks.pwr_block, 1, 3);
|
||||
} else {
|
||||
world.setBlock(entry.getKey().getX(), entry.getKey().getY(), entry.getKey().getZ(), ModBlocks.pwr_block, 0, 3);
|
||||
world.setBlock(pos.getX(), pos.getY(), pos.getZ(), ModBlocks.pwr_block, 0, 3);
|
||||
}
|
||||
|
||||
TileEntityBlockPWR pwr = (TileEntityBlockPWR) world.getTileEntity(pos.getX(), pos.getY(), pos.getZ());
|
||||
pwr.block = block;
|
||||
pwr.coreX = x;
|
||||
pwr.coreY = y;
|
||||
pwr.coreZ = z;
|
||||
pwr.markDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TileEntityPWRController controller = (TileEntityPWRController) world.getTileEntity(x, y, z);
|
||||
controller.assembled = !errored;
|
||||
|
||||
assembly.clear();
|
||||
}
|
||||
|
||||
|
||||
76
src/main/java/com/hbm/inventory/container/ContainerPWR.java
Normal file
@ -0,0 +1,76 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotCraftingOutput;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.tileentity.machine.TileEntityPWRController;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerPWR extends Container {
|
||||
|
||||
TileEntityPWRController controller;
|
||||
|
||||
public ContainerPWR(InventoryPlayer invPlayer, TileEntityPWRController controller) {
|
||||
this.controller = controller;
|
||||
|
||||
this.addSlotToContainer(new Slot(controller, 0, 53, 5));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, controller, 1, 89, 32));
|
||||
this.addSlotToContainer(new Slot(controller, 2, 8, 59));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 108 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 164));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= 2) {
|
||||
if(!this.mergeItemStack(var5, 3, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(var3.getItem() instanceof IItemFluidIdentifier) {
|
||||
if(!this.mergeItemStack(var5, 2, 3, false)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if(!this.mergeItemStack(var5, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return controller.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
}
|
||||
40
src/main/java/com/hbm/inventory/gui/GUIPWR.java
Normal file
@ -0,0 +1,40 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPWR;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityPWRController;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIPWR extends GuiInfoContainer {
|
||||
|
||||
protected TileEntityPWRController controller;
|
||||
private final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/reactors/gui_pwr.png");
|
||||
|
||||
public GUIPWR(InventoryPlayer inventory, TileEntityPWRController controller) {
|
||||
super(new ContainerPWR(inventory, controller));
|
||||
this.controller = controller;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 188;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.controller.hasCustomInventoryName() ? this.controller.getInventoryName() : I18n.format(this.controller.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
}
|
||||
@ -21,6 +21,7 @@ import com.hbm.items.machine.*;
|
||||
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.items.machine.ItemPlateFuel.FunctionEnum;
|
||||
import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel;
|
||||
import com.hbm.items.machine.ItemRBMKRod.EnumBurnFunc;
|
||||
import com.hbm.items.machine.ItemRBMKRod.EnumDepleteFunc;
|
||||
import com.hbm.items.machine.ItemRTGPelletDepleted.DepletedRTGMaterial;
|
||||
@ -1103,6 +1104,10 @@ public class ModItems {
|
||||
public static Item plate_fuel_sa326;
|
||||
public static Item plate_fuel_ra226be;
|
||||
public static Item plate_fuel_pu238be;
|
||||
|
||||
public static Item pwr_fuel;
|
||||
public static Item pwr_fuel_hot;
|
||||
public static Item pwr_fuel_depleted;
|
||||
|
||||
public static Item rbmk_lid;
|
||||
public static Item rbmk_lid_glass;
|
||||
@ -3547,6 +3552,10 @@ public class ModItems {
|
||||
plate_fuel_sa326 = new ItemPlateFuel(2000000).setFunction(FunctionEnum.LINEAR, 80).setUnlocalizedName("plate_fuel_sa326").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_sa326");
|
||||
plate_fuel_ra226be = new ItemPlateFuel(1300000).setFunction(FunctionEnum.PASSIVE, 30).setUnlocalizedName("plate_fuel_ra226be").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_ra226be");
|
||||
plate_fuel_pu238be = new ItemPlateFuel(1000000).setFunction(FunctionEnum.PASSIVE, 50).setUnlocalizedName("plate_fuel_pu238be").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_pu238be");
|
||||
|
||||
pwr_fuel = new ItemPWRFuel().setUnlocalizedName("pwr_fuel").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel");
|
||||
pwr_fuel_hot = new ItemEnumMulti(EnumPWRFuel.class, true, false).setUnlocalizedName("pwr_fuel_hot").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel_hot");
|
||||
pwr_fuel_depleted = new ItemEnumMulti(EnumPWRFuel.class, true, false).setUnlocalizedName("pwr_fuel_depleted").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel_depleted");
|
||||
|
||||
rbmk_lid = new ItemRBMKLid().setUnlocalizedName("rbmk_lid").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid");
|
||||
rbmk_lid_glass = new ItemRBMKLid().setUnlocalizedName("rbmk_lid_glass").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid_glass");
|
||||
@ -6640,6 +6649,11 @@ public class ModItems {
|
||||
GameRegistry.registerItem(plate_fuel_ra226be, plate_fuel_ra226be.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_fuel_pu238be, plate_fuel_pu238be.getUnlocalizedName());
|
||||
|
||||
//PWR Parts
|
||||
GameRegistry.registerItem(pwr_fuel, pwr_fuel.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pwr_fuel_hot, pwr_fuel_hot.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pwr_fuel_depleted, pwr_fuel_depleted.getUnlocalizedName());
|
||||
|
||||
//RBMK parts
|
||||
GameRegistry.registerItem(rbmk_lid, rbmk_lid.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rbmk_lid_glass, rbmk_lid_glass.getUnlocalizedName());
|
||||
|
||||
26
src/main/java/com/hbm/items/machine/ItemPWRFuel.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.hbm.items.machine;
|
||||
|
||||
import com.hbm.items.ItemEnumMulti;
|
||||
|
||||
public class ItemPWRFuel extends ItemEnumMulti {
|
||||
|
||||
public ItemPWRFuel() {
|
||||
super(EnumPWRFuel.class, true, true);
|
||||
}
|
||||
|
||||
public static enum EnumPWRFuel {
|
||||
MEU,
|
||||
HEU233,
|
||||
HEU235,
|
||||
MEN,
|
||||
HEN237,
|
||||
MOX,
|
||||
MEP,
|
||||
HEP239,
|
||||
HEP241,
|
||||
MEA,
|
||||
HEA242,
|
||||
HES326,
|
||||
HES327;
|
||||
}
|
||||
}
|
||||
@ -14,6 +14,7 @@ import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
|
||||
import com.hbm.blocks.generic.BlockMotherOfAllOres.TileEntityRandomOre;
|
||||
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
|
||||
import com.hbm.blocks.generic.PartEmitter.TileEntityPartEmitter;
|
||||
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
|
||||
import com.hbm.blocks.machine.MachineCapacitor.TileEntityCapacitor;
|
||||
import com.hbm.blocks.machine.MachineFan.TileEntityFan;
|
||||
import com.hbm.blocks.machine.PistonInserter.TileEntityPistonInserter;
|
||||
@ -216,6 +217,9 @@ public class TileMappings {
|
||||
|
||||
put(TileEntityRandomOre.class, "tileentity_mother_of_all_ores");
|
||||
put(TileEntityBedrockOre.class, "tileentity_bedrock_ore");
|
||||
|
||||
put(TileEntityBlockPWR.class, "tileentity_block_pwr");
|
||||
put(TileEntityPWRController.class, "tileentity_pwr_controller");
|
||||
|
||||
putNetwork();
|
||||
putBombs();
|
||||
|
||||
@ -132,32 +132,19 @@ public class TileEntityDiFurnace extends TileEntityMachinePolluting implements I
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
if(slots[0] == null || slots[1] == null) {
|
||||
return false;
|
||||
}
|
||||
if(slots[0] == null || slots[1] == null) return false;
|
||||
if(!this.hasPower()) return false;
|
||||
|
||||
if(!this.hasPower()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack itemStack = BlastFurnaceRecipes.getOutput(slots[0], slots[1]);
|
||||
if(itemStack == null) {
|
||||
return false;
|
||||
}
|
||||
ItemStack output = BlastFurnaceRecipes.getOutput(slots[0], slots[1]);
|
||||
if(output == null) return false;
|
||||
if(slots[3] == null) return true;
|
||||
if(!slots[3].isItemEqual(output)) return false;
|
||||
|
||||
if(slots[3] == null) {
|
||||
if(slots[3].stackSize + output.stackSize <= slots[3].getMaxStackSize()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!slots[3].isItemEqual(itemStack)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(slots[3].stackSize < getInventoryStackLimit() && slots[3].stackSize < slots[3].getMaxStackSize()) {
|
||||
return true;
|
||||
} else {
|
||||
return slots[3].stackSize < itemStack.getMaxStackSize();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void processItem() {
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPWR;
|
||||
import com.hbm.inventory.gui.GUIPWR;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityPWRController extends TileEntityMachineBase implements IGUIProvider {
|
||||
|
||||
public boolean assembled;
|
||||
|
||||
public TileEntityPWRController() {
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.pwrController";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
this.assembled = nbt.getBoolean("assembled");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setBoolean("assembled", assembled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerPWR(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIPWR(player.inventory, this);
|
||||
}
|
||||
}
|
||||
@ -2,8 +2,6 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
@ -13,12 +11,12 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityRBMKInlet extends TileEntityLoadedBase implements IFluidAcceptor, IFluidStandardReceiver {
|
||||
public class TileEntityRBMKInlet extends TileEntityLoadedBase implements IFluidStandardReceiver {
|
||||
|
||||
public FluidTank water;
|
||||
|
||||
public TileEntityRBMKInlet() {
|
||||
water = new FluidTank(Fluids.WATER, 32000, 0);
|
||||
water = new FluidTank(Fluids.WATER, 32000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -63,33 +61,6 @@ public class TileEntityRBMKInlet extends TileEntityLoadedBase implements IFluidA
|
||||
this.water.writeToNBT(nbt, "tank");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index == 0) water.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
if(type == Fluids.WATER) water.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index == 0) water.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type == Fluids.WATER) return water.getFill();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
if(type == Fluids.WATER) return water.getMaxFill();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] {water};
|
||||
|
||||
@ -1,16 +1,9 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@ -18,13 +11,12 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityRBMKOutlet extends TileEntityLoadedBase implements IFluidSource, IFluidStandardSender {
|
||||
public class TileEntityRBMKOutlet extends TileEntityLoadedBase implements IFluidStandardSender {
|
||||
|
||||
public List<IFluidAcceptor> list = new ArrayList();
|
||||
public FluidTank steam;
|
||||
|
||||
public TileEntityRBMKOutlet() {
|
||||
steam = new FluidTank(Fluids.SUPERHOTSTEAM, 32000, 0);
|
||||
steam = new FluidTank(Fluids.SUPERHOTSTEAM, 32000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,8 +45,7 @@ public class TileEntityRBMKOutlet extends TileEntityLoadedBase implements IFluid
|
||||
}
|
||||
}
|
||||
|
||||
fillFluidInit(this.steam.getTankType());
|
||||
this.sendFluidToAll(steam, this);
|
||||
fillFluidInit();
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,49 +61,9 @@ public class TileEntityRBMKOutlet extends TileEntityLoadedBase implements IFluid
|
||||
this.steam.writeToNBT(nbt, "tank");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
steam.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
steam.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
steam.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return steam.getFill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
public void fillFluidInit() {
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
fillFluid(this.xCoord + dir.offsetX, this.yCoord + dir.offsetY, this.zCoord + dir.offsetZ, getTact(), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean getTact() { return worldObj.getTotalWorldTime() % 2 == 0; }
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return this.list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
this.list.clear();
|
||||
this.sendFluid(steam, worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.8 KiB |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.hea242.png
Normal file
|
After Width: | Height: | Size: 428 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.hen237.png
Normal file
|
After Width: | Height: | Size: 412 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.hep239.png
Normal file
|
After Width: | Height: | Size: 403 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.hep241.png
Normal file
|
After Width: | Height: | Size: 418 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.hes326.png
Normal file
|
After Width: | Height: | Size: 431 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.hes327.png
Normal file
|
After Width: | Height: | Size: 434 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.heu233.png
Normal file
|
After Width: | Height: | Size: 433 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.heu235.png
Normal file
|
After Width: | Height: | Size: 419 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.mea.png
Normal file
|
After Width: | Height: | Size: 431 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.men.png
Normal file
|
After Width: | Height: | Size: 429 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.mep.png
Normal file
|
After Width: | Height: | Size: 414 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.meu.png
Normal file
|
After Width: | Height: | Size: 422 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel.mox.png
Normal file
|
After Width: | Height: | Size: 414 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel_base.png
Normal file
|
After Width: | Height: | Size: 422 B |
|
After Width: | Height: | Size: 373 B |
BIN
src/main/resources/assets/hbm/textures/items/pwr_fuel_hot.png
Normal file
|
After Width: | Height: | Size: 401 B |