diff options
Diffstat (limited to 'patches/server/0978-Entity-Activation-Range-2.0.patch')
-rw-r--r-- | patches/server/0978-Entity-Activation-Range-2.0.patch | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/patches/server/0978-Entity-Activation-Range-2.0.patch b/patches/server/0978-Entity-Activation-Range-2.0.patch index 13245e49f4..051ceaf599 100644 --- a/patches/server/0978-Entity-Activation-Range-2.0.patch +++ b/patches/server/0978-Entity-Activation-Range-2.0.patch @@ -87,10 +87,10 @@ index ce148cf5930cdcf0163c7f6416cbbd89e4d22720..cd00b534e4c527e0b4a5ad78cde87c22 } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index e2322f361271712aca31c95b8b79cdf1c04945f2..4c76002af5eee553b92a026688c83ab36429fe4f 100644 +index 6ebd653ea3c302f26d02f81b6718924708148e4c..72dbee3795eb634b3ff3f063a226a1965bc988fb 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -420,6 +420,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -421,6 +421,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // Spigot end protected int numCollisions = 0; // Paper - Cap entity collisions public boolean fromNetherPortal; // Paper - Add option to nerf pigmen from nether portals @@ -99,7 +99,7 @@ index e2322f361271712aca31c95b8b79cdf1c04945f2..4c76002af5eee553b92a026688c83ab3 public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one // Paper start - Entity origin API @javax.annotation.Nullable -@@ -992,6 +994,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -993,6 +995,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } else { this.wasOnFire = this.isOnFire(); if (type == MoverType.PISTON) { @@ -108,7 +108,7 @@ index e2322f361271712aca31c95b8b79cdf1c04945f2..4c76002af5eee553b92a026688c83ab3 movement = this.limitPistonMovement(movement); if (movement.equals(Vec3.ZERO)) { return; -@@ -1006,6 +1010,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1007,6 +1011,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.stuckSpeedMultiplier = Vec3.ZERO; this.setDeltaMovement(Vec3.ZERO); } @@ -349,10 +349,10 @@ index 46afba838cf12eeb1bbccaa260131a76f090364b..e1c9a961064887070b29207efd7af478 } } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e8568265007 100644 +index 964e3e81ab522ceebfceb651dfe3309d7b87c688..c1f753f7c4530a772fb408db83fc8c78675cbec2 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -1,26 +1,35 @@ +@@ -1,14 +1,22 @@ package org.spigotmc; +import net.minecraft.core.BlockPos; @@ -375,7 +375,8 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 import net.minecraft.world.entity.boss.EnderDragonPart; import net.minecraft.world.entity.boss.enderdragon.EndCrystal; import net.minecraft.world.entity.boss.enderdragon.EnderDragon; - import net.minecraft.world.entity.boss.wither.WitherBoss; +@@ -16,12 +24,13 @@ import net.minecraft.world.entity.boss.wither.WitherBoss; + import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.item.PrimedTnt; import net.minecraft.world.entity.monster.Creeper; -import net.minecraft.world.entity.monster.Monster; @@ -390,7 +391,7 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 import net.minecraft.world.entity.projectile.FireworkRocketEntity; import net.minecraft.world.entity.projectile.ThrowableProjectile; import net.minecraft.world.entity.projectile.ThrownTrident; -@@ -43,6 +52,43 @@ public class ActivationRange +@@ -44,6 +53,43 @@ public class ActivationRange AABB boundingBox = new AABB( 0, 0, 0, 0, 0, 0 ); } @@ -434,7 +435,7 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 static AABB maxBB = new AABB( 0, 0, 0, 0, 0, 0 ); -@@ -55,10 +101,13 @@ public class ActivationRange +@@ -56,10 +102,13 @@ public class ActivationRange */ public static ActivationType initializeEntityActivationType(Entity entity) { @@ -449,7 +450,7 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 { return ActivationType.MONSTER; } else if ( entity instanceof PathfinderMob || entity instanceof AmbientCreature ) -@@ -79,10 +128,14 @@ public class ActivationRange +@@ -80,10 +129,14 @@ public class ActivationRange */ public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config) { @@ -468,7 +469,7 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 || entity instanceof Player || entity instanceof ThrowableProjectile || entity instanceof EnderDragon -@@ -116,10 +169,25 @@ public class ActivationRange +@@ -117,10 +170,25 @@ public class ActivationRange final int raiderActivationRange = world.spigotConfig.raiderActivationRange; final int animalActivationRange = world.spigotConfig.animalActivationRange; final int monsterActivationRange = world.spigotConfig.monsterActivationRange; @@ -494,7 +495,7 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 maxRange = Math.min( ( world.spigotConfig.simulationDistance << 4 ) - 8, maxRange ); for ( Player player : world.players() ) -@@ -130,13 +198,30 @@ public class ActivationRange +@@ -131,13 +199,30 @@ public class ActivationRange continue; } @@ -531,7 +532,7 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 } } -@@ -168,60 +253,118 @@ public class ActivationRange +@@ -169,60 +254,118 @@ public class ActivationRange * @param entity * @return */ @@ -667,8 +668,8 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 } /** -@@ -236,8 +379,19 @@ public class ActivationRange - if ( entity instanceof FireworkRocketEntity ) { +@@ -237,8 +380,19 @@ public class ActivationRange + if (entity instanceof FireworkRocketEntity || (entity instanceof ItemEntity && (entity.tickCount + entity.getId() + 1) % 4 == 0)) { return true; } + // Paper start - special case always immunities @@ -688,7 +689,7 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 // Should this entity tick? if ( !isActive ) -@@ -245,11 +399,14 @@ public class ActivationRange +@@ -246,11 +400,14 @@ public class ActivationRange if ( ( MinecraftServer.currentTick - entity.activatedTick - 1 ) % 20 == 0 ) { // Check immunities every 20 ticks. @@ -705,8 +706,8 @@ index 05ad15fc40ccb7feed5c51ad0ad0a98bd0d02af6..133bcf639a45bd7fa1a2d02410ea3e85 } + // Paper end isActive = true; - } else if (entity instanceof net.minecraft.world.entity.item.ItemEntity && (entity.tickCount + entity.getId()) % 4 == 0) { // Paper - Needed for item gravity, see ItemEntity tick - isActive = true; + } + } diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java index 2b263246135c85aa225120519e9702a628773935..2c408fa4abcbe1171c58aee8799c8cf7867d0f0a 100644 --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java |