From e9ce4361107a8b8837bb436761556db2920188d7 Mon Sep 17 00:00:00 2001 From: Alcater Date: Thu, 27 Apr 2023 12:19:06 +0200 Subject: [PATCH] Version 1.9.4-a Release: Blast Furnace Fix Fixed Blast Furnace Recipes Fixed Paa Helmet --- build.gradle | 2 +- gradle.properties | 2 +- .../java/com/hbm/entity/mob/EntityFBI.java | 2 +- .../java/com/hbm/handler/HazmatRegistry.java | 1 + .../java/com/hbm/handler/jei/JeiRecipes.java | 13 ++-- .../com/hbm/inventory/DiFurnaceRecipes.java | 63 +++++++++---------- .../java/com/hbm/inventory/RecipesCommon.java | 24 +++++++ .../java/com/hbm/items/gear/ModArmor.java | 2 +- src/main/java/com/hbm/lib/RefStrings.java | 4 +- 9 files changed, 66 insertions(+), 47 deletions(-) diff --git a/build.gradle b/build.gradle index a8612295d1..18810e37ea 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '1.9.3-d' +version = '1.9.4-a' group = 'com.hbm' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'NTM-Extended-1.12.2' diff --git a/gradle.properties b/gradle.properties index d9ab117a94..5396fcb00e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,6 +5,6 @@ org.gradle.daemon=true org.gradle.configureondemand=true org.gradle.parallel=true version_mc=1.12.2 -version=1.9.3-d +version=1.9.4-a version_jei=4.16.1.302 version_crafttweaker=4.1.14.521 diff --git a/src/main/java/com/hbm/entity/mob/EntityFBI.java b/src/main/java/com/hbm/entity/mob/EntityFBI.java index 90994318ce..c9446d75cb 100644 --- a/src/main/java/com/hbm/entity/mob/EntityFBI.java +++ b/src/main/java/com/hbm/entity/mob/EntityFBI.java @@ -107,7 +107,7 @@ protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) { } if(this.world != null && this.world.provider.getDimension() != 0) { - this.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(Blocks.GLASS)); + this.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(ModItems.paa_helmet)); this.setItemStackToSlot(EntityEquipmentSlot.CHEST, new ItemStack(ModItems.paa_plate)); this.setItemStackToSlot(EntityEquipmentSlot.LEGS, new ItemStack(ModItems.paa_legs)); this.setItemStackToSlot(EntityEquipmentSlot.FEET, new ItemStack(ModItems.paa_boots)); diff --git a/src/main/java/com/hbm/handler/HazmatRegistry.java b/src/main/java/com/hbm/handler/HazmatRegistry.java index 1a561f47ce..cd1f835d95 100644 --- a/src/main/java/com/hbm/handler/HazmatRegistry.java +++ b/src/main/java/com/hbm/handler/HazmatRegistry.java @@ -172,6 +172,7 @@ public static void registerHazmats() { HazmatRegistry.registerHazmat(ModItems.dns_legs, dns * legs); HazmatRegistry.registerHazmat(ModItems.dns_boots, dns * boots); + HazmatRegistry.registerHazmat(ModItems.paa_helmet, paa * helmet); HazmatRegistry.registerHazmat(ModItems.paa_plate, paa * chest); HazmatRegistry.registerHazmat(ModItems.paa_legs, paa * legs); HazmatRegistry.registerHazmat(ModItems.paa_boots, paa * boots); diff --git a/src/main/java/com/hbm/handler/jei/JeiRecipes.java b/src/main/java/com/hbm/handler/jei/JeiRecipes.java index d8093b42f8..0fd9823f51 100644 --- a/src/main/java/com/hbm/handler/jei/JeiRecipes.java +++ b/src/main/java/com/hbm/handler/jei/JeiRecipes.java @@ -49,6 +49,7 @@ import com.hbm.main.MainRegistry; import com.hbm.util.WeightedRandomObject; import com.hbm.util.Tuple.Quartet; +import com.hbm.util.Tuple.Pair; import com.hbm.util.I18nUtil; import mezz.jei.api.gui.IDrawableStatic; @@ -165,10 +166,10 @@ public static class AlloyFurnaceRecipe implements IRecipeWrapper { private final List> inputs; private final ItemStack output; - public AlloyFurnaceRecipe(AStack[] inputs, ItemStack output) { - List> list = new ArrayList<>(inputs.length); - for(AStack s : inputs) - list.add(s.getStackList()); + public AlloyFurnaceRecipe(AStack input1, AStack input2, ItemStack output) { + List> list = new ArrayList<>(2); + list.add(input1.getStackList()); + list.add(input2.getStackList()); this.inputs = list; this.output = output; } @@ -746,8 +747,8 @@ public static List getAlloyRecipes() { return alloyFurnaceRecipes; alloyFurnaceRecipes = new ArrayList(); - for(Map.Entry entry : DiFurnaceRecipes.diRecipes.entrySet()){ - alloyFurnaceRecipes.add(new AlloyFurnaceRecipe(entry.getKey(), entry.getValue())); + for(Map.Entry, ItemStack> pairEntry : DiFurnaceRecipes.diRecipes.entrySet()){ + alloyFurnaceRecipes.add(new AlloyFurnaceRecipe(pairEntry.getKey().getKey(), pairEntry.getKey().getValue(), pairEntry.getValue())); } return alloyFurnaceRecipes; } diff --git a/src/main/java/com/hbm/inventory/DiFurnaceRecipes.java b/src/main/java/com/hbm/inventory/DiFurnaceRecipes.java index 57539fbc2c..86454b4c42 100644 --- a/src/main/java/com/hbm/inventory/DiFurnaceRecipes.java +++ b/src/main/java/com/hbm/inventory/DiFurnaceRecipes.java @@ -8,6 +8,7 @@ import static com.hbm.inventory.OreDictManager.*; import com.hbm.blocks.ModBlocks; import com.hbm.config.GeneralConfig; +import com.hbm.util.Tuple.Pair; import com.hbm.inventory.RecipesCommon.AStack; import com.hbm.inventory.RecipesCommon.NbtComparableStack; import com.hbm.inventory.RecipesCommon.ComparableStack; @@ -28,7 +29,7 @@ @Spaghetti("everything") public class DiFurnaceRecipes { - public static HashMap diRecipes = new HashMap(); + public static HashMap, ItemStack> diRecipes = new HashMap, ItemStack>(); public static HashMap diFuels = new HashMap(); public static void registerRecipes(){ @@ -108,13 +109,13 @@ public static void registerFuels(){ } public static void addRecipe(AStack inputTop, AStack inputBottom, ItemStack output){ - diRecipes.put(new AStack[]{ inputTop, inputBottom}, output); - diRecipes.put(new AStack[]{ inputBottom, inputTop}, output); + diRecipes.put(new Pair(inputTop, inputBottom), output); + diRecipes.put(new Pair(inputBottom, inputTop), output); } public static void removeRecipe(AStack inputTop, AStack inputBottom){ - diRecipes.remove(new AStack[]{ inputTop, inputBottom}); - diRecipes.remove(new AStack[]{ inputBottom, inputTop}); + diRecipes.remove(new Pair(inputTop, inputBottom)); + diRecipes.remove(new Pair(inputBottom, inputTop)); } public static void addFuel(AStack fuel, int power){ @@ -132,25 +133,18 @@ public static ItemStack getFurnaceProcessingResult(ItemStack stack1, ItemStack s ItemStack item2 = stack2.copy(); item1.setCount(1); item2.setCount(1); - boolean hasTag1 = item1.hasTagCompound(); - boolean hasTag2 = item2.hasTagCompound(); - AStack input1; - AStack input2; ItemStack outputItem; - if(hasTag1){ - input1 = new NbtComparableStack(item1); - }else{ - input1 = new ComparableStack(item1); - } - - if(hasTag2){ - input2 = new NbtComparableStack(item2); - }else{ - input2 = new ComparableStack(item2); - } - - outputItem = diRecipes.get(new AStack[]{ input1, input2 }); + outputItem = diRecipes.get(new Pair(new ComparableStack(item1), new ComparableStack(item2))); + if(outputItem != null) + return outputItem; + outputItem = diRecipes.get(new Pair(new NbtComparableStack(item1), new ComparableStack(item2))); + if(outputItem != null) + return outputItem; + outputItem = diRecipes.get(new Pair(new ComparableStack(item1), new NbtComparableStack(item2))); + if(outputItem != null) + return outputItem; + outputItem = diRecipes.get(new Pair(new NbtComparableStack(item1), new NbtComparableStack(item2))); if(outputItem != null) return outputItem; @@ -160,29 +154,28 @@ public static ItemStack getFurnaceProcessingResult(ItemStack stack1, ItemStack s for(int id1 = 0; id1 < ids1.length; id1++) { - OreDictStack oreTag1 = new OreDictStack(OreDictionary.getOreName(ids1[id1])); - if(hasTag1){ - outputItem = diRecipes.get(new AStack[]{ oreTag1, new NbtComparableStack(item2) }); - } else { - outputItem = diRecipes.get(new AStack[]{ oreTag1, new ComparableStack(item2) }); - } + OreDictStack oreStack1 = new OreDictStack(OreDictionary.getOreName(ids1[id1])); + outputItem = diRecipes.get(new Pair(oreStack1, new ComparableStack(item2))); + if(outputItem != null) + return outputItem; + outputItem = diRecipes.get(new Pair(oreStack1, new NbtComparableStack(item2))); if(outputItem != null) return outputItem; for(int id2 = 0; id2 < ids2.length; id2++) { - OreDictStack oreTag2 = new OreDictStack(OreDictionary.getOreName(ids2[id2])); + OreDictStack oreStack2 = new OreDictStack(OreDictionary.getOreName(ids2[id2])); if(!haveTriedAllID2){ - if(hasTag1){ - outputItem = diRecipes.get(new AStack[]{ new NbtComparableStack(item1), oreTag2 }); - } else { - outputItem = diRecipes.get(new AStack[]{ new ComparableStack(item1), oreTag2 }); - } + outputItem = diRecipes.get(new Pair(new ComparableStack(item1), oreStack2)); + if(outputItem != null) + return outputItem; + outputItem = diRecipes.get(new Pair(new NbtComparableStack(item1), oreStack2)); if(outputItem != null) return outputItem; } - outputItem = diRecipes.get(new AStack[]{ oreTag1, oreTag2 }); + outputItem = diRecipes.get(new Pair(oreStack1, oreStack2)); if(outputItem != null) return outputItem; + } haveTriedAllID2 = true; } diff --git a/src/main/java/com/hbm/inventory/RecipesCommon.java b/src/main/java/com/hbm/inventory/RecipesCommon.java index a327def9c4..33daf0f18e 100644 --- a/src/main/java/com/hbm/inventory/RecipesCommon.java +++ b/src/main/java/com/hbm/inventory/RecipesCommon.java @@ -398,6 +398,11 @@ public List getStackList(){ } return list; } + + @Override + public int hashCode() { + return (""+name+this.stacksize).hashCode(); + } @Override public AStack singulize() { @@ -443,6 +448,25 @@ public boolean matchesRecipe(ItemStack stack, boolean ignoreSize) { return false; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof OreDictStack)) + return false; + OreDictStack other = (OreDictStack) obj; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + if (stacksize != other.stacksize) + return false; + return true; + } + @Override public AStack copy() { return new OreDictStack(name, stacksize); diff --git a/src/main/java/com/hbm/items/gear/ModArmor.java b/src/main/java/com/hbm/items/gear/ModArmor.java index b378de902a..3b0d284fbd 100644 --- a/src/main/java/com/hbm/items/gear/ModArmor.java +++ b/src/main/java/com/hbm/items/gear/ModArmor.java @@ -46,7 +46,7 @@ public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlo if(stack.getItem().equals(ModItems.cmb_legs)) { return (RefStrings.MODID + ":textures/armor/cmb_2.png"); } - if(stack.getItem().equals(ModItems.paa_plate) || stack.getItem().equals(ModItems.paa_boots)) { + if(stack.getItem().equals(ModItems.paa_helmet) || stack.getItem().equals(ModItems.paa_plate) || stack.getItem().equals(ModItems.paa_boots)) { return (RefStrings.MODID + ":textures/armor/paa_1.png"); } if(stack.getItem().equals(ModItems.paa_legs)) { diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index e1d8c82c81..321d1dd218 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,8 +3,8 @@ public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech - Extended Edition"; - public static final String VERSION = "NTM-Extended-1.12.2-1.9.4"; - public static final String CHANGELOG = "$§2Added RBMk Lid jumping$§2Added RBMK Console Upgrade$§2Added Craftweaker Support$§2Added changelog print config$§2Added Geiger gui position config$§2Added Performance optimizations$§2Added Gradients to Fallout$§2Added acceleration to missiles$§2Added rocket sounds to missiles$§2Added ItemContam Rad threshold of 5 RAD/s$§3Changed PAA armor color to white$§3Changed Doors to be open on redstone signal$§3Changed WasteLeaves to be actual leaves$§6Fixed Gas moving lag$§6Fixed DFC Fuel balance$§6Fixed assembler recipe found$§6Fixed too long mushroom clouds$§6Fixed Gas and Explosive Gas Spawning$§6Fixed Crystallizer fluid acceptance$§6Fixed rocket exaust culling issues"; + public static final String VERSION = "NTM-Extended-1.12.2-1.9.4-a"; + public static final String CHANGELOG = "$§2Added RBMk Lid jumping$§2Added RBMK Console Upgrade$§2Added Craftweaker Support$§2Added changelog print config$§2Added Geiger gui position config$§2Added Performance optimizations$§2Added Gradients to Fallout$§2Added acceleration to missiles$§2Added rocket sounds to missiles$§2Added ItemContam Rad threshold of 5 RAD/s$§3Changed PAA armor color to white$§3Changed Doors to be open on redstone signal$§3Changed WasteLeaves to be actual leaves$§6Fixed Gas moving lag$§6Fixed DFC Fuel balance$§6Fixed assembler recipe found$§6Fixed too long mushroom clouds$§6Fixed Gas and Explosive Gas Spawning$§6Fixed Crystallizer fluid acceptance$§6Fixed rocket exaust culling issues$§6Fixed Paa helmet$§6Fixed Blast Furnace"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version