From c075079630b5955c699d6e80fab40a4e9297a4f1 Mon Sep 17 00:00:00 2001 From: CannibalVox Date: Wed, 4 Mar 2015 04:09:48 -0600 Subject: [PATCH] Fix sounds & last of the low-hanging fruit --- .../StevenDimDoors/mod_pocketDim/DimData.java | 4 +- .../mod_pocketDim/EventHookContainer.java | 83 ++----- .../commands/CommandCreateRandomRift.java | 4 +- .../commands/CommandDeleteRifts.java | 2 +- .../commands/CommandTeleportPlayer.java | 2 +- .../helpers/BlockRotationHelper.java | 234 +++++++++--------- .../helpers/ChunkLoaderHelper.java | 4 +- .../mod_pocketDim/helpers/yCoordHelper.java | 25 +- .../schematic/ChunkBlockSetter.java | 6 +- .../schematic/WorldCopyOperation.java | 2 +- .../mod_pocketDim/ticking/MobMonolith.java | 2 +- .../mod_pocketDim/world/CustomCaveGen.java | 34 +-- .../mod_pocketDim/world/DDBiomeGenBase.java | 2 +- .../world/PersonalPocketProvider.java | 4 +- .../fortresses/ComponentNetherGateway.java | 90 +++---- .../world/gateways/GatewayLimbo.java | 15 +- .../world/gateways/GatewayTwoPillars.java | 9 +- .../mod_pocketDimClient/ClientProxy.java | 4 +- .../mod_pocketDimClient/RenderMobObelisk.java | 8 +- .../resources/assets/dimdoors/sounds.json | 15 ++ 20 files changed, 264 insertions(+), 285 deletions(-) create mode 100644 src/main/resources/assets/dimdoors/sounds.json diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/DimData.java b/src/main/java/StevenDimDoors/mod_pocketDim/DimData.java index cd57285..4fb7bfe 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/DimData.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/DimData.java @@ -64,7 +64,7 @@ public class DimData implements Serializable { while (k>> rotationMappings = new HashMap>>(); + public HashMap>> rotationMappings = new HashMap>>(); public BlockRotationHelper() { @@ -15,7 +16,7 @@ public class BlockRotationHelper public void InitializeRotationMap() { - HashMap> orientation0 = new HashMap>(); + HashMap> orientation0 = new HashMap>(); HashMap stairs0 = new HashMap(); @@ -99,7 +100,7 @@ public class BlockRotationHelper railsSpecial0.put(9, 8); - HashMap> orientation1 = new HashMap>(); + HashMap> orientation1 = new HashMap>(); HashMap stairs1 = new HashMap(); @@ -183,7 +184,7 @@ public class BlockRotationHelper railsSpecial1.put(8, 8); railsSpecial1.put(9, 9); - HashMap> orientation2 = new HashMap>(); + HashMap> orientation2 = new HashMap>(); HashMap stairs2 = new HashMap(); @@ -270,122 +271,119 @@ public class BlockRotationHelper - orientation0.put(Block.stairsBrick.blockID, stairs0); - orientation0.put(Block.stairsCobblestone.blockID, stairs0); - orientation0.put(Block.stairsNetherBrick.blockID, stairs0); - orientation0.put(Block.stairsNetherQuartz.blockID, stairs0); - orientation0.put(Block.stairsSandStone.blockID, stairs0); - orientation0.put(Block.stairsStoneBrick.blockID, stairs0); - orientation0.put(Block.stairsWoodBirch.blockID, stairs0); - orientation0.put(Block.stairsWoodJungle.blockID, stairs0); - orientation0.put(Block.stairsWoodOak.blockID, stairs0); - orientation0.put(Block.stairsWoodSpruce.blockID, stairs0); - orientation0.put(Block.stairsBrick.blockID, stairs0); - orientation0.put(Block.vine.blockID, vine0); - orientation0.put(Block.chest.blockID, chestsLadders0); - orientation0.put(Block.chestTrapped.blockID, chestsLadders0); - orientation0.put(Block.ladder.blockID, chestsLadders0); - orientation0.put(Block.lever.blockID, leverButtonTorch0); - orientation0.put(Block.stoneButton.blockID, leverButtonTorch0); - orientation0.put(Block.woodenButton.blockID, leverButtonTorch0); - orientation0.put(Block.torchRedstoneActive.blockID, leverButtonTorch0); - orientation0.put(Block.torchRedstoneIdle.blockID, leverButtonTorch0); - orientation0.put(Block.torchWood.blockID, leverButtonTorch0); - orientation0.put(Block.pistonBase.blockID,pistonDropperDispenser0); - orientation0.put(Block.pistonExtension.blockID,pistonDropperDispenser0); - orientation0.put(Block.pistonMoving.blockID,pistonDropperDispenser0); - orientation0.put(Block.pistonStickyBase.blockID,pistonDropperDispenser0); - orientation0.put(Block.dropper.blockID,pistonDropperDispenser0); - orientation0.put(Block.dispenser.blockID,pistonDropperDispenser0); - orientation0.put(Block.redstoneComparatorActive.blockID,pistonDropperDispenser0); - orientation0.put(Block.redstoneComparatorIdle.blockID,pistonDropperDispenser0); - orientation0.put(Block.redstoneRepeaterActive.blockID,pistonDropperDispenser0); - orientation0.put(Block.redstoneRepeaterIdle.blockID,pistonDropperDispenser0); - orientation0.put(Block.doorWood.blockID,pistonDropperDispenser0); - orientation0.put(Block.doorIron.blockID,pistonDropperDispenser0); - orientation0.put(Block.tripWireSource.blockID,pistonDropperDispenser0); - orientation0.put(Block.railDetector.blockID,railsSpecial0); - orientation0.put(Block.railActivator.blockID,railsSpecial0); - orientation0.put(Block.railPowered.blockID,railsSpecial0); - orientation0.put(Block.rail.blockID,rails0); + orientation0.put(Blocks.brick_stairs, stairs0); + orientation0.put(Blocks.stone_stairs, stairs0); + orientation0.put(Blocks.nether_brick_stairs, stairs0); + orientation0.put(Blocks.quartz_stairs, stairs0); + orientation0.put(Blocks.sandstone_stairs, stairs0); + orientation0.put(Blocks.stone_brick_stairs, stairs0); + orientation0.put(Blocks.birch_stairs, stairs0); + orientation0.put(Blocks.jungle_stairs, stairs0); + orientation0.put(Blocks.oak_stairs, stairs0); + orientation0.put(Blocks.spruce_stairs, stairs0); + orientation0.put(Blocks.brick_stairs, stairs0); + orientation0.put(Blocks.vine, vine0); + orientation0.put(Blocks.chest, chestsLadders0); + orientation0.put(Blocks.trapped_chest, chestsLadders0); + orientation0.put(Blocks.ladder, chestsLadders0); + orientation0.put(Blocks.lever, leverButtonTorch0); + orientation0.put(Blocks.stone_button, leverButtonTorch0); + orientation0.put(Blocks.wooden_button, leverButtonTorch0); + orientation0.put(Blocks.redstone_torch, leverButtonTorch0); + orientation0.put(Blocks.unlit_redstone_torch, leverButtonTorch0); + orientation0.put(Blocks.torch, leverButtonTorch0); + orientation0.put(Blocks.piston,pistonDropperDispenser0); + orientation0.put(Blocks.piston_head,pistonDropperDispenser0); + orientation0.put(Blocks.piston_extension,pistonDropperDispenser0); + orientation0.put(Blocks.sticky_piston,pistonDropperDispenser0); + orientation0.put(Blocks.dropper,pistonDropperDispenser0); + orientation0.put(Blocks.dispenser,pistonDropperDispenser0); + orientation0.put(Blocks.powered_comparator,pistonDropperDispenser0); + orientation0.put(Blocks.unpowered_comparator,pistonDropperDispenser0); + orientation0.put(Blocks.powered_repeater,pistonDropperDispenser0); + orientation0.put(Blocks.unpowered_repeater,pistonDropperDispenser0); + orientation0.put(Blocks.wooden_door,pistonDropperDispenser0); + orientation0.put(Blocks.iron_door,pistonDropperDispenser0); + orientation0.put(Blocks.tripwire_hook,pistonDropperDispenser0); + orientation0.put(Blocks.detector_rail,railsSpecial0); + orientation0.put(Blocks.activator_rail,railsSpecial0); + orientation0.put(Blocks.golden_rail,railsSpecial0); + orientation0.put(Blocks.rail,rails0); - orientation1.put(Block.stairsBrick.blockID, stairs1); - orientation1.put(Block.stairsCobblestone.blockID, stairs1); - orientation1.put(Block.stairsNetherBrick.blockID, stairs1); - orientation1.put(Block.stairsNetherQuartz.blockID, stairs1); - orientation1.put(Block.stairsSandStone.blockID, stairs1); - orientation1.put(Block.stairsStoneBrick.blockID, stairs1); - orientation1.put(Block.stairsWoodBirch.blockID, stairs1); - orientation1.put(Block.stairsWoodJungle.blockID, stairs1); - orientation1.put(Block.stairsWoodOak.blockID, stairs1); - orientation1.put(Block.stairsWoodSpruce.blockID, stairs1); - orientation1.put(Block.stairsBrick.blockID, stairs1); - orientation1.put(Block.vine.blockID, vine1); - orientation1.put(Block.chest.blockID, chestsLadders1); - orientation1.put(Block.chestTrapped.blockID, chestsLadders1); - orientation1.put(Block.ladder.blockID, chestsLadders1); - orientation1.put(Block.lever.blockID, leverButtonTorch1); - orientation1.put(Block.stoneButton.blockID, leverButtonTorch1); - orientation1.put(Block.woodenButton.blockID, leverButtonTorch1); - orientation1.put(Block.torchRedstoneActive.blockID, leverButtonTorch1); - orientation1.put(Block.torchRedstoneIdle.blockID, leverButtonTorch1); - orientation1.put(Block.torchWood.blockID, leverButtonTorch1); - orientation1.put(Block.pistonBase.blockID,pistonDropperDispenser1); - orientation1.put(Block.pistonExtension.blockID,pistonDropperDispenser1); - orientation1.put(Block.pistonMoving.blockID,pistonDropperDispenser1); - orientation1.put(Block.pistonStickyBase.blockID,pistonDropperDispenser1); - orientation1.put(Block.dropper.blockID,pistonDropperDispenser1); - orientation1.put(Block.dispenser.blockID,pistonDropperDispenser1); - orientation1.put(Block.redstoneComparatorActive.blockID,pistonDropperDispenser1); - orientation1.put(Block.redstoneComparatorIdle.blockID,pistonDropperDispenser1); - orientation1.put(Block.redstoneRepeaterActive.blockID,pistonDropperDispenser1); - orientation1.put(Block.redstoneRepeaterIdle.blockID,pistonDropperDispenser1); - orientation1.put(Block.doorWood.blockID,pistonDropperDispenser1); - orientation1.put(Block.doorIron.blockID,pistonDropperDispenser1); - orientation1.put(Block.tripWireSource.blockID,pistonDropperDispenser1); - orientation1.put(Block.railDetector.blockID,railsSpecial1); - orientation1.put(Block.railActivator.blockID,railsSpecial1); - orientation1.put(Block.railPowered.blockID,railsSpecial1); - orientation1.put(Block.rail.blockID,rails1); + orientation1.put(Blocks.brick_stairs, stairs1); + orientation1.put(Blocks.stone_stairs, stairs1); + orientation1.put(Blocks.nether_brick_stairs, stairs1); + orientation1.put(Blocks.quartz_stairs, stairs1); + orientation1.put(Blocks.sandstone_stairs, stairs1); + orientation1.put(Blocks.stone_brick_stairs, stairs1); + orientation1.put(Blocks.birch_stairs, stairs1); + orientation1.put(Blocks.jungle_stairs, stairs1); + orientation1.put(Blocks.oak_stairs, stairs1); + orientation1.put(Blocks.spruce_stairs, stairs1); + orientation1.put(Blocks.vine, vine1); + orientation1.put(Blocks.chest, chestsLadders1); + orientation1.put(Blocks.trapped_chest, chestsLadders1); + orientation1.put(Blocks.ladder, chestsLadders1); + orientation1.put(Blocks.lever, leverButtonTorch1); + orientation1.put(Blocks.stone_button, leverButtonTorch1); + orientation1.put(Blocks.wooden_button, leverButtonTorch1); + orientation1.put(Blocks.redstone_torch, leverButtonTorch1); + orientation1.put(Blocks.unlit_redstone_torch, leverButtonTorch1); + orientation1.put(Blocks.torch, leverButtonTorch1); + orientation1.put(Blocks.piston,pistonDropperDispenser1); + orientation1.put(Blocks.piston_head,pistonDropperDispenser1); + orientation1.put(Blocks.piston_extension,pistonDropperDispenser1); + orientation1.put(Blocks.sticky_piston,pistonDropperDispenser1); + orientation1.put(Blocks.dropper,pistonDropperDispenser1); + orientation1.put(Blocks.dispenser,pistonDropperDispenser1); + orientation1.put(Blocks.powered_comparator,pistonDropperDispenser1); + orientation1.put(Blocks.unpowered_comparator,pistonDropperDispenser1); + orientation1.put(Blocks.powered_repeater,pistonDropperDispenser1); + orientation1.put(Blocks.unpowered_repeater,pistonDropperDispenser1); + orientation1.put(Blocks.wooden_door,pistonDropperDispenser1); + orientation1.put(Blocks.iron_door,pistonDropperDispenser1); + orientation1.put(Blocks.tripwire_hook,pistonDropperDispenser1); + orientation1.put(Blocks.detector_rail,railsSpecial1); + orientation1.put(Blocks.activator_rail,railsSpecial1); + orientation1.put(Blocks.golden_rail,railsSpecial1); + orientation1.put(Blocks.rail,rails1); - orientation2.put(Block.stairsBrick.blockID, stairs2); - orientation2.put(Block.stairsCobblestone.blockID, stairs2); - orientation2.put(Block.stairsNetherBrick.blockID, stairs2); - orientation2.put(Block.stairsNetherQuartz.blockID, stairs2); - orientation2.put(Block.stairsSandStone.blockID, stairs2); - orientation2.put(Block.stairsStoneBrick.blockID, stairs2); - orientation2.put(Block.stairsWoodBirch.blockID, stairs2); - orientation2.put(Block.stairsWoodJungle.blockID, stairs2); - orientation2.put(Block.stairsWoodOak.blockID, stairs2); - orientation2.put(Block.stairsWoodSpruce.blockID, stairs2); - orientation2.put(Block.stairsBrick.blockID, stairs2); - orientation2.put(Block.vine.blockID, vine2); - orientation2.put(Block.chest.blockID, chestsLadders2); - orientation2.put(Block.chestTrapped.blockID, chestsLadders2); - orientation2.put(Block.ladder.blockID, chestsLadders2); - orientation2.put(Block.lever.blockID, leverButtonTorch2); - orientation2.put(Block.stoneButton.blockID, leverButtonTorch2); - orientation2.put(Block.woodenButton.blockID, leverButtonTorch2); - orientation2.put(Block.torchRedstoneActive.blockID, leverButtonTorch2); - orientation2.put(Block.torchRedstoneIdle.blockID, leverButtonTorch2); - orientation2.put(Block.torchWood.blockID, leverButtonTorch2); - orientation2.put(Block.pistonBase.blockID,pistonDropperDispenser2); - orientation2.put(Block.pistonExtension.blockID,pistonDropperDispenser2); - orientation2.put(Block.pistonMoving.blockID,pistonDropperDispenser2); - orientation2.put(Block.pistonStickyBase.blockID,pistonDropperDispenser2); - orientation2.put(Block.dropper.blockID,pistonDropperDispenser2); - orientation2.put(Block.dispenser.blockID,pistonDropperDispenser2); - orientation2.put(Block.redstoneComparatorActive.blockID,pistonDropperDispenser2); - orientation2.put(Block.redstoneComparatorIdle.blockID,pistonDropperDispenser2); - orientation2.put(Block.redstoneRepeaterActive.blockID,pistonDropperDispenser2); - orientation2.put(Block.redstoneRepeaterIdle.blockID,pistonDropperDispenser2); - orientation2.put(Block.doorWood.blockID,pistonDropperDispenser2); - orientation2.put(Block.doorIron.blockID,pistonDropperDispenser2); - orientation2.put(Block.tripWireSource.blockID,pistonDropperDispenser2); - orientation2.put(Block.railDetector.blockID,railsSpecial2); - orientation2.put(Block.railActivator.blockID,railsSpecial2); - orientation2.put(Block.railPowered.blockID,railsSpecial2); - orientation2.put(Block.rail.blockID,rails2); + orientation2.put(Blocks.brick_stairs, stairs2); + orientation2.put(Blocks.stone_stairs, stairs2); + orientation2.put(Blocks.nether_brick_stairs, stairs2); + orientation2.put(Blocks.quartz_stairs, stairs2); + orientation2.put(Blocks.sandstone_stairs, stairs2); + orientation2.put(Blocks.stone_brick_stairs, stairs2); + orientation2.put(Blocks.birch_stairs, stairs2); + orientation2.put(Blocks.jungle_stairs, stairs2); + orientation2.put(Blocks.oak_stairs, stairs2); + orientation2.put(Blocks.spruce_stairs, stairs2); + orientation2.put(Blocks.vine, vine2); + orientation2.put(Blocks.trapped_chest, chestsLadders2); + orientation2.put(Blocks.ladder, chestsLadders2); + orientation2.put(Blocks.lever, leverButtonTorch2); + orientation2.put(Blocks.stone_button, leverButtonTorch2); + orientation2.put(Blocks.wooden_button, leverButtonTorch2); + orientation2.put(Blocks.redstone_torch, leverButtonTorch2); + orientation2.put(Blocks.unlit_redstone_torch, leverButtonTorch2); + orientation2.put(Blocks.torch, leverButtonTorch2); + orientation2.put(Blocks.piston,pistonDropperDispenser2); + orientation2.put(Blocks.piston_head,pistonDropperDispenser2); + orientation2.put(Blocks.piston_extension,pistonDropperDispenser2); + orientation2.put(Blocks.sticky_piston,pistonDropperDispenser2); + orientation2.put(Blocks.dropper,pistonDropperDispenser2); + orientation2.put(Blocks.dispenser,pistonDropperDispenser2); + orientation2.put(Blocks.powered_comparator,pistonDropperDispenser2); + orientation2.put(Blocks.unpowered_comparator,pistonDropperDispenser2); + orientation2.put(Blocks.powered_repeater,pistonDropperDispenser2); + orientation2.put(Blocks.unpowered_repeater,pistonDropperDispenser2); + orientation2.put(Blocks.wooden_door,pistonDropperDispenser2); + orientation2.put(Blocks.iron_door,pistonDropperDispenser2); + orientation2.put(Blocks.tripwire_hook,pistonDropperDispenser2); + orientation2.put(Blocks.detector_rail,railsSpecial2); + orientation2.put(Blocks.activator_rail,railsSpecial2); + orientation2.put(Blocks.golden_rail,railsSpecial2); + orientation2.put(Blocks.rail,rails2); this.rotationMappings.put(2, orientation2); this.rotationMappings.put(1, orientation1); diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java b/src/main/java/StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java index 6483afd..014dada 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/helpers/ChunkLoaderHelper.java @@ -32,9 +32,9 @@ public class ChunkLoaderHelper implements LoadingCallback int y = ticket.getModData().getInteger("goldDimDoorY"); int z = ticket.getModData().getInteger("goldDimDoorZ"); - if (world.getBlockId(x, y, z) == mod_pocketDim.properties.GoldenDimensionalDoorID) + if (world.getBlock(x, y, z) == mod_pocketDim.goldenDimensionalDoor) { - IChunkLoader loader = (IChunkLoader) world.getBlockTileEntity(x, y, z); + IChunkLoader loader = (IChunkLoader) world.getTileEntity(x, y, z); if (!loader.isInitialized()) { loader.initialize(ticket); diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/helpers/yCoordHelper.java b/src/main/java/StevenDimDoors/mod_pocketDim/helpers/yCoordHelper.java index 26aa178..f46af21 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/helpers/yCoordHelper.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/helpers/yCoordHelper.java @@ -52,22 +52,17 @@ public class yCoordHelper public static boolean isCoveredBlock(Chunk chunk, int localX, int y, int localZ) { - int blockID; Block block; Material material; if (y < 0) return false; - blockID = chunk.getBlockID(localX, y, localZ); - if (blockID == 0) - return false; - - block = Block.blocksList[blockID]; + block = chunk.getBlock(localX, y, localZ); if (block == null) return false; - material = block.blockMaterial; + material = block.getMaterial(); return (material.isLiquid() || !material.isReplaceable()); } @@ -109,12 +104,11 @@ public class yCoordHelper { for (dz = -1; dz <= 1 && isSafe; dz++) { - blockID = chunk.getBlockID(localX + dx, y, localZ + dz); + block = chunk.getBlock(localX + dx, y, localZ + dz); metadata = chunk.getBlockMetadata(localX + dx, y, localZ + dz); - block = Block.blocksList[blockID]; - if (blockID != 0 && (!block.blockMaterial.isReplaceable() || block.blockMaterial.isLiquid())) + if (!block.isAir(world, x, y, z) && (!block.getMaterial().isReplaceable() || block.getMaterial().isLiquid())) { - if (!block.blockMaterial.isReplaceable() && (!block.isOpaqueCube() || block.hasTileEntity(metadata))) + if (!block.getMaterial().isReplaceable() && (!block.isOpaqueCube() || block.hasTileEntity(metadata))) { isSafe = false; } @@ -170,12 +164,11 @@ public class yCoordHelper { for (dz = -1; dz <= 1 && isSafe; dz++) { - blockID = chunk.getBlockID(localX + dx, y, localZ + dz); + block = chunk.getBlock(localX + dx, y, localZ + dz); metadata = chunk.getBlockMetadata(localX + dx, y, localZ + dz); - block = Block.blocksList[blockID]; - if (blockID != 0 && (!block.blockMaterial.isReplaceable() || block.blockMaterial.isLiquid())) + if (!block.isAir(world,x,y,z) && (!block.getMaterial().isReplaceable() || block.getMaterial().isLiquid())) { - if (!block.blockMaterial.isReplaceable() && (!block.isOpaqueCube() || block.hasTileEntity(metadata))) + if (!block.getMaterial().isReplaceable() && (!block.isOpaqueCube() || block.hasTileEntity(metadata))) { if (layers >= 3) { @@ -247,7 +240,7 @@ public class yCoordHelper { for (dz = -1; dz <= 1; dz++, index++) { - if (chunk.getBlockID(localX + dx, y, localZ + dz) != 0) + if (!chunk.getBlock(localX + dx, y, localZ + dz).isAir(world, x+dx,y,z+dz)) { gaps[index] = 0; } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/schematic/ChunkBlockSetter.java b/src/main/java/StevenDimDoors/mod_pocketDim/schematic/ChunkBlockSetter.java index b00195c..a7e9268 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/schematic/ChunkBlockSetter.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/schematic/ChunkBlockSetter.java @@ -14,9 +14,9 @@ public class ChunkBlockSetter implements IBlockSetter this.ignoreAir = ignoreAir; } - public void setBlock(World world, int x, int y, int z, int blockID, int metadata) + public void setBlock(World world, int x, int y, int z, Block block, int metadata) { - if ((blockID == 0 && ignoreAir) || (blockID != 0 && Block.blocksList[blockID] == null)) + if (block.isAir(world, x, y, z) && ignoreAir) { return; } @@ -39,7 +39,7 @@ public class ChunkBlockSetter implements IBlockSetter extBlockStorage = new ExtendedBlockStorage(cY << 4, !world.provider.hasNoSky); chunk.getBlockStorageArray()[cY] = extBlockStorage; } - extBlockStorage.setExtBlockID(localX, y & 15, localZ, blockID); + extBlockStorage.setExtBlockID(localX, y & 15, localZ, block); extBlockStorage.setExtBlockMetadata(localX, y & 15, localZ, metadata); chunk.setChunkModified(); } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/schematic/WorldCopyOperation.java b/src/main/java/StevenDimDoors/mod_pocketDim/schematic/WorldCopyOperation.java index fe49a78..04fab49 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/schematic/WorldCopyOperation.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/schematic/WorldCopyOperation.java @@ -42,7 +42,7 @@ public class WorldCopyOperation extends WorldOperation blockIDs[index] = (short) world.getBlockId(x, y, z); metadata[index] = (byte) world.getBlockMetadata(x, y, z); - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); + TileEntity tileEntity = world.getTileEntity(x, y, z); if (tileEntity != null) { //Extract tile entity data diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java b/src/main/java/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java index 279c123..daf20e6 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/ticking/MobMonolith.java @@ -94,7 +94,7 @@ public class MobMonolith extends EntityFlying implements IMob protected void applyEntityAttributes() { super.applyEntityAttributes(); - this.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth).setAttribute(57005); + this.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth).setBaseValue(57005); } @Override diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/CustomCaveGen.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/CustomCaveGen.java index 1f9b680..0b0b017 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/CustomCaveGen.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/CustomCaveGen.java @@ -2,7 +2,9 @@ package StevenDimDoors.mod_pocketDim.world; import java.util.Random; +import StevenDimDoors.mod_pocketDim.mod_pocketDim; import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.gen.MapGenBase; @@ -21,15 +23,15 @@ public class CustomCaveGen extends MapGenBase /** * Generates a larger initial cave node than usual. Called 25% of the time. */ - protected void generateLargeCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10) + protected void generateLargeCaveNode(long par1, int par3, int par4, Block[] blocks, double par6, double par8, double par10) { - this.generateCaveNode(par1, par3, par4, par5ArrayOfByte, par6, par8, par10, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + this.generateCaveNode(par1, par3, par4, blocks, par6, par8, par10, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); } /** * Generates a node in the current cave system recursion tree. */ - protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17) + protected void generateCaveNode(long par1, int par3, int par4, Block[] blocks, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17) { double var19 = par3 * 16 + 8; double var21 = par4 * 16 + 8; @@ -81,8 +83,8 @@ public class CustomCaveGen extends MapGenBase if (!var54 && par15 == var27 && par12 > 1.0F && par16 > 0) { - this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 - ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); - this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 + ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); + this.generateCaveNode(var25.nextLong(), par3, par4, blocks, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 - ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); + this.generateCaveNode(var25.nextLong(), par3, par4, blocks, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 + ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); return; } @@ -151,7 +153,7 @@ public class CustomCaveGen extends MapGenBase if (var44 >= 0 && var44 < 128) { - if (par5ArrayOfByte[var45] == Block.waterMoving.blockID || par5ArrayOfByte[var45] == Block.waterStill.blockID) + if (blocks[var45] == Blocks.flowing_water || blocks[var45] == Blocks.water) { var58 = true; } @@ -185,26 +187,26 @@ public class CustomCaveGen extends MapGenBase if (var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D) { - byte var53 = par5ArrayOfByte[var48]; + Block var53 = blocks[var48]; - if (var53 == Block.grass.blockID) + if (var53 == Blocks.grass) { var49 = true; } - if (var53 == properties.LimboBlockID || var53 == Block.dirt.blockID || var53 == Block.grass.blockID) + if (var53 == mod_pocketDim.blockLimbo || var53 == Blocks.dirt || var53 == Blocks.grass) { if (var50 < 10) { - par5ArrayOfByte[var48] = (byte)Block.lavaMoving.blockID; + blocks[var48] = Blocks.flowing_lava; } else { - par5ArrayOfByte[var48] = 0; + blocks[var48] = Blocks.air; - if (var49 && par5ArrayOfByte[var48 - 1] == Block.dirt.blockID) + if (var49 && blocks[var48 - 1] == Blocks.dirt) { - par5ArrayOfByte[var48 - 1] = this.worldObj.getBiomeGenForCoords(var42 + par3 * 16, var45 + par4 * 16).topBlock; + blocks[var48 - 1] = this.worldObj.getBiomeGenForCoords(var42 + par3 * 16, var45 + par4 * 16).topBlock; } } } @@ -230,7 +232,7 @@ public class CustomCaveGen extends MapGenBase * Recursively called by generate() (generate) and optionally by itself. */ @Override - protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) + protected void func_151538_a(World par1World, int par2, int par3, int par4, int par5, Block[] blocks) { int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1); @@ -248,7 +250,7 @@ public class CustomCaveGen extends MapGenBase if (this.rand.nextInt(4) == 0) { - this.generateLargeCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13); + this.generateLargeCaveNode(this.rand.nextLong(), par4, par5, blocks, var9, var11, var13); var15 += this.rand.nextInt(4); } @@ -263,7 +265,7 @@ public class CustomCaveGen extends MapGenBase var19 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F; } - this.generateCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13, var19, var17, var18, 0, 0, 1.0D); + this.generateCaveNode(this.rand.nextLong(), par4, par5, blocks, var9, var11, var13, var19, var17, var18, 0, 0, 1.0D); } } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/DDBiomeGenBase.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/DDBiomeGenBase.java index f6e3428..3bd1b95 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/DDBiomeGenBase.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/DDBiomeGenBase.java @@ -23,7 +23,7 @@ public class DDBiomeGenBase extends BiomeGenBase { for (int k = 0; k < biomes.length; k++) { - if (biomeList[biomes[k]] != null && !(biomeList[biomes[k]] instanceof DDBiomeGenBase)) + if (getBiomeGenArray()[biomes[k]] != null && !(getBiomeGenArray()[biomes[k]] instanceof DDBiomeGenBase)) { // Crash Minecraft to avoid having people complain to us about strange things // that are really the result of silent biome ID conflicts. diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/PersonalPocketProvider.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/PersonalPocketProvider.java index 8f1b824..6f42518 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/PersonalPocketProvider.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/PersonalPocketProvider.java @@ -31,7 +31,7 @@ public class PersonalPocketProvider extends PocketProvider public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) { setCloudRenderer( new CloudRenderBlank()); - return this.worldObj.getWorldVec3Pool().getVecFromPool(1,1,1); + return Vec3.createVectorHelper(1,1,1); } public boolean isSurfaceWorld() @@ -61,7 +61,7 @@ public class PersonalPocketProvider extends PocketProvider @Override public Vec3 getFogColor(float par1, float par2) { - return this.worldObj.getWorldVec3Pool().getVecFromPool(1,1,1); + return Vec3.createVectorHelper(1,1,1); } @Override diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/fortresses/ComponentNetherGateway.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/fortresses/ComponentNetherGateway.java index 245071e..4a5758d 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/fortresses/ComponentNetherGateway.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/fortresses/ComponentNetherGateway.java @@ -2,7 +2,7 @@ package StevenDimDoors.mod_pocketDim.world.fortresses; import java.util.List; import java.util.Random; -import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.item.ItemDoor; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; @@ -71,75 +71,75 @@ public class ComponentNetherGateway extends StructureComponent int NETHER_SLAB_METADATA = 6; // Set all the blocks in the area of the room to air - this.fillWithBlocks(world, bounds, 0, 2, 0, 6, 6, 6, 0, 0, false); + this.fillWithBlocks(world, bounds, 0, 2, 0, 6, 6, 6, Blocks.air, Blocks.air, false); // Set up the platform under the gateway - this.fillWithBlocks(world, bounds, 0, 0, 0, 6, 1, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + this.fillWithBlocks(world, bounds, 0, 0, 0, 6, 1, 6, Blocks.nether_brick, Blocks.nether_brick, false); // Build the fence at the back of the room - this.fillWithBlocks(world, bounds, 1, 2, 6, 5, 2, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - this.fillWithBlocks(world, bounds, 1, 3, 6, 5, 3, 6, Block.netherFence.blockID, Block.netherFence.blockID, false); + this.fillWithBlocks(world, bounds, 1, 2, 6, 5, 2, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(world, bounds, 1, 3, 6, 5, 3, 6, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); // Build the fences at the sides of the room - this.fillWithBlocks(world, bounds, 0, 2, 0, 0, 2, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - this.fillWithBlocks(world, bounds, 0, 3, 0, 0, 3, 6, Block.netherFence.blockID, Block.netherFence.blockID, false); + this.fillWithBlocks(world, bounds, 0, 2, 0, 0, 2, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(world, bounds, 0, 3, 0, 0, 3, 6, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); - this.fillWithBlocks(world, bounds, 6, 2, 0, 6, 2, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - this.fillWithBlocks(world, bounds, 6, 3, 0, 6, 3, 6, Block.netherFence.blockID, Block.netherFence.blockID, false); + this.fillWithBlocks(world, bounds, 6, 2, 0, 6, 2, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(world, bounds, 6, 3, 0, 6, 3, 6, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); // Build the fence portions closest to the entrance - this.placeBlockAtCurrentPosition(world, Block.netherBrick.blockID, 0, 1, 2, 0, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherFence.blockID, 0, 1, 3, 0, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick, 0, 1, 2, 0, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_fence, 0, 1, 3, 0, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherBrick.blockID, 0, 5, 2, 0, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherFence.blockID, 0, 5, 3, 0, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick, 0, 5, 2, 0, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_fence, 0, 5, 3, 0, bounds); // Build the first layer of the gateway - this.fillWithBlocks(world, bounds, 1, 2, 2, 5, 2, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - this.fillWithMetadataBlocks(world, bounds, 1, 2, 1, 5, 2, 1, Block.stoneSingleSlab.blockID, NETHER_SLAB_METADATA, Block.stoneSingleSlab.blockID, NETHER_SLAB_METADATA, false); + this.fillWithBlocks(world, bounds, 1, 2, 2, 5, 2, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithMetadataBlocks(world, bounds, 1, 2, 1, 5, 2, 1, Blocks.stone_slab, NETHER_SLAB_METADATA, Blocks.stone_slab, NETHER_SLAB_METADATA, false); - this.placeBlockAtCurrentPosition(world, Block.stoneSingleSlab.blockID, NETHER_SLAB_METADATA, 1, 2, 2, bounds); - this.placeBlockAtCurrentPosition(world, Block.stoneSingleSlab.blockID, NETHER_SLAB_METADATA, 5, 2, 2, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, NETHER_SLAB_METADATA, 1, 2, 2, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, NETHER_SLAB_METADATA, 5, 2, 2, bounds); // Build the second layer of the gateway - int orientation = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 2); - this.fillWithBlocks(world, bounds, 2, 3, 3, 2, 3, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - this.fillWithBlocks(world, bounds, 4, 3, 3, 4, 3, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - this.placeBlockAtCurrentPosition(world, Block.netherBrick.blockID, 0, 3, 3, 4, bounds); - this.placeBlockAtCurrentPosition(world, Block.stairsNetherBrick.blockID, orientation, 3, 3, 5, bounds); + int orientation = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 2); + this.fillWithBlocks(world, bounds, 2, 3, 3, 2, 3, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(world, bounds, 4, 3, 3, 4, 3, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick, 0, 3, 3, 4, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_stairs, orientation, 3, 3, 5, bounds); // Build the third layer of the gateway // We add 4 to get the rotated metadata for upside-down stairs // because Minecraft only supports metadata rotations for normal stairs -_- - this.fillWithMetadataBlocks(world, bounds, 2, 4, 4, 4, 4, 4, Block.stairsNetherBrick.blockID, orientation, Block.stairsNetherBrick.blockID, orientation, false); + this.fillWithMetadataBlocks(world, bounds, 2, 4, 4, 4, 4, 4, Blocks.nether_brick_stairs, orientation, Blocks.nether_brick_stairs, orientation, false); - this.placeBlockAtCurrentPosition(world, Block.stairsNetherBrick.blockID, this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 0) + 4, 2, 4, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.stairsNetherBrick.blockID, this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 1) + 4, 4, 4, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_stairs, this.getMetadataWithOffset(Blocks.nether_brick_stairs, 0) + 4, 2, 4, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_stairs, this.getMetadataWithOffset(Blocks.nether_brick_stairs, 1) + 4, 4, 4, 3, bounds); // Build the fourth layer of the gateway - this.placeBlockAtCurrentPosition(world, Block.netherBrick.blockID, 0, 3, 5, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick, 0, 3, 5, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherrack.blockID, 0, 2, 5, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.stairsNetherBrick.blockID, this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 0) + 4, 1, 5, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.stairsNetherBrick.blockID, this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 3) + 4, 2, 5, 2, bounds); - this.placeBlockAtCurrentPosition(world, Block.stairsNetherBrick.blockID, this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 2) + 4, 2, 5, 4, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.netherrack, 0, 2, 5, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_stairs, this.getMetadataWithOffset(Blocks.nether_brick_stairs, 0) + 4, 1, 5, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_stairs, this.getMetadataWithOffset(Blocks.nether_brick_stairs, 3) + 4, 2, 5, 2, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_stairs, this.getMetadataWithOffset(Blocks.nether_brick_stairs, 2) + 4, 2, 5, 4, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherrack.blockID, 0, 4, 5, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.stairsNetherBrick.blockID, this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 1) + 4, 5, 5, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.stairsNetherBrick.blockID, this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 3) + 4, 4, 5, 2, bounds); - this.placeBlockAtCurrentPosition(world, Block.stairsNetherBrick.blockID, this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 2) + 4, 4, 5, 4, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.netherrack, 0, 4, 5, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_stairs, this.getMetadataWithOffset(Blocks.nether_brick_stairs, 1) + 4, 5, 5, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_stairs, this.getMetadataWithOffset(Blocks.nether_brick_stairs, 3) + 4, 4, 5, 2, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_stairs, this.getMetadataWithOffset(Blocks.nether_brick_stairs, 2) + 4, 4, 5, 4, bounds); // Build the top layer of the gateway - this.placeBlockAtCurrentPosition(world, Block.netherFence.blockID, 0, 3, 6, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_fence, 0, 3, 6, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.fire.blockID, 0, 2, 6, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherFence.blockID, 0, 1, 6, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherFence.blockID, 0, 2, 6, 2, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherFence.blockID, 0, 2, 6, 4, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.fire, 0, 2, 6, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_fence, 0, 1, 6, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_fence, 0, 2, 6, 2, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_fence, 0, 2, 6, 4, bounds); - this.placeBlockAtCurrentPosition(world, Block.fire.blockID, 0, 4, 6, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherFence.blockID, 0, 5, 6, 3, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherFence.blockID, 0, 4, 6, 2, bounds); - this.placeBlockAtCurrentPosition(world, Block.netherFence.blockID, 0, 4, 6, 4, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.fire, 0, 4, 6, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_fence, 0, 5, 6, 3, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_fence, 0, 4, 6, 2, bounds); + this.placeBlockAtCurrentPosition(world, Blocks.nether_brick_fence, 0, 4, 6, 4, bounds); // Place the transient door int y = this.getYWithOffset(3); @@ -152,7 +152,7 @@ public class ComponentNetherGateway extends StructureComponent // due to the way Minecraft handles structure generation! if (bounds.isVecInside(x, y, z) && bounds.isVecInside(x, y + 1, z)) { - orientation = this.getMetadataWithOffset(Block.doorWood.blockID, 1); + orientation = this.getMetadataWithOffset(Blocks.wooden_door, 1); dimension = PocketManager.createDimensionData(world); link = dimension.getLink(x, y + 1, z); if (link == null) @@ -166,7 +166,7 @@ public class ComponentNetherGateway extends StructureComponent { for (z = 0; z <= 6; ++z) { - this.fillCurrentPositionBlocksDownwards(world, Block.netherBrick.blockID, 0, x, -1, z, bounds); + this.func_151554_b(world, Blocks.nether_brick, 0, x, -1, z, bounds); } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayLimbo.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayLimbo.java index 6a3ec04..c9e77e7 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayLimbo.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayLimbo.java @@ -1,5 +1,6 @@ package StevenDimDoors.mod_pocketDim.world.gateways; +import net.minecraft.block.Block; import net.minecraft.item.ItemDoor; import net.minecraft.world.World; import StevenDimDoors.mod_pocketDim.mod_pocketDim; @@ -18,17 +19,17 @@ public class GatewayLimbo extends BaseGateway @Override public boolean generate(World world, int x, int y, int z) { - int blockID = mod_pocketDim.blockLimbo.blockID; + Block block = mod_pocketDim.blockLimbo; // Build the gateway out of Unraveled Fabric. Since nearly all the blocks in Limbo are of // that type, there is no point replacing the ground. - world.setBlock(x, y + 3, z + 1, blockID, 0, 3); - world.setBlock(x, y + 3, z - 1, blockID, 0, 3); + world.setBlock(x, y + 3, z + 1, block, 0, 3); + world.setBlock(x, y + 3, z - 1, block, 0, 3); // Build the columns around the door - world.setBlock(x, y + 2, z - 1, blockID, 0, 3); - world.setBlock(x, y + 2, z + 1, blockID, 0, 3); - world.setBlock(x, y + 1, z - 1, blockID, 0, 3); - world.setBlock(x, y + 1, z + 1, blockID, 0, 3); + world.setBlock(x, y + 2, z - 1, block, 0, 3); + world.setBlock(x, y + 2, z + 1, block, 0, 3); + world.setBlock(x, y + 1, z - 1, block, 0, 3); + world.setBlock(x, y + 1, z + 1, block, 0, 3); PocketManager.getDimensionData(world).createLink(x, y + 2, z, LinkType.DUNGEON, 0); diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayTwoPillars.java b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayTwoPillars.java index 13507a4..42d22fa 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayTwoPillars.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/world/gateways/GatewayTwoPillars.java @@ -1,6 +1,7 @@ package StevenDimDoors.mod_pocketDim.world.gateways; import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.world.World; import StevenDimDoors.mod_pocketDim.config.DDProperties; @@ -16,7 +17,7 @@ public class GatewayTwoPillars extends BaseSchematicGateway @Override protected void generateRandomBits(World world, int x, int y, int z) { - final int blockID = Block.stoneBrick.blockID; + final Block block = Blocks.stonebrick; //Replace some of the ground around the gateway with bricks for (int xc = -GATEWAY_RADIUS; xc <= GATEWAY_RADIUS; xc++) @@ -26,19 +27,19 @@ public class GatewayTwoPillars extends BaseSchematicGateway //Check that the block is supported by an opaque block. //This prevents us from building over a cliff, on the peak of a mountain, //or the surface of the ocean or a frozen lake. - if (world.isBlockOpaqueCube(x + xc, y - 1, z + zc)) + if (world.isBlockNormalCubeDefault(x + xc, y - 1, z + zc, false)) { //Randomly choose whether to place bricks or not. The math is designed so that the //chances of placing a block decrease as we get farther from the gateway's center. if (Math.abs(xc) + Math.abs(zc) < world.rand.nextInt(2) + 3) { //Place Stone Bricks - world.setBlock(x + xc, y, z + zc, blockID, 0, 3); + world.setBlock(x + xc, y, z + zc, block, 0, 3); } else if (Math.abs(xc) + Math.abs(zc) < world.rand.nextInt(3) + 3) { //Place Cracked Stone Bricks - world.setBlock(x + xc, y, z + zc, blockID, 2, 3); + world.setBlock(x + xc, y, z + zc, block, 2, 3); } } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDimClient/ClientProxy.java b/src/main/java/StevenDimDoors/mod_pocketDimClient/ClientProxy.java index 004e4ce..b6e3608 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDimClient/ClientProxy.java +++ b/src/main/java/StevenDimDoors/mod_pocketDimClient/ClientProxy.java @@ -35,14 +35,14 @@ public class ClientProxy extends CommonProxy @Override public void updateDoorTE(BaseDimDoor door, World world, int x, int y, int z) { - TileEntity tile = world.getBlockTileEntity(x, y, z); + TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TileEntityDimDoor) { DimLink link = PocketManager.getLink(x, y, z, world); int metadata = world.getBlockMetadata(x, y, z); TileEntityDimDoor dimTile = (TileEntityDimDoor) tile; dimTile.openOrClosed = door.isDoorOnRift(world, x, y, z)&&door.isUpperDoorBlock(metadata); - dimTile.orientation = door.getFullMetadata(world, x, y, z) & 7; + dimTile.orientation = world.getBlockMetadata(x, y, z) & 7; dimTile.lockStatus = door.getLockStatus(world, x, y, z); } } diff --git a/src/main/java/StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java b/src/main/java/StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java index dc35abd..b87e6c8 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java +++ b/src/main/java/StevenDimDoors/mod_pocketDimClient/RenderMobObelisk.java @@ -29,7 +29,7 @@ public class RenderMobObelisk extends RenderLiving } @Override - public void doRenderLiving(EntityLiving entity, double x, double y, double z, float par8, float par9) + public void doRender(EntityLiving entity, double x, double y, double z, float par8, float par9) { final float minScaling = 0; final float maxScaling = 0.1f; @@ -39,7 +39,7 @@ public class RenderMobObelisk extends RenderLiving float aggroScaling = minScaling + (maxScaling - minScaling) * monolith.getAggroProgress(); // Calculate jitter - include entity ID to give Monoliths individual jitters - float time = ((Minecraft.getSystemTime() + 0xF1234568 * monolith.entityId) % 200000) / 50.0F; + float time = ((Minecraft.getSystemTime() + 0xF1234568 * monolith.getEntityId()) % 200000) / 50.0F; // We use random constants here on purpose just to get different wave forms double xJitter = aggroScaling * Math.sin(1.1f * time) * Math.sin(0.8f * time); double yJitter = aggroScaling * Math.sin(1.2f * time) * Math.sin(0.9f * time); @@ -52,7 +52,7 @@ public class RenderMobObelisk extends RenderLiving public void render(EntityLiving par1EntityLivingBase, double x, double y, double z, float par8, float par9) { - if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre(par1EntityLivingBase, this))) return; + if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre(par1EntityLivingBase, this, x, y, z))) return; GL11.glPushMatrix(); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_LIGHTING); @@ -104,7 +104,7 @@ public class RenderMobObelisk extends RenderLiving GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glPopMatrix(); - MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post(par1EntityLivingBase, this)); + MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post(par1EntityLivingBase, this, x, y, z)); } private static float interpolateRotation(float par1, float par2, float par3) diff --git a/src/main/resources/assets/dimdoors/sounds.json b/src/main/resources/assets/dimdoors/sounds.json new file mode 100644 index 0000000..d676cc3 --- /dev/null +++ b/src/main/resources/assets/dimdoors/sounds.json @@ -0,0 +1,15 @@ +{ + "crack": {"category":"hostile", "sound":[{"name":"crack","stream":false}]}, + "creepy": {"category":"ambient", "sound":[{"name":"creepy","stream":true}]}, + "doorLocked": {"category":"player", "sound":[{"name":"doorLocked","stream":false}]}, + "doorLockRemoved": {"category":"player", "sound":[{"name":"doorLockRemoved","stream":false}]}, + "keyLock": {"category":"player", "sound":[{"name":"keyLock","stream":false}]}, + "keyUnlock": {"category":"player", "sound":[{"name":"keyUnlock", "stream":false}]}, + "monk": {"category":"hostile", "sound":[{"name":"monk", "stream":false}]}, + "rift": {"category":"master", "sound":[{"name":"rift", "stream":false}]}, + "riftClose": {"category":"player", "sound":[{"name":"riftClose", "stream":false}]}, + "riftDoor": {"category":"player", "sound":[{"name":"riftDoor", "stream":false}]}, + "riftEnd": {"category":"player", "sound":[{"name":"riftEnd", "stream":false}]}, + "riftStart": {"category":"player", "sound":[{"name":"riftStart", "stream":false}]}, + "tearing": {"category":"hostile", "sound":[{"name":"tearing", "stream":false}]} +} \ No newline at end of file