mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
centrifuge and cyclotron recipe configs
also some torex tweaks
This commit is contained in:
parent
ea16e518dc
commit
776a203f8a
@ -1424,7 +1424,7 @@ public class ModBlocks {
|
||||
ore_oil_sand = new BlockFalling(Material.sand).setBlockName("ore_oil_sand").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeSand).setHardness(0.5F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":ore_oil_sand_alt");
|
||||
ore_bedrock_oil = new BlockGeneric(Material.rock).setBlockName("ore_bedrock_oil").setCreativeTab(MainRegistry.blockTab).setBlockUnbreakable().setResistance(1_000_000).setBlockTextureName(RefStrings.MODID + ":ore_bedrock_oil");
|
||||
|
||||
ore_tikite = new BlockGeneric(Material.rock).setBlockName("ore_tikite").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_tikite_alt");
|
||||
ore_tikite = new BlockDragonProof(Material.rock).setBlockName("ore_tikite").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_tikite_alt");
|
||||
|
||||
crystal_power = new BlockCrystal(Material.glass).setBlockName("crystal_power").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":crystal_power");
|
||||
crystal_energy = new BlockCrystal(Material.glass).setBlockName("crystal_energy").setStepSound(Block.soundTypeGlass).setCreativeTab(MainRegistry.blockTab).setHardness(2.0F).setResistance(1.0F).setBlockTextureName(RefStrings.MODID + ":crystal_energy");
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCrystal extends Block {
|
||||
public class BlockCrystal extends BlockDragonProof {
|
||||
|
||||
public BlockCrystal(Material mat) {
|
||||
super(mat);
|
||||
|
||||
17
src/main/java/com/hbm/blocks/generic/BlockDragonProof.java
Normal file
17
src/main/java/com/hbm/blocks/generic/BlockDragonProof.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockDragonProof extends BlockGeneric {
|
||||
|
||||
public BlockDragonProof(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
|
||||
return !(entity instanceof EntityDragon);
|
||||
}
|
||||
}
|
||||
@ -36,7 +36,8 @@ public class EntityNukeTorex extends Entity {
|
||||
public void onUpdate() {
|
||||
this.ticksExisted++;
|
||||
|
||||
int maxAge = 90 * 20;
|
||||
double s = this.getScale();
|
||||
int maxAge = (int) (90 * 20 * s);
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
@ -49,19 +50,21 @@ public class EntityNukeTorex extends Entity {
|
||||
for(int i = 0; i < toSpawn; i++) {
|
||||
double y = posY + rand.nextGaussian() - 3; //this.ticksExisted < 60 ? this.posY + this.coreHeight : posY + rand.nextGaussian() - 3;
|
||||
Cloudlet cloud = new Cloudlet(posX + rand.nextGaussian() * range, y, posZ + rand.nextGaussian() * range, (float)(rand.nextDouble() * 2D * Math.PI), 0);
|
||||
cloud.setScale(1F + this.ticksExisted * 0.001F, 5F);
|
||||
cloud.setScale(1F + this.ticksExisted * 0.001F * (float) s, 5F * (float) s);
|
||||
cloudlets.add(cloud);
|
||||
}
|
||||
}
|
||||
|
||||
int cloudCount = ticksExisted * 3;
|
||||
if(ticksExisted < 200) {
|
||||
|
||||
int cloudCount = ticksExisted * 3;
|
||||
|
||||
for(int i = 0; i < cloudCount; i++) {
|
||||
Vec3 vec = Vec3.createVectorHelper((ticksExisted + rand.nextDouble()) * 2, 0, 0);
|
||||
float rot = (float) (Math.PI * 2 * rand.nextDouble());
|
||||
vec.rotateAroundY(rot);
|
||||
this.cloudlets.add(new Cloudlet(vec.xCoord + posX, worldObj.getHeightValue((int) (vec.xCoord + posX) + 1, (int) (vec.zCoord + posZ)), vec.zCoord + posZ, rot, 0)
|
||||
.setScale(5F, 2F)
|
||||
.setScale(5F * (float) s, 2F * (float) s)
|
||||
.setMotion(0));
|
||||
}
|
||||
}
|
||||
@ -69,13 +72,12 @@ public class EntityNukeTorex extends Entity {
|
||||
for(Cloudlet cloud : cloudlets) {
|
||||
cloud.update();
|
||||
}
|
||||
|
||||
coreHeight += 0.15;
|
||||
torusWidth += 0.05;
|
||||
coreHeight += 0.15 * s;
|
||||
torusWidth += 0.05 * s;
|
||||
rollerSize = torusWidth * 0.35;
|
||||
convectionHeight = coreHeight + rollerSize;
|
||||
|
||||
int maxHeat = 50;
|
||||
int maxHeat = (int) (50 * s);
|
||||
heat = maxHeat - Math.pow((maxHeat * this.ticksExisted) / maxAge, 1);
|
||||
|
||||
cloudlets.removeIf(x -> x.isDead);
|
||||
@ -95,6 +97,20 @@ public class EntityNukeTorex extends Entity {
|
||||
|
||||
return 1.0D;
|
||||
}
|
||||
|
||||
public double getScale() {
|
||||
return 1.0D;
|
||||
}
|
||||
|
||||
public double getSaturation() {
|
||||
double d = (double) this.ticksExisted / (double) this.getMaxAge();
|
||||
return 1D - (d * d * d * d);
|
||||
}
|
||||
|
||||
public int getMaxAge() {
|
||||
double s = this.getScale();
|
||||
return (int) (90 * 20 * s);
|
||||
}
|
||||
|
||||
public class Cloudlet {
|
||||
|
||||
|
||||
@ -3,6 +3,8 @@ package com.hbm.handler.imc;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hbm.inventory.RecipesCommon;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -10,7 +12,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class IMCCentrifuge extends IMCHandler {
|
||||
|
||||
public static HashMap<Object, ItemStack[]> buffer = new HashMap();
|
||||
public static HashMap<AStack, ItemStack[]> buffer = new HashMap();
|
||||
|
||||
@Override
|
||||
public void process(IMCMessage message) {
|
||||
@ -40,7 +42,7 @@ public class IMCCentrifuge extends IMCHandler {
|
||||
String dict = data.getString("oredict");
|
||||
|
||||
if(!dict.isEmpty()) {
|
||||
buffer.put(dict, outs);
|
||||
buffer.put(new OreDictStack(dict), outs);
|
||||
} else {
|
||||
this.printError(message, "Input stack could not be read!");
|
||||
}
|
||||
|
||||
@ -19,55 +19,53 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public static ArrayList<Fuel> fuels;
|
||||
public static ArrayList<Fuel> fuels;
|
||||
|
||||
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe
|
||||
{
|
||||
PositionedStack input;
|
||||
PositionedStack result1;
|
||||
PositionedStack result2;
|
||||
PositionedStack result3;
|
||||
PositionedStack result4;
|
||||
|
||||
public RecipeSet(Object input, ItemStack[] results) {
|
||||
this.input = new PositionedStack(input, 21, 6);
|
||||
this.result1 = new PositionedStack(results[0], 129, 6);
|
||||
this.result2 = new PositionedStack(results[1], 147, 6);
|
||||
this.result3 = new PositionedStack(results[2], 129, 42);
|
||||
this.result4 = new PositionedStack(results[3], 147, 42);
|
||||
}
|
||||
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
|
||||
PositionedStack input;
|
||||
PositionedStack result1;
|
||||
PositionedStack result2;
|
||||
PositionedStack result3;
|
||||
PositionedStack result4;
|
||||
|
||||
@Override
|
||||
public RecipeSet(Object input, ItemStack[] results) {
|
||||
this.input = new PositionedStack(input, 21, 6);
|
||||
this.result1 = new PositionedStack(results[0], 129, 6);
|
||||
this.result2 = new PositionedStack(results[1], 147, 6);
|
||||
this.result3 = new PositionedStack(results[2], 129, 42);
|
||||
this.result4 = new PositionedStack(results[3], 147, 42);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return getCycledIngredients(cycleticks / 48, Arrays.asList(input));
|
||||
}
|
||||
return getCycledIngredients(cycleticks / 48, Arrays.asList(input));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks() {
|
||||
List<PositionedStack> stacks = new ArrayList<PositionedStack>();
|
||||
stacks.add(fuels.get((cycleticks / 48) % fuels.size()).stack);
|
||||
stacks.add(result2);
|
||||
stacks.add(result3);
|
||||
stacks.add(result4);
|
||||
return stacks;
|
||||
}
|
||||
List<PositionedStack> stacks = new ArrayList<PositionedStack>();
|
||||
stacks.add(fuels.get((cycleticks / 48) % fuels.size()).stack);
|
||||
stacks.add(result2);
|
||||
stacks.add(result3);
|
||||
stacks.add(result4);
|
||||
return stacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return result1;
|
||||
}
|
||||
}
|
||||
return result1;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Fuel
|
||||
{
|
||||
public Fuel(ItemStack ingred) {
|
||||
|
||||
this.stack = new PositionedStack(ingred, 21, 42, false);
|
||||
}
|
||||
public static class Fuel {
|
||||
public Fuel(ItemStack ingred) {
|
||||
|
||||
this.stack = new PositionedStack(ingred, 21, 42, false);
|
||||
}
|
||||
|
||||
public PositionedStack stack;
|
||||
}
|
||||
|
||||
public PositionedStack stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Centrifuge";
|
||||
@ -78,33 +76,32 @@ public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
|
||||
return GUIMachineCentrifuge.texture.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GUIMachineCentrifuge.class;
|
||||
}
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GUIMachineCentrifuge.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TemplateRecipeHandler newInstance() {
|
||||
if(fuels == null || fuels.isEmpty())
|
||||
fuels = new ArrayList<Fuel>();
|
||||
for(ItemStack i : MachineRecipes.instance().getBatteries()) {
|
||||
fuels.add(new Fuel(i));
|
||||
}
|
||||
return super.newInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TemplateRecipeHandler newInstance() {
|
||||
if (fuels == null || fuels.isEmpty())
|
||||
fuels = new ArrayList<Fuel>();
|
||||
for(ItemStack i : MachineRecipes.instance().getBatteries())
|
||||
{
|
||||
fuels.add(new Fuel(i));
|
||||
}
|
||||
return super.newInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
|
||||
if ((outputId.equals("centrifugeprocessing")) && getClass() == CentrifugeRecipeHandler.class) {
|
||||
|
||||
if((outputId.equals("centrifugeprocessing")) && getClass() == CentrifugeRecipeHandler.class) {
|
||||
|
||||
Map<Object, Object[]> recipes = CentrifugeRecipes.getRecipes();
|
||||
|
||||
for (Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
|
||||
|
||||
for(Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
|
||||
this.arecipes.add(new RecipeSet(recipe.getKey(), RecipesCommon.objectToStackArray(recipe.getValue())));
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
@ -116,22 +113,20 @@ public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
|
||||
Map<Object, Object[]> recipes = CentrifugeRecipes.getRecipes();
|
||||
|
||||
for(Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
|
||||
|
||||
if(NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[0], result) ||
|
||||
NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[1], result) ||
|
||||
NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[2], result) ||
|
||||
NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[3], result))
|
||||
|
||||
if(NEIServerUtils.areStacksSameType((ItemStack) recipe.getValue()[0], result) || NEIServerUtils.areStacksSameType((ItemStack) recipe.getValue()[1], result)
|
||||
|| NEIServerUtils.areStacksSameType((ItemStack) recipe.getValue()[2], result) || NEIServerUtils.areStacksSameType((ItemStack) recipe.getValue()[3], result))
|
||||
this.arecipes.add(new RecipeSet(recipe.getKey(), RecipesCommon.objectToStackArray(recipe.getValue())));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
|
||||
if ((inputId.equals("centrifugeprocessing")) && getClass() == CentrifugeRecipeHandler.class) {
|
||||
|
||||
|
||||
if((inputId.equals("centrifugeprocessing")) && getClass() == CentrifugeRecipeHandler.class) {
|
||||
|
||||
loadCraftingRecipes("centrifugeprocessing", new Object[0]);
|
||||
|
||||
|
||||
} else {
|
||||
super.loadUsageRecipes(inputId, ingredients);
|
||||
}
|
||||
@ -142,37 +137,37 @@ public class CentrifugeRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
Map<Object, Object[]> recipes = CentrifugeRecipes.getRecipes();
|
||||
|
||||
for (Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
|
||||
|
||||
for(Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
|
||||
|
||||
if(recipe.getKey() instanceof ItemStack) {
|
||||
|
||||
if (NEIServerUtils.areStacksSameType(ingredient, (ItemStack)recipe.getKey()))
|
||||
if(NEIServerUtils.areStacksSameType(ingredient, (ItemStack) recipe.getKey()))
|
||||
this.arecipes.add(new RecipeSet(recipe.getKey(), RecipesCommon.objectToStackArray(recipe.getValue())));
|
||||
|
||||
} else if (recipe.getKey() instanceof ArrayList) {
|
||||
|
||||
for(Object o : (ArrayList)recipe.getKey()) {
|
||||
ItemStack stack = (ItemStack)o;
|
||||
|
||||
if (NEIServerUtils.areStacksSameType(ingredient, stack))
|
||||
} else if(recipe.getKey() instanceof ArrayList) {
|
||||
|
||||
for(Object o : (ArrayList) recipe.getKey()) {
|
||||
ItemStack stack = (ItemStack) o;
|
||||
|
||||
if(NEIServerUtils.areStacksSameType(ingredient, stack))
|
||||
this.arecipes.add(new RecipeSet(stack, RecipesCommon.objectToStackArray(recipe.getValue())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
drawProgressBar(21, 24, 195, 55, 16, 16, 48, 7);
|
||||
|
||||
drawProgressBar(56, 5, 176, 0, 54, 54, 48 * 3, 0);
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
drawProgressBar(21, 24, 195, 55, 16, 16, 48, 7);
|
||||
|
||||
drawProgressBar(3, 6, 177, 55, 16, 52, 480, 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(56, 5, 54, 54), "centrifugeprocessing"));
|
||||
}
|
||||
drawProgressBar(56, 5, 176, 0, 54, 54, 48 * 3, 0);
|
||||
|
||||
drawProgressBar(3, 6, 177, 55, 16, 52, 480, 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(56, 5, 54, 54), "centrifugeprocessing"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -155,7 +155,6 @@ public class RecipesCommon {
|
||||
}
|
||||
|
||||
public ItemStack toStack() {
|
||||
|
||||
return new ItemStack(item, stacksize, meta);
|
||||
}
|
||||
|
||||
|
||||
@ -1,15 +1,23 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.handler.imc.IMCCentrifuge;
|
||||
import com.hbm.inventory.RecipesCommon;
|
||||
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.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
@ -18,11 +26,12 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class CentrifugeRecipes {
|
||||
public class CentrifugeRecipes extends SerializableRecipe {
|
||||
|
||||
private static HashMap<Object, ItemStack[]> recipes = new HashMap();
|
||||
|
||||
public static void register() {
|
||||
private static HashMap<AStack, ItemStack[]> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
boolean lbs = GeneralConfig.enableLBSM && GeneralConfig.enableLBSMSimpleCentrifuge;
|
||||
|
||||
@ -128,79 +137,79 @@ public class CentrifugeRecipes {
|
||||
new ItemStack(ModItems.dust, 1),
|
||||
new ItemStack(ModItems.dust, 1) });
|
||||
|
||||
recipes.put("oreCoal", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreCoal"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_coal, 2),
|
||||
new ItemStack(ModItems.powder_coal, 2),
|
||||
new ItemStack(ModItems.powder_coal, 2),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreLignite", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreLignite"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_lignite, 2),
|
||||
new ItemStack(ModItems.powder_lignite, 2),
|
||||
new ItemStack(ModItems.powder_lignite, 2),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreIron", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreIron"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreGold", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreGold"), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_gold, 2) : new ItemStack(ModItems.powder_gold, 1),
|
||||
new ItemStack(ModItems.powder_gold, 1),
|
||||
lbs ? new ItemStack(ModItems.nugget_bismuth, 1) : new ItemStack(ModItems.powder_gold, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreDiamond", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreDiamond"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_diamond, 1),
|
||||
new ItemStack(ModItems.powder_diamond, 1),
|
||||
new ItemStack(ModItems.powder_diamond, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreEmerald", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreEmerald"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_emerald, 1),
|
||||
new ItemStack(ModItems.powder_emerald, 1),
|
||||
new ItemStack(ModItems.powder_emerald, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreTitanium", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreTitanium"), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_titanium, 2) : new ItemStack(ModItems.powder_titanium, 1),
|
||||
lbs ? new ItemStack(ModItems.powder_titanium, 2) : new ItemStack(ModItems.powder_titanium, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreQuartz", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreQuartz"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_quartz, 1),
|
||||
new ItemStack(ModItems.powder_quartz, 1),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 1),
|
||||
new ItemStack(Blocks.netherrack, 1) });
|
||||
|
||||
recipes.put("oreTungsten", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreTungsten"), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_tungsten, 2) : new ItemStack(ModItems.powder_tungsten, 1),
|
||||
new ItemStack(ModItems.powder_tungsten, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreCopper", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreCopper"), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_copper, 2) : new ItemStack(ModItems.powder_copper, 1),
|
||||
new ItemStack(ModItems.powder_copper, 1),
|
||||
new ItemStack(ModItems.powder_gold, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreAluminum", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreAluminum"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_aluminium, 1),
|
||||
new ItemStack(ModItems.powder_aluminium, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreLead", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreLead"), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_lead, 2) : new ItemStack(ModItems.powder_lead, 1),
|
||||
lbs ? new ItemStack(ModItems.nugget_bismuth, 1) : new ItemStack(ModItems.powder_lead, 1),
|
||||
new ItemStack(ModItems.powder_gold, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreSchrabidium", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreSchrabidium"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_schrabidium, 1),
|
||||
new ItemStack(ModItems.powder_schrabidium, 1),
|
||||
new ItemStack(ModItems.nugget_solinium, 1),
|
||||
@ -212,31 +221,31 @@ public class CentrifugeRecipes {
|
||||
new ItemStack(ModItems.nugget_zirconium, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("orePlutonium", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("orePlutonium"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_plutonium, 1),
|
||||
new ItemStack(ModItems.powder_plutonium, 1),
|
||||
new ItemStack(ModItems.nugget_polonium, 3),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreUranium", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreUranium"), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_uranium, 2) : new ItemStack(ModItems.powder_uranium, 1),
|
||||
lbs ? new ItemStack(ModItems.nugget_technetium, 2) : new ItemStack(ModItems.powder_uranium, 1),
|
||||
lbs ? new ItemStack(ModItems.nugget_ra226, 2) : new ItemStack(ModItems.nugget_ra226, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreThorium", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreThorium"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_thorium, 1),
|
||||
new ItemStack(ModItems.powder_thorium, 1),
|
||||
new ItemStack(ModItems.powder_uranium, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreBeryllium", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreBeryllium"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_beryllium, 1),
|
||||
new ItemStack(ModItems.powder_beryllium, 1),
|
||||
new ItemStack(ModItems.powder_emerald, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
recipes.put("oreRedstone", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreRedstone"), new ItemStack[] {
|
||||
new ItemStack(Items.redstone, 3),
|
||||
new ItemStack(Items.redstone, 3),
|
||||
lbs ? new ItemStack(ModItems.ingot_mercury, 3) : new ItemStack(ModItems.ingot_mercury, 1),
|
||||
@ -248,7 +257,7 @@ public class CentrifugeRecipes {
|
||||
new ItemStack(ModItems.powder_nitan_mix, 1),
|
||||
new ItemStack(Blocks.end_stone, 1) });
|
||||
|
||||
recipes.put("oreLapis", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreLapis"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_lapis, 3),
|
||||
new ItemStack(ModItems.powder_lapis, 3),
|
||||
new ItemStack(ModItems.powder_cobalt_tiny, 1),
|
||||
@ -272,7 +281,7 @@ public class CentrifugeRecipes {
|
||||
new ItemStack(ModItems.ingot_phosphorus),
|
||||
new ItemStack(Blocks.netherrack) });
|
||||
|
||||
recipes.put("oreCobalt", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreCobalt"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_cobalt, 2),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(ModItems.powder_copper, 1),
|
||||
@ -290,7 +299,7 @@ public class CentrifugeRecipes {
|
||||
ItemStack qItem = quartz.get(0).copy();
|
||||
qItem.stackSize = 2;
|
||||
|
||||
recipes.put("oreCertusQuartz", new ItemStack[] {
|
||||
recipes.put(new OreDictStack("oreCertusQuartz"), new ItemStack[] {
|
||||
qItem.copy(),
|
||||
qItem.copy(),
|
||||
qItem.copy(),
|
||||
@ -327,8 +336,10 @@ public class CentrifugeRecipes {
|
||||
recipes.put(new ComparableStack(ModItems.crystal_lithium), new ItemStack[] { new ItemStack(ModItems.powder_lithium, 2), new ItemStack(ModItems.powder_lithium, 2), new ItemStack(ModItems.powder_quartz, 1), new ItemStack(ModItems.fluorite, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_starmetal), new ItemStack[] { new ItemStack(ModItems.powder_dura_steel, 3), new ItemStack(ModItems.powder_cobalt, 3), new ItemStack(ModItems.powder_astatine, 2), new ItemStack(ModItems.ingot_mercury, 5) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_cobalt), new ItemStack[] { new ItemStack(ModItems.powder_cobalt, 2), new ItemStack(ModItems.powder_iron, 3), new ItemStack(ModItems.powder_copper, 3), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerPost() {
|
||||
|
||||
if(!IMCCentrifuge.buffer.isEmpty()) {
|
||||
recipes.putAll(IMCCentrifuge.buffer);
|
||||
@ -342,7 +353,7 @@ public class CentrifugeRecipes {
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return null;
|
||||
|
||||
ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
ComparableStack comp = new ComparableStack(stack).makeSingular();
|
||||
|
||||
if(recipes.containsKey(comp))
|
||||
return RecipesCommon.copyStackArray(recipes.get(comp));
|
||||
@ -350,8 +361,7 @@ public class CentrifugeRecipes {
|
||||
String[] dictKeys = comp.getDictKeys();
|
||||
|
||||
for(String key : dictKeys) {
|
||||
|
||||
if(recipes.containsKey(key))
|
||||
if(recipes.containsKey(new OreDictStack(key)))
|
||||
return RecipesCommon.copyStackArray(recipes.get(key));
|
||||
}
|
||||
|
||||
@ -362,16 +372,55 @@ public class CentrifugeRecipes {
|
||||
|
||||
Map<Object, Object[]> recipes = new HashMap<Object, Object[]>();
|
||||
|
||||
for(Entry<Object, ItemStack[]> entry : CentrifugeRecipes.recipes.entrySet()) {
|
||||
|
||||
if(entry.getKey() instanceof String) {
|
||||
List<ItemStack> ingredients = OreDictionary.getOres((String)entry.getKey());
|
||||
recipes.put(ingredients, entry.getValue());
|
||||
} else {
|
||||
recipes.put(((ComparableStack)entry.getKey()).toStack(), entry.getValue());
|
||||
}
|
||||
for(Entry<AStack, ItemStack[]> entry : CentrifugeRecipes.recipes.entrySet()) {
|
||||
recipes.put(entry.getKey().extractForNEI(), entry.getValue());
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmCentrifuge.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());
|
||||
ItemStack[] out = this.readItemStackArray((JsonArray) obj.get("output"));
|
||||
this.recipes.put(in, out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
try {
|
||||
Entry<AStack, ItemStack[]> entry = (Entry<AStack, ItemStack[]>) recipe;
|
||||
writer.name("input");
|
||||
this.writeAStack(entry.getKey(), writer);
|
||||
writer.name("output").beginArray();
|
||||
for(ItemStack stack : entry.getValue()) {
|
||||
this.writeItemStack(stack, writer);
|
||||
}
|
||||
writer.endArray();
|
||||
} catch(Exception ex) {
|
||||
MainRegistry.logger.error(ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return "Outputs have to be an array of four item stacks. The centrifuge can't handle recipes with a smaller output as of now.";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,112 +1,111 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
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.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class CyclotronRecipes {
|
||||
|
||||
//i could have used classes for this, oh bother
|
||||
private static HashMap<Object, ItemStack> lithium = new HashMap();
|
||||
private static HashMap<Object, ItemStack> beryllium = new HashMap();
|
||||
private static HashMap<Object, ItemStack> carbon = new HashMap();
|
||||
private static HashMap<Object, ItemStack> copper = new HashMap();
|
||||
private static HashMap<Object, ItemStack> plutonium = new HashMap();
|
||||
private static HashMap<Object, Integer> liAmat = new HashMap();
|
||||
private static HashMap<Object, Integer> beAmat = new HashMap();
|
||||
private static HashMap<Object, Integer> caAmat = new HashMap();
|
||||
private static HashMap<Object, Integer> coAmat = new HashMap();
|
||||
private static HashMap<Object, Integer> plAmat = new HashMap();
|
||||
public class CyclotronRecipes extends SerializableRecipe {
|
||||
|
||||
public static void register() {
|
||||
public static HashMap<Pair<ComparableStack, AStack>, Pair<ItemStack, Integer>> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
/// LITHIUM START ///
|
||||
int liA = 50;
|
||||
|
||||
makeRecipe(lithium, liAmat, "dustLithium", new ItemStack(ModItems.powder_beryllium), liA);
|
||||
makeRecipe(lithium, liAmat, "dustBeryllium", new ItemStack(ModItems.powder_boron), liA);
|
||||
makeRecipe(lithium, liAmat, "dustBoron", new ItemStack(ModItems.powder_coal), liA);
|
||||
makeRecipe(lithium, liAmat, "dustNetherQuartz", new ItemStack(ModItems.powder_fire), liA);
|
||||
makeRecipe(lithium, liAmat, "dustPhosphorus", new ItemStack(ModItems.sulfur), liA);
|
||||
makeRecipe(lithium, liAmat, "dustIron", new ItemStack(ModItems.powder_cobalt), liA);
|
||||
makeRecipe(lithium, liAmat, new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_zirconium), liA);
|
||||
makeRecipe(lithium, liAmat, "dustGold", new ItemStack(ModItems.ingot_mercury), liA);
|
||||
makeRecipe(lithium, liAmat, "dustPolonium", new ItemStack(ModItems.powder_astatine), liA);
|
||||
makeRecipe(lithium, liAmat, "dustLanthanium", new ItemStack(ModItems.powder_cerium), liA);
|
||||
makeRecipe(lithium, liAmat, "dustActinium", new ItemStack(ModItems.powder_thorium), liA);
|
||||
makeRecipe(lithium, liAmat, "dustUranium", new ItemStack(ModItems.powder_neptunium), liA);
|
||||
makeRecipe(lithium, liAmat, "dustNeptunium", new ItemStack(ModItems.powder_plutonium), liA);
|
||||
makeRecipe(lithium, liAmat, new ComparableStack(ModItems.powder_reiium), new ItemStack(ModItems.powder_weidanium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustLithium"), new ItemStack(ModItems.powder_beryllium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustBeryllium"), new ItemStack(ModItems.powder_boron), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustBoron"), new ItemStack(ModItems.powder_coal), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustNetherQuartz"), new ItemStack(ModItems.powder_fire), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustPhosphorus"), new ItemStack(ModItems.sulfur), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustIron"), new ItemStack(ModItems.powder_cobalt), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_zirconium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustGold"), new ItemStack(ModItems.ingot_mercury), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustPolonium"), new ItemStack(ModItems.powder_astatine), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustLanthanium"), new ItemStack(ModItems.powder_cerium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustActinium"), new ItemStack(ModItems.powder_thorium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustUranium"), new ItemStack(ModItems.powder_neptunium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new OreDictStack("dustNeptunium"), new ItemStack(ModItems.powder_plutonium), liA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium), new ComparableStack(ModItems.powder_reiium), new ItemStack(ModItems.powder_weidanium), liA);
|
||||
/// LITHIUM END ///
|
||||
|
||||
/// BERYLLIUM START ///
|
||||
int beA = 25;
|
||||
|
||||
makeRecipe(beryllium, beAmat, "dustLithium", new ItemStack(ModItems.powder_boron), beA);
|
||||
makeRecipe(beryllium, beAmat, "dustNetherQuartz", new ItemStack(ModItems.sulfur), beA);
|
||||
makeRecipe(beryllium, beAmat, "dustTitanium", new ItemStack(ModItems.powder_iron), beA);
|
||||
makeRecipe(beryllium, beAmat, "dustCobalt", new ItemStack(ModItems.powder_copper), beA);
|
||||
makeRecipe(beryllium, beAmat, new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_niobium), beA);
|
||||
makeRecipe(beryllium, beAmat, new ComparableStack(ModItems.powder_cerium), new ItemStack(ModItems.powder_neodymium), beA);
|
||||
makeRecipe(beryllium, beAmat, "dustThorium", new ItemStack(ModItems.powder_uranium), beA);
|
||||
makeRecipe(beryllium, beAmat, new ComparableStack(ModItems.powder_weidanium), new ItemStack(ModItems.powder_australium), beA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_beryllium), new OreDictStack("dustLithium"), new ItemStack(ModItems.powder_boron), beA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_beryllium), new OreDictStack("dustNetherQuartz"), new ItemStack(ModItems.sulfur), beA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_beryllium), new OreDictStack("dustTitanium"), new ItemStack(ModItems.powder_iron), beA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_beryllium), new OreDictStack("dustCobalt"), new ItemStack(ModItems.powder_copper), beA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_beryllium), new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_niobium), beA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_beryllium), new ComparableStack(ModItems.powder_cerium), new ItemStack(ModItems.powder_neodymium), beA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_beryllium), new OreDictStack("dustThorium"), new ItemStack(ModItems.powder_uranium), beA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_beryllium), new ComparableStack(ModItems.powder_weidanium), new ItemStack(ModItems.powder_australium), beA);
|
||||
/// BERYLLIUM END ///
|
||||
|
||||
/// CARBON START ///
|
||||
int caA = 10;
|
||||
|
||||
makeRecipe(carbon, caAmat, "dustBoron", new ItemStack(ModItems.powder_aluminium), caA);
|
||||
makeRecipe(carbon, caAmat, "dustSulfur", new ItemStack(ModItems.powder_titanium), caA);
|
||||
makeRecipe(carbon, caAmat, "dustTitanium", new ItemStack(ModItems.powder_cobalt), caA);
|
||||
makeRecipe(carbon, caAmat, new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_lanthanium), caA);
|
||||
makeRecipe(carbon, caAmat, new ComparableStack(ModItems.powder_neodymium), new ItemStack(ModItems.powder_gold), caA);
|
||||
makeRecipe(carbon, caAmat, new ComparableStack(ModItems.ingot_mercury), new ItemStack(ModItems.powder_polonium), caA);
|
||||
makeRecipe(carbon, caAmat, new ComparableStack(ModItems.powder_lead), new ItemStack(ModItems.powder_ra226),caA);
|
||||
makeRecipe(carbon, caAmat, new ComparableStack(ModItems.powder_astatine), new ItemStack(ModItems.powder_actinium), caA);
|
||||
makeRecipe(carbon, caAmat, new ComparableStack(ModItems.powder_australium), new ItemStack(ModItems.powder_verticium), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new OreDictStack("dustBoron"), new ItemStack(ModItems.powder_aluminium), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new OreDictStack("dustSulfur"), new ItemStack(ModItems.powder_titanium), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new OreDictStack("dustTitanium"), new ItemStack(ModItems.powder_cobalt), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_lanthanium), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_neodymium), new ItemStack(ModItems.powder_gold), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.ingot_mercury), new ItemStack(ModItems.powder_polonium), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_lead), new ItemStack(ModItems.powder_ra226),caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_astatine), new ItemStack(ModItems.powder_actinium), caA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon), new ComparableStack(ModItems.powder_australium), new ItemStack(ModItems.powder_verticium), caA);
|
||||
/// CARBON END ///
|
||||
|
||||
/// COPPER START ///
|
||||
int coA = 15;
|
||||
|
||||
makeRecipe(copper, coAmat, "dustBeryllium", new ItemStack(ModItems.powder_quartz), coA);
|
||||
makeRecipe(copper, coAmat, "dustCoal", new ItemStack(ModItems.powder_bromine), coA);
|
||||
makeRecipe(copper, coAmat, "dustTitanium", new ItemStack(ModItems.powder_strontium), coA);
|
||||
makeRecipe(copper, coAmat, "dustIron", new ItemStack(ModItems.powder_niobium), coA);
|
||||
makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_bromine), new ItemStack(ModItems.powder_iodine), coA);
|
||||
makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_neodymium), coA);
|
||||
makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_niobium), new ItemStack(ModItems.powder_caesium), coA);
|
||||
makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_iodine), new ItemStack(ModItems.powder_polonium), coA);
|
||||
makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_actinium), coA);
|
||||
makeRecipe(copper, coAmat, "dustGold", new ItemStack(ModItems.powder_uranium), coA);
|
||||
makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_verticium), new ItemStack(ModItems.powder_unobtainium), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new OreDictStack("dustBeryllium"), new ItemStack(ModItems.powder_quartz), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new OreDictStack("dustCoal"), new ItemStack(ModItems.powder_bromine), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new OreDictStack("dustTitanium"), new ItemStack(ModItems.powder_strontium), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new OreDictStack("dustIron"), new ItemStack(ModItems.powder_niobium), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new ComparableStack(ModItems.powder_bromine), new ItemStack(ModItems.powder_iodine), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_neodymium), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new ComparableStack(ModItems.powder_niobium), new ItemStack(ModItems.powder_caesium), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new ComparableStack(ModItems.powder_iodine), new ItemStack(ModItems.powder_polonium), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_actinium), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new OreDictStack("dustGold"), new ItemStack(ModItems.powder_uranium), coA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper), new ComparableStack(ModItems.powder_verticium), new ItemStack(ModItems.powder_unobtainium), coA);
|
||||
/// COPPER END ///
|
||||
|
||||
/// PLUTONIUM START ///
|
||||
int plA = 100;
|
||||
|
||||
makeRecipe(plutonium, plAmat, "dustPhosphorus", new ItemStack(ModItems.powder_tennessine), plA);
|
||||
makeRecipe(plutonium, plAmat, "dustPlutonium", new ItemStack(ModItems.powder_tennessine), plA);
|
||||
makeRecipe(plutonium, plAmat, new ComparableStack(ModItems.powder_tennessine), new ItemStack(ModItems.powder_reiium), plA);
|
||||
makeRecipe(plutonium, plAmat, new ComparableStack(ModItems.pellet_charged), new ItemStack(ModItems.nugget_schrabidium), 1000);
|
||||
makeRecipe(plutonium, plAmat, new ComparableStack(ModItems.powder_unobtainium), new ItemStack(ModItems.powder_daffergon), plA);
|
||||
makeRecipe(plutonium, plAmat, new ComparableStack(ModItems.cell_antimatter), new ItemStack(ModItems.cell_anti_schrabidium), 0);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new OreDictStack("dustPhosphorus"), new ItemStack(ModItems.powder_tennessine), plA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new OreDictStack("dustPlutonium"), new ItemStack(ModItems.powder_tennessine), plA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.powder_tennessine), new ItemStack(ModItems.powder_reiium), plA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.pellet_charged), new ItemStack(ModItems.nugget_schrabidium), 1000);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.powder_unobtainium), new ItemStack(ModItems.powder_daffergon), plA);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium), new ComparableStack(ModItems.cell_antimatter), new ItemStack(ModItems.cell_anti_schrabidium), 0);
|
||||
/// PLUTONIUM END ///
|
||||
|
||||
///TODO: fictional elements
|
||||
}
|
||||
|
||||
private static void makeRecipe(HashMap<Object, ItemStack> map, HashMap<Object, Integer> aMap, Object in, ItemStack out, int amat) {
|
||||
map.put(in, out);
|
||||
aMap.put(in, amat);
|
||||
private static void makeRecipe(ComparableStack part, AStack in, ItemStack out, int amat) {
|
||||
recipes.put(new Pair(part, in), new Pair(out, amat));
|
||||
}
|
||||
|
||||
public static Object[] getOutput(ItemStack stack, ItemStack box) {
|
||||
@ -114,40 +113,22 @@ public class CyclotronRecipes {
|
||||
if(stack == null || stack.getItem() == null || box == null)
|
||||
return null;
|
||||
|
||||
HashMap<Object, ItemStack> pool = null;
|
||||
HashMap<Object, Integer> aPool = null;
|
||||
ComparableStack boxStack = new ComparableStack(box).makeSingular();
|
||||
ComparableStack comp = new ComparableStack(stack).makeSingular();
|
||||
|
||||
if(box.getItem() == ModItems.part_lithium) {
|
||||
pool = lithium;
|
||||
aPool = liAmat;
|
||||
} else if(box.getItem() == ModItems.part_beryllium) {
|
||||
pool = beryllium;
|
||||
aPool = beAmat;
|
||||
} else if(box.getItem() == ModItems.part_carbon) {
|
||||
pool = carbon;
|
||||
aPool = caAmat;
|
||||
} else if(box.getItem() == ModItems.part_copper) {
|
||||
pool = copper;
|
||||
aPool = coAmat;
|
||||
} else if(box.getItem() == ModItems.part_plutonium) {
|
||||
pool = plutonium;
|
||||
aPool = plAmat;
|
||||
Pair<ItemStack, Integer> output = recipes.get(new Pair(boxStack, comp));
|
||||
|
||||
if(output != null) {
|
||||
return new Object[] { output.getKey().copy(), output.getValue() };
|
||||
}
|
||||
|
||||
if(pool == null)
|
||||
return null;
|
||||
|
||||
ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
|
||||
if(pool.containsKey(comp))
|
||||
return new Object[] {pool.get(comp).copy(), aPool.get(comp)};
|
||||
|
||||
String[] dictKeys = comp.getDictKeys();
|
||||
|
||||
for(String key : dictKeys) {
|
||||
|
||||
if(pool.containsKey(key))
|
||||
return new Object[] {pool.get(key).copy(), aPool.get(key)};
|
||||
for(String name : ItemStackUtil.getOreDictNames(stack)) {
|
||||
OreDictStack ods = new OreDictStack(name);
|
||||
output = recipes.get(new Pair(boxStack, comp));
|
||||
|
||||
if(output != null) {
|
||||
return new Object[] { output.getKey().copy(), output.getValue() };
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -155,33 +136,68 @@ public class CyclotronRecipes {
|
||||
|
||||
public static Map<Object[], Object> getRecipes() {
|
||||
|
||||
Map<Object[], Object> recipes = new HashMap<Object[], Object>();
|
||||
|
||||
addRecipes(recipes, lithium, ModItems.part_lithium);
|
||||
addRecipes(recipes, beryllium, ModItems.part_beryllium);
|
||||
addRecipes(recipes, carbon, ModItems.part_carbon);
|
||||
addRecipes(recipes, copper, ModItems.part_copper);
|
||||
addRecipes(recipes, plutonium, ModItems.part_plutonium);
|
||||
Map<Object[], Object> map = new HashMap<Object[], Object>();
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
private static void addRecipes(Map<Object[], Object> recipes, HashMap<Object, ItemStack> map, Item part) {
|
||||
|
||||
for(Entry<Object, ItemStack> entry : map.entrySet()) {
|
||||
for(Entry<Pair<ComparableStack, AStack>, Pair<ItemStack, Integer>> entry : recipes.entrySet()) {
|
||||
List<ItemStack> stack = entry.getKey().getValue().extractForNEI();
|
||||
|
||||
if(entry.getKey() instanceof ComparableStack) {
|
||||
|
||||
recipes.put(new ItemStack[] { new ItemStack(part), ((ComparableStack) entry.getKey()).toStack() }, entry.getValue());
|
||||
|
||||
} else if(entry.getKey() instanceof String) {
|
||||
|
||||
List<ItemStack> ores = OreDictionary.getOres((String) entry.getKey());
|
||||
|
||||
for(ItemStack ore : ores) {
|
||||
recipes.put(new ItemStack[] { new ItemStack(part), ore }, entry.getValue());
|
||||
}
|
||||
for(ItemStack ingredient : stack) {
|
||||
map.put(new ItemStack[] { entry.getKey().getKey().toStack(), ingredient }, entry.getValue().getKey());
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmCyclotron.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return this.recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonArray particle = ((JsonObject)recipe).get("particle").getAsJsonArray();
|
||||
JsonArray input = ((JsonObject)recipe).get("input").getAsJsonArray();
|
||||
JsonArray output = ((JsonObject)recipe).get("output").getAsJsonArray();
|
||||
int antimatter = ((JsonObject)recipe).get("antimatter").getAsInt();
|
||||
ItemStack partStack = this.readItemStack(particle);
|
||||
AStack inStack = this.readAStack(input);
|
||||
ItemStack outStack = this.readItemStack(output);
|
||||
|
||||
this.recipes.put(new Pair(partStack, inStack), new Pair(outStack, antimatter));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
try{
|
||||
Entry<Pair<ComparableStack, AStack>, Pair<ItemStack, Integer>> rec = (Entry<Pair<ComparableStack, AStack>, Pair<ItemStack, Integer>>) recipe;
|
||||
|
||||
writer.name("particle");
|
||||
this.writeItemStack(rec.getKey().getKey().toStack(), writer);
|
||||
writer.name("input");
|
||||
this.writeAStack(rec.getKey().getValue(), writer);
|
||||
writer.name("output");
|
||||
this.writeItemStack(rec.getValue().getKey(), writer);
|
||||
writer.name("antimatter").value(rec.getValue().getValue());
|
||||
|
||||
} catch(Exception ex) {
|
||||
MainRegistry.logger.error(ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
this.recipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return "The particle item, while being an input, has to be defined as an item stack without ore dictionary support.";
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,6 +27,7 @@ import com.hbm.main.MainRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
//the anti-spaghetti. this class provides so much functionality and saves so much time, i just love you, SerializableRecipe <3
|
||||
public abstract class SerializableRecipe {
|
||||
|
||||
public static final Gson gson = new Gson();
|
||||
@ -38,6 +39,8 @@ public abstract class SerializableRecipe {
|
||||
|
||||
public static void registerAllHandlers() {
|
||||
recipeHandlers.add(new ChemplantRecipes());
|
||||
recipeHandlers.add(new CentrifugeRecipes());
|
||||
recipeHandlers.add(new CyclotronRecipes());
|
||||
recipeHandlers.add(new HadronRecipes());
|
||||
recipeHandlers.add(new FuelPoolRecipes());
|
||||
}
|
||||
@ -67,6 +70,8 @@ public abstract class SerializableRecipe {
|
||||
MainRegistry.logger.info("Writing template file " + recTemplate.getName());
|
||||
recipe.writeTemplateFile(recTemplate);
|
||||
}
|
||||
|
||||
recipe.registerPost();
|
||||
}
|
||||
|
||||
MainRegistry.logger.info("Finished recipe init!");
|
||||
@ -89,7 +94,9 @@ public abstract class SerializableRecipe {
|
||||
public abstract void registerDefaults();
|
||||
/** Deletes all existing recipes, currenly unused */
|
||||
public abstract void deleteRecipes();
|
||||
|
||||
/** A routine called after registering all recipes, whether it's a template or not. Good for IMC functionality. */
|
||||
public void registerPost() { }
|
||||
/** Returns a string to be printed as info at the top of the JSON file */
|
||||
public String getComment() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -769,13 +769,9 @@ public class MainRegistry {
|
||||
ShredderRecipes.registerShredder();
|
||||
ShredderRecipes.registerOverrides();
|
||||
CrystallizerRecipes.register();
|
||||
CentrifugeRecipes.register();
|
||||
TileEntityNukeFurnace.registerFuels();
|
||||
BreederRecipes.registerRecipes();
|
||||
AssemblerRecipes.loadRecipes();
|
||||
//ChemplantRecipes.register(); moved to SerializableRecipe
|
||||
CyclotronRecipes.register();
|
||||
//HadronRecipes.register(); moved to SerializableRecipe
|
||||
MagicRecipes.register();
|
||||
SILEXRecipes.register();
|
||||
AnvilRecipes.register();
|
||||
|
||||
@ -1,14 +1,9 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineMiniRTG extends TileEntityLoadedBase implements IEnergyGenerator {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user