Skip to content

Commit

Permalink
Version 1.9.4-a Release: Blast Furnace Fix
Browse files Browse the repository at this point in the history
Fixed Blast Furnace Recipes
Fixed Paa Helmet
  • Loading branch information
Alcatergit committed Apr 27, 2023
1 parent 853bc88 commit e9ce436
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 47 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/main/java/com/hbm/entity/mob/EntityFBI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/hbm/handler/HazmatRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/com/hbm/handler/jei/JeiRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -165,10 +166,10 @@ public static class AlloyFurnaceRecipe implements IRecipeWrapper {
private final List<List<ItemStack>> inputs;
private final ItemStack output;

public AlloyFurnaceRecipe(AStack[] inputs, ItemStack output) {
List<List<ItemStack>> list = new ArrayList<>(inputs.length);
for(AStack s : inputs)
list.add(s.getStackList());
public AlloyFurnaceRecipe(AStack input1, AStack input2, ItemStack output) {
List<List<ItemStack>> list = new ArrayList<>(2);
list.add(input1.getStackList());
list.add(input2.getStackList());
this.inputs = list;
this.output = output;
}
Expand Down Expand Up @@ -746,8 +747,8 @@ public static List<AlloyFurnaceRecipe> getAlloyRecipes() {
return alloyFurnaceRecipes;
alloyFurnaceRecipes = new ArrayList<AlloyFurnaceRecipe>();

for(Map.Entry<AStack[], ItemStack> entry : DiFurnaceRecipes.diRecipes.entrySet()){
alloyFurnaceRecipes.add(new AlloyFurnaceRecipe(entry.getKey(), entry.getValue()));
for(Map.Entry<Pair<AStack, AStack>, ItemStack> pairEntry : DiFurnaceRecipes.diRecipes.entrySet()){
alloyFurnaceRecipes.add(new AlloyFurnaceRecipe(pairEntry.getKey().getKey(), pairEntry.getKey().getValue(), pairEntry.getValue()));
}
return alloyFurnaceRecipes;
}
Expand Down
63 changes: 28 additions & 35 deletions src/main/java/com/hbm/inventory/DiFurnaceRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,7 +29,7 @@
@Spaghetti("everything")
public class DiFurnaceRecipes {

public static HashMap<AStack[], ItemStack> diRecipes = new HashMap<AStack[], ItemStack>();
public static HashMap<Pair<AStack, AStack>, ItemStack> diRecipes = new HashMap<Pair<AStack, AStack>, ItemStack>();
public static HashMap<AStack, Integer> diFuels = new HashMap<AStack, Integer>();

public static void registerRecipes(){
Expand Down Expand Up @@ -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){
Expand All @@ -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;

Expand All @@ -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;
}
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/hbm/inventory/RecipesCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ public List<ItemStack> getStackList(){
}
return list;
}

@Override
public int hashCode() {
return (""+name+this.stacksize).hashCode();
}

@Override
public AStack singulize() {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/hbm/items/gear/ModArmor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/hbm/lib/RefStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9ce436

Please sign in to comment.