Door tile entities are in the top block now.

Fixed 3 block high render.
This commit is contained in:
zangamj 2016-08-23 17:52:49 -04:00
parent 705b2963ee
commit 2ab27633cd
3 changed files with 16 additions and 17 deletions

View file

@ -71,10 +71,9 @@ public class CommonProxy {
public void updateDoorTE(BaseDimDoor door, World world, BlockPos pos) { public void updateDoorTE(BaseDimDoor door, World world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos); TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileEntityDimDoor) { if (tile instanceof TileEntityDimDoor) {
IBlockState state = world.getBlockState(pos);
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile; TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
dimTile.openOrClosed = door.isDoorOnRift(world, pos) && !door.isUpperDoorBlock(state); dimTile.openOrClosed = door.isDoorOnRift(world, pos) && door.isUpperDoorBlock(world.getBlockState(pos));
dimTile.orientation = state.getValue(BlockDoor.FACING).rotateY(); dimTile.orientation = world.getBlockState(pos.down()).getValue(BlockDoor.FACING).rotateY();
//if(state.getValue(BlockDoor.OPEN)) dimTile.orientation |= 4; //if(state.getValue(BlockDoor.OPEN)) dimTile.orientation |= 4;
dimTile.lockStatus = door.getLockStatus(world, pos); dimTile.lockStatus = door.getLockStatus(world, pos);
} }

View file

@ -65,15 +65,15 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
} }
@Override @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 @Override
public void onBlockAdded(World world, BlockPos pos, IBlockState state) { public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
if(state.getValue(BlockDoor.HALF) == EnumDoorHalf.UPPER) placeLink(world, pos); if(state.getValue(BlockDoor.HALF) == EnumDoorHalf.UPPER) {
else { placeLink(world, pos);
world.setTileEntity(pos, createNewTileEntity(world, 0)); world.setTileEntity(pos, createNewTileEntity(world, 0));
updateAttachedTile(world, pos); updateAttachedTile(world, pos);
} }
} }
//Called to update the render information on the tile entity. Could probably implement a data watcher, //Called to update the render information on the tile entity. Could probably implement a data watcher,

View file

@ -139,26 +139,26 @@ public class RenderDimDoor extends TileEntitySpecialRenderer<TileEntityDimDoor>
case SOUTH: case SOUTH:
worldRenderer.pos(x + .01, y - 1, z).endVertex(); worldRenderer.pos(x + .01, y - 1, z).endVertex();
worldRenderer.pos(x + .01, y - 1, z + 1.0D).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 + 1, z + 1.0D).endVertex();
worldRenderer.pos(x + .01, y + 2, z).endVertex(); worldRenderer.pos(x + .01, y + 1, z).endVertex();
break; break;
case WEST: case WEST:
worldRenderer.pos(x, y + 2, z + .01).endVertex(); worldRenderer.pos(x, y + 1, z + .01).endVertex();
worldRenderer.pos(x + 1, y + 2, z + .01).endVertex(); worldRenderer.pos(x + 1, 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(); worldRenderer.pos(x, y -1, z + .01).endVertex();
break; break;
case NORTH: case NORTH:
worldRenderer.pos(x + .99, y + 2, z).endVertex(); worldRenderer.pos(x + .99, y + 1, z).endVertex();
worldRenderer.pos(x + .99, y + 2, z + 1.0D).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 + 1.0D).endVertex();
worldRenderer.pos(x + .99, y - 1, z).endVertex(); worldRenderer.pos(x + .99, y - 1, z).endVertex();
break; break;
case EAST: case EAST:
worldRenderer.pos(x, y -1, z + .99).endVertex(); worldRenderer.pos(x, y -1, z + .99).endVertex();
worldRenderer.pos(x + 1, 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 + 1, y + 1, z + .99).endVertex();
worldRenderer.pos(x, y + 2, z + .99).endVertex(); worldRenderer.pos(x, y + 1, z + .99).endVertex();
break; break;
/*case 4: /*case 4:
GL11.glVertex3d(x + .15F, y - 1 , z); GL11.glVertex3d(x + .15F, y - 1 , z);