geforkt von Mirrors/Paper
Oprimise map impl for tracked players
Reference2BooleanOpenHashMap is going to have better lookups than HashMap.
Dieser Commit ist enthalten in:
Ursprung
12321d761e
Commit
82a8294625
@ -67,19 +67,20 @@
|
|||||||
this.mainThreadExecutor = mainThreadExecutor;
|
this.mainThreadExecutor = mainThreadExecutor;
|
||||||
ConsecutiveExecutor consecutiveexecutor = new ConsecutiveExecutor(executor, "worldgen");
|
ConsecutiveExecutor consecutiveexecutor = new ConsecutiveExecutor(executor, "worldgen");
|
||||||
|
|
||||||
@@ -198,6 +235,12 @@
|
@@ -196,7 +233,13 @@
|
||||||
this.chunksToEagerlySave.add(pos.toLong());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
private void setChunkUnsaved(ChunkPos pos) {
|
||||||
|
this.chunksToEagerlySave.add(pos.toLong());
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ public int getMobCountNear(final ServerPlayer player, final net.minecraft.world.entity.MobCategory mobCategory) {
|
+ public int getMobCountNear(final ServerPlayer player, final net.minecraft.world.entity.MobCategory mobCategory) {
|
||||||
+ return -1;
|
+ return -1;
|
||||||
+ }
|
}
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
|
||||||
protected ChunkGenerator generator() {
|
protected ChunkGenerator generator() {
|
||||||
return this.worldGenContext.generator();
|
return this.worldGenContext.generator();
|
||||||
}
|
|
||||||
@@ -325,7 +368,7 @@
|
@@ -325,7 +368,7 @@
|
||||||
throw this.debugFuturesAndCreateReportedException(new IllegalStateException("At least one of the chunk futures were null"), "n/a");
|
throw this.debugFuturesAndCreateReportedException(new IllegalStateException("At least one of the chunk futures were null"), "n/a");
|
||||||
}
|
}
|
||||||
@ -357,8 +358,12 @@
|
|||||||
|
|
||||||
protected ChunkDistanceManager(final Executor workerExecutor, final Executor mainThreadExecutor) {
|
protected ChunkDistanceManager(final Executor workerExecutor, final Executor mainThreadExecutor) {
|
||||||
super(workerExecutor, mainThreadExecutor);
|
super(workerExecutor, mainThreadExecutor);
|
||||||
@@ -1424,7 +1511,7 @@
|
@@ -1421,10 +1508,10 @@
|
||||||
public final Set<ServerPlayerConnection> seenBy = Sets.newIdentityHashSet();
|
final Entity entity;
|
||||||
|
private final int range;
|
||||||
|
SectionPos lastSectionPos;
|
||||||
|
- public final Set<ServerPlayerConnection> seenBy = Sets.newIdentityHashSet();
|
||||||
|
+ public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
|
||||||
|
|
||||||
public TrackedEntity(final Entity entity, final int i, final int j, final boolean flag) {
|
public TrackedEntity(final Entity entity, final int i, final int j, final boolean flag) {
|
||||||
- this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast);
|
- this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren