mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-09 06:50:32 +08:00
Update upstream B/CB - hitEntity added upstream
This commit is contained in:
parent
422dd712f9
commit
ed6bd4ea4a
@ -1,4 +1,4 @@
|
||||
From 582c0de7289fb70e00150ae60d41ec6b7730d1c9 Mon Sep 17 00:00:00 2001
|
||||
From 4d20b34e3e83e6ed7d517b88c05bc77558641412 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Wed, 26 Oct 2016 15:49:28 -0500
|
||||
Subject: [PATCH] Add debug logging to Timings enable setter
|
||||
@ -21,5 +21,5 @@ index 4e5cf35..bef7cf7 100644
|
||||
|
||||
/**
|
||||
--
|
||||
2.10.0.windows.1
|
||||
2.10.2
|
||||
|
@ -1,64 +0,0 @@
|
||||
From 820409d462306180ec3d416d93a8dba43bb3874f Mon Sep 17 00:00:00 2001
|
||||
From: AlphaBlend <whizkid3000@hotmail.com>
|
||||
Date: Wed, 21 Sep 2016 20:40:21 -0700
|
||||
Subject: [PATCH] Add hit entity to ProjectileHitEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
|
||||
index 25ae832..250bddf 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
|
||||
@@ -1,23 +1,50 @@
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
+import org.bukkit.entity.Entity; // Paper
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
+import javax.annotation.Nullable;
|
||||
+
|
||||
/**
|
||||
* Called when a projectile hits an object
|
||||
*/
|
||||
public class ProjectileHitEvent extends EntityEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
+ // Paper start
|
||||
+ @Nullable
|
||||
+ private final Entity hitEntity;
|
||||
|
||||
public ProjectileHitEvent(final Projectile projectile) {
|
||||
+ this(projectile, null);
|
||||
+ }
|
||||
+
|
||||
+ public ProjectileHitEvent(final Projectile projectile, @Nullable final Entity hitEntity) {
|
||||
super(projectile);
|
||||
+ this.hitEntity = hitEntity;
|
||||
}
|
||||
+ // Paper end
|
||||
|
||||
@Override
|
||||
public Projectile getEntity() {
|
||||
return (Projectile) entity;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the entity that was hit by the projectile.
|
||||
+ *
|
||||
+ * This may be null, depending on if the projectile
|
||||
+ * actually hit an entity.
|
||||
+ *
|
||||
+ * @return The entity that was hit, or null otherwise
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Entity getHitEntity() {
|
||||
+ return hitEntity;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
--
|
||||
2.10.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 4814501c98ba55fe2634f0cabfc8615938866c3b Mon Sep 17 00:00:00 2001
|
||||
From 7a5e519b5a40b6210703aded7140542fbfbe9a9d Mon Sep 17 00:00:00 2001
|
||||
From: AlphaBlend <whizkid3000@hotmail.com>
|
||||
Date: Sun, 16 Oct 2016 23:19:34 -0700
|
||||
Subject: [PATCH] Add EntityZapEvent
|
@ -1,4 +1,4 @@
|
||||
From 37bc40ae29d91e8f1f7ffc1ad83b6f3987c16515 Mon Sep 17 00:00:00 2001
|
||||
From 6e4c05b271039c42a798abb3db3d414d50b0111f Mon Sep 17 00:00:00 2001
|
||||
From: vemacs <d@nkmem.es>
|
||||
Date: Wed, 23 Nov 2016 12:53:43 -0500
|
||||
Subject: [PATCH] Misc Utils
|
||||
@ -42,5 +42,5 @@ index 0000000..d60ecbb
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.8.3.windows.1
|
||||
2.10.2
|
||||
|
@ -1,79 +0,0 @@
|
||||
From 6f81a88ba6c88fd8ac2f420dc4010b7b9999d2d0 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaBlend <whizkid3000@hotmail.com>
|
||||
Date: Wed, 21 Sep 2016 20:40:46 -0700
|
||||
Subject: [PATCH] Add hit entity to ProjectileHitEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
index b71ebea..3021c81 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
|
||||
@@ -264,7 +264,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
|
||||
|
||||
protected void a(MovingObjectPosition movingobjectposition) {
|
||||
Entity entity = movingobjectposition.entity;
|
||||
- org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // CraftBukkit - Call event
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, entity); // CraftBukkit - Call event // Paper - Include entity in movingobjectposition
|
||||
if (entity != null) {
|
||||
float f = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
|
||||
int i = MathHelper.f((double) f * this.damage);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java
|
||||
index 45e5972..88372f3 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFireball.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFireball.java
|
||||
@@ -75,7 +75,7 @@ public abstract class EntityFireball extends Entity {
|
||||
|
||||
// CraftBukkit start - Fire ProjectileHitEvent
|
||||
if (this.dead) {
|
||||
- CraftEventFactory.callProjectileHitEvent(this);
|
||||
+ CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Paper - include entity in movingobjectposition
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
|
||||
index 59a3748..157e32c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
|
||||
@@ -265,7 +265,7 @@ public class EntityFishingHook extends Entity {
|
||||
}
|
||||
|
||||
if (movingobjectposition != null && movingobjectposition.type != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
||||
- org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Craftbukkit - Call event
|
||||
if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.ENTITY) {
|
||||
this.hooked = movingobjectposition.entity;
|
||||
this.s();
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
index 3d5548f..0dbd66a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
@@ -175,7 +175,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
this.a(movingobjectposition);
|
||||
// CraftBukkit start
|
||||
if (this.dead) {
|
||||
- org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition.entity); // Paper - include Entity in movingobjectposition
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 64d4f7e..b9e910d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1037,4 +1037,13 @@ public class CraftEventFactory {
|
||||
child.world.getServer().getPluginManager().callEvent(event);
|
||||
return event;
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
+ public static ProjectileHitEvent callProjectileHitEvent(Entity entity, Entity hitEntity) {
|
||||
+ ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), (hitEntity == null ? null : hitEntity.getBukkitEntity()));
|
||||
+
|
||||
+ entity.world.getServer().getPluginManager().callEvent(event);
|
||||
+ return event;
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
--
|
||||
2.10.2.windows.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 0144aac583728865281312210b416ae4fa6430f2 Mon Sep 17 00:00:00 2001
|
||||
From e5044d41763ffa0757be073aac90a82b7135a1e5 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Wed, 5 Oct 2016 16:27:36 -0500
|
||||
Subject: [PATCH] Option to remove corrupt tile entities
|
@ -1,4 +1,4 @@
|
||||
From adb9ccf7805d2cdde3299522fbed2f36dab3a19a Mon Sep 17 00:00:00 2001
|
||||
From b2d17b7139de38cbd10a1bd239e0b4f67704e8e4 Mon Sep 17 00:00:00 2001
|
||||
From: AlphaBlend <whizkid3000@hotmail.com>
|
||||
Date: Sun, 16 Oct 2016 23:19:30 -0700
|
||||
Subject: [PATCH] Add EntityZapEvent
|
||||
@ -48,7 +48,7 @@ index a2e68c5..4a6b3da 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 4ce1980..9df2758 100644
|
||||
index 96560f9..e7fa96c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -670,6 +670,14 @@ public class CraftEventFactory {
|
@ -1,4 +1,4 @@
|
||||
From 06cdbc2de896f1c2bf170e91007f5435550a0bb4 Mon Sep 17 00:00:00 2001
|
||||
From 6d8ae6ccc27d04cfc36e663794f51d8b56830b6d Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 3 Nov 2016 20:28:12 -0400
|
||||
Subject: [PATCH] Don't load Chunks from Hoppers and other things
|
@ -1,4 +1,4 @@
|
||||
From b9bf5d9d1395f456078224fede75a62bb078bd95 Mon Sep 17 00:00:00 2001
|
||||
From c3f763f58510c0a5ec0fe27df4ff0c32f16baa61 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 3 Nov 2016 21:52:22 -0400
|
||||
Subject: [PATCH] Prevent Auto Save if Save Queue is full
|
@ -1,4 +1,4 @@
|
||||
From 2dc0df2919355e20d84a53b3f8bd0e2ccd0bd5a5 Mon Sep 17 00:00:00 2001
|
||||
From 806edb9e1acefb50e81049f8154ea1f610de031b Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 4 Nov 2016 02:12:10 -0400
|
||||
Subject: [PATCH] Chunk Save Stats Debug Option
|
@ -1,4 +1,4 @@
|
||||
From f5ae9165b3a8817ce2613310bdd39c66b29b38f1 Mon Sep 17 00:00:00 2001
|
||||
From bffd69d3d23fed57a8b8a797fed318356bdc9144 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Sat, 12 Nov 2016 23:25:22 -0600
|
||||
Subject: [PATCH] Filter bad data from ArmorStand and SpawnEgg items
|
@ -1,4 +1,4 @@
|
||||
From 0bdec6d553141cddeaf775576abc30a666dcc6e9 Mon Sep 17 00:00:00 2001
|
||||
From 6e07c554045c64fca0dded4fb63035fccef449d6 Mon Sep 17 00:00:00 2001
|
||||
From: vemacs <d@nkmem.es>
|
||||
Date: Wed, 23 Nov 2016 08:31:45 -0500
|
||||
Subject: [PATCH] Cache user authenticator threads
|
||||
@ -63,5 +63,5 @@ index fe390fe..350ec03 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.10.2.windows.1
|
||||
2.10.2
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a1667a7504d226aedfe54e26e4196cc1717f8abe Mon Sep 17 00:00:00 2001
|
||||
From bd884b008613a8f2f3a04d49a8b7e85964ada2a0 Mon Sep 17 00:00:00 2001
|
||||
From: vemacs <d@nkmem.es>
|
||||
Date: Wed, 23 Nov 2016 12:54:56 -0500
|
||||
Subject: [PATCH] Optimize Network Queue
|
||||
@ -18,5 +18,5 @@ index 683ace3..b4adf7e 100644
|
||||
private long ab = aw();
|
||||
|
||||
--
|
||||
2.10.2.windows.1
|
||||
2.10.2
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 1036c659ccd24bb427ba7f560a0a2428c823db7f Mon Sep 17 00:00:00 2001
|
||||
From 1098877b9639553cb4075c565fe700e82ed3e3c3 Mon Sep 17 00:00:00 2001
|
||||
From: Alfie Cleveland <alfeh@me.com>
|
||||
Date: Fri, 25 Nov 2016 20:35:05 +0000
|
||||
Subject: [PATCH] Optimise NetworkManager
|
@ -1,11 +1,11 @@
|
||||
From d9d4f87eda37e0cf3a41775af63db778ed14d1e5 Mon Sep 17 00:00:00 2001
|
||||
From 50a3c5f506683281ab5c96c1b135fe2a794208c5 Mon Sep 17 00:00:00 2001
|
||||
From: Alfie Cleveland <alfeh@me.com>
|
||||
Date: Fri, 25 Nov 2016 13:22:40 +0000
|
||||
Subject: [PATCH] Optimise removeQueue
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index ec06d8e..29e9786 100644
|
||||
index 4b57278..75d67da 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -4,7 +4,9 @@ import com.google.common.collect.Lists;
|
@ -1,4 +1,4 @@
|
||||
From c741be30be3b023cb1544c6068f7db665b6d72fe Mon Sep 17 00:00:00 2001
|
||||
From 4eb6bc6c01b70d2d77fa96f5e57f5b5646a30fcc Mon Sep 17 00:00:00 2001
|
||||
From: Alfie Cleveland <alfeh@me.com>
|
||||
Date: Sun, 27 Nov 2016 22:17:37 +0000
|
||||
Subject: [PATCH] Don't process packets from offline players
|
@ -1 +1 @@
|
||||
Subproject commit daec93fe81b52a67e92607649b9b3e7e14d6b905
|
||||
Subproject commit 51d92a748dd56496b173885f6c44ad48da230057
|
@ -1 +1 @@
|
||||
Subproject commit c91ca4a54125b568fbc2f6b792cd68350d5e98da
|
||||
Subproject commit 1c07d5c78f07bf8a5dcc73c6f16f1b9743565b06
|
Loading…
Reference in New Issue
Block a user