Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-16 11:30:06 +01:00
Add obfuscation helper (aikar's request) (#1468)
Dieser Commit ist enthalten in:
Ursprung
cce969a59d
Commit
844687a91c
@ -1,11 +1,11 @@
|
|||||||
From f1a992b3f2f203ca2c6776a5f31cf7d83ecf8621 Mon Sep 17 00:00:00 2001
|
From 7f8761e0c24cca4d01e02ea972fa5696fc3174a1 Mon Sep 17 00:00:00 2001
|
||||||
From: Iceee <andrew@opticgaming.tv>
|
From: Iceee <andrew@opticgaming.tv>
|
||||||
Date: Wed, 2 Mar 2016 01:39:52 -0600
|
Date: Wed, 2 Mar 2016 01:39:52 -0600
|
||||||
Subject: [PATCH] Fix lag from explosions processing dead entities
|
Subject: [PATCH] Fix lag from explosions processing dead entities
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
|
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
|
||||||
index e5ba6edd..2620c4c2 100644
|
index e5ba6eddd..c7d11cf62 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Explosion.java
|
--- a/src/main/java/net/minecraft/server/Explosion.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Explosion.java
|
+++ b/src/main/java/net/minecraft/server/Explosion.java
|
||||||
@@ -111,7 +111,14 @@ public class Explosion {
|
@@ -111,7 +111,14 @@ public class Explosion {
|
||||||
@ -17,13 +17,35 @@ index e5ba6edd..2620c4c2 100644
|
|||||||
+ List list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), new com.google.common.base.Predicate<Entity>() {
|
+ List list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), new com.google.common.base.Predicate<Entity>() {
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public boolean apply(Entity entity) {
|
+ public boolean apply(Entity entity) {
|
||||||
+ return IEntitySelector.e.test(entity) && !entity.dead;
|
+ return IEntitySelector.canAITarget().test(entity) && !entity.dead;
|
||||||
+ }
|
+ }
|
||||||
+ });
|
+ });
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ);
|
Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ);
|
||||||
|
|
||||||
for (int l1 = 0; l1 < list.size(); ++l1) {
|
for (int l1 = 0; l1 < list.size(); ++l1) {
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||||
|
index 30f8ec519..b1d05220b 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
|
||||||
|
@@ -13,6 +13,7 @@ public final class IEntitySelector {
|
||||||
|
public static final Predicate<Entity> d = (entity) -> {
|
||||||
|
return entity instanceof IInventory && entity.isAlive();
|
||||||
|
};
|
||||||
|
+ public static Predicate<Entity> canAITarget() { return e; } // Paper - OBFHELPER
|
||||||
|
public static final Predicate<Entity> e = (entity) -> {
|
||||||
|
return !(entity instanceof EntityHuman) || !((EntityHuman)entity).isSpectator() && !((EntityHuman)entity).u();
|
||||||
|
};
|
||||||
|
@@ -96,8 +97,7 @@ public final class IEntitySelector {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- // $FF: synthetic method
|
||||||
|
- public boolean test(@Nullable Object object) {
|
||||||
|
+ public boolean test(@Nullable Entity object) { // Paper - decompile error
|
||||||
|
return this.a((Entity)object);
|
||||||
|
}
|
||||||
|
}
|
||||||
--
|
--
|
||||||
2.18.0
|
2.18.0
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren