chemfac, look overlays on some machines, some bugfixes,

This commit is contained in:
Bob 2022-03-06 18:59:04 +01:00
parent f8cb3ee1ed
commit 9471d66c6e
30 changed files with 10140 additions and 73 deletions

View File

@ -1,7 +1,15 @@
package com.hbm.blocks;
import java.util.ArrayList;
import java.util.List;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
@ -9,4 +17,40 @@ public interface ILookOverlay {
@SideOnly(Side.CLIENT)
public void printHook(RenderGameOverlayEvent.Pre event, World world, int x, int y, int z);
@SideOnly(Side.CLIENT)
public static void printGeneric(RenderGameOverlayEvent.Pre event, String title, int titleCol, int bgCol, List<String> text) {
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution resolution = event.resolution;
GL11.glPushMatrix();
int pX = resolution.getScaledWidth() / 2 + 8;
int pZ = resolution.getScaledHeight() / 2;
List<String> exceptions = new ArrayList();
exceptions.add("x");
exceptions.add("y");
exceptions.add("z");
exceptions.add("items");
exceptions.add("id");
mc.fontRenderer.drawString(title, pX + 1, pZ - 9, bgCol);
mc.fontRenderer.drawString(title, pX, pZ - 10, titleCol);
for(String line : text) {
if(exceptions.contains(line))
continue;
mc.fontRenderer.drawStringWithShadow(line, pX, pZ, 0xFFFFFF);
pZ += 10;
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
}
}

View File

@ -940,6 +940,7 @@ public class ModBlocks {
public static Block machine_chemplant;
public static final int guiID_machine_chemplant = 49;
public static Block machine_chemfac;
public static Block machine_fluidtank;
public static final int guiID_machine_fluidtank = 50;
@ -2060,9 +2061,10 @@ public class ModBlocks {
drill_pipe = new BlockNoDrop(Material.iron).setBlockName("drill_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":drill_pipe");
machine_mining_laser = new MachineMiningLaser(Material.iron).setBlockName("machine_mining_laser").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_mining_laser");
barricade = new BlockNoDrop(Material.sand).setBlockName("barricade").setHardness(1.0F).setResistance(2.5F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":barricade");
machine_assembler = new MachineAssembler(Material.iron).setBlockName("machine_assembler").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_assembler");
machine_chemplant = new MachineChemplant(Material.iron).setBlockName("machine_chemplant").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_chemplant");
machine_fluidtank = new MachineFluidTank(Material.iron).setBlockName("machine_fluidtank").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_fluidtank");
machine_assembler = new MachineAssembler(Material.iron).setBlockName("machine_assembler").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_assembler");
machine_chemplant = new MachineChemplant(Material.iron).setBlockName("machine_chemplant").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_chemplant");
machine_chemfac = new MachineChemfac(Material.iron).setBlockName("machine_chemfac").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_fluidtank = new MachineFluidTank(Material.iron).setBlockName("machine_fluidtank").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_fluidtank");
machine_bat9000 = new MachineBigAssTank9000(Material.iron).setBlockName("machine_bat9000").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_orbus = new MachineOrbus(Material.iron).setBlockName("machine_orbus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_turbofan = new MachineTurbofan(Material.iron).setBlockName("machine_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_turbofan");
@ -2968,6 +2970,7 @@ public class ModBlocks {
GameRegistry.registerBlock(machine_microwave, machine_microwave.getUnlocalizedName());
GameRegistry.registerBlock(machine_assembler, machine_assembler.getUnlocalizedName());
GameRegistry.registerBlock(machine_chemplant, machine_chemplant.getUnlocalizedName());
GameRegistry.registerBlock(machine_chemfac, machine_chemfac.getUnlocalizedName());
GameRegistry.registerBlock(machine_fluidtank, machine_fluidtank.getUnlocalizedName());
GameRegistry.registerBlock(machine_bat9000, machine_bat9000.getUnlocalizedName());
GameRegistry.registerBlock(machine_orbus, machine_orbus.getUnlocalizedName());

View File

@ -1,23 +1,30 @@
package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.oil.TileEntityMachineCatalyticCracker;
import com.hbm.util.I18nUtil;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
import net.minecraftforge.common.util.ForgeDirection;
public class MachineCatalyticCracker extends BlockDummyable {
public class MachineCatalyticCracker extends BlockDummyable implements ILookOverlay {
public MachineCatalyticCracker(Material mat) {
super(mat);
@ -49,7 +56,7 @@ public class MachineCatalyticCracker extends BlockDummyable {
if(!world.isRemote && !player.isSneaking()) {
if(player.getHeldItem() == null || player.getHeldItem().getItem() == ModItems.fluid_identifier) {
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.fluid_identifier) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null)
@ -61,20 +68,10 @@ public class MachineCatalyticCracker extends BlockDummyable {
return false;
TileEntityMachineCatalyticCracker cracker = (TileEntityMachineCatalyticCracker) te;
if(player.getHeldItem() == null) {
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "=== CATALYTIC CRACKING TOWER ==="));
for(int i = 0; i < cracker.tanks.length; i++)
player.addChatComponentMessage(new ChatComponentTranslation("hbmfluid." + cracker.tanks[i].getTankType().getName().toLowerCase()).appendSibling(new ChatComponentText(": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB")));
} else {
FluidType type = Fluids.fromID(player.getHeldItem().getItemDamage());
cracker.tanks[0].setTankType(type);
cracker.markDirty();
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Changed type to " + type + "!"));
}
FluidType type = Fluids.fromID(player.getHeldItem().getItemDamage());
cracker.tanks[0].setTankType(type);
cracker.markDirty();
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase())).appendSibling(new ChatComponentText("!")));
return true;
}
@ -115,4 +112,26 @@ public class MachineCatalyticCracker extends BlockDummyable {
this.makeExtra(world, x + dir.offsetX * o - dir.offsetX * 2 + rot.offsetX * 2, y + dir.offsetY * o, z + dir.offsetZ * o - dir.offsetZ * 2 + rot.offsetZ * 2);
this.makeExtra(world, x + dir.offsetX * o - dir.offsetX * 2 - rot.offsetX * 3, y + dir.offsetY * o, z + dir.offsetZ * o - dir.offsetZ * 2 - rot.offsetZ * 3);
}
@Override
public void printHook(Pre event, World world, int x, int y, int z) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null)
return;
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
if(!(te instanceof TileEntityMachineCatalyticCracker))
return;
TileEntityMachineCatalyticCracker cracker = (TileEntityMachineCatalyticCracker) te;
List<String> text = new ArrayList();
for(int i = 0; i < cracker.tanks.length; i++)
text.add((i < 2 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + cracker.tanks[i].getTankType().getName().toLowerCase()) + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x808000, text);
}
}

View File

@ -0,0 +1,45 @@
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);
}
}

View File

@ -1,11 +1,16 @@
package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.oil.TileEntityMachineFractionTower;
import com.hbm.util.I18nUtil;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
@ -15,9 +20,10 @@ import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
import net.minecraftforge.common.util.ForgeDirection;
public class MachineFractionTower extends BlockDummyable {
public class MachineFractionTower extends BlockDummyable implements ILookOverlay {
public MachineFractionTower(Material mat) {
super(mat);
@ -49,7 +55,7 @@ public class MachineFractionTower extends BlockDummyable {
if(!world.isRemote && !player.isSneaking()) {
if(player.getHeldItem() == null || player.getHeldItem().getItem() == ModItems.fluid_identifier) {
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.fluid_identifier) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null)
@ -62,22 +68,13 @@ public class MachineFractionTower extends BlockDummyable {
TileEntityMachineFractionTower frac = (TileEntityMachineFractionTower) te;
if(player.getHeldItem() == null) {
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "=== FRACTIONING TOWER Y:" + pos[1] + " ==="));
for(int i = 0; i < frac.tanks.length; i++)
player.addChatComponentMessage(new ChatComponentTranslation("hbmfluid." + frac.tanks[i].getTankType().getName().toLowerCase()).appendSibling(new ChatComponentText(": " + frac.tanks[i].getFill() + "/" + frac.tanks[i].getMaxFill() + "mB")));
if(world.getTileEntity(pos[0], pos[1] - 3, pos[2]) instanceof TileEntityMachineFractionTower) {
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "You can only change the type in the bottom segment!"));
} else {
if(world.getTileEntity(pos[0], pos[1] - 3, pos[2]) instanceof TileEntityMachineFractionTower) {
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "You can only change the type in the bottom segment!"));
} else {
FluidType type = Fluids.fromID(player.getHeldItem().getItemDamage());
frac.tanks[0].setTankType(type);
frac.markDirty();
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase())).appendSibling(new ChatComponentText("!")));
}
FluidType type = Fluids.fromID(player.getHeldItem().getItemDamage());
frac.tanks[0].setTankType(type);
frac.markDirty();
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase())).appendSibling(new ChatComponentText("!")));
}
return true;
@ -101,4 +98,26 @@ public class MachineFractionTower extends BlockDummyable {
this.makeExtra(world, x, y, z + 1);
this.makeExtra(world, x, y, z - 1);
}
@Override
public void printHook(Pre event, World world, int x, int y, int z) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null)
return;
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
if(!(te instanceof TileEntityMachineFractionTower))
return;
TileEntityMachineFractionTower cracker = (TileEntityMachineFractionTower) te;
List<String> text = new ArrayList();
for(int i = 0; i < cracker.tanks.length; i++)
text.add((i == 0 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + cracker.tanks[i].getTankType().getName().toLowerCase()) + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x808000, text);
}
}

View File

