diff --git a/changelog b/changelog index 5f62bb644..e22df7578 100644 --- a/changelog +++ b/changelog @@ -6,6 +6,10 @@ * All current nether bedrock ores are tier 1 and do not require any bore fluid * Custom machines now show their recipes in NEI * All it took was battling NEI's source code for 3 hours and my sanity +* Changed energy OC compatibility + * Make sure to update your programs, as the getEnergyStored and getMaxEnergy have been deprecated. ## Fixed -* Fixed crash caused by mobs spawning in highly polluted area +* Fixed custom machines not sending fluid +* Fixed custom machine item IO not working beyond the first slot +* Fixed target designators not accepting coordinates when not designated first (OC compatibility) diff --git a/src/main/java/com/hbm/inventory/recipes/ElectrolyserFluidRecipes.java b/src/main/java/com/hbm/inventory/recipes/ElectrolyserFluidRecipes.java index 5a61fb756..6eee6ba55 100644 --- a/src/main/java/com/hbm/inventory/recipes/ElectrolyserFluidRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/ElectrolyserFluidRecipes.java @@ -2,8 +2,10 @@ package com.hbm.inventory.recipes; import java.io.IOException; import java.util.HashMap; +import java.util.Map.Entry; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.stream.JsonWriter; import com.hbm.inventory.FluidStack; import com.hbm.inventory.fluid.FluidType; @@ -43,12 +45,31 @@ public class ElectrolyserFluidRecipes extends SerializableRecipe { @Override public void readRecipe(JsonElement recipe) { + JsonObject obj = (JsonObject) recipe; + + FluidStack input = this.readFluidStack(obj.get("input").getAsJsonArray()); + FluidStack output1 = this.readFluidStack(obj.get("output1").getAsJsonArray()); + FluidStack output2 = this.readFluidStack(obj.get("output2").getAsJsonArray()); + ItemStack[] byproducts = new ItemStack[0]; + if(obj.has("byproducts")) byproducts = this.readItemStackArray(obj.get("byproducts").getAsJsonArray()); + + recipes.put(input.type, new ElectrolysisRecipe(input.fill, output1, output2, byproducts)); } @Override public void writeRecipe(Object recipe, JsonWriter writer) throws IOException { + Entry rec = (Entry) recipe; + writer.name("input"); this.writeFluidStack(new FluidStack(rec.getKey(), rec.getValue().amount), writer); + writer.name("output1"); this.writeFluidStack(rec.getValue().output1, writer); + writer.name("output2"); this.writeFluidStack(rec.getValue().output2, writer); + + if(rec.getValue().byproduct != null && rec.getValue().byproduct.length > 0) { + writer.name("byproducts").beginArray(); + for(ItemStack stack : rec.getValue().byproduct) this.writeItemStack(stack, writer); + writer.endArray(); + } } public static class ElectrolysisRecipe { diff --git a/src/main/java/com/hbm/inventory/recipes/ElectrolyserMetalRecipes.java b/src/main/java/com/hbm/inventory/recipes/ElectrolyserMetalRecipes.java index 40b3555c7..d5d3fe492 100644 --- a/src/main/java/com/hbm/inventory/recipes/ElectrolyserMetalRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/ElectrolyserMetalRecipes.java @@ -2,12 +2,22 @@ package com.hbm.inventory.recipes; import java.io.IOException; import java.util.HashMap; +import java.util.List; +import java.util.Map.Entry; +import com.google.gson.JsonArray; import com.google.gson.JsonElement; +import com.google.gson.JsonObject; import com.google.gson.stream.JsonWriter; 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.material.Mats; import com.hbm.inventory.material.Mats.MaterialStack; import com.hbm.inventory.recipes.loader.SerializableRecipe; +import com.hbm.items.ModItems; +import com.hbm.util.ItemStackUtil; import net.minecraft.item.ItemStack; @@ -17,10 +27,31 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe { @Override public void registerDefaults() { - + + recipes.put(new ComparableStack(ModItems.crystal_iron), new ElectrolysisMetalRecipe( + new MaterialStack(Mats.MAT_IRON, MaterialShapes.INGOT.q(6)), + new MaterialStack(Mats.MAT_TITANIUM, MaterialShapes.INGOT.q(2)), + new ItemStack(ModItems.powder_lithium_tiny, 1))); + recipes.put(new ComparableStack(ModItems.crystal_gold), new ElectrolysisMetalRecipe( + new MaterialStack(Mats.MAT_IRON, MaterialShapes.INGOT.q(6)), + new MaterialStack(Mats.MAT_LEAD, MaterialShapes.INGOT.q(2)), + new ItemStack(ModItems.powder_lithium_tiny, 1), + new ItemStack(ModItems.ingot_mercury, 1))); } public static ElectrolysisMetalRecipe getRecipe(ItemStack stack) { + + ComparableStack comp = new ComparableStack(stack).makeSingular(); + + if(recipes.containsKey(comp)) return recipes.get(comp); + + List names = ItemStackUtil.getOreDictNames(stack); + + for(String name : names) { + OreDictStack ore = new OreDictStack(name); + if(recipes.containsKey(ore)) return recipes.get(ore); + } + return null; } @@ -41,18 +72,63 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe { @Override public void readRecipe(JsonElement recipe) { + JsonObject obj = (JsonObject) recipe; + AStack input = this.readAStack(obj.get("input").getAsJsonArray()); + + JsonArray out1 = obj.get("output1").getAsJsonArray(); + String name1 = out1.get(0).getAsString(); + int amount1 = out1.get(1).getAsInt(); + MaterialStack output1 = new MaterialStack(Mats.matByName.get(name1), amount1); + + JsonArray out2 = obj.get("output2").getAsJsonArray(); + String name2 = out2.get(0).getAsString(); + int amount2 = out2.get(1).getAsInt(); + MaterialStack output2 = new MaterialStack(Mats.matByName.get(name2), amount2); + + ItemStack[] byproducts = new ItemStack[0]; + if(obj.has("byproducts")) byproducts = this.readItemStackArray(obj.get("byproducts").getAsJsonArray()); + + recipes.put(input, new ElectrolysisMetalRecipe(output1, output2, byproducts)); } @Override public void writeRecipe(Object recipe, JsonWriter writer) throws IOException { + Entry rec = (Entry) recipe; + writer.name("input"); this.writeAStack(rec.getKey(), writer); + + writer.name("output1"); + writer.beginArray(); + writer.setIndent(""); + writer.value(rec.getValue().output1.material.names[0]).value(rec.getValue().output1.amount); + writer.endArray(); + writer.setIndent(" "); + + writer.name("output2"); + writer.beginArray(); + writer.setIndent(""); + writer.value(rec.getValue().output2.material.names[0]).value(rec.getValue().output2.amount); + writer.endArray(); + writer.setIndent(" "); + + if(rec.getValue().byproduct != null && rec.getValue().byproduct.length > 0) { + writer.name("byproducts").beginArray(); + for(ItemStack stack : rec.getValue().byproduct) this.writeItemStack(stack, writer); + writer.endArray(); + } } public static class ElectrolysisMetalRecipe { public MaterialStack output1; public MaterialStack output2; - public ItemStack[] byproducts; + public ItemStack[] byproduct; + + public ElectrolysisMetalRecipe(MaterialStack output1, MaterialStack output2, ItemStack... byproduct) { + this.output1 = output1; + this.output2 = output2; + this.byproduct = byproduct; + } } } diff --git a/src/main/java/com/hbm/inventory/recipes/loader/SerializableRecipe.java b/src/main/java/com/hbm/inventory/recipes/loader/SerializableRecipe.java index c2252db37..cf6ed2490 100644 --- a/src/main/java/com/hbm/inventory/recipes/loader/SerializableRecipe.java +++ b/src/main/java/com/hbm/inventory/recipes/loader/SerializableRecipe.java @@ -63,6 +63,7 @@ public abstract class SerializableRecipe { recipeHandlers.add(new OutgasserRecipes()); recipeHandlers.add(new CompressorRecipes()); recipeHandlers.add(new ElectrolyserFluidRecipes()); + recipeHandlers.add(new ElectrolyserMetalRecipes()); recipeHandlers.add(new MatDistribution()); recipeHandlers.add(new CustomMachineRecipes()); diff --git a/src/main/java/com/hbm/render/tileentity/RenderBobble.java b/src/main/java/com/hbm/render/tileentity/RenderBobble.java index 021499dbc..5d2e0ea14 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderBobble.java +++ b/src/main/java/com/hbm/render/tileentity/RenderBobble.java @@ -404,9 +404,9 @@ public class RenderBobble extends TileEntitySpecialRenderer { renderItem(new ItemStack(ModItems.coin_maskman, 1, 5)); break; case ADAM29: - GL11.glTranslated(0.45, 1.15, 0.4); + GL11.glTranslated(0.4, 1.15, 0.4); GL11.glScaled(0.5, 0.5, 0.5); - renderItem(new ItemStack(ModItems.coffee)); + renderItem(new ItemStack(ModItems.can_redbomb)); break; case PHEO: GL11.glTranslated(0.5, 1.15, 0.45); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityCustomMachine.java b/src/main/java/com/hbm/tileentity/machine/TileEntityCustomMachine.java index dc3302b46..4803e6e38 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityCustomMachine.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityCustomMachine.java @@ -114,10 +114,9 @@ public class TileEntityCustomMachine extends TileEntityMachineBase implements IF } } - if(config.generatorMode && power > 0) { - for(DirPos pos : this.connectionPos) { - this.sendPower(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); - } + for(DirPos pos : this.connectionPos) { + if(config.generatorMode && power > 0) this.sendPower(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); + for(FluidTank tank : this.outputTanks) if(tank.getFill() > 0) this.sendFluid(tank, worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); } if(this.structureOK) { @@ -337,12 +336,12 @@ public class TileEntityCustomMachine extends TileEntityMachineBase implements IF @Override public int[] getAccessibleSlotsFromSide(int side) { if(this.config == null) return new int[] { }; - if(this.config.itemInCount > 0) return new int[] { 4, 16, 17, 18, 19, 20, 21 }; - if(this.config.itemInCount > 1) return new int[] { 4, 5, 16, 17, 18, 19, 20, 21 }; - if(this.config.itemInCount > 2) return new int[] { 4, 5, 6, 16, 17, 18, 19, 20, 21 }; - if(this.config.itemInCount > 3) return new int[] { 4, 5, 6, 7, 16, 17, 18, 19, 20, 21 }; - if(this.config.itemInCount > 4) return new int[] { 4, 5, 6, 7, 8, 16, 17, 18, 19, 20, 21 }; if(this.config.itemInCount > 5) return new int[] { 4, 5, 6, 7, 8, 9, 16, 17, 18, 19, 20, 21 }; + if(this.config.itemInCount > 4) return new int[] { 4, 5, 6, 7, 8, 16, 17, 18, 19, 20, 21 }; + if(this.config.itemInCount > 3) return new int[] { 4, 5, 6, 7, 16, 17, 18, 19, 20, 21 }; + if(this.config.itemInCount > 2) return new int[] { 4, 5, 6, 16, 17, 18, 19, 20, 21 }; + if(this.config.itemInCount > 1) return new int[] { 4, 5, 16, 17, 18, 19, 20, 21 }; + if(this.config.itemInCount > 0) return new int[] { 4, 16, 17, 18, 19, 20, 21 }; return new int[] { }; } diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 4bfcf8ce1..37d2f9508 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -431,6 +431,21 @@ book_lore.bf_bomb_5.page.6=There's a vital distinction to be made between dissec book_lore.bf_bomb_5.page.7=The government wants to put this shit into bombs after all, maybe we'll see a couple more wars, couple more million resigned to a fate worse than death. They can't hide this forever. $ $ I don't care. Not anymore. Please, god, let me go back book_lore.bf_bomb_5.page.8=to actual science. $ $ Goddamnit, Mae, get ahold of yourself... +book_lore.beacon.name=Signal Beacon Instruction Booklet +book_lore.beacon.author=Flim Flam Industries +book_lore.beacon.page.0=Thank you for your purchase of a Mk.2 Illuminated Signal Beacon (rev. 1.3)! This small booklet will provide a short introduction in the operation of the beacon, as well as its inner workings. +book_lore.beacon.page.1=Chapter 1: Architecture $ Each unit is composed of four main parts: The control circuit, a lantern, a fog horn and the casing which houses the other parts. For a detailed explanation of the main circuit, please +book_lore.beacon.page.2=refer to the circuit diagram found on the inside of the maintenance lid of the casing. The lantern is made up of a polycarbonate case containing a dual-color 250 Watt halogen bulb with a standard 200mm socket, replacements +book_lore.beacon.page.3=for the bulb can be ordered from our stores. Third party bulbs are not recommended, as we cannot ensure safe operation. The case is made from a specialized zinc-coated stainless steel and is resistant to weathering. +book_lore.beacon.page.4=Chapter 2: Lantern $ The lantern's primary uses are providing light for ease of maintenance in harsh weather conditions as well as a status indicator. Should the power-on self test (POST) fail, the lantern will +book_lore.beacon.page.5=light up red, otherwise it will light up green. Note that colors can vary depending on the replacement bulb. +book_lore.beacon.page.6=Chapter 3: Fog Horn $ The fog horn is the primary communication device of the beacon. The beacon is designed for peer-to-peer (P2P) commincation as well as for message boradcasting. +book_lore.beacon.page.7=Chapter 4: Peer-to-Peer $ For details on communication, refer to the communications handbook. A short rundown of establishing a P2P connection follows: First, the beacon has to give the "START CONNECTION" signal, +book_lore.beacon.page.8=being a single long tone. All available peers should respond with a single long tone as well (order specified by proximity, as well as the communication guidelines outlined in the handbook, section "Responding to a Connection") +book_lore.beacon.page.9=Once the desired peer has responded, give the "ACCEPT CONNECTION" signal, being two long tones, the peer will then also respon with two long tones. All communication afterwards has to happen using pre-negotiated signals, +book_lore.beacon.page.10=most commonly using the FAR-5M standard. Communication will end immediately if no standard has been negotiated, serving as a "ping". Should communication continue, the connection can be ended using another long single tone "END CONNECTION". +book_lore.beacon.page.11=Chapter 5: Warranty $ [ page intentionally left blank ] + cannery.f1=[ Press F1 for help ] cannery.centrifuge=Gas Centrifuge diff --git a/src/main/resources/assets/hbm/sounds/block/hornFarDual.ogg b/src/main/resources/assets/hbm/sounds/block/hornFarDual.ogg new file mode 100644 index 000000000..f92fc5014 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/block/hornFarDual.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/block/hornFarSingle.ogg b/src/main/resources/assets/hbm/sounds/block/hornFarSingle.ogg new file mode 100644 index 000000000..d77e3f57e Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/block/hornFarSingle.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/block/hornNearDual.ogg b/src/main/resources/assets/hbm/sounds/block/hornNearDual.ogg new file mode 100644 index 000000000..26c030954 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/block/hornNearDual.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/block/hornNearSingle.ogg b/src/main/resources/assets/hbm/sounds/block/hornNearSingle.ogg new file mode 100644 index 000000000..5a66bc414 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/block/hornNearSingle.ogg differ diff --git a/src/main/resources/assets/hbm/textures/armor/envsuit_arm.png b/src/main/resources/assets/hbm/textures/armor/envsuit_arm.png new file mode 100644 index 000000000..119357dd7 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/armor/envsuit_arm.png differ diff --git a/src/main/resources/assets/hbm/textures/armor/envsuit_chest.png b/src/main/resources/assets/hbm/textures/armor/envsuit_chest.png new file mode 100644 index 000000000..f6bbbf97e Binary files /dev/null and b/src/main/resources/assets/hbm/textures/armor/envsuit_chest.png differ diff --git a/src/main/resources/assets/hbm/textures/armor/envsuit_helmet.png b/src/main/resources/assets/hbm/textures/armor/envsuit_helmet.png new file mode 100644 index 000000000..46ef36237 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/armor/envsuit_helmet.png differ diff --git a/src/main/resources/assets/hbm/textures/armor/envsuit_leg.png b/src/main/resources/assets/hbm/textures/armor/envsuit_leg.png new file mode 100644 index 000000000..02d1d631e Binary files /dev/null and b/src/main/resources/assets/hbm/textures/armor/envsuit_leg.png differ diff --git a/src/main/resources/assets/hbm/textures/armor/envsuit_tail.png b/src/main/resources/assets/hbm/textures/armor/envsuit_tail.png new file mode 100644 index 000000000..81d1aa345 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/armor/envsuit_tail.png differ diff --git a/src/main/resources/assets/hbm/textures/models/trinkets/adam29.png b/src/main/resources/assets/hbm/textures/models/trinkets/adam29.png index bab400b53..0aa2f83cc 100644 Binary files a/src/main/resources/assets/hbm/textures/models/trinkets/adam29.png and b/src/main/resources/assets/hbm/textures/models/trinkets/adam29.png differ