Fix EyeHeight variance between client and server in part placement.

This commit is contained in:
AlgorithmX2
2014-08-18 16:12:45 -05:00
parent fd162625ee
commit 1b1c962bab
4 changed files with 35 additions and 15 deletions
+6 -2
View File
@@ -16,6 +16,7 @@ public class PacketPartPlacement extends AppEngPacket
{
int x, y, z, face;
float eyeHeight;
// automatic.
public PacketPartPlacement(ByteBuf stream) throws IOException {
@@ -23,6 +24,7 @@ public class PacketPartPlacement extends AppEngPacket
y = stream.readInt();
z = stream.readInt();
face = stream.readByte();
eyeHeight = stream.readFloat();
}
@Override
@@ -30,12 +32,13 @@ public class PacketPartPlacement extends AppEngPacket
{
EntityPlayerMP sender = (EntityPlayerMP) player;
CommonHelper.proxy.updateRenderMode( sender );
PartPlacement.eyeHeight = eyeHeight;
PartPlacement.place( sender.getHeldItem(), x, y, z, face, sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
CommonHelper.proxy.updateRenderMode( null );
}
// api
public PacketPartPlacement(int x, int y, int z, int face) throws IOException {
public PacketPartPlacement(int x, int y, int z, int face, float eyeHeight ) throws IOException {
ByteBuf data = Unpooled.buffer();
@@ -44,7 +47,8 @@ public class PacketPartPlacement extends AppEngPacket
data.writeInt( y );
data.writeInt( z );
data.writeByte( face );
data.writeFloat( eyeHeight );
configureWrite( data );
}