Add PacketPlayOutCamera for locking view to entity

This commit is contained in:
libraryaddict 2015-08-22 00:38:37 +12:00
parent 63107b0c26
commit 7841b17d03
2 changed files with 46 additions and 1 deletions

View File

@ -51,6 +51,7 @@ public class PacketHandler extends MiniPlugin
Method method = ProtocolInjector.class.getDeclaredMethod("addPacket", EnumProtocol.class,boolean.class, int.class, Class.class);
method.setAccessible(true);
method.invoke(null, EnumProtocol.PLAY, true, 67, PacketPlayOutCamera.class);
method.invoke(null, EnumProtocol.PLAY, true, 68, PacketPlayOutWorldBorder.class);
// EnumProtocol.PLAY.b().put(68, PacketPlayOutWorldBorder.class);

View File

@ -0,0 +1,44 @@
package mineplex.core.packethandler;
import org.bukkit.entity.Entity;
import net.minecraft.server.v1_7_R4.Packet;
import net.minecraft.server.v1_7_R4.PacketDataSerializer;
import net.minecraft.server.v1_7_R4.PacketListener;
public class PacketPlayOutCamera extends Packet
{
public int a;
public PacketPlayOutCamera()
{
}
public PacketPlayOutCamera(int id)
{
a = id;
}
public PacketPlayOutCamera(Entity paramEntity)
{
this.a = paramEntity.getEntityId();
}
public void a(PacketDataSerializer paramPacketDataSerializer)
{
}
public void b(PacketDataSerializer paramPacketDataSerializer)
{
paramPacketDataSerializer.b(this.a);
}
public void a(PacketListener paramPacketListenerPlayOut)
{
}
@Override
public void handle(PacketListener arg0)
{
}
}