Skip to content
Permalink
Browse files

Fixed a server NPE with turrets.

  • Loading branch information...
Ri5ux Ri5ux
Ri5ux authored and Ri5ux committed Jul 12, 2019
1 parent 0cdaa30 commit 62983e183319c7b61ddd60bc0058456b6370ddad
Showing with 13 additions and 2 deletions.
  1. +13 −2 src/main/java/org/avp/packets/server/PacketTurretTargetUpdate.java
@@ -52,15 +52,26 @@ public void toBytes(ByteBuf buf)
buf.writeInt(y);
buf.writeInt(z);
buf.writeInt(id);

if (foc == null)
{
foc = new Pos(0, 0, 0);
}

foc.writeToBuffer(buf);

if (focrot == null)
{
focrot = new Rotation(0F, 0F);
}

focrot.writeToBuffer(buf);
}

@Override
public PacketTurretTargetUpdate onMessage(PacketTurretTargetUpdate packet, MessageContext ctx)
{
Game.minecraft().addScheduledTask(new Runnable()
{
Game.minecraft().addScheduledTask(new Runnable() {
@Override
public void run()
{

0 comments on commit 62983e1

Please sign in to comment.
You can’t perform that action at this time.