From b7028160573aa7d95dd9b6e2b6d6e2c35e271f87 Mon Sep 17 00:00:00 2001 From: Bob Date: Sun, 8 Oct 2023 18:45:45 +0200 Subject: [PATCH] finished arc welder, fixes --- changelog | 31 +- gradle.properties | 2 +- src/main/java/com/hbm/blocks/ModBlocks.java | 2 +- .../com/hbm/blocks/machine/BlockCMAnchor.java | 51 +-- .../hbm/blocks/machine/MachineArcWelder.java | 6 + .../com/hbm/explosion/ExplosionFleija.java | 2 +- .../hbm/explosion/ExplosionNukeAdvanced.java | 64 ---- .../com/hbm/handler/nei/ArcWelderHandler.java | 60 ++++ .../hbm/handler/nei/NEIUniversalHandler.java | 2 + .../com/hbm/inventory/OreDictManager.java | 32 +- src/main/java/com/hbm/inventory/OreNames.java | 1 + .../container/ContainerMachineArcWelder.java | 86 +++++ .../hbm/inventory/fluid/tank/FluidTank.java | 28 +- .../inventory/gui/GUIMachineArcWelder.java | 60 ++++ .../inventory/material/MaterialShapes.java | 1 + .../java/com/hbm/inventory/material/Mats.java | 18 +- .../inventory/recipes/ArcWelderRecipes.java | 200 ++++++++++++ .../inventory/recipes/AssemblerRecipes.java | 39 ++- .../inventory/recipes/anvil/AnvilRecipes.java | 8 + .../recipes/loader/SerializableRecipe.java | 1 + src/main/java/com/hbm/items/ModItems.java | 4 +- src/main/java/com/hbm/lib/HbmWorldGen.java | 10 +- src/main/java/com/hbm/lib/RefStrings.java | 2 +- src/main/java/com/hbm/main/ClientProxy.java | 17 + .../java/com/hbm/main/CraftingManager.java | 14 +- src/main/java/com/hbm/main/NEIConfig.java | 1 + .../java/com/hbm/particle/ParticleHadron.java | 16 +- .../render/tileentity/RenderArcWelder.java | 37 ++- .../com/hbm/render/util/RenderDecoItem.java | 3 + .../hbm/tileentity/machine/TileEntityFEL.java | 2 +- .../machine/TileEntityMachineArcWelder.java | 293 +++++++++++++++++- .../machine/TileEntityMachineRTG.java | 2 +- .../network/TileEntityRequestNetwork.java | 2 +- src/main/java/com/hbm/util/ParticleUtil.java | 4 +- .../hbm/util/fauxpointtwelve/BlockPos.java | 10 +- src/main/resources/META-INF/HBM_at.cfg | 3 + src/main/resources/assets/hbm/lang/de_DE.lang | 3 + src/main/resources/assets/hbm/lang/en_US.lang | 3 + .../textures/blocks/cmt_terminal_front.png | Bin 0 -> 425 bytes .../hbm/textures/blocks/cmt_terminal_side.png | Bin 0 -> 448 bytes 40 files changed, 950 insertions(+), 170 deletions(-) create mode 100644 src/main/java/com/hbm/handler/nei/ArcWelderHandler.java create mode 100644 src/main/java/com/hbm/inventory/container/ContainerMachineArcWelder.java create mode 100644 src/main/java/com/hbm/inventory/gui/GUIMachineArcWelder.java create mode 100644 src/main/java/com/hbm/inventory/recipes/ArcWelderRecipes.java create mode 100644 src/main/resources/assets/hbm/textures/blocks/cmt_terminal_front.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/cmt_terminal_side.png diff --git a/changelog b/changelog index a98335f00..0cbb2b0e8 100644 --- a/changelog +++ b/changelog @@ -1,11 +1,30 @@ ## Added -* Expensive mode - * Horrible new config option that replaces several crafting items in key machine recipes with the all new heavy components - * Heavy components are 256 cast plates combined in an assembler - * +* Crystalline fullerite + * A late-game crafting material that is currenly only used to make the FEnSU + * Made from extracting fullerene from fine soot using high-performance solvent and a SILEX +* Arc welder + * Similar to an assembler, but without templates + * Can combine up to 3 items and one fluid + * Recipes vary in duration and energy consumption, welding together osmiridium plates requires the output of powerful reactors +* Custom fluids + * A config for adding custom fluid types + * Sets basic stats, color and textures + * Fluid tratis can be applied using the already existing fluid trait config + * The fluid trait config has been renamed to prevent name clashes + * Recommended greyscale textures recommended for the custom fluids are `custom_water`, `custom_lava`, `custom_oil` and `custom_toxin` + * 256k tanks do not have a label for custom fluids, but the tank's color will match the fluid's tint +* Custom machine structure positioning anchor + * Allows automatic generation of custom machine block configurations + * Simply replace the controller of your custom machine mockup with the anchor, then link it to a custom machine structure output wand and select the two diagonal points + * The resulting JSON structure will be saved in the config folder +* Welded plates + * Made from welding together two cast plates in an arc welder + * Now used in many progression-relevant machines, meaning that energy demand now more closely matches the energy production of progression-based generators + * Many recipes have been adjusted to now use cast plates or welded plates ## Changed -* Drones are now made from plastic +* Schrabidium explosions now ignore all blocks at Y:0, not just bedrock. This means that bedrock ores and oil are spared +* Drone waypoint connections only show up if a drone or a logistic block is held ## Fixed -* Fixed the new falling block implementation crashing on certain blocks \ No newline at end of file +* Fixed RTG energy connectors being backwards \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 017bb4d71..069c4d1c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod_version=1.0.27 # Empty build number makes a release type -mod_build_number=4740 +mod_build_number=4746 credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\ \ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\ diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index b3e1d84bd..ad16c99fd 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -2268,7 +2268,7 @@ public class ModBlocks { machine_catalytic_reformer = new MachineCatalyticReformer(Material.iron).setBlockName("machine_catalytic_reformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); machine_coker = new MachineCoker(Material.iron).setBlockName("machine_coker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); machine_autosaw = new MachineAutosaw().setBlockName("machine_autosaw").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); - machine_drill = new MachineMiningDrill(Material.iron).setBlockName("machine_drill").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_drill"); + machine_drill = new MachineMiningDrill(Material.iron).setBlockName("machine_drill").setHardness(5.0F).setResistance(100.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":machine_drill"); machine_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); drill_pipe = new BlockNoDrop(Material.iron).setBlockName("drill_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":drill_pipe"); machine_mining_laser = new MachineMiningLaser(Material.iron).setBlockName("machine_mining_laser").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_mining_laser"); diff --git a/src/main/java/com/hbm/blocks/machine/BlockCMAnchor.java b/src/main/java/com/hbm/blocks/machine/BlockCMAnchor.java index bafa683a3..44f60003b 100644 --- a/src/main/java/com/hbm/blocks/machine/BlockCMAnchor.java +++ b/src/main/java/com/hbm/blocks/machine/BlockCMAnchor.java @@ -13,31 +13,34 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class BlockCMAnchor extends Block { - @SideOnly(Side.CLIENT) - private IIcon iconFront; + + @SideOnly(Side.CLIENT) + private IIcon iconFront; - public BlockCMAnchor() { - super(Material.iron); - } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconRegister) { - this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":cm_terminal_front"); - this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":cm_terminal_side"); - } + public BlockCMAnchor() { + super(Material.iron); + } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int metadata) { - return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); - } - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { - int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":cmt_terminal_front"); + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":cmt_terminal_side"); + } - if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2); - if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2); - if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2); - if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2); - } + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { + int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + + if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2); + if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2); + if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2); + if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2); + } } diff --git a/src/main/java/com/hbm/blocks/machine/MachineArcWelder.java b/src/main/java/com/hbm/blocks/machine/MachineArcWelder.java index a728122bc..9cc28da0c 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineArcWelder.java +++ b/src/main/java/com/hbm/blocks/machine/MachineArcWelder.java @@ -5,6 +5,7 @@ import com.hbm.tileentity.TileEntityProxyCombo; import com.hbm.tileentity.machine.TileEntityMachineArcWelder; import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -19,6 +20,11 @@ public class MachineArcWelder extends BlockDummyable { if(meta >= 12) return new TileEntityMachineArcWelder(); return new TileEntityProxyCombo().inventory().power().fluid(); } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + return this.standardOpenBehavior(world, x, y, z, player, 0); + } @Override public int[] getDimensions() { diff --git a/src/main/java/com/hbm/explosion/ExplosionFleija.java b/src/main/java/com/hbm/explosion/ExplosionFleija.java index 3ad81f5e2..5a478fe14 100644 --- a/src/main/java/com/hbm/explosion/ExplosionFleija.java +++ b/src/main/java/com/hbm/explosion/ExplosionFleija.java @@ -96,7 +96,7 @@ public class ExplosionFleija dist = (int) Math.sqrt(dist); for (int y = (int)(dist / this.explosionCoefficient2); y > -dist / this.explosionCoefficient; y--) { - if(!(this.worldObj.getBlock(this.posX+x, this.posY+y, this.posZ+z) == Blocks.bedrock && this.posY+y <= 0) && !(this.worldObj.getBlock(this.posX+x, this.posY+y, this.posZ+z) instanceof DecoBlockAlt))this.worldObj.setBlock(this.posX+x, this.posY+y, this.posZ+z, Blocks.air); + if(this.posY + y > 0 && !(this.worldObj.getBlock(this.posX+x, this.posY+y, this.posZ+z) instanceof DecoBlockAlt))this.worldObj.setBlock(this.posX+x, this.posY+y, this.posZ+z, Blocks.air); } } } diff --git a/src/main/java/com/hbm/explosion/ExplosionNukeAdvanced.java b/src/main/java/com/hbm/explosion/ExplosionNukeAdvanced.java index ef07620ee..5893488d5 100644 --- a/src/main/java/com/hbm/explosion/ExplosionNukeAdvanced.java +++ b/src/main/java/com/hbm/explosion/ExplosionNukeAdvanced.java @@ -147,68 +147,4 @@ public class ExplosionNukeAdvanced } } } - - /*public static void mush(World world, double x, double y, double z) - { - double d = (float)x + 0.5F; - double d1 = (float)y + 0.5F; - double d2 = (float)z + 0.5F; - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1, d2, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 15, d1, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1, d2 + 15, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 15, d1, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1, d2 - 15, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 25, d1, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1, d2 + 25, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 25, d1, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1, d2 - 25, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 10, d1, d2 + 10, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 10, d1, d2 - 10, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 10, d1, d2 + 10, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 10, d1, d2 - 10, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 15, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 30, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 45, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 60, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 75, d2, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 90, d2, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 15, d1 + 90, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 90, d2 + 15, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 15, d1 + 90, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 90, d2 - 15, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 40, d1 + 90, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 90, d2 + 40, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 40, d1 + 90, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 90, d2 - 40, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 30, d1 + 90, d2 + 30, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 30, d1 + 90, d2 - 30, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 30, d1 + 90, d2 + 30, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 30, d1 + 90, d2 - 30, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 105, d2, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 30, d1 + 105, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 105, d2 + 30, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 30, d1 + 105, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 105, d2 - 30, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 20, d1 + 105, d2 + 20, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 20, d1 + 105, d2 - 20, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 20, d1 + 105, d2 + 20, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 20, d1 + 105, d2 - 20, 0.0D, 0.0D, 0.0D, 100)); - - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d + 10, d1 + 120, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 120, d2 + 10, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d - 10, d1 + 120, d2, 0.0D, 0.0D, 0.0D, 100)); - Minecraft.getMinecraft().effectRenderer.addEffect(new NukeCloudFX(world, d, d1 + 120, d2 - 10, 0.0D, 0.0D, 0.0D, 100)); - }*/ } diff --git a/src/main/java/com/hbm/handler/nei/ArcWelderHandler.java b/src/main/java/com/hbm/handler/nei/ArcWelderHandler.java new file mode 100644 index 000000000..e598840fc --- /dev/null +++ b/src/main/java/com/hbm/handler/nei/ArcWelderHandler.java @@ -0,0 +1,60 @@ +package com.hbm.handler.nei; + +import java.awt.Rectangle; +import java.util.Locale; + +import com.hbm.blocks.ModBlocks; +import com.hbm.inventory.gui.GUIMachineArcWelder; +import com.hbm.inventory.recipes.ArcWelderRecipes; +import com.hbm.inventory.recipes.ArcWelderRecipes.ArcWelderRecipe; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.item.ItemStack; + +public class ArcWelderHandler extends NEIUniversalHandler { + + public ArcWelderHandler() { + super("Arc Welder", ModBlocks.machine_arc_welder, ArcWelderRecipes.getRecipes()); + } + + @Override + public String getKey() { + return "ntmArcWelder"; + } + + @Override + public void loadTransferRects() { + super.loadTransferRects(); + transferRectsGui.add(new RecipeTransferRect(new Rectangle(67, 26, 32, 14), "ntmArcWelder")); + guiGui.add(GUIMachineArcWelder.class); + RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui); + } + + @Override + public void drawExtras(int recipe) { + + RecipeSet rec = (RecipeSet) this.arecipes.get(recipe); + Object[] original = (Object[]) rec.originalInputInstance; + ItemStack output = rec.output[0].item; + + outer: for(ArcWelderRecipe arc : ArcWelderRecipes.recipes) { + + //checks do not include the fluid, will break of there's two recipes with identical input and output but with fluids + if(ItemStack.areItemStacksEqual(arc.output, output) && arc.ingredients.length == original.length - (arc.fluid == null ? 0 : 1)) { + + for(int i = 0; i < rec.input.length - (arc.fluid == null ? 0 : 1); i++) { + if(arc.ingredients[i] != original[i]) continue outer; + } + + FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; + String duration = String.format(Locale.US, "%,d", arc.duration) + " ticks"; + String consumption = String.format(Locale.US, "%,d", arc.consumption) + " HE/t"; + int side = 160; + fontRenderer.drawString(duration, side - fontRenderer.getStringWidth(duration), 43, 0x404040); + fontRenderer.drawString(consumption, side - fontRenderer.getStringWidth(consumption), 55, 0x404040); + return; + } + } + } +} diff --git a/src/main/java/com/hbm/handler/nei/NEIUniversalHandler.java b/src/main/java/com/hbm/handler/nei/NEIUniversalHandler.java index 3f4fcbe67..0bb53100a 100644 --- a/src/main/java/com/hbm/handler/nei/NEIUniversalHandler.java +++ b/src/main/java/com/hbm/handler/nei/NEIUniversalHandler.java @@ -56,8 +56,10 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler { PositionedStack[] input; PositionedStack[] output; PositionedStack machinePositioned; + Object originalInputInstance; public RecipeSet(ItemStack[][] in, ItemStack[][] out, Object originalInputInstance /* for custom machine lookup */) { + this.originalInputInstance = originalInputInstance; input = new PositionedStack[in.length]; int[][] inPos = NEIUniversalHandler.getInputCoords(in.length); diff --git a/src/main/java/com/hbm/inventory/OreDictManager.java b/src/main/java/com/hbm/inventory/OreDictManager.java index 5a3169ae0..d62452c94 100644 --- a/src/main/java/com/hbm/inventory/OreDictManager.java +++ b/src/main/java/com/hbm/inventory/OreDictManager.java @@ -504,6 +504,7 @@ public class OreDictManager { for(NTMMaterial mat : Mats.orderedList) { if(mat.smeltable == SmeltingBehavior.SMELTABLE) { if(mat.shapes.contains(MaterialShapes.CASTPLATE)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.CASTPLATE.name() + name, new ItemStack(ModItems.plate_cast, 1, mat.id)); + if(mat.shapes.contains(MaterialShapes.WELDEDPLATE)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.WELDEDPLATE.name() + name, new ItemStack(ModItems.plate_welded, 1, mat.id)); if(mat.shapes.contains(MaterialShapes.HEAVY_COMPONENT)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.HEAVY_COMPONENT.name() + name, new ItemStack(ModItems.heavy_component, 1, mat.id)); } } @@ -603,7 +604,7 @@ public class OreDictManager { public static void registerGroups() { ANY_PLASTIC.addPrefix(INGOT, true).addPrefix(DUST, true).addPrefix(BLOCK, true); ANY_HARDPLASTIC.addPrefix(INGOT, true); - ANY_RESISTANTALLOY.addPrefix(INGOT, true).addPrefix(DUST, true).addPrefix(PLATECAST, true).addPrefix(HEAVY_COMPONENT, true).addPrefix(BLOCK, true); + ANY_RESISTANTALLOY.addPrefix(INGOT, true).addPrefix(DUST, true).addPrefix(PLATECAST, true).addPrefix(PLATEWELDED, true).addPrefix(HEAVY_COMPONENT, true).addPrefix(BLOCK, true); ANY_TAR.addPrefix(ANY, false); } @@ -651,6 +652,7 @@ public class OreDictManager { public String crystal() { return CRYSTAL + mats[0]; } public String plate() { return PLATE + mats[0]; } public String plateCast() { return PLATECAST + mats[0]; } + public String plateWelded() { return PLATEWELDED + mats[0]; } public String heavyComp() { return HEAVY_COMPONENT + mats[0]; } public String billet() { return BILLET + mats[0]; } public String block() { return BLOCK + mats[0]; } @@ -892,19 +894,21 @@ public class OreDictManager { return this; } - public String any() { return ANY + groupName; } - public String nugget() { return NUGGET + groupName; } - public String tiny() { return TINY + groupName; } - public String ingot() { return INGOT + groupName; } - public String dustTiny() { return DUSTTINY + groupName; } - public String dust() { return DUST + groupName; } - public String gem() { return GEM + groupName; } - public String crystal() { return CRYSTAL + groupName; } - public String plate() { return PLATE + groupName; } - public String plateCast() { return PLATECAST + groupName; } - public String billet() { return BILLET + groupName; } - public String block() { return BLOCK + groupName; } - public String ore() { return ORE + groupName; } + public String any() { return ANY + groupName; } + public String nugget() { return NUGGET + groupName; } + public String tiny() { return TINY + groupName; } + public String ingot() { return INGOT + groupName; } + public String dustTiny() { return DUSTTINY + groupName; } + public String dust() { return DUST + groupName; } + public String gem() { return GEM + groupName; } + public String crystal() { return CRYSTAL + groupName; } + public String plate() { return PLATE + groupName; } + public String plateCast() { return PLATECAST + groupName; } + public String plateWelded() { return PLATEWELDED + groupName; } + public String heavyComp() { return HEAVY_COMPONENT + groupName; } + public String billet() { return BILLET + groupName; } + public String block() { return BLOCK + groupName; } + public String ore() { return ORE + groupName; } } private static void addReRegistration(String original, String additional) { diff --git a/src/main/java/com/hbm/inventory/OreNames.java b/src/main/java/com/hbm/inventory/OreNames.java index 7c2e3a947..9f4efc4e1 100644 --- a/src/main/java/com/hbm/inventory/OreNames.java +++ b/src/main/java/com/hbm/inventory/OreNames.java @@ -15,6 +15,7 @@ public class OreNames { public static final String CRYSTAL = "crystal"; public static final String PLATE = "plate"; public static final String PLATECAST = "plateTriple"; //cast plates are solid plates made from 3 ingots, turns out that's literally just a GT triple plate + public static final String PLATEWELDED = "plateSextuple"; public static final String BILLET = "billet"; public static final String BLOCK = "block"; public static final String ORE = "ore"; diff --git a/src/main/java/com/hbm/inventory/container/ContainerMachineArcWelder.java b/src/main/java/com/hbm/inventory/container/ContainerMachineArcWelder.java new file mode 100644 index 000000000..9c5d516b8 --- /dev/null +++ b/src/main/java/com/hbm/inventory/container/ContainerMachineArcWelder.java @@ -0,0 +1,86 @@ +package com.hbm.inventory.container; + +import com.hbm.inventory.SlotCraftingOutput; +import com.hbm.inventory.SlotUpgrade; +import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemMachineUpgrade; +import com.hbm.tileentity.machine.TileEntityMachineArcWelder; + +import api.hbm.energy.IBatteryItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerMachineArcWelder extends Container { + + private TileEntityMachineArcWelder welder; + + public ContainerMachineArcWelder(InventoryPlayer playerInv, TileEntityMachineArcWelder tile) { + welder = tile; + + //Inputs + this.addSlotToContainer(new Slot(tile, 0, 17, 36)); + this.addSlotToContainer(new Slot(tile, 1, 35, 36)); + this.addSlotToContainer(new Slot(tile, 2, 53, 36)); + //Output + this.addSlotToContainer(new SlotCraftingOutput(playerInv.player, tile, 3, 107, 36)); + //Battery + this.addSlotToContainer(new Slot(tile, 4, 152, 72)); + //Fluid ID + this.addSlotToContainer(new Slot(tile, 5, 17, 63)); + //Upgrades + this.addSlotToContainer(new SlotUpgrade(tile, 6, 89, 63)); + this.addSlotToContainer(new SlotUpgrade(tile, 7, 107, 63)); + + for(int i = 0; i < 3; i++) { + for(int j = 0; j < 9; j++) { + this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 122 + i * 18)); + } + } + + for(int i = 0; i < 9; i++) { + this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 180)); + } + } + + @Override + public boolean canInteractWith(EntityPlayer player) { + return welder.isUseableByPlayer(player); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int index) { + ItemStack var3 = null; + Slot var4 = (Slot) this.inventorySlots.get(index); + + if(var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if(index <= 3) { + if(!this.mergeItemStack(var5, 4, this.inventorySlots.size(), true)) { + return null; + } + } else { + + if(var3.getItem() instanceof IBatteryItem || var3.getItem() == ModItems.battery_creative) { + if(!this.mergeItemStack(var5, 4, 5, false)) return null; + } else if(var3.getItem() instanceof ItemMachineUpgrade ) { + if(!this.mergeItemStack(var5, 6, 8, false)) return null; + } else { + if(!this.mergeItemStack(var5, 0, 3, false)) return null; + } + } + + if(var5.stackSize == 0) { + var4.putStack((ItemStack) null); + } else { + var4.onSlotChanged(); + } + } + + return var3; + } +} 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 d3c787fd1..4294759bb 100644 --- a/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java +++ b/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java @@ -200,8 +200,11 @@ public class FluidTank { * @param width * @param height */ - //TODO: add a directional parameter to allow tanks to grow horizontally public void renderTank(int x, int y, double z, int width, int height) { + renderTank(x, y, z, width, height, 0); + } + + public void renderTank(int x, int y, double z, int width, int height, int orientation) { GL11.glEnable(GL11.GL_BLEND); @@ -218,15 +221,32 @@ public class FluidTank { int i = (fluid * height) / maxFluid; double minX = x; - double maxX = x + width; - double minY = y + (height - i); - double maxY = y + height; + double maxX = x; + double minY = y; + double maxY = y; double minV = 1D - i / 16D; double maxV = 1D; double minU = 0D; double maxU = width / 16D; + if(orientation == 0) { + maxX += width; + minY += height - i; + maxY += height; + } + + if(orientation == 1) { + i = (fluid * width) / maxFluid; + maxX += i; + maxY += height; + + minV = 0; + maxV = height / 16D; + minU = 0D; + maxU = width / 16D; + } + Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(minX, maxY, z, minU, maxV); diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineArcWelder.java b/src/main/java/com/hbm/inventory/gui/GUIMachineArcWelder.java new file mode 100644 index 000000000..1e55234b2 --- /dev/null +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineArcWelder.java @@ -0,0 +1,60 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.container.ContainerMachineArcWelder; +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.machine.TileEntityMachineArcWelder; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUIMachineArcWelder extends GuiInfoContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_arc_welder.png"); + private TileEntityMachineArcWelder welder; + + public GUIMachineArcWelder(InventoryPlayer playerInv, TileEntityMachineArcWelder tile) { + super(new ContainerMachineArcWelder(playerInv, tile)); + + this.welder = tile; + this.xSize = 176; + this.ySize = 204; + } + + @Override + public void drawScreen(int x, int y, float interp) { + super.drawScreen(x, y, interp); + + welder.tank.renderTankInfo(this, x, y, guiLeft + 35, guiTop + 63, 34, 16); + this.drawElectricityInfo(this, x, y, guiLeft + 152, guiTop + 18, 16, 52, welder.power, welder.maxPower); + } + + @Override + protected void drawGuiContainerForegroundLayer(int i, int j) { + String name = this.welder.hasCustomInventoryName() ? this.welder.getInventoryName() : I18n.format(this.welder.getInventoryName()); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2 - 18, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + int p = (int) (welder.power * 52 / welder.maxPower); + drawTexturedModalRect(guiLeft + 152, guiTop + 70 - p, 176, 52 - p, 16, p); + + int i = welder.progress * 33 / welder.processTime; + drawTexturedModalRect(guiLeft + 72, guiTop + 37, 192, 0, i, 14); + + if(welder.power >= welder.consumption) { + drawTexturedModalRect(guiLeft + 156, guiTop + 4, 176, 52, 9, 12); + } + + welder.tank.renderTank(guiLeft + 35, guiTop + 79, this.zLevel, 34, 16, 1); + } +} diff --git a/src/main/java/com/hbm/inventory/material/MaterialShapes.java b/src/main/java/com/hbm/inventory/material/MaterialShapes.java index 9b901a520..12a1f9a9d 100644 --- a/src/main/java/com/hbm/inventory/material/MaterialShapes.java +++ b/src/main/java/com/hbm/inventory/material/MaterialShapes.java @@ -20,6 +20,7 @@ public class MaterialShapes { public static final MaterialShapes DUST = new MaterialShapes(INGOT.quantity, "dust"); public static final MaterialShapes PLATE = new MaterialShapes(INGOT.quantity, "plate"); public static final MaterialShapes CASTPLATE = new MaterialShapes(INGOT.quantity * 3, "plateTriple"); + public static final MaterialShapes WELDEDPLATE = new MaterialShapes(INGOT.quantity * 6, "plateSextuple"); public static final MaterialShapes QUART = new MaterialShapes(162); public static final MaterialShapes BLOCK = new MaterialShapes(INGOT.quantity * 9, "block"); public static final MaterialShapes HEAVY_COMPONENT = new MaterialShapes(CASTPLATE.quantity * 256, "componentHeavy"); diff --git a/src/main/java/com/hbm/inventory/material/Mats.java b/src/main/java/com/hbm/inventory/material/Mats.java index e312ff256..74949b37f 100644 --- a/src/main/java/com/hbm/inventory/material/Mats.java +++ b/src/main/java/com/hbm/inventory/material/Mats.java @@ -54,7 +54,7 @@ public class Mats { public static final NTMMaterial MAT_PETCOKE = make( 1411, PETCOKE) .setConversion(MAT_CARBON, 4, 3); public static final NTMMaterial MAT_LIGCOKE = make( 1412, LIGCOKE) .setConversion(MAT_CARBON, 4, 3); public static final NTMMaterial MAT_GRAPHITE = make( 1420, GRAPHITE) .setConversion(MAT_CARBON, 1, 1); - public static final NTMMaterial MAT_IRON = makeSmeltable(2600, IRON, 0xFFFFFF, 0x353535, 0xFFA259).setShapes(CASTPLATE); + public static final NTMMaterial MAT_IRON = makeSmeltable(2600, IRON, 0xFFFFFF, 0x353535, 0xFFA259).setShapes(CASTPLATE, WELDEDPLATE); public static final NTMMaterial MAT_GOLD = makeSmeltable(7900, GOLD, 0xFFFF8B, 0xC26E00, 0xE8D754).setShapes(CASTPLATE); public static final NTMMaterial MAT_REDSTONE = makeSmeltable(_VS + 01, REDSTONE, 0xE3260C, 0x700E06, 0xFF1000); public static final NTMMaterial MAT_OBSIDIAN = makeSmeltable(_VS + 02, df("Obsidian"), 0x3D234D); @@ -94,9 +94,9 @@ public class Mats { public static final NTMMaterial MAT_GHIORSIUM = makeSmeltable(12836, GH336, 0xF4EFE1, 0x2A3306, 0xC6C6A1).setShapes(NUGGET, BILLET, INGOT, BLOCK); //Base metals - public static final NTMMaterial MAT_TITANIUM = makeSmeltable(2200, TI, 0xF7F3F2, 0x4F4C4B, 0xA99E79).setShapes(INGOT, DUST, PLATE, CASTPLATE, BLOCK, HEAVY_COMPONENT); + public static final NTMMaterial MAT_TITANIUM = makeSmeltable(2200, TI, 0xF7F3F2, 0x4F4C4B, 0xA99E79).setShapes(INGOT, DUST, PLATE, CASTPLATE, WELDEDPLATE, BLOCK, HEAVY_COMPONENT); public static final NTMMaterial MAT_COPPER = makeSmeltable(2900, CU, 0xFDCA88, 0x601E0D, 0xC18336).setShapes(WIRE, INGOT, DUST, PLATE, CASTPLATE, BLOCK, HEAVY_COMPONENT); - public static final NTMMaterial MAT_TUNGSTEN = makeSmeltable(7400, W, 0x868686, 0x000000, 0x977474).setShapes(WIRE, INGOT, DUST, CASTPLATE, BLOCK, HEAVY_COMPONENT); + public static final NTMMaterial MAT_TUNGSTEN = makeSmeltable(7400, W, 0x868686, 0x000000, 0x977474).setShapes(WIRE, INGOT, DUST, CASTPLATE, WELDEDPLATE, BLOCK, HEAVY_COMPONENT); public static final NTMMaterial MAT_ALUMINIUM = makeSmeltable(1300, AL, 0xFFFFFF, 0x344550, 0xD0B8EB).setShapes(WIRE, INGOT, DUST, PLATE, CASTPLATE, BLOCK, HEAVY_COMPONENT); public static final NTMMaterial MAT_LEAD = makeSmeltable(8200, PB, 0xA6A6B2, 0x03030F, 0x646470).setShapes(NUGGET, INGOT, DUST, PLATE, CASTPLATE, BLOCK, HEAVY_COMPONENT); public static final NTMMaterial MAT_BISMUTH = makeSmeltable(8300, BI, 0xB200FF).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK); @@ -106,13 +106,13 @@ public class Mats { public static final NTMMaterial MAT_BERYLLIUM = makeSmeltable(400, BE, 0xB2B2A6, 0x0F0F03, 0xAE9572).setShapes(NUGGET, INGOT, DUST, BLOCK); public static final NTMMaterial MAT_COBALT = makeSmeltable(2700, CO, 0xC2D1EE, 0x353554, 0x8F72AE).setShapes(NUGGET, DUSTTINY, BILLET, INGOT, DUST, BLOCK); public static final NTMMaterial MAT_BORON = makeSmeltable(500, B, 0xBDC8D2, 0x29343E, 0xAD72AE).setShapes(DUSTTINY, INGOT, DUST, BLOCK); - public static final NTMMaterial MAT_ZIRCONIUM = makeSmeltable(4000, ZR, 0xE3DCBE, 0x3E3719, 0xADA688).setShapes(NUGGET, DUSTTINY, BILLET, INGOT, DUST, CASTPLATE, BLOCK); + public static final NTMMaterial MAT_ZIRCONIUM = makeSmeltable(4000, ZR, 0xE3DCBE, 0x3E3719, 0xADA688).setShapes(NUGGET, DUSTTINY, BILLET, INGOT, DUST, CASTPLATE, WELDEDPLATE, BLOCK); public static final NTMMaterial MAT_LITHIUM = makeSmeltable(300, LI, 0xFFFFFF, 0x818181, 0xD6D6D6).setShapes(INGOT, DUST, BLOCK); public static final NTMMaterial MAT_CADMIUM = makeSmeltable(4800, CD, 0xFFFADE, 0x350000, 0xA85600).setShapes(INGOT, DUST); - public static final NTMMaterial MAT_OSMIRIDIUM = makeSmeltable(7699, OSMIRIDIUM, 0xDBE3EF, 0x7891BE, 0xACBDD9).setShapes(NUGGET, INGOT, CASTPLATE); + public static final NTMMaterial MAT_OSMIRIDIUM = makeSmeltable(7699, OSMIRIDIUM, 0xDBE3EF, 0x7891BE, 0xACBDD9).setShapes(NUGGET, INGOT, CASTPLATE, WELDEDPLATE); //Alloys - public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0xAFAFAF, 0x0F0F0F, 0x4A4A4A).setShapes(DUSTTINY, INGOT, DUST, PLATE, CASTPLATE, BLOCK, HEAVY_COMPONENT); + public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0xAFAFAF, 0x0F0F0F, 0x4A4A4A).setShapes(DUSTTINY, INGOT, DUST, PLATE, CASTPLATE, WELDEDPLATE, BLOCK, HEAVY_COMPONENT); public static final NTMMaterial MAT_MINGRADE = makeSmeltable(_AS + 1, MINGRADE, 0xFFBA7D, 0xAF1700, 0xE44C0F).setShapes(WIRE, INGOT, DUST, BLOCK); public static final NTMMaterial MAT_ALLOY = makeSmeltable(_AS + 2, ALLOY, 0xFF8330, 0x700000, 0xFF7318).setShapes(WIRE, INGOT, DUST, PLATE, CASTPLATE, BLOCK, HEAVY_COMPONENT); public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0x183039, 0x030B0B, 0x376373).setShapes(INGOT, DUST, BLOCK); @@ -120,10 +120,10 @@ public class Mats { public static final NTMMaterial MAT_DESH = makeSmeltable(_AS + 12, DESH, 0xFF6D6D, 0x720000, 0xF22929).setShapes(INGOT, DUST, CASTPLATE, BLOCK, HEAVY_COMPONENT); public static final NTMMaterial MAT_STAR = makeSmeltable(_AS + 5, STAR, 0xCCCCEA, 0x11111A, 0xA5A5D3).setShapes(INGOT, DUST, BLOCK); public static final NTMMaterial MAT_FERRO = makeSmeltable(_AS + 7, FERRO, 0xB7B7C9, 0x101022, 0x6B6B8B).setShapes(INGOT); - public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0xD4D6D6, 0x323D3D, 0x9CA6A6).setShapes(INGOT, DUST, CASTPLATE, HEAVY_COMPONENT); - public static final NTMMaterial MAT_CDALLOY = makeSmeltable(_AS + 13, CDALLOY, 0xF7DF8F, 0x604308, 0xFBD368).setShapes(INGOT, CASTPLATE, HEAVY_COMPONENT); + public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0xD4D6D6, 0x323D3D, 0x9CA6A6).setShapes(INGOT, DUST, CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT); + public static final NTMMaterial MAT_CDALLOY = makeSmeltable(_AS + 13, CDALLOY, 0xF7DF8F, 0x604308, 0xFBD368).setShapes(INGOT, CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT); public static final NTMMaterial MAT_MAGTUNG = makeSmeltable(_AS + 8, MAGTUNG, 0x22A2A2, 0x0F0F0F, 0x22A2A2).setShapes(INGOT, DUST, BLOCK); - public static final NTMMaterial MAT_CMB = makeSmeltable(_AS + 9, CMB, 0x6F6FB4, 0x000011, 0x6F6FB4).setShapes(INGOT, DUST, PLATE, CASTPLATE, BLOCK); + public static final NTMMaterial MAT_CMB = makeSmeltable(_AS + 9, CMB, 0x6F6FB4, 0x000011, 0x6F6FB4).setShapes(INGOT, DUST, PLATE, CASTPLATE, WELDEDPLATE, BLOCK); public static final NTMMaterial MAT_FLUX = makeAdditive(_AS + 10, df("Flux"), 0xF1E0BB, 0x6F6256, 0xDECCAD).setShapes(DUST); public static final NTMMaterial MAT_SLAG = makeSmeltable(_AS + 11, SLAG, 0x554940, 0x34281F, 0x6C6562).setShapes(BLOCK); public static final NTMMaterial MAT_MUD = makeSmeltable(_AS + 14, MUD, 0xBCB5A9, 0x481213, 0x96783B).setShapes(INGOT); diff --git a/src/main/java/com/hbm/inventory/recipes/ArcWelderRecipes.java b/src/main/java/com/hbm/inventory/recipes/ArcWelderRecipes.java new file mode 100644 index 000000000..8591f971c --- /dev/null +++ b/src/main/java/com/hbm/inventory/recipes/ArcWelderRecipes.java @@ -0,0 +1,200 @@ +package com.hbm.inventory.recipes; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import static com.hbm.inventory.OreDictManager.*; + +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.RecipesCommon.AStack; +import com.hbm.inventory.RecipesCommon.ComparableStack; +import com.hbm.inventory.RecipesCommon.OreDictStack; +import com.hbm.inventory.fluid.Fluids; +import com.hbm.inventory.material.Mats; +import com.hbm.inventory.recipes.loader.SerializableRecipe; +import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemFluidIcon; + +import net.minecraft.item.ItemStack; + +public class ArcWelderRecipes extends SerializableRecipe { + + public static List recipes = new ArrayList(); + + @Override + public void registerDefaults() { + + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.motor), 100, 200L, + new OreDictStack(IRON.plate(), 2), new ComparableStack(ModItems.coil_copper), new ComparableStack(ModItems.coil_copper_torus))); + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.motor), 100, 400L, + new OreDictStack(STEEL.plate(), 1), new ComparableStack(ModItems.coil_copper), new ComparableStack(ModItems.coil_copper_torus))); + + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.circuit_copper), 100, 1_000L, new FluidStack(Fluids.GAS, 250), + new ComparableStack(ModItems.circuit_aluminium, 1), new OreDictStack(NETHERQUARTZ.dust()), new ComparableStack(ModItems.wire_copper, 8))); + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.circuit_red_copper), 100, 2_500L, new FluidStack(Fluids.PETROLEUM, 250), + new ComparableStack(ModItems.circuit_copper, 1), new OreDictStack(GOLD.dust()), new ComparableStack(ModItems.wire_red_copper, 8))); + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.circuit_gold), 100, 10_000L, new FluidStack(Fluids.UNSATURATEDS, 250), + new ComparableStack(ModItems.circuit_red_copper, 1), new OreDictStack(ANY_PLASTIC.ingot()), new ComparableStack(ModItems.wire_gold, 8))); + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.circuit_schrabidium), 100, 50_000L, new FluidStack(Fluids.SOURGAS, 250), + new ComparableStack(ModItems.circuit_gold, 1), new OreDictStack(DESH.ingot()), new ComparableStack(ModItems.wire_schrabidium, 8))); + + //earlygame welded parts + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_IRON.id), 100, 100L, + new OreDictStack(IRON.plateCast(), 2))); + //high-demand mid-game parts + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_STEEL.id), 100, 500L, + new OreDictStack(STEEL.plateCast(), 2))); + //mid-game, single combustion engine running on LPG + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_TITANIUM.id), 600, 50_000L, + new OreDictStack(TI.plateCast(), 2))); + //mid-game PWR + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_ZIRCONIUM.id), 600, 10_000L, + new OreDictStack(ZR.plateCast(), 2))); + //late-game fusion + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_TCALLOY.id), 1_200, 1_000_000L, new FluidStack(Fluids.OXYGEN, 1_000), + new OreDictStack(TCALLOY.plateCast(), 2))); + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_CDALLOY.id), 1_200, 1_000_000L, new FluidStack(Fluids.OXYGEN, 1_000), + new OreDictStack(CDALLOY.plateCast(), 2))); + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_TUNGSTEN.id), 1_200, 250_000L, new FluidStack(Fluids.OXYGEN, 1_000), + new OreDictStack(W.plateCast(), 2))); + //pre-DFC + recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_OSMIRIDIUM.id), 6_000, 20_000_000L, new FluidStack(Fluids.REFORMGAS, 16_000), + new OreDictStack(OSMIRIDIUM.plateCast(), 2))); + } + + public static HashMap getRecipes() { + + HashMap recipes = new HashMap(); + + for(ArcWelderRecipe recipe : ArcWelderRecipes.recipes) { + + int size = recipe.ingredients.length + (recipe.fluid != null ? 1 : 0); + Object[] array = new Object[size]; + + for(int i = 0; i < recipe.ingredients.length; i++) { + array[i] = recipe.ingredients[i]; + } + + if(recipe.fluid != null) array[size - 1] = ItemFluidIcon.make(recipe.fluid); + + recipes.put(array, recipe.output); + } + + return recipes; + } + + public static ArcWelderRecipe getRecipe(ItemStack... inputs) { + + outer: + for(ArcWelderRecipe recipe : recipes) { + + List recipeList = new ArrayList(); + for(AStack ingredient : recipe.ingredients) recipeList.add(ingredient); + + for(int i = 0; i < inputs.length; i++) { + + ItemStack inputStack = inputs[i]; + + if(inputStack != null) { + + boolean hasMatch = false; + Iterator iterator = recipeList.iterator(); + + while(iterator.hasNext()) { + AStack recipeStack = iterator.next(); + + if(recipeStack.matchesRecipe(inputStack, true) && inputStack.stackSize >= recipeStack.stacksize) { + hasMatch = true; + recipeList.remove(recipeStack); + break; + } + } + + if(!hasMatch) { + continue outer; + } + } + } + + if(recipeList.isEmpty()) return recipe; + } + + return null; + } + + @Override + public String getFileName() { + return "hbmArcWelder.json"; + } + + @Override + public Object getRecipeObject() { + return recipes; + } + + @Override + public void deleteRecipes() { + recipes.clear(); + } + + @Override + public void readRecipe(JsonElement recipe) { + JsonObject obj = (JsonObject) recipe; + + AStack[] inputs = this.readAStackArray(obj.get("inputs").getAsJsonArray()); + FluidStack fluid = obj.has("fluid") ? this.readFluidStack(obj.get("fluid").getAsJsonArray()) : null; + ItemStack output = this.readItemStack(obj.get("output").getAsJsonArray()); + int duration = obj.get("duration").getAsInt(); + long consumption = obj.get("consumption").getAsLong(); + + recipes.add(new ArcWelderRecipe(output, duration, consumption, fluid, inputs)); + } + + @Override + public void writeRecipe(Object obj, JsonWriter writer) throws IOException { + ArcWelderRecipe recipe = (ArcWelderRecipe) obj; + + writer.name("inputs").beginArray(); + for(AStack aStack : recipe.ingredients) { + this.writeAStack(aStack, writer); + } + writer.endArray(); + + if(recipe.fluid != null) { + writer.name("fluid"); + this.writeFluidStack(recipe.fluid, writer); + } + + this.writeItemStack(recipe.output, writer); + + writer.name("duration").value(recipe.duration); + writer.name("consumption").value(recipe.consumption); + } + + public static class ArcWelderRecipe { + + public AStack[] ingredients; + public FluidStack fluid; + public ItemStack output; + public int duration; + public long consumption; + + public ArcWelderRecipe(ItemStack output, int duration, long consumption, FluidStack fluid, AStack... ingredients) { + this.ingredients = ingredients; + this.fluid = fluid; + this.output = output; + this.duration = duration; + this.consumption = consumption; + } + + public ArcWelderRecipe(ItemStack output, int duration, long consumption, AStack... ingredients) { + this(output, duration, consumption, null, ingredients); + } + } +} diff --git a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java index d136042b1..ae318932e 100644 --- a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java @@ -274,38 +274,37 @@ public class AssemblerRecipes { makeRecipe(new ComparableStack(ModBlocks.machine_centrifuge, 1), new AStack[] {new ComparableStack(ModItems.centrifuge_element, 1), new OreDictStack(ANY_PLASTIC.ingot(), 2), new OreDictStack(STEEL.plate528(), 8), new OreDictStack(CU.plate(), 8), new ComparableStack(ModItems.circuit_copper, 1), }, 200); makeRecipe(new ComparableStack(ModBlocks.machine_gascent, 1), new AStack[] {new ComparableStack(ModItems.centrifuge_element, 4), new OreDictStack(ANY_PLASTIC.ingot(), 4), new OreDictStack(DESH.ingot(), 2), new OreDictStack(STEEL.plate528(), 8), new ComparableStack(ModItems.coil_tungsten, 4), new ComparableStack(ModItems.circuit_red_copper, 1) }, 300); makeRecipe(new ComparableStack(ModBlocks.machine_rtg_furnace_off, 1), new AStack[] {new ComparableStack(Blocks.furnace, 1), new ComparableStack(ModItems.rtg_unit, 3), new OreDictStack(PB.plate528(), 6), new OreDictStack(OreDictManager.getReflector(), 4), new OreDictStack(CU.plate(), 2), },150); - makeRecipe(new ComparableStack(ModBlocks.machine_diesel, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 1), new ComparableStack(ModItems.piston_selenium, 1), new OreDictStack(STEEL.ingot(), 6), new OreDictStack(CU.plate(), 4), new ComparableStack(ModItems.coil_copper, 4), }, 100); + makeRecipe(new ComparableStack(ModBlocks.machine_diesel, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 1), new ComparableStack(ModItems.piston_selenium, 1), new OreDictStack(IRON.plateWelded(), 1), new OreDictStack(CU.plate(), 4), new ComparableStack(ModItems.coil_copper, 4), }, 100); makeRecipe(new ComparableStack(ModBlocks.machine_selenium, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(TI.plate(), 6), new OreDictStack(CU.plate(), 8), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.hull_small_steel, 9), new ComparableStack(ModItems.pedestal_steel, 1), new ComparableStack(ModItems.coil_copper, 4), },250); makeRecipe(new ComparableStack(ModBlocks.machine_rtg_grey, 1), new AStack[] {new ComparableStack(ModItems.rtg_unit, 3), new OreDictStack(STEEL.plate528(), 4), new ComparableStack(ModItems.wire_red_copper, 4), new OreDictStack(ANY_PLASTIC.ingot(), 3), },200); - makeRecipe(new ComparableStack(ModBlocks.machine_battery, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(S.dust(), 12), new OreDictStack(PB.dust(), 12), new OreDictStack(MINGRADE.ingot(), 2), new ComparableStack(ModItems.wire_red_copper, 4), },200); + makeRecipe(new ComparableStack(ModBlocks.machine_battery, 1), new AStack[] {new OreDictStack(STEEL.plateWelded(), 1), new OreDictStack(S.dust(), 12), new OreDictStack(PB.dust(), 12), new OreDictStack(MINGRADE.ingot(), 2), new ComparableStack(ModItems.wire_red_copper, 4), },200); makeRecipe(new ComparableStack(ModBlocks.machine_lithium_battery, 1), new AStack[] {new OreDictStack(ANY_PLASTIC.ingot(), 4), new OreDictStack(CO.dust(), 12), new OreDictStack(LI.dust(), 12), new OreDictStack(ALLOY.ingot(), 2), new ComparableStack(ModItems.wire_red_copper, 4), },400); makeRecipe(new ComparableStack(ModBlocks.machine_schrabidium_battery, 1), new AStack[] {new OreDictStack(DESH.ingot(), 4), new OreDictStack(NP237.dust(), 12), new OreDictStack(SA326.dust(), 12), new OreDictStack(SA326.ingot(), 2), new ComparableStack(ModItems.wire_schrabidium, 4), },800); makeRecipe(new ComparableStack(ModBlocks.machine_dineutronium_battery, 1), new AStack[] {new OreDictStack(DNT.ingot(), 24), new ComparableStack(ModItems.powder_spark_mix, 12), new ComparableStack(ModItems.battery_spark_cell_1000, 1), new OreDictStack(CMB.ingot(), 32), new ComparableStack(ModItems.coil_magnetized_tungsten, 8), },1600); - makeRecipe(new ComparableStack(ModBlocks.machine_shredder, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 2), new OreDictStack(STEEL.plate528(), 4), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.wire_red_copper, 2), new ComparableStack(ModBlocks.steel_beam, 2), new ComparableStack(Blocks.iron_bars, 2), new ComparableStack(ModBlocks.red_wire_coated, 1), },200); + makeRecipe(new ComparableStack(ModBlocks.machine_shredder, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 8), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModBlocks.steel_beam, 2), new ComparableStack(Blocks.iron_bars, 2) },200); makeRecipe(new ComparableStack(ModBlocks.machine_well, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 20), new ComparableStack(ModBlocks.steel_beam, 8), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.pipes_steel, 3), new ComparableStack(ModItems.drill_titanium, 1), new ComparableStack(ModItems.wire_red_copper, 6), },250); - makeRecipe(new ComparableStack(ModBlocks.machine_pumpjack, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 8), new OreDictStack(STEEL.block(), 8), new ComparableStack(ModItems.pipes_steel, 4), new ComparableStack(ModItems.tank_steel, 4), new OreDictStack(STEEL.ingot(), 24), new OreDictStack(STEEL.plate(), 16), new OreDictStack(AL.plate(), 6), new ComparableStack(ModItems.drill_titanium, 1), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.wire_red_copper, 8), },400); + makeRecipe(new ComparableStack(ModBlocks.machine_pumpjack, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 8), new OreDictStack(STEEL.plateWelded(), 8), new ComparableStack(ModItems.pipes_steel, 4), new ComparableStack(ModItems.tank_steel, 4), new OreDictStack(STEEL.plate(), 32), new ComparableStack(ModItems.drill_titanium, 1), new ComparableStack(ModItems.motor, 2) }, 400); makeRecipe(new ComparableStack(ModBlocks.machine_flare, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 12), new OreDictStack(IRON.ingot(), 12), new OreDictStack(CU.plate528(), 4), new ComparableStack(ModItems.tank_steel, 1), new ComparableStack(ModBlocks.deco_pipe_quad, 8), new ComparableStack(ModItems.hull_small_steel, 4), new ComparableStack(ModItems.thermo_element, 3), },200); - makeRecipe(new ComparableStack(ModBlocks.machine_coker, 1), new AStack[] {!exp ? new OreDictStack(STEEL.plate(), 24) : new OreDictStack(STEEL.heavyComp(), 2), new OreDictStack(IRON.ingot(), 12), new OreDictStack(CU.plate528(), 8), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModBlocks.steel_grate, 4) },200); - makeRecipe(new ComparableStack(ModBlocks.machine_refinery, 1), new AStack[] {!exp ? new OreDictStack(STEEL.plate528(), 16) : new OreDictStack(STEEL.heavyComp(), 1), new OreDictStack(CU.plate(), 16), new ComparableStack(ModItems.hull_big_steel, 6), new ComparableStack(ModItems.pipes_steel, 2), new ComparableStack(ModItems.plate_polymer, 8), new ComparableStack(ModItems.circuit_red_copper, 1) },350); + makeRecipe(new ComparableStack(ModBlocks.machine_coker, 1), new AStack[] {!exp ? new OreDictStack(STEEL.plateWelded(), 4) : new OreDictStack(STEEL.heavyComp(), 2), new OreDictStack(IRON.ingot(), 12), new OreDictStack(CU.plate528(), 8), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModBlocks.steel_grate, 4) },200); + makeRecipe(new ComparableStack(ModBlocks.machine_refinery, 1), new AStack[] {!exp ? new OreDictStack(STEEL.plateWelded(), 3) : new OreDictStack(STEEL.heavyComp(), 1), new OreDictStack(CU.plate528(), 16), new ComparableStack(ModItems.hull_big_steel, 6), new ComparableStack(ModItems.pipes_steel, 2), new ComparableStack(ModItems.plate_polymer, 8), new ComparableStack(ModItems.circuit_red_copper, 1) },350); makeRecipe(new ComparableStack(ModBlocks.machine_epress, 1), new AStack[] {new OreDictStack(STEEL.plate(), 8), new ComparableStack(ModItems.plate_polymer, 4), new ComparableStack(ModItems.part_generic, 2, EnumPartType.PISTON_HYDRAULIC.ordinal()), new ComparableStack(ModItems.circuit_copper, 1) }, 100); makeRecipe(new ComparableStack(ModBlocks.machine_chemplant, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(CU.plate528(), 6), new ComparableStack(ModItems.tank_steel, 4), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.coil_tungsten, 3), new ComparableStack(ModItems.circuit_copper, 2), new ComparableStack(ModItems.circuit_red_copper, 1), new ComparableStack(ModItems.plate_polymer, 8), },200); - makeRecipe(new ComparableStack(ModBlocks.machine_crystallizer, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 4), new ComparableStack(ModItems.pipes_steel, 1), new OreDictStack(DESH.ingot(), 4), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.blades_advanced_alloy, 2), new OreDictStack(STEEL.ingot(), 16), new OreDictStack(TI.plate(), 16), new ComparableStack(Blocks.glass, 4), new ComparableStack(ModItems.circuit_gold, 1), },400); + makeRecipe(new ComparableStack(ModBlocks.machine_crystallizer, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 4), new ComparableStack(ModItems.pipes_steel, 1), new OreDictStack(DESH.ingot(), 4), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.blades_advanced_alloy, 2), new OreDictStack(STEEL.plateWelded(), 4), new OreDictStack(TI.plate(), 16), new ComparableStack(Blocks.glass, 4), new ComparableStack(ModItems.circuit_gold, 1), },400); makeRecipe(new ComparableStack(ModBlocks.machine_fluidtank, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 2), new OreDictStack(STEEL.plate528(), 6), new ComparableStack(ModItems.hull_big_steel, 4), new OreDictStack(ANY_TAR.any(), 4), },150); - makeRecipe(new ComparableStack(ModBlocks.machine_bat9000, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 16), new OreDictStack(ANY_RESISTANTALLOY.ingot(), 16), new ComparableStack(ModBlocks.steel_scaffold, 16), new OreDictStack(ANY_TAR.any(), 16), },150); - makeRecipe(new ComparableStack(ModBlocks.machine_orbus, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 12), new OreDictStack(ANY_RESISTANTALLOY.ingot(), 12), new OreDictStack(BIGMT.plate(), 12), new ComparableStack(ModItems.coil_advanced_alloy, 12), new ComparableStack(ModItems.battery_sc_polonium, 1) }, 200); - makeRecipe(new ComparableStack(ModBlocks.machine_drill, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 6), new OreDictStack(STEEL.ingot(), 4), new ComparableStack(ModItems.wire_red_copper, 4), new ComparableStack(ModItems.circuit_copper, 1), new ComparableStack(ModItems.motor, 1), new OreDictStack(DURA.ingot(), 2), new ComparableStack(ModItems.bolt_dura_steel, 2), new ComparableStack(ModItems.drill_titanium, 1), },200); + makeRecipe(new ComparableStack(ModBlocks.machine_bat9000, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 16), new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 3), new ComparableStack(ModBlocks.steel_scaffold, 16), new OreDictStack(ANY_TAR.any(), 16), },150); + makeRecipe(new ComparableStack(ModBlocks.machine_orbus, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 12), new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 8), new OreDictStack(BIGMT.plate(), 12), new ComparableStack(ModItems.coil_advanced_alloy, 12), new ComparableStack(ModItems.battery_sc_polonium, 1) }, 200); makeRecipe(new ComparableStack(ModBlocks.machine_mining_laser, 1), new AStack[] {new ComparableStack(ModItems.tank_steel, 3), !exp ? new OreDictStack(STEEL.plate528(), 16) : new OreDictStack(STEEL.heavyComp(), 3), new ComparableStack(ModItems.crystal_redstone, 3), new ComparableStack(Items.diamond, 3), new OreDictStack(ANY_PLASTIC.ingot(), 4), new ComparableStack(ModItems.motor, 3), !exp ? new OreDictStack(DURA.ingot(), 4) : new OreDictStack(DESH.heavyComp(), 1), new ComparableStack(ModItems.bolt_dura_steel, 6), new ComparableStack(ModBlocks.machine_battery, 3), },400); makeRecipe(new ComparableStack(ModBlocks.machine_turbofan, 1), new AStack[] {!exp ? new ComparableStack(ModItems.hull_big_steel, 1) : new OreDictStack(STEEL.heavyComp(), 1), new ComparableStack(ModItems.hull_big_titanium, 3), new ComparableStack(ModItems.hull_small_steel, 2), new ComparableStack(ModItems.turbine_tungsten, 1), new ComparableStack(ModItems.turbine_titanium, 7), new ComparableStack(ModItems.bolt_compound, 8), new OreDictStack(MINGRADE.ingot(), 12), new ComparableStack(ModItems.wire_red_copper, 24), },500); makeRecipe(new ComparableStack(ModBlocks.machine_turbinegas, 1), new AStack[] {!exp ? new ComparableStack(ModItems.hull_big_steel, 4) : new OreDictStack(STEEL.heavyComp(), 2), new ComparableStack(ModItems.hull_small_steel, 6), new ComparableStack(ModItems.generator_steel, 2), new ComparableStack(ModItems.bolt_compound, 4), new ComparableStack(ModBlocks.steel_scaffold, 8), new ComparableStack(ModBlocks.deco_pipe_quad, 4), new ComparableStack(ModItems.turbine_tungsten, 3), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.ingot_rubber, 4), new ComparableStack(ModItems.circuit_red_copper, 3)}, 600); makeRecipe(new ComparableStack(ModBlocks.machine_teleporter, 1), new AStack[] {new OreDictStack(TI.ingot(), 8), new OreDictStack(ALLOY.plate528(), 12), new ComparableStack(ModItems.wire_gold, 32), new ComparableStack(ModItems.entanglement_kit, 1), new ComparableStack(ModBlocks.machine_battery, 1) },300); - makeRecipe(new ComparableStack(ModBlocks.machine_schrabidium_transmutator, 1), new AStack[] {new OreDictStack(MAGTUNG.ingot(), 1), !exp ? new OreDictStack(TI.ingot(), 24) : new OreDictStack(TI.heavyComp(), 2), !exp ? new OreDictStack(ALLOY.plate(), 18) : new OreDictStack(ALLOY.heavyComp(), 1), new OreDictStack(STEEL.plate(), 12), new ComparableStack(ModItems.plate_desh, 6), new OreDictStack(RUBBER.ingot(), 8), new ComparableStack(ModBlocks.machine_battery, 5), new ComparableStack(ModItems.circuit_gold, 5), },500); + makeRecipe(new ComparableStack(ModBlocks.machine_schrabidium_transmutator, 1), new AStack[] {new OreDictStack(MAGTUNG.ingot(), 1), !exp ? new OreDictStack(TI.ingot(), 24) : new OreDictStack(TI.heavyComp(), 2), !exp ? new OreDictStack(ALLOY.plate(), 18) : new OreDictStack(ALLOY.heavyComp(), 1), new OreDictStack(STEEL.plateWelded(), 12), new ComparableStack(ModItems.plate_desh, 6), new OreDictStack(RUBBER.ingot(), 8), new ComparableStack(ModBlocks.machine_battery, 5), new ComparableStack(ModItems.circuit_gold, 5), },500); makeRecipe(new ComparableStack(ModBlocks.fusion_conductor, 1), new AStack[] {new ComparableStack(ModItems.coil_advanced_alloy, 5), }, 100); makeRecipe(new ComparableStack(ModBlocks.fusion_center, 1), new AStack[] {new OreDictStack(ANY_HARDPLASTIC.ingot(), 4), new OreDictStack(STEEL.plate528(), 6), new ComparableStack(ModItems.wire_advanced_alloy, 24), },200); makeRecipe(new ComparableStack(ModBlocks.fusion_motor, 1), new AStack[] {new OreDictStack(TI.ingot(), 4), new OreDictStack(STEEL.ingot(), 2), new ComparableStack(ModItems.motor, 4), },250); - makeRecipe(new ComparableStack(ModBlocks.fusion_heater, 1), new AStack[] {new OreDictStack(W.ingot(), 4), new OreDictStack(STEEL.plate528(), 2), new OreDictStack(OreDictManager.getReflector(), 2), new OreDictStack(CU.plate(), 4), new ComparableStack(ModItems.magnetron, 1), new ComparableStack(ModItems.wire_advanced_alloy, 4), },150); + makeRecipe(new ComparableStack(ModBlocks.fusion_heater, 1), new AStack[] {new OreDictStack(W.plateWelded(), 1), new OreDictStack(STEEL.plateWelded(), 2), new OreDictStack(OreDictManager.getReflector(), 2), new ComparableStack(ModItems.magnetron, 1) }, 200); makeRecipe(new ComparableStack(ModBlocks.watz_element, 3), new AStack[] {new OreDictStack(STEEL.plateCast(), 2), new OreDictStack(ZR.ingot(), 2), new OreDictStack(BIGMT.ingot(), 2), new OreDictStack(ANY_HARDPLASTIC.ingot(), 4)},200); makeRecipe(new ComparableStack(ModBlocks.watz_cooler, 3), new AStack[] {new OreDictStack(STEEL.plateCast(), 2), new OreDictStack(CU.plateCast(), 4), new OreDictStack(RUBBER.ingot(), 2), }, 200); - makeRecipe(new ComparableStack(ModBlocks.watz_end, 3), new AStack[] {new OreDictStack(ANY_RESISTANTALLOY.plateCast()), new OreDictStack(B.ingot(), 3), new OreDictStack(STEEL.plate(), 9), }, 100); + makeRecipe(new ComparableStack(ModBlocks.watz_end, 3), new AStack[] {new OreDictStack(ANY_RESISTANTALLOY.plateWelded()), new OreDictStack(B.ingot(), 3), new OreDictStack(STEEL.plateWelded(), 2), }, 100); makeRecipe(new ComparableStack(ModBlocks.fwatz_hatch, 1), new AStack[] {new OreDictStack(W.ingot(), 6), new OreDictStack(CMB.plate(), 4), },250); makeRecipe(new ComparableStack(ModBlocks.fwatz_conductor, 1), new AStack[] {new OreDictStack(CMB.plate(), 2), new ComparableStack(ModItems.coil_magnetized_tungsten, 5), },250); makeRecipe(new ComparableStack(ModBlocks.fwatz_computer, 1), new AStack[] {new ComparableStack(ModBlocks.block_meteor, 1), new ComparableStack(ModItems.wire_magnetized_tungsten, 16), new OreDictStack(DIAMOND.dust(), 6), new OreDictStack(MAGTUNG.dust(), 6), new OreDictStack(DESH.dust(), 4), },300); @@ -441,7 +440,7 @@ public class AssemblerRecipes { makeRecipe(new ComparableStack(ModBlocks.machine_fensu, 1), new AStack[] { new ComparableStack(ModItems.ingot_electronium, 32), new ComparableStack(ModBlocks.machine_dineutronium_battery, 16), - !exp ? new OreDictStack(STEEL.block(), 32) : new OreDictStack(STEEL.heavyComp(), 64), + !exp ? new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 64) : new OreDictStack(ANY_RESISTANTALLOY.heavyComp(), 64), new OreDictStack(DURA.block(), 16), new OreDictStack(STAR.block(), 64), new ComparableStack(ModBlocks.machine_transformer_dnt, 8), @@ -449,11 +448,11 @@ public class AssemblerRecipes { new ComparableStack(ModItems.powder_magic, 64), new ComparableStack(ModItems.plate_dineutronium, 24), new ComparableStack(ModItems.ingot_u238m2), - new OreDictStack(FIBER.ingot(), 128) + new ComparableStack(ModItems.ingot_cft, 128) }, 1200); makeRecipe(new ComparableStack(ModBlocks.struct_iter_core, 1), new AStack[] { - !exp ? new OreDictStack(STEEL.ingot(), 6) : new OreDictStack(STEEL.heavyComp(), 4), - !exp ? new OreDictStack(W.ingot(), 6) : new OreDictStack(W.heavyComp(), 1), + !exp ? new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 6) : new OreDictStack(ANY_RESISTANTALLOY.heavyComp(), 2), + !exp ? new OreDictStack(W.plateWelded(), 6) : new OreDictStack(W.heavyComp(), 1), new OreDictStack(OreDictManager.getReflector(), 12), new ComparableStack(ModItems.coil_advanced_alloy, 12), new OreDictStack(ANY_PLASTIC.ingot(), 8), @@ -566,7 +565,7 @@ public class AssemblerRecipes { }, 200); makeRecipe(new ComparableStack(ModBlocks.machine_chungus, 1), new AStack[] { new ComparableStack(ModItems.hull_big_steel, 6), - !exp ? new OreDictStack(STEEL.plate528(), 32) : new OreDictStack(STEEL.heavyComp(), 3), + !exp ? new OreDictStack(STEEL.plateWelded(), 16) : new OreDictStack(STEEL.heavyComp(), 3), !exp ? new OreDictStack(TI.plate528(), 12) : new OreDictStack(TI.heavyComp(), 1), new OreDictStack(ANY_RESISTANTALLOY.ingot(), 16), new ComparableStack(ModItems.turbine_tungsten, 5), @@ -578,8 +577,8 @@ public class AssemblerRecipes { }, 600); makeRecipe(new ComparableStack(ModBlocks.machine_condenser_powered, 1), new AStack[] { - !exp ? new OreDictStack(STEEL.plateCast(), 16) : new OreDictStack(STEEL.heavyComp(), 3), - new OreDictStack(ANY_RESISTANTALLOY.ingot(), 16), + !exp ? new OreDictStack(STEEL.plateWelded(), 8) : new OreDictStack(STEEL.heavyComp(), 3), + new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 4), !exp ? new OreDictStack(CU.plate528(), 16) : new OreDictStack(CU.heavyComp(), 3), new ComparableStack(ModItems.motor_desh, 3), new ComparableStack(ModItems.pipes_steel, 4), diff --git a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java index 18c3f31e9..281d884e3 100644 --- a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java @@ -364,6 +364,14 @@ public class AnvilRecipes { new ComparableStack(ModItems.plate_polymer, 8) }, new AnvilOutput(new ItemStack(ModBlocks.machine_boiler))).setTier(2)); + constructionRecipes.add(new AnvilConstructionRecipe( + new AStack[] { + new OreDictStack(STEEL.plateCast(), 4), + new OreDictStack(W.ingot(), 8), + new ComparableStack(ModBlocks.machine_transformer, 1), + new ComparableStack(ModItems.arc_electrode, 2) + }, new AnvilOutput(new ItemStack(ModBlocks.machine_arc_welder))).setTier(2)); + constructionRecipes.add(new AnvilConstructionRecipe( new AStack[] { new OreDictStack(STEEL.plateCast(), 8), 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 cf6ed2490..8149dfaba 100644 --- a/src/main/java/com/hbm/inventory/recipes/loader/SerializableRecipe.java +++ b/src/main/java/com/hbm/inventory/recipes/loader/SerializableRecipe.java @@ -64,6 +64,7 @@ public abstract class SerializableRecipe { recipeHandlers.add(new CompressorRecipes()); recipeHandlers.add(new ElectrolyserFluidRecipes()); recipeHandlers.add(new ElectrolyserMetalRecipes()); + recipeHandlers.add(new ArcWelderRecipes()); recipeHandlers.add(new MatDistribution()); recipeHandlers.add(new CustomMachineRecipes()); diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 14e3d76f4..bf75c0f59 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -778,6 +778,7 @@ public class ModItems { public static Item mold; public static Item scraps; public static Item plate_cast; + public static Item plate_welded; public static Item heavy_component; public static Item part_lithium; @@ -3259,6 +3260,7 @@ public class ModItems { mold = new ItemMold().setUnlocalizedName("mold").setCreativeTab(MainRegistry.controlTab); scraps = new ItemScraps().aot(Mats.MAT_BISMUTH, "scraps_bismuth").setUnlocalizedName("scraps").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":scraps"); plate_cast = new ItemAutogen(MaterialShapes.CASTPLATE).aot(Mats.MAT_BISMUTH, "plate_cast_bismuth").setUnlocalizedName("plate_cast").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_cast"); + plate_welded = new ItemAutogen(MaterialShapes.WELDEDPLATE).setUnlocalizedName("plate_welded").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_welded"); heavy_component = new ItemAutogen(MaterialShapes.HEAVY_COMPONENT).setUnlocalizedName("heavy_component").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":heavy_component"); part_lithium = new Item().setUnlocalizedName("part_lithium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":part_lithium"); @@ -3274,7 +3276,6 @@ public class ModItems { laser_crystal_digamma = new ItemFELCrystal(EnumWavelengths.DRX).setUnlocalizedName("laser_crystal_digamma").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_digamma"); thermo_element = new Item().setUnlocalizedName("thermo_element").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":thermo_element"); - //limiter = new Item().setUnlocalizedName("limiter").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":limiter"); catalytic_converter = new Item().setUnlocalizedName("catalytic_converter").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":catalytic_converter"); antiknock = new Item().setUnlocalizedName("antiknock").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":antiknock"); @@ -5995,6 +5996,7 @@ public class ModItems { //Heavy/Cast Plate GameRegistry.registerItem(plate_cast, plate_cast.getUnlocalizedName()); + GameRegistry.registerItem(plate_welded, plate_welded.getUnlocalizedName()); GameRegistry.registerItem(heavy_component, heavy_component.getUnlocalizedName()); //Boards diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index b832541ce..96fc5134f 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -61,6 +61,7 @@ import net.minecraft.world.biome.BiomeGenForest; import net.minecraft.world.biome.BiomeGenJungle; import net.minecraft.world.biome.BiomeGenRiver; import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderFlat; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.common.IWorldGenerator; @@ -221,8 +222,15 @@ public class HbmWorldGen implements IWorldGenerator { (new WorldGenMinable(ModBlocks.ore_australium, 50)).generate(world, rand, randPosX, randPosY, randPosZ); } } + + boolean enableDungeons = true; + + if(world.getChunkProvider() instanceof ChunkProviderFlat) { + ChunkProviderFlat provider = (ChunkProviderFlat) world.getChunkProvider(); + enableDungeons = provider.hasDungeons; + } - if(GeneralConfig.enableDungeons && world.provider.isSurfaceWorld()) { + if(GeneralConfig.enableDungeons && world.provider.isSurfaceWorld() && enableDungeons) { if(MobConfig.enableHives && rand.nextInt(MobConfig.hiveSpawn) == 0) { int x = i + rand.nextInt(16) + 8; diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index da10a8299..1db22f6d1 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (4740)"; + public static final String VERSION = "1.0.27 BETA (4746)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 8b4ff3564..7f4a5edad 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -1852,6 +1852,23 @@ public class ClientProxy extends ServerProxy { Minecraft.getMinecraft().effectRenderer.addEffect(text); } + if("debugdrone".equals(type)) { + Item held = player.getHeldItem() == null ? null : player.getHeldItem().getItem(); + + if(held == ModItems.drone || + held == Item.getItemFromBlock(ModBlocks.drone_crate_provider) || + held == Item.getItemFromBlock(ModBlocks.drone_crate_requester) || + held == Item.getItemFromBlock(ModBlocks.drone_dock) || + held == Item.getItemFromBlock(ModBlocks.drone_waypoint_request)) { + double mX = data.getDouble("mX"); + double mY = data.getDouble("mY"); + double mZ = data.getDouble("mZ"); + int color = data.getInteger("color"); + ParticleDebugLine text = new ParticleDebugLine(world, x, y, z, mX, mY, mZ, color); + Minecraft.getMinecraft().effectRenderer.addEffect(text); + } + } + if("network".equals(type)) { ParticleDebug debug = null; double mX = data.getDouble("mX"); diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 06b7eef97..d0815eb79 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -790,10 +790,10 @@ public class CraftingManager { addShapelessAuto(new ItemStack(ModItems.ams_catalyst_schrabidium, 1), new Object[] { ModItems.ams_catalyst_blank, ModItems.rune_dagaz, ModItems.rune_hagalaz, ModItems.rune_thurisaz, ModItems.rune_thurisaz, SA326.dust(), SA326.dust(), SA326.dust(), SA326.dust() }); addShapelessAuto(new ItemStack(ModItems.ams_catalyst_dineutronium, 1), new Object[] { ModItems.ams_catalyst_blank, ModItems.rune_hagalaz, ModItems.rune_hagalaz, ModItems.rune_thurisaz, ModItems.rune_thurisaz, DNT.dust(), DNT.dust(), DNT.dust(), DNT.dust() }); addRecipeAuto(new ItemStack(ModBlocks.dfc_core, 1), new Object[] { "DLD", "LML", "DLD", 'D', ModItems.ingot_bismuth, 'L', DNT.block(), 'M', KEY_CIRCUIT_BISMUTH }); - addRecipeAuto(new ItemStack(ModBlocks.dfc_emitter, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateCast(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModItems.crystal_xen, 'L', ModItems.sat_head_laser }); - addRecipeAuto(new ItemStack(ModBlocks.dfc_receiver, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateCast(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModBlocks.block_dineutronium, 'L', ModItems.hull_small_steel }); - addRecipeAuto(new ItemStack(ModBlocks.dfc_injector, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateCast(), 'D', CMB.plate(), 'T', ModBlocks.machine_fluidtank, 'X', ModItems.motor, 'L', ModItems.pipes_steel }); - addRecipeAuto(new ItemStack(ModBlocks.dfc_stabilizer, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateCast(), 'D', ModItems.plate_desh, 'T', ModItems.singularity_spark, 'X', ModItems.magnet_circular, 'L', ModItems.crystal_xen }); + addRecipeAuto(new ItemStack(ModBlocks.dfc_emitter, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModItems.crystal_xen, 'L', ModItems.sat_head_laser }); + addRecipeAuto(new ItemStack(ModBlocks.dfc_receiver, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModBlocks.block_dineutronium, 'L', ModItems.hull_small_steel }); + addRecipeAuto(new ItemStack(ModBlocks.dfc_injector, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', CMB.plate(), 'T', ModBlocks.machine_fluidtank, 'X', ModItems.motor, 'L', ModItems.pipes_steel }); + addRecipeAuto(new ItemStack(ModBlocks.dfc_stabilizer, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.plateWelded(), 'D', ModItems.plate_desh, 'T', ModItems.singularity_spark, 'X', ModItems.magnet_circular, 'L', ModItems.crystal_xen }); addRecipeAuto(new ItemStack(ModBlocks.barrel_plastic, 1), new Object[] { "IPI", "I I", "IPI", 'I', ModItems.plate_polymer, 'P', AL.plate() }); addRecipeAuto(new ItemStack(ModBlocks.barrel_iron, 1), new Object[] { "IPI", "I I", "IPI", 'I', IRON.plate(), 'P', IRON.ingot() }); addShapelessAuto(new ItemStack(ModBlocks.barrel_iron, 1), new Object[] { ModBlocks.barrel_corroded, ANY_TAR.any() }); @@ -882,7 +882,7 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.rbmk_steam_outlet, 1), new Object[] { "SCS", "CBC", "SCS", 'S', STEEL.ingot(), 'C', CU.plate(), 'B', ModItems.tank_steel }); //addRecipeAuto(new ItemStack(ModBlocks.rbmk_heatex, 1), new Object[] { "SCS", "CBC", "SCS", 'S', STEEL.ingot(), 'C', CU.plate(), 'B', ModItems.pipes_steel }); - addRecipeAuto(new ItemStack(ModBlocks.pwr_fuel, 4), new Object[] { "LZL", "LZL", "LZL", 'L', PB.plate528(), 'Z', ZR.plateCast() }); + addRecipeAuto(new ItemStack(ModBlocks.pwr_fuel, 4), new Object[] { "LZL", "L L", "LZL", 'L', PB.plate528(), 'Z', ZR.plateWelded() }); addRecipeAuto(new ItemStack(ModBlocks.pwr_control, 4), new Object[] { "SBS", "MBM", "SBS", 'S', STEEL.plate528(), 'B', B.ingot(), 'M', ModItems.motor }); addRecipeAuto(new ItemStack(ModBlocks.pwr_channel, 4), new Object[] { "CPC", "BPB", "CPC", 'C', CU.ingot(), 'P', ModBlocks.deco_pipe_quad, 'B', ANY_PLASTIC.ingot() }); addRecipeAuto(new ItemStack(ModBlocks.pwr_heatex, 4), new Object[] { "CSC", "SMS", "CSC", 'C', CU.plateCast(), 'S', STEEL.plate528(), 'M', ModItems.motor }); @@ -997,9 +997,9 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL.ordinal()), new Object[] { "PPP", "HCH", " B ", 'P', ANY_PLASTIC.ingot(), 'H', ModItems.hull_small_steel, 'C', ModItems.circuit_copper, 'B', ModBlocks.crate_steel }); addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_CHUNKLOADING.ordinal()), new Object[] { "E", "D", 'E', Items.ender_pearl, 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL.ordinal()) }); - addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS.ordinal()), new Object[] { " P ", "KDK", " P ", 'P', ModItems.plate_desh, 'K', Fluids.KEROSENE.getDict(1_000), 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL.ordinal()) }); + addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS.ordinal()), new Object[] { " P ", "KDK", " P ", 'P', TI.plateWelded(), 'K', Fluids.KEROSENE.getDict(1_000), 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL.ordinal()) }); addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS_CHUNKLOADING.ordinal()), new Object[] { "E", "D", 'E', Items.ender_pearl, 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS.ordinal()) }); - addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS_CHUNKLOADING.ordinal()), new Object[] { " P ", "KDK", " P ", 'P', ModItems.plate_desh, 'K', Fluids.KEROSENE.getDict(1_000), 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_CHUNKLOADING.ordinal()) }); + addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS_CHUNKLOADING.ordinal()), new Object[] { " P ", "KDK", " P ", 'P', TI.plateWelded(), 'K', Fluids.KEROSENE.getDict(1_000), 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_CHUNKLOADING.ordinal()) }); addShapelessAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL.ordinal()), new Object[] { new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_CHUNKLOADING.ordinal()) }); addShapelessAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS.ordinal()), new Object[] { new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS_CHUNKLOADING.ordinal()) }); addRecipeAuto(new ItemStack(ModItems.drone, 1, EnumDroneType.REQUEST.ordinal()), new Object[] { "E", "D", 'E', ModItems.circuit_red_copper, 'D', new ItemStack(ModItems.drone, 1, EnumDroneType.PATROL_EXPRESS.ordinal()) }); diff --git a/src/main/java/com/hbm/main/NEIConfig.java b/src/main/java/com/hbm/main/NEIConfig.java index 8f3f93532..dc6b9cc4a 100644 --- a/src/main/java/com/hbm/main/NEIConfig.java +++ b/src/main/java/com/hbm/main/NEIConfig.java @@ -76,6 +76,7 @@ public class NEIConfig implements IConfigureNEI { registerHandler(new ElectrolyserFluidHandler()); registerHandler(new ElectrolyserMetalHandler()); registerHandler(new AshpitHandler()); + registerHandler(new ArcWelderHandler()); for(MachineConfiguration conf : CustomMachineConfigJSON.niceList) registerHandlerBypass(new CustomMachineHandler(conf)); diff --git a/src/main/java/com/hbm/particle/ParticleHadron.java b/src/main/java/com/hbm/particle/ParticleHadron.java index 923ca8b58..46b5e3d7c 100644 --- a/src/main/java/com/hbm/particle/ParticleHadron.java +++ b/src/main/java/com/hbm/particle/ParticleHadron.java @@ -6,10 +6,12 @@ import com.hbm.lib.RefStrings; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; @@ -50,11 +52,16 @@ public class ParticleHadron extends EntityFX { float scale = (this.particleAge + interp) * 0.15F; tess.setColorRGBA_F(1.0F, 1.0F, 1.0F, this.particleAlpha); + + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + double dX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)interp; + double dY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)interp; + double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp; - float pX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double)interp - interpPosX); - float pY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double)interp - interpPosY); - float pZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double)interp - interpPosZ); - + double pX = this.prevPosX + (this.posX - this.prevPosX) * (double) interp - dX; + double pY = this.prevPosY + (this.posY - this.prevPosY) * (double) interp - dY; + double pZ = this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - dZ; + tess.addVertexWithUV((double)(pX - x * scale - tx * scale), (double)(pY - y * scale), (double)(pZ - z * scale - tz * scale), 1, 1); tess.addVertexWithUV((double)(pX - x * scale + tx * scale), (double)(pY + y * scale), (double)(pZ - z * scale + tz * scale), 1, 0); tess.addVertexWithUV((double)(pX + x * scale + tx * scale), (double)(pY + y * scale), (double)(pZ + z * scale + tz * scale), 0, 0); @@ -63,6 +70,7 @@ public class ParticleHadron extends EntityFX { GL11.glPolygonOffset(0.0F, 0.0F); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); } } diff --git a/src/main/java/com/hbm/render/tileentity/RenderArcWelder.java b/src/main/java/com/hbm/render/tileentity/RenderArcWelder.java index f7b1ef53c..e87c1d7e4 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderArcWelder.java +++ b/src/main/java/com/hbm/render/tileentity/RenderArcWelder.java @@ -6,14 +6,21 @@ import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; import com.hbm.main.ResourceManager; import com.hbm.render.item.ItemRenderBase; +import com.hbm.render.util.RenderDecoItem; +import com.hbm.tileentity.machine.TileEntityMachineArcWelder; +import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.client.IItemRenderer; public class RenderArcWelder extends TileEntitySpecialRenderer implements IItemRendererProvider { - + + private RenderItem itemRenderer = new RenderDecoItem(this); + @Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) { GL11.glPushMatrix(); @@ -33,12 +40,35 @@ public class RenderArcWelder extends TileEntitySpecialRenderer implements IItemR bindTexture(ResourceManager.arc_welder_tex); ResourceManager.arc_welder.renderAll(); + TileEntityMachineArcWelder welder = (TileEntityMachineArcWelder) tile; + if(welder.display != null) { + GL11.glPushMatrix(); + GL11.glTranslated(0.0625D * 2.5D, 1.125D, 0D); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glRotatef(90, 0F, 1F, 0F); + GL11.glRotatef(-90, 1F, 0F, 0F); + + if(welder.display != null) { + ItemStack stack = welder.display.copy(); + + EntityItem item = new EntityItem(null, 0.0D, 0.0D, 0.0D, stack); + item.getEntityItem().stackSize = 1; + item.hoverStart = 0.0F; + + RenderItem.renderInFrame = true; + GL11.glScaled(1.5, 1.5, 1.5); + this.itemRenderer.doRender(item, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderItem.renderInFrame = false; + } + GL11.glPopMatrix(); + } + GL11.glPopMatrix(); } @Override public Item getItemForRenderer() { - return Item.getItemFromBlock(ModBlocks.radio_telex); + return Item.getItemFromBlock(ModBlocks.machine_arc_welder); } @Override @@ -46,10 +76,9 @@ public class RenderArcWelder extends TileEntitySpecialRenderer implements IItemR return new ItemRenderBase( ) { public void renderInventory() { GL11.glTranslated(0, -2, 0); - GL11.glScaled(6, 6, 6); + GL11.glScaled(4, 4, 4); } public void renderCommon() { - GL11.glTranslated(0, 0, -0.5); bindTexture(ResourceManager.arc_welder_tex); ResourceManager.arc_welder.renderAll(); }}; diff --git a/src/main/java/com/hbm/render/util/RenderDecoItem.java b/src/main/java/com/hbm/render/util/RenderDecoItem.java index bfca8e9ff..b7e6d2a70 100644 --- a/src/main/java/com/hbm/render/util/RenderDecoItem.java +++ b/src/main/java/com/hbm/render/util/RenderDecoItem.java @@ -1,6 +1,7 @@ package com.hbm.render.util; import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; @@ -9,7 +10,9 @@ import net.minecraft.item.ItemStack; * @author hbm */ public class RenderDecoItem extends RenderItem { + public RenderDecoItem(TileEntitySpecialRenderer render) { + this.setRenderManager(RenderManager.instance); } @Override diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityFEL.java b/src/main/java/com/hbm/tileentity/machine/TileEntityFEL.java index 0fa67c699..40b8b27e3 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityFEL.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityFEL.java @@ -68,7 +68,7 @@ public class TileEntityFEL extends TileEntityMachineBase implements IEnergyUser, if(!worldObj.isRemote) { ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset); - this.trySubscribe(worldObj, xCoord + dir.offsetX * -5, yCoord + 1, zCoord + dir.offsetZ * -5, dir); + this.trySubscribe(worldObj, xCoord + dir.offsetX * -5, yCoord + 1, zCoord + dir.offsetZ * -5, dir.getOpposite()); this.power = Library.chargeTEFromItems(slots, 0, power, maxPower); if(this.isOn && !(this.slots[1] == null)) { diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineArcWelder.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineArcWelder.java index f2099415d..5373ff76c 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineArcWelder.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineArcWelder.java @@ -1,20 +1,53 @@ package com.hbm.tileentity.machine; +import com.hbm.inventory.RecipesCommon.AStack; +import com.hbm.inventory.UpgradeManager; +import com.hbm.inventory.container.ContainerMachineArcWelder; +import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; +import com.hbm.inventory.gui.GUIMachineArcWelder; +import com.hbm.inventory.recipes.ArcWelderRecipes; +import com.hbm.inventory.recipes.ArcWelderRecipes.ArcWelderRecipe; +import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType; +import com.hbm.lib.Library; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; +import com.hbm.tileentity.IConditionalInvAccess; +import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.TileEntityMachineBase; +import com.hbm.util.fauxpointtwelve.BlockPos; +import com.hbm.util.fauxpointtwelve.DirPos; import api.hbm.energy.IEnergyUser; import api.hbm.fluid.IFluidStandardReceiver; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +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.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityMachineArcWelder extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver { +public class TileEntityMachineArcWelder extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver, IConditionalInvAccess, IGUIProvider { public long power; - public long maxPower; + public long maxPower = 2_000; + public long consumption; + + public int progress; + public int processTime = 1; public FluidTank tank; + public ItemStack display; public TileEntityMachineArcWelder() { super(8); + this.tank = new FluidTank(Fluids.NONE, 24_000); } @Override @@ -25,6 +58,174 @@ public class TileEntityMachineArcWelder extends TileEntityMachineBase implements @Override public void updateEntity() { + if(!worldObj.isRemote) { + + this.power = Library.chargeTEFromItems(slots, 4, power, maxPower); + this.tank.setType(5, slots); + + if(worldObj.getTotalWorldTime() % 20 == 0) { + for(DirPos pos : getConPos()) { + this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); + if(tank.getTankType() != Fluids.NONE) this.trySubscribe(tank.getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); + } + } + + ArcWelderRecipe recipe = ArcWelderRecipes.getRecipe(slots[0], slots[1], slots[2]); + long intendedMaxPower; + + UpgradeManager.eval(slots, 6, 7); + int redLevel = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3); + int blueLevel = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3); + + if(recipe != null) { + this.processTime = recipe.duration - (recipe.duration * redLevel / 6) + (recipe.duration * blueLevel / 3); + this.consumption = recipe.consumption + (recipe.consumption * redLevel) - (recipe.consumption * blueLevel / 6); + intendedMaxPower = recipe.consumption * 20; + + if(canProcess(recipe)) { + this.progress++; + this.power -= this.consumption; + + if(progress >= processTime) { + this.progress = 0; + this.consumeItems(recipe); + + if(slots[3] == null) { + slots[3] = recipe.output.copy(); + } else { + slots[3].stackSize += recipe.output.stackSize; + } + + this.markDirty(); + } + + if(worldObj.getTotalWorldTime() % 2 == 0) { + ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10); + NBTTagCompound dPart = new NBTTagCompound(); + dPart.setString("type", worldObj.getTotalWorldTime() % 20 == 0 ? "tau" : "hadron"); + dPart.setByte("count", (byte) 5); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(dPart, xCoord + 0.5 - dir.offsetX * 0.5, yCoord + 1.25, zCoord + 0.5 - dir.offsetZ * 0.5), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 25)); + } + + } else { + this.progress = 0; + } + + } else { + this.progress = 0; + this.consumption = 100; + intendedMaxPower = 2000; + } + + this.maxPower = Math.max(intendedMaxPower, power); + + NBTTagCompound data = new NBTTagCompound(); + data.setLong("power", power); + data.setLong("maxPower", maxPower); + data.setLong("consumption", consumption); + data.setInteger("progress", progress); + data.setInteger("processTime", processTime); + if(recipe != null) { + data.setInteger("display", Item.getIdFromItem(recipe.output.getItem())); + data.setInteger("displayMeta", recipe.output.getItemDamage()); + } + this.tank.writeToNBT(data, "t"); + this.networkPack(data, 25); + } + } + + public boolean canProcess(ArcWelderRecipe recipe) { + + if(this.power < recipe.consumption) return false; + + if(recipe.fluid != null) { + if(this.tank.getTankType() != recipe.fluid.type) return false; + if(this.tank.getFill() < recipe.fluid.fill) return false; + } + + if(slots[3] != null) { + if(slots[3].getItem() != recipe.output.getItem()) return false; + if(slots[3].getItemDamage() != recipe.output.getItemDamage()) return false; + if(slots[3].stackSize + recipe.output.stackSize > slots[3].getMaxStackSize()) return false; + } + + return true; + } + + public void consumeItems(ArcWelderRecipe recipe) { + + for(AStack aStack : recipe.ingredients) { + + for(int i = 0; i < 3; i++) { + ItemStack stack = slots[i]; + if(aStack.matchesRecipe(stack, true) && stack.stackSize >= aStack.stacksize) { + this.decrStackSize(i, aStack.stacksize); + break; + } + } + } + + if(recipe.fluid != null) { + this.tank.setFill(tank.getFill() - recipe.fluid.fill); + } + } + + protected DirPos[] getConPos() { + + ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10); + ForgeDirection rot = dir.getRotation(ForgeDirection.UP); + + return new DirPos[] { + new DirPos(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ, dir), + new DirPos(xCoord + dir.offsetX + rot.offsetX, yCoord, zCoord + dir.offsetZ + rot.offsetZ, dir), + new DirPos(xCoord + dir.offsetX - rot.offsetX, yCoord, zCoord + dir.offsetZ - rot.offsetZ, dir), + new DirPos(xCoord - dir.offsetX * 2, yCoord, zCoord - dir.offsetZ * 2, dir.getOpposite()), + new DirPos(xCoord - dir.offsetX * 2 + rot.offsetX, yCoord, zCoord - dir.offsetZ * 2 + rot.offsetZ, dir.getOpposite()), + new DirPos(xCoord - dir.offsetX * 2 - rot.offsetX, yCoord, zCoord - dir.offsetZ * 2 - rot.offsetZ, dir.getOpposite()), + new DirPos(xCoord + rot.offsetX * 2, yCoord, zCoord + rot.offsetZ * 2, rot), + new DirPos(xCoord - dir.offsetX + rot.offsetX * 2, yCoord, zCoord - dir.offsetZ + rot.offsetZ * 2, rot), + new DirPos(xCoord - rot.offsetX * 2, yCoord, zCoord - rot.offsetZ * 2, rot.getOpposite()), + new DirPos(xCoord - dir.offsetX - rot.offsetX * 2, yCoord, zCoord - dir.offsetZ - rot.offsetZ * 2, rot.getOpposite()) + }; + } + + @Override + public void networkUnpack(NBTTagCompound nbt) { + this.power = nbt.getLong("power"); + this.maxPower = nbt.getLong("maxPower"); + this.consumption = nbt.getLong("consumption"); + this.progress = nbt.getInteger("progress"); + this.processTime = nbt.getInteger("processTime"); + + if(nbt.hasKey("display")) { + this.display = new ItemStack(Item.getItemById(nbt.getInteger("display")), 1, nbt.getInteger("displayMeta")); + } else { + this.display = null; + } + + this.tank.readFromNBT(nbt, "t"); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + + this.power = nbt.getLong("power"); + this.maxPower = nbt.getLong("maxPower"); + this.progress = nbt.getInteger("progress"); + this.processTime = nbt.getInteger("processTime"); + tank.readFromNBT(nbt, "t"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + + nbt.setLong("power", power); + nbt.setLong("maxPower", maxPower); + nbt.setInteger("progress", progress); + nbt.setInteger("processTime", processTime); + tank.writeToNBT(nbt, "t"); } @Override @@ -51,4 +252,92 @@ public class TileEntityMachineArcWelder extends TileEntityMachineBase implements public FluidTank[] getReceivingTanks() { return new FluidTank[] {tank}; } + + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) { + return slot < 3; + } + + @Override + public boolean canExtractItem(int slot, ItemStack stack, int side) { + return slot == 3; + } + + @Override + public int[] getAccessibleSlotsFromSide(int side) { + return new int[] { 1, 3 }; + } + + @Override + public boolean isItemValidForSlot(int x, int y, int z, int slot, ItemStack stack) { + return slot < 3; + } + + @Override + public boolean canInsertItem(int x, int y, int z, int slot, ItemStack stack, int side) { + return slot < 3; + } + + @Override + public boolean canExtractItem(int x, int y, int z, int slot, ItemStack stack, int side) { + return slot == 3; + } + + @Override + public int[] getAccessibleSlotsFromSide(int x, int y, int z, int side) { + BlockPos pos = new BlockPos(x, y, z); + ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10); + ForgeDirection rot = dir.getRotation(ForgeDirection.UP); + BlockPos core = new BlockPos(xCoord, yCoord, zCoord); + + //Red + if(pos.equals(core.clone().offset(rot)) || pos.equals(core.clone().offset(rot.getOpposite()).offset(dir.getOpposite()))) + return new int[] { 0, 3 }; + + //Yellow + if(pos.equals(core.clone().offset(dir.getOpposite()))) + return new int[] { 1, 3 }; + + //Green + if(pos.equals(core.clone().offset(rot.getOpposite())) || pos.equals(core.clone().offset(rot).offset(dir.getOpposite()))) + return new int[] { 2, 3 }; + + return new int[] { }; + } + + @Override + public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { + return new ContainerMachineArcWelder(player.inventory, this); + } + + @Override + @SideOnly(Side.CLIENT) + public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { + return new GUIMachineArcWelder(player.inventory, this); + } + + AxisAlignedBB bb = null; + + @Override + public AxisAlignedBB getRenderBoundingBox() { + + if(bb == null) { + bb = AxisAlignedBB.getBoundingBox( + xCoord - 1, + yCoord, + zCoord - 1, + xCoord + 2, + yCoord + 3, + zCoord + 2 + ); + } + + return bb; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRTG.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRTG.java index 63f6ec905..4e386f468 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRTG.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRTG.java @@ -209,7 +209,7 @@ public class TileEntityMachineRTG extends TileEntityLoadedBase implements ISided if(!worldObj.isRemote) { for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.getOpposite()); + this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir); heat = RTGUtil.updateRTGs(slots, slot_io); diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityRequestNetwork.java b/src/main/java/com/hbm/tileentity/network/TileEntityRequestNetwork.java index 3e241d394..645374a1e 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityRequestNetwork.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityRequestNetwork.java @@ -55,7 +55,7 @@ public abstract class TileEntityRequestNetwork extends TileEntity { // draw debug crap for(PathNode known : knownNodes) { - if(reachableNodes.contains(known)) ParticleUtil.spawnDebugLine(worldObj, + if(reachableNodes.contains(known)) ParticleUtil.spawnDroneLine(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, (known.pos.getX() - pos.getX()) / 2D, (known.pos.getY() - pos.getY()) / 2D, (known.pos.getZ() - pos.getZ()) / 2D, reachableNodes.contains(known) ? 0x00ff00 : 0xff0000); diff --git a/src/main/java/com/hbm/util/ParticleUtil.java b/src/main/java/com/hbm/util/ParticleUtil.java index f62efba92..45898c14d 100644 --- a/src/main/java/com/hbm/util/ParticleUtil.java +++ b/src/main/java/com/hbm/util/ParticleUtil.java @@ -28,10 +28,10 @@ public class ParticleUtil { } } - public static void spawnDebugLine(World world, double x, double y, double z, double x0, double y0, double z0, int color) { + public static void spawnDroneLine(World world, double x, double y, double z, double x0, double y0, double z0, int color) { NBTTagCompound data = new NBTTagCompound(); - data.setString("type", "debugline"); + data.setString("type", "debugdrone"); data.setDouble("mX", x0); data.setDouble("mY", y0); data.setDouble("mZ", z0); diff --git a/src/main/java/com/hbm/util/fauxpointtwelve/BlockPos.java b/src/main/java/com/hbm/util/fauxpointtwelve/BlockPos.java index 0113b4817..4b2c6a1c8 100644 --- a/src/main/java/com/hbm/util/fauxpointtwelve/BlockPos.java +++ b/src/main/java/com/hbm/util/fauxpointtwelve/BlockPos.java @@ -7,7 +7,7 @@ import net.minecraftforge.common.util.ForgeDirection; /** * Adjusted code from MC 1.12 (com.minecraft.util.math.BlockPos) */ -public class BlockPos { +public class BlockPos implements Cloneable { private final int x; private final int y; @@ -92,4 +92,12 @@ public class BlockPos { } } } + + @Override + public BlockPos clone() { + try { + return (BlockPos) super.clone(); + } catch(Exception x) { } + return null; + } } diff --git a/src/main/resources/META-INF/HBM_at.cfg b/src/main/resources/META-INF/HBM_at.cfg index ba62b1a85..158e03857 100644 --- a/src/main/resources/META-INF/HBM_at.cfg +++ b/src/main/resources/META-INF/HBM_at.cfg @@ -25,3 +25,6 @@ public net.minecraft.client.gui.GuiMainMenu field_73975_c # sp # EntityLivingBase public net.minecraft.entity.EntityLivingBase field_82180_bT # previousEquipment + +# ChunkProviderFlat +public net.minecraft.world.gen.ChunkProviderFlat field_82702_h # hasDungeons diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index be712bbcc..b57571485 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -338,6 +338,7 @@ container.keyForge=Schlossertisch container.launchPad=Raketenabschussrampe container.launchTable=Große Startrampe container.leadBox=Sicherheitsbehälter +container.machineArcWelder=Lichtbogenschweißer container.machineBoiler=Ölwärmer container.machineCMB=CMB-Stahl Hochofen container.machineCoal=Verbrennungsgenerator @@ -2697,6 +2698,7 @@ item.plate_saturnite.name=Saturnitplatte item.plate_schrabidium.name=Schrabidiumplatte item.plate_steel.name=Stahlplatte item.plate_titanium.name=Titanplatte +item.plate_welded.name=Geschweißte %splatte item.polaroid.name=Das Polaroid item.pollution_detector.name=Verschmutzungsdetektor item.powder_actinium.name=Actiniumstaub @@ -4014,6 +4016,7 @@ tile.lox_barrel.name=LOX-Fass tile.machine_amgen.name=Umgebungsstrahlungs-Generator tile.machine_arc_furnace_off.name=Lichtbogenofen tile.machine_arc_furnace_on.name=Lichtbogenofen +tile.machine_arc_welder.name=Lichtbogenschweißer tile.machine_armor_table.name=Rüstungsmodifikationstisch tile.machine_ashpit.name=Aschekasten tile.machine_ashpit.desc=Sammelt Asche von Feuerbüchsen und Heizöfen diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 1d001cf5d..8cdae49aa 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -696,6 +696,7 @@ container.keyForge=Locksmith Table container.launchPad=Missile Launch Pad container.launchTable=Large Launch Pad container.leadBox=Containment Box +container.machineArcWelder=Arc Welder container.machineBoiler=Oil Heater container.machineCMB=CMB Steel Furnace container.machineCoal=Combustion Generator @@ -3501,6 +3502,7 @@ item.plate_saturnite.name=Saturnite Plate item.plate_schrabidium.name=Schrabidium Plate item.plate_steel.name=Steel Plate item.plate_titanium.name=Titanium Plate +item.plate_welded.name=Welded %s Plate item.polaroid.name=The Polaroid item.pollution_detector.name=Pollution Detector item.powder_actinium.name=Actinium Powder @@ -4990,6 +4992,7 @@ tile.lox_barrel.name=LOX Barrel tile.machine_amgen.name=Ambience Radiation Generator tile.machine_arc_furnace_off.name=Arc Furnace tile.machine_arc_furnace_on.name=Arc Furnace +tile.machine_arc_welder.name=Arc Welder tile.machine_armor_table.name=Armor Modification Table tile.machine_ashpit.name=Ashpit tile.machine_ashpit.desc=Collects ashes from fireboxes and heating ovens diff --git a/src/main/resources/assets/hbm/textures/blocks/cmt_terminal_front.png b/src/main/resources/assets/hbm/textures/blocks/cmt_terminal_front.png new file mode 100644 index 0000000000000000000000000000000000000000..1cf5cdafa4235c84ad39e67e4db42c2308a25195 GIT binary patch literal 425 zcmV;a0apHrP)@~;@`x-J`m*-U^IQC;q#o@PkV~M6 Tg23(600000NkvXXu0mjfim$k; literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/blocks/cmt_terminal_side.png b/src/main/resources/assets/hbm/textures/blocks/cmt_terminal_side.png new file mode 100644 index 0000000000000000000000000000000000000000..adb2fdb8a9232535b1756bb84a3556a3a280ebc4 GIT binary patch literal 448 zcmV;x0YCnUP)bn&iKqRLGt+~wbHqJvq_^b*N8Krm|>*@f@ z^4-h;D8&OjPskZ)%rl61a>|ByGiQnMh0$hgGKAJPIXEym zJ9DjG9AK(_8r{UNotYQZ>Hs30S;PrS@$WG7(THjvQ2@n#NXbLh3*&r0TZtJ*Vf+ig zl=?nmD*z<@n7FwqTTf;kEN5vk