diff --git a/src/main/java/assets/hbm/sounds/music/jungleDrums.ogg b/src/main/java/assets/hbm/sounds/music/jungleDrums.ogg new file mode 100644 index 000000000..527670bf2 Binary files /dev/null and b/src/main/java/assets/hbm/sounds/music/jungleDrums.ogg differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_0.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_0.png new file mode 100644 index 000000000..43ed14063 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_0.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_1.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_1.png new file mode 100644 index 000000000..230d9612b Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_1.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_10.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_10.png new file mode 100644 index 000000000..6b872942e Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_10.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_11.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_11.png new file mode 100644 index 000000000..e07a9a01b Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_11.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_12.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_12.png new file mode 100644 index 000000000..35242a9ee Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_12.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_13.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_13.png new file mode 100644 index 000000000..65fa67b6d Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_13.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_14.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_14.png new file mode 100644 index 000000000..74b1b6821 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_14.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_15.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_15.png new file mode 100644 index 000000000..37922abf9 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_15.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_2.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_2.png new file mode 100644 index 000000000..d8c7ec7db Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_2.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_3.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_3.png new file mode 100644 index 000000000..274f280c7 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_3.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_4.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_4.png new file mode 100644 index 000000000..d40953a7a Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_4.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_5.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_5.png new file mode 100644 index 000000000..459059271 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_5.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_6.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_6.png new file mode 100644 index 000000000..582940101 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_6.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_7.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_7.png new file mode 100644 index 000000000..525cd4b37 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_7.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_8.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_8.png new file mode 100644 index 000000000..77295f4f3 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_8.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_9.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_9.png new file mode 100644 index 000000000..cdb2d46df Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_glyph_9.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_lava.png b/src/main/java/assets/hbm/textures/blocks/brick_jungle_lava.png new file mode 100644 index 000000000..180693533 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/brick_jungle_lava.png differ diff --git a/src/main/java/assets/hbm/textures/blocks/brick_jungle_lava.png.mcmeta b/src/main/java/assets/hbm/textures/blocks/brick_jungle_lava.png.mcmeta new file mode 100644 index 000000000..fc4bc9855 --- /dev/null +++ b/src/main/java/assets/hbm/textures/blocks/brick_jungle_lava.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 4 + } +} diff --git a/src/main/java/assets/hbm/textures/blocks/crate_jungle.png b/src/main/java/assets/hbm/textures/blocks/crate_jungle.png new file mode 100644 index 000000000..212b7b639 Binary files /dev/null and b/src/main/java/assets/hbm/textures/blocks/crate_jungle.png differ diff --git a/src/main/java/assets/hbm/textures/items/blades_desh.png b/src/main/java/assets/hbm/textures/items/blades_desh.png new file mode 100644 index 000000000..a8392ff7b Binary files /dev/null and b/src/main/java/assets/hbm/textures/items/blades_desh.png differ diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 3a5be3fd4..c85e06e5c 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -7,6 +7,7 @@ import com.hbm.blocks.machine.*; import com.hbm.blocks.network.*; import com.hbm.blocks.test.*; import com.hbm.items.block.ItemBlockLore; +import com.hbm.items.block.ItemGlyphBlock; import com.hbm.items.block.ItemTaintBlock; import com.hbm.items.bomb.ItemPrototypeBlock; import com.hbm.items.special.ItemOreBlock; @@ -207,6 +208,9 @@ public class ModBlocks { public static Block brick_jungle; public static Block brick_jungle_cracked; + public static Block brick_jungle_lava; + public static Block brick_jungle_trap; + public static Block brick_jungle_glyph; public static Block tape_recorder; public static Block steel_poles; @@ -285,6 +289,7 @@ public class ModBlocks { public static Block crate_red; public static Block crate_can; public static Block crate_ammo; + public static Block crate_jungle; public static Block boxcar; public static Block boat; @@ -978,6 +983,9 @@ public class ModBlocks { brick_jungle = new BlockGeneric(Material.rock).setBlockName("brick_jungle").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":brick_jungle"); brick_jungle_cracked = new BlockGeneric(Material.rock).setBlockName("brick_jungle_cracked").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":brick_jungle_cracked"); + brick_jungle_lava = new BlockGeneric(Material.rock).setBlockName("brick_jungle_lava").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setLightLevel(5F/15F).setBlockTextureName(RefStrings.MODID + ":brick_jungle_lava"); + brick_jungle_trap = new BlockGeneric(Material.rock).setBlockName("brick_jungle_trap").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":brick_jungle_trap"); + brick_jungle_glyph = new BlockGlyph(Material.rock).setBlockName("brick_jungle_glyph").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F); tape_recorder = new DecoTapeRecorder(Material.rock).setBlockName("tape_recorder").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":deco_tape_recorder"); steel_poles = new DecoSteelPoles(Material.rock).setBlockName("steel_poles").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_beam"); @@ -1290,7 +1298,8 @@ public class ModBlocks { crate_metal = new BlockCrate(Material.iron).setBlockName("crate_metal").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":crate_metal"); crate_red = new BlockCrate(Material.iron).setBlockName("crate_red").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":crate_red"); crate_can = new BlockCanCrate(Material.wood).setBlockName("crate_can").setStepSound(Block.soundTypeWood).setHardness(1.0F).setResistance(2.5F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":crate_can"); - crate_ammo = new BlockAmmoCrate(Material.wood).setBlockName("crate_ammo").setStepSound(Block.soundTypeMetal).setHardness(1.0F).setResistance(2.5F).setCreativeTab(MainRegistry.consumableTab); + crate_ammo = new BlockAmmoCrate(Material.iron).setBlockName("crate_ammo").setStepSound(Block.soundTypeMetal).setHardness(1.0F).setResistance(2.5F).setCreativeTab(MainRegistry.consumableTab); + crate_jungle = new BlockJungleCrate(Material.rock).setBlockName("crate_jungle").setStepSound(Block.soundTypeStone).setHardness(1.0F).setResistance(2.5F).setCreativeTab(MainRegistry.consumableTab).setBlockTextureName(RefStrings.MODID + ":crate_jungle"); crate_iron = new BlockStorageCrate(Material.iron).setBlockName("crate_iron").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab); crate_steel = new BlockStorageCrate(Material.iron).setBlockName("crate_steel").setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab); safe = new BlockStorageCrate(Material.iron).setBlockName("safe").setStepSound(Block.soundTypeMetal).setHardness(7.5F).setResistance(10000.0F).setCreativeTab(MainRegistry.machineTab); @@ -1630,6 +1639,9 @@ public class ModBlocks { GameRegistry.registerBlock(meteor_battery, ItemBlockLore.class, meteor_battery.getUnlocalizedName()); GameRegistry.registerBlock(brick_jungle, brick_jungle.getUnlocalizedName()); GameRegistry.registerBlock(brick_jungle_cracked, brick_jungle_cracked.getUnlocalizedName()); + GameRegistry.registerBlock(brick_jungle_lava, brick_jungle_lava.getUnlocalizedName()); + GameRegistry.registerBlock(brick_jungle_trap, brick_jungle_trap.getUnlocalizedName()); + GameRegistry.registerBlock(brick_jungle_glyph, ItemGlyphBlock.class, brick_jungle_glyph.getUnlocalizedName()); GameRegistry.registerBlock(tape_recorder, tape_recorder.getUnlocalizedName()); GameRegistry.registerBlock(steel_poles, steel_poles.getUnlocalizedName()); GameRegistry.registerBlock(pole_top, pole_top.getUnlocalizedName()); @@ -1990,6 +2002,7 @@ public class ModBlocks { GameRegistry.registerBlock(crate_red, crate_red.getUnlocalizedName()); GameRegistry.registerBlock(crate_can, crate_can.getUnlocalizedName()); GameRegistry.registerBlock(crate_ammo, crate_ammo.getUnlocalizedName()); + GameRegistry.registerBlock(crate_jungle, crate_jungle.getUnlocalizedName()); //ElB GameRegistry.registerBlock(statue_elb, statue_elb.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/generic/BlockGlyph.java b/src/main/java/com/hbm/blocks/generic/BlockGlyph.java new file mode 100644 index 000000000..c1afaa28e --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/BlockGlyph.java @@ -0,0 +1,57 @@ +package com.hbm.blocks.generic; + +import java.util.List; + +import com.hbm.lib.RefStrings; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockGlyph extends Block { + + @SideOnly(Side.CLIENT) + private IIcon[] glyphIcons; + + public BlockGlyph(Material material) { + super(material); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_jungle"); + + this.glyphIcons = new IIcon[16]; + + for(int i = 0; i < 16; i++) + this.glyphIcons[i] = iconRegister.registerIcon(RefStrings.MODID + ":brick_jungle_glyph_" + i); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + return side == 1 ? this.blockIcon : (side == 0 ? this.blockIcon : (this.glyphIcons[metadata])); + } + + @Override + public int damageDropped(int p_149692_1_) + { + return p_149692_1_; + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) + { + for (int i = 0; i < 16; ++i) + { + p_149666_3_.add(new ItemStack(p_149666_1_, 1, i)); + } + } +} diff --git a/src/main/java/com/hbm/blocks/generic/BlockJungleCrate.java b/src/main/java/com/hbm/blocks/generic/BlockJungleCrate.java new file mode 100644 index 000000000..defbc1999 --- /dev/null +++ b/src/main/java/com/hbm/blocks/generic/BlockJungleCrate.java @@ -0,0 +1,31 @@ +package com.hbm.blocks.generic; + +import java.util.ArrayList; +import java.util.Random; + +import com.hbm.items.ModItems; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BlockJungleCrate extends Block { + + public BlockJungleCrate(Material material) { + super(material); + } + + Random rand = new Random(); + + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { + + ArrayList ret = new ArrayList(); + + ret.add(new ItemStack(ModItems.cap_nuka, 12 + rand.nextInt(21))); + ret.add(new ItemStack(ModItems.syringe_metal_stimpak, 1 + rand.nextInt(3))); + + return ret; + } + +} diff --git a/src/main/java/com/hbm/items/block/ItemGlyphBlock.java b/src/main/java/com/hbm/items/block/ItemGlyphBlock.java new file mode 100644 index 000000000..9aac47956 --- /dev/null +++ b/src/main/java/com/hbm/items/block/ItemGlyphBlock.java @@ -0,0 +1,47 @@ +package com.hbm.items.block; + +import java.util.List; + +import com.hbm.blocks.generic.RedBarrel; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemGlyphBlock extends ItemBlock { + + public ItemGlyphBlock(Block p_i45328_1_) { + super(p_i45328_1_); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { + + switch(itemstack.getItemDamage()) { + case 0: list.add("Hourglass"); break; + case 1: list.add("Eye"); break; + case 2: list.add("'Pillar'"); break; + case 3: list.add("IOI"); break; + case 4: list.add("Delta"); break; + case 5: list.add("VTPC"); break; + case 6: list.add("Cool S"); break; + case 7: list.add("Trefoil"); break; + case 8: list.add("Pony"); break; + case 9: list.add("Sparkle"); break; + case 10: list.add("PiP"); break; + case 11: list.add("Triangles"); break; + case 12: list.add("Linux Mint"); break; + case 13: list.add("13"); break; + case 14: list.add("Digamma"); break; + case 15: list.add("Celestial Altar"); break; + } + } + + public int getMetadata(int p_77647_1_) + { + return p_77647_1_; + } +} diff --git a/src/main/java/com/hbm/items/special/ItemModRecord.java b/src/main/java/com/hbm/items/special/ItemModRecord.java index 460f8d563..5f92e27ba 100644 --- a/src/main/java/com/hbm/items/special/ItemModRecord.java +++ b/src/main/java/com/hbm/items/special/ItemModRecord.java @@ -32,29 +32,25 @@ public class ItemModRecord extends ItemRecord { } @Override - public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, - int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { - if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == Blocks.jukebox - && p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_) == 0) { - if (p_77648_3_.isRemote) { + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { + + if(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == Blocks.jukebox && p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_) == 0) { + + if(p_77648_3_.isRemote) { return true; + } else { - ((BlockJukebox) Blocks.jukebox).func_149926_b(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, - p_77648_1_); - p_77648_3_.playAuxSFXAtEntity((EntityPlayer) null, 1005, p_77648_4_, p_77648_5_, p_77648_6_, - Item.getIdFromItem(this)); + ((BlockJukebox) Blocks.jukebox).func_149926_b(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_1_); + p_77648_3_.playAuxSFXAtEntity((EntityPlayer) null, 1005, p_77648_4_, p_77648_5_, p_77648_6_, Item.getIdFromItem(this)); --p_77648_1_.stackSize; return true; } + } else { return false; } } - - /** - * allows items to add custom lines of information to the mouseover - * description - */ + @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) { @@ -82,17 +78,10 @@ public class ItemModRecord extends ItemRecord { public static ItemRecord getRecord(String p_150926_0_) { return (ItemRecord) modRecords.get(p_150926_0_); } - - /** - * Retrieves the resource location of the sound to play for this record. - * - * @param name - * The name of the record to play - * @return The resource location for the audio, null to use default. - */ + @Override public ResourceLocation getRecordResource(String name) { - + String s = ""; if(name.equals("records.lc")) @@ -103,15 +92,14 @@ public class ItemModRecord extends ItemRecord { s = RefStrings.MODID + ":music.recordVortalCombat"; if(name.equals("records.glass")) s = RefStrings.MODID + ":music.transmission"; - + return new ResourceLocation(s); } - @Override - public String getItemStackDisplayName(ItemStack p_77653_1_) - { - String s = (StatCollector.translateToLocal(Items.record_11.getUnlocalizedName() + ".name")).trim(); + @Override + public String getItemStackDisplayName(ItemStack p_77653_1_) { + String s = (StatCollector.translateToLocal(Items.record_11.getUnlocalizedName() + ".name")).trim(); - return s; - } + return s; + } } diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index da1acf00c..c5444665a 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -28,8 +28,10 @@ public class ItemWandD extends Item { int y = world.getHeightValue(x, z); //new Ruin001().generate_r0(world, world.rand, x, y - 8, z); - + CellularDungeonFactory.jungle.generate(world, x, y, z, world.rand); + CellularDungeonFactory.jungle.generate(world, x, y + 4, z, world.rand); + CellularDungeonFactory.jungle.generate(world, x, y + 8, z, world.rand); } return stack; diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 27662df03..4117e1a0e 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -764,5 +764,10 @@ public class ClientProxy extends ServerProxy { audio.updatePosition(x, y, z); return audio; } + + @Override + public void playSound(String sound, Object data) { + + } } diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index d98c78058..00dd1e674 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -27,6 +27,7 @@ import com.hbm.packet.RadSurveyPacket; import com.hbm.saveddata.AuxSavedData; import com.hbm.saveddata.RadiationSavedData; import com.hbm.util.ContaminationUtil; +import com.hbm.world.generator.TimedGenerator; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; @@ -372,6 +373,7 @@ public class ModEventHandler if(event.phase == Phase.START) { RadiationWorldHandler.handleWorldDestruction(event.world); BossSpawnHandler.rollTheDice(event.world); + TimedGenerator.automaton(event.world, 100); } } diff --git a/src/main/java/com/hbm/main/ServerProxy.java b/src/main/java/com/hbm/main/ServerProxy.java index 6f855cd45..3f07bbb5e 100644 --- a/src/main/java/com/hbm/main/ServerProxy.java +++ b/src/main/java/com/hbm/main/ServerProxy.java @@ -21,4 +21,6 @@ public class ServerProxy { public void registerMissileItems() { } public AudioWrapper getLoopedSound(String sound, float x, float y, float z, float volume, float pitch) { return null; } + + public void playSound(String sound, Object data) { } } \ No newline at end of file diff --git a/src/main/java/com/hbm/world/generator/CellularDungeonFactory.java b/src/main/java/com/hbm/world/generator/CellularDungeonFactory.java index 522ce5d8f..e1e660fd2 100644 --- a/src/main/java/com/hbm/world/generator/CellularDungeonFactory.java +++ b/src/main/java/com/hbm/world/generator/CellularDungeonFactory.java @@ -20,7 +20,7 @@ public class CellularDungeonFactory { meteor.rooms.add(new TestDungeonRoom7(meteor)); meteor.rooms.add(new TestDungeonRoom8(meteor)); - jungle = new JungleDungeon(5, 5, 21, 21, 500, 5); + jungle = new JungleDungeon(5, 5, 25, 25, 700, 6); jungle.rooms.add(new JungleDungeonRoom(jungle)); } diff --git a/src/main/java/com/hbm/world/generator/DungeonToolbox.java b/src/main/java/com/hbm/world/generator/DungeonToolbox.java index 58883f0b5..b5b549a55 100644 --- a/src/main/java/com/hbm/world/generator/DungeonToolbox.java +++ b/src/main/java/com/hbm/world/generator/DungeonToolbox.java @@ -8,7 +8,24 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; public class DungeonToolbox { - + + public static void generateBoxTimed(World world, int x, int y, int z, int sx, int sy, int sz, List blocks) { + + if(blocks.isEmpty()) + return; + + for(int i = x; i < x + sx; i++) { + + for(int j = y; j < y + sy; j++) { + + for(int k = z; k < z + sz; k++) { + + Block b = getRandom(blocks, world.rand); + TimedGenerator.addOp(world, i, j, k, b, 0, 2); + } + } + } + } public static void generateBox(World world, int x, int y, int z, int sx, int sy, int sz, List blocks) { @@ -42,6 +59,20 @@ public class DungeonToolbox { } } } + + public static void generateBoxTimed(World world, int x, int y, int z, int sx, int sy, int sz, Block block) { + + for(int i = x; i < x + sx; i++) { + + for(int j = y; j < y + sy; j++) { + + for(int k = z; k < z + sz; k++) { + + TimedGenerator.addOp(world, i, j, k, block, 0, 2); + } + } + } + } //now with vectors to provide handy rotations public static void generateBox(World world, int x, int y, int z, Vec3 size, List blocks) { diff --git a/src/main/java/com/hbm/world/generator/TimedGenerator.java b/src/main/java/com/hbm/world/generator/TimedGenerator.java new file mode 100644 index 000000000..5d7b1472e --- /dev/null +++ b/src/main/java/com/hbm/world/generator/TimedGenerator.java @@ -0,0 +1,47 @@ +package com.hbm.world.generator; + +import java.util.ArrayList; +import java.util.HashMap; + +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public class TimedGenerator { + + private static final HashMap> operations = new HashMap(); + + public static void automaton(World world, int amount) { + + ArrayList list = operations.get(world.provider.dimensionId); + + if(list == null) + return; + + long start = System.currentTimeMillis(); + + while(start + 15 > System.currentTimeMillis()) { + + if(list.isEmpty()) + return; + + Object[] entry = list.get(0); + list.remove(0); + + world.setBlock((Integer)entry[0], (Integer)entry[1], (Integer)entry[2], (Block)entry[3], (Integer)entry[4], (Integer)entry[5]); + + //amount --; + } + } + + public static void addOp(World world, int x, int y, int z, Block b, int meta, int flags) { + + ArrayList list = operations.get(world.provider.dimensionId); + + if(list == null) { + list = new ArrayList(); + operations.put(world.provider.dimensionId, list); + } + + list.add(new Object[] {x, y, z, b, meta, flags}); + } +} diff --git a/src/main/java/com/hbm/world/generator/room/JungleDungeonRoom.java b/src/main/java/com/hbm/world/generator/room/JungleDungeonRoom.java index 62a4c6d62..97e90d151 100644 --- a/src/main/java/com/hbm/world/generator/room/JungleDungeonRoom.java +++ b/src/main/java/com/hbm/world/generator/room/JungleDungeonRoom.java @@ -1,8 +1,12 @@ package com.hbm.world.generator.room; +import java.util.ArrayList; + +import com.hbm.blocks.ModBlocks; import com.hbm.world.generator.CellularDungeon; import com.hbm.world.generator.CellularDungeonRoom; import com.hbm.world.generator.DungeonToolbox; +import com.hbm.world.generator.TimedGenerator; import net.minecraft.init.Blocks; import net.minecraft.world.World; @@ -13,35 +17,51 @@ public class JungleDungeonRoom extends CellularDungeonRoom { public JungleDungeonRoom(CellularDungeon parent) { super(parent); } + + public void generateMain(World world, int x, int y, int z) { + + DungeonToolbox.generateBoxTimed(world, x, y, z, parent.width, 1, parent.width, parent.floor); + DungeonToolbox.generateBoxTimed(world, x, y + 1, z, parent.width, parent.height - 1, parent.width, Blocks.air); + DungeonToolbox.generateBoxTimed(world, x, y + parent.height - 1, z, parent.width, 1, parent.width, parent.ceiling); + + int rtd = world.rand.nextInt(10); + + if(rtd == 0) { + DungeonToolbox.generateBoxTimed(world, x + parent.width / 2 - 1, y, z + parent.width / 2 - 1, 3, 1, 3, new ArrayList() {{ add(ModBlocks.brick_jungle_cracked); add(ModBlocks.brick_jungle_lava); }}); + + } else if(rtd == 1) { + TimedGenerator.addOp(world, x + 1 + world.rand.nextInt(parent.width - 1), y + 1, z + world.rand.nextInt(parent.width - 1), ModBlocks.crate_jungle, 0, 2); + } + } public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) { if(wall == ForgeDirection.NORTH) { - DungeonToolbox.generateBox(world, x, y + 1, z, parent.width, parent.height - 2, 1, parent.wall); + DungeonToolbox.generateBoxTimed(world, x, y + 1, z, parent.width, parent.height - 2, 1, parent.wall); if(door) - DungeonToolbox.generateBox(world, x + parent.width / 2 - 1, y + 1, z, 3, 3, 1, Blocks.air); + DungeonToolbox.generateBoxTimed(world, x + parent.width / 2 - 1, y + 1, z, 3, 3, 1, Blocks.air); } if(wall == ForgeDirection.SOUTH) { - DungeonToolbox.generateBox(world, x, y + 1, z + parent.width - 1, parent.width, parent.height - 2, 1, parent.wall); + DungeonToolbox.generateBoxTimed(world, x, y + 1, z + parent.width - 1, parent.width, parent.height - 2, 1, parent.wall); if(door) - DungeonToolbox.generateBox(world, x + parent.width / 2 - 1, y + 1, z + parent.width - 1, 3, 3, 1, Blocks.air); + DungeonToolbox.generateBoxTimed(world, x + parent.width / 2 - 1, y + 1, z + parent.width - 1, 3, 3, 1, Blocks.air); } if(wall == ForgeDirection.WEST) { - DungeonToolbox.generateBox(world, x, y + 1, z, 1, parent.height - 2, parent.width, parent.wall); + DungeonToolbox.generateBoxTimed(world, x, y + 1, z, 1, parent.height - 2, parent.width, parent.wall); if(door) - DungeonToolbox.generateBox(world, x, y + 1, z + parent.width / 2 - 1, 1, 3, 3, Blocks.air); + DungeonToolbox.generateBoxTimed(world, x, y + 1, z + parent.width / 2 - 1, 1, 3, 3, Blocks.air); } if(wall == ForgeDirection.EAST) { - DungeonToolbox.generateBox(world, x + parent.width - 1, y + 1, z, 1, parent.height - 2, parent.width, parent.wall); + DungeonToolbox.generateBoxTimed(world, x + parent.width - 1, y + 1, z, 1, parent.height - 2, parent.width, parent.wall); if(door) - DungeonToolbox.generateBox(world, x + parent.width - 1, y + 1, z + parent.width / 2 - 1, 1, 3, 3, Blocks.air); + DungeonToolbox.generateBoxTimed(world, x + parent.width - 1, y + 1, z + parent.width / 2 - 1, 1, 3, 3, Blocks.air); } } }