Merge pull request #420 from Vaern/master

I can do anything
This commit is contained in:
HbmMods 2022-02-02 08:55:38 +01:00 committed by GitHub
commit be5b6a1cd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 3363 additions and 134 deletions

View File

@ -868,7 +868,8 @@ public class ModBlocks {
public static Block machine_geo;
public static Block machine_minirtg;
public static Block machine_powerrtg;
public static Block machine_radiolysis;
public static Block machine_well;
public static Block oil_pipe;
public static final int guiID_machine_well = 40;
@ -1789,7 +1790,8 @@ public class ModBlocks {
machine_geo = new MachineAmgen(Material.iron).setBlockName("machine_geo").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
machine_minirtg = new MachineMiniRTG(Material.iron).setBlockName("machine_minirtg").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rtg_cell");
machine_powerrtg = new MachineMiniRTG(Material.iron).setBlockName("machine_powerrtg").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rtg_polonium");
machine_radiolysis = new MachineRadiolysis(Material.iron).setBlockName("machine_radiolysis").setHardness(10.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
red_wire_coated = new WireCoated(Material.iron).setBlockName("red_wire_coated").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_wire_coated");
red_cable = new BlockCable(Material.iron).setBlockName("red_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cable_neo");
rf_cable = new BlockRFCable(Material.iron).setBlockName("rf_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rf_cable_icon");
@ -2819,6 +2821,7 @@ public class ModBlocks {
GameRegistry.registerBlock(machine_amgen, machine_amgen.getUnlocalizedName());
GameRegistry.registerBlock(machine_minirtg, machine_minirtg.getUnlocalizedName());
GameRegistry.registerBlock(machine_powerrtg, machine_powerrtg.getUnlocalizedName());
GameRegistry.registerBlock(machine_radiolysis, machine_radiolysis.getUnlocalizedName());
GameRegistry.registerBlock(machine_spp_bottom, machine_spp_bottom.getUnlocalizedName());
GameRegistry.registerBlock(machine_spp_top, machine_spp_top.getUnlocalizedName());

View File

@ -0,0 +1,71 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.BossSpawnHandler;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityMachineRadiolysis;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
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 MachineRadiolysis extends BlockDummyable {
public MachineRadiolysis(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12)
return new TileEntityMachineRadiolysis();
if(meta >= 6)
return new TileEntityProxyCombo(true, true, true);
return null;
}
@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()) {
BossSpawnHandler.markFBI(player);
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 false;
}
}
@Override
public int[] getDimensions() {
return new int[] {2, 0, 1, 1, 1, 1,};
}
@Override
public int getOffset() {
return 0;
}
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);
this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o);
this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o);
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o + 1);
this.makeExtra(world, x + dir.offsetX * o, y, z + dir.offsetZ * o - 1);
}
}

View File

@ -2,6 +2,7 @@ package com.hbm.crafting;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemRTGPelletDepleted.DepletedRTGMaterial;
import com.hbm.items.special.ItemWasteLong;
import com.hbm.items.special.ItemWasteShort;
import static com.hbm.inventory.OreDictManager.*;
@ -11,6 +12,7 @@ import net.minecraft.block.Block;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
@ -160,6 +162,9 @@ public class MineralRecipes {
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_po210be, 1), new Object[] { "nuggetPolonium210", "nuggetPolonium210", "nuggetPolonium210", ModItems.nugget_beryllium, ModItems.nugget_beryllium, ModItems.nugget_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_pu238be, 1), new Object[] { "nuggetPlutonium238", "nuggetPlutonium238", "nuggetPlutonium238", ModItems.nugget_beryllium, ModItems.nugget_beryllium, ModItems.nugget_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_ra226be, 1), new Object[] { "nuggetRadium226", "nuggetRadium226", "nuggetRadium226", ModItems.nugget_beryllium, ModItems.nugget_beryllium, ModItems.nugget_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_po210be, 2), new Object[] { ModItems.billet_polonium, ModItems.billet_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_pu238be, 2), new Object[] { ModItems.billet_pu238, ModItems.billet_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_ra226be, 2), new Object[] { ModItems.billet_ra226, ModItems.billet_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_po210be, 6), new Object[] { ModItems.billet_polonium, ModItems.billet_polonium, ModItems.billet_polonium, ModItems.billet_beryllium, ModItems.billet_beryllium, ModItems.billet_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_pu238be, 6), new Object[] { ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_pu238, ModItems.billet_beryllium, ModItems.billet_beryllium, ModItems.billet_beryllium }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.billet_ra226be, 6), new Object[] { ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_beryllium, ModItems.billet_beryllium, ModItems.billet_beryllium }));
@ -211,12 +216,22 @@ public class MineralRecipes {
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_radium), new Object[] { ModItems.billet_ra226, ModItems.billet_ra226, ModItems.billet_ra226, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_weak), new Object[] { ModItems.billet_u238, ModItems.billet_u238, ModItems.billet_pu238, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_strontium), new Object[] { ModItems.billet_sr90, ModItems.billet_sr90, ModItems.billet_sr90, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_cobalt), new Object[] { ModItems.billet_co60, ModItems.billet_co60, ModItems.billet_co60, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_actinium), new Object[] { ModItems.billet_actinium, ModItems.billet_actinium, ModItems.billet_actinium, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_polonium), new Object[] { ModItems.billet_polonium, ModItems.billet_polonium, ModItems.billet_polonium, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_lead), new Object[] { ModItems.billet_pb209, ModItems.billet_pb209, ModItems.billet_pb209, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_gold), new Object[] { ModItems.billet_au198, ModItems.billet_au198, ModItems.billet_au198, "plateIron" }));
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.pellet_rtg_americium), new Object[] { ModItems.billet_am241, ModItems.billet_am241, ModItems.billet_am241, "plateIron" }));
//There's no need for anvil recycling recipes if you simply set the container item
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_bismuth, 3), new Object[] { new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.BISMUTH.ordinal()) });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.ingot_lead, 2), new Object[] { new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.LEAD.ordinal()) });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.ingot_mercury, 2), new Object[] { new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.MERCURY.ordinal()) });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_neptunium, 3), new Object[] { new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.NEPTUNIUM.ordinal()) });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.billet_zirconium, 3), new Object[] { new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.ZIRCONIUM.ordinal()) });
if(OreDictionary.doesOreNameExist("ingotNickel"))
GameRegistry.addShapelessRecipe(new ItemStack(OreDictionary.getOres("ingotNickel").get(0).getItem(), 2), new Object[] { new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.NICKEL.ordinal()) });
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_copper), 1), new Object[] { "###", "###", "###", '#', ModItems.ingot_copper });
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_fluorite), 1), new Object[] { "###", "###", "###", '#', ModItems.fluorite });
GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.block_niter), 1), new Object[] { "###", "###", "###", '#', ModItems.niter });

View File

@ -35,6 +35,10 @@ public class GUIHandler implements IGuiHandler {
return new ContainerSolidifier(player.inventory, (TileEntityMachineSolidifier) entity);
}
if(entity instanceof TileEntityMachineRadiolysis) {
return new ContainerRadiolysis(player.inventory, (TileEntityMachineRadiolysis) entity);
}
switch(ID) {
case ModBlocks.guiID_test_difurnace: {
if(entity instanceof TileEntityDiFurnace) {
@ -878,6 +882,10 @@ public class GUIHandler implements IGuiHandler {
return new GUISolidifier(player.inventory, (TileEntityMachineSolidifier) entity);
}
if(entity instanceof TileEntityMachineRadiolysis) {
return new GUIRadiolysis(player.inventory, (TileEntityMachineRadiolysis) entity);
}
switch(ID) {
case ModBlocks.guiID_test_difurnace: {
if(entity instanceof TileEntityDiFurnace) {

View File

@ -0,0 +1,132 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.gui.GUIRadiolysis;
import com.hbm.inventory.recipes.RadiolysisRecipes;
import com.hbm.lib.RefStrings;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRectHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
public class RadiolysisRecipeHandler extends TemplateRecipeHandler {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
PositionedStack input;
PositionedStack output1;
PositionedStack output2;
public RecipeSet(ItemStack input, ItemStack output1, ItemStack output2) {
input.stackSize = 1;
this.input = new PositionedStack(input, 34, 25);
this.output1 = new PositionedStack(output1, 118, 16);
this.output2 = new PositionedStack(output2, 118, 34);
}
@Override
public List<PositionedStack> getIngredients() {
return getCycledIngredients(cycleticks / 20, Arrays.asList(input));
}
@Override
public PositionedStack getResult() {
return output1;
}
@Override
public List<PositionedStack> getOtherStacks() {
List<PositionedStack> stacks = new ArrayList<PositionedStack>();
stacks.add(output2);
return stacks;
}
}
@Override
public String getRecipeName() {
return "Radiolysis";
}
@Override
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_radiolysis.png";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if(outputId.equals("ntmRadiolysis")) {
HashMap<Object, Object[]> recipes = (HashMap<Object, Object[]>) RadiolysisRecipes.getRecipesForNEI();
for(Entry<Object, Object[]> recipe : recipes.entrySet()) {
this.arecipes.add(new RecipeSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1]));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
HashMap<Object, Object[]> recipes = (HashMap<Object, Object[]>) RadiolysisRecipes.getRecipesForNEI();
for(Entry<Object, Object[]> recipe : recipes.entrySet()) {
if(NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[0], result) || NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[1], result))
this.arecipes.add(new RecipeSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1]));
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if(inputId.equals("ntmRadiolysis")) {
loadCraftingRecipes("ntmRadiolysis", new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
HashMap<Object, Object[]> recipes = (HashMap<Object, Object[]>) RadiolysisRecipes.getRecipesForNEI();
for(Entry<Object, Object[]> recipe : recipes.entrySet()) {
if(NEIServerUtils.areStacksSameType((ItemStack)recipe.getKey(), ingredient))
this.arecipes.add(new RecipeSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1]));
}
}
@Override
public void drawExtras(int recipe) {
drawProgressBar(52, 19, 5, 87, 64, 28, 60, 0);
}
@Override
public void loadTransferRects() {
transferRectsGui = new LinkedList<RecipeTransferRect>();
guiGui = new LinkedList<Class<? extends GuiContainer>>();
transferRects.add(new RecipeTransferRect(new Rectangle(52, 19, 64, 27), "ntmRadiolysis"));
transferRectsGui.add(new RecipeTransferRect(new Rectangle(66, 25, 25, 14), "ntmRadiolysis"));
guiGui.add(GUIRadiolysis.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
}

View File

@ -253,8 +253,8 @@ public class HazardRegistry {
registerOtherFuel(plate_fuel_mox, mox * ingot, mox * ingot * 100, false);
registerOtherFuel(plate_fuel_pu239, pu239 * ingot, pu239 * ingot * 100, false);
registerOtherFuel(plate_fuel_sa326, sa326 * ingot, sa326 * ingot * 100, true);
registerOtherFuel(plate_fuel_ra226be, rabe * ingot, po210 * nugget * 3, false);
registerOtherFuel(plate_fuel_pu238be, pube * ingot, pu238 * nugget, false);
registerOtherFuel(plate_fuel_ra226be, rabe * billet, po210 * nugget * 3, false);
registerOtherFuel(plate_fuel_pu238be, pube * billet, pu238 * nugget, false);
registerOtherWaste(waste_plate_u233, u233 * ingot * 100);
registerOtherWaste(waste_plate_u235, u235 * ingot * 100);
@ -322,6 +322,7 @@ public class HazardRegistry {
registerRTGPellet(pellet_rtg_radium, ra226 * rtg, 0);
registerRTGPellet(pellet_rtg_weak, (pu238 + (u238 * 2)) * billet, 0);
registerRTGPellet(pellet_rtg_strontium, sr90 * rtg, 0);
registerRTGPellet(pellet_rtg_cobalt, co60 * rtg, 0);
registerRTGPellet(pellet_rtg_actinium, ac227 * rtg, 0);
registerRTGPellet(pellet_rtg_polonium, po210 * rtg, 0, 3F);
registerRTGPellet(pellet_rtg_lead, pb209 * rtg, 0, 7F, 5F);
@ -331,10 +332,13 @@ public class HazardRegistry {
registerBreedingRodRadiation(BreedingRodType.TRITIUM, 0.001F);
registerBreedingRodRadiation(BreedingRodType.CO60, co60);
registerBreedingRodRadiation(BreedingRodType.RA226, ra226);
registerBreedingRodRadiation(BreedingRodType.AC227, ac227);
registerBreedingRodRadiation(BreedingRodType.TH232, th232);
registerBreedingRodRadiation(BreedingRodType.THF, thf);
registerBreedingRodRadiation(BreedingRodType.U235, u235);
registerBreedingRodRadiation(BreedingRodType.NP237, np237);
registerBreedingRodRadiation(BreedingRodType.U238, u238);
registerBreedingRodRadiation(BreedingRodType.PU238, pu238); //it's in a container :)
registerBreedingRodRadiation(BreedingRodType.PU239, pu239);
registerBreedingRodRadiation(BreedingRodType.RGP, purg);

View File

@ -24,6 +24,7 @@ public class HazardTypeHot extends HazardTypeBase {
boolean reacher = false;
boolean gloves = false;
//Why on earth did I add gloves again?
if(target instanceof EntityPlayer) {
ItemStack item = ((EntityPlayer) target).inventory.getCurrentItem();
if(item != null)
@ -34,7 +35,8 @@ public class HazardTypeHot extends HazardTypeBase {
gloves = armor.getItem() instanceof ItemModGloves || ArmorUtil.checkForHazmat(target);
if(!gloves) {
ItemStack mod = ArmorModHandler.pryMods(armor)[ArmorModHandler.legs_only];
gloves = mod.getItem() instanceof ItemModGloves;
if(mod != null)
gloves = mod.getItem() instanceof ItemModGloves;
}
}
}

View File

@ -0,0 +1,80 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.tileentity.machine.TileEntityMachineRadiolysis;
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 ContainerRadiolysis extends Container {
private TileEntityMachineRadiolysis radiolysis;
public ContainerRadiolysis(InventoryPlayer playerInv, TileEntityMachineRadiolysis tile) {
radiolysis = tile;
//RTG
for(byte i = 0; i < 2; i++) {
for(byte j = 0; j < 5; j++) {
this.addSlotToContainer(new Slot(tile, j + i * 5, 188 + i * 18, 8 + j * 18));
}
}
//Fluid IO
this.addSlotToContainer(new Slot(tile, 10, 34, 17));
this.addSlotToContainer(new SlotMachineOutput(tile, 11, 34, 53));
//Sterilization
this.addSlotToContainer(new Slot(tile, 12, 148, 17));
this.addSlotToContainer(new SlotMachineOutput(tile, 13, 148, 53));
//Battery
this.addSlotToContainer(new Slot(tile, 14, 8, 53));
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, 84 + i * 18));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return radiolysis.isUseableByPlayer(player);
}
/** my eye, my eye, coctor coctor coctor **/
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack var3 = null;
Slot slot = (Slot) this.inventorySlots.get(index);
if(slot != null && slot.getHasStack()) {
ItemStack stack = slot.getStack();
var3 = stack.copy();
if(index <= 14) {
if(!this.mergeItemStack(stack, 15, this.inventorySlots.size(), true)) {
return null;
}
} else if(!this.mergeItemStack(stack, 0, 15, false)) {
return null;
}
if(stack.stackSize == 0) {
slot.putStack((ItemStack) null);
} else {
slot.onSlotChanged();
}
}
return var3;
}
}

View File

@ -79,11 +79,11 @@ public class ContainerReactorZirnox extends Container {
} else {
if(FluidContainerRegistry.getFluidContent(stack, Fluids.CARBONDIOXIDE) > 0) {
if(!this.mergeItemStack(stack, 24, 25, true))
if(!this.mergeItemStack(stack, 24, 26, false))
return null;
} else if(FluidContainerRegistry.getFluidContent(stack, Fluids.WATER) > 0) {
if(!this.mergeItemStack(stack, 25, 26, true))
if(!this.mergeItemStack(stack, 26, 28, false))
return null;
} else {

View File

@ -1,5 +1,6 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotMachineOutput;
import com.hbm.items.ModItems;
import com.hbm.tileentity.machine.TileEntitySILEX;
@ -24,14 +25,14 @@ public class ContainerSILEX extends Container {
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));
this.addSlotToContainer(new SlotMachineOutput(te, 4, 116, 90));
//Output Queue
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));
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));
for(int i = 0; i < 3; i++)
{

View File

@ -60,22 +60,31 @@ public class GUIMachineGasCent extends GuiInfoContainer {
int j = (int)gasCent.getCentrifugeProgressScaled(33);
drawTexturedModalRect(guiLeft + 74, guiTop + 37, 208, 0, j, 12);
int a = gasCent.getTankScaled(32, 0);
int a = gasCent.getTankScaled(31, 0);
switch (gasCent.inputTank.getTankType()) {
case PF6:
drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 200, 31 - a, 8, a);
break;
case MUD:
drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 192, 63 - a, 8, a);
break;
case MUD_HEAVY:
drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 192, 63 - a, 8, a);
break;
case NONE:
break;
default:
drawTexturedModalRect(guiLeft + 58, guiTop + 62 - a, 192, 31 - a, 8, a);
}
int b = gasCent.getTankScaled(32, 1);
int b = gasCent.getTankScaled(31, 1);
switch (gasCent.outputTank.getTankType()) {
case PF6:
drawTexturedModalRect(guiLeft + 114, guiTop + 62 - b, 200, 31 - b, 8, b);
break;
case MUD_HEAVY:
drawTexturedModalRect(guiLeft + 114, guiTop + 62 - b, 192, 63 - b, 8, b);
break;
case NONE:
break;
default:

View File

@ -43,7 +43,7 @@ public class GUIMachineRTG extends GuiInfoContainer {
for(int i = 0; i < pellets.size(); i++) {
ItemRTGPellet pellet = pellets.get(i);
pelletText[i + 1] = I18nUtil.resolveKey("desc.gui.rtg.pelletPower", I18nUtil.resolveKey(pellet.getUnlocalizedName() + ".name"), pellet.getHeat() * 10);
pelletText[i + 1] = I18nUtil.resolveKey("desc.gui.rtg.pelletPower", I18nUtil.resolveKey(pellet.getUnlocalizedName() + ".name"), pellet.getHeat() * 5);
}
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, pelletText);

View File

@ -0,0 +1,91 @@
package com.hbm.inventory.gui;
import java.util.List;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.container.ContainerRadiolysis;
import com.hbm.items.machine.ItemRTGPellet;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.machine.TileEntityMachineRadiolysis;
import com.hbm.util.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIRadiolysis extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_radiolysis.png");
private TileEntityMachineRadiolysis radiolysis;
public GUIRadiolysis(InventoryPlayer invPlayer, TileEntityMachineRadiolysis tedf) {
super(new ContainerRadiolysis(invPlayer, tedf));
radiolysis = tedf;
this.xSize = 230;
this.ySize = 166;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
radiolysis.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 61, guiTop + 17, 8, 52);
radiolysis.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 87, guiTop + 17, 12, 16);
radiolysis.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 87, guiTop + 53, 12, 16);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 17, 16, 34, radiolysis.power, radiolysis.maxPower);
String[] descText = I18nUtil.resolveKeyArray("desc.gui.radiolysis.desc");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, descText);
String[] heatText = I18nUtil.resolveKeyArray("desc.gui.rtg.heat", radiolysis.heat);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 16 + 18, 16, 16, guiLeft - 8, guiTop + 36 + 18 + 16, heatText);
List<ItemRTGPellet> pellets = ItemRTGPellet.pelletList;
String[] pelletText = new String[pellets.size() + 1];
pelletText[0] = I18nUtil.resolveKey("desc.gui.rtg.pellets");
for(int i = 0; i < pellets.size(); i++) {
ItemRTGPellet pellet = pellets.get(i);
pelletText[i + 1] = I18nUtil.resolveKey("desc.gui.rtg.pelletPower", I18nUtil.resolveKey(pellet.getUnlocalizedName() + ".name"), pellet.getHeat() * 10);
}
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 16 + 36, 16, 16, guiLeft - 8, guiTop + 36 + 36 + 16, pelletText);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.radiolysis.hasCustomInventoryName() ? this.radiolysis.getInventoryName() : I18n.format(this.radiolysis.getInventoryName());
this.fontRendererObj.drawString(name, 88 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
int i = (int)(radiolysis.getPower() * 34 / radiolysis.getMaxPower());
drawTexturedModalRect(guiLeft + 8, guiTop + 51 - i, 240, 34 - i, 16, i);
Minecraft.getMinecraft().getTextureManager().bindTexture(radiolysis.tanks[0].getSheet());
radiolysis.tanks[0].renderTank(this, guiLeft + 61, guiTop + 69, radiolysis.tanks[0].getTankType().textureX() * FluidTank.x, radiolysis.tanks[0].getTankType().textureY() * FluidTank.y, 8, 52);
//For some reason, liquid hydrogen appears as lava. but it doesn't seem to be an issue with any other fuel?
for(byte j = 0; j < 2; j++) {
Minecraft.getMinecraft().getTextureManager().bindTexture(radiolysis.tanks[j].getSheet());
radiolysis.tanks[j + 1].renderTank(this, guiLeft + 87, guiTop + 33 + j * 36, radiolysis.tanks[j + 1].getTankType().textureX() * FluidTank.x, radiolysis.tanks[j + 1].getTankType().textureY() * FluidTank.y, 12, 16);
}
this.drawInfoPanel(guiLeft - 16, guiTop + 16, 16, 16, 10);
this.drawInfoPanel(guiLeft - 16, guiTop + 16 + 18, 16, 16, 2);
this.drawInfoPanel(guiLeft - 16, guiTop + 16 + 36, 16, 16, 3);
}
}

View File

@ -71,7 +71,7 @@ public class GUIReactorResearch extends GuiInfoContainer {
"This reactor is fueled with plate fuel.",
"The reaction needs a neutron source to start."
};
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 14, guiTop + 31, 16, 16, guiLeft - 6, guiTop + 31 + 16, text2);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 14, guiTop + 61, 16, 16, guiLeft - 6, guiTop + 61 + 16, text2);
}
@Override
@ -145,7 +145,7 @@ public class GUIReactorResearch extends GuiInfoContainer {
}
this.drawInfoPanel(guiLeft - 14, guiTop + 23, 16, 16, 3);
this.drawInfoPanel(guiLeft - 14, guiTop + 31, 16, 16, 2);
this.drawInfoPanel(guiLeft - 14, guiTop + 61, 16, 16, 2);
}

View File

@ -7,6 +7,7 @@ import com.hbm.lib.RefStrings;
import com.hbm.packet.NBTControlPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.machine.TileEntityReactorZirnox;
import com.hbm.util.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
@ -36,23 +37,23 @@ public class GUIReactorZirnox extends GuiInfoContainer {
zirnox.steam.renderTankInfo(this, mouseX, mouseY, guiLeft + 160, guiTop + 108, 18, 12);
zirnox.carbonDioxide.renderTankInfo(this, mouseX, mouseY, guiLeft + 142, guiTop + 108, 18, 12);
zirnox.water.renderTankInfo(this, mouseX, mouseY, guiLeft + 178, guiTop + 108, 18, 12);
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 160, guiTop + 33, 18, 17, new String[] { "Temperature:", " " + Math.round((zirnox.heat) * 0.00001 * 480 + 20) + "°C" });
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 160, guiTop + 33, 18, 17, new String[] { "Temperature:", " " + Math.round((zirnox.heat) * 0.00001 * 780 + 20) + "°C" });
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 178, guiTop + 33, 18, 17, new String[] { "Pressure:", " " + Math.round((zirnox.pressure) * 0.00001 * 30) + " bar" });
String[] info = new String[] { "CO2 transfers heat from the core", "to the water. This will boil", "the water into steam.", "Water Consumption Rate:", "100 mB/t", "2000 mB/s" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, info);
String[] info2 = new String[] { "Pressure can be reduced by", "reducing the amount of CO2", "in the reactor. Warning:", "this will reduce cooling!" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, info2);
String[] coolantText = I18nUtil.resolveKeyArray("desc.gui.zirnox.coolant");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, coolantText);
String[] pressureText = I18nUtil.resolveKeyArray("desc.gui.zirnox.pressure");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, pressureText);
if(zirnox.water.getFill() <= 0) {
String[] warn1 = new String[] { "Error: Water is required for", "the reactor to function properly!" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 32, 16, 16, guiLeft - 8, guiTop + 36 + 32 + 16, warn1);
String[] warning1 = I18nUtil.resolveKeyArray("desc.gui.zirnox.warning1");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 32, 16, 16, guiLeft - 8, guiTop + 36 + 32 + 16, warning1);
}
if(zirnox.carbonDioxide.getFill() < 4000) {
String[] warn2 = new String[] { "Error: CO2 is required for", "the reactor to function properly!" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 32 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 32 + 16, warn2);
String[] warning2 = I18nUtil.resolveKeyArray("desc.gui.zirnox.warning2");
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 32 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 32 + 16, warning2);
}
}
@ -123,7 +124,7 @@ public class GUIReactorZirnox extends GuiInfoContainer {
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 32, 16, 16, 6);
if(zirnox.carbonDioxide.getFill() <= 4000)
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 32 + 16, 16, 16, 7);
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 32 + 16, 16, 16, 6);
}
}

View File

