Fix sounds & last of the low-hanging fruit

This commit is contained in:
CannibalVox 2015-03-04 04:09:48 -06:00
parent fe40edf200
commit c075079630
20 changed files with 264 additions and 285 deletions

View file

@ -64,7 +64,7 @@ public class DimData implements Serializable
{
while (k<range)
{
if (world.getBlockId(x+i, y+j, z+k) == properties.RiftBlockID && MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance)
if (world.getBlock(x+i, y+j, z+k) == mod_pocketDim.blockRift && MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)<distance)
{
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0)
{
@ -104,7 +104,7 @@ public class DimData implements Serializable
{
while (k<range)
{
if(world.getBlockId(x+i, y+j, z+k)==properties.RiftBlockID)
if(world.getBlock(x+i, y+j, z+k)==mod_pocketDim.blockRift)
{
if(MathHelper.abs(i)+MathHelper.abs(j)+MathHelper.abs(k)!=0)
{

View file

@ -1,17 +1,23 @@
package StevenDimDoors.mod_pocketDim;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.audio.SoundManager;
import net.minecraft.client.audio.SoundPoolEntry;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.client.event.sound.PlayBackgroundMusicEvent;
import net.minecraftforge.client.event.sound.PlaySoundEvent17;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingFallEvent;
@ -45,9 +51,12 @@ public class EventHookContainer
private DDWorldProperties worldProperties;
private RiftRegenerator regenerator;
private ISound limboMusic;
public EventHookContainer(DDProperties properties)
{
this.properties = properties;
this.limboMusic = PositionedSoundRecord.func_147673_a(new ResourceLocation(mod_pocketDim.modid + ":creepy"));
}
public void setSessionFields(DDWorldProperties worldProperties, RiftRegenerator regenerator)
@ -75,31 +84,20 @@ public class EventHookContainer
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onSoundLoad(SoundLoadEvent event)
public void onSoundEffectResult(PlaySoundEvent17 event)
{
event.manager.addSound(mod_pocketDim.modid + ":doorLockRemoved.ogg");
event.manager.addSound(mod_pocketDim.modid + ":doorLocked.ogg");
event.manager.addSound(mod_pocketDim.modid + ":keyLock.ogg");
event.manager.addSound(mod_pocketDim.modid + ":keyUnlock.ogg");
event.manager.addSound(mod_pocketDim.modid + ":monk.ogg");
event.manager.addSound(mod_pocketDim.modid + ":crack.ogg");
event.manager.addSound(mod_pocketDim.modid + ":tearing.ogg");
event.manager.addSound(mod_pocketDim.modid + ":rift.ogg");
event.manager.addSound(mod_pocketDim.modid + ":riftStart.ogg");
event.manager.addSound(mod_pocketDim.modid + ":riftEnd.ogg");
event.manager.addSound(mod_pocketDim.modid + ":riftClose.ogg");
event.manager.addSound(mod_pocketDim.modid + ":riftDoor.ogg");
event.manager.addSound(mod_pocketDim.modid + ":creepy.ogg");
}
ResourceLocation playingSound = event.sound.getPositionedSoundLocation();
if (playingSound != null && playingSound.getResourceDomain().equals("minecraft") && playingSound.getResourcePath().equals("music.game")) {
if (FMLClientHandler.instance().getClient().thePlayer.worldObj.provider.dimensionId == mod_pocketDim.properties.LimboDimensionID) {
ResourceLocation sound = new ResourceLocation(mod_pocketDim.modid + ":creepy");
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onSoundEffectResult(PlayBackgroundMusicEvent event)
{
if (FMLClientHandler.instance().getClient().thePlayer.worldObj.provider.dimensionId == mod_pocketDim.properties.LimboDimensionID)
{
this.playMusicForDim(FMLClientHandler.instance().getClient().thePlayer.worldObj);
}
if (!Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(limboMusic)) {
event.result = limboMusic;
} else {
event.setResult(Event.Result.DENY);
}
}
}
}
@SubscribeEvent
@ -147,10 +145,10 @@ public class EventHookContainer
PocketManager.load();
}
if (event.world != null)
{
this.playMusicForDim(event.world);
}
if (FMLClientHandler.instance().getClient().thePlayer.worldObj.provider.dimensionId == mod_pocketDim.properties.LimboDimensionID &&
!Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(limboMusic)) {
Minecraft.getMinecraft().getSoundHandler().playSound(limboMusic);
}
}
@SubscribeEvent
@ -210,7 +208,7 @@ public class EventHookContainer
if (properties.LimboEnabled && !properties.LimboReturnsInventoryEnabled)
{
player.inventory.clearInventory(-1, -1);
player.inventory.clearInventory(null, -1);
revivePlayerInLimbo(player);
event.setCanceled(true);
}
@ -272,33 +270,4 @@ public class EventHookContainer
}
}
}
public void playMusicForDim(World world)
{
if (world.isRemote)
{
SoundManager sndManager = FMLClientHandler.instance().getClient().sndManager;
// SenseiKiwi: I've added the following check as a quick fix for a
// reported crash. This needs to work without a hitch or we have to
// stop trying to replace the background music...
if (sndManager != null && sndManager.sndSystem != null)
{
if (world.provider instanceof LimboProvider)
{
sndManager.sndSystem.stop("BgMusic");
SoundPoolEntry soundPoolEntry = sndManager.soundPoolSounds.getRandomSoundFromSoundPool(mod_pocketDim.modid + ":creepy");
if (soundPoolEntry != null)
{
sndManager.sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.getSoundUrl(), soundPoolEntry.getSoundName(), false);
sndManager.sndSystem.play("LimboMusic");
}
}
else if (!(world.provider instanceof LimboProvider))
{
sndManager.sndSystem.stop("LimboMusic");
}
}
}
}
}

