diff --git a/.github/ISSUE_TEMPLATE/issue-template--mandatory-.md b/.github/ISSUE_TEMPLATE/issue-template--mandatory-.md index 02e9585b0..e72104c8c 100644 --- a/.github/ISSUE_TEMPLATE/issue-template--mandatory-.md +++ b/.github/ISSUE_TEMPLATE/issue-template--mandatory-.md @@ -10,7 +10,3 @@ assignees: '' ### Describe the bug Please describe the issue in as much detail as possible. Also mention the version of the mod you're running, if it's not the newest. In the case of a crash, please attach a crash log. - -### Please solve this equation to x - -x²+3x-19=√(9x²)+6 diff --git a/src/main/java/com/hbm/blocks/BlockDummyable.java b/src/main/java/com/hbm/blocks/BlockDummyable.java index 14e296608..309a9b2e0 100644 --- a/src/main/java/com/hbm/blocks/BlockDummyable.java +++ b/src/main/java/com/hbm/blocks/BlockDummyable.java @@ -6,7 +6,9 @@ import java.util.Random; import com.hbm.handler.MultiblockHandlerXR; import com.hbm.handler.ThreeInts; +import com.hbm.main.MainRegistry; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -336,4 +338,20 @@ public abstract class BlockDummyable extends BlockContainer { return 0; } + protected boolean standardOpenBehavior(World world, int x, int y, int z, EntityPlayer player, int id) { + + if(world.isRemote) { + return true; + } else if(!player.isSneaking()) { + int[] pos = this.findCore(world, x, y, z); + + if(pos == null) + return false; + + FMLNetworkHandler.openGui(player, MainRegistry.instance, id, world, pos[0], pos[1], pos[2]); + return true; + } else { + return true; + } + } } diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 54d7493e7..5d65dd3f6 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -2063,6 +2063,7 @@ public class ModBlocks { machine_deuterium_tower = new DeuteriumTower(Material.iron).setBlockName("machine_deuterium_tower").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete"); machine_liquefactor = new MachineLiquefactor().setBlockName("machine_liquefactor").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); + machine_solidifier = new MachineSolidifier().setBlockName("machine_solidifier").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine"); anvil_iron = new NTMAnvil(Material.iron, 1).setBlockName("anvil_iron").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_iron"); anvil_lead = new NTMAnvil(Material.iron, 1).setBlockName("anvil_lead").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_lead"); @@ -2943,6 +2944,7 @@ public class ModBlocks { GameRegistry.registerBlock(machine_deuterium_extractor, machine_deuterium_extractor.getUnlocalizedName()); GameRegistry.registerBlock(machine_deuterium_tower, machine_deuterium_tower.getUnlocalizedName()); GameRegistry.registerBlock(machine_liquefactor, ItemBlockBase.class, machine_liquefactor.getUnlocalizedName()); + GameRegistry.registerBlock(machine_solidifier, ItemBlockBase.class, machine_solidifier.getUnlocalizedName()); GameRegistry.registerBlock(machine_deaerator, machine_deaerator.getUnlocalizedName()); GameRegistry.registerBlock(machine_waste_drum, machine_waste_drum.getUnlocalizedName()); GameRegistry.registerBlock(machine_storage_drum, machine_storage_drum.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/machine/MachineLiquefactor.java b/src/main/java/com/hbm/blocks/machine/MachineLiquefactor.java index 0be904f1d..d63e89512 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineLiquefactor.java +++ b/src/main/java/com/hbm/blocks/machine/MachineLiquefactor.java @@ -44,19 +44,7 @@ public class MachineLiquefactor extends BlockDummyable implements ITooltipProvid @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(world.isRemote) { - return true; - } else if(!player.isSneaking()) { - int[] pos = this.findCore(world, x, y, z); - - if(pos == null) - return false; - - FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]); - return true; - } else { - return true; - } + return this.standardOpenBehavior(world, x, y, z, player, 0); } @Override diff --git a/src/main/java/com/hbm/blocks/machine/MachineSolidifier.java b/src/main/java/com/hbm/blocks/machine/MachineSolidifier.java new file mode 100644 index 000000000..3c27f6d11 --- /dev/null +++ b/src/main/java/com/hbm/blocks/machine/MachineSolidifier.java @@ -0,0 +1,94 @@ +package com.hbm.blocks.machine; + +import java.util.List; + +import org.lwjgl.input.Keyboard; + +import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.ITooltipProvider; +import com.hbm.tileentity.TileEntityProxyCombo; +import com.hbm.tileentity.machine.TileEntityMachineSolidifier; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class MachineSolidifier extends BlockDummyable implements ITooltipProvider { + + public MachineSolidifier() { + super(Material.iron); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + + if(meta >= 12) + return new TileEntityMachineSolidifier(); + + if(meta >= extra) + return new TileEntityProxyCombo(true, true, true); + + return null; + } + + @Override + public int[] getDimensions() { + return new int[] {3, 0, 1, 1, 1, 1}; + } + + @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 getOffset() { + return 1; + } + + @Override + public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { + super.fillSpace(world, x, y, z, dir, o); + + x = x + dir.offsetX * o; + z = z + dir.offsetZ * o; + + this.makeExtra(world, x, y + 3, z); + + this.makeExtra(world, x + 1, y + 1, z); + this.makeExtra(world, x - 1, y + 1, z); + this.makeExtra(world, x, y + 1, z + 1); + this.makeExtra(world, x, y + 1, z - 1); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { + + if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + list.add(EnumChatFormatting.YELLOW + "beb"); + } else { + list.add(EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC +"Hold <" + + EnumChatFormatting.YELLOW + "" + EnumChatFormatting.ITALIC + "LSHIFT" + + EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC + "> to display more info"); + } + } + + @Override + public int getRenderType() { + return 0; + } + + @Override + public boolean isOpaqueCube() { + return true; + } + + @Override + public boolean renderAsNormalBlock() { + return true; + } +} diff --git a/src/main/java/com/hbm/inventory/recipes/SolidificationRecipes.java b/src/main/java/com/hbm/inventory/recipes/SolidificationRecipes.java new file mode 100644 index 000000000..807398ba9 --- /dev/null +++ b/src/main/java/com/hbm/inventory/recipes/SolidificationRecipes.java @@ -0,0 +1,42 @@ +package com.hbm.inventory.recipes; + +import static com.hbm.inventory.fluid.Fluids.*; + +import java.util.HashMap; + +import com.hbm.inventory.FluidStack; +import com.hbm.inventory.OreDictManager.DictFrame; +import com.hbm.inventory.fluid.FluidType; +import com.hbm.items.ItemEnums.EnumTarType; +import com.hbm.items.ModItems; +import com.hbm.util.Tuple.Pair; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class SolidificationRecipes { + + private static HashMap> recipes = new HashMap(); + + public static void register() { + registerRecipe(WATER, 1000, Blocks.ice); + registerRecipe(LAVA, 1000, Blocks.obsidian); + + //temporary recipes with incorrect quantities + registerRecipe(OIL, 1000, DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE)); + registerRecipe(BITUMEN, 1000, DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE)); + registerRecipe(HEATINGOIL, 1000, ModItems.solid_fuel); + } + + private static void registerRecipe(FluidType type, int quantity, Item output) { registerRecipe(type, quantity, new ItemStack(output)); } + private static void registerRecipe(FluidType type, int quantity, Block output) { registerRecipe(type, quantity, new ItemStack(output)); } + private static void registerRecipe(FluidType type, int quantity, ItemStack output) { + recipes.put(type, new Pair(quantity, output)); + } + + public static Pair getOutput(FluidType type) { + return recipes.get(type); + } +} diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 436664c12..267dfb971 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -377,9 +377,10 @@ public class CraftingManager { addShapelessAuto(new ItemStack(ModBlocks.asphalt, 1), new Object[] { ModBlocks.asphalt_light }); addRecipeAuto(new ItemStack(ModBlocks.block_niter_reinforced, 1), new Object[] { "TCT", "CNC", "TCT", 'T', TCALLOY.ingot(), 'C', ModBlocks.concrete, 'N', KNO.block() }); + String[] dyes = { "Black", "Red", "Green", "Brown", "Blue", "Purple", "Cyan", "LightGray", "Gray", "Pink", "Lime", "Yellow", "LightBlue", "Magenta", "Orange", "White" }; + for(int i = 0; i < 16; i++) { - String dyeName = ItemDye.field_150923_a[15 - i]; - dyeName = "dye" + dyeName.substring(0, 1).toUpperCase() + dyeName.substring(1); + String dyeName = "dye" + dyes[15 - i]; addRecipeAuto(new ItemStack(ModBlocks.concrete_colored, 8, i), new Object[] { "CCC", "CDC", "CCC", 'C', ModBlocks.concrete_smooth, 'D', dyeName }); addRecipeAuto(new ItemStack(ModBlocks.concrete_colored, 8, i), new Object[] { "CCC", "CDC", "CCC", 'C', ModBlocks.concrete_colored, 'D', dyeName }); } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineLiquefactor.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineLiquefactor.java index c466e4229..9503a4751 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineLiquefactor.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineLiquefactor.java @@ -115,7 +115,8 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen this.markDirty(); } } - + + @Override public void networkUnpack(NBTTagCompound nbt) { this.power = nbt.getLong("power"); this.progress = nbt.getInteger("progress"); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSolidifier.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSolidifier.java new file mode 100644 index 000000000..0096b6ac6 --- /dev/null +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineSolidifier.java @@ -0,0 +1,114 @@ +package com.hbm.tileentity.machine; + +import com.hbm.inventory.FluidTank; +import com.hbm.inventory.fluid.Fluids; +import com.hbm.inventory.recipes.LiquefactionRecipes; +import com.hbm.inventory.recipes.SolidificationRecipes; +import com.hbm.lib.Library; +import com.hbm.tileentity.TileEntityMachineBase; + +import api.hbm.energy.IEnergyUser; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityMachineSolidifier extends TileEntityMachineBase implements IEnergyUser { + + public long power; + public static final long maxPower = 100000; + public static final int usage = 500; + public int progress; + public static final int processTime = 200; + + public FluidTank tank; + + public TileEntityMachineSolidifier() { + super(5); + tank = new FluidTank(Fluids.NONE, 24000, 0); + } + + @Override + public String getName() { + return "container.machineSolidifier"; + } + + @Override + public void updateEntity() { + + if(!worldObj.isRemote) { + this.power = Library.chargeTEFromItems(slots, 1, power, maxPower); + tank.updateTank(this); + + this.trySubscribe(worldObj, xCoord + 2, yCoord + 1, zCoord, Library.POS_X); + this.trySubscribe(worldObj, xCoord - 2, yCoord + 1, zCoord, Library.NEG_X); + this.trySubscribe(worldObj, xCoord, yCoord + 1, zCoord + 2, Library.POS_Z); + this.trySubscribe(worldObj, xCoord, yCoord + 1, zCoord - 2, Library.NEG_Z); + + NBTTagCompound data = new NBTTagCompound(); + data.setLong("power", this.power); + data.setInteger("progress", this.progress); + this.networkPack(data, 50); + } + } + + @Override + public void networkUnpack(NBTTagCompound nbt) { + this.power = nbt.getLong("power"); + this.progress = nbt.getInteger("progress"); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + tank.readFromNBT(nbt, "tank"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + tank.writeToNBT(nbt, "tank"); + } + + @Override + public void setPower(long power) { + this.power = power; + } + + @Override + public long getPower() { + return power; + } + + @Override + public long getMaxPower() { + return maxPower; + } + + AxisAlignedBB bb = null; + + @Override + public AxisAlignedBB getRenderBoundingBox() { + + if(bb == null) { + bb = AxisAlignedBB.getBoundingBox( + xCoord - 1, + yCoord, + zCoord - 1, + xCoord + 2, + yCoord + 4, + zCoord + 2 + ); + } + + return bb; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } +} diff --git a/src/main/resources/assets/hbm/textures/gui/processing/gui_liquefactor.png b/src/main/resources/assets/hbm/textures/gui/processing/gui_liquefactor.png index 738d436d8..a0878acab 100644 Binary files a/src/main/resources/assets/hbm/textures/gui/processing/gui_liquefactor.png and b/src/main/resources/assets/hbm/textures/gui/processing/gui_liquefactor.png differ diff --git a/src/main/resources/assets/hbm/textures/gui/processing/gui_solidifier.png b/src/main/resources/assets/hbm/textures/gui/processing/gui_solidifier.png new file mode 100644 index 000000000..c98d96837 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/gui/processing/gui_solidifier.png differ