commit
fbd6cb2d13
4 changed files with 48 additions and 69 deletions
|
@ -18,25 +18,21 @@ public class BlankTeleporter extends Teleporter
|
|||
* Create a new portal near an entity.
|
||||
*/
|
||||
@Override
|
||||
public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
|
||||
public void placeInPortal(Entity par1Entity, float rotationyaw) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void setEntityPosition(Entity entity, double x, double y, double z)
|
||||
{
|
||||
public void setEntityPosition(Entity entity, double x, double y, double z) {
|
||||
entity.lastTickPosX = entity.prevPosX = entity.posX = x;
|
||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + entity.yOffset;
|
||||
entity.lastTickPosY = entity.prevPosY = entity.posY = y + entity.getYOffset();
|
||||
entity.lastTickPosZ = entity.prevPosZ = entity.posZ = z;
|
||||
entity.setPosition(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeStalePortalLocations(long par1)
|
||||
{
|
||||
public void removeStalePortalLocations(long par1) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,15 +4,15 @@ package com.zixiken.dimdoors;
|
|||
import com.zixiken.dimdoors.config.DDProperties;
|
||||
import com.zixiken.dimdoors.core.DDLock;
|
||||
import com.zixiken.dimdoors.items.behaviors.DispenserBehaviorStabilizedRS;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import com.zixiken.dimdoors.items.ItemDDKey;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class CraftingManager
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ public class CraftingManager
|
|||
{
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(DimDoors.itemWarpDoor, 1),
|
||||
"yxy", 'x', Items.ender_pearl, 'y', Items.wooden_door);
|
||||
"yxy", 'x', Items.ender_pearl, 'y', Items.oak_door);
|
||||
}
|
||||
if (properties.CraftingTransTrapdoorAllowed)
|
||||
{
|
||||
|
|
|
@ -116,9 +116,8 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
@Override
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
this.updateAttachedTile(par1World, par2, par3, par4);
|
||||
public void updateTick(World par1World, BlockPos pos, IBlockState state, Random rand) {
|
||||
this.updateAttachedTile(par1World, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -216,37 +215,29 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
* their own) Args: x, y, z, neighbor blockID
|
||||
*/
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor)
|
||||
{
|
||||
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
if (isUpperDoorBlock(metadata))
|
||||
{
|
||||
if (world.getBlock(x, y - 1, z) != this)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighbor) {
|
||||
|
||||
int metadata = getMetaFromState(world.getBlockState(pos));
|
||||
if (isUpperDoorBlock(state)) {
|
||||
if (world.getBlockState(pos.down()) != this) {
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
if (!neighbor.isAir(world, x, y, z) && neighbor != this)
|
||||
{
|
||||
this.onNeighborBlockChange(world, x, y - 1, z, neighbor);
|
||||
if (!neighbor.isAir(world, pos) && neighbor != this) {
|
||||
this.onNeighborBlockChange(world, pos.down(), state, neighbor);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (world.getBlock(x, y + 1, z) != this)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
if (!world.isRemote)
|
||||
{
|
||||
this.dropBlockAsItem(world, x, y, z, metadata, 0);
|
||||
else {
|
||||
if (world.getBlockState(pos.up()) != this) {
|
||||
world.setBlockToAir(pos);
|
||||
if (!world.isRemote) {
|
||||
this.dropBlockAsItem(world, pos, state, 0);
|
||||
}
|
||||
}
|
||||
else if(this.getLockStatus(world, x, y, z)<=1)
|
||||
{
|
||||
boolean powered = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z);
|
||||
if ((powered || !neighbor.isAir(world, x, y, z) && neighbor.canProvidePower()) && neighbor != this)
|
||||
else if(this.getLockStatus(world, pos)<=1) {
|
||||
boolean powered = world.isBlockPowered(pos) || world.isBlockPowered(pos.up());
|
||||
if ((powered || !neighbor.isAir(world, pos) && neighbor.canProvidePower()) && neighbor != this)
|
||||
{
|
||||
this.func_150014_a(world, x, y, z, powered);
|
||||
this.toggleDoor(world, pos, powered);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -257,8 +248,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
*/
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player)
|
||||
{
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(this.getDoorItem(), 1, 0);
|
||||
}
|
||||
|
||||
|
@ -266,14 +256,13 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
* Returns the ID of the items to drop on destruction.
|
||||
*/
|
||||
@Override
|
||||
public Item getItemDropped(int metadata, Random random, int fortune)
|
||||
{
|
||||
return isUpperDoorBlock(metadata) ? null : this.getDoorItem();
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune) {
|
||||
return isUpperDoorBlock(state) ? null : this.getDoorItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z) {
|
||||
public Item getItem(World world, BlockPos pos) {
|
||||
return this.getDoorItem();
|
||||
}
|
||||
|
||||
|
@ -284,17 +273,14 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
}
|
||||
|
||||
@Override
|
||||
public void enterDimDoor(World world, BlockPos pos, Entity entity)
|
||||
{
|
||||
public void enterDimDoor(World world, BlockPos pos, Entity entity) {
|
||||
// FX entities dont exist on the server
|
||||
if (world.isRemote)
|
||||
{
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check that this is the top block of the door
|
||||
if (world.getBlock(x, y - 1, z) == this)
|
||||
{
|
||||
if (world.getBlock(x, y - 1, z) == this) {
|
||||
int metadata = world.getBlockMetadata(x, y - 1, z);
|
||||
boolean canUse = isDoorOpen(metadata);
|
||||
if (canUse && entity instanceof EntityPlayer)
|
||||
|
@ -345,9 +331,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
* 1 if there is a lock;
|
||||
* 2 if the lock is locked.
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param pos
|
||||
* @return
|
||||
*/
|
||||
public byte getLockStatus(World world, BlockPos pos)
|
||||
|
@ -396,7 +380,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
}
|
||||
}
|
||||
}
|
||||
player.playSound(DimDoors.modid + ":doorLocked", 1F, 1F);
|
||||
player.playSound(DimDoors.MODID + ":doorLocked", 1F, 1F);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -411,19 +395,18 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
}
|
||||
|
||||
@Override
|
||||
public TileEntity initDoorTE(World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity te = this.createNewTileEntity(world, world.getBlockMetadata(x, y, z));
|
||||
world.setTileEntity(x, y, z, te);
|
||||
public TileEntity initDoorTE(World world, BlockPos pos) {
|
||||
TileEntity te = this.createTileEntity(world, world.getBlockState(pos));
|
||||
world.setTileEntity(pos, te);
|
||||
return te;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block oldBlock, int oldMeta)
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
// This function runs on the server side after a block is replaced
|
||||
// We MUST call super.breakBlock() since it involves removing tile entities
|
||||
super.breakBlock(world, x, y, z, oldBlock, oldMeta);
|
||||
super.breakBlock(world, pos, state);
|
||||
|
||||
// Schedule rift regeneration for this block if it was replaced
|
||||
if (world.getBlock(x, y, z) != oldBlock)
|
||||
|
|
|
@ -22,9 +22,9 @@ import com.zixiken.dimdoors.util.Point4D;
|
|||
import com.zixiken.dimdoors.watcher.ClientDimData;
|
||||
import com.zixiken.dimdoors.watcher.ClientLinkData;
|
||||
import com.zixiken.dimdoors.watcher.UpdateWatcherProxy;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* This class regulates all the operations involving the storage and
|
||||
|
@ -451,7 +451,7 @@ public class PocketManager
|
|||
|
||||
public static NewDimData registerDimension(World world)
|
||||
{
|
||||
return registerDimension(world.provider.dimensionId, null, DimensionType.ROOT);
|
||||
return registerDimension(world.provider.getDimensionId(), null, DimensionType.ROOT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -588,12 +588,12 @@ public class PocketManager
|
|||
|
||||
public static NewDimData getDimensionData(World dimension)
|
||||
{
|
||||
return PocketManager.dimensionData.get(dimension.provider.dimensionId);
|
||||
return PocketManager.dimensionData.get(dimension.provider.getDimensionId());
|
||||
}
|
||||
|
||||
public static NewDimData createDimensionData(World world)
|
||||
{
|
||||
return createDimensionData(world.provider.dimensionId);
|
||||
return createDimensionData(world.provider.getDimensionId());
|
||||
}
|
||||
|
||||
public static NewDimData createDimensionDataDangerously(int dimensionID)
|
||||
|
@ -658,7 +658,7 @@ public class PocketManager
|
|||
|
||||
public static DimLink getLink(int x, int y, int z, World world)
|
||||
{
|
||||
return getLink(x, y, z, world.provider.dimensionId);
|
||||
return getLink(x, y, z, world.provider.getDimensionId());
|
||||
}
|
||||
|
||||
public static DimLink getLink(Point4D point)
|
||||
|
|
Loading…
Reference in a new issue