Skip to content

Commit 43505dc

Browse files
committed
Start updating feature patches
1 parent 5787676 commit 43505dc

File tree

2 files changed

+117
-120
lines changed

2 files changed

+117
-120
lines changed

paper-server/patches/features/0003-Entity-Activation-Range-2.0.patch

+49-47
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ index 0000000000000000000000000000000000000000..ade6110cc6adb1263c0359ff7e96e96b
338338
+ }
339339
+}
340340
diff --git a/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
341-
index d95413af04121fe91ca0f3b0c70025b9808acef9..ad665c7535c615d2b03a3e7864be435f933235dd 100644
341+
index 7a86892eb69b01656848c755a4cabacfc0dce8e6..09c6ebe91ca80552a487d01ab5394db21cf3d34f 100644
342342
--- a/net/minecraft/server/level/ChunkMap.java
343343
+++ b/net/minecraft/server/level/ChunkMap.java
344344
@@ -4,7 +4,6 @@ import com.google.common.collect.ImmutableList;
@@ -357,7 +357,7 @@ index d95413af04121fe91ca0f3b0c70025b9808acef9..ad665c7535c615d2b03a3e7864be435f
357357
import java.io.IOException;
358358
import java.io.Writer;
359359
import java.nio.file.Path;
360-
@@ -95,7 +93,6 @@ import net.minecraft.world.level.levelgen.structure.StructureStart;
360+
@@ -98,7 +96,6 @@ import net.minecraft.world.level.levelgen.structure.StructureStart;
361361
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager;
362362
import net.minecraft.world.level.storage.DimensionDataStorage;
363363
import net.minecraft.world.level.storage.LevelStorageSource;
@@ -366,18 +366,18 @@ index d95413af04121fe91ca0f3b0c70025b9808acef9..ad665c7535c615d2b03a3e7864be435f
366366
import org.slf4j.Logger;
367367

368368
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
369-
index cdb4d313eb33c049c8467fe5d31fb0d671737768..40b799fd90b0db13bdaa8834c021f5ca8f25ce10 100644
369+
index e5777f1f67a3b96f4e03e1a90a0f2f6e159748ef..8b2d4f5ff1780a5bb0f9ce3617e2be6c8715a9f5 100644
370370
--- a/net/minecraft/server/level/ServerLevel.java
371371
+++ b/net/minecraft/server/level/ServerLevel.java
372-
@@ -551,6 +551,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
372+
@@ -544,6 +544,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
373373
profilerFiller.pop();
374374
}
375375

376376
+ io.papermc.paper.entity.activation.ActivationRange.activateEntities(this); // Paper - EAR
377377
this.entityTickList
378378
.forEach(
379379
entity -> {
380-
@@ -980,12 +981,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
380+
@@ -982,12 +983,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
381381
entity.totalEntityAge++; // Paper - age-like counter for all entities
382382
profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString());
383383
profilerFiller.incrementCounter("tickNonPassenger");
@@ -394,7 +394,7 @@ index cdb4d313eb33c049c8467fe5d31fb0d671737768..40b799fd90b0db13bdaa8834c021f5ca
394394
}
395395
// Paper start - log detailed entity tick information
396396
} finally {
397-
@@ -996,7 +1000,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
397+
@@ -998,7 +1002,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
398398
// Paper end - log detailed entity tick information
399399
}
400400

