diff options
author | EvilSeph <evilseph@gmail.com> | 2012-04-19 22:47:26 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-04-21 00:44:31 -0400 |
commit | 3e15a6911f1a2b6ff9401a3c6058d3c361b0fb17 (patch) | |
tree | 1f0a32bcdeab43ee1eec570ed32f79a38870d64f | |
parent | e28ae3f2fe4b6eef34b656ee3417637677016025 (diff) | |
download | craftbukkit-3e15a6911f1a2b6ff9401a3c6058d3c361b0fb17.tar craftbukkit-3e15a6911f1a2b6ff9401a3c6058d3c361b0fb17.tar.gz craftbukkit-3e15a6911f1a2b6ff9401a3c6058d3c361b0fb17.tar.lz craftbukkit-3e15a6911f1a2b6ff9401a3c6058d3c361b0fb17.tar.xz craftbukkit-3e15a6911f1a2b6ff9401a3c6058d3c361b0fb17.zip |
Added Packet24 for diff visibility.
-rw-r--r-- | src/main/java/net/minecraft/server/Packet24MobSpawn.java | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/Packet24MobSpawn.java b/src/main/java/net/minecraft/server/Packet24MobSpawn.java new file mode 100644 index 00000000..0ceb8e0c --- /dev/null +++ b/src/main/java/net/minecraft/server/Packet24MobSpawn.java @@ -0,0 +1,67 @@ +package net.minecraft.server; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.util.List; + +import java.io.IOException; // CraftBukkit + +public class Packet24MobSpawn extends Packet { + + public int a; + public int b; + public int c; + public int d; + public int e; + public byte f; + public byte g; + public byte h; + private DataWatcher i; + private List q; + + public Packet24MobSpawn() {} + + public Packet24MobSpawn(EntityLiving entityliving) { + this.a = entityliving.id; + this.b = (byte) EntityTypes.a((Entity) entityliving); + this.c = MathHelper.floor(entityliving.locX * 32.0D); + this.d = MathHelper.floor(entityliving.locY * 32.0D); + this.e = MathHelper.floor(entityliving.locZ * 32.0D); + this.f = (byte) ((int) (entityliving.yaw * 256.0F / 360.0F)); + this.g = (byte) ((int) (entityliving.pitch * 256.0F / 360.0F)); + this.h = (byte) ((int) (entityliving.X * 256.0F / 360.0F)); + this.i = entityliving.getDataWatcher(); + } + + public void a(DataInputStream datainputstream) throws IOException { // CraftBukkit - throws IOException + this.a = datainputstream.readInt(); + this.b = datainputstream.readByte() & 255; + this.c = datainputstream.readInt(); + this.d = datainputstream.readInt(); + this.e = datainputstream.readInt(); + this.f = datainputstream.readByte(); + this.g = datainputstream.readByte(); + this.h = datainputstream.readByte(); + this.q = DataWatcher.a(datainputstream); + } + + public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit - throws IOException + dataoutputstream.writeInt(this.a); + dataoutputstream.writeByte(this.b & 255); + dataoutputstream.writeInt(this.c); + dataoutputstream.writeInt(this.d); + dataoutputstream.writeInt(this.e); + dataoutputstream.writeByte(this.f); + dataoutputstream.writeByte(this.g); + dataoutputstream.writeByte(this.h); + this.i.a(dataoutputstream); + } + + public void handle(NetHandler nethandler) { + nethandler.a(this); + } + + public int a() { + return 20; + } +} |