@ -251,7 +251,7 @@ public class AssemblerRecipes {
makeRecipe(new ComparableStack(ModItems.part_carbon, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new OreDictStack(COAL.dust(), 1), },50);
makeRecipe(new ComparableStack(ModItems.part_copper, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new OreDictStack(CU.dust(), 1), },50);
makeRecipe(new ComparableStack(ModItems.part_plutonium, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new ComparableStack(ModItems.powder_plutonium, 1), },50);
makeRecipe(new ComparableStack(ModItems.thermo_element, 1), new AStack[] {new OreDictStack(STEEL.plate(), 3), new OreDictStack(IRON.plate(), 1), new OreDictStack(CU.plate(), 2), new ComparableStack(ModItems.wire_red_copper, 2), new ComparableStack(ModItems.wire_aluminium, 2), new OreDictStack(NETHERQUARTZ.dust(), 4), },150);
makeRecipe(new ComparableStack(ModItems.thermo_element, 1), new AStack[] {new OreDictStack(STEEL.plate(), 2), new OreDictStack(IRON.plate(), 1), new OreDictStack(CU.plate(), 2), new ComparableStack(ModItems.wire_red_copper, 2), new ComparableStack(ModItems.wire_aluminium, 2), new OreDictStack(NETHERQUARTZ.dust(), 2), },150);
makeRecipe(new ComparableStack(ModItems.limiter, 1), new AStack[] {new OreDictStack(STEEL.plate(), 3), new OreDictStack(IRON.plate(), 1), new ComparableStack(ModItems.circuit_copper, 2), new ComparableStack(ModItems.wire_copper, 4), },150);
makeRecipe(new ComparableStack(ModItems.plate_dalekanium, 1), new AStack[] {new ComparableStack(ModBlocks.block_meteor, 1), },50);
makeRecipe(new ComparableStack(ModBlocks.block_meteor, 1), new AStack[] {new ComparableStack(ModItems.fragment_meteorite, 100), },500);
@ -264,7 +264,7 @@ public class AssemblerRecipes {
makeRecipe(new ComparableStack(ModBlocks.machine_rtg_furnace_off, 1), new AStack[] {new ComparableStack(Blocks.furnace, 1), new ComparableStack(ModItems.rtg_unit, 3), new OreDictStack(PB.plate(), 6), new OreDictStack(OreDictManager.getReflector(), 4), new OreDictStack(CU.plate(), 2), },150);
makeRecipe(new ComparableStack(ModBlocks.machine_diesel, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 4), new ComparableStack(Blocks.piston, 4), new OreDictStack(STEEL.ingot(), 6), new OreDictStack(MINGRADE.ingot(), 2), new OreDictStack(CU.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 6), },200);
makeRecipe(new ComparableStack(ModBlocks.machine_selenium, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(TI.plate(), 6), new OreDictStack(CU.plate(), 8), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.hull_small_steel, 9), new ComparableStack(ModItems.pedestal_steel, 1), new ComparableStack(ModItems.coil_copper, 4), },250);
makeRecipe(new ComparableStack(ModBlocks.machine_rtg_grey, 1), new AStack[] {new ComparableStack(ModItems.rtg_unit, 5), new OreDictStack(STEEL.plate(), 8), new ComparableStack(ModItems.wire_red_copper, 4), new OreDictStack(POLYMER.ingot(), 6), },200);
makeRecipe(new ComparableStack(ModBlocks.machine_rtg_grey, 1), new AStack[] {new ComparableStack(ModItems.rtg_unit, 3), new OreDictStack(STEEL.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 4), new OreDictStack(POLYMER.ingot(), 3), },200);
makeRecipe(new ComparableStack(ModBlocks.machine_battery, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(S.dust(), 12), new OreDictStack(PB.dust(), 12), new OreDictStack(MINGRADE.ingot(), 2), new ComparableStack(ModItems.wire_red_copper, 4), },200);
makeRecipe(new ComparableStack(ModBlocks.machine_lithium_battery, 1), new AStack[] {new OreDictStack(POLYMER.ingot(), 4), new OreDictStack(CO.dust(), 12), new OreDictStack(LI.dust(), 12), new OreDictStack(ALLOY.ingot(), 2), new ComparableStack(ModItems.wire_red_copper, 4), },400);
makeRecipe(new ComparableStack(ModBlocks.machine_schrabidium_battery, 1), new AStack[] {new OreDictStack(DESH.ingot(), 4), new OreDictStack(NP237.dust(), 12), new OreDictStack(SA326.dust(), 12), new OreDictStack(SA326.ingot(), 2), new ComparableStack(ModItems.wire_schrabidium, 4), },800);
@ -930,6 +930,20 @@ public class AssemblerRecipes {
new ComparableStack(ModItems.inf_water_mk2, 2)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.machine_radiolysis), new AStack[] {
new OreDictStack(STEEL.ingot(), 8),
new OreDictStack(TCALLOY.ingot(), 4),
new ComparableStack(ModBlocks.steel_beam, 16),
new OreDictStack(DURA.ingot(), 10),
new OreDictStack(DESH.ingot(), 4),
new OreDictStack(PB.plate(), 12),
new ComparableStack(ModItems.board_copper, 4),
new ComparableStack(ModItems.thermo_element, 10),
new ComparableStack(ModItems.circuit_copper, 3),
new ComparableStack(ModItems.wire_red_copper, 8),
new ComparableStack(ModItems.tank_steel, 3)
}, 200);
if(Loader.isModLoaded("Mekanism")) {
Block mb = (Block) Block.blockRegistry.getObject("Mekanism:MachineBlock");

View File

@ -28,12 +28,12 @@ public class FusionRecipes {
public static HashMap<FluidType, Integer> levels = new HashMap();
static {
levels.put(Fluids.PLASMA_DT, 1);
levels.put(Fluids.PLASMA_DH3, 2);
levels.put(Fluids.PLASMA_HD, 1);
levels.put(Fluids.PLASMA_HT, 1);
levels.put(Fluids.PLASMA_XM, 3);
levels.put(Fluids.PLASMA_BF, 4);
levels.put(Fluids.PLASMA_DT, 1000);
levels.put(Fluids.PLASMA_DH3, 2000);
levels.put(Fluids.PLASMA_HD, 1000);
levels.put(Fluids.PLASMA_HT, 1000);
levels.put(Fluids.PLASMA_XM, 3000);
levels.put(Fluids.PLASMA_BF, 4000);
}
public static int getBreedingLevel(FluidType plasma) {

View File

@ -2,13 +2,17 @@ package com.hbm.inventory.recipes;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.util.Tuple.Pair;
import net.minecraft.item.ItemStack;
@ -68,57 +72,37 @@ public class GasCentrifugeRecipes {
}
};
//Recipes for NEI
public static List<ItemStack> getGasCentOutputs(FluidType fluid) {
List<ItemStack> outputs = new ArrayList(4);
if(fluid == Fluids.UF6) {
outputs.add(new ItemStack(ModItems.nugget_u238, 11));
outputs.add(new ItemStack(ModItems.nugget_u235, 1));
outputs.add(new ItemStack(ModItems.fluorite, 4));
} else if(fluid == Fluids.PUF6) {
outputs.add(new ItemStack(ModItems.nugget_pu238, 3));
outputs.add(new ItemStack(ModItems.nugget_pu_mix, 6));
outputs.add(new ItemStack(ModItems.fluorite, 3));
} else if(fluid == Fluids.WATZ) {
outputs.add(new ItemStack(ModItems.powder_iron, 1));
outputs.add(new ItemStack(ModItems.powder_lead, 1));
outputs.add(new ItemStack(ModItems.nuclear_waste_tiny, 1)); //we have to omit dust here because the NEI handler only supports 3 items
}
return outputs;
}
public static int getQuantityRequired(FluidType fluid) {
if(fluid == Fluids.UF6) return 1200;
if(fluid == Fluids.PUF6)return 900;
if(fluid == Fluids.WATZ)return 1000;
return 0;
}
/* Recipe NEI Handler */
private static Map<FluidStack, ItemStack[]> gasCent = new HashMap();
//Iterators are lots of fun
public static Map<Object, Object[]> getGasCentrifugeRecipes() {
Map<Object, Object[]> recipes = new HashMap<Object, Object[]>();
for(int i = 0; i < Fluids.getAll().length; i++) {
if(getGasCentOutputs(Fluids.fromID(i)) != null) {
List<ItemStack> out = getGasCentOutputs(Fluids.fromID(i));
ItemStack[] outputs = new ItemStack[4];
for(int j = 0; j < out.size(); j++) {
outputs[j] = out.get(j).copy();
}
for(int j = 0; j < 4; j++)
if(outputs[j] == null)
outputs[j] = new ItemStack(ModItems.nothing);
ItemStack input = new ItemStack(ModItems.fluid_icon, 1, i);
ItemFluidIcon.addQuantity(input, getQuantityRequired(Fluids.fromID(i)));
recipes.put(input, outputs);
Iterator itr = gasCent.entrySet().iterator();
while(itr.hasNext()) {
Map.Entry entry = (Entry) itr.next();
FluidStack input = (FluidStack) entry.getKey();
ItemStack[] out = new ItemStack[4];
ItemStack[] outputs = (ItemStack[]) entry.getValue();
for(int j = 0; j < outputs.length; j++) {
out[j] = outputs[j].copy();
}
for(int j = 0; j < 4; j++)
if(out[j] == null)
out[j] = new ItemStack(ModItems.nothing);
recipes.put(ItemFluidIcon.make(input.type, input.fill), outputs);
}
return recipes;
}
public static void register() {
gasCent.put(new FluidStack(1200, Fluids.UF6), new ItemStack[] {new ItemStack(ModItems.nugget_u238, 11), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 4)});
gasCent.put(new FluidStack(900, Fluids.PUF6), new ItemStack[] {new ItemStack(ModItems.nugget_pu238, 3), new ItemStack(ModItems.nugget_pu_mix, 6), new ItemStack(ModItems.fluorite, 3)});
gasCent.put(new FluidStack(1000, Fluids.WATZ), new ItemStack[] {new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.powder_lead, 1), new ItemStack(ModItems.nuclear_waste_tiny, 1)});
}
}

View File

@ -0,0 +1,64 @@
package com.hbm.inventory.recipes;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.RefineryRecipes;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.util.Tuple.Pair;
import net.minecraft.item.ItemStack;
public class RadiolysisRecipes {
//All cracking recipes, + 2H2O => H2O2 + H2, + heavy oil => light oil + waste product, and others i haven't even thought of yet
private static Map<FluidType, Pair<FluidStack, FluidStack>> radiolysis = new HashMap(); //fluidstacks :reimumunch:
/* I am proud of this */
public static Map<Object, Object[]> getRecipesForNEI() {
Map<Object, Object[]> recipes = new HashMap<Object, Object[]>();
Iterator itr = radiolysis.entrySet().iterator();
while(itr.hasNext()) {
Map.Entry entry = (Entry) itr.next();
Pair<FluidStack, FluidStack> pair = (Pair<FluidStack, FluidStack>) entry.getValue();
ItemStack[] outputs = new ItemStack[2];
if(pair.getKey().type == Fluids.NONE) {
outputs[0] = new ItemStack(ModItems.nothing);
} else {
outputs[0] = ItemFluidIcon.make(pair.getKey().type, pair.getKey().fill);
}
if(pair.getValue().type == Fluids.NONE) {
outputs[1] = new ItemStack(ModItems.nothing);
} else {
outputs[1] = ItemFluidIcon.make(pair.getValue().type, pair.getValue().fill);
}
recipes.put(ItemFluidIcon.make((FluidType) entry.getKey(), 100), outputs);
}
return recipes;
}
public static void registerRadiolysis() {
radiolysis.put(Fluids.WATER, new Pair(new FluidStack(80, Fluids.ACID), new FluidStack(20, Fluids.HYDROGEN)));
//now this is poggers
radiolysis.put(Fluids.OIL, new Pair(new FluidStack(RefineryRecipes.oil_crack_oil, Fluids.CRACKOIL), new FluidStack(RefineryRecipes.oil_crack_petro, Fluids.PETROLEUM)));
radiolysis.put(Fluids.BITUMEN, new Pair(new FluidStack(RefineryRecipes.bitumen_crack_oil, Fluids.OIL), new FluidStack(RefineryRecipes.bitumen_crack_aroma, Fluids.AROMATICS)));
radiolysis.put(Fluids.SMEAR, new Pair(new FluidStack(RefineryRecipes.smear_crack_napht, Fluids.NAPHTHA), new FluidStack(RefineryRecipes.smear_crack_petro, Fluids.PETROLEUM)));
radiolysis.put(Fluids.GAS, new Pair(new FluidStack(RefineryRecipes.gas_crack_petro, Fluids.PETROLEUM), new FluidStack(RefineryRecipes.gas_crack_unsat, Fluids.UNSATURATEDS)));
radiolysis.put(Fluids.DIESEL, new Pair(new FluidStack(RefineryRecipes.diesel_crack_kero, Fluids.KEROSENE), new FluidStack(RefineryRecipes.diesel_crack_petro, Fluids.PETROLEUM)));
radiolysis.put(Fluids.KEROSENE, new Pair(new FluidStack(RefineryRecipes.kero_crack_petro, Fluids.PETROLEUM), new FluidStack(0, Fluids.NONE)));
}
public static Pair<FluidStack, FluidStack> getRadiolysis(FluidType input) {
return radiolysis.get(input);
}
}

View File

@ -19,6 +19,8 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class AnvilRecipes {
@ -596,18 +598,6 @@ public class AnvilRecipes {
new AnvilOutput(new ItemStack(ModBlocks.crate_steel, 2))
}).setTier(4));
//RTG
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.BISMUTH.ordinal())), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.billet_bismuth, 3)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 1)) }).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.LEAD.ordinal())), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.ingot_lead, 2)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 1)) }).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.MERCURY.ordinal())), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.ingot_mercury, 2)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 1)) }).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.NEPTUNIUM.ordinal())), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.billet_neptunium, 3)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 1)) }).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(new ItemStack(ModItems.pellet_rtg_depleted, 1, DepletedRTGMaterial.ZIRCONIUM.ordinal())), new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.billet_zirconium, 3)), new AnvilOutput(new ItemStack(ModItems.plate_iron, 1)) }).setTier(3));
if(!GeneralConfig.enable528) {
constructionRecipes.add(new AnvilConstructionRecipe(

View File

@ -732,16 +732,17 @@ public class ModItems {
public static Item pellet_rtg_depleted;
public static Item pellet_rtg;
public static Item pellet_rtg_radium;
public static Item pellet_rtg_weak;
public static Item pellet_rtg_polonium;
public static Item pellet_rtg_actinium;
public static Item pellet_rtg;
public static Item pellet_rtg_strontium;
public static Item pellet_rtg_lead;
public static Item pellet_rtg_gold;
public static Item pellet_rtg_cobalt;
public static Item pellet_rtg_actinium;
public static Item pellet_rtg_polonium;
public static Item pellet_rtg_americium;
public static Item pellet_rtg_berkelium;
public static Item pellet_rtg_gold;
public static Item pellet_rtg_lead;
public static Item tritium_deuterium_cake;
@ -2641,7 +2642,7 @@ public class ModItems {
billet_pb209 = new Item().setUnlocalizedName("billet_pb209").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":billet_pb209");
billet_ra226 = new Item().setUnlocalizedName("billet_ra226").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":billet_ra226");
billet_actinium = new Item().setUnlocalizedName("billet_actinium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":billet_actinium");
billet_schrabidium = new Item().setUnlocalizedName("billet_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":billet_schrabidium");
billet_schrabidium = new ItemCustomLore().setRarity(EnumRarity.rare).setUnlocalizedName("billet_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":billet_schrabidium");
billet_solinium = new Item().setUnlocalizedName("billet_solinium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":billet_solinium");
billet_gh336 = new ItemCustomLore().setRarity(EnumRarity.epic).setUnlocalizedName("billet_gh336").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":billet_gh336");
billet_australium = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("billet_australium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":billet_australium");
@ -3104,18 +3105,19 @@ public class ModItems {
wiring_red_copper = new ItemWiring().setUnlocalizedName("wiring_red_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wiring_red_copper");
pellet_rtg_depleted = new ItemRTGPelletDepleted().setUnlocalizedName("pellet_rtg_depleted").setCreativeTab(MainRegistry.controlTab); //TODO: add localization; uncrafting recipes; make radiation scale with depletion for rtgs
pellet_rtg_depleted = new ItemRTGPelletDepleted().setContainerItem(plate_iron).setUnlocalizedName("pellet_rtg_depleted").setCreativeTab(MainRegistry.controlTab);
pellet_rtg = new ItemRTGPellet(10).setDecays(DepletedRTGMaterial.LEAD, (long) (RTGUtil.getLifespan(87.7F, HalfLifeType.MEDIUM, false) * 1.5)).setUnlocalizedName("pellet_rtg").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg");
pellet_rtg_radium = new ItemRTGPellet(3).setDecays(DepletedRTGMaterial.LEAD, (long) (RTGUtil.getLifespan(16.0F, HalfLifeType.LONG, false) * 1.5)).setUnlocalizedName("pellet_rtg_radium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_radium");
pellet_rtg_weak = new ItemRTGPellet(5).setDecays(DepletedRTGMaterial.LEAD, (long) (RTGUtil.getLifespan(1.0F, HalfLifeType.LONG, false) * 1.5)).setUnlocalizedName("pellet_rtg_weak").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_weak");
pellet_rtg_polonium = new ItemRTGPellet(50).setDecays(DepletedRTGMaterial.LEAD, (long) (RTGUtil.getLifespan(138.0F, HalfLifeType.SHORT, false) * 1.5)).setUnlocalizedName("pellet_rtg_polonium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_polonium");
pellet_rtg_actinium = new ItemRTGPellet(20).setDecays(DepletedRTGMaterial.LEAD, (long) (RTGUtil.getLifespan(21.7F, HalfLifeType.MEDIUM, false) * 1.5)).setUnlocalizedName("pellet_rtg_actinium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_rtg_actinium");
pellet_rtg = new ItemRTGPellet(10).setDecays(DepletedRTGMaterial.LEAD, (long) (RTGUtil.getLifespan(87.7F, HalfLifeType.MEDIUM, false) * 1.5)).setUnlocalizedName("pellet_rtg").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg");
pellet_rtg_strontium = new ItemRTGPellet(15).setDecays(DepletedRTGMaterial.ZIRCONIUM, (long) (RTGUtil.getLifespan(29.0F, HalfLifeType.MEDIUM, false) * 1.5)).setUnlocalizedName("pellet_rtg_strontium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_rtg_strontium");
pellet_rtg_lead = new ItemRTGPellet(VersatileConfig.rtgDecay() ? 600 : 200).setDecays(DepletedRTGMaterial.BISMUTH, (long) (RTGUtil.getLifespan(0.3F, HalfLifeType.SHORT, false) * 1.5)).setUnlocalizedName("pellet_rtg_lead").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_rtg_lead");
pellet_rtg_gold = new ItemRTGPellet(VersatileConfig.rtgDecay() ? 300 : 100).setDecays(DepletedRTGMaterial.MERCURY, (long) (RTGUtil.getLifespan(2.7F, HalfLifeType.SHORT, false) * 1.5)).setUnlocalizedName("pellet_rtg_gold").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_gold");
pellet_rtg_cobalt = new ItemRTGPellet(15).setDecays(DepletedRTGMaterial.NICKEL, (long) (RTGUtil.getLifespan(29.0F, HalfLifeType.MEDIUM, false) * 1.5)).setUnlocalizedName("pellet_rtg_cobalt").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_rtg_cobalt");
pellet_rtg_actinium = new ItemRTGPellet(20).setDecays(DepletedRTGMaterial.LEAD, (long) (RTGUtil.getLifespan(5.3F, HalfLifeType.MEDIUM, false) * 1.5)).setUnlocalizedName("pellet_rtg_actinium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_rtg_actinium");
pellet_rtg_americium = new ItemRTGPellet(20).setDecays(DepletedRTGMaterial.NEPTUNIUM, (long) (RTGUtil.getLifespan(4.7F, HalfLifeType.LONG, false) * 1.5)).setUnlocalizedName("pellet_rtg_americium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_americium");
pellet_rtg_berkelium = new ItemRTGPellet(20).setUnlocalizedName("pellet_rtg_berkelium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_berkelium");
pellet_rtg_polonium = new ItemRTGPellet(50).setDecays(DepletedRTGMaterial.LEAD, (long) (RTGUtil.getLifespan(138.0F, HalfLifeType.SHORT, false) * 1.5)).setUnlocalizedName("pellet_rtg_polonium").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_polonium");
pellet_rtg_gold = new ItemRTGPellet(VersatileConfig.rtgDecay() ? 200 : 100).setDecays(DepletedRTGMaterial.MERCURY, (long) (RTGUtil.getLifespan(2.7F, HalfLifeType.SHORT, false) * 1.5)).setUnlocalizedName("pellet_rtg_gold").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":pellet_rtg_gold");
pellet_rtg_lead = new ItemRTGPellet(VersatileConfig.rtgDecay() ? 600 : 200).setDecays(DepletedRTGMaterial.BISMUTH, (long) (RTGUtil.getLifespan(0.3F, HalfLifeType.SHORT, false) * 1.5)).setUnlocalizedName("pellet_rtg_lead").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_rtg_lead");
tritium_deuterium_cake = new ItemCustomLore().setUnlocalizedName("tritium_deuterium_cake").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":tritium_deuterium_cake");
@ -6168,16 +6170,17 @@ public class ModItems {
GameRegistry.registerItem(flame_opinion, flame_opinion.getUnlocalizedName());
//Pellets
GameRegistry.registerItem(pellet_rtg, pellet_rtg.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_radium, pellet_rtg_radium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_weak, pellet_rtg_weak.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_polonium, pellet_rtg_polonium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg, pellet_rtg.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_strontium, pellet_rtg_strontium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_cobalt, pellet_rtg_cobalt.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_actinium, pellet_rtg_actinium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_lead, pellet_rtg_lead.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_gold, pellet_rtg_gold.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_polonium, pellet_rtg_polonium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_americium, pellet_rtg_americium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_berkelium, pellet_rtg_berkelium.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_gold, pellet_rtg_gold.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_lead, pellet_rtg_lead.getUnlocalizedName());
GameRegistry.registerItem(pellet_rtg_depleted, pellet_rtg_depleted.getUnlocalizedName());
GameRegistry.registerItem(tritium_deuterium_cake, tritium_deuterium_cake.getUnlocalizedName());
GameRegistry.registerItem(pellet_cluster, pellet_cluster.getUnlocalizedName());

View File

@ -13,6 +13,7 @@ public class ItemRTGPelletDepleted extends ItemEnumMulti {
MERCURY,
NEPTUNIUM,
LEAD,
ZIRCONIUM;
ZIRCONIUM,
NICKEL;
}
}

View File

@ -205,6 +205,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCatalyticCracker.class, new RenderCatalyticCracker());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLiquefactor.class, new RenderLiquefactor());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineSolidifier.class, new RenderSolidifier());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadiolysis.class, new RenderRadiolysis());
//AMS
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSBase.class, new RenderAMSBase());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSEmitter.class, new RenderAMSEmitter());

