From 1e3e5f38d407dd05138fbf5ca8aa2f4a96fd6203 Mon Sep 17 00:00:00 2001 From: Boblet Date: Thu, 11 Dec 2025 16:34:57 +0100 Subject: [PATCH] all our food keeps blowing up --- build.gradle | 2 +- changelog | 13 ++++++- .../java/com/hbm/config/GeneralConfig.java | 3 ++ .../hbm/handler/nei/AnnihilatorHandler.java | 16 +++++++++ .../inventory/gui/GUIMachineAnnihilator.java | 4 +-- .../inventory/recipes/AnnihilatorRecipes.java | 36 +++++++++++++++++++ .../hbm/inventory/recipes/PrecAssRecipes.java | 11 ++---- .../com/hbm/items/machine/ItemFluidIcon.java | 1 + .../java/com/hbm/main/ModEventHandler.java | 28 +++++++++++++-- src/main/java/com/hbm/main/NEIRegistry.java | 1 + .../machine/TileEntityMachineAnnihilator.java | 19 +++++++++- .../com/hbm/util/DamageResistanceHandler.java | 4 +-- 12 files changed, 118 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/hbm/handler/nei/AnnihilatorHandler.java diff --git a/build.gradle b/build.gradle index 4e7e8f7f4..430634ede 100644 --- a/build.gradle +++ b/build.gradle @@ -107,7 +107,7 @@ dependencies { implementation "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api" - compileOnly "com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta.56-GTNH:dev" + implementation "com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta.56-GTNH:dev" } processResources { diff --git a/changelog b/changelog index dd9030a64..abd9b1e81 100644 --- a/changelog +++ b/changelog @@ -4,11 +4,21 @@ * Used extensively in 528 mode * Replaces recipes for micro chips, controllers and upgrades * All recipes only have a chance to be completed, broken items yielded otherwise need to be recycled + * Can do precise recipes, but it very unreliable. Many recipes have a high chance of outputting a broken version of the made item + * Broken items can be recycled in the precision assembler, returning some of the ingredients * Annihilator * Destroys items and fluids and keeps track of how much has been destroyed * In 528 mode, destroying quantities of certain items yield unique progression relevant blueprints ## Changed +* Changed the way 528 mode works + * May of the old tantalium requirements no longer exist since the assembler rework + * Some important recipes have been moved to the precision assembler + * Many key "milestone" recipes now require 528 mode exclusive blueprints + * 528 exclusive blueprints are obtained from annihilating large quantities of certain items + * AE2 blocks, by default, will detonate when interacted with + * Synergizes with expensive mode, many recycling probabilities of the precision assembler are massively lowered with expensive mode enabled, increasing effective cost massively + * :) * New fusion reactor and particle accelerator parts now have OpenComputers compat * Irradiation recipe config now has the `fusionOnly` flag, preventing the recipe from being done in the RBMK irradiation channel * Removed legacy fusion reactor parts from the creative inventory @@ -41,9 +51,10 @@ * Steel barrels and 256k tanks no longer use tar in their recipes (except in expensive mode) * Solidifying biogas into compressed biomass now yields 4x more, making the biogas route twice as efficient as simply compressing biomass * Finally removed the long deprecated ambience radiation generator and geothermal generator +* Nerfed the ballistic jackets, as they are comically cheap and made some zombies impossible to kill in early game ## Fixed * Fixed gamebreaking issue causing crashes and world corruption where the multi detonator had its tooltip misspelled * Fixed panzerschreck equip animation not speeding up with the sawed off mod * Fixed FENSU not keeping its charge when broken -* Removed skeletonizer reloading from `/ntmreload` as it wasn't usable for end users and just caused error messages on servers \ No newline at end of file +* Removed skeletonizer reloading from `/ntmreload` as it wasn't usable for end users and just caused error messages on servers diff --git a/src/main/java/com/hbm/config/GeneralConfig.java b/src/main/java/com/hbm/config/GeneralConfig.java index fd3892280..8dce4f139 100644 --- a/src/main/java/com/hbm/config/GeneralConfig.java +++ b/src/main/java/com/hbm/config/GeneralConfig.java @@ -50,6 +50,7 @@ public class GeneralConfig { public static boolean enable528BosniaSimulator = true; public static boolean enable528NetherBurn = true; public static boolean enable528PressurizedRecipes = true; + public static boolean enable528ExplosiveEnergistics = true; public static int coltanRate = 2; public static boolean enableLBSM = false; @@ -132,6 +133,7 @@ public class GeneralConfig { enable528BosniaSimulator = CommonConfig.createConfigBool(config, CATEGORY_528, "X528_enableBosniaSimulator", "Enables anti tank mines spawning all over the world.", true); enable528NetherBurn = CommonConfig.createConfigBool(config, CATEGORY_528, "X528_enable528NetherBurn", "Whether players burn in the nether", true); enable528PressurizedRecipes = CommonConfig.createConfigBool(config, CATEGORY_528, "X528_enable528PressurizedRecipes", "Sets some recipes to require pressurized input fluid", true); + enable528ExplosiveEnergistics = CommonConfig.createConfigBool(config, CATEGORY_528, "X528_enable528ExplosiveEnergistics", "Renders AE2 unusable.", true); coltanRate = CommonConfig.createConfigInt(config, CATEGORY_528, "X528_oreColtanFrequency", "Determines how many coltan ore veins are to be expected in a chunk. These values do not affect the frequency in deposits, and only apply if random coltan spanwing is enabled.", 2); final String CATEGORY_LBSM = CommonConfig.CATEGORY_LBSM; @@ -167,6 +169,7 @@ public class GeneralConfig { enable528BosniaSimulator = false; enable528NetherBurn = false; enable528PressurizedRecipes = false; + enable528ExplosiveEnergistics = false; } } } diff --git a/src/main/java/com/hbm/handler/nei/AnnihilatorHandler.java b/src/main/java/com/hbm/handler/nei/AnnihilatorHandler.java new file mode 100644 index 000000000..3a8e6e770 --- /dev/null +++ b/src/main/java/com/hbm/handler/nei/AnnihilatorHandler.java @@ -0,0 +1,16 @@ +package com.hbm.handler.nei; + +import com.hbm.blocks.ModBlocks; +import com.hbm.inventory.recipes.AnnihilatorRecipes; + +public class AnnihilatorHandler extends NEIUniversalHandler { + + public AnnihilatorHandler() { + super("Annihilator", ModBlocks.machine_annihilator, AnnihilatorRecipes.getRecipes()); + } + + @Override + public String getKey() { + return "ntmAnnihilating"; + } +} diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineAnnihilator.java b/src/main/java/com/hbm/inventory/gui/GUIMachineAnnihilator.java index b642010c4..375c35359 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineAnnihilator.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineAnnihilator.java @@ -3,7 +3,6 @@ package com.hbm.inventory.gui; import java.util.Arrays; import java.util.Locale; -import org.apache.commons.lang3.math.NumberUtils; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; @@ -93,9 +92,8 @@ public class GUIMachineAnnihilator extends GuiInfoContainer { protected void keyTyped(char c, int i) { if(this.pool.textboxKeyTyped(c, i)) { String text = this.pool.getText(); - int num = NumberUtils.toInt(this.pool.getText()); NBTTagCompound data = new NBTTagCompound(); - data.setInteger("threshold", num); + data.setString("pool", text); PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, annihilator.xCoord, annihilator.yCoord, annihilator.zCoord)); return; } diff --git a/src/main/java/com/hbm/inventory/recipes/AnnihilatorRecipes.java b/src/main/java/com/hbm/inventory/recipes/AnnihilatorRecipes.java index 3fb46d66b..154676b56 100644 --- a/src/main/java/com/hbm/inventory/recipes/AnnihilatorRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/AnnihilatorRecipes.java @@ -5,6 +5,7 @@ import java.math.BigInteger; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map.Entry; import static com.hbm.inventory.OreDictManager.*; @@ -14,6 +15,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.stream.JsonWriter; 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.GenericRecipes; @@ -21,6 +23,7 @@ import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.items.ModItems; import com.hbm.items.machine.IItemFluidIdentifier; import com.hbm.items.machine.ItemBlueprints; +import com.hbm.items.machine.ItemFluidIcon; import com.hbm.items.machine.ItemCircuit.EnumCircuitType; import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo; import com.hbm.util.ItemStackUtil; @@ -28,6 +31,7 @@ import com.hbm.util.Tuple.Pair; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; public class AnnihilatorRecipes extends SerializableRecipe { @@ -75,6 +79,38 @@ public class AnnihilatorRecipes extends SerializableRecipe { @Override public String getFileName() { return "hbmAnnihilator.json"; } @Override public Object getRecipeObject() { return recipes; } @Override public void deleteRecipes() { recipes.clear(); } + + public static HashMap getRecipes() { + + HashMap recipes = new HashMap(); + + for(Entry entry : AnnihilatorRecipes.recipes.entrySet()) { + for(Pair milestone : entry.getValue().milestones) { + + Object input = new ItemStack[1]; + + if(entry.getKey() instanceof Item) input = new ItemStack((Item) entry.getKey()); + if(entry.getKey() instanceof ComparableStack) input = ((ComparableStack) entry.getKey()).toStack(); + if(entry.getKey() instanceof FluidType) input = ItemFluidIcon.make((FluidType) entry.getKey(), 0); + if(entry.getKey() instanceof String) input = new OreDictStack((String) entry.getKey()).extractForNEI(); + + if(input == null) continue; + + if(input instanceof ItemStack) { + ItemStackUtil.addTooltipToStack((ItemStack) input, EnumChatFormatting.RED + String.format(Locale.US, "%,d", milestone.getKey())); + } + if(input instanceof List) { + List list = (List) input; + for(ItemStack stack : list) ItemStackUtil.addTooltipToStack(stack, EnumChatFormatting.RED + String.format(Locale.US, "%,d", milestone.getKey())); + input = list.toArray(new ItemStack[0]); + } + + recipes.put(input, milestone.getValue()); + } + } + + return recipes; + } /** * If prevAmount is null, a payout is guaranteed if the currentAmount matches or exceeds the requirement. diff --git a/src/main/java/com/hbm/inventory/recipes/PrecAssRecipes.java b/src/main/java/com/hbm/inventory/recipes/PrecAssRecipes.java index 3c096002b..ee47ebc85 100644 --- a/src/main/java/com/hbm/inventory/recipes/PrecAssRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/PrecAssRecipes.java @@ -120,7 +120,7 @@ public class PrecAssRecipes extends GenericRecipes { new OreDictStack(BIGMT.ingot(), 16), new ComparableStack(ModItems.ingot_cft, 8), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.CAPACITOR_BOARD)), - new ItemStack(ModItems.upgrade_overdrive_1), 10, GeneralConfig.enableExpensiveMode ? 10 : 50); + new ItemStack(ModItems.upgrade_overdrive_2), 10, GeneralConfig.enableExpensiveMode ? 10 : 50); registerPair(new GenericRecipe("precass.upgrade_overdive_iii").setup(1_200, 100_000) .inputItems(new ComparableStack(ModItems.upgrade_overdrive_2, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), @@ -128,14 +128,7 @@ public class PrecAssRecipes extends GenericRecipes { new OreDictStack(ANY_BISMOIDBRONZE.ingot(), 16), new ComparableStack(ModItems.ingot_cft, 16), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.BISMOID)), - new ItemStack(ModItems.upgrade_overdrive_1), 5, GeneralConfig.enableExpensiveMode ? 10 : 50); - - this.register(new GenericRecipe("ass.overdrive1").setup(200, 100).outputItems(new ItemStack(ModItems.upgrade_overdrive_1, 1)) - .inputItems(new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new OreDictStack(BIGMT.ingot(), 16), new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.ADVANCED))); - this.register(new GenericRecipe("ass.overdrive2").setup(600, 100).outputItems(new ItemStack(ModItems.upgrade_overdrive_2, 1)) - .inputItems(new ComparableStack(ModItems.upgrade_overdrive_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new OreDictStack(BIGMT.ingot(), 16), new ComparableStack(ModItems.ingot_cft, 8), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.CAPACITOR_BOARD))); - this.register(new GenericRecipe("ass.overdrive3").setup(1_200, 100).outputItems(new ItemStack(ModItems.upgrade_overdrive_3, 1)) - .inputItems(new ComparableStack(ModItems.upgrade_overdrive_2, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new OreDictStack(ANY_BISMOIDBRONZE.ingot(), 16), new ComparableStack(ModItems.ingot_cft, 16), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.BISMOID))); + new ItemStack(ModItems.upgrade_overdrive_3), 5, GeneralConfig.enableExpensiveMode ? 10 : 50); } int min = 1_200; diff --git a/src/main/java/com/hbm/items/machine/ItemFluidIcon.java b/src/main/java/com/hbm/items/machine/ItemFluidIcon.java index f41ec69eb..bbeb85104 100644 --- a/src/main/java/com/hbm/items/machine/ItemFluidIcon.java +++ b/src/main/java/com/hbm/items/machine/ItemFluidIcon.java @@ -51,6 +51,7 @@ public class ItemFluidIcon extends Item { } public static ItemStack addQuantity(ItemStack stack, int i) { + if(i <= 0) return stack; if(!stack.hasTagCompound()) stack.stackTagCompound = new NBTTagCompound(); stack.getTagCompound().setInteger("fill", i); return stack; diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 39027aaa8..18cc855fb 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -13,6 +13,10 @@ import com.hbm.entity.mob.*; import com.hbm.entity.projectile.EntityBulletBaseMK4; import com.hbm.entity.projectile.EntityBurningFOEQ; import com.hbm.entity.train.EntityRailCarBase; +import com.hbm.explosion.vanillant.ExplosionVNT; +import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth; +import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon; +import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard; import com.hbm.extprop.HbmLivingProps; import com.hbm.extprop.HbmPlayerProps; import com.hbm.handler.ArmorModHandler; @@ -1177,12 +1181,30 @@ public class ModEventHandler { } @SubscribeEvent - public void onClickSign(PlayerInteractEvent event) { + public void onClickBlock(PlayerInteractEvent event) { int x = event.x; - int y = event.z; - int z = event.y; + int y = event.y; + int z = event.z; World world = event.world; + + if(GeneralConfig.enable528ExplosiveEnergistics && !world.isRemote && event.action == Action.RIGHT_CLICK_BLOCK) { + Block b = world.getBlock(x, y, z); + String name = Block.blockRegistry.getNameForObject(b); + if(name != null && name.startsWith("appliedenergistics2")) { + world.func_147480_a(x, y, z, false); + ExplosionVNT vnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 5, null); + vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 20).setupPiercing(5, 0.2F)); + vnt.setPlayerProcessor(new PlayerProcessorStandard()); + vnt.setSFX(new ExplosionEffectWeapon(10, 2.5F, 1F)); + vnt.explode(); + event.setCanceled(true); + } + } + + x = event.x; + y = event.z; + z = event.y; if(!world.isRemote && event.action == Action.RIGHT_CLICK_BLOCK && world.getTileEntity(x, y, z) instanceof TileEntitySign) { diff --git a/src/main/java/com/hbm/main/NEIRegistry.java b/src/main/java/com/hbm/main/NEIRegistry.java index 682d83f00..755dda1fd 100644 --- a/src/main/java/com/hbm/main/NEIRegistry.java +++ b/src/main/java/com/hbm/main/NEIRegistry.java @@ -15,6 +15,7 @@ public class NEIRegistry { if(!handlers.isEmpty()) return handlers; + handlers.add(new AnnihilatorHandler()); handlers.add(new AnvilRecipeHandler()); handlers.add(new SmithingRecipeHandler()); handlers.add(new PressRecipeHandler()); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAnnihilator.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAnnihilator.java index dd6a92d1d..e90183afb 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAnnihilator.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAnnihilator.java @@ -2,6 +2,7 @@ package com.hbm.tileentity.machine; import java.math.BigInteger; +import com.hbm.interfaces.IControlReceiver; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.inventory.container.ContainerMachineAnnihilator; import com.hbm.inventory.fluid.FluidType; @@ -30,7 +31,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityMachineAnnihilator extends TileEntityMachineBase implements IFluidStandardReceiverMK2, IGUIProvider { +public class TileEntityMachineAnnihilator extends TileEntityMachineBase implements IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider { public String pool = "Recycling"; public int timer; @@ -214,6 +215,22 @@ public class TileEntityMachineAnnihilator extends TileEntityMachineBase implemen @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerMachineAnnihilator(player.inventory, this); } @Override @SideOnly(Side.CLIENT) public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIMachineAnnihilator(player.inventory, this); } + @Override + public boolean hasPermission(EntityPlayer player) { + return this.isUseableByPlayer(player); + } + + @Override + public void receiveControl(NBTTagCompound data) { + if(data.hasKey("pool")) { + String pool = data.getString("pool"); + if(pool != null && !pool.isEmpty()) { + this.pool = pool; + this.markChanged(); + } + } + } + AxisAlignedBB bb = null; @Override diff --git a/src/main/java/com/hbm/util/DamageResistanceHandler.java b/src/main/java/com/hbm/util/DamageResistanceHandler.java index 2c059c5b0..adb9973d2 100644 --- a/src/main/java/com/hbm/util/DamageResistanceHandler.java +++ b/src/main/java/com/hbm/util/DamageResistanceHandler.java @@ -122,9 +122,9 @@ public class DamageResistanceHandler { entityStats.put(EntityCreeper.class, new ResistanceStats().addCategory(CATEGORY_EXPLOSION, 2F, 0.25F)); itemStats.put(ModItems.jackt, new ResistanceStats() - .addCategory(CATEGORY_PHYSICAL, 5F, 0.5F)); + .addCategory(CATEGORY_PHYSICAL, 1F, 0.25F)); itemStats.put(ModItems.jackt2, new ResistanceStats() - .addCategory(CATEGORY_PHYSICAL, 5F, 0.5F)); + .addCategory(CATEGORY_PHYSICAL, 3F, 0.35F)); registerSet(ModItems.steel_helmet, ModItems.steel_plate, ModItems.steel_legs, ModItems.steel_boots, new ResistanceStats()); registerSet(ModItems.titanium_helmet, ModItems.titanium_plate, ModItems.titanium_legs, ModItems.titanium_boots, new ResistanceStats());