From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Thu, 11 Mar 2021 09:50:39 -0800
Subject: [PATCH] Fix NPE in pickup logic for arrow

Apparently the shooter can be null for tridents returning to players.

diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java
index 01679d76405625223869f3fdcb29ffba49f7b69a..e440d26c920c4efddf958c61bfdfa508273062cc 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java
@@ -547,7 +547,8 @@ public abstract class EntityArrow extends IProjectile {
                 }
                 itemstack = item.getItemStack();
             }
-            boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild || this.t() && this.getShooter().getUniqueID() == entityhuman.getUniqueID();
+            Entity shooter; // Tuinity - fix NPE here
+            boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild || this.t() && ((shooter = this.getShooter()) != null && shooter.getUniqueID() == entityhuman.getUniqueID()); // Tuinity - fix NPE here
 
             if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(itemstack)) {
                 // CraftBukkit end