View File

@ -949,6 +949,8 @@ public class MainRegistry {
PressRecipes.register();
RefineryRecipes.registerFractions();
RefineryRecipes.registerCracking();
RadiolysisRecipes.registerRadiolysis();
GasCentrifugeRecipes.register();
LiquefactionRecipes.register();
SolidificationRecipes.register();
FuelPoolRecipes.register();

View File

@ -57,6 +57,8 @@ public class NEIConfig implements IConfigureNEI {
API.registerUsageHandler(new AnvilRecipeHandler());
API.registerRecipeHandler(new FuelPoolHandler());
API.registerUsageHandler(new FuelPoolHandler());
API.registerRecipeHandler(new RadiolysisRecipeHandler());
API.registerUsageHandler(new RadiolysisRecipeHandler());
//universal boyes
API.registerRecipeHandler(new ZirnoxRecipeHandler());

View File

@ -279,6 +279,9 @@ public class ResourceManager {
public static final IModelCustom pylon_large = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/network/pylon_large.obj"));
public static final IModelCustom substation = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/network/substation.obj"));
//Radiolysis
public static final IModelCustom radiolysis = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/radiolysis.obj"));
////Textures TEs
public static final ResourceLocation universal = new ResourceLocation(RefStrings.MODID, "textures/models/TheGadget3_.png");
@ -577,7 +580,8 @@ public class ResourceManager {
public static final ResourceLocation pylon_large_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/pylon_large.png");
public static final ResourceLocation substation_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/substation.png");
//Radiolysis
public static final ResourceLocation radiolysis_tex = new ResourceLocation(RefStrings.MODID, "textures/models/radiolysis.png");
////Obj Items

View File

@ -1205,6 +1205,17 @@ public class ItemRenderLibrary {
bindTexture(ResourceManager.solidifier_tex); ResourceManager.solidifier.renderPart("Main");
GL11.glShadeModel(GL11.GL_FLAT);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.machine_radiolysis), new ItemRenderBase( ) {
public void renderInventory() {
GL11.glTranslated(0, -2.5, 0);
GL11.glScaled(3, 3, 3);
}
public void renderCommon() {
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.radiolysis_tex); ResourceManager.radiolysis.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}});
}
private static void bindTexture(ResourceLocation res) {

View File

@ -0,0 +1,40 @@
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 RenderRadiolysis 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 2:
GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3:
GL11.glRotatef(0, 0F, 1F, 0F); break;
case 4:
GL11.glRotatef(90, 0F, 1F, 0F); break;
case 5:
GL11.glRotatef(270, 0F, 1F, 0F); break;
}
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.radiolysis_tex);
ResourceManager.radiolysis.renderAll();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
}
}

View File

@ -185,7 +185,7 @@ public class TileMappings {
put(TileEntityWatz.class, "tileentity_watz");
put(TileEntityMachineBAT9000.class, "tileentity_bat9000");
put(TileEntityMachineOrbus.class, "tileentity_orbus");
put(TileEntityLoot.class, "tileentity_ntm_loot");
put(TileEntityBobble.class, "tileentity_ntm_bobblehead");
@ -231,6 +231,7 @@ public class TileMappings {
private static void putMachines() {
put(TileEntityDiFurnaceRTG.class, "tileentity_rtg_difurnace");
put(TileEntityMachineRadiolysis.class, "tileentity_radiolysis");
put(TileEntityUVLamp.class, "tileentity_uv_lamp");
put(TileEntityCondenser.class, "tileentity_condenser");

View File

@ -192,10 +192,10 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
BreederRecipe out = BreederRecipes.getOutput(slots[1]);
if(slots[1] != null && slots[1].getItem() == ModItems.meteorite_sword_irradiated)
out = new BreederRecipe(ModItems.meteorite_sword_fused, 1);
out = new BreederRecipe(ModItems.meteorite_sword_fused, 1000);
if(slots[1] != null && slots[1].getItem() == ModItems.meteorite_sword_fused)
out = new BreederRecipe(ModItems.meteorite_sword_baleful, 4);
out = new BreederRecipe(ModItems.meteorite_sword_baleful, 4000);
if(out == null) {
this.progress = 0;

View File

@ -7,6 +7,7 @@ import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
import com.hbm.interfaces.Spaghetti;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
@ -36,6 +37,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
@Spaghetti("I still can't believe this was my idea of a 'rework'")
public class TileEntityMachineGasCent extends TileEntityMachineBase implements IEnergyUser, IFluidContainer, IFluidAcceptor {
public byte age;
@ -226,7 +228,7 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
setTankType(1);
if(inputTank.getTankType() == PseudoFluidType.PF6 || inputTank.getTankType() == PseudoFluidType.NUF6) {
if(inputTank.getTankType() == PseudoFluidType.PF6 || inputTank.getTankType() == PseudoFluidType.NUF6 || inputTank.getTankType() == PseudoFluidType.MUD) {
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
attemptConversion();
}
@ -334,10 +336,17 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
if(newType == Fluids.UF6) {
inputTank.setTankType(PseudoFluidType.NUF6);
outputTank.setTankType(PseudoFluidType.NUF6.getOutputFluid());
return;
}
if(newType == Fluids.PUF6) {
inputTank.setTankType(PseudoFluidType.PF6);
outputTank.setTankType(PseudoFluidType.PF6.getOutputFluid());
return;
}
if(newType == Fluids.WATZ) {
inputTank.setTankType(PseudoFluidType.MUD);
outputTank.setTankType(PseudoFluidType.MUD.getOutputFluid());
return;
}
}
return;

View File

@ -131,7 +131,7 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
// RTG ///
this.hasRTG = RTGUtil.hasHeat(slots, RTGSlots);
this.spin += RTGUtil.updateRTGs(slots, RTGSlots) * 0.1;
this.spin += RTGUtil.updateRTGs(slots, RTGSlots) * 0.2;
if(this.spin > 0) {

View File

@ -210,7 +210,7 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory,
if(heat > heatMax)
heat = heatMax;
power += heat * 10;
power += heat * 5;
if(power > powerMax)
power = powerMax;

View File

@ -0,0 +1,338 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
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.RadiolysisRecipes;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemRTGPellet;
import com.hbm.items.machine.ItemRTGPelletDepleted;
import com.hbm.lib.Library;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.RTGUtil;
import com.hbm.util.Tuple.Pair;
import api.hbm.energy.IEnergyGenerator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineRadiolysis extends TileEntityMachineBase implements IEnergyGenerator, IFluidAcceptor, IFluidSource, IFluidContainer {
//TODO: Render file + resource locations + itemrenderlibrary + clientproxy, gui texture, further recipes
public long power;
public static final int maxPower = 1000000;
public int heat;
public FluidTank[] tanks;
public List<IFluidAcceptor> list1 = new ArrayList();
public List<IFluidAcceptor> list2 = new ArrayList();
private static final int[] slot_io = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 13 };
private static final int[] slot_rtg = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public TileEntityMachineRadiolysis() {
super(15); //10 rtg slots, 2 fluid ID slots (io), 2 irradiation slots (io), battery slot
tanks = new FluidTank[3];
tanks[0] = new FluidTank(Fluids.NONE, 2000, 0);
tanks[1] = new FluidTank(Fluids.NONE, 2000, 1);
tanks[2] = new FluidTank(Fluids.NONE, 2000, 2);
}
@Override
public String getName() {
return "container.radiolysis";
}
/* IO Methods */
@Override
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
return i == 12 || (i < 10 && itemStack.getItem() instanceof ItemRTGPellet);
}
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return slot_io;
}
@Override
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
return (i < 10 && itemStack.getItem() instanceof ItemRTGPelletDepleted) || i == 13;
}
/* NBT Methods */
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.power = nbt.getLong("power");
this.heat = nbt.getInteger("heat");
tanks[0].readFromNBT(nbt, "input");
tanks[1].readFromNBT(nbt, "output1");
tanks[2].readFromNBT(nbt, "output2");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setLong("power", power);
nbt.setInteger("heat", heat);
tanks[0].writeToNBT(nbt, "input");
tanks[1].writeToNBT(nbt, "output1");
tanks[2].writeToNBT(nbt, "output2");
}
public void networkUnpack(NBTTagCompound data) {
this.power = data.getLong("power");
this.heat = data.getInteger("heat");
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
power = Library.chargeItemsFromTE(slots, 14, power, maxPower);
heat = RTGUtil.updateRTGs(slots, slot_rtg);
power += heat * 10;
if(power > maxPower)
power = maxPower;
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
this.sendPower(worldObj, xCoord + 2, yCoord, zCoord, dir);
this.sendPower(worldObj, xCoord - 2, yCoord, zCoord, dir);
this.sendPower(worldObj, xCoord, yCoord, zCoord + 2, dir);
this.sendPower(worldObj, xCoord, yCoord, zCoord - 2, dir);
tanks[0].setType(10, 11, slots);
setupTanks();
if(heat > 0) {
if(heat >= 100 && worldObj.getTotalWorldTime() % 30 == 0)
crack();
if(heat >= 200 && worldObj.getTotalWorldTime() % 100 == 0)
sterilize();
}
if(worldObj.getTotalWorldTime() % 10 == 0) {
fillFluidInit(tanks[1].getTankType());
fillFluidInit(tanks[2].getTankType());
}
NBTTagCompound data = new NBTTagCompound();
data.setLong("power", power);
data.setInteger("heat", heat);
this.networkPack(data, 50);
for(byte i = 0; i < 3; i++)
tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
}
}
/* Processing Methods */
private void crack() {
Pair<FluidStack, FluidStack> quart = RadiolysisRecipes.getRadiolysis(tanks[0].getTankType());
if(quart != null) {
int left = quart.getKey().fill;
int right = quart.getValue().fill;
if(tanks[0].getFill() >= 100 && hasSpace(left, right)) {
tanks[0].setFill(tanks[0].getFill() - 100);
tanks[1].setFill(tanks[1].getFill() + left);
tanks[2].setFill(tanks[2].getFill() + right);
}
}
}
private boolean hasSpace(int left, int right) {
return tanks[1].getFill() + left <= tanks[1].getMaxFill() && tanks[2].getFill() + right <= tanks[2].getMaxFill();
}
private void setupTanks() {
Pair<FluidStack, FluidStack> quart = RadiolysisRecipes.getRadiolysis(tanks[0].getTankType());
if(quart != null) {
tanks[1].setTankType(quart.getKey().type);
tanks[2].setTankType(quart.getValue().type);
} else {
tanks[0].setTankType(Fluids.NONE);
tanks[1].setTankType(Fluids.NONE);
tanks[2].setTankType(Fluids.NONE);
}
}
// Code: pressure, sword, sterilize.
private void sterilize() {
if(slots[12] != null) {
if(slots[12].getItem() instanceof ItemFood && !(slots[12].getItem() == ModItems.pancake)) {
slots[12].stackSize -= 1;
if(slots[12].stackSize <= 0)
slots[12] = null;
}
if(!checkIfValid())
return;
ItemStack output = slots[12].copy();
output.stackSize = 1;
if(slots[13] == null) {
slots[12].stackSize -= output.stackSize;
if(slots[12].stackSize <= 0)
slots[12] = null;
slots[13] = output;
slots[13].stackTagCompound.setBoolean("ntmContagion", false);
} else if(slots[13].isItemEqual(output) && slots[13].stackSize + output.stackSize <= slots[13].getMaxStackSize()) {
slots[12].stackSize -= output.stackSize;
if(slots[12].stackSize <= 0)
slots[12] = null;
slots[13].stackSize += output.stackSize;
slots[13].stackTagCompound.setBoolean("ntmContagion", false);
}
}
}
private boolean checkIfValid() {
if(slots[12] == null)
return false;
if(!slots[12].hasTagCompound())
return false;
if(!slots[12].getTagCompound().getBoolean("ntmContagion"))
return false;
return true;
}
/* Power methods */
@Override
public void setPower(long power) {
this.power = power;
}
@Override
public long getPower() {
return power;
}
@Override
public long getMaxPower() {
return maxPower;
}
/* Fluid Methods */
@Override
public void setFillstate(int fill, int index) {
if(index < 3 && tanks[index] != null)
tanks[index].setFill(fill);
}
@Override
public void setFluidFill(int fill, FluidType type) {
for(FluidTank tank : tanks) {
if(tank.getTankType() == type) {
tank.setFill(fill);
}
}
}
@Override
public void setType(FluidType type, int index) {
this.tanks[index].setTankType(type);
}
@Override
public List<FluidTank> getTanks() {
return Arrays.asList(this.tanks);
}
@Override
public int getFluidFill(FluidType type) {
for(FluidTank tank : tanks) {
if(tank.getTankType() == type) {
return tank.getFill();
}
}
return 0;
}
@Override
public int getMaxFluidFill(FluidType type) {
if(tanks[0].getTankType() == type) {
return tanks[0].getMaxFill();
}
return 0;
}
@Override
public void fillFluidInit(FluidType type) {
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord, this.getTact(), type);
fillFluid(this.xCoord - 2, this.yCoord, this.zCoord, this.getTact(), type);
fillFluid(this.xCoord, this.yCoord, this.zCoord + 2, this.getTact(), type);
fillFluid(this.xCoord, this.yCoord, this.zCoord - 2, this.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;
}
@Override
public List<IFluidAcceptor> getFluidList(FluidType type) {
if(type == tanks[1].getTankType())
return list1;
if(type == tanks[2].getTankType())
return list2;
return new ArrayList<IFluidAcceptor>();
}
@Override
public void clearFluidList(FluidType type) {
if(type == tanks[1].getTankType())
list1.clear();
if(type == tanks[2].getTankType())
list2.clear();
}
public AxisAlignedBB getRenderBoundingBox() {
return AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 3, zCoord + 2);
}
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

