mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 17:07:34 +01:00
Ignore minecart in activation range (#10359)
This commit is contained in:
parent
8e75001cb8
commit
241d8e26fb
@ -1,18 +1,20 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||||
Date: Wed, 2 Mar 2016 00:32:25 -0600
|
Date: Wed, 2 Mar 2016 00:32:25 -0600
|
||||||
Subject: [PATCH] Always tick falling blocks
|
Subject: [PATCH] Add more entities to activation range ignore list
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
index a5da6c1cae0afbde684be250e2fc3c0c32a1265b..e5ff35531a933268f2b8b6c15c234de4482931d5 100644
|
index a5da6c1cae0afbde684be250e2fc3c0c32a1265b..6d51464f6368151e8acc532414ee223714584e96 100644
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
@@ -92,6 +92,7 @@ public class ActivationRange
|
@@ -92,6 +92,9 @@ public class ActivationRange
|
||||||
|| entity instanceof AbstractHurtingProjectile
|
|| entity instanceof AbstractHurtingProjectile
|
||||||
|| entity instanceof LightningBolt
|
|| entity instanceof LightningBolt
|
||||||
|| entity instanceof PrimedTnt
|
|| entity instanceof PrimedTnt
|
||||||
+ || entity instanceof net.minecraft.world.entity.item.FallingBlockEntity // Paper - Always tick falling blocks
|
+ || entity instanceof net.minecraft.world.entity.item.FallingBlockEntity // Paper - Always tick falling blocks
|
||||||
|
+ || entity instanceof net.minecraft.world.entity.vehicle.AbstractMinecart // Paper
|
||||||
|
+ || entity instanceof net.minecraft.world.entity.vehicle.Boat // Paper
|
||||||
|| entity instanceof EndCrystal
|
|| entity instanceof EndCrystal
|
||||||
|| entity instanceof FireworkRocketEntity
|
|| entity instanceof FireworkRocketEntity
|
||||||
|| entity instanceof ThrownTrident )
|
|| entity instanceof ThrownTrident )
|
@ -28,10 +28,10 @@ index bfbbb9382cf483a23acf35c17250f6f9223f7507..5994cb69575d365f435f5ef6da5fa61e
|
|||||||
float f1 = 0.98F;
|
float f1 = 0.98F;
|
||||||
|
|
||||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
index e5ff35531a933268f2b8b6c15c234de4482931d5..90df7e83d9166c22a56a31db22d843768229b9ab 100644
|
index 6d51464f6368151e8acc532414ee223714584e96..9fb9fa62c32445ac3c3883a6433759c86dcfc428 100644
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
@@ -254,7 +254,7 @@ public class ActivationRange
|
@@ -256,7 +256,7 @@ public class ActivationRange
|
||||||
isActive = true;
|
isActive = true;
|
||||||
}
|
}
|
||||||
// Add a little performance juice to active entities. Skip 1/4 if not immune.
|
// Add a little performance juice to active entities. Skip 1/4 if not immune.
|
||||||
|
@ -111,7 +111,7 @@ index bd8c96e914b156284bdbb960f168e63e1f122920..abb4c32e8b35de332fa517523e8c598e
|
|||||||
} else {
|
} else {
|
||||||
passenger.stopRiding();
|
passenger.stopRiding();
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 3f620c4b8415f09a8d4664481b2d41d421ee836e..703b32362cf6a23dfe9326aa4e0ee74511e0d2cb 100644
|
index 3f620c4b8415f09a8d4664481b2d41d421ee836e..132ab49c02b83c37e1a64fc19f9bdfc04f52f2ed 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -412,6 +412,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@@ -412,6 +412,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||||
@ -137,7 +137,7 @@ index 3f620c4b8415f09a8d4664481b2d41d421ee836e..703b32362cf6a23dfe9326aa4e0ee745
|
|||||||
this.setDeltaMovement(Vec3.ZERO);
|
this.setDeltaMovement(Vec3.ZERO);
|
||||||
}
|
}
|
||||||
+ // Paper start - ignore movement changes while inactive.
|
+ // Paper start - ignore movement changes while inactive.
|
||||||
+ if (isTemporarilyActive && !(this instanceof ItemEntity || this instanceof net.minecraft.world.entity.vehicle.AbstractMinecart) && movement == getDeltaMovement() && movementType == MoverType.SELF) {
|
+ if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && movementType == MoverType.SELF) {
|
||||||
+ setDeltaMovement(Vec3.ZERO);
|
+ setDeltaMovement(Vec3.ZERO);
|
||||||
+ this.level.getProfiler().pop();
|
+ this.level.getProfiler().pop();
|
||||||
+ return;
|
+ return;
|
||||||
@ -371,7 +371,7 @@ index b1061db1d9b3bfde61d5016e10556c4320095827..c71690dbc3dc52803945f1608f0ee3ba
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
index 90df7e83d9166c22a56a31db22d843768229b9ab..c39894e824334f1dc52e0466cf9d84f7e219be70 100644
|
index 9fb9fa62c32445ac3c3883a6433759c86dcfc428..3283ed99c35ffed6805567705e0518d9f84feedc 100644
|
||||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||||
@@ -1,33 +1,43 @@
|
@@ -1,33 +1,43 @@
|
||||||
@ -499,7 +499,7 @@ index 90df7e83d9166c22a56a31db22d843768229b9ab..c39894e824334f1dc52e0466cf9d84f7
|
|||||||
|| entity instanceof Player
|
|| entity instanceof Player
|
||||||
|| entity instanceof ThrowableProjectile
|
|| entity instanceof ThrowableProjectile
|
||||||
|| entity instanceof EnderDragon
|
|| entity instanceof EnderDragon
|
||||||
@@ -116,10 +170,25 @@ public class ActivationRange
|
@@ -118,10 +172,25 @@ public class ActivationRange
|
||||||
final int raiderActivationRange = world.spigotConfig.raiderActivationRange;
|
final int raiderActivationRange = world.spigotConfig.raiderActivationRange;
|
||||||
final int animalActivationRange = world.spigotConfig.animalActivationRange;
|
final int animalActivationRange = world.spigotConfig.animalActivationRange;
|
||||||
final int monsterActivationRange = world.spigotConfig.monsterActivationRange;
|
final int monsterActivationRange = world.spigotConfig.monsterActivationRange;
|
||||||
@ -525,7 +525,7 @@ index 90df7e83d9166c22a56a31db22d843768229b9ab..c39894e824334f1dc52e0466cf9d84f7
|
|||||||
maxRange = Math.min( ( world.spigotConfig.simulationDistance << 4 ) - 8, maxRange );
|
maxRange = Math.min( ( world.spigotConfig.simulationDistance << 4 ) - 8, maxRange );
|
||||||
|
|
||||||
for ( Player player : world.players() )
|
for ( Player player : world.players() )
|
||||||
@@ -130,13 +199,30 @@ public class ActivationRange
|
@@ -132,13 +201,30 @@ public class ActivationRange
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -562,7 +562,7 @@ index 90df7e83d9166c22a56a31db22d843768229b9ab..c39894e824334f1dc52e0466cf9d84f7
|
|||||||
}
|
}
|
||||||
MinecraftTimings.entityActivationCheckTimer.stopTiming();
|
MinecraftTimings.entityActivationCheckTimer.stopTiming();
|
||||||
}
|
}
|
||||||
@@ -169,60 +255,118 @@ public class ActivationRange
|
@@ -171,60 +257,118 @@ public class ActivationRange
|
||||||
* @param entity
|
* @param entity
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -698,7 +698,7 @@ index 90df7e83d9166c22a56a31db22d843768229b9ab..c39894e824334f1dc52e0466cf9d84f7
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -237,8 +381,19 @@ public class ActivationRange
|
@@ -239,8 +383,19 @@ public class ActivationRange
|
||||||
if ( entity instanceof FireworkRocketEntity ) {
|
if ( entity instanceof FireworkRocketEntity ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -719,7 +719,7 @@ index 90df7e83d9166c22a56a31db22d843768229b9ab..c39894e824334f1dc52e0466cf9d84f7
|
|||||||
|
|
||||||
// Should this entity tick?
|
// Should this entity tick?
|
||||||
if ( !isActive )
|
if ( !isActive )
|
||||||
@@ -246,15 +401,19 @@ public class ActivationRange
|
@@ -248,15 +403,19 @@ public class ActivationRange
|
||||||
if ( ( MinecraftServer.currentTick - entity.activatedTick - 1 ) % 20 == 0 )
|
if ( ( MinecraftServer.currentTick - entity.activatedTick - 1 ) % 20 == 0 )
|
||||||
{
|
{
|
||||||
// Check immunities every 20 ticks.
|
// Check immunities every 20 ticks.
|
||||||
|
Loading…
Reference in New Issue
Block a user