initial commit
This commit is contained in:
parent
3c9ee26b06
commit
22186c33b9
1458 changed files with 282792 additions and 0 deletions
208
java/src/game/packet/S14PacketEntity.java
Executable file
208
java/src/game/packet/S14PacketEntity.java
Executable file
|
@ -0,0 +1,208 @@
|
|||
package game.packet;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import game.entity.Entity;
|
||||
import game.network.NetHandlerPlayClient;
|
||||
import game.network.Packet;
|
||||
import game.network.PacketBuffer;
|
||||
import game.world.World;
|
||||
|
||||
public class S14PacketEntity implements Packet<NetHandlerPlayClient>
|
||||
{
|
||||
protected int entityId;
|
||||
protected byte posX;
|
||||
protected byte posY;
|
||||
protected byte posZ;
|
||||
protected byte yaw;
|
||||
protected byte pitch;
|
||||
protected boolean onGround;
|
||||
protected boolean field_149069_g;
|
||||
|
||||
public S14PacketEntity()
|
||||
{
|
||||
}
|
||||
|
||||
public S14PacketEntity(int entityIdIn)
|
||||
{
|
||||
this.entityId = entityIdIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the raw packet data from the data stream.
|
||||
*/
|
||||
public void readPacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
this.entityId = buf.readVarIntFromBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the raw packet data to the data stream.
|
||||
*/
|
||||
public void writePacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
buf.writeVarIntToBuffer(this.entityId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Passes this Packet on to the NetHandler for processing.
|
||||
*/
|
||||
public void processPacket(NetHandlerPlayClient handler)
|
||||
{
|
||||
handler.handleEntityMovement(this);
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "Entity_" + super.toString();
|
||||
}
|
||||
|
||||
public Entity getEntity(World worldIn)
|
||||
{
|
||||
return worldIn.getEntityByID(this.entityId);
|
||||
}
|
||||
|
||||
public byte func_149062_c()
|
||||
{
|
||||
return this.posX;
|
||||
}
|
||||
|
||||
public byte func_149061_d()
|
||||
{
|
||||
return this.posY;
|
||||
}
|
||||
|
||||
public byte func_149064_e()
|
||||
{
|
||||
return this.posZ;
|
||||
}
|
||||
|
||||
public byte func_149066_f()
|
||||
{
|
||||
return this.yaw;
|
||||
}
|
||||
|
||||
public byte func_149063_g()
|
||||
{
|
||||
return this.pitch;
|
||||
}
|
||||
|
||||
public boolean func_149060_h()
|
||||
{
|
||||
return this.field_149069_g;
|
||||
}
|
||||
|
||||
public boolean getOnGround()
|
||||
{
|
||||
return this.onGround;
|
||||
}
|
||||
|
||||
public static class S15PacketEntityRelMove extends S14PacketEntity
|
||||
{
|
||||
public S15PacketEntityRelMove()
|
||||
{
|
||||
}
|
||||
|
||||
public S15PacketEntityRelMove(int entityIdIn, byte x, byte y, byte z, boolean onGroundIn)
|
||||
{
|
||||
super(entityIdIn);
|
||||
this.posX = x;
|
||||
this.posY = y;
|
||||
this.posZ = z;
|
||||
this.onGround = onGroundIn;
|
||||
}
|
||||
|
||||
public void readPacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
super.readPacketData(buf);
|
||||
this.posX = buf.readByte();
|
||||
this.posY = buf.readByte();
|
||||
this.posZ = buf.readByte();
|
||||
this.onGround = buf.readBoolean();
|
||||
}
|
||||
|
||||
public void writePacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
super.writePacketData(buf);
|
||||
buf.writeByte(this.posX);
|
||||
buf.writeByte(this.posY);
|
||||
buf.writeByte(this.posZ);
|
||||
buf.writeBoolean(this.onGround);
|
||||
}
|
||||
}
|
||||
|
||||
public static class S16PacketEntityLook extends S14PacketEntity
|
||||
{
|
||||
public S16PacketEntityLook()
|
||||
{
|
||||
this.field_149069_g = true;
|
||||
}
|
||||
|
||||
public S16PacketEntityLook(int entityIdIn, byte yawIn, byte pitchIn, boolean onGroundIn)
|
||||
{
|
||||
super(entityIdIn);
|
||||
this.yaw = yawIn;
|
||||
this.pitch = pitchIn;
|
||||
this.field_149069_g = true;
|
||||
this.onGround = onGroundIn;
|
||||
}
|
||||
|
||||
public void readPacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
super.readPacketData(buf);
|
||||
this.yaw = buf.readByte();
|
||||
this.pitch = buf.readByte();
|
||||
this.onGround = buf.readBoolean();
|
||||
}
|
||||
|
||||
public void writePacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
super.writePacketData(buf);
|
||||
buf.writeByte(this.yaw);
|
||||
buf.writeByte(this.pitch);
|
||||
buf.writeBoolean(this.onGround);
|
||||
}
|
||||
}
|
||||
|
||||
public static class S17PacketEntityLookMove extends S14PacketEntity
|
||||
{
|
||||
public S17PacketEntityLookMove()
|
||||
{
|
||||
this.field_149069_g = true;
|
||||
}
|
||||
|
||||
public S17PacketEntityLookMove(int p_i45973_1_, byte p_i45973_2_, byte p_i45973_3_, byte p_i45973_4_, byte p_i45973_5_, byte p_i45973_6_, boolean p_i45973_7_)
|
||||
{
|
||||
super(p_i45973_1_);
|
||||
this.posX = p_i45973_2_;
|
||||
this.posY = p_i45973_3_;
|
||||
this.posZ = p_i45973_4_;
|
||||
this.yaw = p_i45973_5_;
|
||||
this.pitch = p_i45973_6_;
|
||||
this.onGround = p_i45973_7_;
|
||||
this.field_149069_g = true;
|
||||
}
|
||||
|
||||
public void readPacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
super.readPacketData(buf);
|
||||
this.posX = buf.readByte();
|
||||
this.posY = buf.readByte();
|
||||
this.posZ = buf.readByte();
|
||||
this.yaw = buf.readByte();
|
||||
this.pitch = buf.readByte();
|
||||
this.onGround = buf.readBoolean();
|
||||
}
|
||||
|
||||
public void writePacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
super.writePacketData(buf);
|
||||
buf.writeByte(this.posX);
|
||||
buf.writeByte(this.posY);
|
||||
buf.writeByte(this.posZ);
|
||||
buf.writeByte(this.yaw);
|
||||
buf.writeByte(this.pitch);
|
||||
buf.writeBoolean(this.onGround);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue