mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Also apply the "vanished players don't have rights" patch to Fishing Hook entities.
This commit is contained in:
parent
c0fa6b8d12
commit
cc7182a269
1 changed files with 19 additions and 0 deletions
|
@ -23,6 +23,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
if (movingobjectposition != null) {
|
if (movingobjectposition != null) {
|
||||||
org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // CraftBukkit - Call event
|
org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // CraftBukkit - Call event
|
||||||
if (movingobjectposition.entity != null) {
|
if (movingobjectposition.entity != null) {
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
|
||||||
|
@@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity {
|
||||||
|
movingobjectposition = new MovingObjectPosition(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // PaperSpigot start - Allow fishing hooks to fly through vanished players the shooter can't see
|
||||||
|
+ if (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && owner != null && owner instanceof EntityPlayer) {
|
||||||
|
+ if (!((EntityPlayer) owner).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) {
|
||||||
|
+ movingobjectposition = null;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ // PaperSpigot end
|
||||||
|
+
|
||||||
|
if (movingobjectposition != null) {
|
||||||
|
org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
|
||||||
|
if (movingobjectposition.entity != null) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
|
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
|
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||||
|
|
Loading…
Reference in a new issue