diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 225e7b11e..00eb695da 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -469,6 +469,13 @@ container.reactorSmall=Atomreaktor tile.machine_controller.name=Reaktorfernsteuerung container.reactorControl=Reaktorfernsteuerung +tile.barrel_plastic.name=Sicheres Fass™ +tile.barrel_corroded.name=Verrostetes Fass +tile.barrel_iron.name=Eisenfass +tile.barrel_steel.name=Stahlfass +tile.barrel_antimatter.name=Magnetischer Antimaterie-Behälter +container.barrel=Fass + tile.broadcaster_pc.name=Korrupter Sender tile.radiobox.name=Rosenberg Ungeziefervernichter diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index bc2caba4d..526fb71f9 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -469,6 +469,13 @@ container.reactorSmall=Nuclear Reactor tile.machine_controller.name=Reactor Remote Control Block container.reactorControl=Reactor Remote Control Block +tile.barrel_plastic.name=Safe Barrel™ +tile.barrel_corroded.name=Corroded Barrel +tile.barrel_iron.name=Iron Barrel +tile.barrel_steel.name=Steel Barrel +tile.barrel_antimatter.name=Magnetic Antimatter Container +container.barrel=Barrel + tile.broadcaster_pc.name=Corrupted Broadcaster tile.radiobox.name=Rosenberg Pest Control Box diff --git a/assets/hbm/models/blocks/antenna_top.obj b/assets/hbm/models/blocks/antenna_top.obj new file mode 100644 index 000000000..893224b1f --- /dev/null +++ b/assets/hbm/models/blocks/antenna_top.obj @@ -0,0 +1,147 @@ +# Blender v2.76 (sub 0) OBJ File: 'antenna_top.blend' +# www.blender.org +o Cube_Cube.001 +v -0.375000 0.000000 0.375000 +v -0.375000 0.500000 0.375000 +v -0.375000 0.000000 -0.375000 +v -0.375000 0.500000 -0.375000 +v 0.375000 0.000000 0.375000 +v 0.375000 0.500000 0.375000 +v 0.375000 0.000000 -0.375000 +v 0.375000 0.500000 -0.375000 +v -0.250000 1.250000 -0.250000 +v -0.250000 1.250000 -0.500000 +v -0.500000 1.250000 -0.500000 +v -0.500000 1.250000 -0.250000 +v -0.500000 0.250000 -0.250000 +v -0.500000 0.250000 -0.500000 +v -0.250000 0.250000 -0.250000 +v -0.250000 0.250000 -0.500000 +v -0.125000 0.500000 -0.125000 +v 0.125000 0.500000 -0.125000 +v -0.125000 0.500000 0.125000 +v 0.125000 0.500000 0.125000 +v 0.125000 0.625000 -0.125000 +v 0.125000 0.625000 0.125000 +v -0.125000 0.625000 -0.125000 +v -0.125000 0.625000 0.125000 +v -0.250000 1.250000 0.500000 +v -0.250000 1.250000 0.250000 +v -0.500000 1.250000 0.250000 +v -0.500000 1.250000 0.500000 +v -0.500000 0.250000 0.500000 +v -0.500000 0.250000 0.250000 +v -0.250000 0.250000 0.500000 +v -0.250000 0.250000 0.250000 +v 0.500000 1.250000 -0.250000 +v 0.500000 1.250000 -0.500000 +v 0.250000 1.250000 -0.500000 +v 0.250000 1.250000 -0.250000 +v 0.250000 0.250000 -0.250000 +v 0.250000 0.250000 -0.500000 +v 0.500000 0.250000 -0.250000 +v 0.500000 0.250000 -0.500000 +v 0.500000 1.250000 0.500000 +v 0.500000 1.250000 0.250000 +v 0.250000 1.250000 0.250000 +v 0.250000 1.250000 0.500000 +v 0.250000 0.250000 0.500000 +v 0.250000 0.250000 0.250000 +v 0.500000 0.250000 0.500000 +v 0.500000 0.250000 0.250000 +vt 0.600000 0.000000 +vt 0.600000 0.400000 +vt -0.000000 0.400000 +vt 0.000122 0.000122 +vt 0.600000 1.000000 +vt 0.000000 1.000000 +vt 0.800000 0.000000 +vt 0.800000 0.800000 +vt 0.600000 0.800000 +vt 0.600000 0.600000 +vt 0.800000 0.100000 +vt 0.999906 0.000094 +vt 1.000000 0.000000 +vt 0.800000 0.600000 +vt 1.000000 0.300000 +vt 0.800000 0.300000 +vt -0.000000 -0.000000 +vt 0.000100 0.999900 +vt 1.000000 0.100000 +vn -1.000000 0.000000 0.000000 +vn 0.000000 0.000000 -1.000000 +vn 1.000000 0.000000 0.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 -1.000000 0.000000 +vn 0.000000 1.000000 0.000000 +s off +f 4/1/1 3/2/1 1/3/1 +f 8/1/2 7/2/2 3/3/2 +f 6/3/3 5/4/3 7/1/3 +f 2/3/4 1/4/4 5/1/4 +f 3/3/5 7/2/5 5/5/5 +f 8/5/6 4/6/6 2/3/6 +f 13/7/1 12/8/1 11/9/1 +f 16/7/3 10/8/3 9/9/3 +f 14/7/2 11/8/2 10/9/2 +f 15/7/4 9/8/4 12/9/4 +f 10/8/6 11/9/6 12/10/6 +f 22/11/3 20/7/3 18/12/3 +f 23/11/1 17/7/1 19/13/1 +f 24/11/4 19/7/4 20/12/4 +f 21/11/2 18/7/2 17/13/2 +f 13/10/5 14/14/5 16/8/5 +f 21/15/6 23/16/6 24/11/6 +f 29/7/1 28/8/1 27/9/1 +f 32/7/3 26/8/3 25/9/3 +f 30/7/2 27/8/2 26/9/2 +f 31/7/4 25/8/4 28/9/4 +f 26/8/6 27/9/6 28/10/6 +f 29/10/5 30/14/5 32/8/5 +f 37/7/1 36/8/1 35/9/1 +f 40/7/3 34/8/3 33/9/3 +f 38/7/2 35/8/2 34/9/2 +f 39/7/4 33/8/4 36/9/4 +f 34/8/6 35/9/6 36/10/6 +f 37/10/5 38/14/5 40/8/5 +f 45/7/1 44/8/1 43/9/1 +f 48/7/3 42/8/3 41/9/3 +f 46/7/2 43/8/2 42/9/2 +f 47/7/4 41/8/4 44/9/4 +f 42/8/6 43/9/6 44/10/6 +f 45/10/5 46/14/5 48/8/5 +f 2/17/1 4/1/1 1/3/1 +f 4/17/2 8/1/2 3/3/2 +f 8/2/3 6/3/3 7/1/3 +f 6/2/4 2/3/4 5/1/4 +f 1/18/5 3/3/5 5/5/5 +f 6/2/6 8/5/6 2/3/6 +f 14/1/1 13/7/1 11/9/1 +f 15/1/3 16/7/3 9/9/3 +f 16/1/2 14/7/2 10/9/2 +f 13/1/4 15/7/4 12/9/4 +f 9/14/6 10/8/6 12/10/6 +f 21/19/3 22/11/3 18/12/3 +f 24/19/1 23/11/1 19/13/1 +f 22/19/4 24/11/4 20/12/4 +f 23/19/2 21/11/2 17/13/2 +f 15/9/5 13/10/5 16/8/5 +f 22/19/6 21/15/6 24/11/6 +f 30/1/1 29/7/1 27/9/1 +f 31/1/3 32/7/3 25/9/3 +f 32/1/2 30/7/2 26/9/2 +f 29/1/4 31/7/4 28/9/4 +f 25/14/6 26/8/6 28/10/6 +f 31/9/5 29/10/5 32/8/5 +f 38/1/1 37/7/1 35/9/1 +f 39/1/3 40/7/3 33/9/3 +f 40/1/2 38/7/2 34/9/2 +f 37/1/4 39/7/4 36/9/4 +f 33/14/6 34/8/6 36/10/6 +f 39/9/5 37/10/5 40/8/5 +f 46/1/1 45/7/1 43/9/1 +f 47/1/3 48/7/3 41/9/3 +f 48/1/2 46/7/2 42/9/2 +f 45/1/4 47/7/4 44/9/4 +f 41/14/6 42/8/6 44/10/6 +f 47/9/5 45/10/5 48/8/5 diff --git a/assets/hbm/models/barrel.obj b/assets/hbm/models/blocks/barrel.obj similarity index 100% rename from assets/hbm/models/barrel.obj rename to assets/hbm/models/blocks/barrel.obj diff --git a/assets/hbm/models/beam.obj b/assets/hbm/models/blocks/beam.obj similarity index 100% rename from assets/hbm/models/beam.obj rename to assets/hbm/models/blocks/beam.obj diff --git a/assets/hbm/models/pole.obj b/assets/hbm/models/blocks/pole.obj similarity index 100% rename from assets/hbm/models/pole.obj rename to assets/hbm/models/blocks/pole.obj diff --git a/assets/hbm/models/scaffold.obj b/assets/hbm/models/blocks/scaffold.obj similarity index 100% rename from assets/hbm/models/scaffold.obj rename to assets/hbm/models/blocks/scaffold.obj diff --git a/assets/hbm/models/taperecorder.obj b/assets/hbm/models/blocks/taperecorder.obj similarity index 100% rename from assets/hbm/models/taperecorder.obj rename to assets/hbm/models/blocks/taperecorder.obj diff --git a/assets/hbm/textures/blocks/barrel_Iron.png b/assets/hbm/textures/blocks/barrel_iron.png similarity index 100% rename from assets/hbm/textures/blocks/barrel_Iron.png rename to assets/hbm/textures/blocks/barrel_iron.png diff --git a/assets/hbm/textures/blocks/block_waste.png b/assets/hbm/textures/blocks/block_waste.png index 8c9c10d4f..ba7a9d711 100644 Binary files a/assets/hbm/textures/blocks/block_waste.png and b/assets/hbm/textures/blocks/block_waste.png differ diff --git a/assets/hbm/textures/blocks/block_waste_painted.png b/assets/hbm/textures/blocks/block_waste_painted.png new file mode 100644 index 000000000..b128bc2e7 Binary files /dev/null and b/assets/hbm/textures/blocks/block_waste_painted.png differ diff --git a/assets/hbm/textures/blocks/deco_pole_top.png b/assets/hbm/textures/blocks/deco_pole_top.png index f0ea8ef39..e3fb41bfb 100644 Binary files a/assets/hbm/textures/blocks/deco_pole_top.png and b/assets/hbm/textures/blocks/deco_pole_top.png differ diff --git a/assets/hbm/textures/blocks/waste_log_side.png b/assets/hbm/textures/blocks/waste_log_side.png index 517c9dc2b..fa1518e21 100644 Binary files a/assets/hbm/textures/blocks/waste_log_side.png and b/assets/hbm/textures/blocks/waste_log_side.png differ diff --git a/assets/hbm/textures/blocks/waste_log_top.png b/assets/hbm/textures/blocks/waste_log_top.png index 7fa742c90..9cccd4e41 100644 Binary files a/assets/hbm/textures/blocks/waste_log_top.png and b/assets/hbm/textures/blocks/waste_log_top.png differ diff --git a/assets/hbm/textures/items/ammo_rocket.png b/assets/hbm/textures/items/ammo_rocket.png index 21192e91d..7fec64353 100644 Binary files a/assets/hbm/textures/items/ammo_rocket.png and b/assets/hbm/textures/items/ammo_rocket.png differ diff --git a/assets/hbm/textures/items/ammo_rocket_emp.png b/assets/hbm/textures/items/ammo_rocket_emp.png index 2049797c5..57f7b245e 100644 Binary files a/assets/hbm/textures/items/ammo_rocket_emp.png and b/assets/hbm/textures/items/ammo_rocket_emp.png differ diff --git a/assets/hbm/textures/items/ammo_rocket_glare.png b/assets/hbm/textures/items/ammo_rocket_glare.png index 45f1c8d19..2da9af3c1 100644 Binary files a/assets/hbm/textures/items/ammo_rocket_glare.png and b/assets/hbm/textures/items/ammo_rocket_glare.png differ diff --git a/assets/hbm/textures/items/ammo_rocket_he.png b/assets/hbm/textures/items/ammo_rocket_he.png index cfe3181ef..be341237d 100644 Binary files a/assets/hbm/textures/items/ammo_rocket_he.png and b/assets/hbm/textures/items/ammo_rocket_he.png differ diff --git a/assets/hbm/textures/items/ammo_rocket_incendiary.png b/assets/hbm/textures/items/ammo_rocket_incendiary.png index 80d5c2a9b..06c6ad789 100644 Binary files a/assets/hbm/textures/items/ammo_rocket_incendiary.png and b/assets/hbm/textures/items/ammo_rocket_incendiary.png differ diff --git a/assets/hbm/textures/items/ammo_rocket_nuclear.png b/assets/hbm/textures/items/ammo_rocket_nuclear.png index e6c2e3284..7a8112095 100644 Binary files a/assets/hbm/textures/items/ammo_rocket_nuclear.png and b/assets/hbm/textures/items/ammo_rocket_nuclear.png differ diff --git a/assets/hbm/textures/items/ammo_rocket_shrapnel.png b/assets/hbm/textures/items/ammo_rocket_shrapnel.png index 6909b1b75..7f9cd9a15 100644 Binary files a/assets/hbm/textures/items/ammo_rocket_shrapnel.png and b/assets/hbm/textures/items/ammo_rocket_shrapnel.png differ diff --git a/assets/hbm/textures/items/ammo_rocket_sleek.png b/assets/hbm/textures/items/ammo_rocket_sleek.png index 748fb0a4f..8eff0d768 100644 Binary files a/assets/hbm/textures/items/ammo_rocket_sleek.png and b/assets/hbm/textures/items/ammo_rocket_sleek.png differ diff --git a/assets/hbm/textures/items/ammo_rocket_toxic.png b/assets/hbm/textures/items/ammo_rocket_toxic.png index 2e1ea5f1a..1cad57c5b 100644 Binary files a/assets/hbm/textures/items/ammo_rocket_toxic.png and b/assets/hbm/textures/items/ammo_rocket_toxic.png differ diff --git a/assets/hbm/textures/items/plate_aluminum.png b/assets/hbm/textures/items/plate_aluminium.png similarity index 100% rename from assets/hbm/textures/items/plate_aluminum.png rename to assets/hbm/textures/items/plate_aluminium.png diff --git a/assets/hbm/textures/models/misc/danger_diamond.png b/assets/hbm/textures/models/misc/danger_diamond.png new file mode 100644 index 000000000..829f24a8d Binary files /dev/null and b/assets/hbm/textures/models/misc/danger_diamond.png differ diff --git a/com/hbm/blocks/ModBlocks.java b/com/hbm/blocks/ModBlocks.java index 606259b15..568e3da89 100644 --- a/com/hbm/blocks/ModBlocks.java +++ b/com/hbm/blocks/ModBlocks.java @@ -401,7 +401,7 @@ public class ModBlocks { public static Block barrel_iron; public static Block barrel_steel; public static Block barrel_antimatter; - public static final int guiID_barrel = 18; + public static final int guiID_barrel = 92; public static Block machine_transformer; public static Block machine_transformer_20; diff --git a/com/hbm/blocks/generic/DecoPoleTop.java b/com/hbm/blocks/generic/DecoPoleTop.java index 7a25a06e3..f189620c6 100644 --- a/com/hbm/blocks/generic/DecoPoleTop.java +++ b/com/hbm/blocks/generic/DecoPoleTop.java @@ -1,29 +1,17 @@ package com.hbm.blocks.generic; -import com.hbm.tileentity.deco.TileEntityDecoPoleTop; - -import net.minecraft.block.BlockContainer; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -public class DecoPoleTop extends BlockContainer { +public class DecoPoleTop extends Block { public DecoPoleTop(Material p_i45386_1_) { super(p_i45386_1_); } - - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileEntityDecoPoleTop(); - } @Override public int getRenderType(){ - return -1; + return 334084; } @Override @@ -35,27 +23,5 @@ public class DecoPoleTop extends BlockContainer { public boolean renderAsNormalBlock() { return false; } - - @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/com/hbm/blocks/machine/BlockFluidBarrel.java b/com/hbm/blocks/machine/BlockFluidBarrel.java index fa086431e..3e88d7997 100644 --- a/com/hbm/blocks/machine/BlockFluidBarrel.java +++ b/com/hbm/blocks/machine/BlockFluidBarrel.java @@ -17,6 +17,8 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockFluidBarrel extends BlockContainer { @@ -61,6 +63,20 @@ public class BlockFluidBarrel extends BlockContainer { return false; } } + + @Override + public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) + { + float f = 0.0625F; + this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f); + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { + float f = 0.0625F; + this.setBlockBounds(2*f, 0.0F, 2*f, 14*f, 1.0F, 14*f); + return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); + } private final Random field_149933_a = new Random(); private Random rand; diff --git a/com/hbm/entity/grenade/EntityGrenadePulse.java b/com/hbm/entity/grenade/EntityGrenadePulse.java index 24819a718..476d1135f 100644 --- a/com/hbm/entity/grenade/EntityGrenadePulse.java +++ b/com/hbm/entity/grenade/EntityGrenadePulse.java @@ -9,8 +9,6 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.world.World; public class EntityGrenadePulse extends EntityGrenadeBouncyBase { - - private static final String __OBFID = "CL_00001722"; public EntityGrenadePulse(World p_i1773_1_) { super(p_i1773_1_); diff --git a/com/hbm/explosion/ExplosionChaos.java b/com/hbm/explosion/ExplosionChaos.java index fa3eceadc..f9ebe822e 100644 --- a/com/hbm/explosion/ExplosionChaos.java +++ b/com/hbm/explosion/ExplosionChaos.java @@ -152,7 +152,9 @@ public class ExplosionChaos { int Z = zz + z; int ZZ = YY + zz * zz; if (ZZ < r22) { - pDestruction(world, X, Y, Z); + + if(world.getBlock(X, Y, Z).getExplosionResistance(null) <= 70) + pDestruction(world, X, Y, Z); } } } diff --git a/com/hbm/handler/FluidTypeHandler.java b/com/hbm/handler/FluidTypeHandler.java index a0e70b732..5d6ad3017 100644 --- a/com/hbm/handler/FluidTypeHandler.java +++ b/com/hbm/handler/FluidTypeHandler.java @@ -2,64 +2,66 @@ package com.hbm.handler; import java.util.Arrays; +import com.hbm.render.util.EnumSymbol; + public class FluidTypeHandler { public enum FluidType { - NONE (0x888888, 0, 1, 1, "hbmfluid.none"), + NONE (0x888888, 0, 1, 1, 0, 0, 0, EnumSymbol.NONE, "hbmfluid.none"), - WATER (0x3333FF, 1, 1, 1, "hbmfluid.water"), - STEAM (0xe5e5e5, 9, 2, 1, "hbmfluid.steam", true, false, false), - HOTSTEAM (0xE7D6D6, 1, 1, 2, "hbmfluid.hotsteam", true, false, false), - SUPERHOTSTEAM (0xE7B7B7, 2, 1, 2, "hbmfluid.superhotsteam", true, false, false), - COOLANT (0xd8fcff, 2, 1, 1, "hbmfluid.coolant"), + WATER (0x3333FF, 1, 1, 1, 0, 0, 0, EnumSymbol.NONE, "hbmfluid.water"), + STEAM (0xe5e5e5, 9, 2, 1, 3, 0, 0, EnumSymbol.NONE, "hbmfluid.steam", true, false, false), + HOTSTEAM (0xE7D6D6, 1, 1, 2, 4, 0, 0, EnumSymbol.NONE, "hbmfluid.hotsteam", true, false, false), + SUPERHOTSTEAM (0xE7B7B7, 2, 1, 2, 4, 0, 0, EnumSymbol.NONE, "hbmfluid.superhotsteam", true, false, false), + COOLANT (0xd8fcff, 2, 1, 1, 1, 0, 0, EnumSymbol.NONE, "hbmfluid.coolant"), - LAVA (0xFF3300, 3, 1, 1, "hbmfluid.lava", true, false, false), + LAVA (0xFF3300, 3, 1, 1, 4, 0, 0, EnumSymbol.NOWATER, "hbmfluid.lava", true, false, false), - DEUTERIUM (0x0000FF, 4, 1, 1, "hbmfluid.deuterium"), - TRITIUM (0x000099, 5, 1, 1, "hbmfluid.tritium"), + DEUTERIUM (0x0000FF, 4, 1, 1, 3, 4, 0, EnumSymbol.NONE, "hbmfluid.deuterium"), + TRITIUM (0x000099, 5, 1, 1, 3, 4, 0, EnumSymbol.RADIATION, "hbmfluid.tritium"), - OIL (0x020202, 6, 1, 1, "hbmfluid.oil"), - HOTOIL (0x300900, 8, 2, 1, "hbmfluid.hotoil", true, false, false), + OIL (0x020202, 6, 1, 1, 2, 1, 0, EnumSymbol.NONE, "hbmfluid.oil"), + HOTOIL (0x300900, 8, 2, 1, 2, 3, 0, EnumSymbol.NONE, "hbmfluid.hotoil", true, false, false), - HEAVYOIL (0x141312, 2, 2, 1, "hbmfluid.heavyoil"), - BITUMEN (0x1f2426, 3, 2, 1, "hbmfluid.bitumen"), - SMEAR (0x190f01, 7, 1, 1, "hbmfluid.smear"), - HEATINGOIL (0x211806, 4, 2, 1, "hbmfluid.heatingoil"), + HEAVYOIL (0x141312, 2, 2, 1, 2, 1, 0, EnumSymbol.NONE, "hbmfluid.heavyoil"), + BITUMEN (0x1f2426, 3, 2, 1, 2, 0, 0, EnumSymbol.NONE, "hbmfluid.bitumen"), + SMEAR (0x190f01, 7, 1, 1, 2, 1, 0, EnumSymbol.NONE, "hbmfluid.smear"), + HEATINGOIL (0x211806, 4, 2, 1, 2, 2, 0, EnumSymbol.NONE, "hbmfluid.heatingoil"), - RECLAIMED (0x332b22, 8, 1, 1, "hbmfluid.reclaimed"), - PETROIL (0x44413d, 9, 1, 1, "hbmfluid.petroil"), + RECLAIMED (0x332b22, 8, 1, 1, 2, 2, 0, EnumSymbol.NONE, "hbmfluid.reclaimed"), + PETROIL (0x44413d, 9, 1, 1, 1, 3, 0, EnumSymbol.NONE, "hbmfluid.petroil"), - LUBRICANT (0x606060, 10, 1, 1, "hbmfluid.lubricant"), + LUBRICANT (0x606060, 10, 1, 1, 2, 1, 0, EnumSymbol.NONE, "hbmfluid.lubricant"), - NAPHTHA (0x595744, 5, 2, 1, "hbmfluid.naphtha"), - DIESEL (0xf2eed5, 11, 1, 1, "hbmfluid.diesel"), + NAPHTHA (0x595744, 5, 2, 1, 2, 1, 0, EnumSymbol.NONE, "hbmfluid.naphtha"), + DIESEL (0xf2eed5, 11, 1, 1, 1, 2, 0, EnumSymbol.NONE, "hbmfluid.diesel"), - LIGHTOIL (0x8c7451, 6, 2, 1, "hbmfluid.lightoil"), - KEROSENE (0xffa5d2, 12, 1, 1, "hbmfluid.kerosene"), + LIGHTOIL (0x8c7451, 6, 2, 1, 1, 2, 0, EnumSymbol.NONE, "hbmfluid.lightoil"), + KEROSENE (0xffa5d2, 12, 1, 1, 1, 2, 0, EnumSymbol.NONE, "hbmfluid.kerosene"), - GAS (0xfffeed, 13, 1, 1, "hbmfluid.gas"), - PETROLEUM (0x7cb7c9, 7, 2, 1, "hbmfluid.petroleum"), + GAS (0xfffeed, 13, 1, 1, 1, 4, 1, EnumSymbol.NONE, "hbmfluid.gas"), + PETROLEUM (0x7cb7c9, 7, 2, 1, 1, 4, 1, EnumSymbol.NONE, "hbmfluid.petroleum"), - BIOGAS (0xbfd37c, 12, 2, 1, "hbmfluid.biogas"), - BIOFUEL (0xeef274, 13, 2, 1, "hbmfluid.biofuel"), + BIOGAS (0xbfd37c, 12, 2, 1, 1, 4, 1, EnumSymbol.NONE, "hbmfluid.biogas"), + BIOFUEL (0xeef274, 13, 2, 1, 1, 2, 0, EnumSymbol.NONE, "hbmfluid.biofuel"), - NITAN (0x8018ad, 15, 2, 1, "hbmfluid.nitan"), + NITAN (0x8018ad, 15, 2, 1, 2, 4, 1, EnumSymbol.NONE, "hbmfluid.nitan"), - UF6 (0xD1CEBE, 14, 1, 1, "hbmfluid.uf6", false, true, false), - PUF6 (0x4C4C4C, 15, 1, 1, "hbmfluid.puf6", false, true, false), - SAS3 (0x4ffffc, 14, 2, 1, "hbmfluid.sas3", false, true, false), + UF6 (0xD1CEBE, 14, 1, 1, 4, 0, 2, EnumSymbol.RADIATION, "hbmfluid.uf6", false, true, false), + PUF6 (0x4C4C4C, 15, 1, 1, 4, 0, 4, EnumSymbol.RADIATION, "hbmfluid.puf6", false, true, false), + SAS3 (0x4ffffc, 14, 2, 1, 5, 0, 4, EnumSymbol.RADIATION, "hbmfluid.sas3", false, true, false), - AMAT (0x010101, 0, 2, 1, "hbmfluid.amat", false, false, true), - ASCHRAB (0xb50000, 1, 2, 1, "hbmfluid.aschrab", false, false, true), + AMAT (0x010101, 0, 2, 1, 5, 0, 5, EnumSymbol.ANTIMATTER, "hbmfluid.amat", false, false, true), + ASCHRAB (0xb50000, 1, 2, 1, 5, 0, 5, EnumSymbol.ANTIMATTER, "hbmfluid.aschrab", false, false, true), - ACID (0xfff7aa, 10, 2, 1, "hbmfluid.acid", false, true, false), - WATZ (0x86653E, 11, 2, 1, "hbmfluid.watz", false, true, false), - CRYOGEL (0x32ffff, 0, 1, 2, "hbmfluid.cryogel"), + ACID (0xfff7aa, 10, 2, 1, 3, 0, 3, EnumSymbol.OXIDIZER, "hbmfluid.acid", false, true, false), + WATZ (0x86653E, 11, 2, 1, 4, 0, 3, EnumSymbol.ACID, "hbmfluid.watz", false, true, false), + CRYOGEL (0x32ffff, 0, 1, 2, 2, 0, 0, EnumSymbol.CROYGENIC, "hbmfluid.cryogel"), - HYDROGEN (0x4286f4, 3, 1, 2, "hbmfluid.hydrogen"), - OXYGEN (0x98bdf9, 4, 1, 2, "hbmfluid.oxygen"), - XENON (0xba45e8, 5, 1, 2, "hbmfluid.xenon"), - BALEFIRE (0x28e02e, 6, 1, 2, "hbmfluid.balefire", true, true, false); + HYDROGEN (0x4286f4, 3, 1, 2, 3, 4, 0, EnumSymbol.CROYGENIC, "hbmfluid.hydrogen"), + OXYGEN (0x98bdf9, 4, 1, 2, 3, 0, 0, EnumSymbol.CROYGENIC, "hbmfluid.oxygen"), + XENON (0xba45e8, 5, 1, 2, 0, 0, 0, EnumSymbol.ASPHYXIANT, "hbmfluid.xenon"), + BALEFIRE (0x28e02e, 6, 1, 2, 4, 4, 3, EnumSymbol.RADIATION, "hbmfluid.balefire", true, true, false); //Approximate HEX Color of the fluid, used for pipe rendering @@ -79,20 +81,33 @@ public class FluidTypeHandler { //Whether the fluid is antimatter and requires magnetic storage private boolean antimatter; - private FluidType(int color, int x, int y, int sheet, String name) { + public int poison; + public int flammability; + public int reactivity; + public EnumSymbol symbol; + + private FluidType(int color, int x, int y, int sheet, int p, int f, int r, EnumSymbol symbol, String name) { this.color = color; this.textureX = x; this.textureY = y; this.name = name; this.sheetID = sheet; + this.poison = p; + this.flammability = f; + this.reactivity = r; + this.symbol = symbol; } - private FluidType(int color, int x, int y, int sheet, String name, boolean hot, boolean corrosive, boolean antimatter) { + private FluidType(int color, int x, int y, int sheet, int p, int f, int r, EnumSymbol symbol, String name, boolean hot, boolean corrosive, boolean antimatter) { this.color = color; this.textureX = x; this.textureY = y; this.name = name; this.sheetID = sheet; + this.poison = p; + this.flammability = f; + this.reactivity = r; + this.symbol = symbol; this.hot = hot; this.corrosive = corrosive; this.antimatter = antimatter; diff --git a/com/hbm/handler/GUIHandler.java b/com/hbm/handler/GUIHandler.java index 2a96a6682..71e2c8b92 100644 --- a/com/hbm/handler/GUIHandler.java +++ b/com/hbm/handler/GUIHandler.java @@ -822,6 +822,15 @@ public class GUIHandler implements IGuiHandler { } return null; } + + case ModBlocks.guiID_barrel: + { + if(entity instanceof TileEntityBarrel) + { + return new ContainerBarrel(player.inventory, (TileEntityBarrel) entity); + } + return null; + } } } else { //NON-TE CONTAINERS @@ -1643,6 +1652,15 @@ public class GUIHandler implements IGuiHandler { } return null; } + + case ModBlocks.guiID_barrel: + { + if(entity instanceof TileEntityBarrel) + { + return new GUIBarrel(player.inventory, (TileEntityBarrel) entity); + } + return null; + } } } else { //CLIENTONLY GUIS diff --git a/com/hbm/inventory/container/ContainerBarrel.java b/com/hbm/inventory/container/ContainerBarrel.java new file mode 100644 index 000000000..bb49b6000 --- /dev/null +++ b/com/hbm/inventory/container/ContainerBarrel.java @@ -0,0 +1,87 @@ +package com.hbm.inventory.container; + +import com.hbm.tileentity.machine.TileEntityBarrel; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerBarrel extends Container { + + private TileEntityBarrel diFurnace; + private int power; + + public ContainerBarrel(InventoryPlayer invPlayer, TileEntityBarrel tedf) { + power = 0; + + diFurnace = tedf; + + this.addSlotToContainer(new Slot(tedf, 0, 8, 17)); + this.addSlotToContainer(new Slot(tedf, 1, 8, 53)); + this.addSlotToContainer(new Slot(tedf, 2, 53 - 18, 17)); + this.addSlotToContainer(new Slot(tedf, 3, 53 - 18, 53)); + this.addSlotToContainer(new Slot(tedf, 4, 125, 17)); + this.addSlotToContainer(new Slot(tedf, 5, 125, 53)); + + for(int i = 0; i < 3; i++) + { + for(int j = 0; j < 9; j++) + { + this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for(int i = 0; i < 9; i++) + { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting crafting) { + super.addCraftingToCrafters(crafting); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot) this.inventorySlots.get(par2); + + if (var4 != null && var4.getHasStack()) + { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (par2 <= 5) { + if (!this.mergeItemStack(var5, 7, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(var5, 0, 6, false)) + { + return null; + } + + if (var5.stackSize == 0) + { + var4.putStack((ItemStack) null); + } + else + { + var4.onSlotChanged(); + } + } + + return var3; + } + + @Override + public boolean canInteractWith(EntityPlayer player) { + return diFurnace.isUseableByPlayer(player); + } +} diff --git a/com/hbm/inventory/container/ContainerCoreEmitter.java b/com/hbm/inventory/container/ContainerCoreEmitter.java index bdfdde1d5..79e8dd3ca 100644 --- a/com/hbm/inventory/container/ContainerCoreEmitter.java +++ b/com/hbm/inventory/container/ContainerCoreEmitter.java @@ -6,6 +6,7 @@ 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 ContainerCoreEmitter extends Container { @@ -33,4 +34,18 @@ public class ContainerCoreEmitter extends Container { public boolean canInteractWith(EntityPlayer player) { return nukeBoy.isUseableByPlayer(player); } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot) this.inventorySlots.get(par2); + + if (var4 != null && var4.getHasStack()) + { + return null; + } + + return var3; + } } diff --git a/com/hbm/inventory/container/ContainerCoreReceiver.java b/com/hbm/inventory/container/ContainerCoreReceiver.java index 16953d61e..e5e104100 100644 --- a/com/hbm/inventory/container/ContainerCoreReceiver.java +++ b/com/hbm/inventory/container/ContainerCoreReceiver.java @@ -6,6 +6,7 @@ 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 ContainerCoreReceiver extends Container { @@ -33,4 +34,18 @@ public class ContainerCoreReceiver extends Container { public boolean canInteractWith(EntityPlayer player) { return te.isUseableByPlayer(player); } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot) this.inventorySlots.get(par2); + + if (var4 != null && var4.getHasStack()) + { + return null; + } + + return var3; + } } diff --git a/com/hbm/inventory/gui/GUIBarrel.java b/com/hbm/inventory/gui/GUIBarrel.java new file mode 100644 index 000000000..f7a9166ea --- /dev/null +++ b/com/hbm/inventory/gui/GUIBarrel.java @@ -0,0 +1,70 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.FluidTank; +import com.hbm.inventory.container.ContainerBarrel; +import com.hbm.lib.RefStrings; +import com.hbm.packet.AuxButtonPacket; +import com.hbm.packet.PacketDispatcher; +import com.hbm.tileentity.machine.TileEntityBarrel; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUIBarrel extends GuiInfoContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_barrel.png"); + private TileEntityBarrel tank; + + public GUIBarrel(InventoryPlayer invPlayer, TileEntityBarrel tedf) { + super(new ContainerBarrel(invPlayer, tedf)); + tank = tedf; + + this.xSize = 176; + this.ySize = 166; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + tank.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 71, guiTop + 69 - 52, 34, 52); + } + + @Override + protected void drawGuiContainerForegroundLayer(int i, int j) { + String name = this.tank.hasCustomInventoryName() ? this.tank.getInventoryName() : I18n.format(this.tank.getInventoryName()); + + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + protected void mouseClicked(int x, int y, int i) { + super.mouseClicked(x, y, i); + + if(guiLeft + 151 <= x && guiLeft + 151 + 18 > x && guiTop + 35 < y && guiTop + 35 + 18 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(tank.xCoord, tank.yCoord, tank.zCoord, 0, 0)); + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + int i = tank.mode; + drawTexturedModalRect(guiLeft + 151, guiTop + 34, 176, i * 18, 18, 18); + + Minecraft.getMinecraft().getTextureManager().bindTexture(tank.tank.getSheet()); + tank.tank.renderTank(this, guiLeft + 71, guiTop + 69, tank.tank.getTankType().textureX() * FluidTank.x, tank.tank.getTankType().textureY() * FluidTank.y, 16, 52); + tank.tank.renderTank(this, guiLeft + 71 + 16, guiTop + 69, tank.tank.getTankType().textureX() * FluidTank.x, tank.tank.getTankType().textureY() * FluidTank.y, 16, 52); + tank.tank.renderTank(this, guiLeft + 71 + 32, guiTop + 69, tank.tank.getTankType().textureX() * FluidTank.x, tank.tank.getTankType().textureY() * FluidTank.y, 2, 52); + } +} diff --git a/com/hbm/items/special/ItemBlockLore.java b/com/hbm/items/special/ItemBlockLore.java index 2c00fa200..0af718785 100644 --- a/com/hbm/items/special/ItemBlockLore.java +++ b/com/hbm/items/special/ItemBlockLore.java @@ -19,20 +19,33 @@ public class ItemBlockLore extends ItemBlock { @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { - if(this.field_150939_a instanceof RedBarrel) + if(this.field_150939_a instanceof RedBarrel) { list.add("Static fluid barrel"); + } - if(this.field_150939_a == ModBlocks.barrel_plastic) + if(this.field_150939_a == ModBlocks.barrel_plastic) { list.add("Cannot store hot fluids"); + list.add("Cannot store corrosive fluids"); + list.add("Cannot store antimatter"); + } - if(this.field_150939_a == ModBlocks.barrel_iron) - list.add("Will leak when corrosive fluids are stored"); + if(this.field_150939_a == ModBlocks.barrel_iron) { + list.add("Can store hot fluids"); + list.add("Cannot store corrosive fluids properly"); + list.add("Cannot store antimatter"); + } - if(this.field_150939_a == ModBlocks.barrel_steel) - list.add("Can hold corrosive fluids"); + if(this.field_150939_a == ModBlocks.barrel_steel) { + list.add("Can store hot fluids"); + list.add("Can store corrosive fluids"); + list.add("Cannot store antimatter"); + } - if(this.field_150939_a == ModBlocks.barrel_antimatter) + if(this.field_150939_a == ModBlocks.barrel_antimatter) { + list.add("Can store hot fluids"); + list.add("Can store corrosive fluids"); list.add("Can store antimatter"); + } } } diff --git a/com/hbm/main/ClientProxy.java b/com/hbm/main/ClientProxy.java index c00d9b61b..63044a586 100644 --- a/com/hbm/main/ClientProxy.java +++ b/com/hbm/main/ClientProxy.java @@ -60,6 +60,7 @@ public class ClientProxy extends ServerProxy RenderingRegistry.registerBlockHandler(new RenderBarrel()); RenderingRegistry.registerBlockHandler(new RenderFence()); RenderingRegistry.registerBlockHandler(new RenderBarbedWire()); + RenderingRegistry.registerBlockHandler(new RenderAntennaTop()); MinecraftForgeClient.registerItemRenderer(ModItems.assembly_template, new ItemRenderTemplate()); MinecraftForgeClient.registerItemRenderer(ModItems.chemistry_template, new ItemRenderTemplate()); @@ -79,7 +80,6 @@ public class ClientProxy extends ServerProxy ClientRegistry.bindTileEntitySpecialRenderer(TileEntityObjTester.class, new RendererObjTester()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeGadget.class, new RenderNukeGadget()); - //MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.nuke_gadget), new ItemRenderNukeGadget()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeBoy.class, new RenderNukeBoy()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeCustom.class, new RenderNukeCustom()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukeSolinium.class, new RenderNukeSolinium()); @@ -131,6 +131,7 @@ public class ClientProxy extends ServerProxy ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineReactorSmall.class, new RenderSmallReactor()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineShredderLarge.class, new RenderMachineShredder()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTesla.class, new RenderTesla()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBarrel.class, new RenderFluidBarrel()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVaultDoor.class, new RenderVaultDoor()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBlastDoor.class, new RenderBlastDoor()); diff --git a/com/hbm/main/ResourceManager.java b/com/hbm/main/ResourceManager.java index 77a84a278..d0cd6b28b 100644 --- a/com/hbm/main/ResourceManager.java +++ b/com/hbm/main/ResourceManager.java @@ -612,11 +612,12 @@ public class ResourceManager { public static final ResourceLocation mp_w_15_balefire_tex = new ResourceLocation(RefStrings.MODID, "textures/models/missile_parts/warheads/mp_w_15_balefire.png"); //ISBRHs - public static final IModelCustom scaffold = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/scaffold.obj")); - public static final IModelCustom taperecorder = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/taperecorder.obj")); - public static final IModelCustom beam = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/beam.obj")); - public static final IModelCustom barrel = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/barrel.obj")); - public static final IModelCustom pole = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/pole.obj")); + public static final IModelCustom scaffold = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/scaffold.obj")); + public static final IModelCustom taperecorder = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/taperecorder.obj")); + public static final IModelCustom beam = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/beam.obj")); + public static final IModelCustom barrel = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/barrel.obj")); + public static final IModelCustom pole = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/pole.obj")); public static final IModelCustom barbed_wire = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/barbed_wire.obj")); + public static final IModelCustom antenna_top = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/antenna_top.obj")); } diff --git a/com/hbm/packet/AuxButtonPacket.java b/com/hbm/packet/AuxButtonPacket.java index a74183925..0bda5426c 100644 --- a/com/hbm/packet/AuxButtonPacket.java +++ b/com/hbm/packet/AuxButtonPacket.java @@ -3,6 +3,7 @@ package com.hbm.packet; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.items.weapon.ItemMissile.PartSize; import com.hbm.tileentity.bomb.TileEntityLaunchTable; +import com.hbm.tileentity.machine.TileEntityBarrel; import com.hbm.tileentity.machine.TileEntityCoreEmitter; import com.hbm.tileentity.machine.TileEntityCoreStabilizer; import com.hbm.tileentity.machine.TileEntityForceField; @@ -226,6 +227,13 @@ public class AuxButtonPacket implements IMessage { } } + if (te instanceof TileEntityBarrel) { + TileEntityBarrel barrel = (TileEntityBarrel)te; + + barrel.mode = (short) ((barrel.mode + 1) % barrel.modes); + barrel.markDirty(); + } + //} catch (Exception x) { } return null; diff --git a/com/hbm/render/block/RenderAntennaTop.java b/com/hbm/render/block/RenderAntennaTop.java new file mode 100644 index 000000000..2f7322e8e --- /dev/null +++ b/com/hbm/render/block/RenderAntennaTop.java @@ -0,0 +1,70 @@ +package com.hbm.render.block; + +import org.lwjgl.opengl.GL11; + +import com.hbm.main.ResourceManager; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.client.model.obj.WavefrontObject; + +public class RenderAntennaTop implements ISimpleBlockRenderingHandler { + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + + GL11.glPushMatrix(); + Tessellator tessellator = Tessellator.instance; + IIcon iicon = block.getIcon(0, 0); + tessellator.setColorOpaque_F(1, 1, 1); + + if (renderer.hasOverrideBlockTexture()) + { + iicon = renderer.overrideBlockTexture; + } + + GL11.glTranslated(0, -0.5, 0); + GL11.glScalef(0.75F, 0.75F, 0.75F); + tessellator.startDrawingQuads(); + ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.antenna_top, iicon, tessellator, 0, false); + tessellator.draw(); + + GL11.glPopMatrix(); + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + + Tessellator tessellator = Tessellator.instance; + IIcon iicon = block.getIcon(0, world.getBlockMetadata(x, y, z)); + + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + tessellator.setColorOpaque_F(1, 1, 1); + + if (renderer.hasOverrideBlockTexture()) + { + iicon = renderer.overrideBlockTexture; + } + + tessellator.addTranslation(x + 0.5F, y, z + 0.5F); + ObjUtil.renderWithIcon((WavefrontObject) ResourceManager.antenna_top, iicon, tessellator, 0, true); + tessellator.addTranslation(-x - 0.5F, -y, -z - 0.5F); + + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return 334084; + } + +} diff --git a/com/hbm/render/block/RenderFence.java b/com/hbm/render/block/RenderFence.java index c3dfa1384..cb42f1d72 100644 --- a/com/hbm/render/block/RenderFence.java +++ b/com/hbm/render/block/RenderFence.java @@ -20,12 +20,10 @@ public class RenderFence implements ISimpleBlockRenderingHandler { BlockFence fence = (BlockFence) ModBlocks.fence_metal; - boolean flag = false; float f = 0.375F; float f1 = 0.625F; renderer.setRenderBounds((double)f, 0.0D, (double)f, (double)f1, 1.0D, (double)f1); renderer.renderStandardBlock(fence, x, y, z); - flag = true; boolean flag1 = false; boolean flag2 = false; @@ -61,24 +59,22 @@ public class RenderFence implements ISimpleBlockRenderingHandler { { renderer.setRenderBounds((double)f4, (double)0, (double)0.5, (double)f5, (double)1, (double)0.5); renderer.renderStandardBlock(fence, x, y, z); - flag = true; } if (flag2) { renderer.setRenderBounds((double)0.5, (double)0, (double)f6, (double)0.5, (double)1, (double)f7); renderer.renderStandardBlock(fence, x, y, z); - flag = true; } renderer.field_152631_f = false; fence.setBlockBoundsBasedOnState(world, x, y, z); - return flag; + return true; } @Override public boolean shouldRender3DInInventory(int modelId) { - return false; + return true; } @Override diff --git a/com/hbm/render/tileentity/RenderFluidBarrel.java b/com/hbm/render/tileentity/RenderFluidBarrel.java new file mode 100644 index 000000000..9ae93cf83 --- /dev/null +++ b/com/hbm/render/tileentity/RenderFluidBarrel.java @@ -0,0 +1,46 @@ +package com.hbm.render.tileentity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.render.util.DiamondPronter; +import com.hbm.render.util.EnumSymbol; +import com.hbm.tileentity.machine.TileEntityBarrel; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; + +public class RenderFluidBarrel extends TileEntitySpecialRenderer { + + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float i) { + + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); + GL11.glEnable(GL11.GL_LIGHTING); + + if(te instanceof TileEntityBarrel) { + + TileEntityBarrel barrel = (TileEntityBarrel)te; + FluidType type = barrel.tank.getTankType(); + int poison = type.poison; + int flammability = type.flammability; + int reactivity = type.reactivity; + EnumSymbol symbol = type.symbol; + + for(int j = 0; j < 4; j++) { + + GL11.glPushMatrix(); + GL11.glTranslated(0.4, 0.25, -0.15); + GL11.glScalef(1.0F, 0.35F, 0.35F); + DiamondPronter.pront(poison, flammability, reactivity, symbol); + GL11.glPopMatrix(); + GL11.glRotatef(90, 0, 1, 0); + } + + } + + GL11.glPopMatrix(); + } + +} diff --git a/com/hbm/render/tileentity/RendererObjTester.java b/com/hbm/render/tileentity/RendererObjTester.java index a063d6926..05f6d6356 100644 --- a/com/hbm/render/tileentity/RendererObjTester.java +++ b/com/hbm/render/tileentity/RendererObjTester.java @@ -3,14 +3,12 @@ package com.hbm.render.tileentity; import org.lwjgl.opengl.GL11; import com.hbm.lib.RefStrings; -import com.hbm.render.util.BeamPronter; -import com.hbm.render.util.BeamPronter.EnumBeamType; -import com.hbm.render.util.BeamPronter.EnumWaveType; +import com.hbm.render.util.DiamondPronter; +import com.hbm.render.util.EnumSymbol; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.Vec3; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; @@ -32,7 +30,8 @@ public class RendererObjTester extends TileEntitySpecialRenderer { public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { GL11.glPushMatrix(); - GL11.glTranslated(x + 0.5, y, z + 0.5); + GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); + GL11.glEnable(GL11.GL_LIGHTING); /*switch(tileEntity.getBlockMetadata()) { case 5: @@ -108,10 +107,12 @@ public class RendererObjTester extends TileEntitySpecialRenderer { //SoyuzPronter.prontSoyuz(); //TomPronter.prontTom(); - BeamPronter.prontBeam(Vec3.createVectorHelper(5, 5, 5), EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0xff8000, 0xff8000, (int)tileEntity.getWorldObj().getTotalWorldTime() % 360 * 25, 25, 0.1F, 4, 0.05F); - BeamPronter.prontBeam(Vec3.createVectorHelper(5, 5, 5), EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0xffff00, 0xffff00, (int)tileEntity.getWorldObj().getTotalWorldTime() % 360 * 25, 1, 0F, 4, 0.05F); + //BeamPronter.prontBeam(Vec3.createVectorHelper(5, 5, 5), EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0xff8000, 0xff8000, (int)tileEntity.getWorldObj().getTotalWorldTime() % 360 * 25, 25, 0.1F, 4, 0.05F); + //BeamPronter.prontBeam(Vec3.createVectorHelper(5, 5, 5), EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0xffff00, 0xffff00, (int)tileEntity.getWorldObj().getTotalWorldTime() % 360 * 25, 1, 0F, 4, 0.05F); //BeamPronter.prontHelix(Vec3.createVectorHelper(0, 5, 0), 0.5, 0.5, 0.5, EnumWaveType.SPIRAL, EnumBeamType.LINE, 0x0000ff, 0xffff00, (int)tileEntity.getWorldObj().getTotalWorldTime() % 360 * 25 + 180, 25, 0.25F); + DiamondPronter.pront(1, 2, 3, EnumSymbol.OXIDIZER); + GL11.glPopMatrix(); } diff --git a/com/hbm/render/util/DiamondPronter.java b/com/hbm/render/util/DiamondPronter.java new file mode 100644 index 000000000..bd4c3950b --- /dev/null +++ b/com/hbm/render/util/DiamondPronter.java @@ -0,0 +1,115 @@ +package com.hbm.render.util; + +import org.lwjgl.opengl.GL11; + +import com.hbm.lib.RefStrings; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; + +public class DiamondPronter { + + private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/models/misc/danger_diamond.png"); + + public static void pront(int poison, int flammability, int reactivity, EnumSymbol symbol) { + + GL11.glPushMatrix(); + + Minecraft.getMinecraft().renderEngine.bindTexture(texture); + + float p = 1F/256F; + float s = 1F/139F; + Tessellator tess = Tessellator.instance; + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + + tess.startDrawingQuads(); + tess.addVertexWithUV(0.0, 0.5, -0.5, p * 144, p * 45); + tess.addVertexWithUV(0.0, 0.5, 0.5, p * 5, p * 45); + tess.addVertexWithUV(0.0, -0.5, 0.5, p * 5, p * 184); + tess.addVertexWithUV(0.0, -0.5, -0.5, p * 144, p * 184); + tess.draw(); + + float width = 10F * s; + float height = 14F * s; + + if(poison >= 0 && poison < 6) { + + float oY = 0; + float oZ = 33 * s; + + int x = 5 + (poison - 1) * 24; + int y = 5; + + if(poison == 0) x = 125; + + tess.startDrawingQuads(); + tess.addVertexWithUV(0.01, height + oY, -width + oZ, (x + 20) * p, y * p); + tess.addVertexWithUV(0.01, height + oY, width + oZ, x * p, y * p); + tess.addVertexWithUV(0.01, -height + oY, width + oZ, x * p, (y + 28) * p); + tess.addVertexWithUV(0.01, -height + oY, -width + oZ, (x + 20) * p, (y + 28) * p); + tess.draw(); + } + + if(flammability >= 0 && flammability < 6) { + + float oY = 33 * s; + float oZ = 0; + + int x = 5 + (flammability - 1) * 24; + int y = 5; + + if(flammability == 0) x = 125; + + tess.startDrawingQuads(); + tess.addVertexWithUV(0.01, height + oY, -width + oZ, (x + 20) * p, y * p); + tess.addVertexWithUV(0.01, height + oY, width + oZ, x * p, y * p); + tess.addVertexWithUV(0.01, -height + oY, width + oZ, x * p, (y + 28) * p); + tess.addVertexWithUV(0.01, -height + oY, -width + oZ, (x + 20) * p, (y + 28) * p); + tess.draw(); + } + + if(reactivity >= 0 && reactivity < 6) { + + float oY = 0; + float oZ = -33 * s; + + int x = 5 + (reactivity - 1) * 24; + int y = 5; + + if(reactivity == 0) x = 125; + + tess.startDrawingQuads(); + tess.addVertexWithUV(0.01, height + oY, -width + oZ, (x + 20) * p, y * p); + tess.addVertexWithUV(0.01, height + oY, width + oZ, x * p, y * p); + tess.addVertexWithUV(0.01, -height + oY, width + oZ, x * p, (y + 28) * p); + tess.addVertexWithUV(0.01, -height + oY, -width + oZ, (x + 20) * p, (y + 28) * p); + tess.draw(); + } + + + float symSize = 59F/2F * s; + + if(symbol != EnumSymbol.NONE) { + + float oY = -33 * s; + float oZ = 0; + + int x = symbol.x; + int y = symbol.y; + + tess.startDrawingQuads(); + tess.addVertexWithUV(0.01, symSize + oY, -symSize + oZ, (x + 59) * p, y * p); + tess.addVertexWithUV(0.01, symSize + oY, symSize + oZ, x * p, y * p); + tess.addVertexWithUV(0.01, -symSize + oY, symSize + oZ, x * p, (y + 59) * p); + tess.addVertexWithUV(0.01, -symSize + oY, -symSize + oZ, (x + 59) * p, (y + 59) * p); + tess.draw(); + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + +} diff --git a/com/hbm/render/util/EnumSymbol.java b/com/hbm/render/util/EnumSymbol.java new file mode 100644 index 000000000..7b73294ef --- /dev/null +++ b/com/hbm/render/util/EnumSymbol.java @@ -0,0 +1,20 @@ +package com.hbm.render.util; + +public enum EnumSymbol { + NONE(0, 0), + RADIATION(195, 2), + NOWATER(195, 63), + ACID(195, 124), + ASPHYXIANT(195, 185), + CROYGENIC(134, 185), + ANTIMATTER(73, 185), + OXIDIZER(12, 185); + + public int x; + public int y; + + private EnumSymbol(int x, int y) { + this.x = x; + this.y = y; + } +} diff --git a/com/hbm/tileentity/machine/TileEntityBarrel.java b/com/hbm/tileentity/machine/TileEntityBarrel.java index ed1046218..e00c473f9 100644 --- a/com/hbm/tileentity/machine/TileEntityBarrel.java +++ b/com/hbm/tileentity/machine/TileEntityBarrel.java @@ -3,6 +3,7 @@ package com.hbm.tileentity.machine; import java.util.ArrayList; import java.util.List; +import com.hbm.blocks.ModBlocks; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidSource; @@ -10,13 +11,23 @@ import com.hbm.inventory.FluidTank; import com.hbm.lib.Library; import com.hbm.tileentity.TileEntityMachineBase; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcceptor, IFluidSource { public FluidTank tank; - public int mode = 0; + public short mode = 0; + public static final short modes = 4; public int age = 0; public List list = new ArrayList(); + public TileEntityBarrel() { + super(6); + tank = new FluidTank(FluidType.NONE, 0, 0); + } + public TileEntityBarrel(int capacity) { super(6); tank = new FluidTank(FluidType.NONE, capacity, 0); @@ -33,9 +44,62 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc if(!worldObj.isRemote) { tank.setType(0, 1, slots); + tank.loadTank(2, 3, slots); + tank.unloadTank(4, 5, slots); tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId); + + age++; + if(age >= 20) + age = 0; + + if((mode == 1 || mode == 2) && (age == 9 || age == 19)) + fillFluidInit(tank.getTankType()); + + if(tank.getFill() > 0) { + + Block b = this.getBlockType(); + + if(b != ModBlocks.barrel_antimatter && tank.getTankType().isAntimatter()) { + worldObj.func_147480_a(xCoord, yCoord, zCoord, false); + worldObj.newExplosion(null, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 5, true, true); + } + + if(b == ModBlocks.barrel_plastic && (tank.getTankType().isCorrosive() || tank.getTankType().isHot())) { + worldObj.func_147480_a(xCoord, yCoord, zCoord, false); + worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "random.fizz", 1.0F, 1.0F); + } + + //TODO: rip off furnace code and make transition more seamless + if(b == ModBlocks.barrel_iron && tank.getTankType().isCorrosive()) { + ItemStack[] copy = this.slots.clone(); + this.slots = new ItemStack[6]; + worldObj.setBlock(xCoord, yCoord, zCoord, ModBlocks.barrel_corroded); + TileEntityBarrel barrel = (TileEntityBarrel)worldObj.getTileEntity(xCoord, yCoord, zCoord); + + if(barrel != null) { + barrel.tank.setTankType(tank.getTankType()); + barrel.tank.setFill(Math.min(barrel.tank.getMaxFill(), tank.getFill())); + barrel.slots = copy; + } + + worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "random.fizz", 1.0F, 1.0F); + } + + if(b == ModBlocks.barrel_corroded && worldObj.rand.nextInt(3) == 0) { + tank.setFill(tank.getFill() - 1); + } + } + + NBTTagCompound data = new NBTTagCompound(); + data.setShort("mode", mode); + this.networkPack(data, 50); } } + + public void networkUnpack(NBTTagCompound data) { + + mode = data.getShort("mode"); + } @Override public void setFillstate(int fill, int index) { @@ -49,6 +113,10 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc @Override public int getMaxFluidFill(FluidType type) { + + if(mode == 2 || mode == 3) + return 0; + return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0; } @@ -74,6 +142,7 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc @Override public int getFluidFill(FluidType type) { + return type.name().equals(this.tank.getTankType().name()) ? tank.getFill() : 0; } @@ -100,4 +169,20 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc return list; } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + + mode = nbt.getShort("mode"); + tank.readFromNBT(nbt, "tank"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + + nbt.setShort("mode", mode); + tank.writeToNBT(nbt, "tank"); + } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineReactorSmall.java b/com/hbm/tileentity/machine/TileEntityMachineReactorSmall.java index 1e834620d..3682fc7f5 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineReactorSmall.java +++ b/com/hbm/tileentity/machine/TileEntityMachineReactorSmall.java @@ -48,8 +48,8 @@ public class TileEntityMachineReactorSmall extends TileEntity public FluidTank[] tanks; private static final int[] slots_top = new int[] { 0 }; - private static final int[] slots_bottom = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16 }; - private static final int[] slots_side = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16 }; + private static final int[] slots_bottom = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15 }; + private static final int[] slots_side = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14 }; private String customName;