recipe configs, tank textures, persistent NBT, cleanup
@ -11,4 +11,4 @@ credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion al
|
||||
\ Sten89 (models), Pixelguru26 (textures), TheBlueHat (textures), Alcater (GUI textures, porting), impbk2002 (project settings),\
|
||||
\ OvermindDL1 (project settings), TehTemmie (reacher radiation function), Toshayo (satellite loot system, project settings), Silly541 (config for safe ME drives),\
|
||||
\ Voxelstice (OpenComputers integration, turbine spinup), martemen (project settings), Pvndols (thorium fuel recipe, gas turbine), JamesH2 (blood, nitric acid),\
|
||||
\ sdddddf80 (mixer recipe config), SuperCraftAlex (tooltips)
|
||||
\ sdddddf80 (recipe configs), SuperCraftAlex (tooltips)
|
||||
@ -3172,10 +3172,10 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_storage_drum, machine_storage_drum.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_shredder, machine_shredder.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_shredder_large, machine_shredder_large.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_well, machine_well.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_pumpjack, machine_pumpjack.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_fracking_tower, machine_fracking_tower.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_flare, ItemBlockBase.class, machine_flare.getUnlocalizedName());
|
||||
register(machine_well);
|
||||
register(machine_pumpjack);
|
||||
register(machine_fracking_tower);
|
||||
register(machine_flare);
|
||||
register(machine_refinery);
|
||||
register(machine_vacuum_distill);
|
||||
GameRegistry.registerBlock(machine_fraction_tower, machine_fraction_tower.getUnlocalizedName());
|
||||
|
||||
@ -26,7 +26,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
@ -89,27 +88,11 @@ public class MachineFluidTank extends BlockDummyable implements IPersistentInfoP
|
||||
this.makeExtra(world, x - dir.offsetX - 1, y, z - dir.offsetZ + 1);
|
||||
this.makeExtra(world, x - dir.offsetX - 1, y, z - dir.offsetZ - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
|
||||
|
||||
if(!player.capabilities.isCreativeMode) {
|
||||
harvesters.set(player);
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
harvesters.set(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return IPersistentNBT.getDrops(world, x, y, z, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) {
|
||||
player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1);
|
||||
player.addExhaustion(0.025F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
@ -1,19 +1,31 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineFrackingTower;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineFrackingTower extends BlockDummyable {
|
||||
public class MachineFrackingTower extends BlockDummyable implements IPersistentInfoProvider {
|
||||
|
||||
public MachineFrackingTower() {
|
||||
super(Material.iron);
|
||||
@ -89,4 +101,19 @@ public class MachineFrackingTower extends BlockDummyable {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return IPersistentNBT.getDrops(world, x, y, z, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.GREEN + BobMathUtil.getShortNumber(persistentTag.getLong("power")) + "HE");
|
||||
for(int i = 0; i < 2; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "t" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,18 +1,30 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineOilWell;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineOilWell extends BlockDummyable {
|
||||
public class MachineOilWell extends BlockDummyable implements IPersistentInfoProvider {
|
||||
|
||||
public MachineOilWell() {
|
||||
super(Material.iron);
|
||||
@ -63,4 +75,19 @@ public class MachineOilWell extends BlockDummyable {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return IPersistentNBT.getDrops(world, x, y, z, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.GREEN + BobMathUtil.getShortNumber(persistentTag.getLong("power")) + "HE");
|
||||
for(int i = 0; i < 2; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "t" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +1,31 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachinePumpjack;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachinePumpjack extends BlockDummyable {
|
||||
public class MachinePumpjack extends BlockDummyable implements IPersistentInfoProvider {
|
||||
|
||||
public MachinePumpjack() {
|
||||
super(Material.iron);
|
||||
@ -76,4 +88,19 @@ public class MachinePumpjack extends BlockDummyable {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
return IPersistentNBT.getDrops(world, x, y, z, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
list.add(EnumChatFormatting.GREEN + BobMathUtil.getShortNumber(persistentTag.getLong("power")) + "HE");
|
||||
for(int i = 0; i < 2; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "t" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -488,11 +488,11 @@ public class OreDictManager {
|
||||
String dyeName = "dye" + dyes[i];
|
||||
|
||||
OreDictionary.registerOre(dyeName, new ItemStack(ModItems.chemical_dye, 1, i));
|
||||
OreDictionary.registerOre("dye", new ItemStack(ModItems.chemical_dye, 1, i));
|
||||
|
||||
OreDictionary.registerOre(dyeName, new ItemStack(ModItems.crayon, 1, i));
|
||||
OreDictionary.registerOre("dye", new ItemStack(ModItems.crayon, 1, i));
|
||||
}
|
||||
OreDictionary.registerOre("dye", new ItemStack(chemical_dye, 1, OreDictionary.WILDCARD_VALUE));
|
||||
OreDictionary.registerOre("dye", new ItemStack(crayon, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
OreDictionary.registerOre("dyeRed", cinnebar);
|
||||
OreDictionary.registerOre("dye", cinnebar);
|
||||
@ -513,7 +513,7 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("dyeGray", fromOne(oil_tar, EnumTarType.COAL));
|
||||
OreDictionary.registerOre("dyeBrown", fromOne(oil_tar, EnumTarType.WOOD));
|
||||
OreDictionary.registerOre("dyeCyan", fromOne(oil_tar, EnumTarType.WAX));
|
||||
OreDictionary.registerOre("dye", oil_tar);
|
||||
OreDictionary.registerOre("dye", new ItemStack(oil_tar, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
OreDictionary.registerOre("blockGlass", glass_boron);
|
||||
OreDictionary.registerOre("blockGlass", glass_lead);
|
||||
|
||||
@ -1,20 +1,28 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBreedingRod.*;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BreederRecipes {
|
||||
public class BreederRecipes extends SerializableRecipe {
|
||||
|
||||
private static HashMap<ComparableStack, BreederRecipe> recipes = new HashMap();
|
||||
|
||||
public static void registerRecipes() {
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
setRecipe(BreedingRodType.LITHIUM, BreedingRodType.TRITIUM, 200);
|
||||
setRecipe(BreedingRodType.CO, BreedingRodType.CO60, 100);
|
||||
@ -73,4 +81,40 @@ public class BreederRecipes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmBreeder.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
AStack in = this.readAStack(obj.get("input").getAsJsonArray());
|
||||
int flux = obj.get("flux").getAsInt();
|
||||
ItemStack out = this.readItemStack(obj.get("output").getAsJsonArray());
|
||||
recipes.put(((ComparableStack) in), new BreederRecipe(out, flux));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<ComparableStack, BreederRecipe> rec = (Entry<ComparableStack, BreederRecipe>) recipe;
|
||||
ComparableStack in = rec.getKey();
|
||||
|
||||
writer.name("input");
|
||||
this.writeAStack(in, writer);
|
||||
writer.name("flux").value(rec.getValue().flux);
|
||||
writer.name("output");
|
||||
this.writeItemStack(rec.getValue().output, writer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,21 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums.EnumBriquetteType;
|
||||
import com.hbm.items.ItemEnums.EnumCokeType;
|
||||
import com.hbm.items.ItemEnums.EnumTarType;
|
||||
@ -20,11 +26,12 @@ import com.hbm.util.Tuple.Pair;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CombinationRecipes {
|
||||
public class CombinationRecipes extends SerializableRecipe {
|
||||
|
||||
private static HashMap<Object, Pair<ItemStack, FluidStack>> recipes = new HashMap();
|
||||
|
||||
public static void register() {
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
recipes.put(COAL.gem(), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), new FluidStack(Fluids.COALCREOSOTE, 100)));
|
||||
recipes.put(COAL.dust(), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), new FluidStack(Fluids.COALCREOSOTE, 100)));
|
||||
recipes.put(new ComparableStack(DictFrame.fromOne(ModItems.briquette, EnumBriquetteType.COAL)), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), new FluidStack(Fluids.COALCREOSOTE, 150)));
|
||||
@ -94,4 +101,60 @@ public class CombinationRecipes {
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmCombination.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
AStack in = this.readAStack(obj.get("input").getAsJsonArray());
|
||||
FluidStack fluid = null;
|
||||
ItemStack out = null;
|
||||
|
||||
if(obj.has("fluid")) fluid = this.readFluidStack(obj.get("fluid").getAsJsonArray());
|
||||
if(obj.has("output")) out = this.readItemStack(obj.get("output").getAsJsonArray());
|
||||
|
||||
if(in instanceof ComparableStack) {
|
||||
recipes.put(((ComparableStack) in).makeSingular(), new Pair(out, fluid));
|
||||
} else if(in instanceof OreDictStack) {
|
||||
recipes.put(((OreDictStack) in).name, new Pair(out, fluid));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<Object, Pair> rec = (Entry<Object, Pair>) recipe;
|
||||
Object in = rec.getKey();
|
||||
Pair<ItemStack, FluidStack> Pair = rec.getValue();
|
||||
ItemStack output = Pair.key;
|
||||
FluidStack fluid = Pair.value;
|
||||
|
||||
writer.name("input");
|
||||
if(in instanceof String) {
|
||||
this.writeAStack(new OreDictStack((String) in), writer);
|
||||
} else if(in instanceof ComparableStack) {
|
||||
this.writeAStack((ComparableStack) in, writer);
|
||||
}
|
||||
if(output != null) {
|
||||
writer.name("output");
|
||||
this.writeItemStack(output, writer);
|
||||
}
|
||||
if(fluid != null) {
|
||||
writer.name("fluid");
|
||||
this.writeFluidStack(fluid, writer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,17 +1,24 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.imc.IMCCrystallizer;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums.EnumTarType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemChemicalDye.EnumChemDye;
|
||||
@ -30,12 +37,13 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
//This time we're doing this right
|
||||
//...right?
|
||||
public class CrystallizerRecipes {
|
||||
public class CrystallizerRecipes extends SerializableRecipe {
|
||||
|
||||
//'Object' is either a ComparableStack or the key for the ore dict
|
||||
private static HashMap<Pair<Object, FluidType>, CrystallizerRecipe> recipes = new HashMap();
|
||||
|
||||
public static void register() {
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
int baseTime = 600;
|
||||
int utilityTime = 100;
|
||||
@ -212,4 +220,54 @@ public class CrystallizerRecipes {
|
||||
this.acidAmount = 500;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmCrystallizer.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
ItemStack output = this.readItemStack(obj.get("output").getAsJsonArray());
|
||||
AStack input = this.readAStack(obj.get("input").getAsJsonArray());
|
||||
FluidStack fluid = this.readFluidStack(obj.get("fluid").getAsJsonArray());
|
||||
int duration = obj.get("duration").getAsInt();
|
||||
|
||||
CrystallizerRecipe cRecipe = new CrystallizerRecipe(output, duration);
|
||||
cRecipe.acidAmount = fluid.fill;
|
||||
if(input instanceof ComparableStack) {
|
||||
recipes.put(new Pair(((ComparableStack) input).makeSingular(), fluid.type), cRecipe);
|
||||
} else if(input instanceof OreDictStack) {
|
||||
recipes.put(new Pair(((OreDictStack) input).name, fluid.type), cRecipe);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<Pair, CrystallizerRecipe> rec = (Entry<Pair, CrystallizerRecipe>) recipe;
|
||||
CrystallizerRecipe cRecipe = rec.getValue();
|
||||
Pair<Object, FluidType> pair = rec.getKey();
|
||||
AStack input = pair.getKey() instanceof String ? new OreDictStack((String )pair.getKey()) : (ComparableStack) pair.getKey();
|
||||
FluidStack fluid = new FluidStack(pair.value, cRecipe.acidAmount);
|
||||
|
||||
writer.name("duration").value(cRecipe.duration);
|
||||
writer.name("fluid");
|
||||
this.writeFluidStack(fluid, writer);
|
||||
writer.name("input");
|
||||
this.writeAStack(input, writer);
|
||||
writer.name("output");
|
||||
this.writeItemStack(cRecipe.output, writer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,18 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums.EnumBriquetteType;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo556mm;
|
||||
@ -20,7 +26,7 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class PressRecipes {
|
||||
public class PressRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap<Pair<AStack, StampType>, ItemStack> recipes = new HashMap();
|
||||
|
||||
@ -42,8 +48,9 @@ public class PressRecipes {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
makeRecipe(StampType.FLAT, new OreDictStack(NETHERQUARTZ.dust()), Items.quartz);
|
||||
makeRecipe(StampType.FLAT, new OreDictStack(LAPIS.dust()), new ItemStack(Items.dye, 1, 4));
|
||||
@ -114,4 +121,43 @@ public class PressRecipes {
|
||||
public static void makeRecipe(StampType type, AStack in, ItemStack out) {
|
||||
recipes.put(new Pair<AStack, StampType>(in, type), out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmPress.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
AStack input = this.readAStack(obj.get("input").getAsJsonArray());
|
||||
StampType stamp = StampType.valueOf(obj.get("stamp").getAsString().toUpperCase());
|
||||
ItemStack output = this.readItemStack(obj.get("output").getAsJsonArray());
|
||||
|
||||
if(stamp != null) {
|
||||
makeRecipe(stamp, input, output);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<Pair<AStack, StampType>, ItemStack> entry = (Entry<Pair<AStack, StampType>, ItemStack>) recipe;
|
||||
|
||||
writer.name("input");
|
||||
this.writeAStack(entry.getKey().getKey(), writer);
|
||||
writer.name("stamp").value(entry.getKey().getValue().name().toLowerCase());
|
||||
writer.name("output");
|
||||
this.writeItemStack(entry.getValue(), writer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,15 +39,19 @@ public abstract class SerializableRecipe {
|
||||
*/
|
||||
|
||||
public static void registerAllHandlers() {
|
||||
recipeHandlers.add(new PressRecipes());
|
||||
recipeHandlers.add(new BlastFurnaceRecipes());
|
||||
recipeHandlers.add(new ShredderRecipes());
|
||||
recipeHandlers.add(new ChemplantRecipes());
|
||||
recipeHandlers.add(new CombinationRecipes());
|
||||
recipeHandlers.add(new CrucibleRecipes());
|
||||
recipeHandlers.add(new CentrifugeRecipes());
|
||||
recipeHandlers.add(new CrystallizerRecipes());
|
||||
recipeHandlers.add(new FractionRecipes());
|
||||
recipeHandlers.add(new CrackingRecipes());
|
||||
recipeHandlers.add(new LiquefactionRecipes());
|
||||
recipeHandlers.add(new SolidificationRecipes());
|
||||
recipeHandlers.add(new BreederRecipes());
|
||||
recipeHandlers.add(new CyclotronRecipes());
|
||||
recipeHandlers.add(new HadronRecipes());
|
||||
recipeHandlers.add(new FuelPoolRecipes());
|
||||
@ -211,7 +215,7 @@ public abstract class SerializableRecipe {
|
||||
ComparableStack comp = (ComparableStack) astack;
|
||||
writer.value("item"); //ITEM identifier
|
||||
writer.value(Item.itemRegistry.getNameForObject(comp.toStack().getItem())); //item name
|
||||
if(comp.stacksize != 1) writer.value(comp.stacksize); //stack size
|
||||
if(comp.stacksize != 1 || comp.meta > 0) writer.value(comp.stacksize); //stack size
|
||||
if(comp.meta > 0) writer.value(comp.meta); //metadata
|
||||
}
|
||||
if(astack instanceof OreDictStack) {
|
||||
|
||||
@ -775,17 +775,13 @@ public class MainRegistry {
|
||||
|
||||
@EventHandler
|
||||
public static void PostLoad(FMLPostInitializationEvent PostEvent) {
|
||||
CrystallizerRecipes.register();
|
||||
TileEntityNukeFurnace.registerFuels();
|
||||
BreederRecipes.registerRecipes();
|
||||
AssemblerRecipes.loadRecipes();
|
||||
MagicRecipes.register();
|
||||
SILEXRecipes.register();
|
||||
AnvilRecipes.register();
|
||||
PressRecipes.register();
|
||||
RefineryRecipes.registerRefinery();
|
||||
GasCentrifugeRecipes.register();
|
||||
CombinationRecipes.register();
|
||||
|
||||
//the good stuff
|
||||
SerializableRecipe.registerAllHandlers();
|
||||
|
||||
@ -138,7 +138,7 @@ public class ModEventHandlerImpact {
|
||||
|
||||
TomSaveData data = TomSaveData.getLastCachedOrNull();
|
||||
|
||||
if(event.biome == null) {
|
||||
if(data == null || event.biome == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.Tuple;
|
||||
@ -33,8 +34,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class TileEntityOilDrillBase extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidStandardTransceiver, IConfigurableMachine, IGUIProvider {
|
||||
|
||||
public abstract class TileEntityOilDrillBase extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidStandardTransceiver, IConfigurableMachine, IPersistentNBT, IGUIProvider {
|
||||
|
||||
public int indicator = 0;
|
||||
|
||||
public long power;
|
||||
@ -54,6 +55,7 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
this.power = nbt.getLong("power");
|
||||
for(int i = 0; i < this.tanks.length; i++)
|
||||
this.tanks[i].readFromNBT(nbt, "t" + i);
|
||||
}
|
||||
@ -62,10 +64,32 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setLong("power", power);
|
||||
for(int i = 0; i < this.tanks.length; i++)
|
||||
this.tanks[i].writeToNBT(nbt, "t" + i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeNBT(NBTTagCompound nbt) {
|
||||
|
||||
boolean empty = power == 0;
|
||||
for(FluidTank tank : tanks) if(tank.getFill() > 0) empty = false;
|
||||
|
||||
if(!empty) {
|
||||
nbt.setLong("power", power);
|
||||
for(int i = 0; i < this.tanks.length; i++) {
|
||||
this.tanks[i].writeToNBT(nbt, "t" + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readNBT(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("power");
|
||||
for(int i = 0; i < this.tanks.length; i++)
|
||||
this.tanks[i].readFromNBT(nbt, "t" + i);
|
||||
}
|
||||
|
||||
public int speedLevel;
|
||||
public int energyLevel;
|
||||
public int overLevel;
|
||||
|
||||
|
Before Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 296 B |
|
Before Width: | Height: | Size: 194 B |
|
Before Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 339 B |
|
Before Width: | Height: | Size: 372 B |
|
Before Width: | Height: | Size: 281 B |
|
Before Width: | Height: | Size: 400 B |
|
Before Width: | Height: | Size: 461 B |
|
Before Width: | Height: | Size: 440 B |
|
Before Width: | Height: | Size: 451 B |
|
Before Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 380 B |
|
Before Width: | Height: | Size: 382 B |
|
Before Width: | Height: | Size: 294 B |
|
Before Width: | Height: | Size: 324 B |
|
Before Width: | Height: | Size: 375 B |
|
Before Width: | Height: | Size: 406 B |
|
Before Width: | Height: | Size: 376 B |
|
Before Width: | Height: | Size: 304 B |
|
Before Width: | Height: | Size: 214 B |
|
Before Width: | Height: | Size: 346 B |
|
Before Width: | Height: | Size: 358 B |
|
Before Width: | Height: | Size: 347 B |
|
Before Width: | Height: | Size: 305 B |
|
Before Width: | Height: | Size: 433 B |
|
Before Width: | Height: | Size: 307 B |
BIN
src/main/resources/assets/hbm/textures/items/chem_icon_PET.png
Normal file
|
After Width: | Height: | Size: 305 B |
BIN
src/main/resources/assets/hbm/textures/items/chem_icon_TATB.png
Normal file
|
After Width: | Height: | Size: 337 B |
BIN
src/main/resources/assets/hbm/textures/items/stick_tatb.png
Normal file
|
After Width: | Height: | Size: 223 B |
|
Before Width: | Height: | Size: 833 B After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |