mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
liquefactor machine
This commit is contained in:
parent
be38d75119
commit
474a729a47
@ -1,6 +1,5 @@
|
||||
package api.hbm.energy;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
|
||||
@ -902,6 +902,9 @@ public class ModBlocks {
|
||||
public static Block machine_deuterium_extractor;
|
||||
public static Block machine_deuterium_tower;
|
||||
|
||||
public static Block machine_liquefactor;
|
||||
public static Block machine_solidifier;
|
||||
|
||||
public static Block machine_chungus;
|
||||
public static Block machine_condenser;
|
||||
public static Block machine_tower_small;
|
||||
@ -2059,6 +2062,8 @@ public class ModBlocks {
|
||||
machine_deuterium_extractor = new MachineDeuteriumExtractor(Material.iron).setBlockName("machine_deuterium_extractor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_deuterium_extractor_side");
|
||||
machine_deuterium_tower = new DeuteriumTower(Material.iron).setBlockName("machine_deuterium_tower").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete");
|
||||
|
||||
machine_liquefactor = new MachineLiquefactor().setBlockName("machine_liquefactor").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");
|
||||
@ -2071,7 +2076,7 @@ public class ModBlocks {
|
||||
anvil_osmiridium = new NTMAnvil(Material.iron, 8).setBlockName("anvil_osmiridium").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_osmiridium");
|
||||
anvil_murky = new NTMAnvil(Material.iron, 1916169).setBlockName("anvil_murky").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_steel");
|
||||
|
||||
machine_deaerator = new MachineDeaerator(Material.iron).setBlockName("machine_deaerator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_deaerator");
|
||||
machine_deaerator = new MachineDeaerator(Material.iron).setBlockName("machine_deaerator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
|
||||
|
||||
machine_waste_drum = new WasteDrum(Material.iron).setBlockName("machine_waste_drum").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":waste_drum");
|
||||
machine_storage_drum = new StorageDrum(Material.iron, guiID_storage_drum).setBlockName("machine_storage_drum").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_storage_drum");
|
||||
@ -2937,6 +2942,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_tower_large, machine_tower_large.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_deuterium_extractor, machine_deuterium_extractor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_deuterium_tower, machine_deuterium_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_liquefactor, ItemBlockBase.class, machine_liquefactor.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());
|
||||
|
||||
@ -25,7 +25,21 @@ public class MachineDeaerator extends BlockDummyable {
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
98
src/main/java/com/hbm/blocks/machine/MachineLiquefactor.java
Normal file
98
src/main/java/com/hbm/blocks/machine/MachineLiquefactor.java
Normal file
@ -0,0 +1,98 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineLiquefactor;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineLiquefactor extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineLiquefactor() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12)
|
||||
return new TileEntityMachineLiquefactor();
|
||||
|
||||
if(meta >= extra)
|
||||
return new TileEntityProxyCombo(true, true, true);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {2, 0, 1, 1, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]);
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@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 = x + dir.offsetX * o;
|
||||
z = z + dir.offsetZ * o;
|
||||
|
||||
this.makeExtra(world, x, y + 2, z);
|
||||
|
||||
this.makeExtra(world, x + 1, y + 1, z);
|
||||
this.makeExtra(world, x - 1, y + 1, z);
|
||||
this.makeExtra(world, x, y + 1, z + 1);
|
||||
this.makeExtra(world, x, y + 1, z - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
//list.add(EnumChatFormatting.YELLOW + "");
|
||||
}
|
||||
}
|
||||
@ -27,6 +27,11 @@ public class GUIHandler implements IGuiHandler {
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
|
||||
if(entity instanceof TileEntityMachineLiquefactor) {
|
||||
return new ContainerLiquefactor(player.inventory, (TileEntityMachineLiquefactor) entity);
|
||||
}
|
||||
|
||||
switch(ID) {
|
||||
case ModBlocks.guiID_test_difurnace: {
|
||||
if(entity instanceof TileEntityDiFurnace) {
|
||||
@ -862,6 +867,11 @@ public class GUIHandler implements IGuiHandler {
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
|
||||
if(entity instanceof TileEntityMachineLiquefactor) {
|
||||
return new GUILiquefactor(player.inventory, (TileEntityMachineLiquefactor) entity);
|
||||
}
|
||||
|
||||
switch(ID) {
|
||||
case ModBlocks.guiID_test_difurnace: {
|
||||
if(entity instanceof TileEntityDiFurnace) {
|
||||
|
||||
11
src/main/java/com/hbm/handler/nei/LiquefactionHandler.java
Normal file
11
src/main/java/com/hbm/handler/nei/LiquefactionHandler.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.LiquefactionRecipes;
|
||||
|
||||
public class LiquefactionHandler extends NEIUniversalHandler {
|
||||
|
||||
public LiquefactionHandler() {
|
||||
super("ntmLiquefaction", "Liquefaction", ModBlocks.machine_liquefactor, LiquefactionRecipes.getRecipes());
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
@ -11,5 +11,4 @@ public class FluidStack {
|
||||
this.fill = fill;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@ -78,6 +79,10 @@ public class FluidTank {
|
||||
}
|
||||
|
||||
//Called on TE update
|
||||
public void updateTank(TileEntity te) {
|
||||
updateTank(te.xCoord, te.yCoord, te.zCoord, te.getWorldObj().provider.dimensionId);
|
||||
}
|
||||
|
||||
public void updateTank(int x, int y, int z, int dim) {
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEFluidPacket(x, y, z, fluid, index, type), new TargetPoint(dim, x, y, z, 100));
|
||||
}
|
||||
|
||||
@ -11,15 +11,14 @@ public class SlotUpgrade extends Slot {
|
||||
public SlotUpgrade(IInventory inventory, int i, int j, int k) {
|
||||
super(inventory, i, j, k);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack stack) {
|
||||
return stack != null && stack.getItem() instanceof ItemMachineUpgrade;
|
||||
}
|
||||
|
||||
return stack != null && stack.getItem() instanceof ItemMachineUpgrade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChange(ItemStack sta1, ItemStack sta2) {
|
||||
|
||||
public void onSlotChange(ItemStack sta1, ItemStack sta2) {
|
||||
super.onSlotChange(sta1, sta2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,22 +10,25 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerFEL extends Container {
|
||||
|
||||
private TileEntityFEL microwave;
|
||||
private TileEntityFEL fel;
|
||||
|
||||
public ContainerFEL(InventoryPlayer invPlayer, TileEntityFEL tedf) {
|
||||
|
||||
microwave = tedf;
|
||||
fel = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 26, 53));
|
||||
//battery
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 182, 144));
|
||||
//laser crystal
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 141, 23));
|
||||
|
||||
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, 84 + i * 18));
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 83 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 141));
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,11 +42,11 @@ public class ContainerFEL extends Container {
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 == 0) {
|
||||
if(!this.mergeItemStack(var5, 1, this.inventorySlots.size(), true)) {
|
||||
if(!this.mergeItemStack(var5, 1, this.inventorySlots.size(), false)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if(!this.mergeItemStack(var5, 0, 1, true))
|
||||
if(!this.mergeItemStack(var5, 0, 1, false))
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -59,6 +62,6 @@ public class ContainerFEL extends Container {
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return microwave.isUseableByPlayer(player);
|
||||
return fel.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotUpgrade;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineLiquefactor;
|
||||
|
||||
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 ContainerLiquefactor extends Container {
|
||||
|
||||
private TileEntityMachineLiquefactor liquefactor;
|
||||
|
||||
public ContainerLiquefactor(InventoryPlayer playerInv, TileEntityMachineLiquefactor tile) {
|
||||
liquefactor = tile;
|
||||
|
||||
//Input
|
||||
this.addSlotToContainer(new Slot(tile, 0, 35, 54));
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tile, 1, 134, 72));
|
||||
//Upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tile, 2, 98, 36));
|
||||
this.addSlotToContainer(new SlotUpgrade(tile, 3, 98, 54));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 180));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return liquefactor.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(index <= 2) {
|
||||
if(!this.mergeItemStack(var5, 4, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(var5, 0, 3, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.machine.TileEntitySILEX;
|
||||
|
||||
@ -16,23 +15,23 @@ public class ContainerSILEX extends Container {
|
||||
|
||||
public ContainerSILEX(InventoryPlayer invPlayer, TileEntitySILEX te) {
|
||||
silex = te;
|
||||
|
||||
|
||||
//Input
|
||||
this.addSlotToContainer(new Slot(te, 0, 116, 36));
|
||||
this.addSlotToContainer(new Slot(te, 0, 80, 12));
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(te, 1, 44, 36));
|
||||
this.addSlotToContainer(new Slot(te, 1, 8, 24));
|
||||
//Fluid Container
|
||||
this.addSlotToContainer(new Slot(te, 2, 62, 36));
|
||||
this.addSlotToContainer(new Slot(te, 3, 80, 36));
|
||||
this.addSlotToContainer(new Slot(te, 2, 8 + 18, 24));
|
||||
this.addSlotToContainer(new Slot(te, 3, 8 + 18*2, 24));
|
||||
//Output
|
||||
this.addSlotToContainer(new Slot(te, 4, 116, 90));
|
||||
//Output Queue
|
||||
this.addSlotToContainer(new SlotMachineOutput(te, 5, 134, 72));
|
||||
this.addSlotToContainer(new SlotMachineOutput(te, 6, 152, 72));
|
||||
this.addSlotToContainer(new SlotMachineOutput(te, 7, 134, 90));
|
||||
this.addSlotToContainer(new SlotMachineOutput(te, 8, 152, 90));
|
||||
this.addSlotToContainer(new SlotMachineOutput(te, 9, 134, 108));
|
||||
this.addSlotToContainer(new SlotMachineOutput(te, 10, 152, 108));
|
||||
this.addSlotToContainer(new Slot(te, 5, 134, 72));
|
||||
this.addSlotToContainer(new Slot(te, 6, 152, 72));
|
||||
this.addSlotToContainer(new Slot(te, 7, 134, 90));
|
||||
this.addSlotToContainer(new Slot(te, 8, 152, 90));
|
||||
this.addSlotToContainer(new Slot(te, 9, 134, 108));
|
||||
this.addSlotToContainer(new Slot(te, 10, 152, 108));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
@ -56,7 +55,6 @@ public class ContainerSILEX extends Container {
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
SlotMachineOutput.checkAchievements(p_82846_1_, var5);
|
||||
|
||||
if(par2 <= silex.getSizeInventory() - 1) {
|
||||
if(!this.mergeItemStack(var5, silex.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||
@ -87,4 +85,4 @@ public class ContainerSILEX extends Container {
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return silex.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
63
src/main/java/com/hbm/inventory/gui/GUILiquefactor.java
Normal file
63
src/main/java/com/hbm/inventory/gui/GUILiquefactor.java
Normal file
@ -0,0 +1,63 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerLiquefactor;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineLiquefactor;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUILiquefactor extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_liquefactor.png");
|
||||
private TileEntityMachineLiquefactor liquefactor;
|
||||
|
||||
public GUILiquefactor(InventoryPlayer invPlayer, TileEntityMachineLiquefactor tedf) {
|
||||
super(new ContainerLiquefactor(invPlayer, tedf));
|
||||
liquefactor = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
liquefactor.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 71, guiTop + 36, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 18, 16, 52, liquefactor.power, liquefactor.maxPower);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
|
||||
String name = this.liquefactor.hasCustomInventoryName() ? this.liquefactor.getInventoryName() : I18n.format(this.liquefactor.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, 70 - this.fontRendererObj.getStringWidth(name) / 2, 6, 0xC7C1A3);
|
||||
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);
|
||||
|
||||
int i = (int)(liquefactor.getPower() * 52 / liquefactor.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 134, guiTop + 70 - i, 176, 52 - i, 16, i);
|
||||
|
||||
int j = liquefactor.progress * 42 / liquefactor.processTime;
|
||||
drawTexturedModalRect(guiLeft + 42, guiTop + 17, 192, 0, j, 35);
|
||||
|
||||
if(i > 0)
|
||||
drawTexturedModalRect(guiLeft + 138, guiTop + 4, 176, 52, 9, 12);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(liquefactor.tank.getSheet());
|
||||
liquefactor.tank.renderTank(this, guiLeft + 71, guiTop + 88, liquefactor.tank.getTankType().textureX() * FluidTank.x, liquefactor.tank.getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class LiquefactionRecipes {
|
||||
|
||||
private static HashMap<Object, FluidStack> recipes = new HashMap();
|
||||
|
||||
public static void register() {
|
||||
|
||||
recipes.put(COAL.gem(), new FluidStack(100, Fluids.OIL));
|
||||
recipes.put(COAL.dust(), new FluidStack(100, Fluids.OIL));
|
||||
recipes.put(ANY_TAR.any(), new FluidStack(100, Fluids.BITUMEN));
|
||||
recipes.put(new ComparableStack(Blocks.netherrack), new FluidStack(250, Fluids.LAVA));
|
||||
recipes.put(new ComparableStack(Blocks.cobblestone), new FluidStack(250, Fluids.LAVA));
|
||||
recipes.put(new ComparableStack(Blocks.stone), new FluidStack(250, Fluids.LAVA));
|
||||
recipes.put(new ComparableStack(Blocks.obsidian), new FluidStack(500, Fluids.LAVA));
|
||||
recipes.put(new ComparableStack(Items.snowball), new FluidStack(125, Fluids.WATER));
|
||||
recipes.put(new ComparableStack(Blocks.snow), new FluidStack(500, Fluids.WATER));
|
||||
recipes.put(new ComparableStack(Blocks.ice), new FluidStack(1000, Fluids.WATER));
|
||||
recipes.put(new ComparableStack(Blocks.packed_ice), new FluidStack(1000, Fluids.WATER));
|
||||
}
|
||||
|
||||
public static FluidStack getOutput(ItemStack stack) {
|
||||
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return null;
|
||||
|
||||
ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
|
||||
if(recipes.containsKey(comp))
|
||||
return recipes.get(comp);
|
||||
|
||||
String[] dictKeys = comp.getDictKeys();
|
||||
|
||||
for(String key : dictKeys) {
|
||||
|
||||
if(recipes.containsKey(key))
|
||||
return recipes.get(key);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static HashMap<Object, ItemStack> getRecipes() {
|
||||
|
||||
HashMap<Object, ItemStack> recipes = new HashMap<Object, ItemStack>();
|
||||
|
||||
for(Entry<Object, FluidStack> entry : LiquefactionRecipes.recipes.entrySet()) {
|
||||
|
||||
FluidStack out = entry.getValue();
|
||||
|
||||
if(entry.getKey() instanceof String) {
|
||||
recipes.put(new OreDictStack((String)entry.getKey()), ItemFluidIcon.make(out.type, out.fill));
|
||||
} else {
|
||||
recipes.put(((ComparableStack)entry.getKey()).toStack(), ItemFluidIcon.make(out.type, out.fill));
|
||||
}
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
||||
@ -315,7 +315,7 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModItems.blades_combine_steel, 1), new Object[] { "PIP", 'P', CMB.plate(), 'I', new ItemStack(ModItems.blades_combine_steel, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
addRecipeAuto(new ItemStack(ModItems.blades_schrabidium, 1), new Object[] { "PIP", 'P', SA326.plate(), 'I', new ItemStack(ModItems.blades_schrabidium, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModItems.laser_crystal_co2, 1), new Object[] { "QDQ", "NCN", "QDQ", 'Q', ModBlocks.glass_quartz, 'D', DESH.ingot(), 'N', ND.ingot(), 'C', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.CARBONDIOXIDE.getID()) });
|
||||
addRecipeAuto(new ItemStack(ModItems.laser_crystal_co2, 1), new Object[] { "QDQ", "NCN", "QDQ", 'Q', ModBlocks.glass_quartz, 'D', DESH.ingot(), 'N', NB.ingot(), 'C', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.CARBONDIOXIDE.getID()) });
|
||||
addRecipeAuto(new ItemStack(ModItems.laser_crystal_bismuth, 1), new Object[] {"QUQ", "BCB", "QTQ", 'Q', ModBlocks.glass_quartz, 'U', U.ingot(), 'T', TH232.ingot(), 'B', ModItems.nugget_bismuth, 'C', ModItems.crystal_rare });
|
||||
addRecipeAuto(new ItemStack(ModItems.laser_crystal_cmb, 1), new Object[] {"QBQ", "CSC", "QBQ", 'Q', ModBlocks.glass_quartz, 'B', CMB.ingot(), 'C', SBD.ingot(), 'S', ModItems.cell_anti_schrabidium });
|
||||
addRecipeAuto(new ItemStack(ModItems.laser_crystal_dnt, 1), new Object[] {"QDQ", "SBS", "QDQ", 'Q', ModBlocks.glass_quartz, 'D', DNT.ingot(), 'B', ModItems.egg_balefire, 'S', ModItems.powder_spark_mix });
|
||||
|
||||
@ -949,6 +949,7 @@ public class MainRegistry {
|
||||
PressRecipes.register();
|
||||
RefineryRecipes.registerFractions();
|
||||
RefineryRecipes.registerCracking();
|
||||
LiquefactionRecipes.register();
|
||||
FuelPoolRecipes.register();
|
||||
|
||||
TileEntityNukeCustom.registerBombItems();
|
||||
|
||||
@ -65,6 +65,8 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.registerRecipeHandler(new RTGRecipeHandler());
|
||||
API.registerUsageHandler(new RTGRecipeHandler());
|
||||
}
|
||||
API.registerRecipeHandler(new LiquefactionHandler());
|
||||
API.registerUsageHandler(new LiquefactionHandler());
|
||||
|
||||
//Some things are even beyond my control...or are they?
|
||||
API.hideItem(ItemBattery.getEmptyBattery(ModItems.memory));
|
||||
|
||||
@ -143,7 +143,7 @@ public abstract class TileEntityMachineBase extends TileEntity implements ISided
|
||||
//was it update? onUpdate? updateTile? did it have any args?
|
||||
//shit i don't know man
|
||||
@Override
|
||||
public abstract void updateEntity();
|
||||
public abstract void updateEntity();
|
||||
|
||||
@Deprecated
|
||||
public void updateGauge(int val, int id, int range) {
|
||||
|
||||
@ -238,6 +238,7 @@ public class TileMappings {
|
||||
put(TileEntityTowerLarge.class, "tileentity_cooling_tower_large");
|
||||
put(TileEntityDeuteriumExtractor.class, "tileentity_deuterium_extractor");
|
||||
put(TileEntityDeuteriumTower.class, "tileentity_deuterium_tower");
|
||||
put(TileEntityMachineLiquefactor.class, "tileentity_liquefactor");
|
||||
|
||||
put(TileEntityMachineOilWell.class, "tileentity_derrick");
|
||||
put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack");
|
||||
|
||||
@ -0,0 +1,192 @@
|
||||
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.FluidStack;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.LiquefactionRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEntityMachineLiquefactor extends TileEntityMachineBase implements IEnergyUser, IFluidSource {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
public static final int usage = 500;
|
||||
public int progress;
|
||||
public static final int processTime = 200;
|
||||
|
||||
public FluidTank tank;
|
||||
|
||||
public TileEntityMachineLiquefactor() {
|
||||
super(4);
|
||||
tank = new FluidTank(Fluids.NONE, 24000, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineLiquefactor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
this.power = Library.chargeTEFromItems(slots, 1, power, maxPower);
|
||||
tank.updateTank(this);
|
||||
|
||||
this.trySubscribe(worldObj, xCoord + 2, yCoord + 1, zCoord, Library.POS_X);
|
||||
this.trySubscribe(worldObj, xCoord - 2, yCoord + 1, zCoord, Library.NEG_X);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 1, zCoord + 2, Library.POS_Z);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord + 1, zCoord - 2, Library.NEG_Z);
|
||||
|
||||
if(this.canProcess())
|
||||
this.process();
|
||||
else
|
||||
this.progress = 0;
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 10 == 0) {
|
||||
this.fillFluidInit(tank.getTankType());
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setLong("power", this.power);
|
||||
data.setInteger("progress", this.progress);
|
||||
this.networkPack(data, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
|
||||
if(this.power < usage)
|
||||
return false;
|
||||
|
||||
if(slots[0] == null)
|
||||
return false;
|
||||
|
||||
FluidStack out = LiquefactionRecipes.getOutput(slots[0]);
|
||||
|
||||
if(out.type != tank.getTankType() && tank.getFill() > 0)
|
||||
return false;
|
||||
|
||||
if(out.fill + tank.getFill() > tank.getMaxFill())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
|
||||
this.power -= usage;
|
||||
|
||||
progress++;
|
||||
|
||||
if(progress >= processTime) {
|
||||
|
||||
FluidStack out = LiquefactionRecipes.getOutput(slots[0]);
|
||||
tank.setTankType(out.type);
|
||||
tank.setFill(tank.getFill() + out.fill);
|
||||
this.decrStackSize(0, 1);
|
||||
|
||||
progress = 0;
|
||||
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
tank.readFromNBT(nbt, "tank");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
tank.writeToNBT(nbt, "tank");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
if(type == tank.getTankType())
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> tanks = new ArrayList();
|
||||
tanks.add(tank);
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return type == tank.getTankType() ? tank.getFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
fillFluid(xCoord, yCoord - 1, zCoord, getTact(), type);
|
||||
fillFluid(xCoord, yCoord + 3, zCoord, 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
|
||||
public boolean getTact() {
|
||||
return worldObj.getTotalWorldTime() % 20 < 10;
|
||||
}
|
||||
|
||||
private List<IFluidAcceptor> consumers = new ArrayList();
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return consumers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
consumers.clear();
|
||||
}
|
||||
}
|
||||
@ -234,8 +234,10 @@ container.machineCMB=CMB-Stahl Hochofen
|
||||
container.machineCoal=Verbrennungsgenerator
|
||||
container.machineDiesel=Dieselgenerator
|
||||
container.machineElectricBoiler=Elektrischer Boiler
|
||||
container.machineFEL=FEL
|
||||
container.machineITER=Kernfusionsreaktor
|
||||
container.machineLargeTurbine=Industrielle Dampfturbine
|
||||
container.machineLiquefactor=Verflüssiger
|
||||
container.machineRefinery=Ölraffinerie
|
||||
container.machineSelenium=Hochleistungs-Sternmotor
|
||||
container.machineShredder=Brecher
|
||||
@ -1659,6 +1661,15 @@ item.key.name=Schlüssel
|
||||
item.key_fake.name=Gefälschter Schlüssel
|
||||
item.key_kit.name=Schlüssel-Imitationskit
|
||||
item.key_red.name=Roter Schlüssel
|
||||
item.laser_crystal_bismuth.desc=Bismuth-Samarium-Uran-Thorium-Kristallmatrix
|
||||
item.laser_crystal_bismuth.name=BiSmUTh-Laserkristall
|
||||
item.laser_crystal_cmb.desc=Antischrabidium in einem CMB-Schrabidat Legierungsgitter
|
||||
item.laser_crystal_cmb.name=CMB-Schrabidat-Antimaterie-Laserkristall
|
||||
item.laser_crystal_co2.desc=Kohlenstoffdioxid in kristallinem Desh
|
||||
item.laser_crystal_co2.name=CO2-Desh-Laserkristall
|
||||
item.laser_crystal_digamma.name=Digamma-Laserkristall
|
||||
item.laser_crystal_dnt.desc=Dineutronium-Spark Fermion Superkristall
|
||||
item.laser_crystal_dnt.name=Spark-Laserkristall
|
||||
item.lead_gavel.name=Bleierner Richterhammer
|
||||
item.lemon.name="Zitrone"
|
||||
item.letter.name=Eilbrief
|
||||
@ -3190,6 +3201,7 @@ tile.machine_drill.name=Automatischer Minenbohrer
|
||||
tile.machine_electric_furnace_off.name=Elektrischer Ofen
|
||||
tile.machine_electric_furnace_on.name=Elektrischer Ofen
|
||||
tile.machine_epress.name=Hydraulische Presse
|
||||
tile.machine_fel.name=FEL
|
||||
tile.machine_fensu.name=FEnSU
|
||||
tile.machine_flare.name=Abfackelturm
|
||||
tile.machine_fluidtank.name=Tank
|
||||
@ -3590,6 +3602,17 @@ tool.ability.shredder=Auto-Brecher
|
||||
tool.ability.silktouch=Behutsamkeit
|
||||
tool.ability.smelter=Auto-Ofen
|
||||
|
||||
wavelengths.name.ir=Infrarot
|
||||
wavelengths.name.visible=Sichtbares Licht
|
||||
wavelengths.name.uv=Ultraviolett
|
||||
wavelengths.name.gamma=Gamma
|
||||
wavelengths.name.drx=Digamma
|
||||
wavelengths.waveRange.ir=780nm-1mm
|
||||
wavelengths.waveRange.visible=400nm-780nm
|
||||
wavelengths.waveRange.uv=100nm-400nm
|
||||
wavelengths.waveRange.gamma=<100pm
|
||||
wavelengths.waveRange.drx=1916169 Plancklängen
|
||||
|
||||
weapon.ability.beheader=Köpfer
|
||||
weapon.ability.bobble=Glück des Sammlers
|
||||
# Should rhyme with the translation for "chainsaw"
|
||||
|
||||
@ -367,8 +367,10 @@ container.machineCMB=CMB Steel Furnace
|
||||
container.machineCoal=Combustion Generator
|
||||
container.machineDiesel=Diesel Generator
|
||||
container.machineElectricBoiler=Electric Boiler
|
||||
container.machineFEL=FEL
|
||||
container.machineITER=Fusion Reactor
|
||||
container.machineLargeTurbine=Industrial Steam Turbine
|
||||
container.machineLiquefactor=Liquefactor
|
||||
container.machineRefinery=Oil Refinery
|
||||
container.machineSelenium=Radial Performance Engine
|
||||
container.machineShredder=Shredder
|
||||
@ -1851,6 +1853,15 @@ item.key_kit.name=Key Imitation Kit
|
||||
item.key_red.name=Red Key
|
||||
item.key_red.desc=Explore the other side.
|
||||
item.key_red.desc.P11=§4e§r
|
||||
item.laser_crystal_bismuth.desc=Bismuth-Samarium-Uranium-Thorium crystal matrix
|
||||
item.laser_crystal_bismuth.name=BiSmUTh Laser Crystal
|
||||
item.laser_crystal_cmb.desc=Antischrabidium Suspended in a CMB-Schrabidate Alloy Lattice
|
||||
item.laser_crystal_cmb.name=CMB-Schrabidate Antimatter Laser Crystal
|
||||
item.laser_crystal_co2.desc=Carbon Dioxide encased in Crystalline Desh
|
||||
item.laser_crystal_co2.name=CO2-Desh Laser Crystal
|
||||
item.laser_crystal_digamma.name=Digamma Laser Crystal
|
||||
item.laser_crystal_dnt.desc=Dineutronium-Spark Fermion Supercrystal
|
||||
item.laser_crystal_dnt.name=Spark Laser Crystal
|
||||
item.lead_gavel.name=Leaden Gavel
|
||||
item.lemon.name="Lemon"
|
||||
item.letter.name=Express Mail
|
||||
@ -3504,6 +3515,7 @@ tile.machine_drill.name=Automatic Mining Drill
|
||||
tile.machine_electric_furnace_off.name=Electric Furnace
|
||||
tile.machine_electric_furnace_on.name=Electric Furnace
|
||||
tile.machine_epress.name=Electric Press
|
||||
tile.machine_fel.name=FEL
|
||||
tile.machine_fensu.name=FEnSU
|
||||
tile.machine_flare.name=Gas Flare
|
||||
tile.machine_fluidtank.name=Tank
|
||||
@ -3902,6 +3914,17 @@ tool.ability.shredder=Auto-Shredder
|
||||
tool.ability.silktouch=Silk Touch
|
||||
tool.ability.smelter=Auto-Smelter
|
||||
|
||||
wavelengths.name.ir=Infrared
|
||||
wavelengths.name.visible=Visible Light
|
||||
wavelengths.name.uv=Ultraviolet
|
||||
wavelengths.name.gamma=Gamma
|
||||
wavelengths.name.drx=Digamma
|
||||
wavelengths.waveRange.ir=780nm-1mm
|
||||
wavelengths.waveRange.visible=400nm-780nm
|
||||
wavelengths.waveRange.uv=100nm-400nm
|
||||
wavelengths.waveRange.gamma=<100pm
|
||||
wavelengths.waveRange.drx=1916169 planck lengths
|
||||
|
||||
weapon.ability.beheader=Decapitator
|
||||
weapon.ability.bobble=Luck of the Collector
|
||||
# Should rhyme with the translation for "chainsaw"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 530 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Loading…
x
Reference in New Issue
Block a user