View File

@ -203,13 +203,15 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
}
}
}
this.pressure = (int) ((float)this.heat * (1.5 * this.carbonDioxide.getFill() / 16000));
//2(fill) + ((x^2 * fill%) / 100,000)
this.pressure = (this.carbonDioxide.getFill() * 2) + (int)((float)this.heat * (float)this.heat * ((float)this.carbonDioxide.getFill() / (float)this.carbonDioxide.getMaxFill() / 100000F));
if(this.heat > 0 && this.heat < maxHeat) {
if(this.water.getFill() > 0 && this.carbonDioxide.getFill() > 0 && this.steam.getFill() < this.steam.getMaxFill()) {
generateSteam();
this.heat -= (int) ((float)this.heat * (Math.sqrt(this.carbonDioxide.getFill()) / 1800));
//(x * pressure) / 1,000,000
this.heat -= (int) ((float)this.heat * (float)this.pressure / 1000000F);
} else {
this.heat -= 10;
}
@ -233,19 +235,20 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
private void generateSteam() {
// function of SHS produced per tick
// heat% * 25 * 1 (should get rid of any rounding errors)
int Water = (int) (((float)heat / maxHeat) * 25) * 5;
int Steam = Water * 1;
water.setFill(water.getFill() - Water);
steam.setFill(steam.getFill() + Steam);
if(water.getFill() < 0)
water.setFill(0);
if(steam.getFill() > steam.getMaxFill())
steam.setFill(steam.getMaxFill());
// heat - 10256/100000 * pressure / 50,000 * 25 * 3 (should get rid of any rounding errors)
if(this.heat > 10256) {
int Water = (int)((((float)heat - 10256F) / (float)maxHeat) * ((float)pressure / (float)(maxPressure / 2)) * 25F * 3F);
int Steam = Water * 1;
water.setFill(water.getFill() - Water);
steam.setFill(steam.getFill() + Steam);
if(water.getFill() < 0)
water.setFill(0);
if(steam.getFill() > steam.getMaxFill())
steam.setFill(steam.getMaxFill());
}
}
private boolean hasFuelRod(int id) {

View File

@ -170,7 +170,7 @@ public class TileEntityWasteDrum extends TileEntity implements ISidedInventory {
if(itemStack.getItem() instanceof ItemRBMKRod) {
return ItemRBMKRod.getCoreHeat(itemStack) < 50 && ItemRBMKRod.getHullHeat(itemStack) < 50;
} else {
return !FuelPoolRecipes.recipes.containsKey(getStackInSlot(i));
return !FuelPoolRecipes.recipes.containsKey(new ComparableStack(getStackInSlot(i)));
}
}

View File

@ -404,6 +404,7 @@ container.pumpjack=Pumpjack
container.radGen=Radiation-Powered Engine
container.radar=Radar
container.radiobox=FM Transmitter
container.radiolysis=RTG and Radiolysis Chamber
container.radiorec=FM Radio
container.rbmkBoiler=RBMK Steam Channel
container.rbmkControl=RBMK Control Rods
@ -498,11 +499,16 @@ death.attack.teleporter=%1$s was teleported into nothingness.
desc.item.rtgDecay=Decays to: %s
desc.item.rtgHeat=Power Level: %s
desc.item.wasteCooling=Cool in a Spent Fuel Pool Drum
desc.gui.radiolysis.desc=§9Description§r$This RTG is more efficient then others, and$comes equipped with a radiolysis chamber for$cracking and sterilization.
desc.gui.rtgBFurnace.desc=Requires at least 15 heat to process$The more heat on top of that, the faster it runs$Heat going over maximum speed will have no effect$Short-lived pellets may decay
desc.gui.rtg.heat=§eCurrent heat level: %s
desc.gui.rtg.pellets=Accepted Pellets:
desc.gui.rtg.pelletHeat=%s (%s heat)
desc.gui.rtg.pelletPower=%s (%s HE/tick)
desc.gui.zirnox.coolant=§3Coolant§r$CO2 transfers heat from the core to the water.$This will boil it into super dense steam.$The efficiency of cooling and steam production$is based on pressure.
desc.gui.zirnox.pressure=§6Pressure§r$Pressure can be reduced by venting CO2.$However, too low a pressure, and cooling$efficiency and steam production will be reduced.$Look out for meltdowns!
desc.gui.zirnox.warning1=§cError:§r Water is required for$the reactor to function properly!
desc.gui.zirnox.warning2=§cError:§r CO2 is required for$the reactor to function properly!
digamma.playerDigamma=Digamma exposure:
digamma.playerHealth=Digamma influence:
@ -2285,10 +2291,13 @@ item.pellet_rtg_americium.name=Americium-241 RTG Pellet
item.pellet_rtg_americium.desc=Rare and reliable, good old Americium!
item.pellet_rtg_berkelium.name=Berkelium RTG Pellet
item.pellet_rtg_berkelium.desc=
item.pellet_rtg_cobalt.name=Cobalt-60 RTG Pellet
item.pellet_rtg_cobalt.desc=Not the best as an RTG, but great for gamma radiation!
item.pellet_rtg_depleted.bismuth.name=Decayed Bismuth RTG Pellet
item.pellet_rtg_depleted.lead.name=Decayed Lead RTG Pellet
item.pellet_rtg_depleted.neptunium.name=Decayed Neptunium RTG Pellet
item.pellet_rtg_depleted.mercury.name=Decayed Mercury RTG Pellet
item.pellet_rtg_depleted.nickel.name=Decayed Nickel RTG Pellet
item.pellet_rtg_depleted.zirconium.name=Decayed Zirconium RTG Pellet
item.pellet_rtg_lead.name=Lead-209 RTG Pellet
item.pellet_rtg_lead.desc=Exposure will result in immediate death.
@ -3549,6 +3558,7 @@ tile.machine_puf6_tank.name=Plutonium Hexafluoride Tank
tile.machine_pumpjack.name=Pumpjack
tile.machine_radar.name=Radar
tile.machine_radgen.name=Radiation-Powered Engine
tile.machine_radiolysis.name=Radioisotope Thermoelectric Generator and Radiolysis Chamber
tile.machine_reactor.name=Breeding Reactor
tile.machine_reactor_small.name=Research Reactor
tile.machine_refinery.name=Oil Refinery

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB