From ad0954a145dca33e39756938b24103d5f204d40b Mon Sep 17 00:00:00 2001 From: HbmMods Date: Thu, 11 Jun 2020 23:34:07 +0200 Subject: [PATCH] added soyuz launcher core compnent with hologram, diamond gravel recipes --- assets/hbm/lang/de_DE.lang | 4 +- assets/hbm/lang/en_US.lang | 4 +- .../hbm/textures/blocks/struct_scaffold.png | Bin 372 -> 378 bytes .../hbm/textures/blocks/struct_soyuz_core.png | Bin 0 -> 405 bytes assets/hbm/textures/items/crystal_diamond.png | Bin 0 -> 433 bytes com/hbm/blocks/BlockDummyable.java | 3 +- com/hbm/blocks/ModBlocks.java | 3 + com/hbm/blocks/machine/BlockSoyuzStruct.java | 26 +++ com/hbm/blocks/machine/SoyuzLauncher.java | 16 +- com/hbm/handler/MultiblockHandlerXR.java | 8 + com/hbm/handler/ToolAbility.java | 28 +++ .../handler/guncfg/BulletConfigFactory.java | 2 +- com/hbm/inventory/CentrifugeRecipes.java | 1 + com/hbm/inventory/CrystallizerRecipes.java | 6 + com/hbm/inventory/ShredderRecipes.java | 4 +- com/hbm/items/ModItems.java | 49 ++++-- com/hbm/items/bomb/ItemMike.java | 1 - .../items/machine/ItemAssemblyTemplate.java | 2 +- com/hbm/lib/Library.java | 3 +- com/hbm/main/ClientProxy.java | 1 + com/hbm/main/CraftingManager.java | 2 + com/hbm/main/MainRegistry.java | 4 + com/hbm/render/block/BusAnimation.java | 65 +++++++ .../render/block/BusAnimationKeyframe.java | 47 +++++ .../render/block/BusAnimationSequence.java | 24 +++ .../tileentity/RenderSoyuzMultiblock.java | 165 ++++++++++++++++++ .../machine/TileEntityMachineSatDock.java | 70 ++++---- .../machine/TileEntitySoyuzStruct.java | 156 +++++++++++++++++ com/hbm/util/WeightedRandomObject.java | 23 +++ 29 files changed, 652 insertions(+), 65 deletions(-) create mode 100644 assets/hbm/textures/blocks/struct_soyuz_core.png create mode 100644 assets/hbm/textures/items/crystal_diamond.png create mode 100644 com/hbm/blocks/machine/BlockSoyuzStruct.java create mode 100644 com/hbm/render/block/BusAnimation.java create mode 100644 com/hbm/render/block/BusAnimationKeyframe.java create mode 100644 com/hbm/render/block/BusAnimationSequence.java create mode 100644 com/hbm/render/tileentity/RenderSoyuzMultiblock.java create mode 100644 com/hbm/tileentity/machine/TileEntitySoyuzStruct.java create mode 100644 com/hbm/util/WeightedRandomObject.java diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index d4ac876a1..6c94e203f 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -70,6 +70,7 @@ potion.hbm_phosphorus=Phosphorverbrennung tool.ability.recursion=Erzadern-Miner tool.ability.hammer=AoE +tool.ability.silktouch=Präzisionswerkzeug tool.ability.smelter=Auto-Ofen tool.ability.shredder=Auto-Brecher tool.ability.cnetrifuge=Auto-Zentrifuge @@ -675,7 +676,7 @@ item.coil_magnetized_tungsten.name=4000K Hochtemperaturensupraleitermagnetspule item.plate_mixed.name=Gemischte Platte item.plate_paa.name=PaA-Legierungsplatte item.ingot_dura_steel.name=Schnellarbeitsstahlbarren -item.ingot_polymer.name=Polymerbarren +item.ingot_polymer.name=Polymertafel item.bolt_dura_steel.name=Schnellarbeitsstahlbolzen item.pipes_steel.name=Stahlrohre item.drill_titanium.name=Titanbohrer @@ -745,6 +746,7 @@ item.nugget_beryllium.name=Berylliumnugget item.crystal_iron.name=Eisenkristalle item.crystal_gold.name=Goldkristalle item.crystal_redstone.name=Redstonekristalle +item.crystal_diamond.name=Diamantkristalle item.crystal_uranium.name=Urankristalle item.crystal_thorium.name=Thoriumkristalle item.crystal_plutonium.name=Plutoniumkristalle diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index e0a6fdeee..cf96d0170 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -70,6 +70,7 @@ potion.hbm_phosphorus=Phosphorus Burns tool.ability.recursion=Vein Miner tool.ability.hammer=AoE +tool.ability.silktouch=Precision Miner tool.ability.smelter=Auto-Smelter tool.ability.shredder=Auto-Shredder tool.ability.centrifuge=Auto-Centrifuge @@ -675,7 +676,7 @@ item.coil_magnetized_tungsten.name=4000K High Temperature Super Conducting Coil item.plate_mixed.name=Mixed Plate item.plate_paa.name=PaA Alloy Plate item.ingot_dura_steel.name=High-Speed Steel Ingot -item.ingot_polymer.name=Polymer Ingot +item.ingot_polymer.name=Polymer Bar item.bolt_dura_steel.name=High-Speed Steel Bolt item.pipes_steel.name=Steel Pipes item.drill_titanium.name=Titanium Drill @@ -745,6 +746,7 @@ item.nugget_beryllium.name=Beryllium Nugget item.crystal_iron.name=Iron Crystals item.crystal_gold.name=Gold Crystals item.crystal_redstone.name=Redstone Crystals +item.crystal_diamond.name=Diamond Crystals item.crystal_uranium.name=Uranium Crystals item.crystal_thorium.name=Thorium Crystals item.crystal_plutonium.name=Plutonium Crystals diff --git a/assets/hbm/textures/blocks/struct_scaffold.png b/assets/hbm/textures/blocks/struct_scaffold.png index abf5723f97eaee213b8686ff596bc8c7972ada01..65faffc9a4803cff12b298c2708683beb0fb6e97 100644 GIT binary patch delta 335 zcmV-V0kHn`0{Q}wG=DKkL_t(Ijir;Zjl(buMW1{I;)385DZECiOdyqRyg~*zWE7Rk z1Q{c%5Gvf=6*&oV9H+St2q0{J;`5Vqm&@gcKd5R65fNJCoNH`mHSPiCdB)7R-EPDf z>(5~r09cl#ew(IgmEW}$Rh4O)D!F}ytg0&o?s~ocm>H^yh<}iC#>_}5trUb1HaV*L zR1jmt%*Z(-BB&}M1eRslC6`wFA|=LH5 z;=Sj5K5xjau^k`Ky1j?~bNNrUmeI zI-S19aolyg??`(dj|a!&5$7Btf^&{>961~gbY{jp&nvgvITy6c=Do*zkD0A+p(U3s hEUzuHx`qFq^DnIV1os-gzK{R_002ovPDHLkV1m{TpJM<3 delta 329 zcmV-P0k;170`vlqG=D2eL_t(Ijir+@lEN?yMIRZ)(E&JtJKuwnit8|xR4H>fcRm4C zD%lNNuo4c0ZB~^g(bs%ES-a!$_~180#8N^C^wC=LTva{a1I+WxvMgLK7h;V5a~wwi zYOVgQl(MQH0G4HO2c;AjiwGj(jY=tqh}Q$`PN&mDRS^+F2!FKJP*qY&K9Z`EbN;9i zk*9+gBdSVkjSvDNLe3dg{VKLm_hu!===Kd@&e=!X5(5lYJdPtNr4J`tqZyMB!gGWk zSl?utCa%}(2bUh~z#q}m{uaCQ`TRH>4&Lz{m|5*z!1Ha~?|1fARBQD;_X3L^tU+w8 zy++s)r<69q+CsLR!8h?1*!L!bsxr^>igv$ei~g}q)5Ps|Lsi$e(2HxW{u1q&tjX#Y b{(H_pkLd-2shD;X00000NkvXXu0mjf1qGZS diff --git a/assets/hbm/textures/blocks/struct_soyuz_core.png b/assets/hbm/textures/blocks/struct_soyuz_core.png new file mode 100644 index 0000000000000000000000000000000000000000..4f36c0bf01379378f4cc3d9512d880d0ce856a01 GIT binary patch literal 405 zcmV;G0c!qc5mAE-x9T}t=<71Kbr{1H#hUbovUh z=(-MNSpopQ-k&mphvyFf!0~v@;%5Nhy%z-n+-G?CUp8Bb2Y^XcRc9iCQVQRnF9Pg$ zr;MO@oF}JFB#fC`{=bkk#-S0B z$mVgeKU^SD5MxYBQl}2DLI4qoY%YN(F`Pn-alC}r3kf%IIL6<0_ae=RNOpVKyd@F< z1?G9GIz7u~i?(gYZ-I#9X#P4TE=@|f_ndzKGhERBl#ViF00000NkvXXu0mjf@87A0 literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/crystal_diamond.png b/assets/hbm/textures/items/crystal_diamond.png new file mode 100644 index 0000000000000000000000000000000000000000..a0ebdb784f76c437243c7ff49118f46ac4f233d7 GIT binary patch literal 433 zcmV;i0Z#sjP)b;@5JjJnIRX_zAcRSeTmYu=A-F&qP|lDGq)U+^6@3aS z`XCBhF3=)TB2l??O@wTVN#otv5JeOj$=Vt3{GI>*Slkiw!$EZZ-tSxYU@G99i0nk9 z{E!a&uL<+RL1vBvKo>}omQ5p7=l1F5MV39Np9E! zP}51b__iWUT-N}%A{_Iaugk^ADod_u-H&0&wwR)uk9iKjNd%=7Poohpg{&J1OV6_i z0-3ljaU3(~bWD?eaGzyRuUE{hY#~V!)2u_YNYfO6*Ug5N@0(2-4`z--qtQSqWoVaA z&7|3ER(z=G$z6U{*=n^apeTwM4u`~X%(T~I+UuEn!(fr7bb;sb_=W|5Qi_Lm8`rYf zXPNQAF6&zqr>@I>3g8dtt=v0jVGfl7US b_h0c1)Lq*Tw^r#300000NkvXXu0mjfiT1mj literal 0 HcmV?d00001 diff --git a/com/hbm/blocks/BlockDummyable.java b/com/hbm/blocks/BlockDummyable.java index 13f433f98..01fccbc11 100644 --- a/com/hbm/blocks/BlockDummyable.java +++ b/com/hbm/blocks/BlockDummyable.java @@ -42,7 +42,7 @@ public abstract class BlockDummyable extends BlockContainer { super.onNeighborBlockChange(world, x, y, z, block); - if(world.isRemote) + if(world.isRemote || safeRem) return; int metadata = world.getBlockMetadata(x, y, z); @@ -56,6 +56,7 @@ public abstract class BlockDummyable extends BlockContainer { if(b != this) { world.setBlockToAir(x, y, z); + //world.setBlock(x, y, z, ModBlocks.dfc_injector, dir.ordinal(), 3); } } diff --git a/com/hbm/blocks/ModBlocks.java b/com/hbm/blocks/ModBlocks.java index e3ea321a0..1fd8a8e9f 100644 --- a/com/hbm/blocks/ModBlocks.java +++ b/com/hbm/blocks/ModBlocks.java @@ -460,6 +460,7 @@ public class ModBlocks { public static Block struct_scaffold; public static Block struct_launcher_core; public static Block struct_launcher_core_large; + public static Block struct_soyuz_core; public static Block factory_titanium_hull; public static Block factory_titanium_furnace; @@ -1124,6 +1125,7 @@ public class ModBlocks { struct_scaffold = new BlockGeneric(Material.iron).setBlockName("struct_scaffold").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":struct_scaffold"); struct_launcher_core = new BlockStruct(Material.iron).setBlockName("struct_launcher_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":struct_launcher_core"); struct_launcher_core_large = new BlockStruct(Material.iron).setBlockName("struct_launcher_core_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":struct_launcher_core_large"); + struct_soyuz_core = new BlockSoyuzStruct(Material.iron).setBlockName("struct_soyuz_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":struct_soyuz_core"); factory_titanium_hull = new BlockGeneric(Material.iron).setBlockName("factory_titanium_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_titanium_hull"); factory_titanium_furnace = new FactoryHatch(Material.iron).setBlockName("factory_titanium_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":factory_titanium_furnace"); @@ -1805,6 +1807,7 @@ public class ModBlocks { GameRegistry.registerBlock(struct_scaffold, struct_scaffold.getUnlocalizedName()); GameRegistry.registerBlock(struct_launcher_core, struct_launcher_core.getUnlocalizedName()); GameRegistry.registerBlock(struct_launcher_core_large, struct_launcher_core_large.getUnlocalizedName()); + GameRegistry.registerBlock(struct_soyuz_core, struct_soyuz_core.getUnlocalizedName()); //Absorbers GameRegistry.registerBlock(absorber, absorber.getUnlocalizedName()); diff --git a/com/hbm/blocks/machine/BlockSoyuzStruct.java b/com/hbm/blocks/machine/BlockSoyuzStruct.java new file mode 100644 index 000000000..60a417d51 --- /dev/null +++ b/com/hbm/blocks/machine/BlockSoyuzStruct.java @@ -0,0 +1,26 @@ +package com.hbm.blocks.machine; + +import com.hbm.tileentity.machine.TileEntitySoyuzStruct; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class BlockSoyuzStruct extends BlockContainer { + + public BlockSoyuzStruct(Material mat) { + super(mat); + } + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + return new TileEntitySoyuzStruct(); + } + + public boolean isOpaqueCube() { + + return false; + } + +} diff --git a/com/hbm/blocks/machine/SoyuzLauncher.java b/com/hbm/blocks/machine/SoyuzLauncher.java index ef94859d7..f3129a0b9 100644 --- a/com/hbm/blocks/machine/SoyuzLauncher.java +++ b/com/hbm/blocks/machine/SoyuzLauncher.java @@ -75,7 +75,7 @@ public class SoyuzLauncher extends BlockDummyable { } } - int height = 4; + public static final int height = 4; @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { @@ -120,7 +120,7 @@ public class SoyuzLauncher extends BlockDummyable { super.onBlockPlacedBy(world, x, y, z, player, itemStack); } - protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) { + public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) { x = x + dir.offsetX * o; y = y + dir.offsetY * o + height; @@ -137,7 +137,7 @@ public class SoyuzLauncher extends BlockDummyable { return true; } - protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { + public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { x = x + dir.offsetX * o; y = y + dir.offsetY * o + height; @@ -210,7 +210,15 @@ public class SoyuzLauncher extends BlockDummyable { } } } - + + for(int l = 0; l < 10; l++) + world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_launcher, 38))); + for(int l = 0; l < 8; l++) + world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.concrete_smooth, 41))); + for(int l = 0; l < 6; l++) + world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_scaffold, 64))); + world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_scaffold, 53))); + world.func_147453_f(x, y, z, p_149749_5_); } } diff --git a/com/hbm/handler/MultiblockHandlerXR.java b/com/hbm/handler/MultiblockHandlerXR.java index 838575f61..95b599547 100644 --- a/com/hbm/handler/MultiblockHandlerXR.java +++ b/com/hbm/handler/MultiblockHandlerXR.java @@ -1,5 +1,7 @@ package com.hbm.handler; +import com.hbm.blocks.BlockDummyable; + import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -52,6 +54,8 @@ public class MultiblockHandlerXR { int count = 0; int[] rot = rotate(dim, dir); + + BlockDummyable.safeRem = true; for(int a = x - rot[4]; a <= x + rot[5]; a++) { for(int b = y - rot[1]; b <= y + rot[0]; b++) { @@ -81,11 +85,15 @@ public class MultiblockHandlerXR { if(count > 2000) { System.out.println("fillspace: ded " + a + " " + b + " " + c + " " + x + " " + y + " " + z); + + BlockDummyable.safeRem = false; return; } } } } + + BlockDummyable.safeRem = false; } @Deprecated diff --git a/com/hbm/handler/ToolAbility.java b/com/hbm/handler/ToolAbility.java index 8dac80b46..113f2f33b 100644 --- a/com/hbm/handler/ToolAbility.java +++ b/com/hbm/handler/ToolAbility.java @@ -162,6 +162,34 @@ public abstract class ToolAbility { } } + public static class SilkAbility extends ToolAbility { + + @Override + public void onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, ItemToolAbility tool) { + + //a band-aid on a gaping wound + if(block == Blocks.lit_redstone_ore) + block = Blocks.redstone_ore; + + ItemStack stack = new ItemStack(block, 1, meta); + + if(stack.getItem() != null) { + world.setBlockToAir(x, y, z); + world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack)); + } + } + + @Override + public String getName() { + return "tool.ability.silktouch"; + } + + @Override + public String getFullName() { + return I18n.format(getName()); + } + } + public static class SmelterAbility extends ToolAbility { @Override diff --git a/com/hbm/handler/guncfg/BulletConfigFactory.java b/com/hbm/handler/guncfg/BulletConfigFactory.java index 081bc3233..a3fc98fa9 100644 --- a/com/hbm/handler/guncfg/BulletConfigFactory.java +++ b/com/hbm/handler/guncfg/BulletConfigFactory.java @@ -175,7 +175,7 @@ public class BulletConfigFactory { bullet.HBRC = 0; bullet.LBRC = 0; bullet.bounceMod = 1.0; - bullet.doesPenetrate = false; + bullet.doesPenetrate = true; bullet.doesBreakGlass = false; bullet.nuke = 35; bullet.style = BulletConfiguration.STYLE_NUKE; diff --git a/com/hbm/inventory/CentrifugeRecipes.java b/com/hbm/inventory/CentrifugeRecipes.java index e81a7ac91..9d9b2c178 100644 --- a/com/hbm/inventory/CentrifugeRecipes.java +++ b/com/hbm/inventory/CentrifugeRecipes.java @@ -203,6 +203,7 @@ public class CentrifugeRecipes { recipes.put(new ComparableStack(ModItems.crystal_iron), new ItemStack[] { new ItemStack(ModItems.powder_iron, 2), new ItemStack(ModItems.powder_iron, 2), new ItemStack(ModItems.powder_titanium, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) }); recipes.put(new ComparableStack(ModItems.crystal_gold), new ItemStack[] { new ItemStack(ModItems.powder_gold, 2), new ItemStack(ModItems.powder_gold, 2), new ItemStack(ModItems.nugget_mercury, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) }); recipes.put(new ComparableStack(ModItems.crystal_redstone), new ItemStack[] { new ItemStack(Items.redstone, 3), new ItemStack(Items.redstone, 3), new ItemStack(Items.redstone, 3), new ItemStack(ModItems.nugget_mercury, 3) }); + recipes.put(new ComparableStack(ModItems.crystal_diamond), new ItemStack[] { new ItemStack(ModItems.powder_diamond, 1), new ItemStack(ModItems.powder_diamond, 1), new ItemStack(ModItems.powder_diamond, 1), new ItemStack(ModItems.powder_diamond, 1) }); recipes.put(new ComparableStack(ModItems.crystal_uranium), new ItemStack[] { new ItemStack(ModItems.powder_uranium, 2), new ItemStack(ModItems.powder_uranium, 2), new ItemStack(ModItems.powder_thorium, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) }); recipes.put(new ComparableStack(ModItems.crystal_thorium), new ItemStack[] { new ItemStack(ModItems.powder_thorium, 2), new ItemStack(ModItems.powder_thorium, 2), new ItemStack(ModItems.powder_uranium, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) }); recipes.put(new ComparableStack(ModItems.crystal_plutonium), new ItemStack[] { new ItemStack(ModItems.powder_plutonium, 2), new ItemStack(ModItems.powder_plutonium, 2), new ItemStack(ModItems.powder_uranium, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) }); diff --git a/com/hbm/inventory/CrystallizerRecipes.java b/com/hbm/inventory/CrystallizerRecipes.java index 05a414c80..04c82dc53 100644 --- a/com/hbm/inventory/CrystallizerRecipes.java +++ b/com/hbm/inventory/CrystallizerRecipes.java @@ -10,6 +10,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.items.ModItems; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; @@ -25,6 +26,7 @@ public class CrystallizerRecipes { recipes.put("oreIron", new ItemStack(ModItems.crystal_iron)); recipes.put("oreGold", new ItemStack(ModItems.crystal_gold)); recipes.put("oreRedstone", new ItemStack(ModItems.crystal_redstone)); + recipes.put("oreDiamond", new ItemStack(ModItems.crystal_diamond)); recipes.put("oreUranium", new ItemStack(ModItems.crystal_uranium)); recipes.put("oreThorium", new ItemStack(ModItems.crystal_thorium)); recipes.put("orePlutonium", new ItemStack(ModItems.crystal_plutonium)); @@ -48,6 +50,10 @@ public class CrystallizerRecipes { recipes.put(new ComparableStack(Blocks.cobblestone), new ItemStack(ModBlocks.reinforced_stone)); recipes.put(new ComparableStack(ModBlocks.gravel_obsidian), new ItemStack(ModBlocks.brick_obsidian)); recipes.put("blockRedstone", new ItemStack(ModItems.nugget_mercury)); + recipes.put(new ComparableStack(ModBlocks.gravel_diamond), new ItemStack(ModItems.crystal_diamond)); + recipes.put(new ComparableStack(ModItems.powder_diamond), new ItemStack(Items.diamond)); + recipes.put(new ComparableStack(ModItems.powder_emerald), new ItemStack(Items.emerald)); + recipes.put(new ComparableStack(ModItems.powder_lapis), new ItemStack(Items.dye, 1, 4)); } public static ItemStack getOutput(ItemStack stack) { diff --git a/com/hbm/inventory/ShredderRecipes.java b/com/hbm/inventory/ShredderRecipes.java index e73e958db..4c65beae0 100644 --- a/com/hbm/inventory/ShredderRecipes.java +++ b/com/hbm/inventory/ShredderRecipes.java @@ -144,10 +144,12 @@ public class ShredderRecipes { ShredderRecipes.setRecipe(ModBlocks.meteor_brick_chiseled, new ItemStack(ModItems.powder_meteorite, 1)); ShredderRecipes.setRecipe(ModBlocks.meteor_pillar, new ItemStack(ModItems.powder_meteorite, 1)); ShredderRecipes.setRecipe(ModBlocks.ore_rare, new ItemStack(ModItems.powder_desh_mix, 1)); + ShredderRecipes.setRecipe(Blocks.diamond_ore, new ItemStack(ModBlocks.gravel_diamond, 2)); ShredderRecipes.setRecipe(ModItems.crystal_iron, new ItemStack(ModItems.powder_iron, 3)); - ShredderRecipes.setRecipe(ModItems.crystal_gold, new ItemStack(ModItems.powder_iron, 3)); + ShredderRecipes.setRecipe(ModItems.crystal_gold, new ItemStack(ModItems.powder_gold, 3)); ShredderRecipes.setRecipe(ModItems.crystal_redstone, new ItemStack(Items.redstone, 8)); + ShredderRecipes.setRecipe(ModItems.crystal_diamond, new ItemStack(ModItems.powder_diamond, 3)); ShredderRecipes.setRecipe(ModItems.crystal_uranium, new ItemStack(ModItems.powder_uranium, 3)); ShredderRecipes.setRecipe(ModItems.crystal_plutonium, new ItemStack(ModItems.powder_plutonium, 3)); ShredderRecipes.setRecipe(ModItems.crystal_thorium, new ItemStack(ModItems.powder_thorium, 3)); diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 468483bb7..4778a8f59 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -229,6 +229,7 @@ public class ModItems { public static Item crystal_iron; public static Item crystal_gold; public static Item crystal_redstone; + public static Item crystal_diamond; public static Item crystal_uranium; public static Item crystal_thorium; public static Item crystal_plutonium; @@ -2078,6 +2079,7 @@ public class ModItems { crystal_iron = new Item().setUnlocalizedName("crystal_iron").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_iron"); crystal_gold = new Item().setUnlocalizedName("crystal_gold").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_gold"); crystal_redstone = new Item().setUnlocalizedName("crystal_redstone").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_redstone"); + crystal_diamond = new Item().setUnlocalizedName("crystal_diamond").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_diamond"); crystal_uranium = new ItemRadioactive(0.75F).setUnlocalizedName("crystal_uranium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_uranium"); crystal_thorium = new Item().setUnlocalizedName("crystal_thorium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_thorium"); crystal_plutonium = new ItemRadioactive(3.0F).setUnlocalizedName("crystal_plutonium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crystal_plutonium"); @@ -3478,6 +3480,7 @@ public class ModItems { jackt2 = new ModArmor(MainRegistry.aMatSteel, 7, 1).setUnlocalizedName("jackt2").setTextureName(RefStrings.MODID + ":jackt2"); chainsaw = new ItemToolAbility(25, -0.05, MainRegistry.tMatChainsaw, EnumToolType.AXE) + .addBreakAbility(new ToolAbility.SilkAbility()) .addBreakAbility(new ToolAbility.RecursionAbility(5)).setUnlocalizedName("chainsaw").setTextureName(RefStrings.MODID + ":chainsaw"); schrabidium_sword = new ItemToolAbility(150, 0, MainRegistry.tMatSchrab, EnumToolType.SWORD) @@ -3489,6 +3492,7 @@ public class ModItems { .addHitAbility(new WeaponAbility.RadiationAbility(15F)) .addBreakAbility(new ToolAbility.HammerAbility(2)) .addBreakAbility(new ToolAbility.RecursionAbility(10)) + .addBreakAbility(new ToolAbility.SilkAbility()) .addBreakAbility(new ToolAbility.SmelterAbility()) .addBreakAbility(new ToolAbility.ShredderAbility()) .setRarity(EnumRarity.rare).setUnlocalizedName("schrabidium_pickaxe").setTextureName(RefStrings.MODID + ":schrabidium_pickaxe"); @@ -3497,6 +3501,7 @@ public class ModItems { .addHitAbility(new WeaponAbility.RadiationAbility(15F)) .addBreakAbility(new ToolAbility.HammerAbility(2)) .addBreakAbility(new ToolAbility.RecursionAbility(10)) + .addBreakAbility(new ToolAbility.SilkAbility()) .addBreakAbility(new ToolAbility.SmelterAbility()) .addBreakAbility(new ToolAbility.ShredderAbility()) .setRarity(EnumRarity.rare).setUnlocalizedName("schrabidium_axe").setTextureName(RefStrings.MODID + ":schrabidium_axe"); @@ -3505,6 +3510,7 @@ public class ModItems { .addHitAbility(new WeaponAbility.RadiationAbility(15F)) .addBreakAbility(new ToolAbility.HammerAbility(2)) .addBreakAbility(new ToolAbility.RecursionAbility(10)) + .addBreakAbility(new ToolAbility.SilkAbility()) .addBreakAbility(new ToolAbility.SmelterAbility()) .addBreakAbility(new ToolAbility.ShredderAbility()) .setRarity(EnumRarity.rare).setUnlocalizedName("schrabidium_shovel").setTextureName(RefStrings.MODID + ":schrabidium_shovel"); @@ -3542,15 +3548,18 @@ public class ModItems { cmb_pickaxe = new ItemToolAbility(10F, 0, MainRegistry.tMatCMB, EnumToolType.PICKAXE) .addBreakAbility(new ToolAbility.RecursionAbility(5)) - .addBreakAbility(new ToolAbility.SmelterAbility()).setUnlocalizedName("cmb_pickaxe").setTextureName(RefStrings.MODID + ":cmb_pickaxe"); + .addBreakAbility(new ToolAbility.SmelterAbility()) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cmb_pickaxe").setTextureName(RefStrings.MODID + ":cmb_pickaxe"); cmb_axe = new ItemToolAbility(12.5F, 0, MainRegistry.tMatCMB, EnumToolType.AXE) .addBreakAbility(new ToolAbility.RecursionAbility(5)) - .addBreakAbility(new ToolAbility.SmelterAbility()).setUnlocalizedName("cmb_axe").setTextureName(RefStrings.MODID + ":cmb_axe"); + .addBreakAbility(new ToolAbility.SmelterAbility()) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cmb_axe").setTextureName(RefStrings.MODID + ":cmb_axe"); cmb_shovel = new ItemToolAbility(8F, 0, MainRegistry.tMatCMB, EnumToolType.SHOVEL) .addBreakAbility(new ToolAbility.RecursionAbility(5)) - .addBreakAbility(new ToolAbility.SmelterAbility()).setUnlocalizedName("cmb_shovel").setTextureName(RefStrings.MODID + ":cmb_shovel"); + .addBreakAbility(new ToolAbility.SmelterAbility()) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cmb_shovel").setTextureName(RefStrings.MODID + ":cmb_shovel"); cmb_hoe = new ModHoe(MainRegistry.tMatCMB).setUnlocalizedName("cmb_hoe").setTextureName(RefStrings.MODID + ":cmb_hoe"); @@ -3559,43 +3568,52 @@ public class ModItems { elec_pickaxe = new ItemToolAbilityPower(10F, 0, MainRegistry.tMatElec, EnumToolType.PICKAXE, 500000, 1000, 100) .addBreakAbility(new ToolAbility.HammerAbility(2)) - .addBreakAbility(new ToolAbility.RecursionAbility(5)).setUnlocalizedName("elec_pickaxe").setTextureName(RefStrings.MODID + ":elec_drill_anim"); + .addBreakAbility(new ToolAbility.RecursionAbility(5)) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("elec_pickaxe").setTextureName(RefStrings.MODID + ":elec_drill_anim"); elec_axe = new ItemToolAbilityPower(12.5F, 0, MainRegistry.tMatElec, EnumToolType.AXE, 500000, 1000, 100) .addBreakAbility(new ToolAbility.HammerAbility(2)) - .addBreakAbility(new ToolAbility.RecursionAbility(5)).setUnlocalizedName("elec_axe").setTextureName(RefStrings.MODID + ":elec_chainsaw_anim"); + .addBreakAbility(new ToolAbility.RecursionAbility(5)) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("elec_axe").setTextureName(RefStrings.MODID + ":elec_chainsaw_anim"); elec_shovel = new ItemToolAbilityPower(7.5F, 0, MainRegistry.tMatElec, EnumToolType.SHOVEL, 500000, 1000, 100) .addBreakAbility(new ToolAbility.HammerAbility(2)) - .addBreakAbility(new ToolAbility.RecursionAbility(5)).setUnlocalizedName("elec_shovel").setTextureName(RefStrings.MODID + ":elec_shovel_anim"); + .addBreakAbility(new ToolAbility.RecursionAbility(5)) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("elec_shovel").setTextureName(RefStrings.MODID + ":elec_shovel_anim"); desh_sword = new ItemToolAbility(15F, 0, MainRegistry.tMatDesh, EnumToolType.SWORD) .addHitAbility(new WeaponAbility.StunAbility(2)).setUnlocalizedName("desh_sword").setTextureName(RefStrings.MODID + ":desh_sword"); - desh_pickaxe = new ItemToolAbility(5F, 0, MainRegistry.tMatDesh, EnumToolType.PICKAXE) + desh_pickaxe = new ItemToolAbility(5F, -0.05, MainRegistry.tMatDesh, EnumToolType.PICKAXE) .addBreakAbility(new ToolAbility.HammerAbility(1)) - .addBreakAbility(new ToolAbility.RecursionAbility(3)).setUnlocalizedName("desh_pickaxe").setTextureName(RefStrings.MODID + ":desh_pickaxe"); + .addBreakAbility(new ToolAbility.RecursionAbility(3)) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("desh_pickaxe").setTextureName(RefStrings.MODID + ":desh_pickaxe"); - desh_axe = new ItemToolAbility(6.5F, 0, MainRegistry.tMatDesh, EnumToolType.AXE) + desh_axe = new ItemToolAbility(6.5F, -0.05, MainRegistry.tMatDesh, EnumToolType.AXE) .addBreakAbility(new ToolAbility.HammerAbility(1)) - .addBreakAbility(new ToolAbility.RecursionAbility(3)).setUnlocalizedName("desh_axe").setTextureName(RefStrings.MODID + ":desh_axe"); + .addBreakAbility(new ToolAbility.RecursionAbility(3)) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("desh_axe").setTextureName(RefStrings.MODID + ":desh_axe"); - desh_shovel = new ItemToolAbility(4F, 0, MainRegistry.tMatDesh, EnumToolType.SHOVEL) + desh_shovel = new ItemToolAbility(4F, -0.05, MainRegistry.tMatDesh, EnumToolType.SHOVEL) .addBreakAbility(new ToolAbility.HammerAbility(1)) - .addBreakAbility(new ToolAbility.RecursionAbility(3)).setUnlocalizedName("desh_shovel").setTextureName(RefStrings.MODID + ":desh_shovel"); + .addBreakAbility(new ToolAbility.RecursionAbility(3)) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("desh_shovel").setTextureName(RefStrings.MODID + ":desh_shovel"); desh_hoe = new ModHoe(MainRegistry.tMatDesh).setUnlocalizedName("desh_hoe").setTextureName(RefStrings.MODID + ":desh_hoe"); cobalt_sword = new ItemToolAbility(12F, 0, MainRegistry.tMatCobalt, EnumToolType.SWORD).setUnlocalizedName("cobalt_sword").setTextureName(RefStrings.MODID + ":cobalt_sword"); cobalt_pickaxe = new ItemToolAbility(4F, 0, MainRegistry.tMatCobalt, EnumToolType.PICKAXE) - .addBreakAbility(new ToolAbility.RecursionAbility(4)).setUnlocalizedName("cobalt_pickaxe").setTextureName(RefStrings.MODID + ":cobalt_pickaxe"); + .addBreakAbility(new ToolAbility.RecursionAbility(4)) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cobalt_pickaxe").setTextureName(RefStrings.MODID + ":cobalt_pickaxe"); cobalt_axe = new ItemToolAbility(6F, 0, MainRegistry.tMatCobalt, EnumToolType.AXE) - .addBreakAbility(new ToolAbility.RecursionAbility(4)).setUnlocalizedName("cobalt_axe").setTextureName(RefStrings.MODID + ":cobalt_axe"); + .addBreakAbility(new ToolAbility.RecursionAbility(4)) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cobalt_axe").setTextureName(RefStrings.MODID + ":cobalt_axe"); cobalt_shovel = new ItemToolAbility(3.5F, 0, MainRegistry.tMatCobalt, EnumToolType.SHOVEL) - .addBreakAbility(new ToolAbility.RecursionAbility(4)).setUnlocalizedName("cobalt_shovel").setTextureName(RefStrings.MODID + ":cobalt_shovel"); + .addBreakAbility(new ToolAbility.RecursionAbility(4)) + .addBreakAbility(new ToolAbility.SilkAbility()).setUnlocalizedName("cobalt_shovel").setTextureName(RefStrings.MODID + ":cobalt_shovel"); cobalt_hoe = new ModHoe(MainRegistry.tMatCobalt).setUnlocalizedName("cobalt_hoe").setTextureName(RefStrings.MODID + ":cobalt_hoe"); @@ -3979,6 +3997,7 @@ public class ModItems { GameRegistry.registerItem(crystal_iron, crystal_iron.getUnlocalizedName()); GameRegistry.registerItem(crystal_gold, crystal_gold.getUnlocalizedName()); GameRegistry.registerItem(crystal_redstone, crystal_redstone.getUnlocalizedName()); + GameRegistry.registerItem(crystal_diamond, crystal_diamond.getUnlocalizedName()); GameRegistry.registerItem(crystal_uranium, crystal_uranium.getUnlocalizedName()); GameRegistry.registerItem(crystal_thorium, crystal_thorium.getUnlocalizedName()); GameRegistry.registerItem(crystal_plutonium, crystal_plutonium.getUnlocalizedName()); diff --git a/com/hbm/items/bomb/ItemMike.java b/com/hbm/items/bomb/ItemMike.java index 202f74db2..3d9f994c2 100644 --- a/com/hbm/items/bomb/ItemMike.java +++ b/com/hbm/items/bomb/ItemMike.java @@ -11,7 +11,6 @@ public class ItemMike extends ItemRadioactive { public ItemMike(float radiation) { super(radiation); - // TODO Auto-generated constructor stub } @Override diff --git a/com/hbm/items/machine/ItemAssemblyTemplate.java b/com/hbm/items/machine/ItemAssemblyTemplate.java index bdacd6728..431281ab7 100644 --- a/com/hbm/items/machine/ItemAssemblyTemplate.java +++ b/com/hbm/items/machine/ItemAssemblyTemplate.java @@ -1353,7 +1353,7 @@ public class ItemAssemblyTemplate extends Item { //scheme.applyUniversalScheme(); scheme.colorCount = 4; //universal scheme configuration for testing - //TODO: get textures properly baked, display color for shield + //todo: get textures properly baked, display color for shield scheme.addColor(0x334077); scheme.addColor(0x6A298F); scheme.addColor(0xDF3795); diff --git a/com/hbm/lib/Library.java b/com/hbm/lib/Library.java index b37416730..6c83bcf36 100644 --- a/com/hbm/lib/Library.java +++ b/com/hbm/lib/Library.java @@ -410,8 +410,7 @@ public class Library { return power; } - - //TODO: rewrite this shit + public static long chargeTEFromItems(ItemStack[] slots, int index, long power, long maxPower) { if(slots[index] != null && slots[index].getItem() == ModItems.battery_creative) diff --git a/com/hbm/main/ClientProxy.java b/com/hbm/main/ClientProxy.java index 22693f8fb..881aeb636 100644 --- a/com/hbm/main/ClientProxy.java +++ b/com/hbm/main/ClientProxy.java @@ -359,6 +359,7 @@ public class ClientProxy extends ServerProxy ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPylonRedWire.class, new RenderPylon()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStructureMarker.class, new RenderStructureMaker()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMultiblock.class, new RenderMultiblock()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySoyuzStruct.class, new RenderSoyuzMultiblock()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSBase.class, new RenderAMSBase()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSEmitter.class, new RenderAMSEmitter()); diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 2e45c91a3..3c52db377 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -1603,10 +1603,12 @@ public class CraftingManager { GameRegistry.addSmelting(new ItemStack(Items.dye, 1, 15), new ItemStack(Items.slime_ball, 1), 0.0F); GameRegistry.addSmelting(new ItemStack(Blocks.gravel, 1), new ItemStack(Blocks.cobblestone, 1), 0.0F); GameRegistry.addSmelting(new ItemStack(ModBlocks.gravel_obsidian), new ItemStack(Blocks.obsidian), 0.0F); + GameRegistry.addSmelting(new ItemStack(ModBlocks.gravel_diamond), new ItemStack(Items.diamond), 3.0F); GameRegistry.addSmelting(ModItems.crystal_iron, new ItemStack(Items.iron_ingot, 2), 2.0F); GameRegistry.addSmelting(ModItems.crystal_gold, new ItemStack(Items.gold_ingot, 2), 2.0F); GameRegistry.addSmelting(ModItems.crystal_redstone, new ItemStack(Items.redstone, 6), 2.0F); + GameRegistry.addSmelting(ModItems.crystal_diamond, new ItemStack(Items.diamond, 2), 2.0F); GameRegistry.addSmelting(ModItems.crystal_uranium, new ItemStack(ModItems.ingot_uranium, 2), 2.0F); GameRegistry.addSmelting(ModItems.crystal_thorium, new ItemStack(ModItems.ingot_th232, 2), 2.0F); GameRegistry.addSmelting(ModItems.crystal_plutonium, new ItemStack(ModItems.ingot_plutonium, 2), 2.0F); diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index 7643b4a22..f53a5edf2 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -443,6 +443,9 @@ public class MainRegistry GameRegistry.registerTileEntity(TileEntityYellowBarrel.class, "tileentity_nukebarrel"); GameRegistry.registerTileEntity(TileEntityLaunchPad.class, "tileentity_launch1"); GameRegistry.registerTileEntity(TileEntityDecoBlock.class, "tileentity_deco"); + GameRegistry.registerTileEntity(TileEntityDecoBlockAltW.class, "tileentity_deco_w"); + GameRegistry.registerTileEntity(TileEntityDecoBlockAltG.class, "tileentity_deco_g"); + GameRegistry.registerTileEntity(TileEntityDecoBlockAltF.class, "tileentity_deco_f"); GameRegistry.registerTileEntity(TileEntityCoreTitanium.class, "tileentity_core_titanium"); GameRegistry.registerTileEntity(TileEntityCoreAdvanced.class, "tileentity_core_advanced"); GameRegistry.registerTileEntity(TileEntityFusionMultiblock.class, "tileentity_fusion_multiblock"); @@ -557,6 +560,7 @@ public class MainRegistry GameRegistry.registerTileEntity(TileEntityCyberCrab.class, "tileentity_crabs"); GameRegistry.registerTileEntity(TileEntitySoyuzCapsule.class, "tileentity_soyuz_capsule"); GameRegistry.registerTileEntity(TileEntityMachineCrystallizer.class, "tileentity_acidomatic"); + GameRegistry.registerTileEntity(TileEntitySoyuzStruct.class, "tileentity_soyuz_struct"); EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true); EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true); diff --git a/com/hbm/render/block/BusAnimation.java b/com/hbm/render/block/BusAnimation.java new file mode 100644 index 000000000..c7ad3707f --- /dev/null +++ b/com/hbm/render/block/BusAnimation.java @@ -0,0 +1,65 @@ +package com.hbm.render.block; + +import java.util.HashMap; + +//a """simple""" implementation of an animation system +//it's the first thing i came up with and i suppose it's relatively simple but +//it's probably not since i suck at everything +//i could have jut used collada XML animations but where's the fun in that? +public class BusAnimation { + + //"buses" with one S since it's not a vehicle + private final HashMap animationBuses= new HashMap(); + //multiples buses exist simultaneously and start with 0. + //a bus has one authority, i.e. the translation of a single part of a model or the rotation of the entire thing. + //imagine the busses being film strips that hang from the ceiling, with the tape player + //rolling down, picking up images from all tapes and combining them into a movie. + + /** + * Adds a bus to the animation + * If an object has several moving parts, each transformation type of each seperat bus should have its own bus + * Unless you use one bus for several things because the animation is identical, that's ok too + * @param name of the bus being added + * @param bus the bus in question + * @return + */ + public BusAnimation addBus(String name, BusAnimationSequence bus) { + + animationBuses.put(name, bus); + return this; + } + + /** + * Gets a bus from the specified name. Usually not something you want to do + * @param name + * @param bus + * @return + */ + public BusAnimationSequence getBus(String name) { + return animationBuses.get(name); + } + + /** + * Gets the state of a bus at a specified time + * @param name the name of the bus in question + * @param millis the elapsed time since the animation started in milliseconds + * @return + */ + public double[] getTimedTransformation(String name, int millis) { + + if(this.animationBuses.containsKey(name)) + return animationBuses.get(name).getTransformation(millis); + + return null; + } + + /** + * reads all buses and checks if inbetween the last invocation and this one, a sound was scheduled + * @param lastMillis the last time the bus was checked + * @param millis the current time + */ + public void playPendingSounds(int lastMillis, int millis) { + //TODO: pending + } + +} diff --git a/com/hbm/render/block/BusAnimationKeyframe.java b/com/hbm/render/block/BusAnimationKeyframe.java new file mode 100644 index 000000000..5b523cd8e --- /dev/null +++ b/com/hbm/render/block/BusAnimationKeyframe.java @@ -0,0 +1,47 @@ +package com.hbm.render.block; + +//"pieces" that make up a bus +public class BusAnimationKeyframe { + + //whether the next frame "snaps" to the intended value or has interpolation + //it's an enum so stuff like accelerated animations between just + //two frames could be implemented + public static enum InterpolationType { + NONE, + SMOOTH + } + + //unimplemented, all current animations are absolute + //whether the transformation happens on its own or relative to the last state + //i.e. 5 with 15 being the previous would be 20 additive and 5 absolute, simple enough + public static enum StateType { + ADDITIVE, + ABSOLTE + } + + public double x; + public double y; + public double z; + public InterpolationType interpolationType; + public int duration; + + //this one can be used for "reset" type keyframes + public BusAnimationKeyframe() { + this.x = 0; + this.y = 0; + this.z = 0; + this.interpolationType = InterpolationType.SMOOTH; + } + + public BusAnimationKeyframe(double x, double y, double z) { + this(); + this.x = x; + this.y = y; + this.z = z; + } + + public BusAnimationKeyframe(double x, double y, double z, InterpolationType interpolation) { + this(x, y, z); + this.interpolationType = interpolation; + } +} diff --git a/com/hbm/render/block/BusAnimationSequence.java b/com/hbm/render/block/BusAnimationSequence.java new file mode 100644 index 000000000..5170ebea0 --- /dev/null +++ b/com/hbm/render/block/BusAnimationSequence.java @@ -0,0 +1,24 @@ +package com.hbm.render.block; + +import java.util.ArrayList; +import java.util.List; + +//the actual bus, a sequence of keyframes with their own behavior and such +public class BusAnimationSequence { + + //not actually useful for anything since the renderer usually handles + //this part, but it's nice to have for distinction just in case + public static enum EnumTransformation { + UNDEFINED, + ROTATION, + TRANSLATION, + SCALE + } + + private List keyframes = new ArrayList(); + public EnumTransformation transformationType; + + public double[] getTransformation(int millis) { + return null; + } +} diff --git a/com/hbm/render/tileentity/RenderSoyuzMultiblock.java b/com/hbm/render/tileentity/RenderSoyuzMultiblock.java new file mode 100644 index 000000000..141e86b5f --- /dev/null +++ b/com/hbm/render/tileentity/RenderSoyuzMultiblock.java @@ -0,0 +1,165 @@ +package com.hbm.render.tileentity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.blocks.ModBlocks; +import com.hbm.lib.RefStrings; + +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public class RenderSoyuzMultiblock extends TileEntitySpecialRenderer { + + float pixel = 1F/16F; + + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) { + + GL11.glPushMatrix(); + + GL11.glTranslatef((float)x + 1, (float)y + 1, (float)z); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F); + GL11.glDisable(GL11.GL_ALPHA_TEST); + + RenderBlocks rb = RenderBlocks.getInstance(); + + IIcon icon; + ResourceLocation loc; + + icon = rb.getBlockIconFromSide(ModBlocks.struct_launcher, 1); + loc = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + icon.getIconName().substring(4, icon.getIconName().length()) + ".png"); + + for(int i = -6; i <= 6; i++) + for(int j = 3; j <= 4; j++) + for(int k = -6; k <= 6; k++) + renderSmolBlockAt(loc, i, j, k); + + for(int i = -1; i <= 1; i++) + for(int j = 3; j <= 4; j++) + for(int k = -8; k <= -7; k++) + renderSmolBlockAt(loc, i, j, k); + + for(int i = -2; i <= 2; i++) + for(int j = 3; j <= 4; j++) + for(int k = 7; k <= 9; k++) + renderSmolBlockAt(loc, i, j, k); + + for(int i = -2; i <= 2; i++) + for(int k = 5; k <= 9; k++) + renderSmolBlockAt(loc, i, 51, k); + + for(int i = -1; i <= 1; i++) + for(int k = -8; k <= -6; k++) + renderSmolBlockAt(loc, i, 38, k); + + icon = rb.getBlockIconFromSide(ModBlocks.concrete_smooth, 1); + loc = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + icon.getIconName().substring(4, icon.getIconName().length()) + ".png"); + + for(int i = 3; i <= 6; i++) + for(int j = 0; j <= 2; j++) + for(int k = 3; k <= 6; k++) + renderSmolBlockAt(loc, i, j, k); + + for(int i = -6; i <= -3; i++) + for(int j = 0; j <= 2; j++) + for(int k = 3; k <= 6; k++) + renderSmolBlockAt(loc, i, j, k); + + for(int i = -6; i <= -3; i++) + for(int j = 0; j <= 2; j++) + for(int k = -6; k <= -3; k++) + renderSmolBlockAt(loc, i, j, k); + + for(int i = 3; i <= 6; i++) + for(int j = 0; j <= 2; j++) + for(int k = -6; k <= -3; k++) + renderSmolBlockAt(loc, i, j, k); + + for(int i = -1; i <= 1; i++) + for(int j = 0; j <= 2; j++) + for(int k = -8; k <= -6; k++) + renderSmolBlockAt(loc, i, j, k); + + for(int i = -2; i <= 2; i++) + for(int j = 0; j <= 2; j++) + for(int k = 5; k <= 9; k++) + renderSmolBlockAt(loc, i, j, k); + + icon = rb.getBlockIconFromSide(ModBlocks.struct_scaffold, 1); + loc = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + icon.getIconName().substring(4, icon.getIconName().length()) + ".png"); + + for(int i = -1; i <= 1; i++) + for(int j = 5; j <= 50; j++) + for(int k = 6; k <= 8; k++) + renderSmolBlockAt(loc, i, j, k); + + for(int j = 5; j <= 37; j++) + renderSmolBlockAt(loc, 0, j, -7); + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + GL11.glPopMatrix(); + } + + public void renderSmolBlockAt(ResourceLocation loc, int x, int y, int z) { + GL11.glPushMatrix(); + GL11.glTranslatef(x, y, z); + GL11.glRotatef(180, 0F, 0F, 1F); + + Tessellator tesseract = Tessellator.instance; + tesseract.startDrawingQuads(); + this.bindTexture(loc); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 0); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 0); + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1); + tesseract.draw(); + + tesseract.startDrawingQuads(); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 1, 0); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 0); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 1, 1); + tesseract.draw(); + + tesseract.startDrawingQuads(); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 1, 0); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0, 0); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0, 1); + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 1, 1); + tesseract.draw(); + + tesseract.startDrawingQuads(); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 0); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0, 0); + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0, 1); + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1); + tesseract.draw(); + + tesseract.startDrawingQuads(); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 1, 0); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0, 0); + tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1); + tesseract.draw(); + + tesseract.startDrawingQuads(); + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 1, 0); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0, 0); + tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1); + tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1); + tesseract.draw(); + GL11.glPopMatrix(); + + } +} diff --git a/com/hbm/tileentity/machine/TileEntityMachineSatDock.java b/com/hbm/tileentity/machine/TileEntityMachineSatDock.java index 1a4d5c046..33b0e2181 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineSatDock.java +++ b/com/hbm/tileentity/machine/TileEntityMachineSatDock.java @@ -3,12 +3,14 @@ package com.hbm.tileentity.machine; import java.util.List; import java.util.Random; +import com.hbm.blocks.ModBlocks; import com.hbm.entity.missile.EntityMinerRocket; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemSatChip; import com.hbm.saveddata.SatelliteSavedData; import com.hbm.saveddata.satellites.Satellite; import com.hbm.saveddata.satellites.SatelliteMiner; +import com.hbm.util.WeightedRandomObject; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -22,6 +24,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.WeightedRandom; public class TileEntityMachineSatDock extends TileEntity implements ISidedInventory { @@ -252,50 +255,43 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent int items = rand.nextInt(6) + 10; - int randy = 0; rand = new Random(); for(int i = 0; i < items; i++) { - randy = (int) (rand.nextFloat() * 100); - - if(randy < 10) - addToInv(new ItemStack(ModItems.powder_aluminium, 3)); - else if(randy < 20) - addToInv(new ItemStack(ModItems.powder_iron, 3)); - else if(randy < 30) - addToInv(new ItemStack(ModItems.powder_titanium, 2)); - else if(randy < 45) - addToInv(new ItemStack(ModItems.powder_coal, 4)); - else if(randy < 50) - addToInv(new ItemStack(ModItems.powder_uranium, 2)); - else if(randy < 53) - addToInv(new ItemStack(ModItems.powder_plutonium, 1)); - else if(randy < 58) - addToInv(new ItemStack(ModItems.powder_thorium, 2)); - else if(randy < 60) - addToInv(new ItemStack(ModItems.powder_desh_mix, 3)); - else if(randy < 65) - addToInv(new ItemStack(ModItems.powder_diamond, 2)); - else if(randy < 75) - addToInv(new ItemStack(Items.redstone, 5)); - else if(randy < 77) - addToInv(new ItemStack(ModItems.powder_nitan_mix, 2)); - else if(randy < 80) - addToInv(new ItemStack(ModItems.powder_power, 2)); - else if(randy < 85) - addToInv(new ItemStack(ModItems.powder_copper, 5)); - else if(randy < 90) - addToInv(new ItemStack(ModItems.powder_lead, 3)); - else if(randy < 95) - addToInv(new ItemStack(ModItems.fluorite, 4)); - else if(randy < 99) - addToInv(new ItemStack(ModItems.powder_lapis, 4)); - else - addToInv(new ItemStack(ModItems.powder_combine_steel, 1)); + ItemStack stack = ((WeightedRandomObject)WeightedRandom.getRandomItem(rand, cargo)).asStack(); + addToInv(stack); } } + private WeightedRandomObject[] cargo = new WeightedRandomObject[] { + new WeightedRandomObject(new ItemStack(ModItems.powder_aluminium, 3), 10), + new WeightedRandomObject(new ItemStack(ModItems.powder_iron, 3), 10), + new WeightedRandomObject(new ItemStack(ModItems.powder_titanium, 2), 8), + new WeightedRandomObject(new ItemStack(ModItems.powder_coal, 4), 15), + new WeightedRandomObject(new ItemStack(ModItems.powder_uranium, 2), 5), + new WeightedRandomObject(new ItemStack(ModItems.powder_plutonium, 1), 5), + new WeightedRandomObject(new ItemStack(ModItems.powder_thorium, 2), 7), + new WeightedRandomObject(new ItemStack(ModItems.powder_desh_mix, 3), 5), + new WeightedRandomObject(new ItemStack(ModItems.powder_diamond, 2), 7), + new WeightedRandomObject(new ItemStack(Items.redstone, 5), 15), + new WeightedRandomObject(new ItemStack(ModItems.powder_nitan_mix, 2), 5), + new WeightedRandomObject(new ItemStack(ModItems.powder_power, 2), 5), + new WeightedRandomObject(new ItemStack(ModItems.powder_copper, 5), 15), + new WeightedRandomObject(new ItemStack(ModItems.powder_lead, 3), 10), + new WeightedRandomObject(new ItemStack(ModItems.fluorite, 4), 15), + new WeightedRandomObject(new ItemStack(ModItems.powder_lapis, 4), 10), + new WeightedRandomObject(new ItemStack(ModItems.powder_combine_steel, 1), 1), + new WeightedRandomObject(new ItemStack(ModItems.crystal_aluminium, 1), 5), + new WeightedRandomObject(new ItemStack(ModItems.crystal_gold, 1), 5), + new WeightedRandomObject(new ItemStack(ModItems.crystal_phosphorus, 1), 10), + new WeightedRandomObject(new ItemStack(ModBlocks.gravel_diamond, 1), 3), + new WeightedRandomObject(new ItemStack(ModItems.crystal_uranium, 1), 3), + new WeightedRandomObject(new ItemStack(ModItems.crystal_plutonium, 1), 3), + new WeightedRandomObject(new ItemStack(ModItems.crystal_trixite, 1), 1), + new WeightedRandomObject(new ItemStack(ModItems.crystal_starmetal, 1), 1), + }; + private void addToInv(ItemStack stack) { for(int i = 0; i < 15; i++) { diff --git a/com/hbm/tileentity/machine/TileEntitySoyuzStruct.java b/com/hbm/tileentity/machine/TileEntitySoyuzStruct.java new file mode 100644 index 000000000..f7fd2c501 --- /dev/null +++ b/com/hbm/tileentity/machine/TileEntitySoyuzStruct.java @@ -0,0 +1,156 @@ +package com.hbm.tileentity.machine; + +import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.machine.SoyuzLauncher; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.util.ForgeDirection; + +public class TileEntitySoyuzStruct extends TileEntity { + + int age; + + @Override + public void updateEntity() { + + if(worldObj.isRemote) + return; + + age++; + + if(age < 20) + return; + + age = 0; + + /// CHECK PAD /// + for(int i = -6; i <= 6; i++) + for(int j = 3; j <= 4; j++) + for(int k = -6; k <= 6; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.struct_launcher) + return; + + for(int i = -1; i <= 1; i++) + for(int j = 3; j <= 4; j++) + for(int k = -8; k <= -7; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.struct_launcher) + return; + + for(int i = -2; i <= 2; i++) + for(int j = 3; j <= 4; j++) + for(int k = 7; k <= 9; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.struct_launcher) + return; + + for(int i = -2; i <= 2; i++) + for(int k = 5; k <= 9; k++) + if(worldObj.getBlock(xCoord + i, yCoord + 51, zCoord + k) != ModBlocks.struct_launcher) + return; + + for(int i = -1; i <= 1; i++) + for(int k = -8; k <= -6; k++) + if(worldObj.getBlock(xCoord + i, yCoord + 38, zCoord + k) != ModBlocks.struct_launcher) + return; + + /// CHECK LEGS /// + for(int i = 3; i <= 6; i++) + for(int j = 0; j <= 2; j++) + for(int k = 3; k <= 6; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete && + worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete_smooth) + return; + + for(int i = -6; i <= -3; i++) + for(int j = 0; j <= 2; j++) + for(int k = 3; k <= 6; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete && + worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete_smooth) + return; + + for(int i = -6; i <= -3; i++) + for(int j = 0; j <= 2; j++) + for(int k = -6; k <= -3; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete && + worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete_smooth) + return; + + for(int i = 3; i <= 6; i++) + for(int j = 0; j <= 2; j++) + for(int k = -6; k <= -3; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete && + worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete_smooth) + return; + + for(int i = -1; i <= 1; i++) + for(int j = 0; j <= 2; j++) + for(int k = -8; k <= -6; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete && + worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete_smooth) + return; + + for(int i = -2; i <= 2; i++) + for(int j = 0; j <= 2; j++) + for(int k = 5; k <= 9; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete && + worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.concrete_smooth) + return; + + /// CHECK SCAFFOLDING /// + for(int i = -1; i <= 1; i++) + for(int j = 5; j <= 50; j++) + for(int k = 6; k <= 8; k++) + if(worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k) != ModBlocks.struct_scaffold) + return; + + for(int j = 5; j <= 37; j++) + if(worldObj.getBlock(xCoord, yCoord + j, zCoord - 7) != ModBlocks.struct_scaffold) + return; + /// CHECKS COMPLETE /// + + /// DELETE SCAFFOLDING /// + + for(int i = -2; i <= 2; i++) + for(int k = 5; k <= 9; k++) + worldObj.setBlock(xCoord + i, yCoord + 51, zCoord + k, Blocks.air); + + for(int i = -1; i <= 1; i++) + for(int k = -8; k <= -6; k++) + worldObj.setBlock(xCoord + i, yCoord + 38, zCoord + k, Blocks.air); + + for(int i = -2; i <= 2; i++) + for(int j = 0; j <= 2; j++) + for(int k = 5; k <= 9; k++) + worldObj.setBlock(xCoord + i, yCoord + j, zCoord + k, Blocks.air); + + for(int i = -1; i <= 1; i++) + for(int j = 5; j <= 50; j++) + for(int k = 6; k <= 8; k++) + worldObj.setBlock(xCoord + i, yCoord + j, zCoord + k, Blocks.air); + + for(int j = 5; j <= 37; j++) + worldObj.setBlock(xCoord, yCoord + j, zCoord - 7, Blocks.air); + + /// GENERATE LAUNCHER /// + + ForgeDirection dir = ForgeDirection.EAST; + + worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); + worldObj.setBlock(xCoord , yCoord + SoyuzLauncher.height, zCoord, ModBlocks.soyuz_launcher, dir.ordinal() + SoyuzLauncher.offset, 3); + ((SoyuzLauncher)ModBlocks.soyuz_launcher).fillSpace(worldObj, xCoord, yCoord, zCoord, dir, 0); + } + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return TileEntity.INFINITE_EXTENT_AABB; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } +} diff --git a/com/hbm/util/WeightedRandomObject.java b/com/hbm/util/WeightedRandomObject.java new file mode 100644 index 000000000..472b75f88 --- /dev/null +++ b/com/hbm/util/WeightedRandomObject.java @@ -0,0 +1,23 @@ +package com.hbm.util; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandom; + +public class WeightedRandomObject extends WeightedRandom.Item { + + Object item; + + public WeightedRandomObject(Object o, int weight) { + super(weight); + item = o; + } + + public ItemStack asStack() { + + if(item instanceof ItemStack) + return ((ItemStack) item).copy(); + + return null; + } + +}