@@ -403,7 +403,7 @@ index cdb4d313eb33c049c8467fe5d31fb0d671737768..40b799fd90b0db13bdaa8834c021f5ca
403403
if (passengerEntity.isRemoved() || passengerEntity.getVehicle() != ridingEntity) {
404404
passengerEntity.stopRiding();
405405
} else if (passengerEntity instanceof Player || this.entityTickList.contains(passengerEntity)) {
406-
@@ -1006,12 +1010,21 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
406+
@@ -1008,12 +1012,21 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
407407
ProfilerFiller profilerFiller = Profiler.get();
408408
profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(passengerEntity.getType()).toString());
409409
profilerFiller.incrementCounter("tickPassenger");
@@ -427,10 +427,10 @@ index cdb4d313eb33c049c8467fe5d31fb0d671737768..40b799fd90b0db13bdaa8834c021f5ca
427427
}
428428
}
429429
diff --git a/net/minecraft/world/entity/AgeableMob.java b/net/minecraft/world/entity/AgeableMob.java
430-
index a9f01e616ef6b0d74caf57cd68eb371a4fd30fd5..179f4e4b9b1eb57f78bbb2f9fa34b11ea79b7a88 100644
430+
index f9cfa9dd17bd259cfbc0d96bf48a17556b365d8b..201c6d6e2f5799a7678b16f01c85508bc72e8af5 100644
431431
--- a/net/minecraft/world/entity/AgeableMob.java
432432
+++ b/net/minecraft/world/entity/AgeableMob.java
433-
@@ -126,6 +126,23 @@ public abstract class AgeableMob extends PathfinderMob {
433+
@@ -129,6 +129,23 @@ public abstract class AgeableMob extends PathfinderMob {
434434
super.onSyncedDataUpdated(key);
435435
}
436436

@@ -455,10 +455,10 @@ index a9f01e616ef6b0d74caf57cd68eb371a4fd30fd5..179f4e4b9b1eb57f78bbb2f9fa34b11e
455455
public void aiStep() {
456456
super.aiStep();
457457
diff --git a/net/minecraft/world/entity/AreaEffectCloud.java b/net/minecraft/world/entity/AreaEffectCloud.java
458-
index 24735284fda151414d99faad401d25ba60995f9a..23b342cc31c7e72ade0e1ccad86a9ccf34380f13 100644
458+
index bf44f6b9c8710e0c9a85d44f6217501abc98a7b1..bfd904e468bbf2cc1a5b3353d3a69ad5087c81ae 100644
459459
--- a/net/minecraft/world/entity/AreaEffectCloud.java
460460
+++ b/net/minecraft/world/entity/AreaEffectCloud.java
461-
@@ -128,6 +128,16 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
461+
@@ -144,6 +144,16 @@ public class AreaEffectCloud extends Entity implements TraceableEntity {
462462
this.duration = duration;
463463
}
464464

@@ -476,10 +476,10 @@ index 24735284fda151414d99faad401d25ba60995f9a..23b342cc31c7e72ade0e1ccad86a9ccf
476476
public void tick() {
477477
super.tick();
478478
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
479-
index 54cf80831372d102e8d2966ac104678caebdf336..d89c3949e16ff6cb0374da29ec6731d854b5f105 100644
479+
index 30c10dfe3b70a2b137b372ae1aa144f17733455b..7feeb2663fc1a52a72e7c47ae6f575cdc8d668a7 100644
480480
--- a/net/minecraft/world/entity/Entity.java
481481
+++ b/net/minecraft/world/entity/Entity.java
482-
@@ -381,6 +381,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
482+
@@ -389,6 +389,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
483483
private final int despawnTime; // Paper - entity despawn time limit
484484
public int totalEntityAge; // Paper - age-like counter for all entities
485485
public final io.papermc.paper.entity.activation.ActivationType activationType = io.papermc.paper.entity.activation.ActivationType.activationTypeFor(this); // Paper - EAR 2/tracking ranges
@@ -495,7 +495,7 @@ index 54cf80831372d102e8d2966ac104678caebdf336..d89c3949e16ff6cb0374da29ec6731d8
495495

496496
public void setOrigin(@javax.annotation.Nonnull org.bukkit.Location location) {
497497
this.origin = location.toVector();
498-
@@ -414,6 +423,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
498+
@@ -424,6 +433,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
499499
this.position = Vec3.ZERO;
500500
this.blockPosition = BlockPos.ZERO;
501501
this.chunkPosition = ChunkPos.ZERO;
@@ -509,16 +509,18 @@ index 54cf80831372d102e8d2966ac104678caebdf336..d89c3949e16ff6cb0374da29ec6731d8
509509
SynchedEntityData.Builder builder = new SynchedEntityData.Builder(this);
510510
builder.define(DATA_SHARED_FLAGS_ID, (byte)0);
511511
builder.define(DATA_AIR_SUPPLY_ID, this.getMaxAirSupply());
512-
@@ -978,6 +994,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
512+
@@ -993,6 +1009,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
513+
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
513514
} else {
514-
this.wasOnFire = this.isOnFire();
515515
if (type == MoverType.PISTON) {
516-
+ this.activatedTick = Math.max(this.activatedTick, MinecraftServer.currentTick + 20); // Paper - EAR 2
517-
+ this.activatedImmunityTick = Math.max(this.activatedImmunityTick, MinecraftServer.currentTick + 20); // Paper - EAR 2
516+
+ // Paper start - EAR 2
517+
+ this.activatedTick = Math.max(this.activatedTick, MinecraftServer.currentTick + 20);
518+
+ this.activatedImmunityTick = Math.max(this.activatedImmunityTick, MinecraftServer.currentTick + 20);
519+
+ // Paper end - EAR 2
518520
movement = this.limitPistonMovement(movement);
519521
if (movement.equals(Vec3.ZERO)) {
520522
return;
521-
@@ -991,6 +1009,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
523+
@@ -1006,6 +1026,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
522524
this.stuckSpeedMultiplier = Vec3.ZERO;
523525
this.setDeltaMovement(Vec3.ZERO);
524526
}
@@ -533,10 +535,10 @@ index 54cf80831372d102e8d2966ac104678caebdf336..d89c3949e16ff6cb0374da29ec6731d8
533535
movement = this.maybeBackOffFromEdge(movement, type);
534536
Vec3 vec3 = this.collide(movement);
535537
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
536-
index bf5fd2a6c8630ea2bb06881d4d365dda9a4e90ea..4713c29cc2add476f568163a29cb297f5d1049df 100644
538+
index e8fe7e8b25406e862d5f60dc096ff299ac00983c..36c04f06ba55cd0f9f7158692cd5cc1c59dcccc7 100644
537539
--- a/net/minecraft/world/entity/LivingEntity.java
538540
+++ b/net/minecraft/world/entity/LivingEntity.java
539-
@@ -3103,6 +3103,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
541+
@@ -3178,6 +3178,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
540542
return false;
541543
}
542544

@@ -552,10 +554,10 @@ index bf5fd2a6c8630ea2bb06881d4d365dda9a4e90ea..4713c29cc2add476f568163a29cb297f
552554
public void tick() {
553555
super.tick();
554556
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
555-
index f7d69db61d1293510428ae275e8a50571dde5ddf..1ed07fd23985a6bf8cf8300f74c92b7531a79fc6 100644
557+
index 98d08a253afd2ba524a84d828338be00de1fd231..49eadf2b8a198719185101726a81958af9596585 100644
556558
--- a/net/minecraft/world/entity/Mob.java
557559
+++ b/net/minecraft/world/entity/Mob.java
558-
@@ -215,6 +215,19 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
560+
@@ -207,6 +207,19 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
559561
return this.lookControl;
560562
}
561563

@@ -651,10 +653,10 @@ index 789fea258d70e60d38271ebb31270562dc7eb3ab..d0ab3db7bbd2942db19f473474371b20
651653
}
652654
}
653655
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
654-
index 8b034b6bda937b25dbb3d09b8293fed6d7dc512c..52a7ed0d991758bad0dcedcb7f97fb15ac6c6d04 100644
656+
index 5af21eadecdba8cccc5d7b43fc2f47588955afee..1c06749c0a14fe0b42013842e8ed86669bb1eb6d 100644
655657
--- a/net/minecraft/world/entity/item/ItemEntity.java
656658
+++ b/net/minecraft/world/entity/item/ItemEntity.java
657-
@@ -124,6 +124,29 @@ public class ItemEntity extends Entity implements TraceableEntity {
659+
@@ -131,6 +131,29 @@ public class ItemEntity extends Entity implements TraceableEntity {
658660
return 0.04;
659661
}
660662

@@ -685,10 +687,10 @@ index 8b034b6bda937b25dbb3d09b8293fed6d7dc512c..52a7ed0d991758bad0dcedcb7f97fb15
685687
public void tick() {
686688
if (this.getItem().isEmpty()) {
687689
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
688-
index 27568a1604d2dd5d46e836bbc25431929e218aa1..2b83262e4a13eae86df82913ce4f3121e3631a43 100644
690+
index 9ca48d759b97c636e77277aa0dded80da99fe723..058b9815be752295be60be8a479d2dc4d6ed266c 100644
689691
--- a/net/minecraft/world/entity/npc/Villager.java
690692
+++ b/net/minecraft/world/entity/npc/Villager.java
691-
@@ -265,11 +265,35 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
693+
@@ -276,11 +276,35 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
692694
return this.assignProfessionWhenSpawned;
693695
}
694696

@@ -706,7 +708,7 @@ index 27568a1604d2dd5d46e836bbc25431929e218aa1..2b83262e4a13eae86df82913ce4f3121
706708
+ this.customServerAiStep(this.level().getMinecraftWorld(), true);
707709
+ }
708710
+ }
709-
+ maybeDecayGossip();
711+
+ this.maybeDecayGossip();
710712
+ super.inactiveTick();
711713
+ }
712714
+ // Paper end - EAR 2
@@ -725,7 +727,7 @@ index 27568a1604d2dd5d46e836bbc25431929e218aa1..2b83262e4a13eae86df82913ce4f3121
725727
profilerFiller.pop();
726728
if (this.assignProfessionWhenSpawned) {
727729
this.assignProfessionWhenSpawned = false;
728-
@@ -293,7 +317,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
730+
@@ -304,7 +328,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
729731
this.lastTradedPlayer = null;
730732
}
731733

@@ -734,19 +736,19 @@ index 27568a1604d2dd5d46e836bbc25431929e218aa1..2b83262e4a13eae86df82913ce4f3121
734736
Raid raidAt = level.getRaidAt(this.blockPosition());
735737
if (raidAt != null && raidAt.isActive() && !raidAt.isOver()) {
736738
level.broadcastEntityEvent(this, (byte)42);
737-
@@ -303,6 +327,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
738-
if (this.getVillagerData().getProfession() == VillagerProfession.NONE && this.isTrading()) {
739+
@@ -315,6 +339,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
739740
this.stopTrading();
740741
}
741-
+ if (inactive) return; // Paper - EAR 2
742742

743+
+ if (inactive) return; // Paper - EAR 2
743744
super.customServerAiStep(level);
744745
}
746+
745747
diff --git a/net/minecraft/world/entity/projectile/Arrow.java b/net/minecraft/world/entity/projectile/Arrow.java
746-
index c1e09e701757a300183b62d343ded03033e63aa7..56574f8ef879159edc0114da09300143a2c79a35 100644
748+
index e684e3883cf2e09ce93ea10eeccb42e3b86f85c9..692ca85fc85f0cd75eb4464a6bb6428b808e78bc 100644
747749
--- a/net/minecraft/world/entity/projectile/Arrow.java
748750
+++ b/net/minecraft/world/entity/projectile/Arrow.java
749-
@@ -66,6 +66,16 @@ public class Arrow extends AbstractArrow {
751+
@@ -70,6 +70,16 @@ public class Arrow extends AbstractArrow {
750752
builder.define(ID_EFFECT_COLOR, -1);
751753
}
752754

@@ -764,10 +766,10 @@ index c1e09e701757a300183b62d343ded03033e63aa7..56574f8ef879159edc0114da09300143
764766
public void tick() {
765767
super.tick();
766768
diff --git a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
767-
index 7c0862c50b44555fb27ce7dc46f4ec95a3eb0022..774ca9e0b56fd175ae246051de762d0c4256ca58 100644
769+
index 34b5839cf0c6b705c3f329dd26cb36fa333f5f1e..8800d1440073d0abf1d78f58e8396c87e29b24bb 100644
768770
--- a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
769771
+++ b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
770-
@@ -102,6 +102,21 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
772+
@@ -109,6 +109,21 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
771773
return super.shouldRender(x, y, z) && !this.isAttachedToEntity();
772774
}
773775

@@ -790,18 +792,18 @@ index 7c0862c50b44555fb27ce7dc46f4ec95a3eb0022..774ca9e0b56fd175ae246051de762d0c
790792
public void tick() {
791793
super.tick();
792794
diff --git a/net/minecraft/world/entity/vehicle/MinecartHopper.java b/net/minecraft/world/entity/vehicle/MinecartHopper.java
793-
index c553cf0592dfa606dbbb1e6854d3377b9feb5efb..8341e7f01606fca90e69384c16fc19bb9e20d1b7 100644
795+
index 6162415095b030b4cc47364c56fa66236b3b0535..a56d9cdeb6589a053ffaaf2cd599a98ae0a0989a 100644
794796
--- a/net/minecraft/world/entity/vehicle/MinecartHopper.java
795797
+++ b/net/minecraft/world/entity/vehicle/MinecartHopper.java
796-
@@ -47,6 +47,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
798+
@@ -48,6 +48,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
797799
if (flag != this.isEnabled()) {
798800
this.setEnabled(flag);
799801
}
800802
+ this.immunize(); // Paper
801803
}
802804

803805
public boolean isEnabled() {
804-
@@ -100,11 +101,13 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
806+
@@ -101,11 +102,13 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
805807

806808
public boolean suckInItems() {
807809
if (HopperBlockEntity.suckInItems(this.level(), this)) {
@@ -815,7 +817,7 @@ index c553cf0592dfa606dbbb1e6854d3377b9feb5efb..8341e7f01606fca90e69384c16fc19bb
815817
return true;
816818
}
817819
}
818-
@@ -139,4 +142,11 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
820+
@@ -140,4 +143,11 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
819821
public AbstractContainerMenu createMenu(int id, Inventory playerInventory) {
820822
return new HopperMenu(id, playerInventory, this);
821823
}
@@ -828,27 +830,27 @@ index c553cf0592dfa606dbbb1e6854d3377b9feb5efb..8341e7f01606fca90e69384c16fc19bb
828830
+
829831
}
830832
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
831-
index 32f184288f6065259c921293922c1b0163df4dc4..0f346faa82b988e86834c38837f6f11bea7f31c6 100644
833+
index 50caa965e48abe2f53e197c77d4ecfe1829d1e05..f18d5dda1791206c6db241730e42c75d176420ec 100644
832834
--- a/net/minecraft/world/level/Level.java
833835
+++ b/net/minecraft/world/level/Level.java
834-
@@ -153,6 +153,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
835-
public Map<BlockPos, BlockEntity> capturedTileEntities = new java.util.LinkedHashMap<>(); // Paper - Retain block place order when capturing blockstates
836+
@@ -153,6 +153,12 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
837+
@Nullable
836838
public List<net.minecraft.world.entity.item.ItemEntity> captureDrops;
837839
public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>();
838-
+ // Paper start
840+
+ // Paper start - EAR 2
839841
+ public int wakeupInactiveRemainingAnimals;
840842
+ public int wakeupInactiveRemainingFlying;
841843
+ public int wakeupInactiveRemainingMonsters;
842844
+ public int wakeupInactiveRemainingVillagers;
843-
+ // Paper end
845+
+ // Paper end - EAR 2
844846
public boolean populating;
845847
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
846848
// Paper start - add paper world config
847849
diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
848-
index ce880bd45fbda4829d17de8507034b3a39c68cbb..ee2f8e8deb35059824b5730a1442f383dc79f01c 100644
850+
index b8ff5671ea4d4c2966620e26d9ae4132df66f0c5..a6a915619f6ac23ff0769d608fdc983b7808681e 100644
849851
--- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
850852
+++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
851-
@@ -149,6 +149,10 @@ public class PistonMovingBlockEntity extends BlockEntity {
853+
@@ -153,6 +153,10 @@ public class PistonMovingBlockEntity extends BlockEntity {
852854
}
853855

854856
entity.setDeltaMovement(d1, d2, d3);

0 commit comments

Comments
 (0)