Door tile entities are in the top block now.
Fixed 3 block high render.
This commit is contained in:
parent
705b2963ee
commit
2ab27633cd
3 changed files with 16 additions and 17 deletions
|
@ -71,10 +71,9 @@ public class CommonProxy {
|
|||
public void updateDoorTE(BaseDimDoor door, World world, BlockPos pos) {
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityDimDoor) {
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
|
||||
dimTile.openOrClosed = door.isDoorOnRift(world, pos) && !door.isUpperDoorBlock(state);
|
||||
dimTile.orientation = state.getValue(BlockDoor.FACING).rotateY();
|
||||
dimTile.openOrClosed = door.isDoorOnRift(world, pos) && door.isUpperDoorBlock(world.getBlockState(pos));
|
||||
dimTile.orientation = world.getBlockState(pos.down()).getValue(BlockDoor.FACING).rotateY();
|
||||
//if(state.getValue(BlockDoor.OPEN)) dimTile.orientation |= 4;
|
||||
dimTile.lockStatus = door.getLockStatus(world, pos);
|
||||
}
|
||||
|
|
|
@ -65,15 +65,15 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state) {return state.getValue(BlockDoor.HALF) == EnumDoorHalf.LOWER;}
|
||||
public boolean hasTileEntity(IBlockState state) {return state.getValue(BlockDoor.HALF) == EnumDoorHalf.UPPER;}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
|
||||
if(state.getValue(BlockDoor.HALF) == EnumDoorHalf.UPPER) placeLink(world, pos);
|
||||
else {
|
||||
world.setTileEntity(pos, createNewTileEntity(world, 0));
|
||||
updateAttachedTile(world, pos);
|
||||
}
|
||||
if(state.getValue(BlockDoor.HALF) == EnumDoorHalf.UPPER) {
|
||||
placeLink(world, pos);
|
||||
world.setTileEntity(pos, createNewTileEntity(world, 0));
|
||||
updateAttachedTile(world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
//Called to update the render information on the tile entity. Could probably implement a data watcher,
|
||||
|
|
|
@ -139,26 +139,26 @@ public class RenderDimDoor extends TileEntitySpecialRenderer<TileEntityDimDoor>
|
|||
case SOUTH:
|
||||
worldRenderer.pos(x + .01, y - 1, z).endVertex();
|
||||
worldRenderer.pos(x + .01, y - 1, z + 1.0D).endVertex();
|
||||
worldRenderer.pos(x + .01, y + 2, z + 1.0D).endVertex();
|
||||
worldRenderer.pos(x + .01, y + 2, z).endVertex();
|
||||
worldRenderer.pos(x + .01, y + 1, z + 1.0D).endVertex();
|
||||
worldRenderer.pos(x + .01, y + 1, z).endVertex();
|
||||
break;
|
||||
case WEST:
|
||||
worldRenderer.pos(x, y + 2, z + .01).endVertex();
|
||||
worldRenderer.pos(x + 1, y + 2, z + .01).endVertex();
|
||||
worldRenderer.pos(x, y + 1, z + .01).endVertex();
|
||||
worldRenderer.pos(x + 1, y + 1, z + .01).endVertex();
|
||||
worldRenderer.pos(x + 1, y -1, z + .01).endVertex();
|
||||
worldRenderer.pos(x, y -1, z + .01).endVertex();
|
||||
break;
|
||||
case NORTH:
|
||||
worldRenderer.pos(x + .99, y + 2, z).endVertex();
|
||||
worldRenderer.pos(x + .99, y + 2, z + 1.0D).endVertex();
|
||||
worldRenderer.pos(x + .99, y + 1, z).endVertex();
|
||||
worldRenderer.pos(x + .99, y + 1, z + 1.0D).endVertex();
|
||||
worldRenderer.pos(x + .99, y - 1, z + 1.0D).endVertex();
|
||||
worldRenderer.pos(x + .99, y - 1, z).endVertex();
|
||||
break;
|
||||
case EAST:
|
||||
worldRenderer.pos(x, y -1, z + .99).endVertex();
|
||||
worldRenderer.pos(x + 1, y -1, z + .99).endVertex();
|
||||
worldRenderer.pos(x + 1, y + 2, z + .99).endVertex();
|
||||
worldRenderer.pos(x, y + 2, z + .99).endVertex();
|
||||
worldRenderer.pos(x + 1, y + 1, z + .99).endVertex();
|
||||
worldRenderer.pos(x, y + 1, z + .99).endVertex();
|
||||
break;
|
||||
/*case 4:
|
||||
GL11.glVertex3d(x + .15F, y - 1 , z);
|
||||
|
|
Loading…
Reference in a new issue