Fix rifts not rendering, fix rifts not closing, door blocks not synched
This commit is contained in:
parent
4d26a2ec31
commit
76d2f20f5d
5 changed files with 32 additions and 29 deletions
|
@ -140,7 +140,7 @@ public class CommonProxy implements IGuiHandler
|
|||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
|
||||
dimTile.openOrClosed = door.isDoorOnRift(world, x, y, z)&&door.isUpperDoorBlock(metadata);
|
||||
dimTile.orientation = world.getBlockMetadata(x,y,z) & 7;
|
||||
dimTile.orientation = door.func_150012_g(world, x,y,z) & 7;
|
||||
dimTile.lockStatus = door.getLockStatus(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,25 +90,22 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
return false;
|
||||
}
|
||||
|
||||
final int MAGIC_CONSTANT = 1003;
|
||||
int metadata = this.func_150012_g(world, x, y, z);
|
||||
int newMetadata = metadata & 7;
|
||||
newMetadata ^= 4;
|
||||
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
int lowMeta = metadata & 7;
|
||||
lowMeta ^= 4;
|
||||
|
||||
if (isUpperDoorBlock(metadata))
|
||||
if ((metadata & 8) == 0)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y - 1, z, lowMeta, 2);
|
||||
world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z);
|
||||
world.setBlockMetadataWithNotify(x, y, z, newMetadata, 2);
|
||||
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, lowMeta, 2);
|
||||
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
|
||||
world.setBlockMetadataWithNotify(x, y - 1, z, newMetadata, 2);
|
||||
world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z);
|
||||
}
|
||||
|
||||
world.playAuxSFXAtEntity(player, MAGIC_CONSTANT, x, y, z, 0);
|
||||
|
||||
world.playAuxSFXAtEntity(player, 1003, x, y, z, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -129,7 +126,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
{
|
||||
if (side != 1 && side != 0)
|
||||
{
|
||||
int fullMetadata = blockAccess.getBlockMetadata(x, y, z);
|
||||
int fullMetadata = func_150012_g(blockAccess, x, y, z);
|
||||
int orientation = fullMetadata & 3;
|
||||
boolean reversed = false;
|
||||
|
||||
|
@ -246,7 +243,7 @@ public abstract class BaseDimDoor extends BlockDoor implements IDimDoor, ITileEn
|
|||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
||||
{
|
||||
this.setDoorRotation(par1IBlockAccess.getBlockMetadata(par2, par3, par4));
|
||||
this.setDoorRotation(func_150012_g(par1IBlockAccess, par2, par3, par4));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -33,22 +33,28 @@ public class TileEntityDimDoor extends DDTileEntityBase
|
|||
@Override
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
writeToNBT(tag);
|
||||
if(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj)!=null)
|
||||
{
|
||||
ClientLinkData linkData = new ClientLinkData(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj));
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
linkData.writeToNBT(tag);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tag);
|
||||
NBTTagCompound link = new NBTTagCompound();
|
||||
linkData.writeToNBT(link);
|
||||
tag.setTag("Link", link);
|
||||
}
|
||||
return null;
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound tag = pkt.func_148857_g();
|
||||
ClientLinkData linkData = ClientLinkData.readFromNBT(tag);
|
||||
readFromNBT(tag);
|
||||
|
||||
if (tag.hasKey("Link")) {
|
||||
ClientLinkData linkData = ClientLinkData.readFromNBT(tag.getCompoundTag("Link"));
|
||||
PocketManager.getLinkWatcher().onCreated(linkData);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
|
|
|
@ -164,7 +164,7 @@ public class TileEntityRift extends DDTileEntityBase
|
|||
}
|
||||
}
|
||||
}
|
||||
if (growth == 0 && !worldObj.isRemote)
|
||||
if (growth <= 0 && !worldObj.isRemote)
|
||||
{
|
||||
DimLink link = PocketManager.getLink(this.xCoord, this.yCoord, this.zCoord, worldObj);
|
||||
if (link != null)
|
||||
|
|
|
@ -40,7 +40,7 @@ public class ClientProxy extends CommonProxy
|
|||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
TileEntityDimDoor dimTile = (TileEntityDimDoor) tile;
|
||||
dimTile.openOrClosed = door.isDoorOnRift(world, x, y, z)&&door.isUpperDoorBlock(metadata);
|
||||
dimTile.orientation = world.getBlockMetadata(x, y, z) & 7;
|
||||
dimTile.orientation = door.func_150012_g(world, x, y, z) & 7;
|
||||
dimTile.lockStatus = door.getLockStatus(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue