From d6cdc69c899b873bd252329eafd581e32b9dae26 Mon Sep 17 00:00:00 2001 From: Boblet Date: Thu, 22 Jun 2023 14:59:54 +0200 Subject: [PATCH 1/7] pressure --- changelog | 44 +++ .../hbm/fluid/IFluidStandardTransceiver.java | 8 +- .../hbm/blocks/machine/MachineCompressor.java | 19 +- .../hbm/inventory/fluid/tank/FluidTank.java | 3 + .../com/hbm/inventory/gui/GUICompressor.java | 43 ++- .../inventory/recipes/CompressorRecipes.java | 17 +- .../inventory/recipes/OutgasserRecipes.java | 2 + .../recipes/loader/JSONLoaderBase.java | 177 ------------ .../recipes/loader/SerializableRecipe.java | 5 +- .../com/hbm/items/tool/ItemBlowtorch.java | 2 +- .../render/tileentity/RenderCompressor.java | 11 +- .../machine/TileEntityMachineCompressor.java | 251 +++++++++++++++++- .../textures/models/machines/compressor.png | Bin 3463 -> 5337 bytes 13 files changed, 386 insertions(+), 196 deletions(-) delete mode 100644 src/main/java/com/hbm/inventory/recipes/loader/JSONLoaderBase.java diff --git a/changelog b/changelog index e69de29bb..7e7de1c66 100644 --- a/changelog +++ b/changelog @@ -0,0 +1,44 @@ +## Added +* Glpyhids + * Hives will spawn randomly in the world + * Hives will constantly spawn new glyphids + * If explosed to soot, hives will create glyphid scouts, which when far enough from another hive will explode and generate a new hive + * Higher soot levels create stronger glyphids + * Glyphids possess armor which has a chance of breaking off and fully abrosrbing damage + * Each glyphid has five armor plates + * Glyphid types include multiple tiers of melee glyphids as well as a few ranged ones, the scout, and a nuclear variant +* Compressor + * Can compress fluids, turning them into higher pressure variants + * Can also turn steam into higher pressure types +* A new rocket artillery ammo type that creates volcanic lava on impact +* BDCL + * A type of lubricant that is easy to make and can be used in hydraulic piston and electric press recipes instead of regular lubricant +* FBI drones + * A configurable amount of drones can now spawn during FBI raids + * They will hover over players, dropping bombs + +## Changed +* Updated russian localization +* Fluid traits can now be configured, any fluid can now have any fluid with variable stats assigned to them +* Large explosions now load the central chunk they are in, this can be disabled in the config +* Burning leaded fuels now releases poisonous heavy metals into the atmosphere +* The pollution detector now displays rounded values +* More machines and especially destroyed ones now release soot +* The iGen has been rebalanced again, delete your machine config file for the changes to take effect + * The lubrican power multiplier has been increased from 1.1 to 1.5 + * The fluid divisor has been lowered from 5,000 to 1,000, meaning the iGen now burns flammable liquids at full efficiency +* Removed the config for having an additional keybind for dashing, the keybind is now always active since it no longer conflicts with crouching +* Crucible recipes no longer use foundry scraps to visualize the recipes, instead they use a lava-like texture +* Fusion reactors are now made from welded magnets which are created by weling a cast steel plate onto a magnet + * Due to the cost of the cast plates, fusion reactor magnets are now cheaper to compensate + * Consequently, particle accelerators are now also cheaper due to being made from mostly fusion reactor magnets +* The blowtorch now consumes only 250mB per operation, allowing for up to 16 things to be welded with a single fill +* The page and notebook items have been replaced with more dynamic book items that get their data from NBT +* C4 can now be made by irradiating PVC + * Play stupid games, win stupid prizes + +## Fixed +* Fixed potential crash or logspam regarding the pollution handler +* Fixed missiles leaving behind a 3x3 grid of loaded chunks after being destroyed +* Fixed coal ore yielding coal in the crucible instead of making carbon +* Fixed a potential issue where BuildCraft generators can't supply the RF to HE converter \ No newline at end of file diff --git a/src/main/java/api/hbm/fluid/IFluidStandardTransceiver.java b/src/main/java/api/hbm/fluid/IFluidStandardTransceiver.java index eb7092ad8..4012ab63f 100644 --- a/src/main/java/api/hbm/fluid/IFluidStandardTransceiver.java +++ b/src/main/java/api/hbm/fluid/IFluidStandardTransceiver.java @@ -26,7 +26,7 @@ public interface IFluidStandardTransceiver extends IFluidUser { public default long getTotalFluidForSend(FluidType type, int pressure) { for(FluidTank tank : getSendingTanks()) { - if(tank.getTankType() == type) { + if(tank.getTankType() == type && tank.getPressure() == pressure) { return tank.getFill(); } } @@ -38,7 +38,7 @@ public interface IFluidStandardTransceiver extends IFluidUser { public default void removeFluidForTransfer(FluidType type, int pressure, long amount) { for(FluidTank tank : getSendingTanks()) { - if(tank.getTankType() == type) { + if(tank.getTankType() == type && tank.getPressure() == pressure) { tank.setFill(tank.getFill() - (int) amount); return; } @@ -49,7 +49,7 @@ public interface IFluidStandardTransceiver extends IFluidUser { public default long getDemand(FluidType type, int pressure) { for(FluidTank tank : getReceivingTanks()) { - if(tank.getTankType() == type) { + if(tank.getTankType() == type && tank.getPressure() == pressure) { return tank.getMaxFill() - tank.getFill(); } } @@ -61,7 +61,7 @@ public interface IFluidStandardTransceiver extends IFluidUser { public default long transferFluid(FluidType type, int pressure, long amount) { for(FluidTank tank : getReceivingTanks()) { - if(tank.getTankType() == type) { + if(tank.getTankType() == type && tank.getPressure() == pressure) { tank.setFill(tank.getFill() + (int) amount); if(tank.getFill() > tank.getMaxFill()) { diff --git a/src/main/java/com/hbm/blocks/machine/MachineCompressor.java b/src/main/java/com/hbm/blocks/machine/MachineCompressor.java index 791ad2f77..f22bc3fc1 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineCompressor.java +++ b/src/main/java/com/hbm/blocks/machine/MachineCompressor.java @@ -1,6 +1,8 @@ package com.hbm.blocks.machine; import com.hbm.blocks.BlockDummyable; +import com.hbm.handler.MultiblockHandlerXR; +import com.hbm.tileentity.TileEntityProxyCombo; import com.hbm.tileentity.machine.TileEntityMachineCompressor; import net.minecraft.block.material.Material; @@ -18,6 +20,7 @@ public class MachineCompressor extends BlockDummyable { @Override public TileEntity createNewTileEntity(World world, int meta) { if(meta >= 12) return new TileEntityMachineCompressor(); + if(meta >= extra) return new TileEntityProxyCombo().fluid().power(); return null; } @@ -39,11 +42,25 @@ public class MachineCompressor extends BlockDummyable { @Override protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) { - return super.checkRequirement(world, x, y, z, dir, o); + return super.checkRequirement(world, x, y, z, dir, o) && + MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -3, 1, 1, 1, 1}, x, y, z, dir) && + MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {8, -4, 0, 0, 1, 1}, x, y, z, dir); } @Override public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { super.fillSpace(world, x, y, z, dir, o); + + MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -3, 1, 1, 1, 1}, this, dir); + MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {8, -4, 0, 0, 1, 1}, this, dir); + + x += dir.offsetX * o; + z += dir.offsetZ * o; + + ForgeDirection rot = dir.getRotation(ForgeDirection.UP); + + this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ); + this.makeExtra(world, x + rot.offsetX, y, z + rot.offsetZ); + this.makeExtra(world, x - rot.offsetX, y, z - rot.offsetZ); } } diff --git a/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java b/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java index 90e8b3bbf..c9e94b9ee 100644 --- a/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java +++ b/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java @@ -44,6 +44,9 @@ public class FluidTank { } public FluidTank withPressure(int pressure) { + + if(this.pressure != pressure) this.setFill(0); + this.pressure = pressure; return this; } diff --git a/src/main/java/com/hbm/inventory/gui/GUICompressor.java b/src/main/java/com/hbm/inventory/gui/GUICompressor.java index c31ee0baf..9e2f758e8 100644 --- a/src/main/java/com/hbm/inventory/gui/GUICompressor.java +++ b/src/main/java/com/hbm/inventory/gui/GUICompressor.java @@ -4,21 +4,25 @@ import org.lwjgl.opengl.GL11; import com.hbm.inventory.container.ContainerCompressor; import com.hbm.lib.RefStrings; +import com.hbm.packet.NBTControlPacket; +import com.hbm.packet.PacketDispatcher; import com.hbm.tileentity.machine.TileEntityMachineCompressor; import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; public class GUICompressor extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_compressor.png"); - private TileEntityMachineCompressor solidifier; + private TileEntityMachineCompressor compressor; public GUICompressor(InventoryPlayer invPlayer, TileEntityMachineCompressor tedf) { super(new ContainerCompressor(invPlayer, tedf)); - solidifier = tedf; + compressor = tedf; this.xSize = 176; this.ySize = 204; @@ -28,14 +32,31 @@ public class GUICompressor extends GuiInfoContainer { public void drawScreen(int mouseX, int mouseY, float f) { super.drawScreen(mouseX, mouseY, f); - //solidifier.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 35, guiTop + 36, 16, 52); - //this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 18, 16, 52, solidifier.power, solidifier.maxPower); + compressor.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 17, guiTop + 18, 16, 52); + compressor.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 107, guiTop + 18, 16, 52); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 52, compressor.power, compressor.maxPower); + } + + @Override + protected void mouseClicked(int x, int y, int i) { + super.mouseClicked(x, y, i); + + for(int j = 0; j < 5; j++) { + + if(guiLeft + 43 + j * 11 <= x && guiLeft + 43 + 8 + j * 11 > x && guiTop + 46 < y && guiTop + 46 + 14 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + NBTTagCompound data = new NBTTagCompound(); + data.setInteger("compression", j); + PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, compressor.xCoord, compressor.yCoord, compressor.zCoord)); + } + } } @Override protected void drawGuiContainerForegroundLayer(int i, int j) { - String name = this.solidifier.hasCustomInventoryName() ? this.solidifier.getInventoryName() : I18n.format(this.solidifier.getInventoryName()); + String name = this.compressor.hasCustomInventoryName() ? this.compressor.getInventoryName() : I18n.format(this.compressor.getInventoryName()); this.fontRendererObj.drawString(name, 70 - this.fontRendererObj.getStringWidth(name) / 2, 6, 0xC7C1A3); this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); @@ -46,5 +67,17 @@ public class GUICompressor extends GuiInfoContainer { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + if(compressor.power >= 1_000) { + drawTexturedModalRect(guiLeft + 156, guiTop + 4, 176, 52, 9, 12); + } + + drawTexturedModalRect(guiLeft + 43 + compressor.tanks[0].getPressure() * 11, guiTop + 46, 193, 18, 8, 124); + + int i = compressor.progress * 55 / compressor.processTime; + drawTexturedModalRect(guiLeft + 42, guiTop + 26, 192, 0, i, 17); + + compressor.tanks[0].renderTank(guiLeft + 17, guiTop + 70, this.zLevel, 16, 52); + compressor.tanks[1].renderTank(guiLeft + 107, guiTop + 70, this.zLevel, 16, 52); } } diff --git a/src/main/java/com/hbm/inventory/recipes/CompressorRecipes.java b/src/main/java/com/hbm/inventory/recipes/CompressorRecipes.java index 15f5b2baa..2e22d2e8b 100644 --- a/src/main/java/com/hbm/inventory/recipes/CompressorRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CompressorRecipes.java @@ -2,11 +2,14 @@ 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; +import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.util.Tuple.Pair; @@ -16,7 +19,9 @@ public class CompressorRecipes extends SerializableRecipe { @Override public void registerDefaults() { - + recipes.put(new Pair(Fluids.STEAM, 0), new CompressorRecipe(1_000, new FluidStack(Fluids.HOTSTEAM, 100))); + recipes.put(new Pair(Fluids.HOTSTEAM, 0), new CompressorRecipe(1_000, new FluidStack(Fluids.SUPERHOTSTEAM, 100))); + recipes.put(new Pair(Fluids.SUPERHOTSTEAM, 0), new CompressorRecipe(1_000, new FluidStack(Fluids.ULTRAHOTSTEAM, 100))); } public static class CompressorRecipe { @@ -47,11 +52,21 @@ public class CompressorRecipes extends SerializableRecipe { @Override public void readRecipe(JsonElement recipe) { + JsonObject obj = recipe.getAsJsonObject(); + + FluidStack input = this.readFluidStack(obj.get("input").getAsJsonArray()); + FluidStack output = this.readFluidStack(obj.get("output").getAsJsonArray()); + recipes.put(new Pair(input.type, input.pressure), new CompressorRecipe(input.fill, output)); } @Override public void writeRecipe(Object recipe, JsonWriter writer) throws IOException { + Entry, CompressorRecipe> entry = (Entry) recipe; + writer.name("input"); + this.writeFluidStack(new FluidStack(entry.getKey().getKey(), entry.getValue().inputAmount, entry.getKey().getValue()), writer); + writer.name("output"); + this.writeFluidStack(entry.getValue().output, writer); } } diff --git a/src/main/java/com/hbm/inventory/recipes/OutgasserRecipes.java b/src/main/java/com/hbm/inventory/recipes/OutgasserRecipes.java index 1f1c72505..491a8595f 100644 --- a/src/main/java/com/hbm/inventory/recipes/OutgasserRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/OutgasserRecipes.java @@ -56,6 +56,8 @@ public class OutgasserRecipes extends SerializableRecipe { recipes.put(new OreDictStack(COAL.gem()), new Pair(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.COAL, 1), new FluidStack(Fluids.SYNGAS, 50))); recipes.put(new OreDictStack(COAL.dust()), new Pair(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.COAL, 1), new FluidStack(Fluids.SYNGAS, 50))); recipes.put(new OreDictStack(COAL.block()), new Pair(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.COAL, 9), new FluidStack(Fluids.SYNGAS, 500))); + + recipes.put(new OreDictStack(PVC.ingot()), new Pair(new ItemStack(ModItems.ingot_c4), new FluidStack(Fluids.COLLOID, 250))); recipes.put(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.COAL)), new Pair(null, new FluidStack(Fluids.COALOIL, 100))); recipes.put(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX)), new Pair(null, new FluidStack(Fluids.RADIOSOLVENT, 100))); diff --git a/src/main/java/com/hbm/inventory/recipes/loader/JSONLoaderBase.java b/src/main/java/com/hbm/inventory/recipes/loader/JSONLoaderBase.java deleted file mode 100644 index a2e8bc316..000000000 --- a/src/main/java/com/hbm/inventory/recipes/loader/JSONLoaderBase.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.hbm.inventory.recipes.loader; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; - -import com.google.gson.Gson; -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.main.MainRegistry; - -import net.minecraft.item.Item; -import net.minecraftforge.oredict.OreDictionary; - -@Deprecated -public abstract class JSONLoaderBase { - - public File config; - public File template; - private final Gson gson = new Gson(); - - public JSONLoaderBase() { - - } - - public void loadRecipes() { - registerDefaults(); - //saveTemplateJSON(template); - - if(config != null) { - loadJSONRecipes(); - } - } - - protected abstract void registerDefaults(); - - protected void loadJSONRecipes() { - - try { - JsonObject json = gson.fromJson(new FileReader(config), JsonObject.class); - JsonElement recipes = json.get("recipes"); - - if(recipes instanceof JsonArray) { - - JsonArray recArray = recipes.getAsJsonArray(); - for(JsonElement recipe : recArray) { - - if(recipe.isJsonObject()) { - - } - } - } - } catch (Exception e) { } - } - - protected static AStack aStackFromArray(JsonArray array) { - - boolean dict = false; - String item = ""; - int stacksize = 1; - int meta = 0; - - if(array.size() < 2) - return null; - - /* - * EVAL "dict" OR "item" - */ - if(array.get(0).isJsonPrimitive()) { - - if(array.get(0).getAsString().equals("item")) { - dict = false; - } else if(array.get(0).getAsString().equals("dict")) { - dict = true; - } else { - MainRegistry.logger.error("Error reading recipe, stack array does not have 'item' or 'dict' label!"); - return null; - } - - } else { - MainRegistry.logger.error("Error reading recipe, label is not a valid data type!"); - return null; - } - - /* - * EVAL NAME - */ - if(array.get(1).isJsonPrimitive()) { - item = array.get(1).getAsString(); - } else { - MainRegistry.logger.error("Error reading recipe, item string is not a valid data type!"); - return null; - } - - /* - * EVAL STACKSIZE - */ - if(array.size() > 2 && array.get(2).isJsonPrimitive()) { - if(array.get(2).getAsJsonPrimitive().isNumber()) { - stacksize = Math.max(1, array.get(2).getAsJsonPrimitive().getAsNumber().intValue()); - } else { - MainRegistry.logger.error("Error reading recipe, stack size is not a valid data type!"); - return null; - } - } - - /* - * RESOLVE OREDICT - */ - if(dict) { - - if(OreDictionary.doesOreNameExist(item)) { - return new OreDictStack(item, stacksize); - } else { - - MainRegistry.logger.error("Error reading recipe, ore dict name does not exist!"); - return null; - } - - /* - * RESOLVE COMPARABLE - */ - } else { - - /* - * EVAL META - */ - if(array.size() > 3 && array.get(3).isJsonPrimitive()) { - if(array.get(3).getAsJsonPrimitive().isNumber()) { - meta = Math.max(0, array.get(3).getAsJsonPrimitive().getAsNumber().intValue()); - } else { - MainRegistry.logger.error("Error reading recipe, metadata is not a valid data type!"); - return null; - } - } - - Item it = (Item)Item.itemRegistry.getObject(item); - if(it == null) { - MainRegistry.logger.error("Item could not be found!"); - return null; - } - - return new ComparableStack(it, stacksize, meta); - } - } - - protected static void writeAStack(AStack astack, JsonWriter writer) throws IOException { - - writer.beginArray(); - writer.setIndent(""); - - if(astack instanceof ComparableStack) { - ComparableStack comp = (ComparableStack) astack; - - writer.value("item"); //ITEM identifier - writer.value(Item.itemRegistry.getNameForObject(comp.toStack().getItem())); //item name - if(comp.stacksize != 1) writer.value(comp.stacksize); //stack size - if(comp.meta > 0) writer.value(comp.meta); //metadata - } - - if(astack instanceof OreDictStack) { - OreDictStack ore = (OreDictStack) astack; - - writer.value("dict"); //DICT identifier - writer.value(ore.name); //dict name - writer.value(ore.stacksize); //stacksize - } - - writer.endArray(); - writer.setIndent(" "); - } -} 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 92e378ef2..405cede7f 100644 --- a/src/main/java/com/hbm/inventory/recipes/loader/SerializableRecipe.java +++ b/src/main/java/com/hbm/inventory/recipes/loader/SerializableRecipe.java @@ -60,6 +60,7 @@ public abstract class SerializableRecipe { recipeHandlers.add(new FuelPoolRecipes()); recipeHandlers.add(new MixerRecipes()); recipeHandlers.add(new OutgasserRecipes()); + recipeHandlers.add(new CompressorRecipes()); recipeHandlers.add(new MatDistribution()); } @@ -266,7 +267,8 @@ public abstract class SerializableRecipe { try { FluidType type = Fluids.fromName(array.get(0).getAsString()); int fill = array.get(1).getAsInt(); - return new FluidStack(type, fill); + int pressure = array.size() < 3 ? 0 : array.get(2).getAsInt(); + return new FluidStack(type, fill, pressure); } catch(Exception ex) { } MainRegistry.logger.error("Error reading fluid array " + array.toString()); return new FluidStack(Fluids.NONE, 0); @@ -287,6 +289,7 @@ public abstract class SerializableRecipe { writer.setIndent(""); writer.value(stack.type.getName()); //fluid type writer.value(stack.fill); //amount in mB + if(stack.pressure != 0) writer.value(stack.pressure); writer.endArray(); writer.setIndent(" "); } diff --git a/src/main/java/com/hbm/items/tool/ItemBlowtorch.java b/src/main/java/com/hbm/items/tool/ItemBlowtorch.java index 172e0fa4a..211a203c6 100644 --- a/src/main/java/com/hbm/items/tool/ItemBlowtorch.java +++ b/src/main/java/com/hbm/items/tool/ItemBlowtorch.java @@ -137,7 +137,7 @@ public class ItemBlowtorch extends Item implements IFillableItem { if(!world.isRemote) { if(this == ModItems.blowtorch) { - this.setFill(stack, Fluids.GAS, this.getFill(stack, Fluids.GAS) - 1000); + this.setFill(stack, Fluids.GAS, this.getFill(stack, Fluids.GAS) - 250); } if(this == ModItems.acetylene_torch) { diff --git a/src/main/java/com/hbm/render/tileentity/RenderCompressor.java b/src/main/java/com/hbm/render/tileentity/RenderCompressor.java index 4c8eb0faa..6934ff5ac 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderCompressor.java +++ b/src/main/java/com/hbm/render/tileentity/RenderCompressor.java @@ -4,6 +4,7 @@ import org.lwjgl.opengl.GL11; import com.hbm.blocks.BlockDummyable; import com.hbm.main.ResourceManager; +import com.hbm.tileentity.machine.TileEntityMachineCompressor; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; @@ -28,18 +29,18 @@ public class RenderCompressor extends TileEntitySpecialRenderer { bindTexture(ResourceManager.compressor_tex); ResourceManager.compressor.renderPart("Compressor"); - double h = (System.currentTimeMillis() * 0.005) % 6D; - - if(h > 3) h = 6 - h; + TileEntityMachineCompressor compressor = (TileEntityMachineCompressor) tile; + float lift = compressor.prevPiston + (compressor.piston - compressor.prevPiston) * interp; + float fan = compressor.prevFanSpin + (compressor.fanSpin - compressor.prevFanSpin) * interp; GL11.glPushMatrix(); - GL11.glTranslated(0, h - 3, 0); + GL11.glTranslatef(0, lift * 3 - 3, 0); ResourceManager.compressor.renderPart("Pump"); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslated(0, 1.5, 0); - GL11.glRotated((System.currentTimeMillis() * -0.5) % 360, 1, 0, 0); + GL11.glRotatef(fan, 1, 0, 0); GL11.glTranslated(0, -1.5, 0); ResourceManager.compressor.renderPart("Fan"); GL11.glPopMatrix(); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java index 69c09f344..26c4210ef 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java @@ -1,21 +1,52 @@ package com.hbm.tileentity.machine; +import com.hbm.blocks.BlockDummyable; +import com.hbm.interfaces.IControlReceiver; import com.hbm.inventory.container.ContainerCompressor; +import com.hbm.inventory.fluid.Fluids; +import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.gui.GUICompressor; +import com.hbm.inventory.recipes.CompressorRecipes; +import com.hbm.inventory.recipes.CompressorRecipes.CompressorRecipe; +import com.hbm.lib.Library; import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.TileEntityMachineBase; +import com.hbm.util.Tuple.Pair; +import com.hbm.util.fauxpointtwelve.DirPos; +import api.hbm.energy.IEnergyUser; +import api.hbm.fluid.IFluidStandardTransceiver; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityMachineCompressor extends TileEntityMachineBase implements IGUIProvider { +public class TileEntityMachineCompressor extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, IEnergyUser, IFluidStandardTransceiver { + + public FluidTank[] tanks; + public long power; + public static final long maxPower = 1_000_000; + public boolean isOn; + public int progress; + public int processTime = 100; + + public float fanSpin; + public float prevFanSpin; + public float piston; + public float prevPiston; + public boolean pistonDir; public TileEntityMachineCompressor() { super(2); + this.tanks = new FluidTank[2]; + this.tanks[0] = new FluidTank(Fluids.NONE, 16_000); + this.tanks[1] = new FluidTank(Fluids.NONE, 16_000).withPressure(1); } @Override @@ -28,8 +59,148 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement if(!worldObj.isRemote) { + if(worldObj.getTotalWorldTime() % 20 == 0) { + this.updateConnections(); + } + + this.power = Library.chargeTEFromItems(slots, 1, power, maxPower); + this.tanks[0].setType(0, slots); + this.setupTanks(); + + if(canProcess()) { + this.progress++; + this.isOn = true; + this.power -= 1_000; + + if(progress >= this.processTime) { + progress = 0; + this.process(); + this.markChanged(); + } + + } else { + this.progress = 0; + this.isOn = false; + } + + for(DirPos pos : getConPos()) { + this.sendFluid(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); + } + + NBTTagCompound data = new NBTTagCompound(); + data.setInteger("progress", progress); + data.setLong("power", power); + tanks[0].writeToNBT(data, "0"); + tanks[1].writeToNBT(data, "1"); + data.setBoolean("isOn", isOn); + this.networkPack(data, 100); + + } else { + + this.prevFanSpin = this.fanSpin; + this.prevPiston = this.piston; + + if(this.isOn) { + this.fanSpin += 15; + + if(this.fanSpin >= 360) { + this.prevFanSpin -= 360; + this.fanSpin -= 360; + } + + if(this.pistonDir) { + this.piston -= 0.1F; + if(this.piston <= 0) this.pistonDir = !this.pistonDir; + } else { + this.piston += 0.05F; + if(this.piston >= 1) this.pistonDir = !this.pistonDir; + } + + this.piston = MathHelper.clamp_float(this.piston, 0F, 1F); + } } } + + public void networkUnpack(NBTTagCompound nbt) { + this.progress = nbt.getInteger("progress"); + this.power = nbt.getLong("power"); + tanks[0].readFromNBT(nbt, "0"); + tanks[1].readFromNBT(nbt, "1"); + this.isOn = nbt.getBoolean("isOn"); + } + + private void updateConnections() { + for(DirPos pos : getConPos()) { + this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); + this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); + } + } + + public DirPos[] getConPos() { + ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset); + ForgeDirection rot = dir.getRotation(ForgeDirection.UP); + + return new DirPos[] { + new DirPos(xCoord + rot.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2, rot), + new DirPos(xCoord - rot.offsetX * 2, yCoord, zCoord - rot.offsetZ * 2, rot.getOpposite()), + new DirPos(xCoord + dir.offsetX * 2, yCoord, zCoord + dir.offsetZ * 2, dir), + }; + } + + public boolean canProcess() { + + if(this.power <= 1_000) return false; + + CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure())); + + if(recipe == null) { + return tanks[0].getFill() >= 1000 && tanks[1].getFill() + 1000 <= tanks[1].getMaxFill(); + } + + return tanks[0].getFill() > recipe.inputAmount && tanks[1].getFill() + recipe.output.fill <= tanks[1].getMaxFill(); + } + + public void process() { + + CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure())); + + if(recipe == null) { + tanks[0].setFill(tanks[0].getFill() - 1_000); + tanks[1].setFill(tanks[1].getFill() + 1_000); + } else { + tanks[0].setFill(tanks[0].getFill() - recipe.inputAmount); + tanks[1].setFill(tanks[1].getFill() + recipe.output.fill); + } + } + + protected void setupTanks() { + + CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure())); + + if(recipe == null) { + tanks[1].withPressure(tanks[0].getPressure() + 1).setTankType(tanks[0].getTankType()); + } else { + tanks[1].withPressure(recipe.output.pressure).setTankType(recipe.output.type); + } + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + power = nbt.getLong("power"); + progress = nbt.getInteger("progress"); + tanks[0].readFromNBT(nbt, "0"); + tanks[1].readFromNBT(nbt, "1"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setLong("power", power); + nbt.setInteger("progress", progress); + tanks[0].writeToNBT(nbt, "0"); + tanks[1].writeToNBT(nbt, "1"); + } @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { @@ -42,4 +213,82 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement return new GUICompressor(player.inventory, this); } + @Override + public boolean hasPermission(EntityPlayer player) { + return this.isUseableByPlayer(player); + } + + @Override + public void receiveControl(NBTTagCompound data) { + int compression = data.getInteger("compression"); + + if(compression != tanks[0].getPressure()) { + tanks[0].withPressure(compression); + + CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), compression)); + + if(recipe == null) { + tanks[1].withPressure(compression + 1); + } else { + tanks[1].withPressure(recipe.output.pressure).setTankType(recipe.output.type); + } + + this.markChanged(); + } + } + + @Override + public long getPower() { + return power; + } + + @Override + public void setPower(long power) { + this.power = power; + } + + @Override + public long getMaxPower() { + return maxPower; + } + + @Override + public FluidTank[] getAllTanks() { + return tanks; + } + + @Override + public FluidTank[] getSendingTanks() { + return new FluidTank[] {tanks[1]}; + } + + @Override + public FluidTank[] getReceivingTanks() { + return new FluidTank[] {tanks[0]}; + } + + AxisAlignedBB bb = null; + + @Override + public AxisAlignedBB getRenderBoundingBox() { + + if(bb == null) { + bb = AxisAlignedBB.getBoundingBox( + xCoord - 2, + yCoord, + zCoord - 2, + xCoord + 3, + yCoord + 9, + zCoord + 3 + ); + } + + return bb; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } } diff --git a/src/main/resources/assets/hbm/textures/models/machines/compressor.png b/src/main/resources/assets/hbm/textures/models/machines/compressor.png index af84d82fd7c4a0ac20022cb0fedf303b0dfd56a2..2b26f107a5bf031ba598fe512912382c560c174b 100644 GIT binary patch literal 5337 zcmYjVc_36@`@alh-%?D7AxoqX3NZ#_E7=v_>`QjC#h|f_GFh@mWhwhoBa)DVInO!w^L)iuh0;6X0N{M0E=tWbD04ll!dtlYT(tYOht8M8M!IjKMRFjw zn=1^2lmus{X`^Uhf>yKht&TLphsKd&+X4!LHwG_9GF?gvcht^|Qm_;JRCN^_XmHR! zar?#7h~)qS&j16${+|EA+GdJmh;!kiu7-)>VY3O9OVn_011o5>RZ)?uSmAu z2PCgkFgZsQjE8*qvxPCnjIoJ{tPdYQ_KMu*iC`Rsg0>9{PTS z|Ig<5h>d&AhWQX?8kh6Khqc^xO02VyFd7${hMCpuNJp5h@E{eGTCUAjnmwAME~$A- z=vp$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!{mOlI^K{S+8jPC9()X@ zHkak$e-7qQBOvo!C&WB}_p40=iM(qe6*3bKOTeo|m-Do@n(~yHWCm@swdS`~hr<0q z6K>6#0EHt}{C}*ppKjnYY(hZtS{AsTQ#}7sbH|Z#?O`WACtS_Fou}th82Xm02ka*d z%9f>Qpv*g+KhpvrhQBy;lRpnh8A$?9zlJF4B%Yb9SC)vF$ifWLStAbsN@CG=eybxg isojRH$FPcreEpmKcMACZtGRzx05f9?+)G2(g#Q5KuX?rs From ff4b231be28ffd862b7123c96bbe50b3c5b0003e Mon Sep 17 00:00:00 2001 From: Bob Date: Thu, 22 Jun 2023 21:02:19 +0200 Subject: [PATCH 2/7] more compressor stuff --- .../container/ContainerCompressor.java | 11 ++-- .../com/hbm/inventory/gui/GUICompressor.java | 5 +- .../render/tileentity/RenderCompressor.java | 48 +++++++++++++++++- .../machine/TileEntityMachineCompressor.java | 44 +++++++++++++--- .../oil/TileEntityMachineVacuumDistill.java | 2 +- .../gui/processing/gui_compressor.png | Bin 3119 -> 3380 bytes 6 files changed, 98 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/hbm/inventory/container/ContainerCompressor.java b/src/main/java/com/hbm/inventory/container/ContainerCompressor.java index e54aee2d3..3f81b4f68 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerCompressor.java +++ b/src/main/java/com/hbm/inventory/container/ContainerCompressor.java @@ -21,6 +21,9 @@ public class ContainerCompressor extends Container { this.addSlotToContainer(new Slot(tile, 0, 17, 72)); //Battery this.addSlotToContainer(new Slot(tile, 1, 152, 72)); + //Upgrades + this.addSlotToContainer(new Slot(tile, 2, 52, 72)); + this.addSlotToContainer(new Slot(tile, 3, 70, 72)); for(int i = 0; i < 3; i++) { for(int j = 0; j < 9; j++) { @@ -47,8 +50,8 @@ public class ContainerCompressor extends Container { ItemStack var5 = var4.getStack(); var3 = var5.copy(); - if(index < 2) { - if(!this.mergeItemStack(var5, 2, this.inventorySlots.size(), true)) { + if(index < 4) { + if(!this.mergeItemStack(var5, 4, this.inventorySlots.size(), true)) { return null; } } else { @@ -62,7 +65,9 @@ public class ContainerCompressor extends Container { return null; } } else { - return null; + if(!this.mergeItemStack(var5, 2, 4, false)) { + return null; + } } } diff --git a/src/main/java/com/hbm/inventory/gui/GUICompressor.java b/src/main/java/com/hbm/inventory/gui/GUICompressor.java index 9e2f758e8..69c8dc0ac 100644 --- a/src/main/java/com/hbm/inventory/gui/GUICompressor.java +++ b/src/main/java/com/hbm/inventory/gui/GUICompressor.java @@ -68,7 +68,7 @@ public class GUICompressor extends GuiInfoContainer { Minecraft.getMinecraft().getTextureManager().bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - if(compressor.power >= 1_000) { + if(compressor.power >= compressor.powerRequirement) { drawTexturedModalRect(guiLeft + 156, guiTop + 4, 176, 52, 9, 12); } @@ -77,6 +77,9 @@ public class GUICompressor extends GuiInfoContainer { int i = compressor.progress * 55 / compressor.processTime; drawTexturedModalRect(guiLeft + 42, guiTop + 26, 192, 0, i, 17); + int j = (int) (compressor.power * 52 / compressor.maxPower); + drawTexturedModalRect(guiLeft + 152, guiTop + 70 - j, 176, 52 - j, 16, j); + compressor.tanks[0].renderTank(guiLeft + 17, guiTop + 70, this.zLevel, 16, 52); compressor.tanks[1].renderTank(guiLeft + 107, guiTop + 70, this.zLevel, 16, 52); } diff --git a/src/main/java/com/hbm/render/tileentity/RenderCompressor.java b/src/main/java/com/hbm/render/tileentity/RenderCompressor.java index 6934ff5ac..13e9d2c64 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderCompressor.java +++ b/src/main/java/com/hbm/render/tileentity/RenderCompressor.java @@ -3,13 +3,17 @@ package com.hbm.render.tileentity; import org.lwjgl.opengl.GL11; import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.ModBlocks; import com.hbm.main.ResourceManager; +import com.hbm.render.item.ItemRenderBase; import com.hbm.tileentity.machine.TileEntityMachineCompressor; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.client.IItemRenderer; -public class RenderCompressor extends TileEntitySpecialRenderer { +public class RenderCompressor extends TileEntitySpecialRenderer implements IItemRendererProvider { @Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) { @@ -50,4 +54,46 @@ public class RenderCompressor extends TileEntitySpecialRenderer { GL11.glPopMatrix(); } + + @Override + public Item getItemForRenderer() { + return Item.getItemFromBlock(ModBlocks.machine_compressor); + } + + @Override + public IItemRenderer getRenderer() { + return new ItemRenderBase() { + public void renderInventory() { + GL11.glTranslated(0, -4, 0); + GL11.glScaled(3, 3, 3); + } + public void renderCommon() { + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glShadeModel(GL11.GL_SMOOTH); + + GL11.glScaled(0.5, 0.5, 0.5); + + bindTexture(ResourceManager.compressor_tex); + ResourceManager.compressor.renderPart("Compressor"); + + double lift = (System.currentTimeMillis() * 0.005) % 9; + + if(lift > 3) lift = 3 - (lift - 3) / 2D; + + GL11.glPushMatrix(); + GL11.glTranslated(0, -lift, 0); + ResourceManager.compressor.renderPart("Pump"); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glTranslated(0, 1.5, 0); + GL11.glRotated((System.currentTimeMillis() * 0.25) % 360D, 1, 0, 0); + GL11.glTranslated(0, -1.5, 0); + ResourceManager.compressor.renderPart("Fan"); + GL11.glPopMatrix(); + + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glEnable(GL11.GL_CULL_FACE); + }}; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java index 26c4210ef..285c36a20 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCompressor.java @@ -2,12 +2,14 @@ package com.hbm.tileentity.machine; import com.hbm.blocks.BlockDummyable; import com.hbm.interfaces.IControlReceiver; +import com.hbm.inventory.UpgradeManager; import com.hbm.inventory.container.ContainerCompressor; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.gui.GUICompressor; import com.hbm.inventory.recipes.CompressorRecipes; import com.hbm.inventory.recipes.CompressorRecipes.CompressorRecipe; +import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType; import com.hbm.lib.Library; import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.TileEntityMachineBase; @@ -18,12 +20,15 @@ import api.hbm.energy.IEnergyUser; import api.hbm.fluid.IFluidStandardTransceiver; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -35,6 +40,9 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement public boolean isOn; public int progress; public int processTime = 100; + public static final int processTimeBase = 100; + public int powerRequirement; + public static final int powerRequirementBase = 10_000; public float fanSpin; public float prevFanSpin; @@ -43,7 +51,7 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement public boolean pistonDir; public TileEntityMachineCompressor() { - super(2); + super(4); this.tanks = new FluidTank[2]; this.tanks[0] = new FluidTank(Fluids.NONE, 16_000); this.tanks[1] = new FluidTank(Fluids.NONE, 16_000).withPressure(1); @@ -67,10 +75,22 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement this.tanks[0].setType(0, slots); this.setupTanks(); + UpgradeManager.eval(slots, 1, 3); + + int speedLevel = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3); + int powerLevel = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3); + int overLevel = UpgradeManager.getLevel(UpgradeType.OVERDRIVE); + + //there is a reason to do this but i'm not telling you + this.processTime = speedLevel == 3 ? 10 : speedLevel == 2 ? 20 : speedLevel == 1 ? 60 : this.processTimeBase; + this.powerRequirement = this.powerRequirementBase / (powerLevel + 1); + this.processTime = this.processTime / (overLevel + 1); + this.powerRequirement = this.powerRequirement * ((overLevel * 2) + 1); + if(canProcess()) { this.progress++; this.isOn = true; - this.power -= 1_000; + this.power -= powerRequirement; if(progress >= this.processTime) { progress = 0; @@ -89,6 +109,8 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement NBTTagCompound data = new NBTTagCompound(); data.setInteger("progress", progress); + data.setInteger("processTime", processTime); + data.setInteger("powerRequirement", powerRequirement); data.setLong("power", power); tanks[0].writeToNBT(data, "0"); tanks[1].writeToNBT(data, "1"); @@ -109,11 +131,17 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement } if(this.pistonDir) { - this.piston -= 0.1F; - if(this.piston <= 0) this.pistonDir = !this.pistonDir; + this.piston -= randSpeed; + if(this.piston <= 0) { + Minecraft.getMinecraft().getSoundHandler().playSound(new PositionedSoundRecord(new ResourceLocation("hbm:item.boltgun"), 0.5F, 0.75F, xCoord, yCoord, zCoord)); + this.pistonDir = !this.pistonDir; + } } else { this.piston += 0.05F; - if(this.piston >= 1) this.pistonDir = !this.pistonDir; + if(this.piston >= 1) { + this.randSpeed = 0.085F + worldObj.rand.nextFloat() * 0.03F; + this.pistonDir = !this.pistonDir; + } } this.piston = MathHelper.clamp_float(this.piston, 0F, 1F); @@ -121,8 +149,12 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement } } + private float randSpeed = 0.1F; + public void networkUnpack(NBTTagCompound nbt) { this.progress = nbt.getInteger("progress"); + this.processTime = nbt.getInteger("processTime"); + this.powerRequirement = nbt.getInteger("powerRequirement"); this.power = nbt.getLong("power"); tanks[0].readFromNBT(nbt, "0"); tanks[1].readFromNBT(nbt, "1"); @@ -149,7 +181,7 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement public boolean canProcess() { - if(this.power <= 1_000) return false; + if(this.power <= powerRequirement) return false; CompressorRecipe recipe = CompressorRecipes.recipes.get(new Pair(tanks[0].getTankType(), tanks[0].getPressure())); diff --git a/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineVacuumDistill.java b/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineVacuumDistill.java index bc2ba6469..9fc45de36 100644 --- a/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineVacuumDistill.java +++ b/src/main/java/com/hbm/tileentity/machine/oil/TileEntityMachineVacuumDistill.java @@ -41,7 +41,7 @@ public class TileEntityMachineVacuumDistill extends TileEntityMachineBase implem super(11); this.tanks = new FluidTank[5]; - this.tanks[0] = new FluidTank(Fluids.OIL, 64_000); + this.tanks[0] = new FluidTank(Fluids.OIL, 64_000).withPressure(2); this.tanks[1] = new FluidTank(Fluids.HEAVYOIL_VACUUM, 24_000); this.tanks[2] = new FluidTank(Fluids.REFORMATE, 24_000); this.tanks[3] = new FluidTank(Fluids.LIGHTOIL_VACUUM, 24_000); diff --git a/src/main/resources/assets/hbm/textures/gui/processing/gui_compressor.png b/src/main/resources/assets/hbm/textures/gui/processing/gui_compressor.png index e5b80132b0bfac3f4073c92b22d4609e1b36a4a7..0a0179680513cf023dac7cf84eb54e87be55e1ea 100644 GIT binary patch literal 3380 zcmb_edpy(q7yry`mRwqqT!!eOD>ccJ>k3g+OQK1vvLzao`=xF2RJw?wG^@}BxfLpx z%%zJ<3*6Qx2nX!}lAgmgtCeBuC57~W~O%{BbaC~MP6l`i$_ zi9lpZT!7OarorUSef3-Li%;yXvEOxC*J=1wa&WRr;UB@7R2jV^skhJRA%l~Lzqpxi zOHv6Ksr`ef%GxI-tzA(Xz<#;92HU7C+6iHkm726Cvp9Ihdx+9jGxz)8`FSjC0hJS@T6hdmvQ3 zO2VZ~Q=kdm>+{09=-LP_Bt{q(*p%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ndOke)`@(-}2Uge*N6 zw9P6zX?Zf;3__l2?DIP=0~*v}HLDXopA1)`TRt5!xJ0Pz z&nzrdKOB2SA9`ELnl$Ol?&Y7u1G)UtwFwa`S?ZP=wRzB-|&B%oR0LJ5@Q)u5;?Ei2ER0ZuS?%?zo? zDZdHo3|F5k-J?k?x2`mTNS?p^#-yp-oOj_H+$UJDtN6n@Uykdu(sPN6;rBqd(mm}9 z11D)h*u`=UV!4&hf$Q=*Kt2Bwp*C|-ynXLf32Mr43)&Zwf1kkdE11WVFNVx^TuQuR+ z%sZBv4nVJQP($L(Oz2)?;{v6@?ZdPOhjUVg4%9s$Z)|9646RKZ9`^iU+Zg@mMbq}b z75lHQe$IlO4GVkAW>?Hx2PWY^J|5tbX1$rMVmBIO!O3#{7u(jjyrsZOcjsIlW%z8D+PwH-n z>Li!{Fu&ueSX(KzcKo2})X~J#5@qln2!<00|KC1;GyNaMbCG8K&nw}q>p1W@f#StV16EF;R$Yl&lHCYW3OPc5_S!$N c>GT$emih-j-?Tm6^?Nv5D+kL83-8PS1{QpNxc~qF From bb15f500473149e9c0680a2b0550ee4da4cdb83b Mon Sep 17 00:00:00 2001 From: Boblet Date: Fri, 23 Jun 2023 11:17:37 +0200 Subject: [PATCH 3/7] pressure requirement for recipes --- changelog | 2 ++ .../handler/nei/ChemplantRecipeHandler.java | 4 +-- .../hbm/inventory/fluid/tank/FluidTank.java | 2 +- .../inventory/recipes/ChemplantRecipes.java | 4 +-- .../inventory/recipes/RefineryRecipes.java | 2 +- .../items/machine/ItemChemistryTemplate.java | 6 ++-- .../com/hbm/items/machine/ItemFluidIcon.java | 33 ++++++++++++------- .../machine/TileEntityMachineChemplant.java | 8 ++--- .../TileEntityMachineChemplantBase.java | 8 ++--- 9 files changed, 41 insertions(+), 28 deletions(-) diff --git a/changelog b/changelog index 7e7de1c66..d82ff17a6 100644 --- a/changelog +++ b/changelog @@ -10,6 +10,8 @@ * Compressor * Can compress fluids, turning them into higher pressure variants * Can also turn steam into higher pressure types + * Vacuum refning now requires oil at 2 PU + * Some chemical plant recipes also require compressed fluid, TATB requires sour gas at 1 PU and osmiridic solution requires hydrogen peroxide at 5 PU * A new rocket artillery ammo type that creates volcanic lava on impact * BDCL * A type of lubricant that is easy to make and can be used in hydraulic piston and electric press recipes instead of regular lubricant diff --git a/src/main/java/com/hbm/handler/nei/ChemplantRecipeHandler.java b/src/main/java/com/hbm/handler/nei/ChemplantRecipeHandler.java index 0beaff581..9ef27b9a9 100644 --- a/src/main/java/com/hbm/handler/nei/ChemplantRecipeHandler.java +++ b/src/main/java/com/hbm/handler/nei/ChemplantRecipeHandler.java @@ -45,7 +45,7 @@ public class ChemplantRecipeHandler extends TemplateRecipeHandler { for(int i = 0; i < recipe.inputFluids.length; i++) { FluidStack in = recipe.inputFluids[i]; if(in == null) continue; - ItemStack drop = ItemFluidIcon.make(in.type, in.fill); + ItemStack drop = ItemFluidIcon.make(in); this.fluidIn[i] = new PositionedStack(drop, 30 + (i % 2) * 18, 6); } @@ -58,7 +58,7 @@ public class ChemplantRecipeHandler extends TemplateRecipeHandler { for(int i = 0; i < recipe.outputFluids.length; i++) { FluidStack out = recipe.outputFluids[i]; if(out == null) continue; - ItemStack drop = ItemFluidIcon.make(out.type, out.fill); + ItemStack drop = ItemFluidIcon.make(out); this.fluidOut[i] = new PositionedStack(drop, 120 + (i % 2) * 18, 6); } diff --git a/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java b/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java index c9e94b9ee..bd1561bc3 100644 --- a/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java +++ b/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java @@ -241,7 +241,7 @@ public class FluidTank { list.add(fluid + "/" + maxFluid + "mB"); if(this.pressure != 0) { - list.add(EnumChatFormatting.RED + "" + this.pressure + " PU"); + list.add(EnumChatFormatting.RED + "Pressure: " + this.pressure + " PU"); } type.addInfo(list); diff --git a/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java b/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java index 248073743..f32038c47 100644 --- a/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java @@ -147,7 +147,7 @@ public class ChemplantRecipes extends SerializableRecipe { .outputItems(new ItemStack(ModItems.ball_tnt, 4))); recipes.add(new ChemRecipe(95, "TATB", 50) .inputItems(new ComparableStack(ModItems.ball_tnt)) - .inputFluids(new FluidStack(Fluids.SOURGAS, 200), new FluidStack(Fluids.NITRIC_ACID, 10)) + .inputFluids(new FluidStack(Fluids.SOURGAS, 200, 1), new FluidStack(Fluids.NITRIC_ACID, 10)) .outputItems(new ItemStack(ModItems.ball_tatb))); recipes.add(new ChemRecipe(84, "C4", 150) .inputItems(new OreDictStack(KNO.dust())) @@ -352,7 +352,7 @@ public class ChemplantRecipes extends SerializableRecipe { new ComparableStack(ModItems.powder_paleogenite), new OreDictStack(F.dust(), 8), new ComparableStack(ModItems.nugget_bismuth, 4)) - .inputFluids(new FluidStack(Fluids.ACID, 1000)) + .inputFluids(new FluidStack(Fluids.ACID, 1000, 5)) .outputFluids(new FluidStack(Fluids.DEATH, 1000))); //one bucket of ethanol equals 275_000 TU using the diesel baseline0 //the coal baseline is 400_000 per piece diff --git a/src/main/java/com/hbm/inventory/recipes/RefineryRecipes.java b/src/main/java/com/hbm/inventory/recipes/RefineryRecipes.java index 314e50d56..427f4a329 100644 --- a/src/main/java/com/hbm/inventory/recipes/RefineryRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/RefineryRecipes.java @@ -58,7 +58,7 @@ public class RefineryRecipes { public static HashMap getVacuumRecipe() { HashMap recipes = new HashMap(); - recipes.put(ItemFluidIcon.make(Fluids.OIL, 1000), + recipes.put(ItemFluidIcon.make(Fluids.OIL, 1000, 2), new ItemStack[] { ItemFluidIcon.make(Fluids.HEAVYOIL_VACUUM, vac_frac_heavy * 10), ItemFluidIcon.make(Fluids.REFORMATE, vac_frac_reform * 10), diff --git a/src/main/java/com/hbm/items/machine/ItemChemistryTemplate.java b/src/main/java/com/hbm/items/machine/ItemChemistryTemplate.java index 12ad0569e..432141d9d 100644 --- a/src/main/java/com/hbm/items/machine/ItemChemistryTemplate.java +++ b/src/main/java/com/hbm/items/machine/ItemChemistryTemplate.java @@ -75,7 +75,8 @@ public class ItemChemistryTemplate extends Item { for(int i = 0; i < 2; i++) { if(recipe.outputFluids[i] != null) { - list.add(recipe.outputFluids[i].fill + "mB " + I18n.format(recipe.outputFluids[i].type.getUnlocalizedName())); + int p = recipe.outputFluids[i].pressure; + list.add(recipe.outputFluids[i].fill + "mB " + I18n.format(recipe.outputFluids[i].type.getUnlocalizedName()) + (p != 0 ? (" at " + p + "PU") : "")); } } @@ -89,7 +90,8 @@ public class ItemChemistryTemplate extends Item { for(int i = 0; i < 2; i++) { if(recipe.inputFluids[i] != null) { - list.add(recipe.inputFluids[i].fill + "mB " + I18n.format(recipe.inputFluids[i].type.getUnlocalizedName())); + int p = recipe.inputFluids[i].pressure; + list.add(recipe.inputFluids[i].fill + "mB " + I18n.format(recipe.inputFluids[i].type.getUnlocalizedName()) + (p != 0 ? (" at " + p + "PU") : "")); } } diff --git a/src/main/java/com/hbm/items/machine/ItemFluidIcon.java b/src/main/java/com/hbm/items/machine/ItemFluidIcon.java index f15d2ad05..1e121dd96 100644 --- a/src/main/java/com/hbm/items/machine/ItemFluidIcon.java +++ b/src/main/java/com/hbm/items/machine/ItemFluidIcon.java @@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; @@ -38,39 +39,47 @@ public class ItemFluidIcon extends Item { @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { if(stack.hasTagCompound()) { - if(stack.getTagCompound().getInteger("fill") > 0) - list.add(stack.getTagCompound().getInteger("fill") + "mB"); + if(getQuantity(stack) > 0) list.add(getQuantity(stack) + "mB"); + if(getPressure(stack) > 0) list.add(EnumChatFormatting.RED + "" + getPressure(stack) + "PU"); } Fluids.fromID(stack.getItemDamage()).addInfo(list); } public static ItemStack addQuantity(ItemStack stack, int i) { - - if(!stack.hasTagCompound()) - stack.stackTagCompound = new NBTTagCompound(); - + if(!stack.hasTagCompound()) stack.stackTagCompound = new NBTTagCompound(); stack.getTagCompound().setInteger("fill", i); + return stack; + } + public static ItemStack addPressure(ItemStack stack, int i) { + if(!stack.hasTagCompound()) stack.stackTagCompound = new NBTTagCompound(); + stack.getTagCompound().setInteger("pressure", i); return stack; } public static ItemStack make(FluidStack stack) { - return make(stack.type, stack.fill); + return make(stack.type, stack.fill, stack.pressure); } public static ItemStack make(FluidType fluid, int i) { - return addQuantity(new ItemStack(ModItems.fluid_icon, 1, fluid.ordinal()), i); + return make(fluid, i, 0); + } + + public static ItemStack make(FluidType fluid, int i, int pressure) { + return addPressure(addQuantity(new ItemStack(ModItems.fluid_icon, 1, fluid.ordinal()), i), pressure); } public static int getQuantity(ItemStack stack) { - - if(!stack.hasTagCompound()) - return 0; - + if(!stack.hasTagCompound()) return 0; return stack.getTagCompound().getInteger("fill"); } + public static int getPressure(ItemStack stack) { + if(!stack.hasTagCompound()) return 0; + return stack.getTagCompound().getInteger("pressure"); + } + @Override public String getItemStackDisplayName(ItemStack stack) { String s = (StatCollector.translateToLocal(Fluids.fromID(stack.getItemDamage()).getUnlocalizedName())).trim(); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java index 9aea57727..8055c8d11 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplant.java @@ -266,10 +266,10 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements } private void setupTanks(ChemRecipe recipe) { - if(recipe.inputFluids[0] != null) tanks[0].setTankType(recipe.inputFluids[0].type); else tanks[0].setTankType(Fluids.NONE); - if(recipe.inputFluids[1] != null) tanks[1].setTankType(recipe.inputFluids[1].type); else tanks[1].setTankType(Fluids.NONE); - if(recipe.outputFluids[0] != null) tanks[2].setTankType(recipe.outputFluids[0].type); else tanks[2].setTankType(Fluids.NONE); - if(recipe.outputFluids[1] != null) tanks[3].setTankType(recipe.outputFluids[1].type); else tanks[3].setTankType(Fluids.NONE); + if(recipe.inputFluids[0] != null) tanks[0].withPressure(recipe.inputFluids[0].pressure).setTankType(recipe.inputFluids[0].type); else tanks[0].setTankType(Fluids.NONE); + if(recipe.inputFluids[1] != null) tanks[1].withPressure(recipe.inputFluids[1].pressure).setTankType(recipe.inputFluids[1].type); else tanks[1].setTankType(Fluids.NONE); + if(recipe.outputFluids[0] != null) tanks[2].withPressure(recipe.outputFluids[0].pressure).setTankType(recipe.outputFluids[0].type); else tanks[2].setTankType(Fluids.NONE); + if(recipe.outputFluids[1] != null) tanks[3].withPressure(recipe.outputFluids[1].pressure).setTankType(recipe.outputFluids[1].type); else tanks[3].setTankType(Fluids.NONE); } private boolean hasRequiredFluids(ChemRecipe recipe) { diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplantBase.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplantBase.java index 6d2501a7e..6d6caf6e2 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplantBase.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemplantBase.java @@ -109,10 +109,10 @@ public abstract class TileEntityMachineChemplantBase extends TileEntityMachineBa } private void setupTanks(ChemRecipe recipe, int index) { - if(recipe.inputFluids[0] != null) tanks[index * 4].setTankType(recipe.inputFluids[0].type); - if(recipe.inputFluids[1] != null) tanks[index * 4 + 1].setTankType(recipe.inputFluids[1].type); - if(recipe.outputFluids[0] != null) tanks[index * 4 + 2].setTankType(recipe.outputFluids[0].type); - if(recipe.outputFluids[1] != null) tanks[index * 4 + 3].setTankType(recipe.outputFluids[1].type); + if(recipe.inputFluids[0] != null) tanks[index * 4].withPressure(recipe.inputFluids[0].pressure).setTankType(recipe.inputFluids[0].type); else tanks[index * 4].setTankType(Fluids.NONE); + if(recipe.inputFluids[1] != null) tanks[index * 4 + 1].withPressure(recipe.inputFluids[1].pressure).setTankType(recipe.inputFluids[1].type); else tanks[index * 4 + 1].setTankType(Fluids.NONE); + if(recipe.outputFluids[0] != null) tanks[index * 4 + 2].withPressure(recipe.outputFluids[0].pressure).setTankType(recipe.outputFluids[0].type); else tanks[index * 4 + 2].setTankType(Fluids.NONE); + if(recipe.outputFluids[1] != null) tanks[index * 4 + 3].withPressure(recipe.outputFluids[1].pressure).setTankType(recipe.outputFluids[1].type); else tanks[index * 4 + 3].setTankType(Fluids.NONE); } private boolean hasRequiredFluids(ChemRecipe recipe, int index) { From 00360a4586f63f16f455dc06a36ee49cb24fd843 Mon Sep 17 00:00:00 2001 From: Bob Date: Fri, 23 Jun 2023 23:06:44 +0200 Subject: [PATCH 4/7] memepackhunters.xxx --- .../blocks/generic/BlockGlyphidSpawner.java | 14 ++++++---- .../com/hbm/inventory/gui/GUICompressor.java | 2 ++ .../inventory/recipes/AssemblerRecipes.java | 8 ++++++ .../inventory/recipes/ChemplantRecipes.java | 26 +++++++++---------- .../com/hbm/items/special/ItemTeleLink.java | 2 +- .../com/hbm/main/ModEventHandlerClient.java | 2 +- src/main/resources/assets/hbm/lang/de_DE.lang | 2 ++ src/main/resources/assets/hbm/lang/en_US.lang | 2 ++ 8 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/hbm/blocks/generic/BlockGlyphidSpawner.java b/src/main/java/com/hbm/blocks/generic/BlockGlyphidSpawner.java index a489018f1..7e9d805f5 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockGlyphidSpawner.java +++ b/src/main/java/com/hbm/blocks/generic/BlockGlyphidSpawner.java @@ -4,9 +4,12 @@ import java.util.List; import java.util.Random; import com.hbm.entity.mob.EntityGlyphid; +import com.hbm.entity.mob.EntityGlyphidBehemoth; import com.hbm.entity.mob.EntityGlyphidBlaster; import com.hbm.entity.mob.EntityGlyphidBombardier; import com.hbm.entity.mob.EntityGlyphidBrawler; +import com.hbm.entity.mob.EntityGlyphidBrenda; +import com.hbm.entity.mob.EntityGlyphidNuclear; import com.hbm.entity.mob.EntityGlyphidScout; import com.hbm.handler.pollution.PollutionHandler; import com.hbm.handler.pollution.PollutionHandler.PollutionType; @@ -56,12 +59,13 @@ public class BlockGlyphidSpawner extends BlockContainer { public EntityGlyphid createGlyphid(float soot) { Random rand = new Random(); + + if(soot < 1) return rand.nextInt(5) == 0 ? new EntityGlyphidBombardier(worldObj) : new EntityGlyphid(worldObj); + if(soot < 10) return rand.nextInt(5) == 0 ? new EntityGlyphidBombardier(worldObj) : new EntityGlyphidBrawler(worldObj); + if(soot < 50) return rand.nextInt(5) == 0 ? new EntityGlyphidBlaster(worldObj) : new EntityGlyphidBehemoth(worldObj); + if(soot < 100) return rand.nextInt(5) == 0 ? new EntityGlyphidBlaster(worldObj) : new EntityGlyphidBrenda(worldObj); - if(soot < 1) { - return rand.nextInt(5) == 0 ? new EntityGlyphidBombardier(worldObj) : new EntityGlyphid(worldObj); - } - - return rand.nextInt(5) == 0 ? new EntityGlyphidBlaster(worldObj) : new EntityGlyphidBrawler(worldObj); + return rand.nextInt(3) == 0 ? new EntityGlyphidBlaster(worldObj) : new EntityGlyphidNuclear(worldObj); } } } diff --git a/src/main/java/com/hbm/inventory/gui/GUICompressor.java b/src/main/java/com/hbm/inventory/gui/GUICompressor.java index 69c8dc0ac..e555886fa 100644 --- a/src/main/java/com/hbm/inventory/gui/GUICompressor.java +++ b/src/main/java/com/hbm/inventory/gui/GUICompressor.java @@ -35,6 +35,8 @@ public class GUICompressor extends GuiInfoContainer { compressor.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 17, guiTop + 18, 16, 52); compressor.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 107, guiTop + 18, 16, 52); this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 52, compressor.power, compressor.maxPower); + + for(int j = 0; j < 5; j++) drawCustomInfoStat(mouseX, mouseY, guiLeft + 43 + j * 11, guiTop + 48, 8, 14, mouseX, mouseY, j + " PU -> " + (j + 1) + " PU"); } @Override diff --git a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java index 3711f5af2..077b17bdc 100644 --- a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java @@ -985,6 +985,14 @@ public class AssemblerRecipes { new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.circuit_red_copper, 3) }, 200); + + makeRecipe(new ComparableStack(ModBlocks.machine_compressor, 1), new AStack[] { + new OreDictStack(STEEL.plateCast(), 8), + new OreDictStack(CU.plate528(), 4), + new ComparableStack(ModItems.hull_big_steel, 2), + new ComparableStack(ModItems.motor, 3), + new ComparableStack(ModItems.circuit_red_copper, 1) + }, 200); makeRecipe(new ComparableStack(ModItems.euphemium_capacitor, 1), new AStack[] { diff --git a/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java b/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java index f32038c47..62ba87dfa 100644 --- a/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/ChemplantRecipes.java @@ -91,22 +91,22 @@ public class ChemplantRecipes extends SerializableRecipe { new ComparableStack(ModItems.wire_schrabidium, 4), new OreDictStack(DIAMOND.dust()), new OreDictStack(DESH.ingot())) - .inputFluids(new FluidStack(Fluids.ACID, 800), new FluidStack(Fluids.MERCURY, 200)) + .inputFluids(new FluidStack(Fluids.ACID, 800, GeneralConfig.enable528 ? 1 : 0), new FluidStack(Fluids.MERCURY, 200)) .outputItems(new ItemStack(ModItems.circuit_schrabidium))); recipes.add(new ChemRecipe(43, "POLYMER", 100) .inputItems( new OreDictStack(COAL.dust(), 2), new OreDictStack(F.dust())) - .inputFluids(new FluidStack(Fluids.PETROLEUM, 500)) + .inputFluids(new FluidStack(Fluids.PETROLEUM, 500, GeneralConfig.enable528 ? 1 : 0)) .outputItems(new ItemStack(ModItems.ingot_polymer))); recipes.add(new ChemRecipe(81, "BAKELITE", 100) .inputFluids( - new FluidStack(Fluids.AROMATICS, 500), - new FluidStack(Fluids.PETROLEUM, 500)) + new FluidStack(Fluids.AROMATICS, 500, GeneralConfig.enable528 ? 1 : 0), + new FluidStack(Fluids.PETROLEUM, 500, GeneralConfig.enable528 ? 1 : 0)) .outputItems(new ItemStack(ModItems.ingot_bakelite))); recipes.add(new ChemRecipe(82, "RUBBER", 100) .inputItems(new OreDictStack(S.dust())) - .inputFluids(new FluidStack(Fluids.UNSATURATEDS, 500)) + .inputFluids(new FluidStack(Fluids.UNSATURATEDS, 500, GeneralConfig.enable528 ? 2 : 0)) .outputItems(new ItemStack(ModItems.ingot_rubber))); /*recipes.add(new ChemRecipe(94, "PET", 100) .inputItems(new OreDictStack(AL.dust())) @@ -126,14 +126,14 @@ public class ChemplantRecipes extends SerializableRecipe { .outputItems(new ItemStack(com.hbm.blocks.ModBlocks.reinforced_laminate))); recipes.add(new ChemRecipe(94, "PC", 100) .inputFluids( - new FluidStack(Fluids.XYLENE, 500), - new FluidStack(Fluids.PHOSGENE, 500)) + new FluidStack(Fluids.XYLENE, 500, GeneralConfig.enable528 ? 2 : 0), + new FluidStack(Fluids.PHOSGENE, 500, GeneralConfig.enable528 ? 2 : 0)) .outputItems(new ItemStack(ModItems.ingot_pc))); recipes.add(new ChemRecipe(96, "PVC", 100) .inputItems(new OreDictStack(CD.dust())) .inputFluids( - new FluidStack(Fluids.UNSATURATEDS, 250), - new FluidStack(Fluids.CHLORINE, 250)) + new FluidStack(Fluids.UNSATURATEDS, 250, GeneralConfig.enable528 ? 2 : 0), + new FluidStack(Fluids.CHLORINE, 250, GeneralConfig.enable528 ? 2 : 0)) .outputItems(new ItemStack(ModItems.ingot_pvc, 2))); recipes.add(new ChemRecipe(89, "DYNAMITE", 50) .inputItems( @@ -143,7 +143,7 @@ public class ChemplantRecipes extends SerializableRecipe { .outputItems(new ItemStack(ModItems.ball_dynamite, 2))); recipes.add(new ChemRecipe(83, "TNT", 150) .inputItems(new OreDictStack(KNO.dust())) - .inputFluids(new FluidStack(Fluids.AROMATICS, 500)) + .inputFluids(new FluidStack(Fluids.AROMATICS, 500, GeneralConfig.enable528 ? 1 : 0)) .outputItems(new ItemStack(ModItems.ball_tnt, 4))); recipes.add(new ChemRecipe(95, "TATB", 50) .inputItems(new ComparableStack(ModItems.ball_tnt)) @@ -151,7 +151,7 @@ public class ChemplantRecipes extends SerializableRecipe { .outputItems(new ItemStack(ModItems.ball_tatb))); recipes.add(new ChemRecipe(84, "C4", 150) .inputItems(new OreDictStack(KNO.dust())) - .inputFluids(new FluidStack(Fluids.UNSATURATEDS, 500)) + .inputFluids(new FluidStack(Fluids.UNSATURATEDS, 500, GeneralConfig.enable528 ? 1 : 0)) .outputItems(new ItemStack(ModItems.ingot_c4, 4))); //44, formerly deuterium //45, formerly steam @@ -224,7 +224,7 @@ public class ChemplantRecipes extends SerializableRecipe { new ComparableStack(ModItems.solid_fuel, 2), new OreDictStack(KNO.dust()), new OreDictStack(REDSTONE.dust())) - .inputFluids(new FluidStack(Fluids.PETROLEUM, 200)) + .inputFluids(new FluidStack(Fluids.PETROLEUM, 200, GeneralConfig.enable528 ? 1 : 0)) .outputItems(new ItemStack(ModItems.rocket_fuel, 4))); recipes.add(new ChemRecipe(58, "ELECTROLYSIS", 150) .inputFluids(new FluidStack(Fluids.WATER, 8000)) @@ -353,7 +353,7 @@ public class ChemplantRecipes extends SerializableRecipe { new OreDictStack(F.dust(), 8), new ComparableStack(ModItems.nugget_bismuth, 4)) .inputFluids(new FluidStack(Fluids.ACID, 1000, 5)) - .outputFluids(new FluidStack(Fluids.DEATH, 1000))); + .outputFluids(new FluidStack(Fluids.DEATH, 1000, GeneralConfig.enable528 ? 5 : 0))); //one bucket of ethanol equals 275_000 TU using the diesel baseline0 //the coal baseline is 400_000 per piece //if we assume a burntime of 1.5 ops (300 ticks) for sugar at 100 TU/t that would equal a total of 30_000 TU diff --git a/src/main/java/com/hbm/items/special/ItemTeleLink.java b/src/main/java/com/hbm/items/special/ItemTeleLink.java index baf9880ce..6ed12b051 100644 --- a/src/main/java/com/hbm/items/special/ItemTeleLink.java +++ b/src/main/java/com/hbm/items/special/ItemTeleLink.java @@ -42,7 +42,7 @@ public class ItemTeleLink extends Item { if(!stack.hasTagCompound()) { world.playSoundAtEntity(player, "hbm:item.techBoop", 1.0F, 1.0F); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[TeleLink] No destiation set!")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[TeleLink] No destination set!")); return false; } diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index 3a7624b0b..019a369cc 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -1256,7 +1256,7 @@ public class ModEventHandlerClient { switch(rand) { case 0: main.splashText = "Floppenheimer!"; break; - case 1: main.splashText = "i should dip my balls in sulfuic acid"; break; + case 1: main.splashText = "i should dip my balls in sulfuric acid"; break; case 2: main.splashText = "All answers are popbob!"; break; case 3: main.splashText = "None shall enter The Orb!"; break; case 4: main.splashText = "Wacarb was here"; break; diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index c9a2b3a46..6334c68bb 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -332,6 +332,7 @@ container.machineBoiler=Ölwärmer container.machineCMB=CMB-Stahl Hochofen container.machineCoal=Verbrennungsgenerator container.machineCoker=Koker-Anlage +container.machineCompressor=Kompressor container.machineCrucible=Schmelztiegel container.machineDiesel=Dieselgenerator container.machineElectricBoiler=Elektrischer Ölwärmer @@ -3941,6 +3942,7 @@ tile.machine_coker.name=Koker-Anlage tile.machine_coker.desc=Verkokt Öl, erzeugt fluides Nebenprodukt.$Benötigt externe Hitzequelle.$Wärmestransferrate: ΔT*0.025 TU/t tile.machine_combine_factory.name=CMB-Stahl Hochofen tile.machine_combustion_engine.name=Industrieller Verbrennungsmotor +tile.machine_compressor.name=Kompressor tile.machine_condenser.name=Dampfkondensierer tile.machine_controller.name=Reaktorfernsteuerung tile.machine_converter_he_rf.name=HE zu RF Konverter diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index e192d1821..6bd3ff4e6 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -624,6 +624,7 @@ container.machineBoiler=Oil Heater container.machineCMB=CMB Steel Furnace container.machineCoal=Combustion Generator container.machineCoker=Coker Unit +container.machineCompressor=Compressor container.machineCrucible=Crucible container.machineDiesel=Diesel Generator container.machineElectricBoiler=Electric Oil Heater @@ -4764,6 +4765,7 @@ tile.machine_coker.name=Coker Unit tile.machine_coker.desc=Cokes oil, creating fluid byproducts.$Requires external heat source.$Heat transfer rate: ΔT*0.025 TU/t tile.machine_combine_factory.name=CMB Steel Furnace tile.machine_combustion_engine.name=Industrial Combustion Engine +tile.machine_compressor.name=Compressor tile.machine_condenser.name=Steam Condenser tile.machine_controller.name=Reactor Remote Control Block tile.machine_converter_he_rf.name=HE to RF Converter From c7e428d927772d10154400f84d89369469fe86e9 Mon Sep 17 00:00:00 2001 From: Doctor17-git <60807716+Doctor17-git@users.noreply.github.com> Date: Sat, 24 Jun 2023 10:12:24 +0300 Subject: [PATCH 5/7] Updated ru_RU.lang updated russian localization --- src/main/resources/assets/hbm/lang/ru_RU.lang | 120 ++++++++++-------- 1 file changed, 67 insertions(+), 53 deletions(-) diff --git a/src/main/resources/assets/hbm/lang/ru_RU.lang b/src/main/resources/assets/hbm/lang/ru_RU.lang index 4aa131493..4281a44ff 100644 --- a/src/main/resources/assets/hbm/lang/ru_RU.lang +++ b/src/main/resources/assets/hbm/lang/ru_RU.lang @@ -949,114 +949,114 @@ book.starter.page18=vær - просто парень, который слишк book.lore.office0.title=Заявление об увольнении book.lore.office0.author=Kosma -book.lore.office0.page1=Вчера руководство снова сократило наш отдел. Эти идиоты должны винить только самих себя, я не знаю, чего они ожидали после фиаско с Панаем. Кто, черт возьми, сливает такую информацию? Мы теряем миллионы, и -book.lore.office0.page2=это Я сейчас без работы. Это меня просят уйти в отставку. Я надеюсь, что вы, придурки, наконец-то извлекли урок из своего переизбытка ошибок и вытащили эту палку из своей задницы. -book.lore.office0.page3=Я не вернусь в пятницу. Просто пришлите чек на зарплату. +book.lore.office0.page0=Вчера руководство снова сократило наш отдел. Эти идиоты должны винить только самих себя, я не знаю, чего они ожидали после фиаско с Панаем. Кто, черт возьми, сливает такую информацию? Мы теряем миллионы, и +book.lore.office0.page1=это Я сейчас без работы. Это меня просят уйти в отставку. Я надеюсь, что вы, придурки, наконец-то извлекли урок из своего переизбытка ошибок и вытащили эту палку из своей задницы. +book.lore.office0.page2=Я не вернусь в пятницу. Просто пришлите чек на зарплату. book.lore.office1.title=Заметка book.lore.office1.author=Jonas Quinn -book.lore.office1.page1= -book.lore.office2.page2= +book.lore.office1.page0= +book.lore.office2.page1= book_lore.author=By %s book_lore.book_iodine.name=Note book_lore.book_iodine.author=Dave -book_lore.book_iodine.page.1=alright you will not believe this, but old man weathervane finally managed to show up again since he left two weeks ago and what's more surprising is the fact that he actually decided to spill the beans on what they were doing in the canyon: -book_lore.book_iodine.page.2=apparently the morons from R&D discovered a compound that is mostly inorganic, pretty much like a toxin in nature, but get this: the dying cells will reproduce said toxin and excrete it through the skin, creating an aerosol that is highly contagious. -book_lore.book_iodine.page.3=it's just like a virus, but not a virus. the composition is weird, you can mix it in any household bottle but you do have to get the order right. the doc told me that the first ingredient which is just powdered iodine crystals goes into slot %d +book_lore.book_iodine.page.0=alright you will not believe this, but old man weathervane finally managed to show up again since he left two weeks ago and what's more surprising is the fact that he actually decided to spill the beans on what they were doing in the canyon: +book_lore.book_iodine.page.1=apparently the morons from R&D discovered a compound that is mostly inorganic, pretty much like a toxin in nature, but get this: the dying cells will reproduce said toxin and excrete it through the skin, creating an aerosol that is highly contagious. +book_lore.book_iodine.page.2=it's just like a virus, but not a virus. the composition is weird, you can mix it in any household bottle but you do have to get the order right. the doc told me that the first ingredient which is just powdered iodine crystals goes into slot %d book_lore.book_phosphorous.name=Note book_lore.book_phosphorous.author=Dave -book_lore.book_phosphorous.page.1=heyo, it's me again. i assume you got my last memo, the doc wasn't too happy about it. i'll have to do this quick, the dunderheads from R&D are currently moaning again, probably over money. again. anyway, doc weathervane found that the second -book_lore.book_phosphorous.page.2=ingredient is red phosphorous, whihc has to be mixed into slot %d +book_lore.book_phosphorous.page.0=heyo, it's me again. i assume you got my last memo, the doc wasn't too happy about it. i'll have to do this quick, the dunderheads from R&D are currently moaning again, probably over money. again. anyway, doc weathervane found that the second +book_lore.book_phosphorous.page.1=ingredient is red phosphorous, whihc has to be mixed into slot %d book_lore.book_dust.name=Note book_lore.book_dust.author=Dave -book_lore.book_dust.page.1=the doc was furious when he found out that the R&D dorks kept the one remaining sample, ranting about gross negligence this and a doomsday scenario that. i told him to chill for a minute, getting all worked up isn't good for his blood pressure, not -book_lore.book_dust.page.2=that he has much blood left to begin with. one of the R&D morons slipped some more info into last week's circular, they call their little concoction \"MKU\" whatever that means, and that it contains actual household lint. can you believe that? one of the most -book_lore.book_dust.page.3=dangerous inventions of theirs and it contains dust. strangely they also mentioned that it goes into slot %d +book_lore.book_dust.page.0=the doc was furious when he found out that the R&D dorks kept the one remaining sample, ranting about gross negligence this and a doomsday scenario that. i told him to chill for a minute, getting all worked up isn't good for his blood pressure, not +book_lore.book_dust.page.1=that he has much blood left to begin with. one of the R&D morons slipped some more info into last week's circular, they call their little concoction \"MKU\" whatever that means, and that it contains actual household lint. can you believe that? one of the most +book_lore.book_dust.page.2=dangerous inventions of theirs and it contains dust. strangely they also mentioned that it goes into slot %d book_lore.book_mercury.name=Note book_lore.book_mercury.author=Dave -book_lore.book_mercury.page.1=well that settles that. not counting the vomitting blood part, the toxicological report mostly resembles that of mercury poisoning. why? because our little mix also contains mercury! i just wonder where all that stuff comes from when being -book_lore.book_mercury.page.2=replicated by the body? whatever, the mercury goes into slot %d +book_lore.book_mercury.page.0=well that settles that. not counting the vomitting blood part, the toxicological report mostly resembles that of mercury poisoning. why? because our little mix also contains mercury! i just wonder where all that stuff comes from when being +book_lore.book_mercury.page.1=replicated by the body? whatever, the mercury goes into slot %d book_lore.book_flower.name=Note book_lore.book_flower.author=Dave -book_lore.book_flower.page.1=remember when i mentioned in my first memo that the compound is mostly anorganic? well guess what, the old man shared the fourth ingredient: ipomoea nil, a genus of flower. morning glory! it might be due to its low sulfur content, whatever might be the case, -book_lore.book_flower.page.2=it does not work with other flowers. the morning glory goes into slot %d +book_lore.book_flower.page.0=remember when i mentioned in my first memo that the compound is mostly anorganic? well guess what, the old man shared the fourth ingredient: ipomoea nil, a genus of flower. morning glory! it might be due to its low sulfur content, whatever might be the case, +book_lore.book_flower.page.1=it does not work with other flowers. the morning glory goes into slot %d book_lore.book_syringe.name=Note book_lore.book_syringe.author=Dave -book_lore.book_syringe.page.1=a little addendum to my fifth message, obviously you have to store this MKU stuff in a container. the R&D nuts used regular metal syringes that they got from medical. surplus ware i presume, they got thousands of needles just lying around. the metal -book_lore.book_syringe.page.2=syringe goes into slot %d +book_lore.book_syringe.page.0=a little addendum to my fifth message, obviously you have to store this MKU stuff in a container. the R&D nuts used regular metal syringes that they got from medical. surplus ware i presume, they got thousands of needles just lying around. the metal +book_lore.book_syringe.page.1=syringe goes into slot %d book_lore.resignation_note.name=Letter of Resignation book_lore.resignation_note.author=Kosma -book_lore.resignation_note.page.1=Management downsized our department again yesterday. Those idiots only have themselves to blame, I don't know what they were expecting after that fiasco. Who the hell leaks that sort of information? We're losing millions and -book_lore.resignation_note.page.2=it's ME who's the one out of a job now. I'M the one being asked to resign. I hope you asshats finally learn from your overabundance of mistakes and take that stick out of your ass. -book_lore.resignation_note.page.3=I'm not coming back on Friday. Just send the paycheck. +book_lore.resignation_note.page.0=Management downsized our department again yesterday. Those idiots only have themselves to blame, I don't know what they were expecting after that fiasco. Who the hell leaks that sort of information? We're losing millions and +book_lore.resignation_note.page.1=it's ME who's the one out of a job now. I'M the one being asked to resign. I hope you asshats finally learn from your overabundance of mistakes and take that stick out of your ass. +book_lore.resignation_note.page.2=I'm not coming back on Friday. Just send the paycheck. book_lore.memo_stocks.name=Intracorporate Memorandum -book_lore.memo_stocks.page.1=Investor Relations - $ $ There's been some glaring discrepancies in the figures provided for the latest quarterly report. It would be prudent for the financial department to make some adjustments, so there won't be any concern. +book_lore.memo_stocks.page.0=Investor Relations - $ $ There's been some glaring discrepancies in the figures provided for the latest quarterly report. It would be prudent for the financial department to make some adjustments, so there won't be any concern. book_lore.memo_schrab_gsa.name=Internal Memorandum -book_lore.memo_schrab_gsa.page.1=Contract Management - $ $ Legal has made a breakthrough with the DLA. They've awarded us with a 45 BILLION GSA Schedule for further procurement and research of saralloy. At current estimates, that would be at minimum -book_lore.memo_schrab_gsa.page.2=a 40%% profit on related operations, let alone the possibility of future contracts. Due to the confidential nature, all fiscal evidence is to remain private. +book_lore.memo_schrab_gsa.page.0=Contract Management - $ $ Legal has made a breakthrough with the DLA. They've awarded us with a 45 BILLION GSA Schedule for further procurement and research of saralloy. At current estimates, that would be at minimum +book_lore.memo_schrab_gsa.page.1=a 40%% profit on related operations, let alone the possibility of future contracts. Due to the confidential nature, all fiscal evidence is to remain private. book_lore.memo_schrab_rd.name=Internal Memorandum -book_lore.memo_schrab_rd.page.1=Research & Development - $ $ Our main production method of saralloy has been through the new particle accelerator. However, the energy costs are exorbitantly high compared to the amount of output. -book_lore.memo_schrab_rd.page.2=Doctor Schrabauer, however, has discovered a new interaction - called "Strange Lepton Oscillation" - that could significantly reduce costs. Through a not entirely understood process, supplied electrons are transmuted into extremely -book_lore.memo_schrab_rd.page.3=high-energy photons, through a strange charm. This is an extreme exception to many established particle conversion laws, but preliminary experiments have proved that these protons transmute into up and down quarks, eventually creating saralloy. -book_lore.memo_schrab_rd.page.4=Strangely, the prototype requires Tungsten alloyed with small amounts of saralloy. In addition, a special capacitor is required to negate the leftover positive charge. +book_lore.memo_schrab_rd.page.0=Research & Development - $ $ Our main production method of saralloy has been through the new particle accelerator. However, the energy costs are exorbitantly high compared to the amount of output. +book_lore.memo_schrab_rd.page.1=Doctor Schrabauer, however, has discovered a new interaction - called "Strange Lepton Oscillation" - that could significantly reduce costs. Through a not entirely understood process, supplied electrons are transmuted into extremely +book_lore.memo_schrab_rd.page.2=high-energy photons, through a strange charm. This is an extreme exception to many established particle conversion laws, but preliminary experiments have proved that these protons transmute into up and down quarks, eventually creating saralloy. +book_lore.memo_schrab_rd.page.3=Strangely, the prototype requires Tungsten alloyed with small amounts of saralloy. In addition, a special capacitor is required to negate the leftover positive charge. book_lore.memo_schrab_nuke.name=Research Report book_lore.memo_schrab_nuke.author=Doctor Schrabauer -book_lore.memo_schrab_nuke.page.1=Our most recent investigation led us to the effects of nuclear explosions on materials. Thanks to our grant money, we *accidentally* tested our theory on direct saralloy synthesis from uranium. -book_lore.memo_schrab_nuke.page.2=Only our cyclotron has actually created saralloy previously. However, at our underground shot at Everwerpen, miniscule traces of saralloy were found in uranium ore at the site. All pure, metallic uranium nearby had fissioned. -book_lore.memo_schrab_nuke.page.3=As such, given enough uranium ore concentrated around an explosive, or perhaps even a dirty bomb rich in waste containing fissionable material, one could hypothetically create enough saralloy to collect manually. +book_lore.memo_schrab_nuke.page.0=Our most recent investigation led us to the effects of nuclear explosions on materials. Thanks to our grant money, we *accidentally* tested our theory on direct saralloy synthesis from uranium. +book_lore.memo_schrab_nuke.page.1=Only our cyclotron has actually created saralloy previously. However, at our underground shot at Everwerpen, miniscule traces of saralloy were found in uranium ore at the site. All pure, metallic uranium nearby had fissioned. +book_lore.memo_schrab_nuke.page.2=As such, given enough uranium ore concentrated around an explosive, or perhaps even a dirty bomb rich in waste containing fissionable material, one could hypothetically create enough saralloy to collect manually. book_lore.insanity_1.name=Torn Page book_lore.insanity_1.author=D Ferguson -book_lore.insanity_1.page.1=August 6th $ $ Months, no, years worth of dicking about wrestling with investors and operating the greatest energy hog in the northern hemisphere has finally paid off. -book_lore.insanity_1.page.2=While we aren't entirely sure what exactly we found - given we ran gigavolt collisions on particles that were still poorly documented - the results couldn't have been more exciting. -book_lore.insanity_1.page.3=We haven't found a name for whatever it is we've found, nor are we sure if we're looking at a new type of particle, a wormhole leading into another dimension, or satan's anus, but I'm sure our PR people can come up with something. +book_lore.insanity_1.page.0=August 6th $ $ Months, no, years worth of dicking about wrestling with investors and operating the greatest energy hog in the northern hemisphere has finally paid off. +book_lore.insanity_1.page.1=While we aren't entirely sure what exactly we found - given we ran gigavolt collisions on particles that were still poorly documented - the results couldn't have been more exciting. +book_lore.insanity_1.page.2=We haven't found a name for whatever it is we've found, nor are we sure if we're looking at a new type of particle, a wormhole leading into another dimension, or satan's anus, but I'm sure our PR people can come up with something. book_lore.insanity_2.name=Torn Page book_lore.insanity_2.author=D Ferguson -book_lore.insanity_2.page.1=August 8th $ $ We've kept "The Thing" (yes that's what we call it for now) in magnetic isolation for the past days. Spectroscopy tests ended up breaking our spectrometer, but we managed to gain some useful data. -book_lore.insanity_2.page.2=For starters, this thing glows like a christmas tree, radiation photons of about every wavelength you could think of enveloped by a powerful infrared corona. The logical conclusion is that looking at it with your naked -book_lore.insanity_2.page.3=eye would most likely kill you. Now that begs the question: How can a particle this tiny radiate such immense energy? What are you hiding, little man? +book_lore.insanity_2.page.0=August 8th $ $ We've kept "The Thing" (yes that's what we call it for now) in magnetic isolation for the past days. Spectroscopy tests ended up breaking our spectrometer, but we managed to gain some useful data. +book_lore.insanity_2.page.1=For starters, this thing glows like a christmas tree, radiation photons of about every wavelength you could think of enveloped by a powerful infrared corona. The logical conclusion is that looking at it with your naked +book_lore.insanity_2.page.2=eye would most likely kill you. Now that begs the question: How can a particle this tiny radiate such immense energy? What are you hiding, little man? book_lore.insanity_3.name=Torn Page book_lore.insanity_3.author=D Ferguson -book_lore.insanity_3.page.1=August 22nd $ $ I haven't slept right in days. Doc said he couldn't find anything. Been on all sorts of medication now, but the headaches only get worse. Lab boys suspect it might be contamination from the incident two weeks ago. -book_lore.insanity_3.page.2=Doc said it's not that likely, ARS is different. I might need to take some time off if this continues. The Thing is still in containment, the lab boys speculate if the field goes down, the entire complex turns into a mushroom cloud. -book_lore.insanity_3.page.3=I'm not sure how administration can keep this calm, but i don't get paid enough to waste thoughts on that. +book_lore.insanity_3.page.0=August 22nd $ $ I haven't slept right in days. Doc said he couldn't find anything. Been on all sorts of medication now, but the headaches only get worse. Lab boys suspect it might be contamination from the incident two weeks ago. +book_lore.insanity_3.page.1=Doc said it's not that likely, ARS is different. I might need to take some time off if this continues. The Thing is still in containment, the lab boys speculate if the field goes down, the entire complex turns into a mushroom cloud. +book_lore.insanity_3.page.2=I'm not sure how administration can keep this calm, but i don't get paid enough to waste thoughts on that. book_lore.insanity_4.name=Torn Page book_lore.insanity_4.author=D Ferguson -book_lore.insanity_4.page.1=August 28th $ $ They denied my request for leave and I've been pushing through the past few days. Headaches are getting worse. I'm not the only one who's feeling it, either. Some of the lab boys are in a similar situation. -book_lore.insanity_4.page.2=All the while The Thing has left the complex - GOOD. Some suits came in yesterday and had it shipped off, god knows where. One of the lab boys, Zachary, said they're probably burying the containment vessel in the desert, slowly -book_lore.insanity_4.page.3=trying to "fizzle out" The Thing far off from civilization. I say let's shoot it into space. Needless to say, our investors cut all funding for the time being. I should start looking for another job. +book_lore.insanity_4.page.0=August 28th $ $ They denied my request for leave and I've been pushing through the past few days. Headaches are getting worse. I'm not the only one who's feeling it, either. Some of the lab boys are in a similar situation. +book_lore.insanity_4.page.1=All the while The Thing has left the complex - GOOD. Some suits came in yesterday and had it shipped off, god knows where. One of the lab boys, Zachary, said they're probably burying the containment vessel in the desert, slowly +book_lore.insanity_4.page.2=trying to "fizzle out" The Thing far off from civilization. I say let's shoot it into space. Needless to say, our investors cut all funding for the time being. I should start looking for another job. book_lore.insanity_5.name=Torn Page book_lore.insanity_5.author=D Ferguson -book_lore.insanity_5.page.1=September 11th $ $ I'm having this re-occurring nightmare. I'm walking around in an open space and there's these people everywhere, people in rubber suits and freakishly deformed faces. It's always the same nightmare, -book_lore.insanity_5.page.2=and one of the guys from the lab I've spoken with lately has had the same dream. Meanwhile my post has been rather boring, the accelerator has been shut down, all ongoing projects are on halt and our budget is slowly melting away. -book_lore.insanity_5.page.3=Something is telling me that The Thing is still out there somewhere. I can feel it. +book_lore.insanity_5.page.0=September 11th $ $ I'm having this re-occurring nightmare. I'm walking around in an open space and there's these people everywhere, people in rubber suits and freakishly deformed faces. It's always the same nightmare, +book_lore.insanity_5.page.1=and one of the guys from the lab I've spoken with lately has had the same dream. Meanwhile my post has been rather boring, the accelerator has been shut down, all ongoing projects are on halt and our budget is slowly melting away. +book_lore.insanity_5.page.2=Something is telling me that The Thing is still out there somewhere. I can feel it. book_lore.insanity_6.name=Torn Page book_lore.insanity_6.author=D Ferguson -book_lore.insanity_6.page.1=October 3rd $ $ Half the staff is dead, most of the rest is in the ICU. My condition hasn't changed in the past weeks, for better or worse. -book_lore.insanity_6.page.2=Reality is starting to feel less and less real however. Sometimes I look up into the sky at night and hallucinate that thing we discovered all those weeks ago. -book_lore.insanity_6.page.3=That same brilliant sheen of crimson that our spectrometer spat out. My doc says it's delirium and stress caused by the incident, and perhaps hes right, but the meds aren't working at all. +book_lore.insanity_6.page.0=October 3rd $ $ Half the staff is dead, most of the rest is in the ICU. My condition hasn't changed in the past weeks, for better or worse. +book_lore.insanity_6.page.1=Reality is starting to feel less and less real however. Sometimes I look up into the sky at night and hallucinate that thing we discovered all those weeks ago. +book_lore.insanity_6.page.2=That same brilliant sheen of crimson that our spectrometer spat out. My doc says it's delirium and stress caused by the incident, and perhaps hes right, but the meds aren't working at all. book_lore.insanity_7.name=Torn Page book_lore.insanity_7.author=D Ferguson -book_lore.insanity_7.page.1=December 12th $ $ I've been out of a job, but to be honest I'm somewhat thankful about it. My old workplace has gone up in flames - or so they say. -book_lore.insanity_7.page.2=The seismological observatory a couple miles south recorded constant earthquakes for days on end, not that anyone else would have noticed this deep in the desert. -book_lore.insanity_7.page.3=I have concluded that this place was cursed, making everyone sick and then descending into hell like some sort of Edgar Allan Poe story. Good riddance. +book_lore.insanity_7.page.0=December 12th $ $ I've been out of a job, but to be honest I'm somewhat thankful about it. My old workplace has gone up in flames - or so they say. +book_lore.insanity_7.page.1=The seismological observatory a couple miles south recorded constant earthquakes for days on end, not that anyone else would have noticed this deep in the desert. +book_lore.insanity_7.page.2=I have concluded that this place was cursed, making everyone sick and then descending into hell like some sort of Edgar Allan Poe story. Good riddance. hbmfluid.none=Ничего hbmfluid.water=Вода @@ -2140,6 +2140,8 @@ tile.watz_pump.name=Нагнетающая помпа Ватцза tile.machine_coker.name=Коксовая установка tile.machine_coker.desc=Коксует жидкость, создавая жидкую побочку.$Требует внешний источник тепла.$Скорость передачи тепла: ΔT*0.025 TU/t container.machineCoker=Коксовая установка +container.machineCompressor=Компрессор +tile.machine_compressor.name=Компрессор container.hadron=Ускоритель частиц tile.hadron_access.name=Терминал доступа ускорителя частиц @@ -2263,6 +2265,7 @@ tile.machine_tower_large.name=Градирня tile.machine_tower_small.name=Вспомогательная градирня tile.fusion_conductor.name=Сверхпроводящий магнит +tile.fusion_conductor_welded.name=Сверхпроводящий магнит (Сваренный) tile.fusion_center.name=Центральный элемент магнита tile.fusion_motor.name=Элемент магнитного мотора tile.fusion_heater.name=Компонент нагревателя плазмы @@ -4478,6 +4481,14 @@ entity.entity_taint_crab.name=Заражённый порчей теслакра entity.entity_elder_one.name=Крякос Старший entity.entity_ntm_fbi.name=Агент ФБР entity.entity_ntm_radiation_blaze.name=Элементаль Расплавления +entity.entity_glyphid.name=Глифид +entity.entity_glyphid_behemoth.name=Глифид-страж +entity.entity_glyphid_brawler.name=Глифид-солдат +entity.entity_glyphid_brenda.name=Бренда +entity.entity_glyphid_nuclear.name=Чмяк +entity.entity_glyphid_scout.name=Глифид-паучок +entity.entity_glyphid_blaster.name=Глифид-стрелок +entity.entity_glyphid_bombardier.name=Глифид-бомбардир entity.hbm.entity_balls_o_tron.name=Баллс-О-Трон Прайм entity.hbm.entity_balls_o_tron_seg.name=Баллс-О-Трон Сегмент entity.hbm.entity_ntm_ufo.name=Марсианский корабль вторжения @@ -5079,6 +5090,8 @@ tile.meteor_brick_chiseled.name=Высеченные метеоритные ки tile.meteor_pillar.name=Метеоритный столб tile.meteor_spawner.name=Сборщик киберкрабов tile.meteor_battery.name=Генератор статического электричества из звездного металла +tile.glyphid_base.name=Блок улья глифидов +tile.glyphid_spawner.name=Спавнер улья глифидов tile.ore_tektite_osmiridium.name=Перемешанный с осмиридием Тектит tile.tektite.name=Тектит @@ -5239,6 +5252,7 @@ item.bottle2_fritz.name=Фрицз-Кола item.bottle2_korl_special.name=Первый Корл item.bottle2_fritz_special.name=Первая Фрицз-Кола item.bottle2_sunset.name=Сансет Сарсапарилла +item.bdcl.name=BDCL item.chocolate_milk.name=Молочный шоколад item.cap_nuka.name=Крышка item.cap_quantum.name=Крышка от Квантовой Ядер-колы From c32e20daf7161c129394345ea8ee3fff3bad9517 Mon Sep 17 00:00:00 2001 From: Doctor17-git <60807716+Doctor17-git@users.noreply.github.com> Date: Sat, 24 Jun 2023 10:14:45 +0300 Subject: [PATCH 6/7] Updated ru_RU.lang --- src/main/resources/assets/hbm/lang/ru_RU.lang | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/resources/assets/hbm/lang/ru_RU.lang b/src/main/resources/assets/hbm/lang/ru_RU.lang index 4281a44ff..a3235976c 100644 --- a/src/main/resources/assets/hbm/lang/ru_RU.lang +++ b/src/main/resources/assets/hbm/lang/ru_RU.lang @@ -542,8 +542,8 @@ desc.gui.nukeGadget.desc=§1Требует:§r$ * 4 Набора взрывоо desc.gui.nukeMan.desc=§1Требует:§r$ * 4 Набора взрывоопасных линз$ Первого поколения$ * Плутониевое ядро$ * Воспламенитель desc.gui.nukeMike.desc=§1Требует:§r$ * 4 Набора взрывоопасных линз$ * Плутониевое ядро$ * Блок охлаждения дейтерия$ * Дейтериевый бак с урановым покрытием$ * Дейтериевый бак desc.gui.nukeTsar.desc=§1Требует:§r$ * 4 Набора взрывоопасных линз$ * Плутониевое ядро$§9Опционально:§r$ * Ядро Царь-бомбы -desc.item.zirnoxBreedingRod=§2[Стержень-размножитель Цирнокс]$§eРазмещать рядом с топливными стержнями$§eОсталось %d тиков -desc.item.zirnoxRod=§a[Топливный стержень Цирнокс]$§eГенерирует %1$d тепла на тик$§eОсталость %2$d тиков +desc.item.zirnoxBreedingRod=§2[Стержень-размножитель Цирнокс]$§eРазмещать рядом с топливными стержнями$§eВремя работы %d тиков +desc.item.zirnoxRod=§a[Топливный стержень Цирнокс]$§eГенерирует %1$d тепла на тик$§Время работы %2$d тиков desc.item.ammo.con_accuracy2=- Сильно сниженная точность desc.item.ammo.con_damage=- Сильно сниженный урон desc.item.ammo.con_heavy_wear=- Сильно увеличенный износ @@ -5608,7 +5608,6 @@ item.crystal_energy.desc=Densely packed energy powder.$Not edible. item.custom_core.name=Nuclear Fission Core item.detonator_de.desc=Взрывается при падении! item.detonator_deadman.desc=Shift+ПКМ, чтобы задать позицию,$выбросите для детонации! -item.euphemium_capacitor.name=Redcoil Capacitor with Euphemium Positive Energy Negator item.eye.desc.11=§c"All humans, are afraid of monsters, the monsters they keep inside of them.$§cThey drove the species who are able to expose the monsters in them down the$§cpurgatory underground. There, in the purgatory deep inside the earth where$§cpeople are made, he was born. He hated, and loved, the monster that is$§cforming inside of him more than anyone else. Together with his second$§cmother, he climbed up to the world where the people who have driven him into$§cthe underground live. However, at that time, it was too late. This world$§cabove ground is waiting for its slow death, same as the people who are$§ccontinue to stay there. This world, this surface, is the realm of the dead.$§cAnd this species called humans, they have built for themselves a world of$§ctwilight. There, he met a ghost called 'father'. His second mother, who has$§ccome to this netherworld with him, remained there, while he returned to the$§cpurgatory where he was born. That place, the place where he lives, that$§cpurgatory. That should be the last world of humans."§r item.eye.desc=It's looking at me despite being closed,$or rather, through me...$into my soul.$It makes me uncomfortable item.eye.name=Eye? From 99cfce0e5d1a1b4d8dc460574492cc8bc86e8d62 Mon Sep 17 00:00:00 2001 From: Bob Date: Sat, 24 Jun 2023 17:54:46 +0200 Subject: [PATCH 7/7] pollution effects for heavy metal and poison --- changelog | 7 +- .../hbm/entity/grenade/EntityGrenadeGas.java | 23 ++-- .../com/hbm/handler/EntityEffectHandler.java | 104 ++++++++++++------ .../handler/pollution/PollutionHandler.java | 10 +- .../com/hbm/inventory/gui/GUICompressor.java | 2 +- .../com/hbm/items/weapon/ItemAmmoArty.java | 29 +++-- .../java/com/hbm/main/ModEventHandler.java | 25 ++++- .../TileEntityMachineCombustionEngine.java | 4 +- 8 files changed, 141 insertions(+), 63 deletions(-) diff --git a/changelog b/changelog index d82ff17a6..b31f60f2d 100644 --- a/changelog +++ b/changelog @@ -38,9 +38,14 @@ * The page and notebook items have been replaced with more dynamic book items that get their data from NBT * C4 can now be made by irradiating PVC * Play stupid games, win stupid prizes +* Gas grenades now use the new gas system which should be a lot more pleasant to look at and less heavy on the TPS +* Leaded fuels now release heavy metal into the air, heavy metal can cause lead poisoning + * Lower heavy metal concentrations can also cause heavy metal poisoning when breaking blocks +* Gas artillery shell now create heavy metal and poisonous pollution ## Fixed * Fixed potential crash or logspam regarding the pollution handler * Fixed missiles leaving behind a 3x3 grid of loaded chunks after being destroyed * Fixed coal ore yielding coal in the crucible instead of making carbon -* Fixed a potential issue where BuildCraft generators can't supply the RF to HE converter \ No newline at end of file +* Fixed a potential issue where BuildCraft generators can't supply the RF to HE converter +* Fixed combustion engine sound sometimes continue playing even when turned off \ No newline at end of file diff --git a/src/main/java/com/hbm/entity/grenade/EntityGrenadeGas.java b/src/main/java/com/hbm/entity/grenade/EntityGrenadeGas.java index 5526b87a0..51d813653 100644 --- a/src/main/java/com/hbm/entity/grenade/EntityGrenadeGas.java +++ b/src/main/java/com/hbm/entity/grenade/EntityGrenadeGas.java @@ -5,7 +5,9 @@ import net.minecraft.world.World; import java.util.Random; +import com.hbm.entity.effect.EntityMist; import com.hbm.explosion.ExplosionChaos; +import com.hbm.inventory.fluid.Fluids; import com.hbm.items.ModItems; import com.hbm.items.weapon.ItemGrenade; @@ -30,21 +32,12 @@ public class EntityGrenadeGas extends EntityGrenadeBouncyBase { if (!this.worldObj.isRemote) { this.setDead(); this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 0.0F, true); - // ExplosionChaos.poison(this.worldObj, (int)this.posX, - // (int)this.posY, (int)this.posZ, 5); - // for(int i = 0; 0 < 15; i++) { - - /* - * ExplosionLarge.spawnParticlesRadial(worldObj, posX, posY, posZ, - * 50); ExplosionLarge.spawnParticlesRadial(worldObj, posX, posY, - * posZ, 50); ExplosionLarge.spawnParticlesRadial(worldObj, posX, - * posY, posZ, 50); ExplosionLarge.spawnParticlesRadial(worldObj, - * posX, posY, posZ, 50); - */ - - ExplosionChaos.spawnChlorine(worldObj, posX, posY, posZ, 50, 1.25, 0); - - // } + + EntityMist mist = new EntityMist(worldObj); + mist.setType(Fluids.CHLORINE); + mist.setPosition(posX, posY - 5, posZ); + mist.setArea(15, 10); + worldObj.spawnEntityInWorld(mist); } } diff --git a/src/main/java/com/hbm/handler/EntityEffectHandler.java b/src/main/java/com/hbm/handler/EntityEffectHandler.java index d3d177c43..1bcec5d0e 100644 --- a/src/main/java/com/hbm/handler/EntityEffectHandler.java +++ b/src/main/java/com/hbm/handler/EntityEffectHandler.java @@ -12,6 +12,8 @@ import com.hbm.extprop.HbmLivingProps; import com.hbm.extprop.HbmPlayerProps; import com.hbm.extprop.HbmLivingProps.ContaminationEffect; import com.hbm.handler.HbmKeybinds.EnumKeybind; +import com.hbm.handler.pollution.PollutionHandler; +import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.handler.radiation.ChunkRadiationManager; import com.hbm.interfaces.IArmorModDash; import com.hbm.items.armor.ArmorFSB; @@ -19,6 +21,7 @@ import com.hbm.lib.ModDamageSource; import com.hbm.main.MainRegistry; import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.PacketDispatcher; +import com.hbm.potion.HbmPotion; import com.hbm.packet.ExtPropPacket; import com.hbm.saveddata.AuxSavedData; import com.hbm.util.ArmorRegistry; @@ -48,42 +51,40 @@ import net.minecraft.world.World; public class EntityEffectHandler { public static void onUpdate(EntityLivingBase entity) { - + + if(entity.ticksExisted % 20 == 0) { + HbmLivingProps.setRadBuf(entity, HbmLivingProps.getRadEnv(entity)); + HbmLivingProps.setRadEnv(entity, 0); + } + + if(entity instanceof EntityPlayerMP) { + HbmLivingProps props = HbmLivingProps.getData(entity); + HbmPlayerProps pprps = HbmPlayerProps.getData((EntityPlayerMP) entity); + NBTTagCompound data = new NBTTagCompound(); + + if(pprps.shield < pprps.maxShield && entity.ticksExisted > pprps.lastDamage + 60) { + int tsd = entity.ticksExisted - (pprps.lastDamage + 60); + pprps.shield += Math.min(pprps.maxShield - pprps.shield, 0.005F * tsd); + } + + if(pprps.shield > pprps.maxShield) + pprps.shield = pprps.maxShield; + + props.saveNBTData(data); + pprps.saveNBTData(data); + PacketDispatcher.wrapper.sendTo(new ExtPropPacket(data), (EntityPlayerMP) entity); + } + if(!entity.worldObj.isRemote) { - - if(entity.ticksExisted % 20 == 0) { - HbmLivingProps.setRadBuf(entity, HbmLivingProps.getRadEnv(entity)); - HbmLivingProps.setRadEnv(entity, 0); - } - - - if(entity instanceof EntityPlayerMP) { - HbmLivingProps props = HbmLivingProps.getData(entity); - HbmPlayerProps pprps = HbmPlayerProps.getData((EntityPlayerMP) entity); - NBTTagCompound data = new NBTTagCompound(); - - if(pprps.shield < pprps.maxShield && entity.ticksExisted > pprps.lastDamage + 60) { - int tsd = entity.ticksExisted - (pprps.lastDamage + 60); - pprps.shield += Math.min(pprps.maxShield - pprps.shield, 0.005F * tsd); - } - - if(pprps.shield > pprps.maxShield) - pprps.shield = pprps.maxShield; - - props.saveNBTData(data); - pprps.saveNBTData(data); - PacketDispatcher.wrapper.sendTo(new ExtPropPacket(data), (EntityPlayerMP) entity); - } - int timer = HbmLivingProps.getTimer(entity); if(timer > 0) { HbmLivingProps.setTimer(entity, timer - 1); - + if(timer == 1) { ExplosionNukeSmall.explode(entity.worldObj, entity.posX, entity.posY, entity.posZ, ExplosionNukeSmall.PARAMS_MEDIUM); } } - + if(GeneralConfig.enable528 && entity instanceof EntityLivingBase && !entity.isImmuneToFire() && entity.worldObj.provider.isHellWorld) { entity.setFire(5); } @@ -95,6 +96,7 @@ public class EntityEffectHandler { handleDigamma(entity); handleLungDisease(entity); handleOil(entity); + handlePollution(entity); handleDashing(entity); handlePlinking(entity); @@ -365,8 +367,11 @@ public class EntityEffectHandler { double blacklung = Math.min(HbmLivingProps.getBlackLung(entity), HbmLivingProps.maxBlacklung); double asbestos = Math.min(HbmLivingProps.getAsbestos(entity), HbmLivingProps.maxAsbestos); + double soot = PollutionHandler.getPollution(entity.worldObj, (int) Math.floor(entity.posX), (int) Math.floor(entity.posY + entity.getEyeHeight()), (int) Math.floor(entity.posZ), PollutionType.SOOT); - boolean coughs = blacklung / HbmLivingProps.maxBlacklung > 0.25D || asbestos / HbmLivingProps.maxAsbestos > 0.25D; + if(ArmorRegistry.hasProtection(entity, 3, HazardClass.PARTICLE_COARSE)) soot = 0; + + boolean coughs = blacklung / HbmLivingProps.maxBlacklung > 0.25D || asbestos / HbmLivingProps.maxAsbestos > 0.25D || soot > 30; if(!coughs) return; @@ -377,11 +382,10 @@ public class EntityEffectHandler { double blacklungDelta = 1D - (blacklung / (double)HbmLivingProps.maxBlacklung); double asbestosDelta = 1D - (asbestos / (double)HbmLivingProps.maxAsbestos); + double sootDelta = 1D - Math.min(soot / 100, 1D); double total = 1 - (blacklungDelta * asbestosDelta); - int freq = Math.max((int) (1000 - 950 * total), 20); - World world = entity.worldObj; if(total > 0.75D) { @@ -392,6 +396,9 @@ public class EntityEffectHandler { entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 100, 0)); } + total = 1 - (blacklungDelta * asbestosDelta * sootDelta); + int freq = Math.max((int) (1000 - 950 * total), 20); + if(world.getTotalWorldTime() % freq == entity.getEntityId() % freq) { world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:player.cough", 1.0F, 1.0F); @@ -442,6 +449,41 @@ public class EntityEffectHandler { } } + private static void handlePollution(EntityLivingBase entity) { + + if(!ArmorRegistry.hasProtection(entity, 3, HazardClass.GAS_CORROSIVE) && entity.ticksExisted % 60 == 0) { + + float poison = PollutionHandler.getPollution(entity.worldObj, (int) Math.floor(entity.posX), (int) Math.floor(entity.posY + entity.getEyeHeight()), (int) Math.floor(entity.posZ), PollutionType.POISON); + + if(poison > 10) { + + if(poison < 25) { + entity.addPotionEffect(new PotionEffect(Potion.poison.id, 100, 0)); + } else if(poison < 50) { + entity.addPotionEffect(new PotionEffect(Potion.poison.id, 100, 2)); + } else { + entity.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 2)); + } + } + } + + if(!ArmorRegistry.hasProtection(entity, 3, HazardClass.PARTICLE_FINE) && entity.ticksExisted % 60 == 0) { + + float poison = PollutionHandler.getPollution(entity.worldObj, (int) Math.floor(entity.posX), (int) Math.floor(entity.posY + entity.getEyeHeight()), (int) Math.floor(entity.posZ), PollutionType.HEAVYMETAL); + + if(poison > 25) { + + if(poison < 50) { + entity.addPotionEffect(new PotionEffect(HbmPotion.lead.id, 100, 0)); + } else if(poison < 75) { + entity.addPotionEffect(new PotionEffect(HbmPotion.lead.id, 100, 2)); + } else { + entity.addPotionEffect(new PotionEffect(HbmPotion.lead.id, 100, 2)); + } + } + } + } + private static void handleDashing(Entity entity) { //AAAAAAAAAAAAAAAAAAAAEEEEEEEEEEEEEEEEEEEE diff --git a/src/main/java/com/hbm/handler/pollution/PollutionHandler.java b/src/main/java/com/hbm/handler/pollution/PollutionHandler.java index d62fd28e6..ebf943f95 100644 --- a/src/main/java/com/hbm/handler/pollution/PollutionHandler.java +++ b/src/main/java/com/hbm/handler/pollution/PollutionHandler.java @@ -169,6 +169,7 @@ public class PollutionHandler { float[] pollutionForNeightbors = new float[PollutionType.values().length]; int S = PollutionType.SOOT.ordinal(); int H = PollutionType.HEAVYMETAL.ordinal(); + int P = PollutionType.POISON.ordinal(); /* CALCULATION */ if(data.pollution[S] > 15) { @@ -178,7 +179,14 @@ public class PollutionHandler { data.pollution[S] *= 0.99F; } - data.pollution[H] *= 0.999F; + data.pollution[H] *= 0.9995F; + + if(data.pollution[P] > 10) { + pollutionForNeightbors[P] = data.pollution[P] * 0.025F; + data.pollution[P] *= 0.9F; + } else { + data.pollution[P] *= 0.995F; + } /* SPREADING */ //apply new data to self diff --git a/src/main/java/com/hbm/inventory/gui/GUICompressor.java b/src/main/java/com/hbm/inventory/gui/GUICompressor.java index e555886fa..66e72609b 100644 --- a/src/main/java/com/hbm/inventory/gui/GUICompressor.java +++ b/src/main/java/com/hbm/inventory/gui/GUICompressor.java @@ -36,7 +36,7 @@ public class GUICompressor extends GuiInfoContainer { compressor.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 107, guiTop + 18, 16, 52); this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 52, compressor.power, compressor.maxPower); - for(int j = 0; j < 5; j++) drawCustomInfoStat(mouseX, mouseY, guiLeft + 43 + j * 11, guiTop + 48, 8, 14, mouseX, mouseY, j + " PU -> " + (j + 1) + " PU"); + for(int j = 0; j < 5; j++) drawCustomInfoStat(mouseX, mouseY, guiLeft + 43 + j * 11, guiTop + 46, 8, 14, mouseX, mouseY, j + " PU -> " + (j + 1) + " PU"); } @Override diff --git a/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java b/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java index 40efef4ce..d4d263fa5 100644 --- a/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java +++ b/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java @@ -19,6 +19,8 @@ import com.hbm.explosion.vanillant.standard.BlockProcessorStandard; import com.hbm.explosion.vanillant.standard.EntityProcessorCross; import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard; import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard; +import com.hbm.handler.pollution.PollutionHandler; +import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.inventory.fluid.Fluids; import com.hbm.lib.RefStrings; import com.hbm.main.MainRegistry; @@ -318,6 +320,7 @@ public class ItemAmmoArty extends Item { mist.setPosition(mop.hitVec.xCoord - vec.xCoord, mop.hitVec.yCoord - vec.yCoord - 3, mop.hitVec.zCoord - vec.zCoord); mist.setArea(15, 7.5F); shell.worldObj.spawnEntityInWorld(mist); + PollutionHandler.incrementPollution(shell.worldObj, mop.blockX, mop.blockY, mop.blockZ, PollutionType.HEAVYMETAL, 5F); } }; this.itemTypes[PHOSGENE] = new ArtilleryShell("ammo_arty_phosgene", SpentCasing.COLOR_CASE_16INCH_NUKE) { @@ -326,18 +329,20 @@ public class ItemAmmoArty extends Item { Vec3 vec = Vec3.createVectorHelper(shell.motionX, shell.motionY, shell.motionZ).normalize(); shell.worldObj.createExplosion(shell, mop.hitVec.xCoord - vec.xCoord, mop.hitVec.yCoord - vec.yCoord, mop.hitVec.zCoord - vec.zCoord, 5F, false); for(int i = 0; i < 3; i++) { - EntityMist mist = new EntityMist(shell.worldObj); - mist.setType(Fluids.PHOSGENE); - double x = mop.hitVec.xCoord - vec.xCoord; - double z = mop.hitVec.zCoord - vec.zCoord; - if(i > 0) { - x += rand.nextGaussian() * 15; - z += rand.nextGaussian() * 15; + EntityMist mist = new EntityMist(shell.worldObj); + mist.setType(Fluids.PHOSGENE); + double x = mop.hitVec.xCoord - vec.xCoord; + double z = mop.hitVec.zCoord - vec.zCoord; + if(i > 0) { + x += rand.nextGaussian() * 15; + z += rand.nextGaussian() * 15; + } + mist.setPosition(x, mop.hitVec.yCoord - vec.yCoord - 5, z); + mist.setArea(15, 10); + shell.worldObj.spawnEntityInWorld(mist); } - mist.setPosition(x, mop.hitVec.yCoord - vec.yCoord - 5, z); - mist.setArea(15, 10); - shell.worldObj.spawnEntityInWorld(mist); - } + PollutionHandler.incrementPollution(shell.worldObj, mop.blockX, mop.blockY, mop.blockZ, PollutionType.HEAVYMETAL, 10F); + PollutionHandler.incrementPollution(shell.worldObj, mop.blockX, mop.blockY, mop.blockZ, PollutionType.POISON, 15F); } }; this.itemTypes[MUSTARD] = new ArtilleryShell("ammo_arty_mustard_gas", SpentCasing.COLOR_CASE_16INCH_NUKE) { @@ -358,6 +363,8 @@ public class ItemAmmoArty extends Item { mist.setArea(20, 10); shell.worldObj.spawnEntityInWorld(mist); } + PollutionHandler.incrementPollution(shell.worldObj, mop.blockX, mop.blockY, mop.blockZ, PollutionType.HEAVYMETAL, 15F); + PollutionHandler.incrementPollution(shell.worldObj, mop.blockX, mop.blockY, mop.blockZ, PollutionType.POISON, 30F); } }; diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 69a28216f..800a62fbb 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -41,6 +41,8 @@ import com.hbm.hazard.HazardSystem; import com.hbm.interfaces.IBomb; import com.hbm.handler.HTTPHandler; import com.hbm.handler.HbmKeybinds.EnumKeybind; +import com.hbm.handler.pollution.PollutionHandler; +import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.handler.SiegeOrchestrator; import com.hbm.items.IEquipReceiver; import com.hbm.items.ModItems; @@ -65,12 +67,14 @@ import com.hbm.potion.HbmPotion; import com.hbm.saveddata.AuxSavedData; import com.hbm.tileentity.network.RTTYSystem; import com.hbm.util.AchievementHandler; +import com.hbm.util.ArmorRegistry; import com.hbm.util.ArmorUtil; import com.hbm.util.ContaminationUtil; import com.hbm.util.EnchantmentUtil; import com.hbm.util.EntityDamageUtil; import com.hbm.util.EnumUtil; import com.hbm.util.InventoryUtil; +import com.hbm.util.ArmorRegistry.HazardClass; import com.hbm.world.generator.TimedGenerator; import cpw.mods.fml.common.eventhandler.EventPriority; @@ -1149,10 +1153,12 @@ public class ModEventHandler { @SubscribeEvent public void onBlockBreak(BreakEvent event) { - if(!(event.getPlayer() instanceof EntityPlayerMP)) + EntityPlayer player = event.getPlayer(); + + if(!(player instanceof EntityPlayerMP)) return; - if(event.block == ModBlocks.stone_gneiss && !((EntityPlayerMP) event.getPlayer()).func_147099_x().hasAchievementUnlocked(MainRegistry.achStratum)) { + if(event.block == ModBlocks.stone_gneiss && !((EntityPlayerMP) player).func_147099_x().hasAchievementUnlocked(MainRegistry.achStratum)) { event.getPlayer().triggerAchievement(MainRegistry.achStratum); event.setExpToDrop(500); } @@ -1169,6 +1175,21 @@ public class ModEventHandler { event.world.setBlock(x, y, z, ModBlocks.gas_coal); } } + + if(!ArmorRegistry.hasProtection(player, 3, HazardClass.PARTICLE_FINE)) { + + float metal = PollutionHandler.getPollution(player.worldObj, event.x, event.y, event.z, PollutionType.HEAVYMETAL); + + if(metal < 5) return; + + if(metal < 10) { + player.addPotionEffect(new PotionEffect(HbmPotion.lead.id, 100, 0)); + } else if(metal < 25) { + player.addPotionEffect(new PotionEffect(HbmPotion.lead.id, 100, 1)); + } else { + player.addPotionEffect(new PotionEffect(HbmPotion.lead.id, 100, 2)); + } + } } private static final String hash = "41eb77f138ce350932e33b6b26b233df9aad0c0c80c6a49cb9a54ddd8fae3f83"; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCombustionEngine.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCombustionEngine.java index a01fd1347..1527a9e17 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCombustionEngine.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCombustionEngine.java @@ -142,6 +142,8 @@ public class TileEntityMachineCombustionEngine extends TileEntityMachineBase imp audio = rebootAudio(audio); } + audio.keepAlive(); + } else { if(audio != null) { @@ -165,7 +167,7 @@ public class TileEntityMachineCombustionEngine extends TileEntityMachineBase imp } public AudioWrapper createAudioLoop() { - return MainRegistry.proxy.getLoopedSound("hbm:block.igeneratorOperate", xCoord, yCoord, zCoord, 1.0F, 10F, 1.0F); + return MainRegistry.proxy.getLoopedSound("hbm:block.igeneratorOperate", xCoord, yCoord, zCoord, 1.0F, 10F, 1.0F, 20); } @Override