diff --git a/changelog b/changelog index b5897bc7a..00e00be3c 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,10 @@ ## Changed * Updated chinese localization -* Watz powerplant now has OC and RoR integration \ No newline at end of file +* Watz powerplant now has OC and RoR integration +* The automatic thresher now has a fluid port on the bottom as well +* The foundry basins and outlet filters now use the properly translated name instead of the internal name for the material + +## Fixed +* Fixed AUTOCAL's number comparison functions not working with variable substitution as advertised +* Fixed broken thorium ore centrifuging recipe shown in NEI +* Fixed industrial turbine not properly saving its energy values, causing the flywheel to stop on relog \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/machine/FoundryCastingBase.java b/src/main/java/com/hbm/blocks/machine/FoundryCastingBase.java index fe57bc788..9c499f04d 100644 --- a/src/main/java/com/hbm/blocks/machine/FoundryCastingBase.java +++ b/src/main/java/com/hbm/blocks/machine/FoundryCastingBase.java @@ -202,7 +202,7 @@ public abstract class FoundryCastingBase extends BlockContainer implements ICruc } if(cast.type != null && cast.amount > 0) { - text.add(EnumChatFormatting.YELLOW + cast.type.names[0] + ": " + cast.amount + " / " + cast.getCapacity()); + text.add(EnumChatFormatting.YELLOW + cast.type.getLocalizedName() + ": " + cast.amount + " / " + cast.getCapacity()); } ILookOverlay.printGeneric(event, I18nUtil.resolveKey(this.getUnlocalizedName() + ".name"), 0xFF4000, 0x401000, text); diff --git a/src/main/java/com/hbm/blocks/machine/FoundryOutlet.java b/src/main/java/com/hbm/blocks/machine/FoundryOutlet.java index bbf18772b..a9a0d1d7d 100644 --- a/src/main/java/com/hbm/blocks/machine/FoundryOutlet.java +++ b/src/main/java/com/hbm/blocks/machine/FoundryOutlet.java @@ -204,7 +204,7 @@ public class FoundryOutlet extends BlockContainer implements ICrucibleAcceptor, List text = new ArrayList(); if(outlet.filter != null) { - text.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("foundry.filter", outlet.filter.names[0])); + text.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("foundry.filter", outlet.filter.getLocalizedName())); } if(outlet.invertFilter) { text.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("foundry.invertFilter")); diff --git a/src/main/java/com/hbm/inventory/material/NTMMaterial.java b/src/main/java/com/hbm/inventory/material/NTMMaterial.java index 7f15f1bed..56c1a1aa1 100644 --- a/src/main/java/com/hbm/inventory/material/NTMMaterial.java +++ b/src/main/java/com/hbm/inventory/material/NTMMaterial.java @@ -5,6 +5,7 @@ import java.util.Locale; import java.util.Set; import com.hbm.inventory.OreDictManager.DictFrame; +import com.hbm.util.i18n.I18nUtil; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -50,6 +51,10 @@ public class NTMMaterial { return "hbmmat." + this.names[0].toLowerCase(Locale.US); } + public String getLocalizedName() { + return I18nUtil.resolveKey(getUnlocalizedName()); + } + public NTMMaterial setConversion(NTMMaterial mat, int in, int out) { this.smeltsInto = mat; this.convIn = in; diff --git a/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java b/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java index b8b9b5e43..fdc31be9c 100644 --- a/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java @@ -14,12 +14,10 @@ import com.hbm.config.GeneralConfig; import com.hbm.handler.imc.IMCCentrifuge; import static com.hbm.inventory.OreDictManager.*; import com.hbm.inventory.OreDictManager.DictFrame; -import com.hbm.inventory.OreDictManager; 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.material.MaterialShapes; import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.items.ItemEnums; import com.hbm.items.ItemEnums.EnumAshType; @@ -131,7 +129,7 @@ public class CentrifugeRecipes extends SerializableRecipe { new ItemStack(ModItems.nugget_solinium, 1), new ItemStack(Blocks.gravel, 1) }); - recipes.put(new OreDictStack("oreRareEarth"), new ItemStack[] { + recipes.put(new OreDictStack(RAREEARTH.ore()), new ItemStack[] { new ItemStack(ModItems.powder_desh_mix, 1), new ItemStack(ModItems.nugget_zirconium, 1), new ItemStack(ModItems.nugget_zirconium, 1), @@ -149,7 +147,7 @@ public class CentrifugeRecipes extends SerializableRecipe { lbs ? new ItemStack(ModItems.nugget_ra226, 2) : new ItemStack(ModItems.nugget_ra226, 1), new ItemStack(Blocks.gravel, 1) }); - for(String ore : OreDictManager.TH232.all(MaterialShapes.ORE)) recipes.put(new OreDictStack(ore), new ItemStack[] { + recipes.put(new OreDictStack(TH232.ore()), new ItemStack[] { new ItemStack(ModItems.powder_thorium, 1), new ItemStack(ModItems.powder_thorium, 1), new ItemStack(ModItems.powder_uranium, 1), diff --git a/src/main/java/com/hbm/module/ParseMSES1.java b/src/main/java/com/hbm/module/ParseMSES1.java index 453cb1ea3..1f9c8c931 100644 --- a/src/main/java/com/hbm/module/ParseMSES1.java +++ b/src/main/java/com/hbm/module/ParseMSES1.java @@ -180,10 +180,10 @@ public class ParseMSES1 implements IParse { // greater than buffer if(lower.startsWith("gtb ")) { - if(line.length() <= 3 || ctx.buffer.isEmpty()) return EnumStatementReturn.PARAMETER_ERROR; + if(line.length() <= 4 || ctx.buffer.isEmpty()) return EnumStatementReturn.PARAMETER_ERROR; try { double buffer = Double.parseDouble(ctx.buffer); - double val = Double.parseDouble(line.substring(3)); + double val = Double.parseDouble(substitute(ctx, line.substring(4), false)); ctx.buffer = val > buffer ? "true" : "false"; } catch(Exception ex) { return EnumStatementReturn.PARAMETER_ERROR; } return EnumStatementReturn.OK; @@ -191,10 +191,10 @@ public class ParseMSES1 implements IParse { // lower than buffer if(lower.startsWith("ltb ")) { - if(line.length() <= 3 || ctx.buffer.isEmpty()) return EnumStatementReturn.PARAMETER_ERROR; + if(line.length() <= 4 || ctx.buffer.isEmpty()) return EnumStatementReturn.PARAMETER_ERROR; try { double buffer = Double.parseDouble(ctx.buffer); - double val = Double.parseDouble(line.substring(3)); + double val = Double.parseDouble(substitute(ctx, line.substring(4), false)); ctx.buffer = val < buffer ? "true" : "false"; } catch(Exception ex) { return EnumStatementReturn.PARAMETER_ERROR; } return EnumStatementReturn.OK; @@ -202,10 +202,10 @@ public class ParseMSES1 implements IParse { // greater than or equal buffer if(lower.startsWith("geb ")) { - if(line.length() <= 3 || ctx.buffer.isEmpty()) return EnumStatementReturn.PARAMETER_ERROR; + if(line.length() <= 4 || ctx.buffer.isEmpty()) return EnumStatementReturn.PARAMETER_ERROR; try { double buffer = Double.parseDouble(ctx.buffer); - double val = Double.parseDouble(line.substring(3)); + double val = Double.parseDouble(substitute(ctx, line.substring(4), false)); ctx.buffer = val >= buffer ? "true" : "false"; } catch(Exception ex) { return EnumStatementReturn.PARAMETER_ERROR; } return EnumStatementReturn.OK; @@ -213,10 +213,10 @@ public class ParseMSES1 implements IParse { // lower than or equal buffer if(lower.startsWith("leb ")) { - if(line.length() <= 3 || ctx.buffer.isEmpty()) return EnumStatementReturn.PARAMETER_ERROR; + if(line.length() <= 4 || ctx.buffer.isEmpty()) return EnumStatementReturn.PARAMETER_ERROR; try { double buffer = Double.parseDouble(ctx.buffer); - double val = Double.parseDouble(line.substring(3)); + double val = Double.parseDouble(substitute(ctx, line.substring(4), false)); ctx.buffer = val <= buffer ? "true" : "false"; } catch(Exception ex) { return EnumStatementReturn.PARAMETER_ERROR; } return EnumStatementReturn.OK; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineIndustrialTurbine.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineIndustrialTurbine.java index cb1798c91..8ecc1a189 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineIndustrialTurbine.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineIndustrialTurbine.java @@ -183,6 +183,8 @@ public class TileEntityMachineIndustrialTurbine extends TileEntityTurbineBase im public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); lastPowerTarget = nbt.getLong("lastPowerTarget"); + flywheel_energy = nbt.getLong("flywheel_energy"); + maxPower = nbt.getLong("maxPower"); spin = nbt.getDouble("spin"); } @@ -190,6 +192,8 @@ public class TileEntityMachineIndustrialTurbine extends TileEntityTurbineBase im public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); nbt.setLong("lastPowerTarget", lastPowerTarget); + nbt.setLong("flywheel_energy", flywheel_energy); + nbt.setLong("maxPower", maxPower); nbt.setDouble("spin", spin); } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineThresher.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineThresher.java index ffc71f2be..43d329614 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineThresher.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineThresher.java @@ -9,6 +9,7 @@ import com.hbm.handler.threading.PacketThreading; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.items.ModItems; +import com.hbm.lib.Library; import com.hbm.lib.ModDamageSource; import com.hbm.main.MainRegistry; import com.hbm.main.NTMSounds; @@ -85,6 +86,7 @@ public class TileEntityMachineThresher extends TileEntityLoadedBase implements I trySubscribe(tank.getTankType(), worldObj, xCoord + rot.offsetX, yCoord, zCoord + rot.offsetZ, rot); trySubscribe(tank.getTankType(), worldObj, xCoord - rot.offsetX, yCoord, zCoord - rot.offsetZ, rot.getOpposite()); + trySubscribe(tank.getTankType(), worldObj, xCoord, yCoord - 1, zCoord, Library.NEG_Y); } if(isOn && !isSuspended) { diff --git a/src/main/resources/assets/hbm/textures/models/machines/thresher.png b/src/main/resources/assets/hbm/textures/models/machines/thresher.png index a8eb43a0d..122d7ed73 100644 Binary files a/src/main/resources/assets/hbm/textures/models/machines/thresher.png and b/src/main/resources/assets/hbm/textures/models/machines/thresher.png differ