View file

@ -56,7 +56,7 @@ public class CommandCreateRandomRift extends DDCommandBase
dimension = PocketManager.getDimensionData(sender.worldObj);
link = dimension.createLink(x, y + 1, z, LinkType.DUNGEON, orientation);
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift.blockID, 0, 3);
sender.worldObj.setBlock(x, y + 1, z,mod_pocketDim.blockRift, 0, 3);
sendChat(sender, "Created a rift to a random dungeon.");
}
else
@ -76,7 +76,7 @@ public class CommandCreateRandomRift extends DDCommandBase
if (PocketBuilder.generateSelectedDungeonPocket(link, mod_pocketDim.properties, result))
{
// Create a rift to our selected dungeon and notify the player
sender.worldObj.setBlock(x, y + 1, z, mod_pocketDim.blockRift.blockID, 0, 3);
sender.worldObj.setBlock(x, y + 1, z, mod_pocketDim.blockRift, 0, 3);
sendChat(sender, "Created a rift to \"" + result.schematicName() + "\" dungeon (Dimension ID = " + link.destination().getDimension() + ").");
}
else

View file

@ -71,7 +71,7 @@ public class CommandDeleteRifts extends DDCommandBase
x = location.getX();
y = location.getY();
z = location.getZ();
if (world.getBlockId(x, y, z) == mod_pocketDim.blockRift.blockID)
if (world.getBlock(x, y, z) == mod_pocketDim.blockRift)
{
// Remove the rift and its link
world.setBlockToAir(x, y, z);

View file

@ -62,7 +62,7 @@ public class CommandTeleportPlayer extends DDCommandBase
}
}
// Check if the target player is logged in
targetPlayer = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(command[0]);
targetPlayer = MinecraftServer.getServer().getConfigurationManager().func_152612_a(command[0]);
if (targetPlayer == null)
{
return DDCommandResult.PLAYER_OFFLINE;

View file

@ -3,10 +3,11 @@ package StevenDimDoors.mod_pocketDim.helpers;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
public class BlockRotationHelper
{
public HashMap<Integer,HashMap<Integer,HashMap<Integer,Integer>>> rotationMappings = new HashMap<Integer,HashMap<Integer,HashMap<Integer,Integer>>>();
public HashMap<Integer,HashMap<Block,HashMap<Integer,Integer>>> rotationMappings = new HashMap<Integer,HashMap<Block,HashMap<Integer,Integer>>>();
public BlockRotationHelper()
{
@ -15,7 +16,7 @@ public class BlockRotationHelper
public void InitializeRotationMap()
{
HashMap<Integer,HashMap<Integer, Integer>> orientation0 = new HashMap<Integer,HashMap<Integer, Integer>>();
HashMap<Block,HashMap<Integer, Integer>> orientation0 = new HashMap<Block,HashMap<Integer, Integer>>();
HashMap<Integer,Integer> stairs0 = new HashMap<Integer,Integer>();
@ -99,7 +100,7 @@ public class BlockRotationHelper
railsSpecial0.put(9, 8);
HashMap<Integer,HashMap<Integer, Integer>> orientation1 = new HashMap<Integer,HashMap<Integer, Integer>>();
HashMap<Block,HashMap<Integer, Integer>> orientation1 = new HashMap<Block,HashMap<Integer, Integer>>();
HashMap<Integer,Integer> stairs1 = new HashMap<Integer,Integer>();
@ -183,7 +184,7 @@ public class BlockRotationHelper
railsSpecial1.put(8, 8);
railsSpecial1.put(9, 9);
HashMap<Integer,HashMap<Integer, Integer>> orientation2 = new HashMap<Integer,HashMap<Integer, Integer>>();
HashMap<Block,HashMap<Integer, Integer>> orientation2 = new HashMap<Block,HashMap<Integer, Integer>>();
HashMap<Integer,Integer> stairs2 = new HashMap<Integer,Integer>();
@ -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);

View file

@ -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);

View file

@ -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;
}

View file

@ -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();
}

View file

@ -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

View file

@ -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

View file

@ -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);
}
}
}

View file

@ -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.

View file

@ -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

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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);
}
}
}

View file

@ -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);
}
}

View file

@ -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)

View file

@ -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}]}
}