mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
SPIGOT-401: Add async catcher for mob effects.
This commit is contained in:
parent
b7ea61e56b
commit
fb6f1e914b
5 changed files with 36 additions and 24 deletions
|
@ -1,4 +1,4 @@
|
|||
From 6e0e7a59a4df1f9e0b631eef3bad68a2cbcea9aa Mon Sep 17 00:00:00 2001
|
||||
From 43c975988e8da5b34cc1329bfee89f016ecf2ba5 Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <git@md-5.net>
|
||||
Date: Tue, 25 Mar 2014 16:10:01 +1100
|
||||
Subject: [PATCH] Async Operation Catching
|
||||
|
@ -25,6 +25,18 @@ index 12e2b79..9a19752 100644
|
|||
|
||||
public int a(Random random) {
|
||||
return 1;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index fe324a3..331d4de 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -546,6 +546,7 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
public void addEffect(MobEffect mobeffect) {
|
||||
+ org.spigotmc.AsyncCatcher.catchOp( "effect add"); // Spigot
|
||||
if (this.d(mobeffect)) {
|
||||
if (this.effects.containsKey(Integer.valueOf(mobeffect.getEffectId()))) {
|
||||
((MobEffect) this.effects.get(Integer.valueOf(mobeffect.getEffectId()))).a(mobeffect);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
|
||||
index c9058db..350f2f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTracker.java
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From afb2aad236a7e11ba4da622b8907f8cc969d9c82 Mon Sep 17 00:00:00 2001
|
||||
From 3d8df83ca8a3eff073f8728f36f5e2422bd8f920 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 10 Jan 2013 00:18:11 -0500
|
||||
Subject: [PATCH] Spigot Timings
|
||||
|
@ -133,7 +133,7 @@ index 424b71d..390c6eb 100644
|
|||
|
||||
public boolean ad() {
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 976ab95..05213eb 100644
|
||||
index ccf6479..c699dd1 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -16,6 +16,7 @@ import org.bukkit.entity.Hanging;
|
||||
|
@ -171,7 +171,7 @@ index 976ab95..05213eb 100644
|
|||
|
||||
private void recalcPosition() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index fe324a3..c7fb84b 100644
|
||||
index 331d4de..2a05941 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -17,6 +17,8 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageModifier;
|
||||
|
@ -183,7 +183,7 @@ index fe324a3..c7fb84b 100644
|
|||
public abstract class EntityLiving extends Entity {
|
||||
|
||||
private static final UUID a = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
|
||||
@@ -1393,6 +1395,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1394,6 +1396,7 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
public void s_() {
|
||||
|
@ -191,7 +191,7 @@ index fe324a3..c7fb84b 100644
|
|||
super.s_();
|
||||
if (!this.world.isStatic) {
|
||||
int i = this.bu();
|
||||
@@ -1431,7 +1434,9 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1432,7 +1435,9 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ index fe324a3..c7fb84b 100644
|
|||
double d0 = this.locX - this.lastX;
|
||||
double d1 = this.locZ - this.lastZ;
|
||||
float f = (float) (d0 * d0 + d1 * d1);
|
||||
@@ -1496,6 +1501,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1497,6 +1502,7 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
this.aR += f2;
|
||||
|
@ -209,7 +209,7 @@ index fe324a3..c7fb84b 100644
|
|||
}
|
||||
|
||||
protected float h(float f, float f1) {
|
||||
@@ -1560,6 +1566,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1561,6 +1567,7 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
this.world.methodProfiler.a("ai");
|
||||
|
@ -217,7 +217,7 @@ index fe324a3..c7fb84b 100644
|
|||
if (this.bC()) {
|
||||
this.aW = false;
|
||||
this.aX = 0.0F;
|
||||
@@ -1570,6 +1577,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1571,6 +1578,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.doTick();
|
||||
this.world.methodProfiler.b();
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ index fe324a3..c7fb84b 100644
|
|||
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("jump");
|
||||
@@ -1591,11 +1599,15 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1592,11 +1600,15 @@ public abstract class EntityLiving extends Entity {
|
||||
this.aX *= 0.98F;
|
||||
this.aY *= 0.98F;
|
||||
this.aZ *= 0.9F;
|
||||
|
@ -367,7 +367,7 @@ index 5e53661..49429d7 100644
|
|||
this.methodProfiler.b();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 6d3e88b..fad01f3 100644
|
||||
index 2d8ad1c..3727214 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1042,6 +1042,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
From 503fab3aa66ad3ab3e26d04446905dc1f1f78ce9 Mon Sep 17 00:00:00 2001
|
||||
From f95ad09026516fda6088df0b0319b4583fa3efee Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <md_5@live.com.au>
|
||||
Date: Tue, 2 Jul 2013 20:32:49 +1000
|
||||
Subject: [PATCH] Entity Mount and Dismount Events
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 33709ce..bcb815c 100644
|
||||
index 9dcddb1..8f7d865 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1544,6 +1544,7 @@ public abstract class Entity implements ICommandListener {
|
||||
@@ -1537,6 +1537,7 @@ public abstract class Entity implements ICommandListener {
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
@ -16,7 +16,7 @@ index 33709ce..bcb815c 100644
|
|||
this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
|
||||
this.vehicle.passenger = null;
|
||||
}
|
||||
@@ -1578,6 +1579,18 @@ public abstract class Entity implements ICommandListener {
|
||||
@@ -1571,6 +1572,18 @@ public abstract class Entity implements ICommandListener {
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 9b8b992e0eef3ccb396d756be6665fa8d37367b0 Mon Sep 17 00:00:00 2001
|
||||
From ff00b8a9c49a289d0cac4c8fb4119e61c2fd140b Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <md_5@live.com.au>
|
||||
Date: Sat, 3 Aug 2013 19:27:07 +1000
|
||||
Subject: [PATCH] Player Collision API
|
||||
|
@ -25,10 +25,10 @@ index 7eb41e1..b65c225 100644
|
|||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 6bb5428..2d14a0d 100644
|
||||
index fc8517d..b231ee2 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -1625,7 +1625,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1626,7 +1626,7 @@ public abstract class EntityLiving extends Entity {
|
||||
protected void bK() {
|
||||
List list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||
|
||||
|
@ -38,7 +38,7 @@ index 6bb5428..2d14a0d 100644
|
|||
Entity entity = (Entity) list.get(i);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 69229da..768a743 100644
|
||||
index ce54ae8..b957470 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -62,6 +62,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 97d9a64624d50f83d4d8612bfa2c0f24f8d47c39 Mon Sep 17 00:00:00 2001
|
||||
From 901e9094f475719aa9c5f5fd691d85ed90d05130 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 31 Jan 2014 11:18:34 -0500
|
||||
Subject: [PATCH] Cap Entity Collisions
|
||||
|
@ -7,7 +7,7 @@ Limit a single entity to colliding a max of configurable times per tick.
|
|||
This will alleviate issues where living entities are hoarded in 1x1 pens.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index f96a153..0a5d1bb 100644
|
||||
index a1d51a8..25192f3 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1059,6 +1059,7 @@ public abstract class Entity implements ICommandListener {
|
||||
|
@ -19,10 +19,10 @@ index f96a153..0a5d1bb 100644
|
|||
if (entity.passenger != this && entity.vehicle != this) {
|
||||
if (!entity.T && !this.T) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 2d14a0d..807d5fa 100644
|
||||
index b231ee2..d954ce9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -1626,7 +1626,9 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1627,7 +1627,9 @@ public abstract class EntityLiving extends Entity {
|
||||
List list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||
|
||||
if (this.ad() && list != null && !list.isEmpty()) { // Spigot: Add this.ad() condition
|
||||
|
@ -32,7 +32,7 @@ index 2d14a0d..807d5fa 100644
|
|||
Entity entity = (Entity) list.get(i);
|
||||
|
||||
// TODO better check now?
|
||||
@@ -1637,9 +1639,12 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1638,9 +1640,12 @@ public abstract class EntityLiving extends Entity {
|
||||
// CraftBukkit end
|
||||
|
||||
if (entity.ae()) {
|
||||
|
|
Loading…
Reference in a new issue