13
0
geforkt von Mirrors/Paper

Use distance map to optimise entity tracker / Misc Utils

Use the distance map to find candidate players for tracking.

This also ports a few utility changes from Tuinity
Dieser Commit ist enthalten in:
Spottedleaf 2020-05-06 03:44:47 -04:00 committet von Aikar
Ursprung d80d15174b
Commit b4e629a283
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 401ADFC9891FAAFE
102 geänderte Dateien mit 1158 neuen und 714 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
From 3837658c3b4d01d6c8ef94bc972a644eb77e222f Mon Sep 17 00:00:00 2001
From b9fa8d98289a044c4bc231ef79435e27d829a5de Mon Sep 17 00:00:00 2001
From: MiniDigger <admin@minidigger.me>
Date: Fri, 3 Jan 2020 16:24:46 +0100
Subject: [PATCH] Add Mob Goal API
@ -462,5 +462,5 @@ index 957a6016..4fecbe94 100644
/**
* Check if this is tamed
--
2.17.1
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From b2436021374f61062a581239cc1a3500edd54bb4 Mon Sep 17 00:00:00 2001
From e84c20166fcaa037639b0f5205807b1af111257f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils
@ -248,10 +248,10 @@ index 0000000000..59868f37d1
+}
diff --git a/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java b/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java
new file mode 100644
index 0000000000..07685b6bd5
index 0000000000..7bab31a312
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java
@@ -0,0 +1,172 @@
@@ -0,0 +1,202 @@
+package com.destroystokyo.paper.util.map;
+
+import com.destroystokyo.paper.util.concurrent.WeakSeqLock;
@ -300,10 +300,18 @@ index 0000000000..07685b6bd5
+ return this.updatingMap.get(k);
+ }
+
+ public boolean updatingContainsKey(final long k) {
+ return this.updatingMap.containsKey(k);
+ }
+
+ public V getVisible(final long k) {
+ return this.visibleMap.get(k);
+ }
+
+ public boolean visibleContainsKey(final long k) {
+ return this.visibleMap.containsKey(k);
+ }
+
+ public V getVisibleAsync(final long k) {
+ long readlock;
+ V ret = null;
@ -326,6 +334,28 @@ index 0000000000..07685b6bd5
+ return ret;
+ }
+
+ public boolean visibleContainsKeyAsync(final long k) {
+ long readlock;
+ boolean ret = false;
+
+ do {
+ readlock = this.updatingMapSeqLock.acquireRead();
+
+ try {
+ ret = this.visibleMap.containsKey(k);
+ } catch (final Throwable thr) {
+ if (thr instanceof ThreadDeath) {
+ throw (ThreadDeath)thr;
+ }
+ // ignore...
+ continue;
+ }
+
+ } while (!this.updatingMapSeqLock.tryReleaseRead(readlock));
+
+ return ret;
+ }
+
+ public Long2ObjectLinkedOpenHashMap<V> getVisibleMap() {
+ return this.visibleMap;
+ }
@ -1065,10 +1095,10 @@ index 0000000000..c3b936f54b
+}
diff --git a/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java
new file mode 100644
index 0000000000..f625da9f09
index 0000000000..c71ed11834
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java
@@ -0,0 +1,409 @@
@@ -0,0 +1,439 @@
+package com.destroystokyo.paper.util.misc;
+
+import com.destroystokyo.paper.util.math.IntegerUtil;
@ -1148,27 +1178,57 @@ index 0000000000..f625da9f09
+ return this.areaMap.size();
+ }
+
+ public final void update(final E object, final int chunkX, final int chunkZ, final int viewDistance) {
+ public final void addOrUpdate(final E object, final int chunkX, final int chunkZ, final int viewDistance) {
+ final int oldViewDistance = this.objectToViewDistance.put(object, viewDistance);
+ final long newPos = MCUtil.getCoordinateKey(chunkX, chunkZ);
+ final long oldPos = this.objectToLastCoordinate.put(object, newPos);
+
+ if (oldViewDistance == -1) {
+ this.objectToLastCoordinate.put(object, newPos);
+ this.addObject(object, chunkX, chunkZ, Integer.MIN_VALUE, Integer.MIN_VALUE, viewDistance);
+ this.addObjectCallback(object, chunkX, chunkZ, viewDistance);
+ } else {
+ final long oldPos = this.objectToLastCoordinate.put(object, newPos);
+ this.updateObject(object, oldPos, newPos, oldViewDistance, viewDistance);
+ this.updateObjectCallback(object, oldPos, newPos, oldViewDistance, viewDistance);
+ }
+ //this.validate(object, viewDistance);
+ }
+
+ // called after the distance map updates
+ protected void addObjectCallback(final E object, final int chunkX, final int chunkZ, final int viewDistance) {}
+ public final boolean update(final E object, final int chunkX, final int chunkZ, final int viewDistance) {
+ final int oldViewDistance = this.objectToViewDistance.replace(object, viewDistance);
+ if (oldViewDistance == -1) {
+ return false;
+ } else {
+ final long newPos = MCUtil.getCoordinateKey(chunkX, chunkZ);
+ final long oldPos = this.objectToLastCoordinate.put(object, newPos);
+ this.updateObject(object, oldPos, newPos, oldViewDistance, viewDistance);
+ this.updateObjectCallback(object, oldPos, newPos, oldViewDistance, viewDistance);
+ }
+ //this.validate(object, viewDistance);
+ return true;
+ }
+
+ // called after the distance map updates
+ protected void updateObjectCallback(final E Object, final long oldPosition, final long newPosition, final int oldViewDistance, final int newViewDistance) {}
+
+ public final boolean add(final E object, final int chunkX, final int chunkZ, final int viewDistance) {
+ final int oldViewDistance = this.objectToViewDistance.putIfAbsent(object, viewDistance);
+ if (oldViewDistance != -1) {
+ return false;
+ }
+
+ final long newPos = MCUtil.getCoordinateKey(chunkX, chunkZ);
+ this.objectToLastCoordinate.put(object, newPos);
+ this.addObject(object, chunkX, chunkZ, Integer.MIN_VALUE, Integer.MIN_VALUE, viewDistance);
+ this.addObjectCallback(object, chunkX, chunkZ, viewDistance);
+
+ //this.validate(object, viewDistance);
+
+ return true;
+ }
+
+ // called after the distance map updates
+ protected void addObjectCallback(final E object, final int chunkX, final int chunkZ, final int viewDistance) {}
+
+ public final boolean remove(final E object) {
+ final long position = this.objectToLastCoordinate.removeLong(object);
+ final int viewDistance = this.objectToViewDistance.removeInt(object);
@ -2015,6 +2075,197 @@ index 0000000000..e51104e65a
+ }
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/util/pooled/PooledObjects.java b/src/main/java/com/destroystokyo/paper/util/pooled/PooledObjects.java
new file mode 100644
index 0000000000..d4325f1f11
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/pooled/PooledObjects.java
@@ -0,0 +1,185 @@
+package com.destroystokyo.paper.util.pooled;
+
+import org.apache.commons.lang3.mutable.MutableInt;
+import java.util.ArrayDeque;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.concurrent.locks.ReentrantLock;
+
+public final class PooledObjects<E> {
+
+ public static final PooledObjects<MutableInt> POOLED_MUTABLE_INTEGERS = new PooledObjects<>(new PooledObjectHandler<MutableInt>() {
+ @Override
+ public MutableInt createNew() {
+ return new MutableInt();
+ }
+
+ @Override
+ public void onAcquire(final MutableInt value) {}
+
+ @Override
+ public void onRelease(final MutableInt value) {}
+ }, 200, -1);
+
+ private final PooledObjectHandler<E> handler;
+ private final int maxPoolSize;
+ private final int expectingThreads;
+
+ private final IsolatedPool<E> mainPool;
+ // use these under contention
+ private final IsolatedPool<E>[] contendedPools;
+
+ public PooledObjects(final PooledObjectHandler<E> handler, final int maxPoolSize, int expectingThreads) {
+ if (handler == null) {
+ throw new NullPointerException("Handler must not be null");
+ }
+ if (maxPoolSize <= 0) {
+ throw new IllegalArgumentException("Max pool size must be greater-than 0");
+ }
+ if (expectingThreads <= 0) {
+ expectingThreads = Runtime.getRuntime().availableProcessors();
+ }
+
+ this.handler = handler;
+ this.maxPoolSize = maxPoolSize;
+ this.expectingThreads = expectingThreads;
+ this.mainPool = new IsolatedPool<>(handler, maxPoolSize);
+ final IsolatedPool<E>[] contendedPools = new IsolatedPool[2 * expectingThreads];
+
+ for (int i = 0; i < contendedPools.length; ++i) {
+ contendedPools[i] = new IsolatedPool<>(handler, Math.max(1, maxPoolSize / 2));
+ }
+
+ this.contendedPools = contendedPools;
+ }
+
+ // Taken from
+ // https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
+ // https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/2016/06/25/fastrange.c
+ // Original license is public domain
+ public static int fastRandomBounded(final long randomInteger, final long limit) {
+ // randomInteger must be [0, pow(2, 32))
+ // limit must be [0, pow(2, 32))
+ return (int)((randomInteger * limit) >>> 32);
+ }
+
+ public E acquire() {
+ E ret;
+ PooledObjects.IsolatedPool<E> pooled = this.mainPool;
+ int lastIndex = -1;
+ while ((ret = pooled.tryAcquireUncontended()) == null) {
+ int index;
+ while (lastIndex == (index = fastRandomBounded(ThreadLocalRandom.current().nextInt() & 0xFFFFFFFFL, this.contendedPools.length)));
+ lastIndex = index;
+ pooled = this.contendedPools[index];
+ }
+
+ return ret;
+ }
+
+ public void release(final E value) {
+ PooledObjects.IsolatedPool<E> pooled = this.mainPool;
+ int lastIndex = -1;
+ while (!pooled.tryReleaseUncontended(value)) {
+ int index;
+ while (lastIndex == (index = fastRandomBounded(ThreadLocalRandom.current().nextInt() & 0xFFFFFFFFL, this.contendedPools.length)));
+ lastIndex = index;
+ pooled = this.contendedPools[index];
+ }
+ }
+
+ /** This object is restricted from interacting with any pool */
+ static interface PooledObjectHandler<E> {
+
+ /**
+ * Must return a non-null object
+ */
+ E createNew();
+
+ void onAcquire(final E value);
+
+ void onRelease(final E value);
+ }
+
+ protected static class IsolatedPool<E> {
+
+ protected final PooledObjectHandler<E> handler;
+
+ // We use arraydeque as it doesn't create garbage per element...
+ protected final ArrayDeque<E> pool;
+ protected final int maxPoolSize;
+
+ protected final ReentrantLock lock = new ReentrantLock();
+
+ public IsolatedPool(final PooledObjectHandler<E> handler, final int maxPoolSize) {
+ this.handler = handler;
+ this.pool = new ArrayDeque<>();
+ this.maxPoolSize = maxPoolSize;
+ }
+
+ protected E acquireOrCreateNoLock() {
+ E ret;
+
+ ret = this.pool.poll();
+
+ if (ret == null) {
+ ret = this.handler.createNew();
+ }
+ this.handler.onAcquire(ret);
+
+ return ret;
+ }
+
+ public E tryAcquireUncontended() {
+ if (!this.lock.tryLock()) {
+ return null;
+ }
+ try {
+ return this.acquireOrCreateNoLock();
+ } finally {
+ this.lock.unlock();
+ }
+ }
+
+ public E acquire() {
+ this.lock.lock();
+ try {
+ return this.acquireOrCreateNoLock();
+ } finally {
+ this.lock.unlock();
+ }
+ }
+
+ protected void releaseNoLock(final E value) {
+ if (this.pool.size() >= this.maxPoolSize) {
+ this.handler.onRelease(value);
+ return; // can't accept, we're at capacity
+ }
+
+ this.pool.add(value);
+ this.handler.onRelease(value);
+ }
+
+ public boolean tryReleaseUncontended(final E value) {
+ if (!this.lock.tryLock()) {
+ return false;
+ }
+
+ try {
+ this.releaseNoLock(value);
+ } finally {
+ this.lock.unlock();
+ }
+
+ return true;
+ }
+
+ public void release(final E value) {
+ this.lock.lock();
+ try {
+ this.releaseNoLock(value);
+ } finally {
+ this.lock.unlock();
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java
new file mode 100644
index 0000000000..9df0006c1a
@ -2136,7 +2387,7 @@ index 1cf97cefc9..2040f18349 100644
return this.d.containsKey(iblockstate);
}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index c88a62f6b7..5dbd3e60fe 100644
index c88a62f6b7..f8ac39e1b0 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -120,6 +120,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@ -2156,7 +2407,15 @@ index c88a62f6b7..5dbd3e60fe 100644
public BlockPosition immutableCopy() {
return this;
}
@@ -402,6 +405,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -264,6 +267,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
super(i, j, k);
}
+ public static BlockPosition.PooledBlockPosition acquire() { return r(); } // Paper - OBFHELPER
public static BlockPosition.PooledBlockPosition r() {
return f(0, 0, 0);
}
@@ -402,6 +406,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
return this.d;
}
@ -2164,7 +2423,7 @@ index c88a62f6b7..5dbd3e60fe 100644
public BlockPosition.MutableBlockPosition d(int i, int j, int k) {
this.b = i;
this.c = j;
@@ -413,6 +417,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -413,6 +418,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
return this.c(entity.locX(), entity.locY(), entity.locZ());
}
@ -2172,7 +2431,7 @@ index c88a62f6b7..5dbd3e60fe 100644
public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) {
return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
}
@@ -441,14 +446,17 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -441,14 +447,17 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
return this.d(this.b + i, this.c + j, this.d + k);
}
@ -2191,7 +2450,7 @@ index c88a62f6b7..5dbd3e60fe 100644
this.d = i;
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 55373cae07..c50fe1c245 100644
index 55373cae07..b39ce329aa 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
@ -2221,7 +2480,7 @@ index 55373cae07..c50fe1c245 100644
this.i = chunkconverter;
HeightMap.Type[] aheightmap_type = HeightMap.Type.values();
int j = aheightmap_type.length;
@@ -108,6 +108,93 @@ public class Chunk implements IChunkAccess {
@@ -108,6 +108,107 @@ public class Chunk implements IChunkAccess {
public boolean needsDecoration;
// CraftBukkit end
@ -2256,27 +2515,41 @@ index 55373cae07..c50fe1c245 100644
+ if (chunk == null) {
+ throw new IllegalArgumentException("Chunk must be non-null, neighbour: (" + relativeX + "," + relativeZ + "), chunk: " + this.loc);
+ }
+ final long before = this.neighbourChunksLoadedBitset;
+ final int index = getNeighbourIndex(relativeX, relativeZ);
+ this.loadedNeighbourChunks[index] = chunk;
+ this.neighbourChunksLoadedBitset |= (1L << index);
+ this.onNeighbourChange(before, this.neighbourChunksLoadedBitset);
+ }
+
+ public final void setNeighbourUnloaded(final int relativeX, final int relativeZ) {
+ final long before = this.neighbourChunksLoadedBitset;
+ final int index = getNeighbourIndex(relativeX, relativeZ);
+ this.loadedNeighbourChunks[index] = null;
+ this.neighbourChunksLoadedBitset &= ~(1L << index);
+ this.onNeighbourChange(before, this.neighbourChunksLoadedBitset);
+ }
+
+ public final void resetNeighbours() {
+ final long before = this.neighbourChunksLoadedBitset;
+ this.neighbourChunksLoadedBitset = 0L;
+ java.util.Arrays.fill(this.loadedNeighbourChunks, null);
+ this.onNeighbourChange(before, 0L);
+ }
+
+ protected void onNeighbourChange(final long bitsetBefore, final long bitsetAfter) {
+
+ }
+
+ public final boolean areNeighboursLoaded(final int radius) {
+ return Chunk.areNeighboursLoaded(this.neighbourChunksLoadedBitset, radius);
+ }
+
+ public static boolean areNeighboursLoaded(final long bitset, final int radius) {
+ // index = relativeX + (relativeZ * (NEIGHBOUR_CACHE_RADIUS * 2 + 1)) + (NEIGHBOUR_CACHE_RADIUS + NEIGHBOUR_CACHE_RADIUS * ((NEIGHBOUR_CACHE_RADIUS * 2 + 1)))
+ switch (radius) {
+ case 0: {
+ return this.loadedTicketLevel;
+ return (bitset & (1L << getNeighbourIndex(0, 0))) != 0;
+ }
+ case 1: {
+ long mask = 0L;
@ -2285,7 +2558,7 @@ index 55373cae07..c50fe1c245 100644
+ mask |= (1L << getNeighbourIndex(dx, dz));
+ }
+ }
+ return (this.neighbourChunksLoadedBitset & mask) == mask;
+ return (bitset & mask) == mask;
+ }
+ case 2: {
+ long mask = 0L;
@ -2294,7 +2567,7 @@ index 55373cae07..c50fe1c245 100644
+ mask |= (1L << getNeighbourIndex(dx, dz));
+ }
+ }
+ return (this.neighbourChunksLoadedBitset & mask) == mask;
+ return (bitset & mask) == mask;
+ }
+ case 3: {
+ long mask = 0L;
@ -2303,7 +2576,7 @@ index 55373cae07..c50fe1c245 100644
+ mask |= (1L << getNeighbourIndex(dx, dz));
+ }
+ }
+ return (this.neighbourChunksLoadedBitset & mask) == mask;
+ return (bitset & mask) == mask;
+ }
+
+ default:
@ -2315,7 +2588,7 @@ index 55373cae07..c50fe1c245 100644
public Chunk(World world, ProtoChunk protochunk) {
this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null);
Iterator iterator = protochunk.y().iterator();
@@ -213,6 +300,18 @@ public class Chunk implements IChunkAccess {
@@ -213,6 +314,18 @@ public class Chunk implements IChunkAccess {
}
}
@ -2334,7 +2607,7 @@ index 55373cae07..c50fe1c245 100644
@Override
public Fluid getFluid(BlockPosition blockposition) {
return this.a(blockposition.getX(), blockposition.getY(), blockposition.getZ());
@@ -352,6 +451,7 @@ public class Chunk implements IChunkAccess {
@@ -352,6 +465,7 @@ public class Chunk implements IChunkAccess {
entity.chunkX = this.loc.x;
entity.chunkY = k;
entity.chunkZ = this.loc.z;
@ -2342,7 +2615,7 @@ index 55373cae07..c50fe1c245 100644
this.entitySlices[k].add(entity);
}
@@ -374,6 +474,7 @@ public class Chunk implements IChunkAccess {
@@ -374,6 +488,7 @@ public class Chunk implements IChunkAccess {
}
this.entitySlices[i].remove(entity);
@ -2350,7 +2623,7 @@ index 55373cae07..c50fe1c245 100644
}
@Override
@@ -395,6 +496,7 @@ public class Chunk implements IChunkAccess {
@@ -395,6 +510,7 @@ public class Chunk implements IChunkAccess {
return this.a(blockposition, Chunk.EnumTileEntityState.CHECK);
}
@ -2358,7 +2631,7 @@ index 55373cae07..c50fe1c245 100644
@Nullable
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
// CraftBukkit start
@@ -506,7 +608,25 @@ public class Chunk implements IChunkAccess {
@@ -506,7 +622,25 @@ public class Chunk implements IChunkAccess {
// CraftBukkit start
public void loadCallback() {
@ -2384,7 +2657,7 @@ index 55373cae07..c50fe1c245 100644
if (server != null) {
/*
* If it's a new world, the first few chunks are generated inside
@@ -545,6 +665,22 @@ public class Chunk implements IChunkAccess {
@@ -545,6 +679,22 @@ public class Chunk implements IChunkAccess {
server.getPluginManager().callEvent(unloadEvent);
// note: saving can be prevented, but not forced if no saving is actually required
this.mustNotSave = !unloadEvent.isSaveChunk();
@ -3704,10 +3977,10 @@ index 5c5bf010d0..6e9f402fb0 100644
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 7ad30548e2..93d838ec2d 100644
index 7ad30548e2..b505244516 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -99,6 +99,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -99,6 +99,28 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
};
// CraftBukkit end
@ -3715,26 +3988,19 @@ index 7ad30548e2..93d838ec2d 100644
+ private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<EntityPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
+
+ void addPlayerToDistanceMaps(EntityPlayer player) {
+ this.updateMaps(player);
+
+
+
+ int chunkX = MCUtil.getChunkCoordinate(player.locX());
+ int chunkZ = MCUtil.getChunkCoordinate(player.locZ());
+ // Note: players need to be explicitly added to distance maps before they can be updated
+ }
+
+ void removePlayerFromDistanceMaps(EntityPlayer player) {
+
+
+
+
+ }
+
+ void updateMaps(EntityPlayer player) {
+ int chunkX = MCUtil.getChunkCoordinate(player.locX());
+ int chunkZ = MCUtil.getChunkCoordinate(player.locZ());
+
+
+
+
+ // Note: players need to be explicitly added to distance maps before they can be updated
+ }
+
+
@ -3743,7 +4009,38 @@ index 7ad30548e2..93d838ec2d 100644
public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator<?> chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i) {
super(new File(worldserver.getWorldProvider().getDimensionManager().a(file), "region"), datafixer);
this.visibleChunks = this.updatingChunks.clone();
@@ -984,6 +1013,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -187,6 +209,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
};
}
+ // Paper start
+ public final int getEffectiveViewDistance() {
+ // TODO this needs to be checked on update
+ // Mojang currently sets it to +1 of the configured view distance. So subtract one to get the one we really want.
+ return this.viewDistance - 1;
+ }
+ // Paper end
+
private CompletableFuture<Either<List<IChunkAccess>, PlayerChunk.Failure>> a(ChunkCoordIntPair chunkcoordintpair, int i, IntFunction<ChunkStatus> intfunction) {
List<CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>>> list = Lists.newArrayList();
int j = chunkcoordintpair.x;
@@ -867,6 +897,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (!flag1) {
this.chunkDistanceManager.a(SectionPosition.a((Entity) entityplayer), entityplayer);
}
+ this.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps
} else {
SectionPosition sectionposition = entityplayer.K();
@@ -874,6 +905,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (!flag2) {
this.chunkDistanceManager.b(sectionposition, entityplayer);
}
+ this.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps
}
for (int k = i - this.viewDistance; k <= i + this.viewDistance; ++k) {
@@ -984,6 +1016,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@ -3961,26 +4258,6 @@ index 2e1eabba14..2a4fa455ff 100644
Fluid fluid = this.getFluid(blockposition);
return this.setTypeAndData(blockposition, fluid.getBlockData(), 3 | (flag ? 64 : 0));
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index d5014abc9d..8a5ac6f69b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -973,6 +973,7 @@ public class WorldServer extends World {
}
this.registerEntity(entityplayer);
+ this.getChunkProvider().playerChunkMap.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps
}
// CraftBukkit start
@@ -1115,6 +1116,7 @@ public class WorldServer extends World {
EntityPlayer entityplayer = (EntityPlayer) entity;
this.players.remove(entityplayer);
+ this.getChunkProvider().playerChunkMap.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps
}
this.getScoreboard().a(entity);
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index e181df6f4d..4a9132c701 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@ -4034,5 +4311,5 @@ index 1aec70a1f1..f72c13beda 100644
private int initialCapacity;
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 501904519947a10ca310e0db3b92828950e3a027 Mon Sep 17 00:00:00 2001
From e969742b4a74d232455d49d51ce3ac8c0c915e05 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 02:10:36 -0400
Subject: [PATCH] Store reference to current Chunk for Entity and Block
@ -8,7 +8,7 @@ This enables us a fast reference to the entities current chunk instead
of having to look it up by hashmap lookups.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index c50fe1c245..061384b012 100644
index b39ce329aa..4d7dc71474 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -29,7 +29,7 @@ public class Chunk implements IChunkAccess {
@ -58,7 +58,7 @@ index c50fe1c245..061384b012 100644
this.l = Maps.newHashMap();
this.m = Maps.newHashMap();
this.n = new ShortList[16];
@@ -448,6 +473,7 @@ public class Chunk implements IChunkAccess {
@@ -462,6 +487,7 @@ public class Chunk implements IChunkAccess {
}
entity.inChunk = true;
@ -66,7 +66,7 @@ index c50fe1c245..061384b012 100644
entity.chunkX = this.loc.x;
entity.chunkY = k;
entity.chunkZ = this.loc.z;
@@ -460,6 +486,7 @@ public class Chunk implements IChunkAccess {
@@ -474,6 +500,7 @@ public class Chunk implements IChunkAccess {
((HeightMap) this.heightMap.get(heightmap_type)).a(along);
}
@ -74,7 +74,7 @@ index c50fe1c245..061384b012 100644
public void b(Entity entity) {
this.a(entity, entity.chunkY);
}
@@ -473,7 +500,12 @@ public class Chunk implements IChunkAccess {
@@ -487,7 +514,12 @@ public class Chunk implements IChunkAccess {
i = this.entitySlices.length - 1;
}
@ -200,5 +200,5 @@ index 056525526e..5a047dd682 100644
/*
* Order is *EXTREMELY* important -- keep it right! =D
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From ecf43fc4577369da779f08aa2b5c9a3ba2a248cb Mon Sep 17 00:00:00 2001
From 8c353e9c2c1388d62b4b73c47d18c629f4a5682b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 02:13:59 -0400
Subject: [PATCH] Store counts for each Entity/Block Entity Type
@ -6,7 +6,7 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type
Opens door for future patches to optimize performance
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 061384b012..2b6fe2e01d 100644
index 4d7dc71474..a144f4ef56 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -56,15 +56,19 @@ public class Chunk implements IChunkAccess {
@ -37,7 +37,7 @@ index 061384b012..2b6fe2e01d 100644
}
return removed;
}
@@ -472,6 +477,7 @@ public class Chunk implements IChunkAccess {
@@ -486,6 +491,7 @@ public class Chunk implements IChunkAccess {
k = this.entitySlices.length - 1;
}
@ -45,7 +45,7 @@ index 061384b012..2b6fe2e01d 100644
entity.inChunk = true;
entity.setCurrentChunk(this); // Paper
entity.chunkX = this.loc.x;
@@ -505,6 +511,7 @@ public class Chunk implements IChunkAccess {
@@ -519,6 +525,7 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}
@ -54,5 +54,5 @@ index 061384b012..2b6fe2e01d 100644
this.entities.remove(entity); // Paper
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f0fe55e3dd96e50f2eb4a56ca5a601d8e0c89a6a Mon Sep 17 00:00:00 2001
From 3ebd9a34ff56a4ff3f3ff262e9f6ca4059e9363e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 04:00:11 -0600
Subject: [PATCH] Timings v2
@ -343,10 +343,10 @@ index cd72a9c845..5de881371a 100644
private final float frictionFactor;
private final float f;
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 2b6fe2e01d..4cd353b253 100644
index a144f4ef56..352bb787fd 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -675,6 +675,7 @@ public class Chunk implements IChunkAccess {
@@ -689,6 +689,7 @@ public class Chunk implements IChunkAccess {
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(this.bukkitChunk, this.needsDecoration));
if (this.needsDecoration) {
@ -354,7 +354,7 @@ index 2b6fe2e01d..4cd353b253 100644
this.needsDecoration = false;
java.util.Random random = new java.util.Random();
random.setSeed(world.getSeed());
@@ -694,6 +695,7 @@ public class Chunk implements IChunkAccess {
@@ -708,6 +709,7 @@ public class Chunk implements IChunkAccess {
}
}
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
@ -934,7 +934,7 @@ index b4a0bd7951..67bdd57747 100644
this.methodProfiler.exit();
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 93d838ec2d..5e31b65e16 100644
index b505244516..65134c8777 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1,7 +1,9 @@
@ -947,7 +947,7 @@ index 93d838ec2d..5e31b65e16 100644
import com.google.common.collect.Lists;
import com.google.common.collect.Queues;
import com.google.common.collect.Sets;
@@ -506,11 +508,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -507,11 +509,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> f(ChunkCoordIntPair chunkcoordintpair) {
return CompletableFuture.supplyAsync(() -> {
@ -965,7 +965,7 @@ index 93d838ec2d..5e31b65e16 100644
boolean flag = nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8);
if (flag) {
@@ -521,7 +526,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -522,7 +527,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
PlayerChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", chunkcoordintpair);
@ -974,7 +974,7 @@ index 93d838ec2d..5e31b65e16 100644
} catch (ReportedException reportedexception) {
Throwable throwable = reportedexception.getCause();
@@ -548,7 +553,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -549,7 +554,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return "chunkGenerate " + chunkstatus.d();
});
return completablefuture.thenComposeAsync((either) -> {
@ -983,7 +983,7 @@ index 93d838ec2d..5e31b65e16 100644
try {
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture1 = chunkstatus.a(this.world, this.chunkGenerator, this.definedStructureManager, this.lightEngine, (ichunkaccess) -> {
return this.c(playerchunk);
@@ -601,6 +606,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -602,6 +607,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
ChunkStatus chunkstatus = PlayerChunk.getChunkStatus(playerchunk.getTicketLevel());
return !chunkstatus.b(ChunkStatus.FULL) ? PlayerChunk.UNLOADED_CHUNK_ACCESS : either.mapLeft((ichunkaccess) -> {
@ -991,7 +991,7 @@ index 93d838ec2d..5e31b65e16 100644
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
Chunk chunk;
@@ -652,6 +658,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -653,6 +659,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
return chunk;
@ -999,7 +999,7 @@ index 93d838ec2d..5e31b65e16 100644
});
}, (runnable) -> {
Mailbox mailbox = this.mailboxMain;
@@ -1091,6 +1098,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1094,6 +1101,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PlayerChunkMap.EntityTracker playerchunkmap_entitytracker;
ObjectIterator objectiterator;
@ -1007,7 +1007,7 @@ index 93d838ec2d..5e31b65e16 100644
for (objectiterator = this.trackedEntities.values().iterator(); objectiterator.hasNext(); playerchunkmap_entitytracker.trackerEntry.a()) {
playerchunkmap_entitytracker = (PlayerChunkMap.EntityTracker) objectiterator.next();
@@ -1108,16 +1116,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1111,16 +1119,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
playerchunkmap_entitytracker.e = sectionposition1;
}
}
@ -1260,7 +1260,7 @@ index 2a4fa455ff..f572c5f227 100644
CrashReport crashreport = CrashReport.a(throwable, "Ticking entity");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being ticked");
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 8a5ac6f69b..6810d49b17 100644
index d5014abc9d..38a71bca2f 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1,6 +1,8 @@
@ -1870,5 +1870,5 @@ index ca7789b5e0..4423839697 100644
}
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,14 +1,14 @@
From 7d9ffa2cd54f434e0c356777203796fb62c3a137 Mon Sep 17 00:00:00 2001
From f2cfab87a7d62010dd7e2d7c9e23d72e302d1bf6 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 15:08:03 -0600
Subject: [PATCH] Remove invalid mob spawner tile entities
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 4cd353b253..56d740fcad 100644
index 352bb787fd..687e609cab 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -590,6 +590,10 @@ public class Chunk implements IChunkAccess {
@@ -604,6 +604,10 @@ public class Chunk implements IChunkAccess {
}
// CraftBukkit start
@ -20,5 +20,5 @@ index 4cd353b253..56d740fcad 100644
System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()
+ " (" + getType(blockposition) + ") where there was no entity tile!");
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From d02bc60a955773b5851092ecfc25439317cc4fdb Mon Sep 17 00:00:00 2001
From 9294ce1bcbd8799c239b4016a04637ef70470340 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 23:45:08 -0600
Subject: [PATCH] Entity Origin API
@ -101,10 +101,10 @@ index 5406f4c40f..d778eac45d 100644
if (i >= 0 && i < this.list.size()) {
NBTBase nbtbase = (NBTBase) this.list.get(i);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 6810d49b17..450b414298 100644
index 38a71bca2f..351825ebec 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1180,6 +1180,11 @@ public class WorldServer extends World {
@@ -1178,6 +1178,11 @@ public class WorldServer extends World {
this.navigators.add(((EntityInsentient) entity).getNavigation());
}
entity.valid = true; // CraftBukkit
@ -134,5 +134,5 @@ index 5a047dd682..5625e5bda2 100644
+ // Paper end
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 10395b6165373c7b9fee5ad40e085d90e2d121e1 Mon Sep 17 00:00:00 2001
From 29462b1030a7b988922e9e4b7bedcad81158195b Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Wed, 2 Mar 2016 23:13:07 -0600
Subject: [PATCH] Send absolute position the first time an entity is seen
@ -77,10 +77,10 @@ index a75e0ec54e..a13fd9b340 100644
this.c();
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 5e31b65e16..d49f456f73 100644
index 65134c8777..eece2f689c 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1217,10 +1217,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1220,10 +1220,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private final Entity tracker;
private final int trackingDistance;
private SectionPosition e;
@ -97,7 +97,7 @@ index 5e31b65e16..d49f456f73 100644
this.tracker = entity;
this.trackingDistance = i;
this.e = SectionPosition.a(entity);
@@ -1302,7 +1306,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1305,7 +1309,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
entityplayer.removeQueue.remove(Integer.valueOf(this.tracker.getId()));
// CraftBukkit end
@ -107,5 +107,5 @@ index 5e31b65e16..d49f456f73 100644
}
} else if (this.trackedPlayers.remove(entityplayer)) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 2442a75dde041601a119e270ac0db9fbea769b3a Mon Sep 17 00:00:00 2001
From 9f2aaaba2db42bdb16c50970b27d088680156f7a Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <joe@ibj.io>
Date: Thu, 3 Mar 2016 03:15:41 -0600
Subject: [PATCH] Add exception reporting event
@ -49,7 +49,7 @@ index 0000000000..f699ce18ca
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 56d740fcad..39e77f8248 100644
index 687e609cab..8f3eee5ea8 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1,5 +1,6 @@
@ -59,7 +59,7 @@ index 56d740fcad..39e77f8248 100644
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
@@ -595,10 +596,15 @@ public class Chunk implements IChunkAccess {
@@ -609,10 +610,15 @@ public class Chunk implements IChunkAccess {
this.tileEntities.remove(blockposition);
// Paper end
} else {
@ -121,10 +121,10 @@ index c9c2b00251..1422503e11 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index d49f456f73..a79e4cef4a 100644
index eece2f689c..6374bf8785 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -727,6 +727,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -728,6 +728,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.world.checkSession();
} catch (ExceptionWorldConflict exceptionworldconflict) {
PlayerChunkMap.LOGGER.error("Couldn't save chunk; already in use by another instance of Minecraft?", exceptionworldconflict);
@ -132,7 +132,7 @@ index d49f456f73..a79e4cef4a 100644
return false;
}
@@ -755,6 +756,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -756,6 +757,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return true;
} catch (Exception exception) {
PlayerChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception);
@ -306,5 +306,5 @@ index db433ed370..d05a9ae0fb 100644
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 1e4ea523df36a1139d0fd88aefe3e9848c908748 Mon Sep 17 00:00:00 2001
From f986e8a7704f1cd279cfac3c7abad36b88d111ce Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 02:07:55 -0600
Subject: [PATCH] Optimize isValidLocation, getType and getBlockData for inling
@ -31,10 +31,10 @@ index a3b5793e48..71089442c1 100644
public BaseBlockPosition(int i, int j, int k) {
this.a = i;
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 39e77f8248..7ddf6592f7 100644
index 8f3eee5ea8..4b162a768e 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -290,12 +290,24 @@ public class Chunk implements IChunkAccess {
@@ -304,12 +304,24 @@ public class Chunk implements IChunkAccess {
return this.sections;
}
@ -95,5 +95,5 @@ index e7337fc368..6b1ff8f64f 100644
public static boolean b(int i) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,14 +1,14 @@
From 8329fdefafcca151133f8a8aa87fc35172878fa3 Mon Sep 17 00:00:00 2001
From 80a2bc8af10d734cb39781889e1caa58099ea2c7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:32:58 -0400
Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 9d0edf5382..fd42f34004 100644
index 3769f0533d..f8d1cb0231 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1148,7 +1148,7 @@ public class WorldServer extends World {
@@ -1146,7 +1146,7 @@ public class WorldServer extends World {
if (entity instanceof EntityInsentient) {
this.navigators.remove(((EntityInsentient) entity).getNavigation());
}
@ -17,7 +17,7 @@ index 9d0edf5382..fd42f34004 100644
entity.valid = false; // CraftBukkit
}
@@ -1186,6 +1186,7 @@ public class WorldServer extends World {
@@ -1184,6 +1184,7 @@ public class WorldServer extends World {
entity.origin = entity.getBukkitEntity().getLocation();
}
// Paper end
@ -26,5 +26,5 @@ index 9d0edf5382..fd42f34004 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From b106a1543eb979b48adef29d0218e74cd85d9e61 Mon Sep 17 00:00:00 2001
From c2263eb09808a1b09eb8c356ddb3779a397ad21a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:46:14 -0400
Subject: [PATCH] Configurable Chunk Inhabited Time
@ -30,10 +30,10 @@ index 6ef0e1399e..5872e6b171 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7ddf6592f7..d1761ff3c4 100644
index 4b162a768e..6694d0e36c 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -956,7 +956,7 @@ public class Chunk implements IChunkAccess {
@@ -970,7 +970,7 @@ public class Chunk implements IChunkAccess {
@Override
public long getInhabitedTime() {
@ -43,5 +43,5 @@ index 7ddf6592f7..d1761ff3c4 100644
@Override
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From a97b7b1b9b1c5929aaffda2925dcc329b4526c18 Mon Sep 17 00:00:00 2001
From a4f8c250978dfb502b0fb75ef5b15bf9481f0e9a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 00:25:28 -0400
Subject: [PATCH] Remove unused World Tile Entity List
@ -67,10 +67,10 @@ index aaedbaf4d7..0e8d31babd 100644
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index fd42f34004..6f66c38650 100644
index f8d1cb0231..f46da0e8a0 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1633,7 +1633,7 @@ public class WorldServer extends World {
@@ -1631,7 +1631,7 @@ public class WorldServer extends World {
}
bufferedwriter.write(String.format("entities: %d\n", this.entitiesById.size()));
@ -79,7 +79,7 @@ index fd42f34004..6f66c38650 100644
bufferedwriter.write(String.format("block_ticks: %d\n", this.getBlockTickList().a()));
bufferedwriter.write(String.format("fluid_ticks: %d\n", this.getFluidTickList().a()));
bufferedwriter.write("distance_manager: " + playerchunkmap.e().c() + "\n");
@@ -1796,7 +1796,7 @@ public class WorldServer extends World {
@@ -1794,7 +1794,7 @@ public class WorldServer extends World {
private void a(Writer writer) throws IOException {
CSVWriter csvwriter = CSVWriter.a().a("x").a("y").a("z").a("type").a(writer);
@ -89,5 +89,5 @@ index fd42f34004..6f66c38650 100644
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 8fc2a9f39c35e1b30d5cee04f39002520ba81186 Mon Sep 17 00:00:00 2001
From 2915b6164a366517b15f6ba175b76e949c3c19b1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Apr 2016 20:02:00 -0400
Subject: [PATCH] Improve Maps (in item frames) performance and bug fixes
@ -102,10 +102,10 @@ index a56ac3da80..2f1be1995d 100644
for ( org.bukkit.map.MapCursor cursor : render.cursors) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 6f66c38650..40c9cba760 100644
index f46da0e8a0..6271fb2092 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1109,6 +1109,7 @@ public class WorldServer extends World {
@@ -1108,6 +1108,7 @@ public class WorldServer extends World {
{
if ( iter.next().trackee == entity )
{
@ -127,5 +127,5 @@ index 256a131781..5768cd512e 100644
public RenderData() {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 0b2ec2fe2555ad78369bf25ddb552d6a3f03edbc Mon Sep 17 00:00:00 2001
From c645776c533b1d5a34749e7882d577dfbe87d117 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 21 Jun 2016 22:54:34 -0400
Subject: [PATCH] Fix Double World Add issues
@ -8,10 +8,10 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added.
Also add debug if something else tries to, and abort before world gets bad state
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 40c9cba760..3004270455 100644
index 6271fb2092..3508fd7084 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -998,6 +998,7 @@ public class WorldServer extends World {
@@ -997,6 +997,7 @@ public class WorldServer extends World {
// CraftBukkit start
private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
@ -20,5 +20,5 @@ index 40c9cba760..3004270455 100644
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit
return false;
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 6f764fa39b2b86ce5152769b4cab6a32dca28a6d Mon Sep 17 00:00:00 2001
From cd4ec6fc6a45b34dc15ad63f669bd12e8bc91be5 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 5 Oct 2016 16:27:36 -0500
Subject: [PATCH] Option to remove corrupt tile entities
@ -19,10 +19,10 @@ index 8cf3076f4e..721eceeffc 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index d1761ff3c4..e66bbb7ee3 100644
index 6694d0e36c..87d68a3e21 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -616,6 +616,12 @@ public class Chunk implements IChunkAccess {
@@ -630,6 +630,12 @@ public class Chunk implements IChunkAccess {
"Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16));
e.printStackTrace();
ServerInternalException.reportInternalException(e);
@ -36,5 +36,5 @@ index d1761ff3c4..e66bbb7ee3 100644
// CraftBukkit end
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,14 +1,14 @@
From 2e0c912fa929d7d6fffe7cc9da9c1027eff4ac03 Mon Sep 17 00:00:00 2001
From a87b8cf80a36016fbd3dcd7bec2fd18a97dfb30d Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 7 Feb 2017 16:55:35 -0600
Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index a79e4cef4a..a851997e5f 100644
index 6374bf8785..0edba59675 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -139,7 +139,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -132,7 +132,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.u = new AtomicInteger();
this.playerMap = new PlayerMap();
this.trackedEntities = new Int2ObjectOpenHashMap();
@ -17,7 +17,7 @@ index a79e4cef4a..a851997e5f 100644
this.definedStructureManager = definedstructuremanager;
this.w = worldserver.getWorldProvider().getDimensionManager().a(file);
this.world = worldserver;
@@ -389,7 +389,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -390,7 +390,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Spigot start
org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant;
activityAccountant.startActivity(0.5);
@ -26,7 +26,7 @@ index a79e4cef4a..a851997e5f 100644
// Spigot end
while (longiterator.hasNext()) { // Spigot
long j = longiterator.nextLong();
@@ -411,7 +411,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -412,7 +412,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
Runnable runnable;
@ -37,5 +37,5 @@ index a79e4cef4a..a851997e5f 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 7c4c7ea9a0240c869dbae6cc55f56a13cfd58cf9 Mon Sep 17 00:00:00 2001
From ca9958e43d57e7f1c3d78791a939fe61a3e1ac71 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 14 Jan 2018 17:36:02 -0500
Subject: [PATCH] PlayerNaturallySpawnCreaturesEvent
@ -48,10 +48,10 @@ index bf32997c42..88692d9eae 100644
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<EntityPlayer> cachedSingleHashSet; // Paper
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index a851997e5f..175734b50c 100644
index 0edba59675..7804cc0f6a 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -881,12 +881,23 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -882,12 +882,23 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
chunkRange = (chunkRange > world.spigotConfig.viewDistance) ? (byte) world.spigotConfig.viewDistance : chunkRange;
chunkRange = (chunkRange > 8) ? 8 : chunkRange;
@ -78,5 +78,5 @@ index a851997e5f..175734b50c 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From b01cce47551a1f739f0db7b9b033b19f653bd07e Mon Sep 17 00:00:00 2001
From 5135255c143e00b805f7c143b41f08faa889f1b8 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 15 Aug 2017 22:29:12 -0400
Subject: [PATCH] Expand World.spawnParticle API and add Builder
@ -10,7 +10,7 @@ Adds an option to control the force mode of the particle.
This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index eb99f3a967..da391e945c 100644
index 7417725363..60f936f2e5 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -56,7 +56,7 @@ public class WorldServer extends World {
@ -22,7 +22,7 @@ index eb99f3a967..da391e945c 100644
boolean tickingEntities;
private final MinecraftServer server;
private final WorldNBTStorage dataManager;
@@ -1406,12 +1406,17 @@ public class WorldServer extends World {
@@ -1404,12 +1404,17 @@ public class WorldServer extends World {
}
public <T extends ParticleParam> int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) {
@ -66,5 +66,5 @@ index 265af7ac7f..d6e101ca9f 100644
x, y, z, // Position
count, // Count
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From dbee3dc8c2471fbf5ea6d138d1a0b213e9dc6d0c Mon Sep 17 00:00:00 2001
From 7129c46b81098d87e81839acba7e950d4df11b1c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 3 Jul 2018 21:56:23 -0400
Subject: [PATCH] InventoryCloseEvent Reason API
@ -114,10 +114,10 @@ index a61815c794..5ae0927c14 100644
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game");
cserver.getPluginManager().callEvent(playerQuitEvent);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index da391e945c..c5b4218b44 100644
index 60f936f2e5..7c1a748c9b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1051,7 +1051,7 @@ public class WorldServer extends World {
@@ -1050,7 +1050,7 @@ public class WorldServer extends World {
{
if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity )
{
@ -126,7 +126,7 @@ index da391e945c..c5b4218b44 100644
}
}
}
@@ -1074,7 +1074,7 @@ public class WorldServer extends World {
@@ -1073,7 +1073,7 @@ public class WorldServer extends World {
{
if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity )
{
@ -193,5 +193,5 @@ index 7593159fd6..fc3d9efd84 100644
human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity());
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 8c896a05ac40b3c7b64c3f40f28564fca68978c0 Mon Sep 17 00:00:00 2001
From dc900155f5ba16d321383bb5a0471fdcace51771 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 19 Jul 2018 01:08:05 -0400
Subject: [PATCH] Re-add vanilla entity warnings for duplicates
@ -8,10 +8,10 @@ These are a critical sign that somethin went wrong, and you've lost some data...
We should kind of know about these things you know.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index c5b4218b44..4cbf390ce0 100644
index 7c1a748c9b..25e2a6580a 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1036,7 +1036,8 @@ public class WorldServer extends World {
@@ -1035,7 +1035,8 @@ public class WorldServer extends World {
if (entity1 == null) {
return false;
} else {
@ -22,5 +22,5 @@ index c5b4218b44..4cbf390ce0 100644
}
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From caee0bbdf5a85c3e27b138db956bd79b9e6cc1ce Mon Sep 17 00:00:00 2001
From 6233a75f58064fdd417c5a90bc98a4d4f3f156ef Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 21 Jul 2018 08:25:40 -0400
Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
@ -19,10 +19,10 @@ index 2ac396dd17..3043b87cf7 100644
if (bukkitEntity == null) {
bukkitEntity = CraftEntity.getEntity(world.getServer(), this);
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 175734b50c..2c7e611663 100644
index 7804cc0f6a..4ee26ff08f 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1061,6 +1061,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1064,6 +1064,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
} else {
PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = new PlayerChunkMap.EntityTracker(entity, i, j, entitytypes.isDeltaTracking());
@ -30,7 +30,7 @@ index 175734b50c..2c7e611663 100644
this.trackedEntities.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.track(this.world.getPlayers());
if (entity instanceof EntityPlayer) {
@@ -1103,7 +1104,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1106,7 +1107,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.a();
}
@ -52,7 +52,7 @@ index 2f57c7bc76..a1c33c525c 100644
public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 4cbf390ce0..6ce7f77a5e 100644
index 25e2a6580a..02d9c754b1 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -76,6 +76,9 @@ public class WorldServer extends World {
@ -65,7 +65,7 @@ index 4cbf390ce0..6ce7f77a5e 100644
// Add env and gen to constructor
public WorldServer(MinecraftServer minecraftserver, Executor executor, WorldNBTStorage worldnbtstorage, WorldData worlddata, DimensionManager dimensionmanager, GameProfilerFiller gameprofilerfiller, WorldLoadListener worldloadlistener, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
@@ -998,8 +1001,28 @@ public class WorldServer extends World {
@@ -997,8 +1000,28 @@ public class WorldServer extends World {
// CraftBukkit start
private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
@ -95,7 +95,7 @@ index 4cbf390ce0..6ce7f77a5e 100644
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit
return false;
} else if (this.isUUIDTaken(entity)) {
@@ -1172,7 +1195,24 @@ public class WorldServer extends World {
@@ -1170,7 +1193,24 @@ public class WorldServer extends World {
}
}
@ -122,5 +122,5 @@ index 4cbf390ce0..6ce7f77a5e 100644
// CraftBukkit start - SPIGOT-5278
if (entity instanceof EntityDrowned) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 9efee604d673435c8097e6cf3d4f6df62b2f06b5 Mon Sep 17 00:00:00 2001
From 861f8567f99a27430b0a35965cc0d5a7bc0fc382 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Wed, 30 Nov 2016 20:56:58 -0600
Subject: [PATCH] Speedup BlockPos by fixing inlining
@ -110,10 +110,10 @@ index 71089442c1..c439a8d019 100644
return (int) (f + f1 + f2);
}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 5dbd3e60fe..e9ea232a78 100644
index f8ac39e1b0..0ab2b23440 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -342,11 +342,13 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -343,11 +343,13 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
}
public static class MutableBlockPosition extends BlockPosition {
@ -129,7 +129,7 @@ index 5dbd3e60fe..e9ea232a78 100644
public MutableBlockPosition() {
this(0, 0, 0);
}
@@ -356,10 +358,13 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -357,10 +359,13 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
}
public MutableBlockPosition(int i, int j, int k) {
@ -145,7 +145,7 @@ index 5dbd3e60fe..e9ea232a78 100644
}
public MutableBlockPosition(double d0, double d1, double d2) {
@@ -390,6 +395,9 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -391,6 +396,9 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
return super.a(enumblockrotation).immutableCopy();
}
@ -155,7 +155,7 @@ index 5dbd3e60fe..e9ea232a78 100644
@Override
public int getX() {
return this.b;
@@ -403,13 +411,16 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -404,13 +412,16 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@Override
public int getZ() {
return this.d;
@ -176,7 +176,7 @@ index 5dbd3e60fe..e9ea232a78 100644
return this;
}
@@ -439,26 +450,26 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -440,26 +451,26 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
}
public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) {
@ -209,5 +209,5 @@ index 5dbd3e60fe..e9ea232a78 100644
@Override
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 3af39fc278241d8b09966f6443402ebbe999a09c Mon Sep 17 00:00:00 2001
From a82657f16a14fa3516aa95a47b42f9457e7b77e4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 23 Jul 2018 22:18:31 -0400
Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
@ -6,10 +6,10 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index e66bbb7ee3..803afed60d 100644
index 87d68a3e21..6a40dddf46 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -498,6 +498,7 @@ public class Chunk implements IChunkAccess {
@@ -512,6 +512,7 @@ public class Chunk implements IChunkAccess {
entity.chunkZ = this.loc.z;
this.entities.add(entity); // Paper - per chunk entity list
this.entitySlices[k].add(entity);
@ -17,7 +17,7 @@ index e66bbb7ee3..803afed60d 100644
}
@Override
@@ -525,6 +526,7 @@ public class Chunk implements IChunkAccess {
@@ -539,6 +540,7 @@ public class Chunk implements IChunkAccess {
return;
}
entityCounts.decrement(entity.getMinecraftKeyString());
@ -26,5 +26,5 @@ index e66bbb7ee3..803afed60d 100644
this.entities.remove(entity); // Paper
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f93a941f330b4f7cfeab3b724caf43790160a2b5 Mon Sep 17 00:00:00 2001
From 2acf2cef0762f0d88ae7e8c5ef1b17617bec440f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 23 Jul 2018 22:44:23 -0400
Subject: [PATCH] Add some Debug to Chunk Entity slices
@ -9,10 +9,10 @@ This should hopefully avoid duplicate entities ever being created
if the entity was to end up in 2 different chunk slices
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 803afed60d..80b5013d95 100644
index 6a40dddf46..0afa8a7ebd 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -489,6 +489,25 @@ public class Chunk implements IChunkAccess {
@@ -503,6 +503,25 @@ public class Chunk implements IChunkAccess {
if (k >= this.entitySlices.length) {
k = this.entitySlices.length - 1;
}
@ -38,7 +38,7 @@ index 803afed60d..80b5013d95 100644
if (!entity.inChunk || entity.getCurrentChunk() != this) entityCounts.increment(entity.getMinecraftKeyString()); // Paper
entity.inChunk = true;
@@ -498,6 +517,7 @@ public class Chunk implements IChunkAccess {
@@ -512,6 +531,7 @@ public class Chunk implements IChunkAccess {
entity.chunkZ = this.loc.z;
this.entities.add(entity); // Paper - per chunk entity list
this.entitySlices[k].add(entity);
@ -46,7 +46,7 @@ index 803afed60d..80b5013d95 100644
this.markDirty(); // Paper
}
@@ -522,6 +542,10 @@ public class Chunk implements IChunkAccess {
@@ -536,6 +556,10 @@ public class Chunk implements IChunkAccess {
// Paper start
if (entity.currentChunk != null && entity.currentChunk.get() == this) entity.setCurrentChunk(null);
@ -70,5 +70,5 @@ index a0379c6a77..838aa7da69 100644
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From eb17a9e3291d12df5f3a007c85644bcdbdaca564 Mon Sep 17 00:00:00 2001
From 996595a695e7097c24e2bd7a4b1f9594ecf1b2bf Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 26 Jul 2018 00:11:12 -0400
Subject: [PATCH] Prevent Saving Bad entities to chunks
@ -80,10 +80,10 @@ index 13d99de2cd..f54572773c 100644
public static ChunkStatus.Type a(@Nullable NBTTagCompound nbttagcompound) {
if (nbttagcompound != null) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 6ce7f77a5e..87762b1725 100644
index 02d9c754b1..d1424325d5 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1085,6 +1085,7 @@ public class WorldServer extends World {
@@ -1084,6 +1084,7 @@ public class WorldServer extends World {
List[] aentityslice = chunk.getEntitySlices(); // Spigot
int i = aentityslice.length;
@ -91,7 +91,7 @@ index 6ce7f77a5e..87762b1725 100644
for (int j = 0; j < i; ++j) {
List<Entity> entityslice = aentityslice[j]; // Spigot
Iterator iterator = entityslice.iterator();
@@ -1109,11 +1110,25 @@ public class WorldServer extends World {
@@ -1108,11 +1109,25 @@ public class WorldServer extends World {
throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Removing entity while ticking!"));
}
@ -118,5 +118,5 @@ index 6ce7f77a5e..87762b1725 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From a584b96dd649886f03c6e96b89433c236a277c6e Mon Sep 17 00:00:00 2001
From 8a2267af66d0af048717527cfeaf8af8f031e25c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 28 Jul 2018 12:18:27 -0400
Subject: [PATCH] Ignore Dead Entities in entityList iteration
@ -23,10 +23,10 @@ index b839769cea..5acad8e44f 100644
MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap()));
ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ());
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 80b5013d95..f47ed1947e 100644
index 0afa8a7ebd..8e9ddca049 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -796,6 +796,7 @@ public class Chunk implements IChunkAccess {
@@ -810,6 +810,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
Entity entity1 = (Entity) iterator.next();
@ -34,7 +34,7 @@ index 80b5013d95..f47ed1947e 100644
if (entity1.getBoundingBox().c(axisalignedbb) && entity1 != entity) {
if (predicate == null || predicate.test(entity1)) {
@@ -833,6 +834,7 @@ public class Chunk implements IChunkAccess {
@@ -847,6 +848,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
T entity = (T) iterator.next(); // CraftBukkit - decompile error
@ -42,7 +42,7 @@ index 80b5013d95..f47ed1947e 100644
if ((entitytypes == null || entity.getEntityType() == entitytypes) && entity.getBoundingBox().c(axisalignedbb) && predicate.test(entity)) {
list.add(entity);
@@ -854,6 +856,7 @@ public class Chunk implements IChunkAccess {
@@ -868,6 +870,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
T t0 = (T) iterator.next(); // CraftBukkit - decompile error
@ -63,7 +63,7 @@ index 838aa7da69..35d22ec027 100644
public float getBukkitYaw() {
return this.yaw;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 87762b1725..8d292604c3 100644
index d1424325d5..f071b61195 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -908,7 +908,7 @@ public class WorldServer extends World {
@ -75,7 +75,7 @@ index 87762b1725..8d292604c3 100644
if (entity instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
@@ -1244,6 +1244,7 @@ public class WorldServer extends World {
@@ -1242,6 +1242,7 @@ public class WorldServer extends World {
entity.origin = entity.getBukkitEntity().getLocation();
}
// Paper end
@ -83,7 +83,7 @@ index 87762b1725..8d292604c3 100644
new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
}
@@ -1256,6 +1257,7 @@ public class WorldServer extends World {
@@ -1254,6 +1255,7 @@ public class WorldServer extends World {
this.removeEntityFromChunk(entity);
this.entitiesById.remove(entity.getId());
this.unregisterEntity(entity);
@ -128,5 +128,5 @@ index cde999c97f..960e29cb16 100644
if (bukkitEntity == null) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 2e6731ef91c1c7aedbd85382dc6dca59fe98f21b Mon Sep 17 00:00:00 2001
From 71d382d6807a653136966f31db2c34266278e24f Mon Sep 17 00:00:00 2001
From: Mystiflow <mystiflow@gmail.com>
Date: Fri, 6 Jul 2018 13:21:30 +0100
Subject: [PATCH] Send nearby packets from world player list not server list
@ -46,10 +46,10 @@ index 5ae0927c14..6b67201852 100644
double d5 = d1 - entityplayer.locY();
double d6 = d2 - entityplayer.locZ();
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 8d292604c3..09176e6040 100644
index f071b61195..ad779650ed 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1290,7 +1290,7 @@ public class WorldServer extends World {
@@ -1288,7 +1288,7 @@ public class WorldServer extends World {
}
// CraftBukkit end
this.globalEntityList.add(entitylightning);
@ -58,7 +58,7 @@ index 8d292604c3..09176e6040 100644
}
@Override
@@ -1422,7 +1422,7 @@ public class WorldServer extends World {
@@ -1420,7 +1420,7 @@ public class WorldServer extends World {
BlockActionData blockactiondata = (BlockActionData) this.I.removeFirst();
if (this.a(blockactiondata)) {
@ -81,5 +81,5 @@ index 960e29cb16..c7c75a3bfd 100644
private static Map<String, GameRules.GameRuleKey<?>> gamerules;
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 264d561286c4bbb3bbff2fb8aba17192c2655275 Mon Sep 17 00:00:00 2001
From 375dc89e8d706626d0409772f1dd7f6de2c63752 Mon Sep 17 00:00:00 2001
From: Trigary <trigary0@gmail.com>
Date: Fri, 14 Sep 2018 17:42:08 +0200
Subject: [PATCH] Limit lightning strike effect distance
@ -69,10 +69,10 @@ index 7c518983a9..bdb534deb4 100644
--this.lifeTicks;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 09176e6040..43565dd92c 100644
index ad779650ed..a75034079b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1290,7 +1290,7 @@ public class WorldServer extends World {
@@ -1288,7 +1288,7 @@ public class WorldServer extends World {
}
// CraftBukkit end
this.globalEntityList.add(entitylightning);
@ -82,5 +82,5 @@ index 09176e6040..43565dd92c 100644
@Override
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 2b99d6a27557385cf4700c9c1b906fa284f86250 Mon Sep 17 00:00:00 2001
From 2a916333230f6ec329d7edc1c0e3fa63d874739a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 24 Mar 2019 00:24:52 -0400
Subject: [PATCH] Entity#getEntitySpawnReason
@ -72,10 +72,10 @@ index e9908cd01f..7745e70d2d 100644
});
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 43565dd92c..f7a1fad9c1 100644
index a75034079b..955003d5f8 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1001,6 +1001,7 @@ public class WorldServer extends World {
@@ -1000,6 +1000,7 @@ public class WorldServer extends World {
// CraftBukkit start
private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
@ -99,5 +99,5 @@ index bc2df82a5f..ff60568ce4 100644
// Paper end
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f3ac9a0a878d1b35fd7bcbd8f6d5beb5748ffb92 Mon Sep 17 00:00:00 2001
From c5faeb8cde3cbd30f2ce61fb48120094d890a6b3 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Mon, 6 May 2019 01:29:25 -0400
Subject: [PATCH] Per-Player View Distance API placeholders
@ -7,7 +7,7 @@ I hope to look at this more in-depth soon. It appears doable.
However this should not block the update.
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
index 6a4ccaeb0f..af10fc36e0 100644
index 6a4ccaeb0f..5bf99e0028 100644
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
@@ -579,9 +579,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
@ -15,7 +15,7 @@ index 6a4ccaeb0f..af10fc36e0 100644
// this.world.b(1028, new BlockPosition(this), 0);
// Paper start
- //int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
+ int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
+ int viewDistance = this.world.getWorld().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
for (EntityPlayer player : ((WorldServer)world).getPlayers()) {
- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
+ //final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
@ -23,7 +23,7 @@ index 6a4ccaeb0f..af10fc36e0 100644
double deltaX = this.locX() - player.locX();
double deltaZ = this.locZ() - player.locZ();
diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
index 2e95069c19..8977c3516b 100644
index 2e95069c19..2f466af4d5 100644
--- a/src/main/java/net/minecraft/server/EntityWither.java
+++ b/src/main/java/net/minecraft/server/EntityWither.java
@@ -208,9 +208,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
@ -31,7 +31,7 @@ index 2e95069c19..8977c3516b 100644
// this.world.b(1023, new BlockPosition(this), 0);
// Paper start
- //int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
+ int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
+ int viewDistance = this.world.getWorld().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
for (EntityPlayer player : ((WorldServer)world).getPlayers()) {
- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
+ //final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
@ -39,7 +39,7 @@ index 2e95069c19..8977c3516b 100644
double deltaX = this.locX() - player.locX();
double deltaZ = this.locZ() - player.locZ();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6e3bcfe2cd..e76f2b9c7f 100644
index 6e3bcfe2cd..6672feaf51 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1959,6 +1959,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -49,16 +49,16 @@ index 6e3bcfe2cd..e76f2b9c7f 100644
+
+ @Override
+ public int getViewDistance() {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement"); // TODO
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
+
+ @Override
+ public void setViewDistance(int viewDistance) {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement"); // TODO
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
// Paper end
// Spigot start
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From b8287f99f5ee5e93683367ffa43fdd4fe1e48f1f Mon Sep 17 00:00:00 2001
From 95e5aec7a2016027b8d2e8bbd4c4e3f0bf34ecfa Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 28 Sep 2018 21:49:53 -0400
Subject: [PATCH] Fix issues with entity loss due to unloaded chunks
@ -19,7 +19,7 @@ This change ensures the chunks are always loaded when entities are
added to the world, or a valid entity moves between chunks.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f7a1fad9c1..e34ea3d098 100644
index 955003d5f8..6da2392915 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -707,7 +707,7 @@ public class WorldServer extends World {
@ -31,7 +31,7 @@ index f7a1fad9c1..e34ea3d098 100644
entity.inChunk = false;
} else {
this.getChunkAt(i, k).a(entity);
@@ -1033,7 +1033,7 @@ public class WorldServer extends World {
@@ -1032,7 +1032,7 @@ public class WorldServer extends World {
return false;
}
// CraftBukkit end
@ -41,5 +41,5 @@ index f7a1fad9c1..e34ea3d098 100644
if (!(ichunkaccess instanceof Chunk)) {
return false;
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From abb8e6809baf86c7be7154fe356b11a663413686 Mon Sep 17 00:00:00 2001
From 97b023aeeb726ea74a5d6b68d2caf5ec322c3867 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 21 Jul 2018 14:27:34 -0400
Subject: [PATCH] Duplicate UUID Resolve Option
@ -81,10 +81,10 @@ index 4ba72275b9..572679e4d1 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index f47ed1947e..7bcdbe713d 100644
index 8e9ddca049..165cb994e8 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -478,6 +478,7 @@ public class Chunk implements IChunkAccess {
@@ -492,6 +492,7 @@ public class Chunk implements IChunkAccess {
if (i != this.loc.x || j != this.loc.z) {
Chunk.LOGGER.warn("Wrong location! ({}, {}) should be ({}, {}), {}", i, j, this.loc.x, this.loc.z, entity);
entity.dead = true;
@ -105,7 +105,7 @@ index 030c9992eb..fd6dad8437 100644
this.uniqueID = uuid;
this.am = this.uniqueID.toString();
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 2c7e611663..3c237b259e 100644
index 4ee26ff08f..1d255ce383 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1,6 +1,7 @@
@ -134,7 +134,7 @@ index 2c7e611663..3c237b259e 100644
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.Executor;
@@ -638,12 +642,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -639,12 +643,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// CraftBukkit start - these are spawned serialized (DefinedStructure) and we don't call an add event below at the moment due to ordering complexities
boolean needsRemoval = false;
if (chunk.needsDecoration && !this.world.getServer().getServer().getSpawnNPCs() && entity instanceof NPC) {
@ -151,7 +151,7 @@ index 2c7e611663..3c237b259e 100644
if (list == null) {
list = Lists.newArrayList(new Entity[]{entity});
} else {
@@ -670,6 +674,44 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -671,6 +675,44 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
});
}
@ -197,7 +197,7 @@ index 2c7e611663..3c237b259e 100644
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
CompletableFuture<Either<List<IChunkAccess>, PlayerChunk.Failure>> completablefuture = this.a(chunkcoordintpair, 1, (i) -> {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index e34ea3d098..f9ee9afe3a 100644
index 6da2392915..081df240f3 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -3,6 +3,8 @@ package net.minecraft.server;
@ -209,7 +209,7 @@ index e34ea3d098..f9ee9afe3a 100644
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Queues;
@@ -1060,8 +1062,24 @@ public class WorldServer extends World {
@@ -1059,8 +1061,24 @@ public class WorldServer extends World {
if (entity1 == null) {
return false;
} else {
@ -236,5 +236,5 @@ index e34ea3d098..f9ee9afe3a 100644
}
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f71662abfa6f631026e2a31a6fe81da159411d4a Mon Sep 17 00:00:00 2001
From cc2a6afe5cb4a37d3a57b7afaa5754485474a05d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 13 Sep 2014 23:14:43 -0400
Subject: [PATCH] Configurable Keep Spawn Loaded range per world
@ -102,10 +102,10 @@ index 3868572aed..ae77805f71 100644
@Override
public void a(ChunkCoordIntPair chunkcoordintpair) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f9ee9afe3a..389c9d03a1 100644
index 081df240f3..ce506e0e12 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1598,13 +1598,89 @@ public class WorldServer extends World {
@@ -1596,13 +1596,89 @@ public class WorldServer extends World {
return ((PersistentIdCounts) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().a(PersistentIdCounts::new, "idcounts")).a();
}
@ -229,5 +229,5 @@ index 5ea7b0b25a..8f8c18c5a4 100644
@Override
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From c339c9dc305959ce1fd7ff3c76aa5ad621103747 Mon Sep 17 00:00:00 2001
From 66128649d1111260a8bac1509459a62a354d645f Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 9 Jun 2019 03:53:22 +0100
Subject: [PATCH] incremental chunk saving
@ -29,7 +29,7 @@ index 071e5e7f72..4867615215 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7bcdbe713d..4b77934c39 100644
index 165cb994e8..af0d6aff4d 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -42,7 +42,7 @@ public class Chunk implements IChunkAccess {
@ -175,10 +175,10 @@ index a640cb3845..3d255b1964 100644
public void a(ProtoChunkExtension protochunkextension) {
for (int i = 0; i < this.statusFutures.length(); ++i) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 6122d19ccf..4682dca9de 100644
index 34f470779f..4f5b516144 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -331,6 +331,64 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -332,6 +332,64 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@ -243,7 +243,7 @@ index 6122d19ccf..4682dca9de 100644
protected void save(boolean flag) {
if (flag) {
List<PlayerChunk> list = (List) this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).peek(PlayerChunk::m).collect(Collectors.toList());
@@ -441,6 +499,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -442,6 +500,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.world.unloadChunk(chunk);
}
@ -251,7 +251,7 @@ index 6122d19ccf..4682dca9de 100644
this.lightEngine.a(ichunkaccess.getPos());
this.lightEngine.queueUpdate();
@@ -622,6 +681,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -623,6 +682,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
playerchunk.a(new ProtoChunkExtension(chunk));
}
@ -261,7 +261,7 @@ index 6122d19ccf..4682dca9de 100644
return PlayerChunk.getChunkState(playerchunk.getTicketLevel());
});
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 389c9d03a1..62c2275098 100644
index ce506e0e12..ad5e538b24 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -814,11 +814,44 @@ public class WorldServer extends World {
@ -319,5 +319,5 @@ index 389c9d03a1..62c2275098 100644
this.checkSession();
this.worldProvider.i();
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From df1fb149e4665163023f0f4dc676d443e521e296 Mon Sep 17 00:00:00 2001
From 75b996c4fd3a28b61da26277680b89205538715d Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 15 Jun 2019 08:54:33 -0700
Subject: [PATCH] Fix World#isChunkGenerated calls
@ -132,10 +132,10 @@ index 3d255b1964..040d4b41ea 100644
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 4682dca9de..405f57874e 100644
index 4f5b516144..1d517fd1ae 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -968,12 +968,62 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -969,12 +969,62 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@Nullable
@ -376,5 +376,5 @@ index 8f8c18c5a4..50467656df 100644
@Override
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From e53e308d6a701526060a32bbf18768a917f308f8 Mon Sep 17 00:00:00 2001
From 49a348381d91ac93ec0d3b43bfdf5751ba9e0f31 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 22 Jun 2019 04:20:47 -0700
Subject: [PATCH] Use ChunkStatus cache when saving protochunks
@ -7,10 +7,10 @@ The cache should contain the chunk status when saving. If not it
will load it.
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 405f57874e..c9c25cdb8e 100644
index 1d517fd1ae..9171785ad5 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -844,8 +844,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -845,8 +845,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
NBTTagCompound nbttagcompound;
if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) {
@ -24,5 +24,5 @@ index 405f57874e..c9c25cdb8e 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 811e3b68dac83939ebea390ad4c6073380fa6753 Mon Sep 17 00:00:00 2001
From deb49130a0248ad17fd28a1963c89e984fcdb72a Mon Sep 17 00:00:00 2001
From: stonar96 <minecraft.stonar96@gmail.com>
Date: Mon, 20 Aug 2018 03:03:58 +0200
Subject: [PATCH] Anti-Xray
@ -1181,10 +1181,10 @@ index 0000000000..37093419cf
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 4b77934c39..9ce9542b80 100644
index af0d6aff4d..472d3a4c03 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -402,7 +402,7 @@ public class Chunk implements IChunkAccess {
@@ -416,7 +416,7 @@ public class Chunk implements IChunkAccess {
return null;
}
@ -1550,10 +1550,10 @@ index 040d4b41ea..f1620ba80e 100644
this.a(new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, chunk), false);
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index c9c25cdb8e..9c627bf3b4 100644
index 9171785ad5..eb29d0e956 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -603,7 +603,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -604,7 +604,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PlayerChunkMap.LOGGER.error("Couldn't load chunk {}", chunkcoordintpair, exception);
}
@ -1562,7 +1562,7 @@ index c9c25cdb8e..9c627bf3b4 100644
}, this.executor);
}
@@ -1322,7 +1322,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1325,7 +1325,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private void a(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) {
if (apacket[0] == null) {
@ -1702,5 +1702,5 @@ index 8191e7c348..969d548de2 100644
return section;
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,14 +1,14 @@
From 59f09c7598e4673d09acea5493d2e8b1b8231d54 Mon Sep 17 00:00:00 2001
From 48c7ea33b09e22bfd136ef2e492543d543b71d7e Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 28 Jul 2019 00:51:11 +0100
Subject: [PATCH] Mark entities as being ticked when notifying navigation
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 6654b91998..e3913952d9 100644
index 5d1fa08f69..8561f96b9a 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1412,6 +1412,7 @@ public class WorldServer extends World {
@@ -1410,6 +1410,7 @@ public class WorldServer extends World {
VoxelShape voxelshape1 = iblockdata1.getCollisionShape(this, blockposition);
if (VoxelShapes.c(voxelshape, voxelshape1, OperatorBoolean.NOT_SAME)) {
@ -16,7 +16,7 @@ index 6654b91998..e3913952d9 100644
Iterator iterator = this.navigators.iterator();
while (iterator.hasNext()) {
@@ -1422,6 +1423,7 @@ public class WorldServer extends World {
@@ -1420,6 +1421,7 @@ public class WorldServer extends World {
}
}
@ -25,5 +25,5 @@ index 6654b91998..e3913952d9 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 386dbf3369631411cc400ec7852ae290d9bcd655 Mon Sep 17 00:00:00 2001
From e60938cf3ba63d6a51554c36f6116512c7c53863 Mon Sep 17 00:00:00 2001
From: CullanP <cullanpage@gmail.com>
Date: Thu, 3 Mar 2016 02:13:38 -0600
Subject: [PATCH] Avoid hopper searches if there are no items
@ -14,7 +14,7 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear
Combined, this adds up a lot.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 9ce9542b80..a23dfeb63d 100644
index 472d3a4c03..42eede6781 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -84,6 +84,10 @@ public class Chunk implements IChunkAccess {
@ -28,7 +28,7 @@ index 9ce9542b80..a23dfeb63d 100644
// Paper end
public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long i, @Nullable ChunkSection[] achunksection, @Nullable Consumer<Chunk> consumer) {
@@ -518,6 +522,13 @@ public class Chunk implements IChunkAccess {
@@ -532,6 +536,13 @@ public class Chunk implements IChunkAccess {
entity.chunkZ = this.loc.z;
this.entities.add(entity); // Paper - per chunk entity list
this.entitySlices[k].add(entity);
@ -42,7 +42,7 @@ index 9ce9542b80..a23dfeb63d 100644
entity.entitySlice = this.entitySlices[k]; // Paper
this.markDirty(); // Paper
}
@@ -550,6 +561,11 @@ public class Chunk implements IChunkAccess {
@@ -564,6 +575,11 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}
@ -54,7 +54,7 @@ index 9ce9542b80..a23dfeb63d 100644
entityCounts.decrement(entity.getMinecraftKeyString());
this.markDirty(); // Paper
// Paper end
@@ -833,6 +849,14 @@ public class Chunk implements IChunkAccess {
@@ -847,6 +863,14 @@ public class Chunk implements IChunkAccess {
for (int k = i; k <= j; ++k) {
Iterator iterator = this.entitySlices[k].iterator(); // Spigot
@ -69,7 +69,7 @@ index 9ce9542b80..a23dfeb63d 100644
while (iterator.hasNext()) {
T entity = (T) iterator.next(); // CraftBukkit - decompile error
if (entity.shouldBeRemoved) continue; // Paper
@@ -852,9 +876,29 @@ public class Chunk implements IChunkAccess {
@@ -866,9 +890,29 @@ public class Chunk implements IChunkAccess {
i = MathHelper.clamp(i, 0, this.entitySlices.length - 1);
j = MathHelper.clamp(j, 0, this.entitySlices.length - 1);
@ -112,5 +112,5 @@ index 498f381099..a2d1ef3602 100644
return entity instanceof IInventory && entity.isAlive();
};
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 748db0d90c3cc343b0dadb663f4f6ccad2b6161a Mon Sep 17 00:00:00 2001
From b7931612f141bfce24d6020ff0432b868b3e9852 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 13 Jul 2019 09:23:10 -0700
Subject: [PATCH] Asynchronous chunk IO and loading
@ -3099,7 +3099,7 @@ index f1620ba80e..74e6b8b973 100644
completablefuture = (CompletableFuture) this.statusFutures.get(i);
if (completablefuture != null) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 9c627bf3b4..19603343b2 100644
index eb29d0e956..43abdb47fd 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -63,7 +63,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -3120,7 +3120,7 @@ index 9c627bf3b4..19603343b2 100644
private final File w;
private final PlayerMap playerMap;
public final Int2ObjectMap<PlayerChunkMap.EntityTracker> trackedEntities;
@@ -163,7 +163,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -156,7 +156,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.lightEngine = new LightEngineThreaded(ilightaccess, this, this.world.getWorldProvider().f(), threadedmailbox1, this.p.a(threadedmailbox1, false));
this.chunkDistanceManager = new PlayerChunkMap.a(executor, iasynctaskhandler);
this.l = supplier;
@ -3129,7 +3129,7 @@ index 9c627bf3b4..19603343b2 100644
this.setViewDistance(i);
}
@@ -210,7 +210,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -203,7 +203,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@Nullable
@ -3138,7 +3138,7 @@ index 9c627bf3b4..19603343b2 100644
return (PlayerChunk) this.visibleChunks.get(i);
}
@@ -324,6 +324,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -325,6 +325,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public void close() throws IOException {
try {
this.p.close();
@ -3146,7 +3146,7 @@ index 9c627bf3b4..19603343b2 100644
this.m.close();
} finally {
super.close();
@@ -415,7 +416,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -416,7 +417,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.b(() -> {
return true;
});
@ -3156,7 +3156,7 @@ index 9c627bf3b4..19603343b2 100644
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName());
} else {
this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> {
@@ -436,11 +438,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -437,11 +439,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
protected void unloadChunks(BooleanSupplier booleansupplier) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
@ -3172,7 +3172,7 @@ index 9c627bf3b4..19603343b2 100644
}
gameprofilerfiller.exit();
@@ -480,6 +486,60 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -481,6 +487,60 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@ -3233,7 +3233,7 @@ index 9c627bf3b4..19603343b2 100644
private void a(long i, PlayerChunk playerchunk) {
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave();
Consumer<IChunkAccess> consumer = (ichunkaccess) -> { // CraftBukkit - decompile error
@@ -493,7 +553,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -494,7 +554,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
((Chunk) ichunkaccess).setLoaded(false);
}
@ -3242,7 +3242,7 @@ index 9c627bf3b4..19603343b2 100644
if (this.loadedChunks.remove(i) && ichunkaccess instanceof Chunk) {
Chunk chunk = (Chunk) ichunkaccess;
@@ -501,6 +561,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -502,6 +562,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
this.autoSaveQueue.remove(playerchunk); // Paper
@ -3256,7 +3256,7 @@ index 9c627bf3b4..19603343b2 100644
this.lightEngine.a(ichunkaccess.getPos());
this.lightEngine.queueUpdate();
this.worldLoadListener.a(ichunkaccess.getPos(), (ChunkStatus) null);
@@ -570,27 +637,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -571,27 +638,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@ -3305,7 +3305,7 @@ index 9c627bf3b4..19603343b2 100644
} catch (ReportedException reportedexception) {
Throwable throwable = reportedexception.getCause();
@@ -604,7 +676,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -605,7 +677,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
return Either.left(new ProtoChunk(chunkcoordintpair, ChunkConverter.a, this.world)); // Paper - Anti-Xray
@ -3339,7 +3339,7 @@ index 9c627bf3b4..19603343b2 100644
}
private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> b(PlayerChunk playerchunk, ChunkStatus chunkstatus) {
@@ -822,18 +919,43 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -823,18 +920,43 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return this.u.get();
}
@ -3391,7 +3391,7 @@ index 9c627bf3b4..19603343b2 100644
ichunkaccess.setLastSaved(this.world.getTime());
ichunkaccess.setNeedsSaving(false);
@@ -844,28 +966,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -845,28 +967,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
NBTTagCompound nbttagcompound;
if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) {
@ -3429,7 +3429,7 @@ index 9c627bf3b4..19603343b2 100644
}
protected void setViewDistance(int i) {
@@ -969,6 +1098,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -970,6 +1099,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@ -3472,7 +3472,7 @@ index 9c627bf3b4..19603343b2 100644
@Nullable
public NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { // Paper - private -> public
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
@@ -991,33 +1156,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -992,33 +1157,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - chunk status cache "api"
public ChunkStatus getChunkStatusOnDiskIfCached(ChunkCoordIntPair chunkPos) {
@ -3539,7 +3539,7 @@ index 9c627bf3b4..19603343b2 100644
}
public IChunkAccess getUnloadingChunk(int chunkX, int chunkZ) {
@@ -1026,6 +1213,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1027,6 +1214,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
// Paper end
@ -3579,7 +3579,7 @@ index 9c627bf3b4..19603343b2 100644
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
// Spigot start
return isOutsideOfRange(chunkcoordintpair, false);
@@ -1371,6 +1591,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1374,6 +1594,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@ -3983,7 +3983,7 @@ index c999f8c9bf..b59ef1a633 100644
HAS_SPACE(VillagePlaceRecord::d), IS_OCCUPIED(VillagePlaceRecord::e), ANY((villageplacerecord) -> {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index e3913952d9..3db0ad0a46 100644
index 8561f96b9a..c0476f69e4 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -82,6 +82,79 @@ public class WorldServer extends World {
@ -4075,7 +4075,7 @@ index e3913952d9..3db0ad0a46 100644
}
// CraftBukkit start
@@ -1675,7 +1750,11 @@ public class WorldServer extends World {
@@ -1673,7 +1748,11 @@ public class WorldServer extends World {
}
MCUtil.getSpiralOutChunks(spawn, radiusInBlocks >> 4).forEach(pair -> {
@ -4170,5 +4170,5 @@ index 07936eeba2..5bdcdcf9e8 100644
log.log( Level.SEVERE, "------------------------------" );
//
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 286402aba0b28823b89468bffb9e650c76311313 Mon Sep 17 00:00:00 2001
From 8dae2149d4060a1a6797d7d6ce4971f97fa25612 Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
Date: Mon, 19 Aug 2019 01:27:58 +0500
Subject: [PATCH] implement optional per player mob spawns
@ -643,7 +643,7 @@ index 8427ee2ee8..0f04bcc8b7 100644
return this.bb;
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 19603343b2..a7b981f299 100644
index 43abdb47fd..0fd1d6b3e6 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -78,7 +78,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -656,7 +656,7 @@ index 19603343b2..a7b981f299 100644
// CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback()
public final CallbackExecutor callbackExecutor = new CallbackExecutor();
@@ -165,6 +166,24 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -158,6 +159,24 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.l = supplier;
this.m = new VillagePlace(new File(this.w, "poi"), datafixer, this.world); // Paper
this.setViewDistance(i);
@ -755,7 +755,7 @@ index fdac5bb3a2..58bbf2f9d2 100644
@Nullable
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f9aed78188..fd8ca2a510 100644
index 731f6a8320..38c5b721bf 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1028,7 +1028,20 @@ public class WorldServer extends World {
@ -800,5 +800,5 @@ index f9aed78188..fd8ca2a510 100644
@Override
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 053029c773639ce909274257536171299e07e9bc Mon Sep 17 00:00:00 2001
From af85458ed4090ab13771f6e762dea488fe58e236 Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
Date: Sat, 21 Dec 2019 15:22:09 -0500
Subject: [PATCH] Tracking Range Improvements
@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index a7b981f299..043ba702d7 100644
index 0fd1d6b3e6..73bfebb837 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1734,6 +1734,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1737,6 +1737,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
int j = entity.getEntityType().getChunkRange() * 16;
@ -74,5 +74,5 @@ index 6f8e6c1d07..765bdaf9b5 100644
}
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 18fb4717649f3e45bf2e92c2498acef2b185cff2 Mon Sep 17 00:00:00 2001
From caeded93e5038666588e0e7d377325a086b5ec11 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Mon, 27 Jan 2020 21:28:00 -0800
Subject: [PATCH] Optimise random block ticking
@ -99,10 +99,10 @@ index 6d351f0979..a44f65f40d 100644
@Override
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index e76528f199..e650a2e48d 100644
index db7ba12fd4..9010359fbd 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -450,6 +450,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -451,6 +451,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
}
@ -111,10 +111,10 @@ index e76528f199..e650a2e48d 100644
return this.d(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ());
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index a23dfeb63d..2e3db1a755 100644
index 42eede6781..65882f4632 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -572,8 +572,8 @@ public class Chunk implements IChunkAccess {
@@ -586,8 +586,8 @@ public class Chunk implements IChunkAccess {
this.entities.remove(entity); // Paper
}
@ -376,7 +376,7 @@ index 0c23fc89d7..de9f49b884 100644
public boolean isSavingDisabled() {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 62fabb7ad5..9a2b4fa7a2 100644
index c348e3e500..fcbc9f2913 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -531,7 +531,12 @@ public class WorldServer extends World {
@ -520,5 +520,5 @@ index 62fabb7ad5..9a2b4fa7a2 100644
protected BlockPosition a(BlockPosition blockposition) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f0bf987e53c7aa744047a0cd70b3b506897a7998 Mon Sep 17 00:00:00 2001
From 34b65530d5c531d836075966000e6c9dfafb2877 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Tue, 14 Jan 2020 14:59:08 -0800
Subject: [PATCH] Optimise Chunk#getFluid
@ -8,10 +8,10 @@ faster on its own, however removing the try catch makes it
easier to inline due to code size
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 2e3db1a755..d802acef71 100644
index 65882f4632..696634ebf5 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -365,17 +365,20 @@ public class Chunk implements IChunkAccess {
@@ -379,17 +379,20 @@ public class Chunk implements IChunkAccess {
}
public Fluid a(int i, int j, int k) {
@ -39,7 +39,7 @@ index 2e3db1a755..d802acef71 100644
CrashReport crashreport = CrashReport.a(throwable, "Getting fluid state");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Block being got");
@@ -384,6 +387,7 @@ public class Chunk implements IChunkAccess {
@@ -398,6 +401,7 @@ public class Chunk implements IChunkAccess {
});
throw new ReportedException(crashreport);
}
@ -61,5 +61,5 @@ index 3eaf893cdf..cda718bba0 100644
public void a() {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From af50e068e7f0dfcf365d1ce5f047c4945ef86ea0 Mon Sep 17 00:00:00 2001
From bdec2cdf5fdacc359764dd666f6e45ffe8056fd3 Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Sat, 1 Feb 2020 16:50:39 +0100
Subject: [PATCH] Pillager patrol spawn settings and per player options
@ -10,7 +10,7 @@ When not per player it will use the Vanilla mechanic of one delay per
world and the world age for the start day.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index e93176d8f2..659a011e97 100644
index 7ca67a4aa5..803be76772 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -641,10 +641,21 @@ public class PaperWorldConfig {
@ -36,7 +36,7 @@ index e93176d8f2..659a011e97 100644
private void entitiesTargetWithFollowRange() {
entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange);
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 9da6ed85fa..c6474aa0f8 100644
index cf837bdb3b..900631ebe0 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -77,6 +77,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -140,5 +140,5 @@ index 3b6034038a..9c95c0ccfc 100644
return this.a(t0, Counter.DEFAULT);
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,213 +0,0 @@
From 8a760283129e8313839f6fa60e7275446201e46a Mon Sep 17 00:00:00 2001
From: froobynooby <froobynooby@froobworld.com>
Date: Thu, 20 Feb 2020 15:50:49 +0930
Subject: [PATCH] Reduce entity tracker updates on move
With this patch, for each player we keep track of a set of
entities that the player is tracking. This is used to split
the entity tracker update logic in the movePlayer method in
PlayerChunkMap in to two parts:
* Full update: Run through all entity trackers and update them
* Partial update: Run through all entity trackers for entities
the player is already tracking and update them
Partial updates will always take less time than full updates,
usually by a considerable amount if players and entities are
spread out over the map. Assuming they are evenly spread,
and given there are x many players, it would be expected to
take 1/x the time of a full update.
Full updates are only run if the following conditions are met:
* It has been 20 ticks since the last full update
* The player has moved over set distance since the last full
update (distance is configurable)
The motivation for the first condition is that the client
sends the server its position once a second, which calls
movePlayer, so at a minimum we want to be sending the player
an updated set of entities it can see every second.
The motivation for the second condition is that looping
through every entity in world to check if it is now within
the tracking range after the player has moved 0.1 blocks is
largely unnecessary. Checking only after the player has moved
1 or 2 blocks is far better for performance, and very unlikely
to give any noticeable side effects.
In testing, this has reduced the time taken for movement
packet processing by up to 4x. Packet processing for movement
packets often show up as a major contributor to TPS loss in
servers with large player counts
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 7ca67a4aa5..e93176d8f2 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -668,4 +668,9 @@ public class PaperWorldConfig {
private void zombieVillagerInfectionChance() {
zombieVillagerInfectionChance = getDouble("zombie-villager-infection-chance", zombieVillagerInfectionChance);
}
+
+ public double trackerUpdateDistance = 1;
+ private void trackerUpdateDistance() {
+ trackerUpdateDistance = getDouble("tracker-update-distance", trackerUpdateDistance);
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index cf837bdb3b..9da6ed85fa 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -86,6 +86,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public final int[] mobCounts = new int[ENUMCREATURETYPE_TOTAL_ENUMS]; // Paper
public final com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<EntityPlayer> cachedSingleMobDistanceMap;
// Paper end
+ // Paper start - Reduce entity tracker updates on move
+ public Vec3D lastTrackedPosition = new Vec3D(0, 0, 0);
+ public long lastTrackedTick;
+ // Paper end
// CraftBukkit start
public String displayName;
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 043ba702d7..8f477767b9 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -133,6 +133,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
+ // Paper end
+
+ // Paper start - Reduce entity tracker updates on move
+ private double trackerUpdateDistanceSquared;
+ private final Int2ObjectMap<Int2ObjectMap<PlayerChunkMap.EntityTracker>> playerTrackedEntities = new Int2ObjectOpenHashMap<>();
+ private final Int2ObjectMap<Queue<Integer>> playerTrackedEntitiesRemoveQueue = new Int2ObjectOpenHashMap<>();
+
+ void flushRemoveQueue(EntityPlayer entityplayer) {
+ Queue<Integer> removeQueue = getPlayerTrackedEntityMapRemoveQueue(entityplayer.getId());
+ Int2ObjectMap<PlayerChunkMap.EntityTracker> entityMap = getPlayerTrackedEntityMap(entityplayer.getId());
+ for (Integer id = removeQueue.poll(); id != null; id = removeQueue.poll()) {
+ entityMap.remove(id);
+ }
+ }
+
+ void flushRemoveQueues() {
+ for (Int2ObjectMap.Entry<Queue<Integer>> entry : playerTrackedEntitiesRemoveQueue.int2ObjectEntrySet()) {
+ Int2ObjectMap<EntityTracker> entityMap = getPlayerTrackedEntityMap(entry.getKey());
+ Queue<Integer> removeQueue = entry.getValue();
+ for (Integer id = removeQueue.poll(); id != null; id = removeQueue.poll()) {
+ entityMap.remove(id);
+ }
+ }
+ }
+
+ Int2ObjectMap<EntityTracker> getPlayerTrackedEntityMap(int id) {
+ return playerTrackedEntities.computeIfAbsent(id, i -> new Int2ObjectOpenHashMap<>());
+ }
+
+ Queue<Integer> getPlayerTrackedEntityMapRemoveQueue(int id) {
+ return playerTrackedEntitiesRemoveQueue.computeIfAbsent(id, i -> new java.util.ArrayDeque<>());
+ }
+
// Paper end
public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator<?> chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i) {
@@ -167,6 +200,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.m = new VillagePlace(new File(this.w, "poi"), datafixer, this.world); // Paper
this.setViewDistance(i);
this.playerMobDistanceMap = this.world.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper
+ this.trackerUpdateDistanceSquared = Math.pow(this.world.paperConfig.trackerUpdateDistance, 2); // Paper
}
public void updatePlayerMobTypeMap(Entity entity) {
@@ -1339,8 +1373,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
public void movePlayer(EntityPlayer entityplayer) {
- ObjectIterator objectiterator = this.trackedEntities.values().iterator();
+ // Paper start
+ // ObjectIterator objectiterator = this.trackedEntities.values().iterator();
+ ObjectIterator objectiterator;
+ if (MinecraftServer.currentTick - entityplayer.lastTrackedTick >= 20
+ || entityplayer.lastTrackedPosition.distanceSquared(entityplayer.getPositionVector()) >= trackerUpdateDistanceSquared) {
+ entityplayer.lastTrackedPosition = entityplayer.getPositionVector();
+ entityplayer.lastTrackedTick = MinecraftServer.currentTick;
+ objectiterator = this.trackedEntities.values().iterator(); // Update all entity trackers
+ } else {
+ objectiterator = getPlayerTrackedEntityMap(entityplayer.getId()).values().iterator(); // Only update entity trackers for already tracked entities
+ }
+ // Paper end
while (objectiterator.hasNext()) {
PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = (PlayerChunkMap.EntityTracker) objectiterator.next();
@@ -1350,6 +1395,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
playerchunkmap_entitytracker.updatePlayer(entityplayer);
}
}
+ flushRemoveQueues(); // Paper
int i = MathHelper.floor(entityplayer.locX()) >> 4;
int j = MathHelper.floor(entityplayer.locZ()) >> 4;
@@ -1491,12 +1537,21 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
playerchunkmap_entitytracker.clear(entityplayer);
}
+ // Paper start
+ playerTrackedEntities.remove(entityplayer.getId());
+ playerTrackedEntitiesRemoveQueue.remove(entityplayer.getId());
+ // Paper end
}
PlayerChunkMap.EntityTracker playerchunkmap_entitytracker1 = (PlayerChunkMap.EntityTracker) this.trackedEntities.remove(entity.getId());
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.a();
+ // Paper start
+ for (EntityPlayer player : playerchunkmap_entitytracker1.trackedPlayers) {
+ getPlayerTrackedEntityMap(player.getId()).remove(playerchunkmap_entitytracker1.tracker.getId());
+ }
+ // Paper end
}
entity.tracker = null; // Paper - We're no longer tracked
}
@@ -1537,7 +1592,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
world.timings.tracker2.stopTiming(); // Paper
}
-
+ flushRemoveQueues(); // Paper
}
@@ -1586,6 +1641,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
}
+ flushRemoveQueue(entityplayer); // Paper
Iterator iterator;
Entity entity1;
@@ -1682,6 +1738,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
org.spigotmc.AsyncCatcher.catchOp("player tracker clear"); // Spigot
if (this.trackedPlayers.remove(entityplayer)) {
this.trackerEntry.a(entityplayer);
+ getPlayerTrackedEntityMap(entityplayer.getId()).remove(this.tracker.getId()); // Paper
}
}
@@ -1718,9 +1775,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (flag1 && this.trackedPlayerMap.putIfAbsent(entityplayer, true) == null) { // Paper
this.trackerEntry.b(entityplayer);
+ getPlayerTrackedEntityMap(entityplayer.getId()).put(this.tracker.getId(), this); // Paper
}
} else if (this.trackedPlayers.remove(entityplayer)) {
this.trackerEntry.a(entityplayer);
+ getPlayerTrackedEntityMapRemoveQueue(entityplayer.getId()).add(this.tracker.getId()); // Paper
}
}
--
2.26.2

Datei anzeigen

@ -1,4 +1,4 @@
From ff553a44163ebec14ee14149ece19c35bcbe6bca Mon Sep 17 00:00:00 2001
From 5e261d2773e625fa5bffbd4b7ae848b40e6b8972 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 29 Mar 2020 18:26:14 -0400
Subject: [PATCH] Ensure Entity is never double registered
@ -23,7 +23,7 @@ index 00df89d650..0dbe2dce11 100644
private boolean locked = false;
@Override
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 9b9e242432..f80c80957a 100644
index 5173731dc5..3fc25183ca 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -532,6 +532,7 @@ public class WorldServer extends World {
@ -34,7 +34,7 @@ index 9b9e242432..f80c80957a 100644
this.registerEntity(entity);
}
} // Paper - timings
@@ -1354,6 +1355,19 @@ public class WorldServer extends World {
@@ -1353,6 +1354,19 @@ public class WorldServer extends World {
public void unregisterEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot
@ -54,7 +54,7 @@ index 9b9e242432..f80c80957a 100644
// Spigot start
if ( entity instanceof EntityHuman )
{
@@ -1415,9 +1429,21 @@ public class WorldServer extends World {
@@ -1413,9 +1427,21 @@ public class WorldServer extends World {
private void registerEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
@ -78,5 +78,5 @@ index 9b9e242432..f80c80957a 100644
if (entity instanceof EntityEnderDragon) {
EntityComplexPart[] aentitycomplexpart = ((EntityEnderDragon) entity).eo();
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 233dec6facb9b9c1c11989bf62e504303c9a4d56 Mon Sep 17 00:00:00 2001
From 80f240c7853f1795c5e7959e3daec3e1af7faee3 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 31 Mar 2020 03:01:45 -0400
Subject: [PATCH] Fix unregistering entities from unloading chunks
@ -15,10 +15,10 @@ Combine that with a buggy detail of the previous implementation of
the Dupe UUID patch, then this was the likely source of the "Ghost entities"
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f80c80957a..3f8f40018d 100644
index 3fc25183ca..9fbe8fa1b2 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1508,9 +1508,9 @@ public class WorldServer extends World {
@@ -1506,9 +1506,9 @@ public class WorldServer extends World {
}
private void removeEntityFromChunk(Entity entity) {
@ -31,5 +31,5 @@ index f80c80957a..3f8f40018d 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 23ff45ad57869e36aa344f11b7c7f5ad6b028289 Mon Sep 17 00:00:00 2001
From 38e70a8701f6abb26dcc1681a4b6523576503d4a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 31 Mar 2020 03:50:42 -0400
Subject: [PATCH] Remote Connections shouldn't hold up shutdown
@ -24,5 +24,5 @@ index 349a0ea213..1ef7890da5 100644
System.exit(0); // CraftBukkit
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 69d5b79f2d4fb9d153dba0484afc7f4325688594 Mon Sep 17 00:00:00 2001
From 5ed395f3dacf7c33486ae39e1580132e4b1284c0 Mon Sep 17 00:00:00 2001
From: chickeneer <emcchickeneer@gmail.com>
Date: Tue, 17 Mar 2020 14:18:50 -0500
Subject: [PATCH] Do not allow bees to load chunks for beehives
@ -41,5 +41,5 @@ index c7d79efdf6..dd1d246aeb 100644
if (tileentity instanceof TileEntityBeehive) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 97238d4fbd5f5e6a5da9f051e50751ff70c76dcb Mon Sep 17 00:00:00 2001
From a04b7ed17e96d5d02e9d14e3d96a5638a148fcd4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 2 Apr 2020 01:42:39 -0400
Subject: [PATCH] Prevent Double PlayerChunkMap adds crashing server
@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 8f477767b9..7647b804fa 100644
index 73bfebb837..e22ef19534 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1489,6 +1489,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1446,6 +1446,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
protected void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
@ -26,10 +26,10 @@ index 8f477767b9..7647b804fa 100644
if (!(entity instanceof EntityLightning)) {
EntityTypes<?> entitytypes = entity.getEntityType();
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 3f8f40018d..532aba2a5d 100644
index 9fbe8fa1b2..2a7a47c670 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1474,7 +1474,7 @@ public class WorldServer extends World {
@@ -1472,7 +1472,7 @@ public class WorldServer extends World {
}
}
@ -38,7 +38,7 @@ index 3f8f40018d..532aba2a5d 100644
// CraftBukkit start - SPIGOT-5278
if (entity instanceof EntityDrowned) {
this.navigators.add(((EntityDrowned) entity).navigationWater);
@@ -1485,6 +1485,7 @@ public class WorldServer extends World {
@@ -1483,6 +1483,7 @@ public class WorldServer extends World {
this.navigators.add(((EntityInsentient) entity).getNavigation());
}
entity.valid = true; // CraftBukkit
@ -47,5 +47,5 @@ index 3f8f40018d..532aba2a5d 100644
if (entity.origin == null) {
entity.origin = entity.getBukkitEntity().getLocation();
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From ef055b2d308e7f386a101f0aabd78afbb34cdaed Mon Sep 17 00:00:00 2001
From 102b09f710cfa66c9284bf278763fb30b66cf3a4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 2 Apr 2020 02:37:57 -0400
Subject: [PATCH] Optimize Collision Chunk lookup and avoid loading far chunks
@ -38,5 +38,5 @@ index f851ed11df..d154487294 100644
if (iblockaccess != null) {
blockposition_mutableblockposition.d(k1, l1, i2);
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 30e0809c5100d315a28125aa652910f42ef76fbf Mon Sep 17 00:00:00 2001
From c0c34e10d92aefb26116f3c7865b54debcd31ba7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 2 Apr 2020 17:16:48 -0400
Subject: [PATCH] Don't tick dead players
@ -7,10 +7,10 @@ Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla.
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index c6474aa0f8..a16a8c10a2 100644
index 900631ebe0..aa9c903aa8 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -433,7 +433,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -429,7 +429,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void playerTick() {
try {
@ -20,5 +20,5 @@ index c6474aa0f8..a16a8c10a2 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 5c0011d7d238914c4a29da2f28095f31c7aad451 Mon Sep 17 00:00:00 2001
From 09137b1fb59822c382267f14ad337c59403bc733 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 2 Apr 2020 19:31:16 -0400
Subject: [PATCH] Dead Player's shouldn't be able to move
@ -20,5 +20,5 @@ index 61c9e030a1..c4d4334305 100644
@Override
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From a6fbb1690cd064660bca6797edd6afcaec9e1b19 Mon Sep 17 00:00:00 2001
From c02c51d21e1c92abe3c71d9f8718bb457b545c93 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 8 Apr 2020 03:06:30 -0400
Subject: [PATCH] Optimize PlayerChunkMap memory use for visibleChunks
@ -76,7 +76,7 @@ index d9941b38ca..71ab65e00f 100644
List<PlayerChunk> allChunks = new ArrayList<>(visibleChunks.values());
List<EntityPlayer> players = world.players;
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 7647b804fa..fb7bbe8744 100644
index e22ef19534..db5a35598d 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -55,8 +55,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -92,7 +92,7 @@ index 7647b804fa..fb7bbe8744 100644
private final Long2ObjectLinkedOpenHashMap<PlayerChunk> pendingUnload;
final LongSet loadedChunks; // Paper - private -> package
public final WorldServer world;
@@ -170,7 +172,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -130,7 +132,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator<?> chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i) {
super(new File(worldserver.getWorldProvider().getDimensionManager().a(file), "region"), datafixer);
@ -101,7 +101,7 @@ index 7647b804fa..fb7bbe8744 100644
this.pendingUnload = new Long2ObjectLinkedOpenHashMap();
this.loadedChunks = new LongOpenHashSet();
this.unloadQueue = new LongOpenHashSet();
@@ -262,9 +264,52 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -221,9 +223,52 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return (PlayerChunk) this.updatingChunks.get(i);
}
@ -155,7 +155,7 @@ index 7647b804fa..fb7bbe8744 100644
}
protected IntSupplier c(long i) {
@@ -444,8 +489,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -411,8 +456,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper end
protected void save(boolean flag) {
@ -166,7 +166,7 @@ index 7647b804fa..fb7bbe8744 100644
MutableBoolean mutableboolean = new MutableBoolean();
do {
@@ -473,7 +519,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -440,7 +486,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// this.i(); // Paper - nuke IOWorker
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName());
} else {
@ -175,7 +175,7 @@ index 7647b804fa..fb7bbe8744 100644
IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow(null); // CraftBukkit - decompile error
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
@@ -643,7 +689,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -610,7 +656,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (!this.updatingChunksModified) {
return false;
} else {
@ -197,7 +197,7 @@ index 7647b804fa..fb7bbe8744 100644
this.updatingChunksModified = false;
return true;
}
@@ -1109,12 +1168,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1076,12 +1135,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
protected Iterable<PlayerChunk> f() {
@ -271,5 +271,5 @@ index 07ebd78acc..b70c0fd977 100644
return chunks.values().stream().map(PlayerChunk::getFullChunk).filter(Objects::nonNull).map(net.minecraft.server.Chunk::getBukkitChunk).toArray(Chunk[]::new);
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 033758c1aa7ac67619a80cbfb50e858146141638 Mon Sep 17 00:00:00 2001
From 215f58b96ad22596b69d824ef9252ed9290c7d89 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 8 Apr 2020 21:07:08 -0400
Subject: [PATCH] Don't load chunks when attempting to unload a chunk
@ -28,5 +28,5 @@ index b70c0fd977..eb7b48422e 100644
return true;
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From b739b47db7bd4f5083b98e6168f265f53c272411 Mon Sep 17 00:00:00 2001
From 996bb55a72ebbe9ee6543b1e56a721208fa7f7cf Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 8 Apr 2020 21:24:05 -0400
Subject: [PATCH] Increase Light Queue Size
@ -14,12 +14,12 @@ light engine on shutdown...
The queue size only puts a cap on max loss, doesn't solve that problem.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 659a011e97..88a45e517c 100644
index 803be76772..3c0468bc44 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -684,4 +684,9 @@ public class PaperWorldConfig {
private void trackerUpdateDistance() {
trackerUpdateDistance = getDouble("tracker-update-distance", trackerUpdateDistance);
@@ -679,4 +679,9 @@ public class PaperWorldConfig {
private void zombieVillagerInfectionChance() {
zombieVillagerInfectionChance = getDouble("zombie-villager-infection-chance", zombieVillagerInfectionChance);
}
+
+ public int lightQueueSize = 20;
@ -41,5 +41,5 @@ index d1f82eff21..77adc64e30 100644
// CraftBukkit start
this.forceTicks = false;
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 6b84b25e8e23e57646ef302c918c41028cbb92c1 Mon Sep 17 00:00:00 2001
From 203692f5bd79a69c2a0306ecf4dc963d58f176ea Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 9 Apr 2020 00:09:26 -0400
Subject: [PATCH] Mid Tick Chunk Tasks - Speed up processing of chunk loads and
@ -226,7 +226,7 @@ index 77adc64e30..3c25436f15 100644
// Spigot Start
CrashReport crashreport;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 532aba2a5d..dc01fb494d 100644
index 2a7a47c670..9b5f24c262 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -432,6 +432,7 @@ public class WorldServer extends World {
@ -262,5 +262,5 @@ index 532aba2a5d..dc01fb494d 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 3761e0c1541d0ec88c01ac318204538ee4c43315 Mon Sep 17 00:00:00 2001
From 71d1b3f0878eee64b6a71f95471d4b2fdebf0a9d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 9 Apr 2020 21:20:33 -0400
Subject: [PATCH] Don't move existing players to world spawn
@ -10,10 +10,10 @@ larger than the keep loaded range.
By skipping this, we avoid potential for a large spike on server start.
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index a16a8c10a2..50886c1374 100644
index aa9c903aa8..d51af68a92 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -118,7 +118,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -114,7 +114,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.serverStatisticManager = minecraftserver.getPlayerList().getStatisticManager(this);
this.advancementDataPlayer = minecraftserver.getPlayerList().f(this);
this.H = 1.0F;
@ -22,7 +22,7 @@ index a16a8c10a2..50886c1374 100644
this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
@@ -166,6 +166,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -162,6 +162,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
// CraftBukkit end
@ -30,7 +30,7 @@ index a16a8c10a2..50886c1374 100644
private void a(WorldServer worldserver) {
BlockPosition blockposition = worldserver.getSpawn();
@@ -306,7 +307,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -302,7 +303,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
position = new Vec3D(world.getSpawn());
}
this.world = world;
@ -52,5 +52,5 @@ index 01345a62b7..dfe6251576 100644
entityplayer.spawnIn(worldserver);
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From e4d890492f643d70c8e2d0dad49d78d609e6accc Mon Sep 17 00:00:00 2001
From b65aaf9114f0e17ab726ae3af1481f519b82790f Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sun, 5 Apr 2020 22:23:14 -0500
Subject: [PATCH] Add tick times API and /mspt command
@ -168,5 +168,5 @@ index e8d3528d51..4a41003203 100644
private final Spigot spigot = new Spigot()
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 5e7de5d0f599813f82721752e666d40a95e9a096 Mon Sep 17 00:00:00 2001
From 3d40e8ed1f266d37d4e3e069fad413bbc7567262 Mon Sep 17 00:00:00 2001
From: JRoy <joshroy126@gmail.com>
Date: Fri, 10 Apr 2020 21:24:12 -0400
Subject: [PATCH] Expose MinecraftServer#isRunning
@ -21,5 +21,5 @@ index 4a41003203..b627180729 100644
// Paper end
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f311f269de4a50bb27e9d23f7f034d1ba5bd67a8 Mon Sep 17 00:00:00 2001
From 29c2fec0e51219fb6b6cf9ef100c18f6f4ca3d4b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 11 Apr 2020 03:56:07 -0400
Subject: [PATCH] Implement Chunk Priority / Urgency System for World Gen
@ -197,10 +197,10 @@ index 04b97cec29..568fbbd5f2 100644
private void d(int i) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index fb7bbe8744..6fa70eb08d 100644
index db5a35598d..22550f74df 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -324,6 +324,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -291,6 +291,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
List<CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>>> list = Lists.newArrayList();
int j = chunkcoordintpair.x;
int k = chunkcoordintpair.z;
@ -208,7 +208,7 @@ index fb7bbe8744..6fa70eb08d 100644
for (int l = -i; l <= i; ++l) {
for (int i1 = -i; i1 <= i; ++i1) {
@@ -341,6 +342,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -308,6 +309,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
ChunkStatus chunkstatus = (ChunkStatus) intfunction.apply(j1);
@ -216,7 +216,7 @@ index fb7bbe8744..6fa70eb08d 100644
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = playerchunk.a(chunkstatus, this);
list.add(completablefuture);
@@ -804,23 +806,28 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -771,23 +773,28 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
};
CompletableFuture<NBTTagCompound> chunkSaveFuture = this.world.asyncChunkTaskManager.getChunkSaveFuture(chunkcoordintpair.x, chunkcoordintpair.z);
@ -250,7 +250,7 @@ index fb7bbe8744..6fa70eb08d 100644
this.world.getMethodProfiler().c(() -> {
return "chunkGenerate " + chunkstatus.d();
@@ -848,6 +855,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -815,6 +822,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return CompletableFuture.completedFuture(Either.right(playerchunk_failure));
});
}, (runnable) -> {
@ -258,7 +258,7 @@ index fb7bbe8744..6fa70eb08d 100644
this.mailboxWorldGen.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // CraftBukkit - decompile error
});
}
@@ -860,6 +868,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -827,6 +835,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}));
}
@ -266,7 +266,7 @@ index fb7bbe8744..6fa70eb08d 100644
private ChunkStatus a(ChunkStatus chunkstatus, int i) {
ChunkStatus chunkstatus1;
@@ -984,9 +993,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -951,9 +960,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public CompletableFuture<Either<Chunk, PlayerChunk.Failure>> a(PlayerChunk playerchunk) {
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
@ -280,5 +280,5 @@ index fb7bbe8744..6fa70eb08d 100644
return either.flatMap((list) -> {
Chunk chunk = (Chunk) list.get(list.size() / 2);
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 7739f39ca832f6942b113739172d2bf9c948134b Mon Sep 17 00:00:00 2001
From 06c4a96e4c945a0d731ea66f43b78262e7082482 Mon Sep 17 00:00:00 2001
From: Spottedleaf <spottedleaf@spottedleaf.dev>
Date: Mon, 6 Apr 2020 17:53:29 -0700
Subject: [PATCH] Remove streams from Mob AI System
@ -250,5 +250,5 @@ index 29657fed75..1b800c558f 100644
public boolean isRunning() { return this.g(); } // Paper - OBFHELPER
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f6bbc419402487cc17d4788ab2c10812abe20e24 Mon Sep 17 00:00:00 2001
From 20b3b4c7387b9ba6883a3865aeeda334bea48c1b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 11 Apr 2020 21:23:42 -0400
Subject: [PATCH] Delay unsafe actions until after entity ticking is done
@ -6,7 +6,7 @@ Subject: [PATCH] Delay unsafe actions until after entity ticking is done
This will help prevent many cases of unregistering entities during entity ticking
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index dc01fb494d..d13dc8fce9 100644
index 9b5f24c262..b3785775ec 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -60,6 +60,16 @@ public class WorldServer extends World {
@ -57,5 +57,5 @@ index eb7b48422e..ac257d50de 100644
return ret;
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 889fc731b808cb2bc652eac6fde35ff5d08420a6 Mon Sep 17 00:00:00 2001
From 9f7453549fbee5fae923580d3c02c0e4cf4cf57e Mon Sep 17 00:00:00 2001
From: Callahan <mr.callahhh@gmail.com>
Date: Wed, 8 Apr 2020 02:42:14 -0500
Subject: [PATCH] Async command map building
@ -39,5 +39,5 @@ index 37b1a7947c..2414b0a552 100644
event.getPlayer().getServer().getPluginManager().callEvent(event);
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f96d0a3291633d69748de86bc0f5df2de0a1ba83 Mon Sep 17 00:00:00 2001
From b70ba5ecf0012b649a82f6a4d674743ddf9e038c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 12 Apr 2020 15:50:48 -0400
Subject: [PATCH] Forced Watchdog Crash support and Improve Async Shutdown
@ -345,5 +345,5 @@ index 5bdcdcf9e8..fe4b8caf28 100644
break;
} // Paper end
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From d80ac90428fba1fbc926e48af6d01dae922bafb1 Mon Sep 17 00:00:00 2001
From feb3426b29a8e9110eb293543f82ff0a53cac9b8 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 02:02:07 -0600
Subject: [PATCH] Optimize Pathfinding
@ -52,5 +52,5 @@ index f06764973f..dc32107ec3 100644
public boolean setDestination(@Nullable PathEntity pathentity, double speed) { return a(pathentity, speed); } // Paper - OBFHELPER
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 555e1d7a914a914d2fab5912684c5bc79b780456 Mon Sep 17 00:00:00 2001
From 3d87dd6ae279f1ddb4681e2378b1df05acab9697 Mon Sep 17 00:00:00 2001
From: Callahan <mr.callahhh@gmail.com>
Date: Wed, 8 Apr 2020 18:00:17 -0500
Subject: [PATCH] Port 20w15a Villager AI optimizations - DROP 1.16
@ -194,5 +194,5 @@ index 7c6e687707..396b64ea0f 100644
private boolean a(Object object) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 01b45b03af99ed2ec19a8621acfb28354c6b3cbf Mon Sep 17 00:00:00 2001
From 7c0d5dcaea2050d0fc03f8c965ae6835e416d973 Mon Sep 17 00:00:00 2001
From: Spottedleaf <spottedleaf@spottedleaf.dev>
Date: Mon, 6 Apr 2020 18:35:09 -0700
Subject: [PATCH] Reduce Either Optional allocation
@ -47,5 +47,5 @@ index a90adac7bd..3f65fe7102 100644
@Override
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 9f7926a05f4689b2ec3033679fbe04acf2b73511 Mon Sep 17 00:00:00 2001
From d81186e106a802c1faafc42ee24deee0160ac058 Mon Sep 17 00:00:00 2001
From: Spottedleaf <spottedleaf@spottedleaf.dev>
Date: Mon, 6 Apr 2020 18:10:43 -0700
Subject: [PATCH] Remove streams from PairedQueue
@ -78,5 +78,5 @@ index 85bb22e4b7..2369afb4f3 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f150261d52391ce180d530eb53af8a018db7b031 Mon Sep 17 00:00:00 2001
From 88311757ba33ed1beed93ac2c08123490bc554f7 Mon Sep 17 00:00:00 2001
From: Spottedleaf <spottedleaf@spottedleaf.dev>
Date: Mon, 6 Apr 2020 18:06:24 -0700
Subject: [PATCH] Remove streams from MinecraftKey
@ -46,5 +46,5 @@ index 2b271d3e50..b1beebf0ed 100644
public static class a implements JsonDeserializer<MinecraftKey>, JsonSerializer<MinecraftKey> {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 1e736388e18981ea7df68a2ad8bb3e313552c362 Mon Sep 17 00:00:00 2001
From 749d192499880dacf26a985d14e172a9c6f25078 Mon Sep 17 00:00:00 2001
From: Spottedleaf <spottedleaf@spottedleaf.dev>
Date: Mon, 6 Apr 2020 17:39:25 -0700
Subject: [PATCH] Reduce memory footprint of NBTTagCompound
@ -50,5 +50,5 @@ index 98deaba12c..02a2ed1baa 100644
public boolean equals(Object object) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,14 +1,14 @@
From 73d2319fff6b15279fa8f9360da05bc794267ddb Mon Sep 17 00:00:00 2001
From f0b7dac5f0f6ebce44688f3919eb5f727cc38b34 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 13 Apr 2020 07:31:44 +0100
Subject: [PATCH] Prevent opening inventories when frozen
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 50886c1374..0c0224d1eb 100644
index d51af68a92..f453ccdb02 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -384,7 +384,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -380,7 +380,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
containerUpdateDelay = world.paperConfig.containerUpdateTickRate;
}
// Paper end
@ -17,7 +17,7 @@ index 50886c1374..0c0224d1eb 100644
this.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper
this.activeContainer = this.defaultContainer;
}
@@ -1174,7 +1174,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1170,7 +1170,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} else {
// CraftBukkit start
this.activeContainer = container;
@ -26,7 +26,7 @@ index 50886c1374..0c0224d1eb 100644
// CraftBukkit end
container.addSlotListener(this);
return OptionalInt.of(this.containerCounter);
@@ -1912,7 +1912,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1908,7 +1908,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
@Override
@ -58,5 +58,5 @@ index a6d75c0e07..a5e9fc90ff 100644
player.activeContainer.addSlotListener(player);
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From a4e973bd1058ee0377e451d5993619881c7fb0a1 Mon Sep 17 00:00:00 2001
From 97f1acf281aa18312031d809f24aac85bf6c2611 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Wed, 15 Apr 2020 18:23:28 -0700
Subject: [PATCH] Optimise ArraySetSorted#removeIf
@ -64,5 +64,5 @@ index 85f799a713..7db6b5850b 100644
return new ArraySetSorted<>(i, (Comparator)Comparator.naturalOrder()); // Paper - decompile fix
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From e357b2e7bad2b540d3cf268978821148fd64fca2 Mon Sep 17 00:00:00 2001
From 042be6672a5aa3fb6d55fca93722548bae75da92 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Wed, 15 Apr 2020 17:56:07 -0700
Subject: [PATCH] Don't run entity collision code if not needed
@ -29,5 +29,5 @@ index 253e35826f..2c81344a65 100644
if (i > 0 && list.size() > i - 1 && this.random.nextInt(4) == 0) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From f3fde9e5f48bd872498c06b3df0d7d5575c7ea51 Mon Sep 17 00:00:00 2001
From 4dcc309197466e350b831399ebdba433cfeaef13 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Wed, 15 Apr 2020 18:08:53 -0700
Subject: [PATCH] Optimise entity hard collision checking
@ -11,7 +11,7 @@ Less crammed entities are likely to show significantly less benefit.
Effectively, this patch optimises crammed entity situations.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index d802acef71..09137d8785 100644
index 696634ebf5..00dd21205d 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -90,6 +90,54 @@ public class Chunk implements IChunkAccess {
@ -69,7 +69,7 @@ index d802acef71..09137d8785 100644
public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long i, @Nullable ChunkSection[] achunksection, @Nullable Consumer<Chunk> consumer) {
this.sections = new ChunkSection[16];
this.e = Maps.newHashMap();
@@ -525,7 +573,7 @@ public class Chunk implements IChunkAccess {
@@ -539,7 +587,7 @@ public class Chunk implements IChunkAccess {
entity.chunkY = k;
entity.chunkZ = this.loc.z;
this.entities.add(entity); // Paper - per chunk entity list
@ -78,7 +78,7 @@ index d802acef71..09137d8785 100644
// Paper start
if (entity instanceof EntityItem) {
itemCounts[k]++;
@@ -562,7 +610,7 @@ public class Chunk implements IChunkAccess {
@@ -576,7 +624,7 @@ public class Chunk implements IChunkAccess {
entity.entitySlice = null;
entity.inChunk = false;
}
@ -133,7 +133,7 @@ index 0dbe2dce11..324fd07bce 100644
this.id = Entity.entityCount.incrementAndGet();
this.passengers = Lists.newArrayList();
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
index af10fc36e0..2887cb14e4 100644
index 5bf99e0028..aecdaacfc7 100644
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
@@ -847,6 +847,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
@ -215,5 +215,5 @@ index c8619af2cf..899c535c40 100644
public List<Entity> getEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate<? super Entity> predicate) {
this.getMethodProfiler().c("getEntities");
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 33077c31361140aec39629707334a90a1c1185e5 Mon Sep 17 00:00:00 2001
From 253be66625c8d5ead5169a7dd27d192c66ed8993 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Thu, 16 Apr 2020 16:13:59 -0700
Subject: [PATCH] Optimize ChunkProviderServer's chunk level checking helper
@ -61,5 +61,5 @@ index 746b5b5589..c2e4e4f6f1 100644
private boolean a(long i, Function<PlayerChunk, CompletableFuture<Either<Chunk, PlayerChunk.Failure>>> function) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 53ed8a3225ce805964d5e8ec31df55935d7ba6f4 Mon Sep 17 00:00:00 2001
From a8a2c0877959a563ba354a1d238b9bbea01224ac Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Thu, 16 Apr 2020 20:07:29 -0500
Subject: [PATCH] Restrict vanilla teleport command to valid locations
@ -23,5 +23,5 @@ index 3060b4f68b..79016b5870 100644
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(d0, d1, d2));
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 4f94fb854eedf71d0b7908e765e40163fb7d431b Mon Sep 17 00:00:00 2001
From 3cb8049368979b5cc7f3f9c24f323333161a10d3 Mon Sep 17 00:00:00 2001
From: MiniDigger <admin@minidigger.me>
Date: Mon, 20 Jan 2020 21:38:15 +0100
Subject: [PATCH] Implement Player Client Options API
@ -98,7 +98,7 @@ index c4d4334305..7df24be46e 100644
protected static final DataWatcherObject<NBTTagCompound> bs = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
protected static final DataWatcherObject<NBTTagCompound> bt = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 0c0224d1eb..c108a38018 100644
index f453ccdb02..bf2ba0548d 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -2,6 +2,7 @@ package net.minecraft.server;
@ -118,7 +118,7 @@ index 0c0224d1eb..c108a38018 100644
private long cj = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity; private void setSpectatorTargetField(Entity e) { this.spectatedEntity = e; } // Paper - OBFHELPER
public boolean worldChangeInvuln;
@@ -1577,6 +1578,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1573,6 +1574,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
public void a(PacketPlayInSettings packetplayinsettings) {
@ -154,7 +154,7 @@ index 8faebf9efe..4da6371381 100644
return this.e;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e76f2b9c7f..3515b72682 100644
index 6672feaf51..dcbda5b35a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,5 +1,8 @@
@ -176,7 +176,7 @@ index e76f2b9c7f..3515b72682 100644
import net.minecraft.server.EnumChatFormat;
@@ -1969,6 +1973,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setViewDistance(int viewDistance) {
throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement"); // TODO
throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
}
+
+ @Override
@ -200,5 +200,5 @@ index e76f2b9c7f..3515b72682 100644
// Spigot start
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From a025fb60fcd97d4a39b9d65319df173c3bc7cbb5 Mon Sep 17 00:00:00 2001
From 9ce6c35e1a6618d71f84e3d9cea6cda01bbd4047 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 18 Apr 2020 04:36:11 -0400
Subject: [PATCH] Fix Chunk Post Processing deadlock risk
@ -37,7 +37,7 @@ index c2e4e4f6f1..78a8a3cc68 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 6fa70eb08d..0e652625bb 100644
index 22550f74df..cc400a9a84 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -108,6 +108,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -49,7 +49,7 @@ index 6fa70eb08d..0e652625bb 100644
// Paper start - distance maps
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<EntityPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
@@ -1007,7 +1009,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -974,7 +976,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return Either.left(chunk);
});
}, (runnable) -> {
@ -59,5 +59,5 @@ index 6fa70eb08d..0e652625bb 100644
completablefuture1.thenAcceptAsync((either) -> {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From fcd5f0fd7d20df79af0cccf4623690d8d8ecb9fa Mon Sep 17 00:00:00 2001
From 5332bdb3e363c520fd86a1c419d2ef4899661010 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 18 Apr 2020 15:59:41 -0400
Subject: [PATCH] Don't crash if player is attempted to be removed from
@ -19,5 +19,5 @@ index 0244768f76..279c7a85fb 100644
objectset.remove(entityplayer);
if (objectset.isEmpty()) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From b6e6c288e775adbeab66961a5c9ec0dc48161017 Mon Sep 17 00:00:00 2001
From d71b04af8dd05225fb5703e590b000243f968900 Mon Sep 17 00:00:00 2001
From: AvrooVulcan <avrovulcan.programming@gmail.com>
Date: Fri, 17 Apr 2020 00:15:23 +0100
Subject: [PATCH] Broadcast join message to console
@ -22,5 +22,5 @@ index 160476fa29..7403be0b25 100644
// CraftBukkit end
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From eb15a2a2808a32c82fc667b90b4b639aefab097a Mon Sep 17 00:00:00 2001
From 59ffe8f9308d4fbaba074ad07266e65918676505 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 19 Apr 2020 00:05:46 -0400
Subject: [PATCH] Fix Longstanding Broken behavior of PlayerJoinEvent
@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick
delays anymore.
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index c108a38018..a48e113b53 100644
index bf2ba0548d..45df816980 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -104,6 +104,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -100,6 +100,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public double maxHealthCache;
public boolean joining = true;
public boolean sentListPacket = false;
@ -40,10 +40,10 @@ index c108a38018..a48e113b53 100644
// CraftBukkit end
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 0e652625bb..3f4a3205a4 100644
index cc400a9a84..a06c0327df 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1569,6 +1569,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1526,6 +1526,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
.printStackTrace();
return;
}
@ -101,5 +101,5 @@ index 7403be0b25..ec45c30dd3 100644
// Paper start - Add to collideRule team if needed
final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard();
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 8a70af59fcb23c04a33296165224d604fdbf692e Mon Sep 17 00:00:00 2001
From 0cfef8cdd6a79282ce95c46ab2ae67b9df6227a7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 19 Apr 2020 04:28:29 -0400
Subject: [PATCH] Load Chunks for Login Asynchronously
@ -18,7 +18,7 @@ index 324fd07bce..01330045c0 100644
public void setPositionRotation(BlockPosition blockposition, float f, float f1) {
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index a48e113b53..0f9bca8b8b 100644
index 45df816980..48bbaec4b6 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -43,6 +43,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -29,7 +29,7 @@ index a48e113b53..0f9bca8b8b 100644
public final MinecraftServer server;
public final PlayerInteractManager playerInteractManager;
public final Deque<Integer> removeQueue = new ArrayDeque<>(); // Paper
@@ -105,6 +106,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -101,6 +102,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public boolean joining = true;
public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper
@ -250,5 +250,5 @@ index ec45c30dd3..edf9df8c8a 100644
Iterator iterator = list.iterator();
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 04f833aace5e4d08766d9cff78d6e83b5e92dfad Mon Sep 17 00:00:00 2001
From 9ac930771782d9f29527f7361b0435f5e357d2c6 Mon Sep 17 00:00:00 2001
From: 2277 <38501234+2277@users.noreply.github.com>
Date: Tue, 31 Mar 2020 10:33:55 +0100
Subject: [PATCH] Move player to spawn point if spawn in unloaded world
@ -26,5 +26,5 @@ index 01330045c0..9bb5a4bcf1 100644
spawnIn(bworld == null ? null : ((CraftWorld) bworld).getHandle());
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From b05ea81f6deb2f2d7fcc6fb65e371bd7402e2df1 Mon Sep 17 00:00:00 2001
From 73cbe81da65fdec0d5e4042fa4994837e41944a6 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
Date: Sun, 19 Apr 2020 12:25:20 +0200
Subject: [PATCH] Allow sleeping players to float
@ -22,5 +22,5 @@ index 8800a8fcf9..38ec22f4c0 100644
PlayerConnection.LOGGER.warn("{} was kicked for floating too long!", this.player.getDisplayName().getString());
this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickPlayerMessage); // Paper - use configurable kick message
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 57f07c3d690df1b2b2b613dea2e368984ee4b9fb Mon Sep 17 00:00:00 2001
From 152b6fbacb2b2f599adc5815981e17db8fc97515 Mon Sep 17 00:00:00 2001
From: nossr50 <nossr50@gmail.com>
Date: Thu, 26 Mar 2020 19:44:50 -0700
Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
@ -28,5 +28,5 @@ index 2c81344a65..3fc2360a10 100644
if (event.isCancelled()) {
return false;
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 759d5945b448b510250dc35d4c72d2d90c51cfa4 Mon Sep 17 00:00:00 2001
From eb89bb7522116612e4286157a0b9993d0cf9dbba Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 21 Apr 2020 03:51:53 -0400
Subject: [PATCH] Allow multiple callbacks to schedule for Callback Executor
@ -14,7 +14,7 @@ Use an ArrayDeque to store this Queue
We make sure to also implement a pattern that is recursion safe too.
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 3f4a3205a4..aabb9220db 100644
index a06c0327df..e08a3bd96c 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -87,24 +87,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -57,5 +57,5 @@ index 3f4a3205a4..aabb9220db 100644
// CraftBukkit end
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From d4c9271457c31e20ca2245fcc187e3032eff10d2 Mon Sep 17 00:00:00 2001
From 6d05ae8a7ec0b849d7922f0912f1fedb05dbf993 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 23 Apr 2020 01:36:39 -0400
Subject: [PATCH] Don't fire BlockFade on worldgen threads
@ -18,5 +18,5 @@ index b41de95a63..9e501514f3 100644
CraftBlockState blockState = CraftBlockState.getBlockState(generatoraccess, blockposition);
blockState.setData(Blocks.AIR.getBlockData());
--
2.26.2
2.26.0

Datei anzeigen

@ -1,14 +1,14 @@
From be90753baac2d3f3f7548c3d1757dc2ef772506e Mon Sep 17 00:00:00 2001
From c123493ddbfdf4ed2cda2ce0d60c7fadd995a7db Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 25 Apr 2020 15:13:41 -0500
Subject: [PATCH] Add phantom creative and insomniac controls
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 88a45e517c..fc189ebc96 100644
index 3c0468bc44..bfb52d75c7 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -689,4 +689,11 @@ public class PaperWorldConfig {
@@ -684,4 +684,11 @@ public class PaperWorldConfig {
private void lightQueueSize() {
lightQueueSize = getInt("light-queue-size", lightQueueSize);
}
@ -58,5 +58,5 @@ index f488c22ed6..0db431cd6a 100644
if (!worldserver.worldProvider.f() || blockposition.getY() >= worldserver.getSeaLevel() && worldserver.f(blockposition)) {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 1ed9ecc32fcec1fa395073143d271c8373b498b9 Mon Sep 17 00:00:00 2001
From a3d9cf01c0faa21381f3f2d1ec6b27395be1eec4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 25 Apr 2020 06:46:35 -0400
Subject: [PATCH] Fix numerous item duplication issues and teleport issues
@ -93,5 +93,5 @@ index c3f7e46121..73b271f6f3 100644
return event;
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 2b3eacadbea7c13465bc855a2dacd7bbeeaaa33b Mon Sep 17 00:00:00 2001
From 235f4bba895f9ea8992b76a696eef67ca3595425 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 19 Apr 2020 18:15:29 -0400
Subject: [PATCH] Implement Brigadier Mojang API
@ -138,5 +138,5 @@ index 5f33c9e52a..e16ecdea7d 100644
@Override
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 6a37d7c6bd64ccfbb2d061af1cabb3c64b0cef8c Mon Sep 17 00:00:00 2001
From 85dc598c049c292cae2909d518a0df13778ba64b Mon Sep 17 00:00:00 2001
From: zbk <zbk@projectsolaris.net>
Date: Sun, 26 Apr 2020 23:49:01 -0400
Subject: [PATCH] Villager Restocks API
@ -46,5 +46,5 @@ index fe726e7884..a8384081c0 100644
public boolean sleep(Location location) {
Preconditions.checkArgument(location != null, "Location cannot be null");
--
2.26.2
2.26.0

Datei anzeigen

@ -1,11 +1,11 @@
From dcd786960faeeeea7fa3106571ac2e20aae1cf0a Mon Sep 17 00:00:00 2001
From ff054938e2ca3779c9f1aed3717015c120dcdf5c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 2 May 2020 03:09:46 -0400
Subject: [PATCH] Validate PickItem Packet and kick for invalid
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 376f7f8f0b..a33289749c 100644
index a180df220e..02bda8bee4 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -691,7 +691,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
@ -25,5 +25,5 @@ index 376f7f8f0b..a33289749c 100644
this.player.playerConnection.sendPacket(new PacketPlayOutSetSlot(-2, packetplayinpickitem.b(), this.player.inventory.getItem(packetplayinpickitem.b())));
this.player.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex));
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From fb892b50f8ea61b6b898cc2d86769fe3bbfa2fb8 Mon Sep 17 00:00:00 2001
From 3eb7a15b09cbee5e58e2647927e24392ac898799 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Fri, 1 May 2020 17:39:26 +0300
Subject: [PATCH] Expose game version
@ -23,5 +23,5 @@ index f49193d9d7..1647c09756 100644
public List<CraftPlayer> getOnlinePlayers() {
return this.playerView;
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 1e7d68cf958496b9e67872eeb5cc01364bd15339 Mon Sep 17 00:00:00 2001
From cd9083a28d860b7f0fa2d5b3cc59d88f45d474fc Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 May 2020 14:25:55 -0400
Subject: [PATCH] Sync position on teleportation
@ -33,5 +33,5 @@ index 02bda8bee4..a188d9f3b6 100644
}
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From fc80e192e73525b7ac69affa6b4c586fa039cef4 Mon Sep 17 00:00:00 2001
From 7ca4e13c3ecf2b275f2b4fc7b399a65f26f506a6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 May 2020 22:35:09 -0400
Subject: [PATCH] Optimize Voxel Shape Merging
@ -126,5 +126,5 @@ index 08c83c62df..bb3a1a97df 100644
public interface a {
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 8fdbc0b6bb68ba8e6f6ce8035c9936e3922808f0 Mon Sep 17 00:00:00 2001
From d435cc4e885c3c821ef1a3f703e56729cd9e436f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 4 May 2020 00:38:13 -0400
Subject: [PATCH] Cleanup Region Files Direct Memory on close
@ -83,5 +83,5 @@ index df728e2c0a..20927d55c6 100644
private void c() throws IOException {
int i = (int) this.dataFile.size();
--
2.26.2
2.26.0

Datei anzeigen

@ -1,4 +1,4 @@
From 5932b5ecbc0822f05b671372c6e58ac8e14d5bb4 Mon Sep 17 00:00:00 2001
From 4f2c03a5f5be32ff4e04312b84d1db70efab691a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 4 May 2020 01:08:56 -0400
Subject: [PATCH] Set cap on JDK per-thread native byte buffer cache
@ -29,5 +29,5 @@ index 093dbeae27..93340e9470 100644
{
acceptsAll(asList("?", "help"), "Show the help");
--
2.26.2
2.26.0

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen