re-add distance map patch

This commit is contained in:
Jake Potrebic 2023-09-22 16:26:10 -07:00
parent f6d4cdfc99
commit 99baa36800
4 changed files with 7 additions and 55 deletions

View file

@ -15,9 +15,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- 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
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this));
public boolean updatingSectionStatus = false; }
// Paper end // Paper end - optimise entity tracking
+ // Paper start - make end portalling safe + // Paper start - make end portalling safe
+ public BlockPos portalBlock; + public BlockPos portalBlock;
+ public ServerLevel portalWorld; + public ServerLevel portalWorld;

View file

@ -141,8 +141,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- } - }
+ // Paper - delay this logic for the entity tracker tick, no need to duplicate it + // Paper - delay this logic for the entity tracker tick, no need to duplicate it
int i = SectionPos.blockToSectionCoord(player.getBlockX()); SectionPos sectionposition = player.getLastSectionPos();
int j = SectionPos.blockToSectionCoord(player.getBlockZ()); SectionPos sectionposition1 = SectionPos.of((EntityAccess) player);
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
@ -187,57 +187,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return; + return;
+ } + }
+ // Paper end - optimized tracker + // Paper end - optimized tracker
// Paper - replaced by PlayerChunkLoader
List<ServerPlayer> list = Lists.newArrayList(); List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}));
// Paper end
DebugPackets.sendPoiPacketsForChunk(this.level, chunk.getPos());
- List<Entity> list = Lists.newArrayList();
- List<Entity> list1 = Lists.newArrayList();
- ObjectIterator objectiterator = this.entityMap.values().iterator();
-
- while (objectiterator.hasNext()) {
- ChunkMap.TrackedEntity playerchunkmap_entitytracker = (ChunkMap.TrackedEntity) objectiterator.next();
- Entity entity = playerchunkmap_entitytracker.entity;
-
- if (entity != player && entity.chunkPosition().equals(chunk.getPos())) {
- playerchunkmap_entitytracker.updatePlayer(player);
- if (entity instanceof Mob && ((Mob) entity).getLeashHolder() != null) {
- list.add(entity);
- }
-
- if (!entity.getPassengers().isEmpty()) {
- list1.add(entity);
- }
- }
- }
-
- Iterator iterator;
- Entity entity1;
-
- if (!list.isEmpty()) {
- iterator = list.iterator();
-
- while (iterator.hasNext()) {
- entity1 = (Entity) iterator.next();
- player.connection.send(new ClientboundSetEntityLinkPacket(entity1, ((Mob) entity1).getLeashHolder()));
- }
- }
-
- if (!list1.isEmpty()) {
- iterator = list1.iterator();
-
- while (iterator.hasNext()) {
- entity1 = (Entity) iterator.next();
- player.connection.send(new ClientboundSetPassengersPacket(entity1));
- }
- }
+ // Paper - no longer needed - this was used to account for clients bugging out since they needed a chunk to store entities, but they no longer need a chunk
}
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lastSectionPos = SectionPos.of((EntityAccess) entity); this.lastSectionPos = SectionPos.of((EntityAccess) entity);
} }