Can now place doors.
This commit is contained in:
parent
7a4acad1a5
commit
59fddb6116
2 changed files with 9 additions and 12 deletions
|
@ -171,17 +171,17 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
||||||
@Override
|
@Override
|
||||||
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighbor) {
|
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighbor) {
|
||||||
if (isUpperDoorBlock(state)) {
|
if (isUpperDoorBlock(state)) {
|
||||||
if (world.getBlockState(pos.down()) != this)
|
BlockPos downPos = pos.down();
|
||||||
world.setBlockToAir(pos);
|
IBlockState downState = world.getBlockState(downPos);
|
||||||
if (!neighbor.isAir(world, pos) && neighbor != this)
|
if (downState.getBlock() != this) world.setBlockToAir(pos);
|
||||||
onNeighborBlockChange(world, pos.down(), state, neighbor);
|
else if (neighbor != this) onNeighborBlockChange(world, downPos, downState, neighbor);
|
||||||
} else {
|
} else {
|
||||||
if (world.getBlockState(pos.up()) != this) {
|
BlockPos upPos = pos.up();
|
||||||
|
if (world.getBlockState(upPos).getBlock() != this) {
|
||||||
world.setBlockToAir(pos);
|
world.setBlockToAir(pos);
|
||||||
if (!world.isRemote) dropBlockAsItem(world, pos, state, 0);
|
if (!world.isRemote) dropBlockAsItem(world, pos, state, 0);
|
||||||
}
|
} else if(this.getLockStatus(world, pos) <= 1) {
|
||||||
else if(this.getLockStatus(world, pos)<=1) {
|
boolean powered = world.isBlockPowered(pos) || world.isBlockPowered(upPos);
|
||||||
boolean powered = world.isBlockPowered(pos) || world.isBlockPowered(pos.up());
|
|
||||||
if ((powered || !neighbor.isAir(world, pos) && neighbor.canProvidePower()) && neighbor != this)
|
if ((powered || !neighbor.isAir(world, pos) && neighbor.canProvidePower()) && neighbor != this)
|
||||||
toggleDoor(world, pos, powered);
|
toggleDoor(world, pos, powered);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,5 @@ public class DimensionalDoor extends BaseDimDoor {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getDoorItem()
|
public Item getDoorItem() {return DimDoors.itemDimensionalDoor;}
|
||||||
{
|
|
||||||
return DimDoors.itemDimensionalDoor;
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue