mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
finally beginning the electrolyser
This commit is contained in:
parent
9dc0d40c2b
commit
48e6a08fcd
@ -945,6 +945,8 @@ public class ModBlocks {
|
||||
public static Block machine_condenser;
|
||||
public static Block machine_tower_small;
|
||||
public static Block machine_tower_large;
|
||||
|
||||
public static Block machine_electrolyser;
|
||||
|
||||
public static Block machine_deaerator;
|
||||
public static final int guiID_machine_deaerator = 74;
|
||||
@ -2136,6 +2138,8 @@ public class ModBlocks {
|
||||
machine_liquefactor = new MachineLiquefactor().setBlockName("machine_liquefactor").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_solidifier = new MachineSolidifier().setBlockName("machine_solidifier").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
|
||||
machine_electrolyser = new MachineElectrolyser().setBlockName("machine_electrolyser").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
|
||||
anvil_iron = new NTMAnvil(Material.iron, 1).setBlockName("anvil_iron").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_iron");
|
||||
anvil_lead = new NTMAnvil(Material.iron, 1).setBlockName("anvil_lead").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_lead");
|
||||
anvil_steel = new NTMAnvil(Material.iron, 2).setBlockName("anvil_steel").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_steel");
|
||||
@ -3054,6 +3058,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_deuterium_tower, machine_deuterium_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_liquefactor, ItemBlockBase.class, machine_liquefactor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_solidifier, ItemBlockBase.class, machine_solidifier.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_electrolyser, machine_electrolyser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_deaerator, machine_deaerator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_waste_drum, machine_waste_drum.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_storage_drum, machine_storage_drum.getUnlocalizedName());
|
||||
|
||||
@ -1,64 +1,64 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemfac;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineChemfac extends BlockDummyable {
|
||||
|
||||
public MachineChemfac(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineChemfac();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {3, 0, 4, 3, 4, 3};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||
|
||||
this.safeRem = true;
|
||||
|
||||
for(int i = -3; i < 3; i++) {
|
||||
this.makeExtra(world, x + rot.offsetX * 2 + dir.offsetX * i, y + 3, z + rot.offsetZ * 2 + dir.offsetZ * i);
|
||||
this.makeExtra(world, x - rot.offsetX * 3 + dir.offsetX * i, y + 3, z - rot.offsetZ * 3 + dir.offsetZ * i);
|
||||
|
||||
this.makeExtra(world, x + rot.offsetX * 3 + dir.offsetX * i, y + 1, z + rot.offsetZ * 3 + dir.offsetZ * i);
|
||||
this.makeExtra(world, x + rot.offsetX * 3 + dir.offsetX * i, y + 2, z + rot.offsetZ * 3 + dir.offsetZ * i);
|
||||
|
||||
this.makeExtra(world, x - rot.offsetX * 4 + dir.offsetX * i, y + 1, z - rot.offsetZ * 4 + dir.offsetZ * i);
|
||||
this.makeExtra(world, x - rot.offsetX * 4 + dir.offsetX * i, y + 2, z - rot.offsetZ * 4 + dir.offsetZ * i);
|
||||
}
|
||||
|
||||
this.safeRem = false;
|
||||
}
|
||||
}
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemfac;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineChemfac extends BlockDummyable {
|
||||
|
||||
public MachineChemfac(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineChemfac();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {3, 0, 4, 3, 4, 3};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||
|
||||
this.safeRem = true;
|
||||
|
||||
for(int i = -3; i < 3; i++) {
|
||||
this.makeExtra(world, x + rot.offsetX * 2 + dir.offsetX * i, y + 3, z + rot.offsetZ * 2 + dir.offsetZ * i);
|
||||
this.makeExtra(world, x - rot.offsetX * 3 + dir.offsetX * i, y + 3, z - rot.offsetZ * 3 + dir.offsetZ * i);
|
||||
|
||||
this.makeExtra(world, x + rot.offsetX * 3 + dir.offsetX * i, y + 1, z + rot.offsetZ * 3 + dir.offsetZ * i);
|
||||
this.makeExtra(world, x + rot.offsetX * 3 + dir.offsetX * i, y + 2, z + rot.offsetZ * 3 + dir.offsetZ * i);
|
||||
|
||||
this.makeExtra(world, x - rot.offsetX * 4 + dir.offsetX * i, y + 1, z - rot.offsetZ * 4 + dir.offsetZ * i);
|
||||
this.makeExtra(world, x - rot.offsetX * 4 + dir.offsetX * i, y + 2, z - rot.offsetZ * 4 + dir.offsetZ * i);
|
||||
}
|
||||
|
||||
this.safeRem = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,76 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityElectrolyser;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineElectrolyser extends BlockDummyable {
|
||||
|
||||
public MachineElectrolyser() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityElectrolyser();
|
||||
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {0, 0, 4, 4, 2, 2};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {1, 0, 4, 4, 1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -1, 4, 4, 0, 0}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, 1, -1, -2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 1, -1, -1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, 3, -3, -2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 3, -3, -1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, -1, 1, -2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, -1, 1, -1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, -3, 3, -2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, -3, 3, -1, 1}, this, dir);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, getDimensions(), x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {1, 0, 4, 4, 1, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -1, 4, 4, 0, 0}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, 1, -1, -2, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 1, -1, -1, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, 3, -3, -2, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 3, -3, -1, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, -1, 1, -2, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, -1, 1, -1, 1}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, 0, -3, 3, -2, 2}, x, y, z, dir)) return false;
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , 3 + y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, -3, 3, -1, 1}, x, y, z, dir)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@ -31,6 +31,7 @@ public class GUIHandler implements IGuiHandler {
|
||||
if(entity instanceof TileEntityMachineSolidifier) { return new ContainerSolidifier(player.inventory, (TileEntityMachineSolidifier) entity); }
|
||||
if(entity instanceof TileEntityMachineRadiolysis) { return new ContainerRadiolysis(player.inventory, (TileEntityMachineRadiolysis) entity); }
|
||||
if(entity instanceof TileEntityMachineChemfac) { return new ContainerChemfac(player.inventory, (TileEntityMachineChemfac) entity); }
|
||||
if(entity instanceof TileEntityElectrolyser) { return new ContainerElectrolyser(player.inventory, (TileEntityElectrolyser) entity); }
|
||||
|
||||
switch(ID) {
|
||||
case ModBlocks.guiID_test_difurnace: {
|
||||
@ -872,6 +873,7 @@ public class GUIHandler implements IGuiHandler {
|
||||
if(entity instanceof TileEntityMachineSolidifier) { return new GUISolidifier(player.inventory, (TileEntityMachineSolidifier) entity); }
|
||||
if(entity instanceof TileEntityMachineRadiolysis) { return new GUIRadiolysis(player.inventory, (TileEntityMachineRadiolysis) entity); }
|
||||
if(entity instanceof TileEntityMachineChemfac) { return new GUIChemfac(player.inventory, (TileEntityMachineChemfac) entity); }
|
||||
if(entity instanceof TileEntityElectrolyser) { return new GUIElectrolyser(player.inventory, (TileEntityElectrolyser) entity); }
|
||||
|
||||
switch(ID) {
|
||||
case ModBlocks.guiID_test_difurnace: {
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityElectrolyser;
|
||||
|
||||
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 ContainerElectrolyser extends Container {
|
||||
|
||||
TileEntityElectrolyser electrolyser;
|
||||
|
||||
public ContainerElectrolyser(InventoryPlayer invPlayer, TileEntityElectrolyser tile) {
|
||||
|
||||
electrolyser = tile;
|
||||
|
||||
|
||||
|
||||
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, 165 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 223));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return electrolyser.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
51
src/main/java/com/hbm/inventory/gui/GUIElectrolyser.java
Normal file
51
src/main/java/com/hbm/inventory/gui/GUIElectrolyser.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerElectrolyser;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityElectrolyser;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIElectrolyser extends GuiInfoContainer {
|
||||
|
||||
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_electrolyser.png");
|
||||
private TileEntityElectrolyser electrolyser;
|
||||
|
||||
public GUIElectrolyser(InventoryPlayer invPlayer, TileEntityElectrolyser electrolyser) {
|
||||
super(new ContainerElectrolyser(invPlayer, electrolyser));
|
||||
this.electrolyser = electrolyser;
|
||||
|
||||
this.xSize = 210;
|
||||
this.ySize = 247;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
}
|
||||
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.electrolyser.hasCustomInventoryName() ? this.electrolyser.getInventoryName() : I18n.format(this.electrolyser.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, 90 + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 7, 0xffffff);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 94, 4210752);
|
||||
}
|
||||
}
|
||||
@ -241,6 +241,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLiquefactor.class, new RenderLiquefactor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineSolidifier.class, new RenderSolidifier());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadiolysis.class, new RenderRadiolysis());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElectrolyser.class, new RenderElectrolyser());
|
||||
//AMS
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSBase.class, new RenderAMSBase());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSEmitter.class, new RenderAMSEmitter());
|
||||
|
||||
@ -291,6 +291,9 @@ public class ResourceManager {
|
||||
//Radiolysis
|
||||
public static final IModelCustom radiolysis = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/radiolysis.obj"));
|
||||
|
||||
//Electrolyser
|
||||
public static final IModelCustom electrolyser = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/electrolyser.obj"));
|
||||
|
||||
////Textures TEs
|
||||
|
||||
public static final ResourceLocation universal = new ResourceLocation(RefStrings.MODID, "textures/models/TheGadget3_.png");
|
||||
@ -597,6 +600,9 @@ public class ResourceManager {
|
||||
//Radiolysis
|
||||
public static final ResourceLocation radiolysis_tex = new ResourceLocation(RefStrings.MODID, "textures/models/radiolysis.png");
|
||||
|
||||
//Electrolyser
|
||||
public static final ResourceLocation electrolyser_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/electrolyser.png");
|
||||
|
||||
////Obj Items
|
||||
|
||||
//Shimmer Sledge
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityElectrolyser;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderElectrolyser extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
|
||||
|
||||
TileEntityElectrolyser electrolyser = (TileEntityElectrolyser) te;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
|
||||
switch(te.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 4: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 2: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
bindTexture(ResourceManager.electrolyser_tex);
|
||||
ResourceManager.electrolyser.renderAll();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,172 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityElectrolyser extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidAcceptor{
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 20000000;
|
||||
public static final int usageBase = 10000;
|
||||
public int usage;
|
||||
|
||||
public int progressFluid;
|
||||
public static final int processFluidTimeBase = 100;
|
||||
public int processFluidTime;
|
||||
public int progressOre;
|
||||
public static final int processOreTimeBase = 1000;
|
||||
public int processOreTime;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
|
||||
public TileEntityElectrolyser() {
|
||||
super(24);
|
||||
tanks = new FluidTank[3];
|
||||
tanks[0] = new FluidTank(Fluids.WATER, 16000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.HYDROGEN, 16000, 1);
|
||||
tanks[2] = new FluidTank(Fluids.OXYGEN, 16000, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineElectrolyser";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", this.power);
|
||||
data.setInteger("progressFluid", this.progressFluid);
|
||||
data.setInteger("progressOre", this.progressOre);
|
||||
data.setInteger("usage", this.usage);
|
||||
data.setInteger("processFluidTime", this.processFluidTime);
|
||||
data.setInteger("processOreTime", this.processOreTime);
|
||||
this.networkPack(data, 50);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 3,
|
||||
yCoord - 0,
|
||||
zCoord - 4,
|
||||
xCoord + 3,
|
||||
yCoord + 4,
|
||||
zCoord + 4
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return this.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tanks[index].setFill(fill);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
for(int i = 0; i < 3; i++) {
|
||||
if(type == tanks[i].getTankType())
|
||||
tanks[i].setFill(fill);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tanks[index].setTankType(type);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
for(int i = 0; i < 3; i++) {
|
||||
if(type == tanks[i].getTankType() && tanks[i].getFill() != 0)
|
||||
return tanks[i].getFill();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
for(int i = 0; i < 3; i++) {
|
||||
if(type == tanks[i].getTankType() && tanks[i].getMaxFill() != 0)
|
||||
return tanks[i].getMaxFill();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
return worldObj.getTotalWorldTime() % 20 < 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return new ArrayList<IFluidAcceptor>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
}
|
||||
1779
src/main/resources/assets/hbm/models/machines/electrolyser.obj
Normal file
1779
src/main/resources/assets/hbm/models/machines/electrolyser.obj
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Loading…
x
Reference in New Issue
Block a user