From 7daceac39f2c3d507937babd3cd379a8d4193c73 Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 24 Jan 2022 11:59:47 +0100 Subject: [PATCH] better hadron errors, RBMK fuel depletion slopes, mud recycling --- .../nei/GasCentrifugeRecipeHandler.java | 145 +++++++++--------- .../java/com/hbm/inventory/gui/GUIHadron.java | 2 +- .../recipes/GasCentrifugeRecipes.java | 20 ++- src/main/java/com/hbm/items/ModItems.java | 8 + .../com/hbm/items/machine/ItemRBMKRod.java | 33 +++- .../com/hbm/items/tool/ItemGuideBook.java | 14 +- .../java/com/hbm/main/CraftingManager.java | 7 +- .../tileentity/machine/TileEntityHadron.java | 45 +++--- src/main/resources/assets/hbm/lang/de_DE.lang | 11 +- src/main/resources/assets/hbm/lang/en_US.lang | 31 +++- .../hbm/textures/items/rbmk_fuel_test.png | Bin 0 -> 749 bytes 11 files changed, 208 insertions(+), 108 deletions(-) create mode 100644 src/main/resources/assets/hbm/textures/items/rbmk_fuel_test.png diff --git a/src/main/java/com/hbm/handler/nei/GasCentrifugeRecipeHandler.java b/src/main/java/com/hbm/handler/nei/GasCentrifugeRecipeHandler.java index da94c5b43..194d572d0 100644 --- a/src/main/java/com/hbm/handler/nei/GasCentrifugeRecipeHandler.java +++ b/src/main/java/com/hbm/handler/nei/GasCentrifugeRecipeHandler.java @@ -18,54 +18,51 @@ import net.minecraft.item.ItemStack; public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { - public static ArrayList fuels; + public static ArrayList fuels; - public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe - { - PositionedStack input; - PositionedStack result1; - PositionedStack result2; - PositionedStack result3; + public class SmeltingSet extends TemplateRecipeHandler.CachedRecipe { + PositionedStack input; + PositionedStack result1; + PositionedStack result2; + PositionedStack result3; - - public SmeltingSet(ItemStack input, ItemStack result1, ItemStack result2, ItemStack result3) { - input.stackSize = 1; - this.input = new PositionedStack(input, 25, 35 - 11); - this.result1 = new PositionedStack(result1, 128, 26 - 11); - this.result2 = new PositionedStack(result2, 128, 44 - 11); - this.result3 = new PositionedStack(result3, 146, 35 - 11); - } + public SmeltingSet(ItemStack input, ItemStack result1, ItemStack result2, ItemStack result3) { + input.stackSize = 1; + this.input = new PositionedStack(input, 25, 35 - 11); + this.result1 = new PositionedStack(result1, 128, 26 - 11); + this.result2 = new PositionedStack(result2, 128, 44 - 11); + this.result3 = new PositionedStack(result3, 146, 35 - 11); + } - @Override + @Override public List getIngredients() { - return getCycledIngredients(cycleticks / 48, Arrays.asList(new PositionedStack[] {input})); - } + return getCycledIngredients(cycleticks / 48, Arrays.asList(new PositionedStack[] { input })); + } - @Override + @Override public List getOtherStacks() { - List stacks = new ArrayList(); - stacks.add(fuels.get((cycleticks / 48) % fuels.size()).stack); - stacks.add(result2); - stacks.add(result3); - return stacks; - } + List stacks = new ArrayList(); + stacks.add(fuels.get((cycleticks / 48) % fuels.size()).stack); + stacks.add(result2); + stacks.add(result3); + return stacks; + } - @Override + @Override public PositionedStack getResult() { - return result1; - } - } + return result1; + } + } - public static class Fuel - { - public Fuel(ItemStack ingred) { - - this.stack = new PositionedStack(ingred, 3, 42, false); - } + public static class Fuel { + public Fuel(ItemStack ingred) { + + this.stack = new PositionedStack(ingred, 3, 42, false); + } + + public PositionedStack stack; + } - public PositionedStack stack; - } - @Override public String getRecipeName() { return "Gas Centrifuge"; @@ -76,28 +73,27 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { return GUIMachineGasCent.texture.toString(); } - @Override - public Class getGuiClass() { - return GUIMachineGasCent.class; - } + @Override + public Class getGuiClass() { + return GUIMachineGasCent.class; + } + + @Override + public TemplateRecipeHandler newInstance() { + if(fuels == null || fuels.isEmpty()) + fuels = new ArrayList(); + 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(); - 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("gascentprocessing")) && getClass() == GasCentrifugeRecipeHandler.class) { + if((outputId.equals("gascentprocessing")) && getClass() == GasCentrifugeRecipeHandler.class) { Map recipes = GasCentrifugeRecipes.getGasCentrifugeRecipes(); - for (Map.Entry recipe : recipes.entrySet()) { - this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1], (ItemStack)recipe.getValue()[2])); + for(Map.Entry recipe : recipes.entrySet()) { + this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack) recipe.getValue()[0], (ItemStack) recipe.getValue()[1], (ItemStack) recipe.getValue()[2])); } } else { super.loadCraftingRecipes(outputId, results); @@ -107,15 +103,16 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(ItemStack result) { Map recipes = GasCentrifugeRecipes.getGasCentrifugeRecipes(); - for (Map.Entry 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)) - this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1], (ItemStack)recipe.getValue()[2])); + for(Map.Entry 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)) + this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack) recipe.getValue()[0], (ItemStack) recipe.getValue()[1], (ItemStack) recipe.getValue()[2])); } } @Override public void loadUsageRecipes(String inputId, Object... ingredients) { - if ((inputId.equals("gascentprocessing")) && getClass() == GasCentrifugeRecipeHandler.class) { + if((inputId.equals("gascentprocessing")) && getClass() == GasCentrifugeRecipeHandler.class) { loadCraftingRecipes("gascentprocessing", new Object[0]); } else { super.loadUsageRecipes(inputId, ingredients); @@ -125,24 +122,24 @@ public class GasCentrifugeRecipeHandler extends TemplateRecipeHandler { @Override public void loadUsageRecipes(ItemStack ingredient) { Map recipes = GasCentrifugeRecipes.getGasCentrifugeRecipes(); - for (Map.Entry recipe : recipes.entrySet()) { - if (compareFluidStacks(ingredient, (ItemStack)recipe.getKey())) - this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1], (ItemStack)recipe.getValue()[2])); + for(Map.Entry recipe : recipes.entrySet()) { + if(compareFluidStacks(ingredient, (ItemStack) recipe.getKey())) + this.arecipes.add(new SmeltingSet((ItemStack) recipe.getKey(), (ItemStack) recipe.getValue()[0], (ItemStack) recipe.getValue()[1], (ItemStack) recipe.getValue()[2])); } } - + private boolean compareFluidStacks(ItemStack sta1, ItemStack sta2) { return sta1.getItem() == sta2.getItem() && sta1.getItemDamage() == sta2.getItemDamage(); } - @Override - public void drawExtras(int recipe) { - drawProgressBar(3, 51 - 45, 176, 0, 16, 34, 480, 7); - drawProgressBar(69, 26, 208, 0, 33, 12, 200, 0); - } - - @Override - public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(69, 26, 32, 12), "gascentprocessing")); - } + @Override + public void drawExtras(int recipe) { + drawProgressBar(3, 51 - 45, 176, 0, 16, 34, 480, 7); + drawProgressBar(69, 26, 208, 0, 33, 12, 200, 0); + } + + @Override + public void loadTransferRects() { + transferRects.add(new RecipeTransferRect(new Rectangle(69, 26, 32, 12), "gascentprocessing")); + } } diff --git a/src/main/java/com/hbm/inventory/gui/GUIHadron.java b/src/main/java/com/hbm/inventory/gui/GUIHadron.java index 62a47f4c0..caea1d6d8 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIHadron.java +++ b/src/main/java/com/hbm/inventory/gui/GUIHadron.java @@ -100,7 +100,7 @@ public class GUIHadron extends GuiInfoContainer { if(hadron.state == EnumHadronState.NORESULT) { drawTexturedModalRect(guiLeft + 73, guiTop + 29, 176, 30, 30, 30); } - if(hadron.state == EnumHadronState.ERROR) { + if(hadron.state == EnumHadronState.ERROR_GENERIC) { drawTexturedModalRect(guiLeft + 73, guiTop + 29, 176, 106, 30, 30); } diff --git a/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java b/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java index e16464f9e..f7b354184 100644 --- a/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/GasCentrifugeRecipes.java @@ -15,14 +15,17 @@ import net.minecraft.item.ItemStack; public class GasCentrifugeRecipes { public static enum PseudoFluidType { - NONE (0, 0, "NONE", "Empty", false, (ItemStack[])null), + NONE (0, 0, "NONE", "Empty", false, (ItemStack[])null), - NUF6 (400, 300, "LEUF6", "Natural UF6", false, new ItemStack(ModItems.nugget_u238, 1)), - LEUF6 (300, 200, "MEUF6", "Low Enriched UF6", false, new ItemStack(ModItems.nugget_u238, 1), new ItemStack(ModItems.fluorite, 1)), - MEUF6 (200, 100, "HEUF6", "Medium Enriched UF6", false, new ItemStack(ModItems.nugget_u238, 1)), - HEUF6 (300, 0, "NONE", "High Enriched UF6", true, new ItemStack(ModItems.nugget_u238, 2), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 1)), + NUF6 (400, 300, "LEUF6", "Natural UF6", false, new ItemStack(ModItems.nugget_u238, 1)), + LEUF6 (300, 200, "MEUF6", "Low Enriched UF6", false, new ItemStack(ModItems.nugget_u238, 1), new ItemStack(ModItems.fluorite, 1)), + MEUF6 (200, 100, "HEUF6", "Medium Enriched UF6", false, new ItemStack(ModItems.nugget_u238, 1)), + HEUF6 (300, 0, "NONE", "High Enriched UF6", true, new ItemStack(ModItems.nugget_u238, 2), new ItemStack(ModItems.nugget_u235, 1), new ItemStack(ModItems.fluorite, 1)), - PF6 (300, 0, "NONE", "Plutonium Hexafluoride", false, new ItemStack(ModItems.nugget_pu238, 1), new ItemStack(ModItems.nugget_pu_mix, 2), new ItemStack(ModItems.fluorite, 1)); + PF6 (300, 0, "NONE", "Plutonium Hexafluoride", false, new ItemStack(ModItems.nugget_pu238, 1), new ItemStack(ModItems.nugget_pu_mix, 2), new ItemStack(ModItems.fluorite, 1)), + + MUD (1000, 500, "MUD_HEAVY", "Poisonous Mud", false, new ItemStack(ModItems.powder_lead, 1), new ItemStack(ModItems.dust, 1)), + MUD_HEAVY (500, 0, "NONE", "Heavy Mud Fraction", false, new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.dust, 1), new ItemStack(ModItems.nuclear_waste_tiny, 1)); int fluidConsumed; int fluidProduced; @@ -78,6 +81,10 @@ public class GasCentrifugeRecipes { 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; } @@ -85,6 +92,7 @@ public class GasCentrifugeRecipes { 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; } diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index e7719947d..4f821bc75 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -1066,6 +1066,7 @@ public class ModItems { public static ItemRBMKRod rbmk_fuel_zfb_pu241; public static ItemRBMKRod rbmk_fuel_zfb_am_mix; public static ItemRBMKRod rbmk_fuel_drx; + public static ItemRBMKRod rbmk_fuel_test; public static ItemRBMKPellet rbmk_pellet_ueu; public static ItemRBMKPellet rbmk_pellet_meu; public static ItemRBMKPellet rbmk_pellet_heu233; @@ -3741,6 +3742,13 @@ public class ModItems { .setHeat(0.1D) .setMeltingPoint(100000) .setUnlocalizedName("rbmk_fuel_drx").setTextureName(RefStrings.MODID + ":rbmk_fuel_drx"); + rbmk_fuel_test = (ItemRBMKRod) new ItemRBMKRod("THE VOICES") + .setYield(1000000D) + .setStats(1000, 10) + .setFunction(EnumBurnFunc.QUADRATIC) + .setHeat(0.1D) + .setMeltingPoint(100000) + .setUnlocalizedName("rbmk_fuel_drx").setTextureName(RefStrings.MODID + ":rbmk_fuel_drx"); trinitite = new ItemNuclearWaste().setUnlocalizedName("trinitite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":trinitite_new"); nuclear_waste_long = new ItemWasteLong().setUnlocalizedName("nuclear_waste_long").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nuclear_waste_long"); diff --git a/src/main/java/com/hbm/items/machine/ItemRBMKRod.java b/src/main/java/com/hbm/items/machine/ItemRBMKRod.java index aa7527bd6..7a4103ad3 100644 --- a/src/main/java/com/hbm/items/machine/ItemRBMKRod.java +++ b/src/main/java/com/hbm/items/machine/ItemRBMKRod.java @@ -25,6 +25,7 @@ public class ItemRBMKRod extends Item { public double reactivity; //endpoint of the function public double selfRate; //self-inflicted flux from self-igniting fuels public EnumBurnFunc function = EnumBurnFunc.LOG_TEN; + public EnumDepleteFunction depFunc = EnumDepleteFunction.LINEAR; public double xGen = 0.5D; //multiplier for xenon production public double xBurn = 50D; //divider for xenon burnup public double heat = 1D; //heat produced per outFlux @@ -87,6 +88,11 @@ public class ItemRBMKRod extends Item { return this; } + public ItemRBMKRod setDepletionFunction(EnumDepleteFunction func) { + this.depFunc = func; + return this; + } + public ItemRBMKRod setHeat(double heat) { this.heat = heat; return this; @@ -211,7 +217,8 @@ public class ItemRBMKRod extends Item { SIGMOID(EnumChatFormatting.GREEN + "SAFE / SIGMOID"), //100 / (1 + e^(-(x - 50) / 10)) <- tiny amount of reactivity at x=0 ! SQUARE_ROOT(EnumChatFormatting.YELLOW + "MEDIUM / SQUARE ROOT"), //sqrt(x) * 10 * reactivity LINEAR(EnumChatFormatting.RED + "DANGEROUS / LINEAR"), //x * reactivity - QUADRATIC(EnumChatFormatting.RED + "DANGEROUS / QUADRATIC"); //x^2 / 100 * reactivity + QUADRATIC(EnumChatFormatting.RED + "DANGEROUS / QUADRATIC"), //x^2 / 100 * reactivity + EXPERIMENTAL(EnumChatFormatting.RED + "EXPERIMENTAL / SINE SLOPE"); //x * (sin(x) + 1) public String title = ""; @@ -226,7 +233,7 @@ public class ItemRBMKRod extends Item { */ public double reactivityFunc(double in, double enrichment) { - double flux = in * enrichment; + double flux = in * reativityModByEnrichment(enrichment); switch(this.function) { case PASSIVE: return selfRate * enrichment; @@ -237,6 +244,7 @@ public class ItemRBMKRod extends Item { case SQUARE_ROOT: return Math.sqrt(flux) * reactivity / 10D; case LINEAR: return flux / 100D * reactivity; case QUADRATIC: return flux * flux / 10000D * reactivity; + case EXPERIMENTAL: return flux * (Math.sin(flux) + 1) * reactivity; } return 0; @@ -258,11 +266,32 @@ public class ItemRBMKRod extends Item { case SQUARE_ROOT: return "sqrt(" + x + ") * " + reactivity + " / 10"; case LINEAR: return x + " / 100 * " + reactivity; case QUADRATIC: return x + "² / 10000 * " + reactivity; + case EXPERIMENTAL: return x + " * (sin(" + x + ") + 1) * " + reactivity; } return "ERROR"; } + public static enum EnumDepleteFunction { + LINEAR, //old function + RAISING_SLOPE, //for breeding fuels such as MEU, maximum of 110% at 28% depletion + BOOSTED_SLOPE, //for strong breeding fuels such Th232, maximum of 132% at 64% depletion + GENTLE_SLOPE, //recommended for most fuels, maximum barely over the start, near the beginning + STATIC; //for arcade-style neutron sources + } + + public double reativityModByEnrichment(double enrichment) { + + switch(this.depFunc) { + default: + case LINEAR: return enrichment; + case STATIC: return 1D; + case BOOSTED_SLOPE: return -enrichment + 1 + Math.sin(enrichment * enrichment * Math.PI); + case RAISING_SLOPE: return -enrichment + 1 + (Math.sin(enrichment * Math.PI) / 2D); + case GENTLE_SLOPE: return -enrichment + 1 + (Math.sin(enrichment * Math.PI) / 3D); + } + } + /** * Xenon generated per tick, linear function * @param flux diff --git a/src/main/java/com/hbm/items/tool/ItemGuideBook.java b/src/main/java/com/hbm/items/tool/ItemGuideBook.java index b7ab386fd..53dc0947d 100644 --- a/src/main/java/com/hbm/items/tool/ItemGuideBook.java +++ b/src/main/java/com/hbm/items/tool/ItemGuideBook.java @@ -48,7 +48,8 @@ public class ItemGuideBook extends Item { public enum BookType { TEST("book.test.cover", 2F, statFacTest()), - RBMK("book.rbmk.cover", 1.5F, statFacRBMK()); + RBMK("book.rbmk.cover", 1.5F, statFacRBMK()), + HADRON("book.error.cover", 1.5F, statFacHadron()); public List pages; public float titleScale; @@ -115,6 +116,17 @@ public class ItemGuideBook extends Item { return pages; } + public static List statFacHadron() { + + List pages = new ArrayList(); + + for(int i = 1; i <= 9; i++) { + pages.add(new GuidePage("book.error.page" + i).setScale(2F).addTitle("book.error.title" + i, 0x800000, 1F)); + } + + return pages; + } + public static class GuidePage { public String title; diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 499b4eb6c..e100f946e 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -15,6 +15,7 @@ import com.hbm.items.ModItems; import com.hbm.items.machine.ItemBattery; import com.hbm.items.special.ItemCircuitStarComponent.CircuitComponentType; import com.hbm.items.special.ItemPlasticScrap.ScrapType; +import com.hbm.items.tool.ItemGuideBook.BookType; import com.hbm.util.EnchantmentUtil; import net.minecraft.block.Block; @@ -733,7 +734,7 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModItems.upgrade_smelter, 1), new Object[] { "PHP", "CUC", "DTD", 'P', CU.plate(), 'H', Blocks.hopper, 'C', ModItems.coil_tungsten, 'U', ModItems.upgrade_template, 'D', ModItems.coil_copper, 'T', ModBlocks.machine_transformer }); addRecipeAuto(new ItemStack(ModItems.upgrade_shredder, 1), new Object[] { "PHP", "CUC", "DTD", 'P', ModItems.motor, 'H', Blocks.hopper, 'C', ModItems.blades_advanced_alloy, 'U', ModItems.upgrade_smelter, 'D', TI.plate(), 'T', ModBlocks.machine_transformer }); addRecipeAuto(new ItemStack(ModItems.upgrade_centrifuge, 1), new Object[] { "PHP", "PUP", "DTD", 'P', ModItems.centrifuge_element, 'H', Blocks.hopper, 'U', ModItems.upgrade_shredder, 'D', POLYMER.ingot(), 'T', ModBlocks.machine_transformer }); - addRecipeAuto(new ItemStack(ModItems.upgrade_crystallizer, 1), new Object[] { "PHP", "CUC", "DTD", 'P', new ItemStack(ModItems.fluid_barrel_full, 1, Fluids.ACID.ordinal()), 'H', ModItems.circuit_targeting_tier4, 'C', ModBlocks.barrel_steel, 'U', ModItems.upgrade_centrifuge, 'D', ModItems.motor, 'T', ModBlocks.machine_transformer }); + addRecipeAuto(new ItemStack(ModItems.upgrade_crystallizer, 1), new Object[] { "PHP", "CUC", "DTD", 'P', new ItemStack(ModItems.fluid_barrel_full, 1, Fluids.ACID.getID()), 'H', ModItems.circuit_targeting_tier4, 'C', ModBlocks.barrel_steel, 'U', ModItems.upgrade_centrifuge, 'D', ModItems.motor, 'T', ModBlocks.machine_transformer }); addRecipeAuto(new ItemStack(ModItems.upgrade_screm, 1), new Object[] { "SUS", "SCS", "SUS", 'S', STEEL.plate(), 'U', ModItems.upgrade_template, 'C', ModItems.crystal_xen }); addRecipeAuto(new ItemStack(ModItems.upgrade_gc_speed, 1), new Object[] {"TCT", "HUH", "TCT", 'T', ModItems.nugget_bismuth, 'C', ModItems.coil_copper, 'H', ModItems.coil_tungsten, 'U', ModItems.upgrade_template}); @@ -843,6 +844,10 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModItems.rag, 4), new Object[] { "SW", "WS", 'S', Items.string, 'W', Blocks.wool }); addRecipeAuto(new ItemStack(ModBlocks.machine_condenser), new Object[] { "SIS", "ICI", "SIS", 'S', STEEL.ingot(), 'I', IRON.plate(), 'C', ModItems.board_copper }); + + addShapelessAuto(new ItemStack(ModItems.book_guide, 1, BookType.TEST.ordinal()), new Object[] { Items.book, ModItems.canned_jizz }); + addShapelessAuto(new ItemStack(ModItems.book_guide, 1, BookType.RBMK.ordinal()), new Object[] { Items.book, Items.potato }); + addShapelessAuto(new ItemStack(ModItems.book_guide, 1, BookType.HADRON.ordinal()), new Object[] { Items.book, ModItems.fuse }); if(GeneralConfig.enableBabyMode) { addShapelessAuto(new ItemStack(ModItems.cordite, 3), new Object[] { ModItems.ballistite, Items.gunpowder, new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE) }); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityHadron.java b/src/main/java/com/hbm/tileentity/machine/TileEntityHadron.java index f838c4adc..0d8d4e9c8 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityHadron.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityHadron.java @@ -41,7 +41,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs public EnumHadronState state = EnumHadronState.IDLE; private static final int delaySuccess = 20; private static final int delayNoResult = 60; - private static final int delayError = 60; + private static final int delayError = 100; public TileEntityHadron() { super(5); @@ -293,7 +293,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs this.momentum = 0; } - public void expire() { + public void expire(EnumHadronState reason) { if(expired) return; @@ -305,7 +305,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs //System.out.println("Last pos: " + posX + " " + posY + " " + posZ); //Thread.currentThread().dumpStack(); - TileEntityHadron.this.state = EnumHadronState.ERROR; + TileEntityHadron.this.state = reason; TileEntityHadron.this.delay = delayError; } @@ -327,7 +327,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs isCheckExempt = false; //clearing up the exemption we might have held from the previous turn, AFTER stepping if(charge < 0) - this.expire(); + this.expire(EnumHadronState.ERROR_NO_CHARGE); } } @@ -354,7 +354,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs if(te instanceof TileEntityHadron) { if(p.analysis != 3) - p.expire(); + p.expire(EnumHadronState.ERROR_NO_ANALYSIS); else this.finishParticle(p); @@ -362,7 +362,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs } if(block.getMaterial() != Material.air && block != ModBlocks.hadron_diode) - p.expire(); + p.expire(EnumHadronState.ERROR_OBSTRUCTED_CHANNEL); if(block == ModBlocks.hadron_diode) p.isCheckExempt = true; @@ -433,7 +433,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs //not a valid coil: kablam! if(coilVal == 0) { - p.expire(); + p.expire(EnumHadronState.ERROR_EXPECTED_COIL); } else { p.momentum += coilVal; p.charge -= coilVal; @@ -480,7 +480,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs //System.out.println("Was exempt: " + p.isCheckExempt); //worldObj.setBlock(a, b, c, Blocks.dirt); - p.expire(); + p.expire(EnumHadronState.ERROR_MALFORMED_SEGMENT); } } } @@ -492,7 +492,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs //if the analysis chamber is too big, destroy if(p.analysis > 3) - p.expire(); + p.expire(EnumHadronState.ERROR_ANALYSIS_TOO_LONG); if(p.analysis == 2) { this.worldObj.playSoundEffect(p.posX + 0.5, p.posY + 0.5, p.posZ + 0.5, "fireworks.blast", 2.0F, 2F); @@ -511,7 +511,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs //if the analysis stops despite being short of 3 steps in the analysis chamber, destroy if(p.analysis > 0 && p.analysis < 3) - p.expire(); + p.expire(EnumHadronState.ERROR_ANALYSIS_TOO_SHORT); } } @@ -542,7 +542,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs if(diode.getConfig(p.dir.getOpposite().ordinal()) != DiodeConfig.IN) { //it appears as if we have slammed into the side of a diode, ouch - p.expire(); + p.expire(EnumHadronState.ERROR_DIODE_COLLISION); } //there's a diode ahead, turn off checks so we can make the curve @@ -600,28 +600,22 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs List dirs = getRandomDirs(); - //System.out.println("Starting as " + dir.name()); - //let's look at every direction we could go in for(ForgeDirection d : dirs) { if(d == dir || d == dir.getOpposite()) continue; - //System.out.println("Trying " + d.name()); - //there is air! we can pass! if(worldObj.getBlock(x + d.offsetX, y + d.offsetY, z + d.offsetZ).getMaterial() == Material.air) { if(validDir == ForgeDirection.UNKNOWN) { validDir = d; - //System.out.println("yes"); //it seems like there are two or more possible ways, which is not allowed without a diode //sorry kid, nothing personal } else { - //System.out.println("what"); - p.expire(); + p.expire(EnumHadronState.ERROR_BRANCHING_TURN); return; } } @@ -632,8 +626,8 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs p.isCheckExempt = true; return; } - - p.expire(); + + p.expire(EnumHadronState.ERROR_OBSTRUCTED_CHANNEL); } /** @@ -680,7 +674,16 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs ANALYSIS(0xffff00), NORESULT(0xff8000), SUCCESS(0x00ff00), - ERROR(0xff0000); + ERROR_NO_CHARGE(0xff0000), + ERROR_NO_ANALYSIS(0xff0000), + ERROR_OBSTRUCTED_CHANNEL(0xff0000), + ERROR_EXPECTED_COIL(0xff0000), + ERROR_MALFORMED_SEGMENT(0xff0000), + ERROR_ANALYSIS_TOO_LONG(0xff0000), + ERROR_ANALYSIS_TOO_SHORT(0xff0000), + ERROR_DIODE_COLLISION(0xff0000), + ERROR_BRANCHING_TURN(0xff0000), + ERROR_GENERIC(0xff0000); public int color; diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 7780de7f4..81feac309 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -405,7 +405,16 @@ geiger.title.dosimeter=DOSIMETER hadron.analysis=Analysiere... hadron.buttonOn=Analysekammer (falls vorhanden) ist AN hadron.buttonOff=Analysekammer ist AUS -hadron.error=Fehler! +hadron.error_generic=Fehler! +hadron.error_no_charge=Fehler 0x01 [NC] +hadron.error_no_analysis=Fehler 0x02 [NA] +hadron.error_obstructed_channel=Fehler 0x03 [OC] +hadron.error_expected_coil=Fehler 0x04 [EC] +hadron.error_malformed_segment=Fehler 0x05 [MS] +hadron.error_analysis_too_long=Fehler 0x06 [ATL] +hadron.error_analysis_too_short=Fehler 0x07 [ATS] +hadron.error_diode_collision=Fehler 0x08 [DC] +hadron.error_branching_turn=Fehler 0x09 [BT] hadron.hopper0=§eNormalmodus:$Alle Items werden beschleunigt. hadron.hopper1=§eTrichtermodus:$Ein Item bleibt immer übrig. hadron.idle=Leerlauf diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index f58d73785..c5d239961 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -150,6 +150,26 @@ bomb.triggered=Triggered successfully! book.test.cover=HOW 2 SEX book.test.page1=Test Page 1 +book.error.cover=Hadron Collider:$Troubleshooting +book.error.title1=Error 0x01 [NC] +book.error.page1=§Name:§r "ERROR_NO_CHARGE" §lDescription:§r The particle has reached a segment with insufficient charge. §Potential fix:§r Either replace one of the plugs that the particle successfully passes with higher-tier ones or add another plug slightly before the segment where the particle expires. +book.error.title2=Error 0x02 [NA] +book.error.page2=§Name:§r "ERROR_NO_ANALYSIS" §lDescription:§r The particle has reached the core, despite not passing an analysis chamber. §Potential fix:§r Make sure that your accelerator has an analysis chamber and double-check the operating mode (linear/circular). +book.error.title3=Error 0x03 [OC] +book.error.page3=§Name:§r "ERROR_OBSTRUCTED_CHANNEL" §lDescription:§r The particle has collided with a block inside the collider's channel. §Potential fix:§r Make sure that the inside of your particle collider is free of any obstructions, except for particle diodes and core blocks. +book.error.title4=Error 0x04 [EC] +book.error.page4=§Name:§r "ERROR_EXPECTED_COIL" §lDescription:§r The particle has passed a segment that lacks one or multiple coils. §Potential fix:§r Remove the plating of the collider in the offending area and check if all the coils are there. This error will also happen at T-crossings that are built without diodes. +book.error.title5=Error 0x05 [MS] +book.error.page5=§Name:§r "ERROR_MALFORMED_SEGMENT" §lDescription:§r The particle has passed a segment that was built incorrectly (but neither obstructed nor missing coils). §Potential fix:§r Make sure that the offending segment has platings in all the required spaces, leaving no coils exposed. +book.error.title6=Error 0x06 [ATL] +book.error.page6=§Name:§r "ERROR_ANALYSIS_TOO_LONG" §lDescription:§r The particle has passed more than the three required valid analysis chamber segments. §Potential fix:§r Make sure that the analysis chamber is exactly 3 blocks long for circular accelerator and at least 2 blocks long for linear ones. Also check if the particle doesn't pass multiple analysis chambers in a branching and/or looped accelerator. +book.error.title7=Error 0x07 [ATS] +book.error.page7=§Name:§r "ERROR_ANALYSIS_TOO_SHORT" §lDescription:§r The particle has left the analysis chamber, despite not meeting the length requirement. §Potential fix:§r Make sure that the analysis chamber on your circular accelerator is exactly 3 blocks long. Valid analysis segments have no coils and the plating is entirely composed of analysis chamber walls/windows. Analysis chambers with coils in them count as regular segments. +book.error.title8=Error 0x08 [DC] +book.error.page8=§Name:§r "ERROR_DIODE_COLLISION" §lDescription:§r The particle collided with a non-input side of a schottky particle diode. §Potential fix:§r Check if your diodes are configured correctly. Particles can only enter the diode from sides with green inward-pointing arrows. +book.error.title9=Error 0x09 [BT] +book.error.page9=§Name:§r "ERROR_BRANCHING_TURN" §lDescription:§r The particle has reached a turn with multiple exits. §Potential fix:§r If your turn is a normal one, check if all the required coils are present (i.e. no holes in the coil layer). If the turn is intended to be branched, it requires a schottky particle diode that is correctly configured. + book.rbmk.cover=My first RBMK:$Basics of$building a$reactor book.rbmk.title1=Introduction book.rbmk.page1=§lRBMK§r is fully modular nuclear reactor. Unlike most other reactors, there is no "core" and no size restrictions, rather behavior and efficiency of reactor depends on how it is built and how various parts interact with each other. @@ -522,7 +542,16 @@ geiger.title.dosimeter=DOSIMETER hadron.analysis=Analyzing... hadron.buttonOn=Analysis Chamber (if present) is ON hadron.buttonOff=Analysis Chamber is OFF -hadron.error=Error! +hadron.error_generic=Error! +hadron.error_no_charge=Error 0x01 [NC] +hadron.error_no_analysis=Error 0x02 [NA] +hadron.error_obstructed_channel=Error 0x03 [OC] +hadron.error_expected_coil=Error 0x04 [EC] +hadron.error_malformed_segment=Error 0x05 [MS] +hadron.error_analysis_too_long=Error 0x06 [ATL] +hadron.error_analysis_too_short=Error 0x07 [ATS] +hadron.error_diode_collision=Error 0x08 [DC] +hadron.error_branching_turn=Error 0x09 [BT] hadron.hopper0=§eNormal Mode:$All items will be used. hadron.hopper1=§eHopper Mode:$One item will always remain. hadron.idle=Idle diff --git a/src/main/resources/assets/hbm/textures/items/rbmk_fuel_test.png b/src/main/resources/assets/hbm/textures/items/rbmk_fuel_test.png new file mode 100644 index 0000000000000000000000000000000000000000..28847c428c0430d060a0e33474634f63ea4bf96d GIT binary patch literal 749 zcmVy^9k;6u^J8q&=`Oe!w+aX%Q>oiol(n#WuNE32K$ff51P< zLO2O{ZNxh`42aDYA_fsZc5|0aApr}EJd4dFGn1L!$=T>zmd(u0{N{bkzIlOvK?FoV z+_vuXwOQOBcrC}gF#9*+C3=toWlqw4p5LO3F;k{AY4U})GG}DXjo~E(#2jo|=gJkD zOqsIHWxg^A;i`EtE(7SME&0T;oNyq&8Odi(mZ8vhH*HBQPe2+z?LzIMD0r4W1>pJN zOT;juo3_wnVtEQw!*z#_o%;mX1KRC2&1RE_?3W8uF5GUnnaySl27_qcQUUX&H%5yw zyGCE9(_u0xV?LYBaL2~*tgpZo*KL0*AzmXEARua(E9eVAuh+BQ_xpVSj)r-Z;@U$O zu~GnbcdlEVuZC~P$hgJ5jhMkrSkVUHXqW@=op+pbhAgg4c~%JAOl9s??XrybGG@$8 zZjh0&&E24NF}%b#*tNojme<_M0@aIG@e*@@>ni_*gal=|+$XWT%1r1xJXRi#E~)1xQdNYaxl{1vjB9q4#D; z<_15O7tDmAT<%g66bhm?rH^NALf>X_+dugz85vt_an2c+xE-`EhL>nz}N$I znXfLfxDv|?CL-@~I?UOlEWK(