@ -23,6 +23,10 @@ public class ToolboxCraftingHandler implements IRecipe {
ItemStack stack = inventory.getStackInRowAndColumn(i % 3, i / 3);
if(stack != null) {
if(stack.getItem().hasContainerItem(stack) || !stack.getItem().doesContainerItemLeaveCraftingGrid(stack))
return false;
itemCount++;
if(stack.getItem() == ModItems.kit_toolbox_empty) {

View File

@ -30,6 +30,7 @@ public class GUIHandler implements IGuiHandler {
if(entity instanceof TileEntityMachineLiquefactor) { return new ContainerLiquefactor(player.inventory, (TileEntityMachineLiquefactor) entity); }
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); }
switch(ID) {
case ModBlocks.guiID_test_difurnace: {
@ -870,6 +871,7 @@ public class GUIHandler implements IGuiHandler {
if(entity instanceof TileEntityMachineLiquefactor) { return new GUILiquefactor(player.inventory, (TileEntityMachineLiquefactor) entity); }
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); }
switch(ID) {
case ModBlocks.guiID_test_difurnace: {

View File

@ -0,0 +1,38 @@
package com.hbm.inventory.container;
import com.hbm.tileentity.machine.TileEntityMachineChemfac;
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 ContainerChemfac extends Container {
private TileEntityMachineChemfac chemfac;
public ContainerChemfac(InventoryPlayer playerInv, TileEntityMachineChemfac tile) {
chemfac = tile;
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 chemfac.isUseableByPlayer(player);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
return null;
}
}

View File

@ -0,0 +1,47 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerChemfac;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityMachineChemfac;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIChemfac extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_chemfac.png");
private TileEntityMachineChemfac chemfac;
public GUIChemfac(InventoryPlayer invPlayer, TileEntityMachineChemfac tedf) {
super(new ContainerChemfac(invPlayer, tedf));
chemfac = tedf;
this.xSize = 256;
this.ySize = 256;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.chemfac.hasCustomInventoryName() ? this.chemfac.getInventoryName() : I18n.format(this.chemfac.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - 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);
}
}

View File

@ -75,29 +75,26 @@ public class GUIMachineBoilerElectric extends GuiInfoContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
//<insert witty line here>
TileEntityMachineBoilerElectric dud = diFurnace;
if(diFurnace.isInvalid() && diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord) instanceof TileEntityMachineBoilerElectric)
dud = (TileEntityMachineBoilerElectric) diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord);
diFurnace = (TileEntityMachineBoilerElectric) diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord);
if(dud.power > 0)
if(diFurnace.power > 0)
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 176, 0, 18, 18);
int j = (int)dud.getHeatScaled(17);
int j = (int)diFurnace.getHeatScaled(17);
drawTexturedModalRect(guiLeft + 103, guiTop + 33 - j, 194, 16 - j, 6, j);
int i = (int)dud.getPowerScaled(34);
int i = (int)diFurnace.getPowerScaled(34);
drawTexturedModalRect(guiLeft + 123, guiTop + 69 - i, 200, 34 - i, 7, i);
this.drawInfoPanel(guiLeft - 16, guiTop + 36, 16, 16, 2);
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 16, 16, 16, 3);
if(dud.tanks[1].getTankType().name().equals(Fluids.NONE.name())) {
if(diFurnace.tanks[1].getTankType().name().equals(Fluids.NONE.name())) {
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 32, 16, 16, 6);
}
dud.tanks[0].renderTank(guiLeft + 62, guiTop + 69, this.zLevel, 16, 52);
dud.tanks[1].renderTank(guiLeft + 134, guiTop + 69, this.zLevel, 16, 52);
diFurnace.tanks[0].renderTank(guiLeft + 62, guiTop + 69, this.zLevel, 16, 52);
diFurnace.tanks[1].renderTank(guiLeft + 134, guiTop + 69, this.zLevel, 16, 52);
}
}

View File

@ -2,7 +2,6 @@ package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.container.ContainerSolidifier;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.oil.TileEntityMachineSolidifier;

View File

@ -166,7 +166,7 @@ public class RefineryRecipes {
ItemFluidIcon.make(Fluids.SPENTSTEAM, 2)
};
recipes.put(in, recipe.getValue().getValue().type == Fluids.NONE ? ItemFluidIcon.make(recipe.getValue().getKey()) : out);
recipes.put(in, recipe.getValue().getValue().type == Fluids.NONE ? new ItemStack[] {ItemFluidIcon.make(recipe.getValue().getKey()), ItemFluidIcon.make(Fluids.SPENTSTEAM, 2)} : out);
}
return recipes;

View File

@ -172,6 +172,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineMiningLaser.class, new RenderLaserMiner());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAssembler.class, new RenderAssembler());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineChemplant.class, new RenderChemplant());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineChemfac.class, new RenderChemfac());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFluidTank.class, new RenderFluidTank());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineBAT9000.class, new RenderBAT9000());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineOrbus.class, new RenderOrbus());

View File

@ -118,6 +118,7 @@ public class ResourceManager {
public static final IModelCustom chemplant_piston = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/chemplant_new_piston.obj"));
public static final IModelCustom chemplant_fluid = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/chemplant_new_fluid.hmf"));
public static final IModelCustom chemplant_fluidcap = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/chemplant_new_fluidcap.hmf"));
public static final IModelCustom chemfac = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/chemfac.obj"));
//F6 TANKS
public static final IModelCustom tank = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/tank.obj"));
@ -409,8 +410,9 @@ public class ResourceManager {
//Chemplant
public static final ResourceLocation chemplant_body_tex = new ResourceLocation(RefStrings.MODID, "textures/models/chemplant_base_new.png");
public static final ResourceLocation chemplant_spinner_tex = new ResourceLocation(RefStrings.MODID, "textures/models/chemplant_spinner_new.png");
public static final ResourceLocation chemplant_piston_tex = new ResourceLocation(RefStrings.MODID, "textures/models/chemplant_piston_new.png");
public static final ResourceLocation chemplant_fluid_tex = new ResourceLocation(RefStrings.MODID, "textures/models/lavabase_small.png");
public static final ResourceLocation chemplant_piston_tex = new ResourceLocation(RefStrings.MODID, "textures/models/chemplant_piston_new.png");
public static final ResourceLocation chemplant_fluid_tex = new ResourceLocation(RefStrings.MODID, "textures/models/lavabase_small.png");
public static final ResourceLocation chemfac_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/chemfac.png");
//F6 TANKS
public static final ResourceLocation uf6_tex = new ResourceLocation(RefStrings.MODID, "textures/models/UF6Tank.png");

View File

@ -0,0 +1,54 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.BlockDummyable;
import com.hbm.main.ResourceManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderChemfac extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
switch(tileEntity.getBlockMetadata() - BlockDummyable.offset) {
case 5: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 2: GL11.glRotatef(270, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 3: GL11.glRotatef(90, 0F, 1F, 0F); break;
}
GL11.glTranslated(0.5D, 0.0D, -0.5D);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.chemfac_tex);
ResourceManager.chemfac.renderPart("Main");
float slowdown = 2.5F;
GL11.glPushMatrix();
GL11.glTranslated(1, 0, 0);
GL11.glRotated(System.currentTimeMillis() % (int)(360 * slowdown) / slowdown + f, 0, -1, 0);
GL11.glTranslated(-1, 0, 0);
ResourceManager.chemfac.renderPart("Fan1");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(-1, 0, 0);
GL11.glRotated(System.currentTimeMillis() % (int)(360 * slowdown) / slowdown + f, 0, -1, 0);
GL11.glTranslated(1, 0, 0);
ResourceManager.chemfac.renderPart("Fan2");
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -1,8 +1,17 @@
package com.hbm.tileentity;
import com.hbm.packet.NBTPacket;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
public interface INBTPacketReceiver {
public void networkUnpack(NBTTagCompound nbt);
public static void networkPack(TileEntity that, NBTTagCompound data, int range) {
PacketDispatcher.wrapper.sendToAllAround(new NBTPacket(data, that.xCoord, that.yCoord, that.zCoord), new TargetPoint(that.getWorldObj().provider.dimensionId, that.xCoord, that.yCoord, that.zCoord, range));
}
}

View File

@ -247,6 +247,8 @@ public class TileMappings {
put(TileEntityMachineSolidifier.class, "tileentity_solidifier");
put(TileEntityMachineChemplant.class, "tileentity_chemical_plant");
put(TileEntityMachineChemfac.class, "tileentity_chemfac");
put(TileEntityMachineOilWell.class, "tileentity_derrick");
put(TileEntityMachinePumpjack.class, "tileentity_machine_pumpjack");
put(TileEntityMachineFrackingTower.class, "tileentity_fracking_tower");

View File

@ -0,0 +1,81 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.inventory.fluid.FluidType;
import net.minecraft.util.ChunkCoordinates;
public class TileEntityMachineChemfac extends TileEntityMachineChemplantBase {
public TileEntityMachineChemfac() {
super(77);
}
@Override
public long getMaxPower() {
return 0;
}
@Override
public void fillFluidInit(FluidType type) {
}
@Override
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
}
@Override
public boolean getTact() {
return false;
}
@Override
public List<IFluidAcceptor> getFluidList(FluidType type) {
return new ArrayList();
}
@Override
public void clearFluidList(FluidType type) {
}
@Override
public int getRecipeCount() {
return 0;
}
@Override
public int getTankCapacity() {
return 0;
}
@Override
public int getTemplateIndex(int index) {
return 0;
}
@Override
public int[] getSlotIndicesFromIndex(int index) {
return new int[] {4, 4, 4, 4}; //yeah whatever
}
@Override
public ChunkCoordinates[] getInputPositions() {
return new ChunkCoordinates[0];
}
@Override
public ChunkCoordinates[] getOutputPositions() {
return new ChunkCoordinates[0];
}
@Override
public String getName() {
return "container.machineChemFac";
}
}

View File

@ -16,6 +16,8 @@ import com.hbm.inventory.recipes.ChemplantRecipes.ChemRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.InventoryUtil;
@ -35,6 +37,8 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
public int maxProgress = 100;
public boolean isProgressing;
private AudioWrapper audio;
public FluidTank[] tanks;
//upgraded stats
@ -86,7 +90,7 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
loadItems();
unloadItems();
if(worldObj.getTotalWorldTime() % 1 == 0) {
if(worldObj.getTotalWorldTime() % 10 == 0) {
this.fillFluidInit(tanks[2].getTankType());
this.fillFluidInit(tanks[3].getTankType());
}
@ -136,6 +140,23 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
double z = zCoord + 0.5 + dir.offsetZ * 1.125 + rot.offsetZ * 0.125;
worldObj.spawnParticle("cloud", x, y, z, 0.0, 0.1, 0.0);
}
float volume = this.getVolume(2);
if(isProgressing && volume > 0) {
if(audio == null) {
audio = MainRegistry.proxy.getLoopedSound("hbm:block.chemplantOperate", xCoord, yCoord, zCoord, volume, 1.0F);
audio.startSound();
}
} else {
if(audio != null) {
audio.stopSound();
audio = null;
}
}
}
}
@ -150,6 +171,26 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
tanks[i].readFromNBT(nbt, "t" + i);
}
}
@Override
public void onChunkUnload() {
if(audio != null) {
audio.stopSound();
audio = null;
}
}
@Override
public void invalidate() {
super.invalidate();
if(audio != null) {
audio.stopSound();
audio = null;
}
}
private void updateConnections() {

View File

@ -0,0 +1,371 @@
package com.hbm.tileentity.machine;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidSource;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.ChemplantRecipes;
import com.hbm.inventory.recipes.ChemplantRecipes.ChemRecipe;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.InventoryUtil;
import api.hbm.energy.IEnergyUser;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
/**
* Base class for single and multi chemplants.
* Most stuff should be handled by this class automatically, given the slots and indices are defined correctly
* Does not sync automatically, nor handle upgrades
* Slot indices are mostly free game, but battery has to be slot 0
* Tanks follow the order R1(I1, I2, O1, O2), R2(I1, I2, O1, O2) ...
* @author hbm
*/
public abstract class TileEntityMachineChemplantBase extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidAcceptor {
public long power;
public int[] progress;
public int maxProgress = 100;
public boolean isProgressing;
public FluidTank[] tanks;
int consumption = 100;
int speed = 100;
public TileEntityMachineChemplantBase(int scount) {
super(scount);
int count = this.getRecipeCount();
progress = new int[count];
tanks = new FluidTank[4 * count];
for(int i = 0; i < 4 * count; i++) {
tanks[i] = new FluidTank(Fluids.NONE, getTankCapacity(), i);
}
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
int count = this.getRecipeCount();
this.isProgressing = false;
this.power = Library.chargeTEFromItems(slots, 0, power, this.getMaxPower());
for(int i = 0; i < count; i++) {
loadItems(i);
unloadItems(i);
}
if(worldObj.getTotalWorldTime() % 1 == 0) {
for(int i = 0; i < count; i++) {
this.fillFluidInit(tanks[i * 4 + 2].getTankType());
this.fillFluidInit(tanks[i * 4 + 3].getTankType());
}
}
for(int i = 0; i < count; i++) {
if(!canProcess(i)) {
this.progress[i] = 0;
} else {
isProgressing = true;
process(i);
}
}
}
}
private boolean canProcess(int index) {
int template = getTemplateIndex(index);
if(slots[template] == null || slots[template].getItem() != ModItems.chemistry_template)
return false;
ChemRecipe recipe = ChemplantRecipes.indexMapping.get(slots[template].getItemDamage());
if(recipe == null)
return false;
setupTanks(recipe, index);
if(this.power < this.consumption) return false;
if(!hasRequiredFluids(recipe, index)) return false;
if(!hasSpaceForFluids(recipe, index)) return false;
if(!hasRequiredItems(recipe, index)) return false;
if(!hasSpaceForItems(recipe, index)) return false;
return true;
}
private void setupTanks(ChemRecipe recipe, int index) {
if(recipe.inputFluids[0] != null) tanks[index * 4].setTankType(recipe.inputFluids[0].type);
if(recipe.inputFluids[1] != null) tanks[index * 4 + 1].setTankType(recipe.inputFluids[1].type);
if(recipe.outputFluids[0] != null) tanks[index * 4 + 2].setTankType(recipe.outputFluids[0].type);
if(recipe.outputFluids[1] != null) tanks[index * 4 + 3].setTankType(recipe.outputFluids[1].type);
}
private boolean hasRequiredFluids(ChemRecipe recipe, int index) {
if(recipe.inputFluids[0] != null && tanks[index * 4].getFill() < recipe.inputFluids[0].fill) return false;
if(recipe.inputFluids[1] != null && tanks[index * 4 + 1].getFill() < recipe.inputFluids[1].fill) return false;
return true;
}
private boolean hasSpaceForFluids(ChemRecipe recipe, int index) {
if(recipe.outputFluids[0] != null && tanks[index * 4 + 2].getFill() + recipe.outputFluids[0].fill > tanks[index * 4 + 2].getMaxFill()) return false;
if(recipe.outputFluids[1] != null && tanks[index * 4 + 3].getFill() + recipe.outputFluids[1].fill > tanks[index * 4 + 3].getMaxFill()) return false;
return true;
}
private boolean hasRequiredItems(ChemRecipe recipe, int index) {
int[] indices = getSlotIndicesFromIndex(index);
return InventoryUtil.doesArrayHaveIngredients(slots, indices[2], indices[3], recipe.inputs);
}
private boolean hasSpaceForItems(ChemRecipe recipe, int index) {
int[] indices = getSlotIndicesFromIndex(index);
return InventoryUtil.doesArrayHaveSpace(slots, indices[0], indices[1], recipe.outputs);
}
private void process(int index) {
this.power -= this.consumption;
this.progress[index]++;
if(slots[0] != null && slots[0].getItem() == ModItems.meteorite_sword_machined)
slots[0] = new ItemStack(ModItems.meteorite_sword_treated); //fisfndmoivndlmgindgifgjfdnblfm
int template = getTemplateIndex(index);
ChemRecipe recipe = ChemplantRecipes.indexMapping.get(slots[template].getItemDamage());
this.maxProgress = recipe.getDuration() * this.speed / 100;
if(this.progress[index] >= this.maxProgress) {
consumeFluids(recipe, index);
produceFluids(recipe, index);
consumeItems(recipe, index);
produceItems(recipe, index);
this.progress[index] = 0;
this.markDirty();
}
}
private void consumeFluids(ChemRecipe recipe, int index) {
if(recipe.inputFluids[0] != null) tanks[index * 4].setFill(tanks[index * 4].getFill() - recipe.inputFluids[0].fill);
if(recipe.inputFluids[1] != null) tanks[index * 4 + 1].setFill(tanks[index * 4 + 1].getFill() - recipe.inputFluids[1].fill);
}
private void produceFluids(ChemRecipe recipe, int index) {
if(recipe.outputFluids[0] != null) tanks[index * 4 + 2].setFill(tanks[index * 4 + 2].getFill() + recipe.outputFluids[0].fill);
if(recipe.outputFluids[1] != null) tanks[index * 4 + 3].setFill(tanks[index * 4 + 3].getFill() + recipe.outputFluids[1].fill);
}
private void consumeItems(ChemRecipe recipe, int index) {
int[] indices = getSlotIndicesFromIndex(index);
for(AStack in : recipe.inputs) {
if(in != null)
InventoryUtil.tryConsumeAStack(slots, indices[2], indices[3], in);
}
}
private void produceItems(ChemRecipe recipe, int index) {
int[] indices = getSlotIndicesFromIndex(index);
for(ItemStack out : recipe.outputs) {
if(out != null)
InventoryUtil.tryAddItemToInventory(slots, indices[0], indices[1], out.copy());
}
}
private void loadItems(int index) {
int template = getTemplateIndex(index);
if(slots[template] == null || slots[template].getItem() != ModItems.chemistry_template)
return;
ChemRecipe recipe = ChemplantRecipes.indexMapping.get(slots[template].getItemDamage());
if(recipe != null) {
ChunkCoordinates[] positions = getInputPositions();
int[] indices = getSlotIndicesFromIndex(index);
for(ChunkCoordinates coord : positions) {
TileEntity te = worldObj.getTileEntity(coord.posX, coord.posY, coord.posZ);
if(te instanceof IInventory) {
IInventory inv = (IInventory) te;
for(AStack ingredient : recipe.inputs) {
if(!InventoryUtil.doesArrayHaveIngredients(slots, indices[0], indices[1], ingredient)) {
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
if(ingredient.matchesRecipe(stack, true)) {
for(int j = indices[0]; j <= indices[1]; j++) {
if(slots[j] != null && slots[j].stackSize < slots[j].getMaxStackSize() & InventoryUtil.doesStackDataMatch(slots[j], stack)) {
inv.decrStackSize(i, 1);
slots[j].stackSize++;
return;
}
}
for(int j = indices[0]; j <= indices[1]; j++) {
if(slots[j] == null) {
slots[j] = stack.copy();
slots[j].stackSize = 1;
inv.decrStackSize(i, 1);
return;
}
}
}
}
}
}
}
}
}
}
private void unloadItems(int index) {
ChunkCoordinates[] positions = getOutputPositions();
int[] indices = getSlotIndicesFromIndex(index);
for(ChunkCoordinates coord : positions) {
TileEntity te = worldObj.getTileEntity(coord.posX, coord.posY, coord.posZ);
if(te instanceof IInventory) {
IInventory inv = (IInventory) te;
for(int i = indices[2]; i <= indices[3]; i++) {
ItemStack out = slots[i];
if(out != null) {
for(int j = 0; j < inv.getSizeInventory(); j++) {
ItemStack target = inv.getStackInSlot(j);
if(InventoryUtil.doesStackDataMatch(out, target) && target.stackSize < target.getMaxStackSize()) {
this.decrStackSize(i, 1);
target.stackSize++;
return;
}
}
for(int j = 0; j < inv.getSizeInventory(); j++) {
if(inv.getStackInSlot(j) == null) {
inv.setInventorySlotContents(j, out.copy());
inv.getStackInSlot(j).stackSize = 1;
this.decrStackSize(i, 1);
return;
}
}
}
}
}
}
}
@Override
public long getPower() {
return this.power;
}
@Override
public void setPower(long power) {
this.power = power;
}
@Override
public void setFillForSync(int fill, int index) {
if(index >= 0 && index < tanks.length) tanks[index].setFill(fill);
}
@Override
public void setFluidFill(int fill, FluidType type) {
//TODO: figure this shit out
//also this won't work anyway since there's no difference as of now between setting in or output tanks
//the recent rework tried to implement that difference but we all know how that went
/*for(FluidTank tank : tanks) {
if(tank.getTankType() == type) {
tank.setFill(fill);
return;
}
}*/
}
@Override
public void setTypeForSync(FluidType type, int index) {
if(index >= 0 && index < tanks.length) tanks[index].setTankType(type);
}
@Override
public int getFluidFill(FluidType type) {
int fill = 0;
for(FluidTank tank : tanks) {
if(tank.getTankType() == type) {
fill += tank.getFill();
}
}
return fill;
}
/* For input only! */
@Override
public int getMaxFluidFill(FluidType type) {
int maxFill = 0;
int count = getRecipeCount();
for(int i = 0; i < count; i++) {
if(tanks[i * 4].getTankType() == type) maxFill += tanks[i * 4].getMaxFill();
if(tanks[i * 4 + 1].getTankType() == type) maxFill += tanks[i * 4 + 1].getMaxFill();
}
return maxFill;
}
public abstract int getRecipeCount();
public abstract int getTankCapacity();
public abstract int getTemplateIndex(int index);
/**
* @param index
* @return A size 4 int array containing min input, max input, min output and max output indices in that order.
*/
public abstract int[] getSlotIndicesFromIndex(int index);
public abstract ChunkCoordinates[] getInputPositions();
public abstract ChunkCoordinates[] getOutputPositions();
}

View File

@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.RefineryRecipes;
import com.hbm.lib.Library;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.util.Tuple.Pair;
import cpw.mods.fml.relauncher.Side;
@ -21,7 +22,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineCatalyticCracker extends TileEntity implements IFluidSource, IFluidAcceptor {
public class TileEntityMachineCatalyticCracker extends TileEntity implements IFluidSource, IFluidAcceptor, INBTPacketReceiver {
public FluidTank[] tanks;
public List<IFluidAcceptor> list1 = new ArrayList();
@ -51,9 +52,22 @@ public class TileEntityMachineCatalyticCracker extends TileEntity implements IFl
fillFluidInit(tanks[2].getTankType());
fillFluidInit(tanks[3].getTankType());
fillFluidInit(tanks[4].getTankType());
NBTTagCompound data = new NBTTagCompound();
for(int i = 0; i < 5; i++)
tanks[i].writeToNBT(data, "tank" + i);
INBTPacketReceiver.networkPack(this, data, 50);
}
}
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
for(int i = 0; i < 5; i++)
tanks[i].readFromNBT(nbt, "tank" + i);
}
private void crack() {

View File

@ -11,8 +11,8 @@ import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.RefineryRecipes;
import com.hbm.lib.Library;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.util.Tuple.Pair;
import com.hbm.util.Tuple.Quartet;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -20,9 +20,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
import scala.actors.threadpool.Arrays;
public class TileEntityMachineFractionTower extends TileEntity implements IFluidSource, IFluidAcceptor {
public class TileEntityMachineFractionTower extends TileEntity implements IFluidSource, IFluidAcceptor, INBTPacketReceiver {
public FluidTank[] tanks;
public List<IFluidAcceptor> list1 = new ArrayList();
@ -73,9 +72,22 @@ public class TileEntityMachineFractionTower extends TileEntity implements IFluid
if(worldObj.getTotalWorldTime() % 10 == 0) {
fillFluidInit(tanks[1].getTankType());
fillFluidInit(tanks[2].getTankType());
NBTTagCompound data = new NBTTagCompound();
for(int i = 0; i < 3; i++)
tanks[i].writeToNBT(data, "tank" + i);
INBTPacketReceiver.networkPack(this, data, 50);
}
}
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
for(int i = 0; i < 3; i++)
tanks[i].readFromNBT(nbt, "tank" + i);
}
private void setupTanks() {

View File

@ -20,8 +20,8 @@ public class SoundUtil {
Map nameMapping = (Map) ReflectionHelper.findField(SoundCategory.class, "field_147168_j").get(null);
Map idMapping = (Map) ReflectionHelper.findField(SoundCategory.class, "field_147169_k").get(null);
Map mapSoundLevelsOrig = (Map) ReflectionHelper.findField(GameSettings.class, "mapSoundLevels" /* TODO: add obfus case */).get(Minecraft.getMinecraft().gameSettings);
Map mapSoundLevels = Maps.newEnumMap(SoundCategory.class); //(Map) ReflectionHelper.findField(GameSettings.class, "mapSoundLevels" /* TODO: add obfus case */).get(Minecraft.getMinecraft().gameSettings);
Map mapSoundLevelsOrig = (Map) ReflectionHelper.findField(GameSettings.class, "mapSoundLevels", "field_151446_aD").get(Minecraft.getMinecraft().gameSettings);
Map mapSoundLevels = Maps.newEnumMap(SoundCategory.class);
nameMapping.put(category.getCategoryName(), category);
idMapping.put(Integer.valueOf(category.getCategoryId()), category);

View File

@ -2833,6 +2833,8 @@ rbmk.rod.xenon=Xenonvergiftung: %s
rbmk.rod.coreTemp=Kerntemperatur: %s
rbmk.rod.skinTemp=Außentemperatur: %s / %s
soundCategory.ntmMachines=NTM Maschinen
tile.absorber.name=Strahlungs-Absorber
tile.absorber_green.name=Fortgeschrittener Strahlungs-Absorber
tile.absorber_pink.name=Elite Strahlungs-Absorber

View File

@ -3196,6 +3196,8 @@ rbmk.rod.xenon=Xenon poison: %s
rbmk.rod.coreTemp=Core temperature: %s
rbmk.rod.skinTemp=Skin temperature: %s / %s
soundCategory.ntmMachines=NTM Machines
tile.absorber.name=Radiation Absorber
tile.absorber_green.name=Advanced Radiation Absorber
tile.absorber_pink.name=Elite Radiation Absorber

File diff suppressed because it is too large Load Diff

View File

@ -5,20 +5,20 @@
"misc.nullMine": {"category": "player", "sounds": [{"name": "misc/null", "stream": false}]},
"block.crateBreak": {"category": "block", "sounds": ["block/crateBreak1", "block/crateBreak2", "block/crateBreak3", "block/crateBreak4", "block/crateBreak5"]},
"block.shutdown": {"category": "block", "sounds": [{"name": "block/shutdown", "stream": true}]},
"block.minerOperate": {"category": "block", "sounds": [{"name": "block/minerOperate", "stream": true}]},
"block.assemblerOperate": {"category": "block", "sounds": [{"name": "block/assemblerOperate", "stream": true}]},
"block.chemplantOperate": {"category": "block", "sounds": [{"name": "block/chemplantOperate", "stream": true}]},
"block.dieselOperate": {"category": "block", "sounds": [{"name": "block/dieselOperate", "stream": true}]},
"block.igeneratorOperate": {"category": "block", "sounds": [{"name": "block/igeneratorOperate", "stream": true}]},
"block.turbofanOperate": {"category": "block", "sounds": [{"name": "block/turbofanOperate", "stream": true}]},
"block.pressOperate": {"category": "block", "sounds": [{"name": "block/pressOperate", "stream": false}]},
"block.shutdown": {"category": "ntmMachines", "sounds": [{"name": "block/shutdown", "stream": true}]},
"block.minerOperate": {"category": "ntmMachines", "sounds": [{"name": "block/minerOperate", "stream": true}]},
"block.assemblerOperate": {"category": "ntmMachines", "sounds": [{"name": "block/assemblerOperate", "stream": true}]},
"block.chemplantOperate": {"category": "ntmMachines", "sounds": [{"name": "block/chemplantOperate", "stream": true}]},
"block.dieselOperate": {"category": "ntmMachines", "sounds": [{"name": "block/dieselOperate", "stream": true}]},
"block.igeneratorOperate": {"category": "ntmMachines", "sounds": [{"name": "block/igeneratorOperate", "stream": true}]},
"block.turbofanOperate": {"category": "ntmMachines", "sounds": [{"name": "block/turbofanOperate", "stream": true}]},
"block.pressOperate": {"category": "ntmMachines", "sounds": [{"name": "block/pressOperate", "stream": false}]},
"block.broadcast1": {"category": "block", "sounds": [{"name": "block/broadcast1", "stream": true}]},
"block.broadcast2": {"category": "block", "sounds": [{"name": "block/broadcast2", "stream": true}]},
"block.broadcast3": {"category": "block", "sounds": [{"name": "block/broadcast3", "stream": true}]},
"block.sonarPing": {"category": "block", "sounds": [{"name": "block/sonarPing", "stream": false}]},
"block.reactorStart": {"category": "block", "sounds": [{"name": "block/reactorStart", "stream": false}]},
"block.reactorStop": {"category": "block", "sounds": [{"name": "block/reactorStop", "stream": false}]},
"block.sonarPing": {"category": "ntmMachines", "sounds": [{"name": "block/sonarPing", "stream": false}]},
"block.reactorStart": {"category": "ntmMachines", "sounds": [{"name": "block/reactorStart", "stream": false}]},
"block.reactorStop": {"category": "ntmMachines", "sounds": [{"name": "block/reactorStop", "stream": false}]},
"block.vaultScrape": {"category": "block", "sounds": [{"name": "block/vaultScrape", "stream": false}]},
"block.vaultThud": {"category": "block", "sounds": [{"name": "block/vaultThud", "stream": false}]},
"block.vaultScrapeNew": {"category": "block", "sounds": [{"name": "block/vaultScrapeNew", "stream": false}]},
@ -26,17 +26,17 @@
"block.lockOpen": {"category": "block", "sounds": [{"name": "block/lockOpen", "stream": false}]},
"block.lockHang": {"category": "block", "sounds": [{"name": "block/lockHang", "stream": false}]},
"block.debris": {"category": "block", "sounds": ["block/debris1", "block/debris2", "block/debris3"]},
"block.centrifugeOperate": {"category": "block", "sounds": [{"name": "block/centrifugeOperate", "stream": true}]},
"block.centrifugeOperate": {"category": "ntmMachines", "sounds": [{"name": "block/centrifugeOperate", "stream": true}]},
"block.pipePlaced": {"category": "block", "sounds": [{"name": "block/pipePlaced", "stream": false}]},
"block.missileAssembly": {"category": "block", "sounds": [{"name": "block/missileAssembly", "stream": false}]},
"block.missileAssembly2": {"category": "block", "sounds": [{"name": "block/missileAssembly2", "stream": false}]},
"block.missileAssembly": {"category": "ntmMachines", "sounds": [{"name": "block/missileAssembly", "stream": false}]},
"block.missileAssembly2": {"category": "ntmMachines", "sounds": [{"name": "block/missileAssembly2", "stream": false}]},
"block.openDoor": {"category": "block", "sounds": ["block/door_open_1", "block/door_open_2"]},
"block.closeDoor": {"category": "block", "sounds": ["block/door_close_1", "block/door_close_2"]},
"block.soyuzReady": {"category": "block", "sounds": [{"name": "block/soyuzReady", "stream": true}]},
"block.soyuzReady": {"category": "ntmMachines", "sounds": [{"name": "block/soyuzReady", "stream": true}]},
"block.screm": {"category": "block", "sounds": ["screm/scream1", "screm/scream01", "screm/scream2", "screm/scream02", "screm/scream3", "screm/scream03", "screm/scream4", "screm/scream04", "screm/scream5", "screm/scream05", "screm/scream6", "screm/scream06", "screm/scream7", "screm/scream07", "screm/scream08", "screm/scream09", "screm/scream10", "screm/scream11", "screm/scream12", "screm/scream13", "screm/scream14", "screm/scream15", "screm/scream16", "screm/scream17", "screm/scream18", "screm/scream19", "screm/scream20", "screm/scream21", "screm/scream22", "screm/scream23", "screm/scream24", "screm/scream25"]},
"block.rbmk_explosion": {"category": "block", "sounds": [{"name": "block/rbmk_explosion", "stream": false}]},
"block.rbmk_az5_cover": {"category": "block", "sounds": [{"name": "block/rbmk_az5_cover", "stream": false}]},
"block.chungusLever": {"category": "block", "sounds": [{"name": "block/chungusLever", "stream": false}]},
"block.chungusLever": {"category": "ntmMachines", "sounds": [{"name": "block/chungusLever", "stream": false}]},
"block.bobble": {"category": "block", "sounds": [{"name": "block/bobble", "stream": false}]},
"item.techBleep": {"category": "player", "sounds": [{"name": "tool/techBleep", "stream": false}]},

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB