Performance patches prerequisite (#2802)

Prereq changes for the coming storm of performance patches.
Includes optimising incremental saving
This commit is contained in:
Spottedleaf 2020-01-27 16:16:53 -08:00 committed by Zach
parent 5fdafcd7a9
commit d16a5d8813
64 changed files with 2997 additions and 597 deletions

View File

@ -1,11 +1,56 @@
From b094d235e668b63afb13e4d01a9b14c45fa4363f Mon Sep 17 00:00:00 2001
From e1f1e03c209bac8c167db7e56d5859d3777e484d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 30 Mar 2016 19:36:20 -0400
Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/server/ArraySetSorted.java b/src/main/java/net/minecraft/server/ArraySetSorted.java
index a3afe60b0d..85f799a713 100644
--- a/src/main/java/net/minecraft/server/ArraySetSorted.java
+++ b/src/main/java/net/minecraft/server/ArraySetSorted.java
@@ -23,11 +23,11 @@ public class ArraySetSorted<T> extends AbstractSet<T> {
}
public static <T extends Comparable<T>> ArraySetSorted<T> a(int i) {
- return new ArraySetSorted<>(i, Comparator.naturalOrder());
+ return new ArraySetSorted<>(i, (Comparator)Comparator.naturalOrder()); // Paper - decompile fix
}
private static <T> T[] a(Object[] aobject) {
- return (Object[]) aobject;
+ return (T[])aobject; // Paper - decompile fix
}
private int c(T t0) {
@@ -101,7 +101,7 @@ public class ArraySetSorted<T> extends AbstractSet<T> {
}
public boolean remove(Object object) {
- int i = this.c(object);
+ int i = this.c((T)object); // Paper - decompile fix
if (i >= 0) {
this.d(i);
@@ -116,7 +116,7 @@ public class ArraySetSorted<T> extends AbstractSet<T> {
}
public boolean contains(Object object) {
- int i = this.c(object);
+ int i = this.c((T)object); // Paper - decompile fix
return i >= 0;
}
@@ -135,7 +135,7 @@ public class ArraySetSorted<T> extends AbstractSet<T> {
public <U> U[] toArray(U[] au) {
if (au.length < this.c) {
- return (Object[]) Arrays.copyOf(this.b, this.c, au.getClass());
+ return (U[])Arrays.copyOf(this.b, this.c, au.getClass()); // Paper - decompile fix
} else {
System.arraycopy(this.b, 0, au, 0, this.c);
if (au.length > this.c) {
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
index 960dce230..253890e53 100644
index 960dce2307..253890e537 100644
--- a/src/main/java/net/minecraft/server/BiomeBase.java
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
@@ -54,7 +54,7 @@ public abstract class BiomeBase {
@ -27,7 +72,7 @@ index 960dce230..253890e53 100644
public List<WorldGenFeatureConfigured<?, ?>> g() {
diff --git a/src/main/java/net/minecraft/server/BlockDataAbstract.java b/src/main/java/net/minecraft/server/BlockDataAbstract.java
index ab03b5568..1cf97cefc 100644
index ab03b55682..1cf97cefc9 100644
--- a/src/main/java/net/minecraft/server/BlockDataAbstract.java
+++ b/src/main/java/net/minecraft/server/BlockDataAbstract.java
@@ -29,7 +29,7 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
@ -72,7 +117,7 @@ index ab03b5568..1cf97cefc 100644
S s0 = this.e.get(iblockstate, v0);
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index e40f9c153..c88a62f6b 100644
index e40f9c153b..c88a62f6b7 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -57,12 +57,12 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@ -92,7 +137,7 @@ index e40f9c153..c88a62f6b 100644
});
}
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
index 28cfbaae2..1486d460c 100644
index 28cfbaae28..1486d460c8 100644
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java
@@ -20,10 +20,10 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends BlockState<T>
@ -109,7 +154,7 @@ index 28cfbaae2..1486d460c 100644
if (this.b.containsKey(s1)) {
diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java
index 68a601bac..efdf611e6 100644
index 68a601bac5..efdf611e66 100644
--- a/src/main/java/net/minecraft/server/ChunkStatus.java
+++ b/src/main/java/net/minecraft/server/ChunkStatus.java
@@ -84,7 +84,7 @@ public class ChunkStatus {
@ -122,7 +167,7 @@ index 68a601bac..efdf611e6 100644
for (int j = a().size() - 1; j >= 0; --j) {
diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java
index 2dd27edc8..6def3616e 100644
index 2dd27edc83..6def3616ef 100644
--- a/src/main/java/net/minecraft/server/CraftingManager.java
+++ b/src/main/java/net/minecraft/server/CraftingManager.java
@@ -58,7 +58,7 @@ public class CraftingManager extends ResourceDataJson {
@ -135,7 +180,7 @@ index 2dd27edc8..6def3616e 100644
CraftingManager.LOGGER.info("Loaded {} recipes", map1.size());
}
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
index f2c0e06ba..909d13c42 100644
index f2c0e06bab..909d13c427 100644
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
@@ -376,7 +376,7 @@ public class EnderDragonBattle {
@ -157,7 +202,7 @@ index f2c0e06ba..909d13c42 100644
private EntityEnderDragon o() {
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
index 7d44348c7..73ecdd22e 100644
index 7d44348c78..73ecdd22ea 100644
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
+++ b/src/main/java/net/minecraft/server/EntityVindicator.java
@@ -25,7 +25,7 @@ public class EntityVindicator extends EntityIllagerAbstract {
@ -169,8 +214,21 @@ index 7d44348c7..73ecdd22e 100644
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true));
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
diff --git a/src/main/java/net/minecraft/server/Fluid.java b/src/main/java/net/minecraft/server/Fluid.java
index 035f05e827..7c9ba12862 100644
--- a/src/main/java/net/minecraft/server/Fluid.java
+++ b/src/main/java/net/minecraft/server/Fluid.java
@@ -74,7 +74,7 @@ public interface Fluid extends IBlockDataHolder<Fluid> {
if (immutablemap.isEmpty()) {
object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.FLUID.getKey(fluid.getType()).toString())));
} else {
- object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.FLUID.getKey(fluid.getType()).toString()), dynamicops.createString("Properties"), dynamicops.createMap((Map) immutablemap.entrySet().stream().map((entry) -> {
+ object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.FLUID.getKey(fluid.getType()).toString()), dynamicops.createString("Properties"), dynamicops.createMap(immutablemap.entrySet().stream().map((entry) -> { // Paper - decompile fix
return Pair.of(dynamicops.createString(((IBlockState) entry.getKey()).a()), dynamicops.createString(IBlockDataHolder.b((IBlockState) entry.getKey(), (Comparable) entry.getValue())));
}).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond)))));
}
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
index 447f6a55b..1890c760f 100644
index 447f6a55b6..1890c760f9 100644
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
@@ -55,7 +55,7 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
@ -200,7 +258,7 @@ index 447f6a55b..1890c760f 100644
}
}
diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java
index 3be9efd22..3a1ad2346 100644
index 3be9efd22c..3a1ad2346b 100644
--- a/src/main/java/net/minecraft/server/IBlockData.java
+++ b/src/main/java/net/minecraft/server/IBlockData.java
@@ -281,12 +281,12 @@ public class IBlockData extends BlockDataAbstract<Block, IBlockData> implements
@ -240,7 +298,7 @@ index 3be9efd22..3a1ad2346 100644
for (i = 0; i < k; ++i) {
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
index 534e70671..d5c284cdd 100644
index 534e70671a..d5c284cdd1 100644
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
@@ -47,7 +47,7 @@ public interface IEntityAccess {
@ -301,7 +359,7 @@ index 534e70671..d5c284cdd 100644
if (pathfindertargetcondition.a(entityliving, t0)) {
list1.add(t0);
diff --git a/src/main/java/net/minecraft/server/IOWorker.java b/src/main/java/net/minecraft/server/IOWorker.java
index a986f2912..c5658c077 100644
index a986f2912f..c5658c0779 100644
--- a/src/main/java/net/minecraft/server/IOWorker.java
+++ b/src/main/java/net/minecraft/server/IOWorker.java
@@ -46,7 +46,7 @@ public class IOWorker implements AutoCloseable {
@ -340,8 +398,25 @@ index a986f2912..c5658c077 100644
} catch (Exception exception) {
IOWorker.LOGGER.error("Failed to close storage", exception);
this.h.completeExceptionally(exception);
diff --git a/src/main/java/net/minecraft/server/LightEngineStorageSky.java b/src/main/java/net/minecraft/server/LightEngineStorageSky.java
index 1e1f7ec6e6..75d9065b32 100644
--- a/src/main/java/net/minecraft/server/LightEngineStorageSky.java
+++ b/src/main/java/net/minecraft/server/LightEngineStorageSky.java
@@ -28,10 +28,10 @@ public class LightEngineStorageSky extends LightEngineStorage<LightEngineStorage
int l = lightenginestoragesky_a.c.get(SectionPosition.f(j));
if (l != lightenginestoragesky_a.b && k < l) {
- NibbleArray nibblearray = this.a((LightEngineStorageArray) lightenginestoragesky_a, j);
+ NibbleArray nibblearray = this.a(lightenginestoragesky_a, j); // Paper - decompile fix
if (nibblearray == null) {
- for (i = BlockPosition.f(i); nibblearray == null; nibblearray = this.a((LightEngineStorageArray) lightenginestoragesky_a, j)) {
+ for (i = BlockPosition.f(i); nibblearray == null; nibblearray = this.a(lightenginestoragesky_a, j)) { // Paper - decompile fix
j = SectionPosition.a(j, EnumDirection.UP);
++k;
if (k >= l) {
diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java
index 59bb53543..3ed6a1e78 100644
index 59bb535431..3ed6a1e785 100644
--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java
+++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java
@@ -125,7 +125,7 @@ public abstract class LootSelectorEntry extends LootEntryAbstract {
@ -369,7 +444,7 @@ index 59bb53543..3ed6a1e78 100644
}
diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java
index 829a7ae0a..8b9e47b4c 100644
index 829a7ae0a2..8b9e47b4c7 100644
--- a/src/main/java/net/minecraft/server/NBTBase.java
+++ b/src/main/java/net/minecraft/server/NBTBase.java
@@ -18,7 +18,7 @@ public interface NBTBase {
@ -382,7 +457,7 @@ index 829a7ae0a..8b9e47b4c 100644
default String asString() {
return this.toString();
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
index 22035b6c0..5406f4c40 100644
index 22035b6c0b..5406f4c40f 100644
--- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
@@ -51,7 +51,7 @@ public class NBTTagList extends NBTList<NBTBase> {
@ -395,7 +470,7 @@ index 22035b6c0..5406f4c40 100644
private byte type;
diff --git a/src/main/java/net/minecraft/server/NextTickListEntry.java b/src/main/java/net/minecraft/server/NextTickListEntry.java
index 8471920b8..e9c405fb5 100644
index 8471920b8b..e9c405fb53 100644
--- a/src/main/java/net/minecraft/server/NextTickListEntry.java
+++ b/src/main/java/net/minecraft/server/NextTickListEntry.java
@@ -37,13 +37,13 @@ public class NextTickListEntry<T> {
@ -417,7 +492,7 @@ index 8471920b8..e9c405fb5 100644
}
diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java
index 737afc7d7..db9f0196b 100644
index 737afc7d71..db9f0196bd 100644
--- a/src/main/java/net/minecraft/server/RegionFileSection.java
+++ b/src/main/java/net/minecraft/server/RegionFileSection.java
@@ -83,9 +83,9 @@ public class RegionFileSection<R extends MinecraftSerializable> implements AutoC
@ -442,7 +517,7 @@ index 737afc7d7..db9f0196b 100644
}, dynamic2);
});
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 7f89562e9..4efcb8b59 100644
index 7f89562e90..4efcb8b595 100644
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
@@ -27,7 +27,7 @@ public class RegistryBlockID<T> implements Registry<T> {
@ -455,7 +530,7 @@ index 7f89562e9..4efcb8b59 100644
this.c.set(i, t0);
diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java
index 4cb78c6a3..e15d28671 100644
index 4cb78c6a3f..e15d286710 100644
--- a/src/main/java/net/minecraft/server/RegistryID.java
+++ b/src/main/java/net/minecraft/server/RegistryID.java
@@ -17,9 +17,9 @@ public class RegistryID<K> implements Registry<K> {
@ -483,7 +558,7 @@ index 4cb78c6a3..e15d28671 100644
this.f = 0;
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
index 8534585eb..7b92ecfff 100644
index 8534585eb1..7b92ecfff9 100644
--- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
@@ -45,8 +45,8 @@ public class SystemUtils {
@ -526,8 +601,21 @@ index 8534585eb..7b92ecfff 100644
acompletablefuture[i] = completablefuture1.whenComplete((object, throwable) -> {
if (throwable != null) {
completablefuture.completeExceptionally(throwable);
diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java
index 8dbb33e749..8082569022 100644
--- a/src/main/java/net/minecraft/server/ThreadedMailbox.java
+++ b/src/main/java/net/minecraft/server/ThreadedMailbox.java
@@ -83,7 +83,7 @@ public class ThreadedMailbox<T> implements Mailbox<T>, AutoCloseable, Runnable {
public void run() {
try {
- this.a((i) -> {
+ this.a((int i) -> { // Paper - decompile fix
return i == 0;
});
} finally {
diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java
index ee2059cf8..77bb6b092 100644
index ee2059cf8e..77bb6b092a 100644
--- a/src/main/java/net/minecraft/server/Ticket.java
+++ b/src/main/java/net/minecraft/server/Ticket.java
@@ -23,7 +23,7 @@ public final class Ticket<T> implements Comparable<Ticket<?>> {
@ -540,7 +628,7 @@ index ee2059cf8..77bb6b092 100644
}
diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java
index c137484f6..c999f8c9b 100644
index c137484f66..c999f8c9bf 100644
--- a/src/main/java/net/minecraft/server/VillagePlace.java
+++ b/src/main/java/net/minecraft/server/VillagePlace.java
@@ -165,7 +165,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
@ -571,7 +659,7 @@ index c137484f6..c999f8c9b 100644
}
diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java
index a06a31534..3bcf0b385 100644
index a06a31534e..3bcf0b385d 100644
--- a/src/main/java/net/minecraft/server/VillagerTrades.java
+++ b/src/main/java/net/minecraft/server/VillagerTrades.java
@@ -15,12 +15,12 @@ import javax.annotation.Nullable;
@ -590,8 +678,21 @@ index a06a31534..3bcf0b385 100644
hashmap.put(VillagerProfession.CARTOGRAPHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.h(Items.MAP, 7, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.df, 11, 16, 10), new VillagerTrades.k(13, "Monument", MapIcon.Type.MONUMENT, 12, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COMPASS, 1, 12, 20), new VillagerTrades.k(14, "Mansion", MapIcon.Type.MANSION, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.ITEM_FRAME, 7, 1, 15), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.GLOBE_BANNER_PATTERN, 8, 1, 30)})));
hashmap.put(VillagerProfession.CLERIC, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.ROTTEN_FLESH, 32, 16, 2), new VillagerTrades.h(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.GOLD_INGOT, 3, 12, 10), new VillagerTrades.h(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.RABBIT_FOOT, 2, 12, 20), new VillagerTrades.h(Blocks.GLOWSTONE, 4, 1, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SCUTE, 4, 12, 30), new VillagerTrades.b(Items.GLASS_BOTTLE, 9, 12, 30), new VillagerTrades.h(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.NETHER_WART, 22, 12, 30), new VillagerTrades.h(Items.EXPERIENCE_BOTTLE, 3, 1, 30)})));
hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COAL, 15, 16, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 12, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.IRON_INGOT, 4, 12, 10), new VillagerTrades.h(new ItemStack(Items.pQ), 36, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 12, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.LAVA_BUCKET, 1, 12, 20), new VillagerTrades.b(Items.DIAMOND, 1, 12, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 12, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 3, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 3, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 3, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 3, 30, 0.2F)})));
diff --git a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java b/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
index e8daa74986..71d2ae2a9c 100644
--- a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
+++ b/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
@@ -38,7 +38,7 @@ public final class VoxelShapeMergerList implements VoxelShapeMerger {
double d1 = flag4 ? doublelist.getDouble(i++) : doublelist1.getDouble(j++);
if ((i != 0 && flag2 || flag4 || flag1) && (j != 0 && flag3 || !flag4 || flag)) {
- if (d0 < d1 - 1.0E-7D) {
+ if (!(d0 >= d1 - 1.0E-7D)) { // Paper - decompile error - welcome to hell
this.b.add(i - 1);
this.c.add(j - 1);
this.a.add(d1);
diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java b/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java
index 555cf6be7..22e14fe1e 100644
index 555cf6be79..22e14fe1e9 100644
--- a/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java
+++ b/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java
@@ -40,6 +40,6 @@ public class WorldGenFeatureStateProviderWeighted extends WorldGenFeatureStatePr
@ -603,7 +704,7 @@ index 555cf6be7..22e14fe1e 100644
}
}
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index 55fe7625a..19e68a783 100644
index 55fe7625af..19e68a7831 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -37,7 +37,7 @@ public class WorldPersistentData {

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From 7f6a88f275bf307644ba5a8a0507c1eee3507d37 Mon Sep 17 00:00:00 2001
From 0fb24c3112ee195e65b308f168e3bca44fa4edab 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 cfffbd031..125d3acdc 100644
index a263f60d49..8627365923 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 cfffbd031..125d3acdc 100644
this.l = Maps.newHashMap();
this.m = Maps.newHashMap();
this.n = new ShortList[16];
@@ -361,6 +386,7 @@ public class Chunk implements IChunkAccess {
@@ -366,6 +391,7 @@ public class Chunk implements IChunkAccess {
}
entity.inChunk = true;
@ -66,7 +66,7 @@ index cfffbd031..125d3acdc 100644
entity.chunkX = this.loc.x;
entity.chunkY = k;
entity.chunkZ = this.loc.z;
@@ -372,6 +398,7 @@ public class Chunk implements IChunkAccess {
@@ -378,6 +404,7 @@ public class Chunk implements IChunkAccess {
((HeightMap) this.heightMap.get(heightmap_type)).a(along);
}
@ -74,7 +74,7 @@ index cfffbd031..125d3acdc 100644
public void b(Entity entity) {
this.a(entity, entity.chunkY);
}
@@ -384,8 +411,12 @@ public class Chunk implements IChunkAccess {
@@ -390,8 +417,12 @@ public class Chunk implements IChunkAccess {
if (i >= this.entitySlices.length) {
i = this.entitySlices.length - 1;
}
@ -90,7 +90,7 @@ index cfffbd031..125d3acdc 100644
@Override
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index a8ea70b36..3a969d92e 100644
index a8ea70b36b..3a969d92e0 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -134,7 +134,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -143,7 +143,7 @@ index a8ea70b36..3a969d92e 100644
private String entityKeyString;
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 9071bb7ec..820180ab3 100644
index 9071bb7ece..820180ab3f 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -51,6 +51,15 @@ public abstract class TileEntity implements KeyedObject { // Paper
@ -163,7 +163,7 @@ index 9071bb7ec..820180ab3 100644
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 63ecbcd47..c82c21326 100644
index 63ecbcd47a..c82c213260 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -138,6 +138,7 @@ import net.minecraft.server.EntityZombieVillager;

View File

@ -1,4 +1,4 @@
From 50eee3a1fb88960217779354b20dd20daae7c7b6 Mon Sep 17 00:00:00 2001
From 109173e7396da82ee8dcef2df5036d1dda99b0f2 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 125d3acdc..dcaf3a509 100644
index 8627365923..4110b6fa39 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 125d3acdc..dcaf3a509 100644
}
return removed;
}
@@ -385,6 +390,7 @@ public class Chunk implements IChunkAccess {
@@ -390,6 +395,7 @@ public class Chunk implements IChunkAccess {
k = this.entitySlices.length - 1;
}
@ -45,7 +45,7 @@ index 125d3acdc..dcaf3a509 100644
entity.inChunk = true;
entity.setCurrentChunk(this); // Paper
entity.chunkX = this.loc.x;
@@ -416,6 +422,7 @@ public class Chunk implements IChunkAccess {
@@ -422,6 +428,7 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}

View File

@ -1,4 +1,4 @@
From ce5ca10c801e990f0f814a775ff9f8d35b82bb1b Mon Sep 17 00:00:00 2001
From 0bc5c16d73d2e593416aef85336d9d001a29c0e7 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
@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
new file mode 100644
index 000000000..69e26a826
index 0000000000..69e26a8267
--- /dev/null
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -0,0 +1,141 @@
@ -153,7 +153,7 @@ index 000000000..69e26a826
+}
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
new file mode 100644
index 000000000..3a79cde59
index 0000000000..3a79cde595
--- /dev/null
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -0,0 +1,130 @@
@ -288,7 +288,7 @@ index 000000000..3a79cde59
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index b6d470e59..f402a29b0 100644
index b6d470e594..f402a29b09 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -14,11 +14,14 @@ import java.util.concurrent.TimeUnit;
@ -335,7 +335,7 @@ index b6d470e59..f402a29b0 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index cd72a9c84..5de881371 100644
index cd72a9c845..5de881371a 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -31,6 +31,15 @@ public class Block implements IMaterial {
@ -355,10 +355,10 @@ index cd72a9c84..5de881371 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 dcaf3a509..5f9031257 100644
index 4110b6fa39..2ebbcc6958 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -567,6 +567,7 @@ public class Chunk implements IChunkAccess {
@@ -574,6 +574,7 @@ public class Chunk implements IChunkAccess {
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(this.bukkitChunk, this.needsDecoration));
if (this.needsDecoration) {
@ -366,7 +366,7 @@ index dcaf3a509..5f9031257 100644
this.needsDecoration = false;
java.util.Random random = new java.util.Random();
random.setSeed(world.getSeed());
@@ -586,6 +587,7 @@ public class Chunk implements IChunkAccess {
@@ -593,6 +594,7 @@ public class Chunk implements IChunkAccess {
}
}
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
@ -375,10 +375,10 @@ index dcaf3a509..5f9031257 100644
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 9cd21b1ff..99afce39a 100644
index d24c8070f4..1ba34cfaa9 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -133,11 +133,13 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -229,11 +229,13 @@ public class ChunkProviderServer extends IChunkProvider {
}
gameprofilerfiller.c("getChunkCacheMiss");
@ -394,7 +394,7 @@ index 9cd21b1ff..99afce39a 100644
ichunkaccess = (IChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
return ichunkaccess1;
}, (playerchunk_failure) -> {
@@ -330,7 +332,9 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -426,7 +428,9 @@ public class ChunkProviderServer extends IChunkProvider {
public void save(boolean flag) {
this.tickDistanceManager();
@ -404,7 +404,7 @@ index 9cd21b1ff..99afce39a 100644
}
@Override
@@ -367,7 +371,9 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -463,7 +467,9 @@ public class ChunkProviderServer extends IChunkProvider {
this.tickDistanceManager();
this.world.timings.doChunkMap.stopTiming(); // Spigot
this.world.getMethodProfiler().exitEnter("chunks");
@ -414,7 +414,7 @@ index 9cd21b1ff..99afce39a 100644
this.world.timings.doChunkUnload.startTiming(); // Spigot
this.world.getMethodProfiler().exitEnter("unload");
this.playerChunkMap.unloadChunks(booleansupplier);
@@ -392,10 +398,12 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -488,10 +494,12 @@ public class ChunkProviderServer extends IChunkProvider {
boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit // PAIL: TODO monster ticks
this.world.getMethodProfiler().enter("naturalSpawnCount");
@ -427,7 +427,7 @@ index 9cd21b1ff..99afce39a 100644
this.world.getMethodProfiler().exit();
this.playerChunkMap.f().forEach((playerchunk) -> {
Optional<Chunk> optional = ((Either) playerchunk.b().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
@@ -404,13 +412,27 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -500,13 +508,27 @@ public class ChunkProviderServer extends IChunkProvider {
Chunk chunk = (Chunk) optional.get();
this.world.getMethodProfiler().enter("broadcast");
@ -457,7 +457,7 @@ index 9cd21b1ff..99afce39a 100644
this.world.getMethodProfiler().enter("spawner");
this.world.timings.mobSpawn.startTiming(); // Spigot
EnumCreatureType[] aenumcreaturetype1 = aenumcreaturetype;
@@ -454,24 +476,24 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -550,24 +572,24 @@ public class ChunkProviderServer extends IChunkProvider {
this.world.getMethodProfiler().exit();
}
@ -487,7 +487,7 @@ index 9cd21b1ff..99afce39a 100644
@Override
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index e16d30f2c..4af5a230b 100644
index e16d30f2ca..4af5a230ba 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -1,5 +1,6 @@
@ -525,7 +525,7 @@ index e16d30f2c..4af5a230b 100644
}
diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java
index 8d7a6d240..707bd2600 100644
index 8d7a6d2403..707bd2600d 100644
--- a/src/main/java/net/minecraft/server/CustomFunction.java
+++ b/src/main/java/net/minecraft/server/CustomFunction.java
@@ -13,12 +13,22 @@ public class CustomFunction {
@ -552,7 +552,7 @@ index 8d7a6d240..707bd2600 100644
return this.b;
}
diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java
index ba40d5fbb..ee42e1dfa 100644
index ba40d5fbb5..ee42e1dfa4 100644
--- a/src/main/java/net/minecraft/server/CustomFunctionData.java
+++ b/src/main/java/net/minecraft/server/CustomFunctionData.java
@@ -103,7 +103,7 @@ public class CustomFunctionData implements IResourcePackListener {
@ -565,7 +565,7 @@ index ba40d5fbb..ee42e1dfa 100644
int k = 0;
CustomFunction.c[] acustomfunction_c = customfunction.b();
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 1cde6fc9c..e636433b1 100644
index 1cde6fc9c1..e636433b11 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -20,6 +20,8 @@ import java.util.List;
@ -653,7 +653,7 @@ index 1cde6fc9c..e636433b1 100644
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 3a969d92e..2d8c37d73 100644
index 3a969d92e0..2d8c37d73b 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender;
@ -692,7 +692,7 @@ index 3a969d92e..2d8c37d73 100644
protected BlockPosition ag() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 1f350e335..35e3f1c78 100644
index 1f350e3352..35e3f1c78d 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -37,7 +37,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@ -768,7 +768,7 @@ index 1f350e335..35e3f1c78 100644
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b4a0bd795..4dc691775 100644
index b4a0bd7951..4dc6917759 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -63,7 +63,7 @@ import org.bukkit.craftbukkit.CraftServer;
@ -944,7 +944,7 @@ index b4a0bd795..4dc691775 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 b5a3b1001..dcfb37004 100644
index e248893717..1f289047fa 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1,7 +1,9 @@
@ -957,7 +957,7 @@ index b5a3b1001..dcfb37004 100644
import com.google.common.collect.Lists;
import com.google.common.collect.Queues;
import com.google.common.collect.Sets;
@@ -477,9 +479,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -506,9 +508,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> f(ChunkCoordIntPair chunkcoordintpair) {
return CompletableFuture.supplyAsync(() -> {
@ -972,7 +972,7 @@ index b5a3b1001..dcfb37004 100644
if (nbttagcompound != null) {
boolean flag = nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8);
@@ -519,7 +524,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -548,7 +553,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return "chunkGenerate " + chunkstatus.d();
});
return completablefuture.thenComposeAsync((either) -> {
@ -981,7 +981,7 @@ index b5a3b1001..dcfb37004 100644
try {
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture1 = chunkstatus.a(this.world, this.chunkGenerator, this.definedStructureManager, this.lightEngine, (ichunkaccess) -> {
return this.c(playerchunk);
@@ -572,6 +577,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -601,6 +606,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) -> {
@ -989,7 +989,7 @@ index b5a3b1001..dcfb37004 100644
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
Chunk chunk;
@@ -623,6 +629,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -652,6 +658,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
return chunk;
@ -997,7 +997,7 @@ index b5a3b1001..dcfb37004 100644
});
}, (runnable) -> {
Mailbox mailbox = this.mailboxMain;
@@ -1060,6 +1067,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1091,6 +1098,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PlayerChunkMap.EntityTracker playerchunkmap_entitytracker;
ObjectIterator objectiterator;
@ -1005,7 +1005,7 @@ index b5a3b1001..dcfb37004 100644
for (objectiterator = this.trackedEntities.values().iterator(); objectiterator.hasNext(); playerchunkmap_entitytracker.trackerEntry.a()) {
playerchunkmap_entitytracker = (PlayerChunkMap.EntityTracker) objectiterator.next();
@@ -1077,16 +1085,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1108,16 +1116,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
playerchunkmap_entitytracker.e = sectionposition1;
}
}
@ -1027,7 +1027,7 @@ index b5a3b1001..dcfb37004 100644
protected void broadcast(Entity entity, Packet<?> packet) {
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index b257e1c4e..b7beb058d 100644
index b257e1c4e9..b7beb058d8 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -58,6 +58,7 @@ import org.bukkit.inventory.CraftingInventory;
@ -1082,7 +1082,7 @@ index b257e1c4e..b7beb058d 100644
// this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s);
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
index 2c671629a..eb3269e0e 100644
index 2c671629a4..eb3269e0ea 100644
--- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
+++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
@@ -2,6 +2,8 @@ package net.minecraft.server;
@ -1109,7 +1109,7 @@ index 2c671629a..eb3269e0e 100644
PlayerConnectionUtils.LOGGER.debug("Ignoring packet due to disconnection: " + packet);
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 0694f4563..1652a57e2 100644
index 0694f4563e..1652a57e25 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1,5 +1,6 @@
@ -1133,7 +1133,7 @@ index 0694f4563..1652a57e2 100644
public WhiteList getWhitelist() {
diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java
index 00bbd34b6..f533860bb 100644
index 00bbd34b6a..f533860bbe 100644
--- a/src/main/java/net/minecraft/server/TickListServer.java
+++ b/src/main/java/net/minecraft/server/TickListServer.java
@@ -28,13 +28,18 @@ public class TickListServer<T> implements TickList<T> {
@ -1183,7 +1183,7 @@ index 00bbd34b6..f533860bb 100644
this.g.clear();
}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 820180ab3..fa6400dcc 100644
index 820180ab3f..fa6400dccd 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -9,11 +9,12 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;
@ -1202,7 +1202,7 @@ index 820180ab3..fa6400dcc 100644
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public CraftPersistentDataContainer persistentDataContainer;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8fc88f162..0087bd9b1 100644
index 8fc88f162c..0087bd9b1c 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1,5 +1,7 @@
@ -1257,7 +1257,7 @@ index 8fc88f162..0087bd9b1 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 32f8f2aed..bc1ff7d56 100644
index 2aaf679df4..ebc252a610 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1,6 +1,8 @@
@ -1382,7 +1382,7 @@ index 32f8f2aed..bc1ff7d56 100644
// CraftBukkit start - moved from MinecraftServer.saveChunks
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 57ad50403..038928789 100644
index 57ad50403b..038928789b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1935,12 +1935,31 @@ public final class CraftServer implements Server {
@ -1419,7 +1419,7 @@ index 57ad50403..038928789 100644
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
deleted file mode 100644
index 2bd22a369..000000000
index 2bd22a3698..0000000000
--- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
+++ /dev/null
@@ -1,162 +0,0 @@
@ -1586,7 +1586,7 @@ index 2bd22a369..000000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9eba8449e..1094190fd 100644
index 9eba8449e4..1094190fd9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1753,6 +1753,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -1605,7 +1605,7 @@ index 9eba8449e..1094190fd 100644
public Player.Spigot spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index b90979c7b..8823f94f7 100644
index b90979c7ba..8823f94f7b 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -1,5 +1,6 @@
@ -1671,7 +1671,7 @@ index b90979c7b..8823f94f7 100644
private boolean isReady(final int currentTick) {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
index 3f55381c1..0d9a46680 100644
index 3f55381c15..0d9a466809 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
@@ -1,9 +1,11 @@
@ -1756,7 +1756,7 @@ index 3f55381c1..0d9a46680 100644
- // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
index e52ef47b7..3d90b3426 100644
index e52ef47b78..3d90b34268 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
@@ -5,6 +5,7 @@ import org.bukkit.util.CachedServerIcon;
@ -1768,7 +1768,7 @@ index e52ef47b7..3d90b3426 100644
this.value = value;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index afe4004ff..1c719ec0e 100644
index afe4004ff2..1c719ec0e3 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -290,6 +290,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
@ -1786,7 +1786,7 @@ index afe4004ff..1c719ec0e 100644
* This helper class represents the different NBT Tags.
* <p>
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index ca7789b5e..442383969 100644
index ca7789b5e0..4423839697 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -31,7 +31,7 @@ import net.minecraft.server.EntityWither;
@ -1847,5 +1847,5 @@ index ca7789b5e..442383969 100644
}
}
--
2.25.0
2.25.0.windows.1

View File

@ -1,14 +1,14 @@
From 25bc4ba2c424139f3a547e135bf830164fd857b6 Mon Sep 17 00:00:00 2001
From e9d2579100a78a8de64e2942babd0acee0965be5 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 5f9031257..f62429277 100644
index 2ebbcc6958..e7268074b4 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -500,6 +500,10 @@ public class Chunk implements IChunkAccess {
@@ -506,6 +506,10 @@ public class Chunk implements IChunkAccess {
}
// CraftBukkit start

View File

@ -1,11 +1,11 @@
From f394d66b388a13b0538381f70c637c2154cf5bdb Mon Sep 17 00:00:00 2001
From 41d5a5951d57736867404618442e8cb8a3b69520 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
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 706bab8a1..ecf9f9f76 100644
index 706bab8a1d..ecf9f9f764 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -167,6 +167,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -51,7 +51,7 @@ index 706bab8a1..ecf9f9f76 100644
NBTTagList nbttaglist = new NBTTagList();
double[] adouble1 = adouble;
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index cb21ce0b1..40fd012ae 100644
index cb21ce0b1a..40fd012ae2 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -253,6 +253,14 @@ public class EntityFallingBlock extends Entity {
@ -70,7 +70,7 @@ index cb21ce0b1..40fd012ae 100644
public void a(boolean flag) {
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index 33c51dced..346315acb 100644
index 33c51dced7..346315acb7 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -103,6 +103,14 @@ public class EntityTNTPrimed extends Entity {
@ -89,7 +89,7 @@ index 33c51dced..346315acb 100644
@Nullable
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
index 5406f4c40..d778eac45 100644
index 5406f4c40f..d778eac45d 100644
--- a/src/main/java/net/minecraft/server/NBTTagList.java
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
@@ -188,6 +188,7 @@ public class NBTTagList extends NBTList<NBTBase> {
@ -101,10 +101,10 @@ index 5406f4c40..d778eac45 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 bc1ff7d56..948438829 100644
index ebc252a610..6f07065eb4 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1174,6 +1174,11 @@ public class WorldServer extends World {
@@ -1176,6 +1176,11 @@ public class WorldServer extends World {
this.navigators.add(((EntityInsentient) entity).getNavigation());
}
entity.valid = true; // CraftBukkit
@ -117,7 +117,7 @@ index bc1ff7d56..948438829 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index c82c21326..a29693674 100644
index c82c213260..a296936748 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1007,4 +1007,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View File

@ -1,11 +1,11 @@
From 8effbabd66a3a27d839b6ef5ea2a3d3d971354d4 Mon Sep 17 00:00:00 2001
From c084ec91efac4a1c1d5721f399bd0647a1151d9c Mon Sep 17 00:00:00 2001
From: DoctorDark <doctordark11@gmail.com>
Date: Wed, 16 Mar 2016 02:21:39 -0500
Subject: [PATCH] Configurable end credits
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index f7a0a33e4..50dec5cb5 100644
index f7a0a33e49..50dec5cb5e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -144,4 +144,10 @@ public class PaperWorldConfig {
@ -20,7 +20,7 @@ index f7a0a33e4..50dec5cb5 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index ce4821092..bc0a1585d 100644
index 57ce9bde64..23c1706874 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -60,7 +60,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -32,7 +32,7 @@ index ce4821092..bc0a1585d 100644
private final RecipeBookServer recipeBook;
private Vec3D co;
private int cp;
@@ -691,6 +691,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -695,6 +695,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.getWorldServer().removePlayer(this);
if (!this.viewingCredits) {
this.viewingCredits = true;

View File

@ -1,11 +1,11 @@
From b4faae88abba8ea23a3d5a3b1f30d1be8e1983f1 Mon Sep 17 00:00:00 2001
From ceaede64459309b8a6cf12881d861e8ee5a90dff 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
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index a75e0ec54..a13fd9b34 100644
index a75e0ec54e..a13fd9b340 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -2,6 +2,7 @@ package net.minecraft.server;
@ -77,10 +77,10 @@ index a75e0ec54..a13fd9b34 100644
this.c();
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index dcfb37004..89433004d 100644
index 1f289047fa..b2260498cb 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1186,10 +1186,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1217,10 +1217,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 dcfb37004..89433004d 100644
this.tracker = entity;
this.trackingDistance = i;
this.e = SectionPosition.a(entity);
@@ -1271,7 +1275,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1302,7 +1306,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
entityplayer.removeQueue.remove(Integer.valueOf(this.tracker.getId()));
// CraftBukkit end

View File

@ -1,11 +1,11 @@
From 276892365068cb1f6cd5535e5975d48caadf6407 Mon Sep 17 00:00:00 2001
From de587b9b8c013c069adefd8afd0dbbae0bb9f640 Mon Sep 17 00:00:00 2001
From: Sudzzy <originmc@outlook.com>
Date: Wed, 2 Mar 2016 23:34:44 -0600
Subject: [PATCH] Configurable container update tick rate
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 428deed56..a4da22ea6 100644
index 428deed56d..a4da22ea65 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -176,4 +176,9 @@ public class PaperWorldConfig {
@ -19,7 +19,7 @@ index 428deed56..a4da22ea6 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index bc0a1585d..f03395e2d 100644
index 23c1706874..f0f456983f 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -72,6 +72,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -30,7 +30,7 @@ index bc0a1585d..f03395e2d 100644
// CraftBukkit start
public String displayName;
@@ -351,7 +352,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -355,7 +356,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
--this.noDamageTicks;
}

View File

@ -1,11 +1,11 @@
From 7fd41e3eaf2305ff8ba5253e7ed1d7e5fd53c42e Mon Sep 17 00:00:00 2001
From 2c35f4f4a2d099ec32ad3a51236f0692b002eb7c Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <joe@ibj.io>
Date: Thu, 3 Mar 2016 02:46:17 -0600
Subject: [PATCH] Add configurable portal search radius
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 62e793b71..cd47a4ca0 100644
index 62e793b71b..cd47a4ca06 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -191,4 +191,11 @@ public class PaperWorldConfig {
@ -21,7 +21,7 @@ index 62e793b71..cd47a4ca0 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 1ce080287..be39f38d5 100644
index 1ce0802879..be39f38d56 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2574,7 +2574,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -34,10 +34,10 @@ index 1ce080287..be39f38d5 100644
return null;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index f03395e2d..4289aadc6 100644
index f0f456983f..b5101af011 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -751,7 +751,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -755,7 +755,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
// CraftBukkit start
Location enter = this.getBukkitEntity().getLocation();
Location exit = (worldserver1 == null) ? null : new Location(worldserver1.getWorld(), d0, d1, d2, f1, f);
@ -49,7 +49,7 @@ index f03395e2d..4289aadc6 100644
if (event.isCancelled() || event.getTo() == null) {
return null;
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
index 19c54f1dd..f84dd6d9b 100644
index 19c54f1dde..f84dd6d9be 100644
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
@@ -45,7 +45,7 @@ public class PortalTravelAgent {

View File

@ -1,4 +1,4 @@
From c96259dffb4ead729ef3e2e4055b543ce972333c Mon Sep 17 00:00:00 2001
From b257a14b9a64d819e39d4128d92c262b38087324 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
@ -6,7 +6,7 @@ Subject: [PATCH] Add exception reporting event
diff --git a/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java
new file mode 100644
index 000000000..f699ce18c
index 0000000000..f699ce18ca
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java
@@ -0,0 +1,38 @@
@ -49,7 +49,7 @@ index 000000000..f699ce18c
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index f62429277..be32b31e7 100644
index e7268074b4..6ed23ea6c8 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 f62429277..be32b31e7 100644
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
@@ -505,10 +506,15 @@ public class Chunk implements IChunkAccess {
@@ -511,10 +512,15 @@ public class Chunk implements IChunkAccess {
this.tileEntities.remove(blockposition);
// Paper end
} else {
@ -80,7 +80,7 @@ index f62429277..be32b31e7 100644
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 99afce39a..a3ef6dba7 100644
index 1ba34cfaa9..3ef7e4561f 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -15,6 +15,9 @@ import java.util.function.BooleanSupplier;
@ -94,7 +94,7 @@ index 99afce39a..a3ef6dba7 100644
public class ChunkProviderServer extends IChunkProvider {
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index c9c2b0025..1422503e1 100644
index c9c2b00251..1422503e11 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -1,5 +1,6 @@
@ -121,10 +121,10 @@ index c9c2b0025..1422503e1 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 89433004d..1627aeeef 100644
index b2260498cb..c575ff57dd 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -698,6 +698,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -727,6 +727,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 89433004d..1627aeeef 100644
return false;
}
@@ -726,6 +727,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -755,6 +756,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);
@ -141,7 +141,7 @@ index 89433004d..1627aeeef 100644
}
}
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 187c4e0f5..c2312a227 100644
index 187c4e0f58..c2312a227c 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -241,6 +241,7 @@ public class RegionFile implements AutoCloseable {
@ -161,7 +161,7 @@ index 187c4e0f5..c2312a227 100644
} finally {
if (filechannel != null) {
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 8ba344df6..02157d051 100644
index 8ba344df64..02157d051f 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -8,6 +8,7 @@ import org.apache.logging.log4j.LogManager;
@ -189,7 +189,7 @@ index 8ba344df6..02157d051 100644
}
diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java
index d5e9bae70..1bcf01c09 100644
index d5e9bae709..1bcf01c09a 100644
--- a/src/main/java/net/minecraft/server/VillageSiege.java
+++ b/src/main/java/net/minecraft/server/VillageSiege.java
@@ -1,5 +1,7 @@
@ -209,7 +209,7 @@ index d5e9bae70..1bcf01c09 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index cb369665c..026007891 100644
index cb369665c4..0260078911 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2,6 +2,9 @@ package net.minecraft.server;
@ -248,7 +248,7 @@ index cb369665c..026007891 100644
return;
// Paper end
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index 19e68a783..a2a25cf6a 100644
index 19e68a7831..a2a25cf6a4 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -121,6 +121,7 @@ public class WorldPersistentData {
@ -260,7 +260,7 @@ index 19e68a783..a2a25cf6a 100644
} finally {
if (pushbackinputstream != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 8823f94f7..552daf437 100644
index 8823f94f7b..552daf4376 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -16,6 +16,9 @@ import java.util.concurrent.atomic.AtomicInteger;

View File

@ -1,4 +1,4 @@
From 91f5356e6a891791dc57ff093432a4eed0d57d02 Mon Sep 17 00:00:00 2001
From 36a26b5d1886726fd705a5d5fff6c85f3e568c2a 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
@ -12,7 +12,7 @@ Replace all calls to the new place to the unnecessary forward.
Optimize getType and getBlockData to manually inline and optimize the calls
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index a3b5793e4..71089442c 100644
index a3b5793e48..71089442c1 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -13,6 +13,14 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> {
@ -31,10 +31,10 @@ index a3b5793e4..71089442c 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 be32b31e7..fd9ba8232 100644
index 6ed23ea6c8..7033c6e839 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -203,12 +203,24 @@ public class Chunk implements IChunkAccess {
@@ -208,12 +208,24 @@ public class Chunk implements IChunkAccess {
return this.sections;
}
@ -64,7 +64,7 @@ index be32b31e7..fd9ba8232 100644
IBlockData iblockdata = null;
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
index 652067757..0d5deee36 100644
index 652067757a..0d5deee365 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
@@ -9,7 +9,7 @@ public class ChunkSection {
@ -77,7 +77,7 @@ index 652067757..0d5deee36 100644
public ChunkSection(int i) {
this(i, (short) 0, (short) 0, (short) 0);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 37914c2f5..18ee29e50 100644
index 37914c2f53..18ee29e507 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -183,11 +183,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable {

View File

@ -1,14 +1,14 @@
From 050929739349814b3532f81e389a5ee3efcb2714 Mon Sep 17 00:00:00 2001
From b510c1a11e27b982e5a084ed3303c975eb3c36b9 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 9161d6fd6..2a80fe846 100644
index 4e29746c14..dac6e10d25 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1142,7 +1142,7 @@ public class WorldServer extends World {
@@ -1144,7 +1144,7 @@ public class WorldServer extends World {
if (entity instanceof EntityInsentient) {
this.navigators.remove(((EntityInsentient) entity).getNavigation());
}
@ -17,7 +17,7 @@ index 9161d6fd6..2a80fe846 100644
entity.valid = false; // CraftBukkit
}
@@ -1180,6 +1180,7 @@ public class WorldServer extends World {
@@ -1182,6 +1182,7 @@ public class WorldServer extends World {
entity.origin = entity.getBukkitEntity().getLocation();
}
// Paper end

View File

@ -1,4 +1,4 @@
From 25fbadf155b0e1ccde33fc04eac74940af7bc4af Mon Sep 17 00:00:00 2001
From d6acffa96589e496354732eab4ffabeb36dec11d 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
@ -11,7 +11,7 @@ For people who want all chunks to be treated equally, you can chose a fixed valu
This allows to fine-tune vanilla gameplay.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 6ef0e1399..5872e6b17 100644
index 6ef0e1399e..5872e6b171 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -236,4 +236,14 @@ public class PaperWorldConfig {
@ -30,10 +30,10 @@ index 6ef0e1399..5872e6b17 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index fd9ba8232..034e8684d 100644
index 7033c6e839..c6a79644ef 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -832,7 +832,7 @@ public class Chunk implements IChunkAccess {
@@ -840,7 +840,7 @@ public class Chunk implements IChunkAccess {
@Override
public long getInhabitedTime() {

View File

@ -1,4 +1,4 @@
From 6bbea6f4606dafaf738658a00512fdbddd28c9e1 Mon Sep 17 00:00:00 2001
From a5671d9f986739e5b97273f3f6941e89b30ba5b6 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
@ -6,7 +6,7 @@ Subject: [PATCH] Remove unused World Tile Entity List
Massive hit to performance and it is completely unnecessary.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index e7d441b22..50c138d06 100644
index e7d441b22b..50c138d06d 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -40,7 +40,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@ -67,10 +67,10 @@ index e7d441b22..50c138d06 100644
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 2a80fe846..9121aa2e4 100644
index dac6e10d25..7b3e3487fa 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1627,7 +1627,7 @@ public class WorldServer extends World {
@@ -1629,7 +1629,7 @@ public class WorldServer extends World {
}
bufferedwriter.write(String.format("entities: %d\n", this.entitiesById.size()));
@ -79,7 +79,7 @@ index 2a80fe846..9121aa2e4 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");
@@ -1790,7 +1790,7 @@ public class WorldServer extends World {
@@ -1792,7 +1792,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);

View File

@ -1,11 +1,11 @@
From da29415c772bbff8d14c2af933489884c855fb4c Mon Sep 17 00:00:00 2001
From f5359af1e1a41db39a22219987cd988c7e4c227f Mon Sep 17 00:00:00 2001
From: Isaac Moore <rmsy@me.com>
Date: Tue, 19 Apr 2016 14:09:31 -0500
Subject: [PATCH] Implement PlayerLocaleChangeEvent
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 4289aadc6..1f5145d49 100644
index b5101af011..d4bba876d0 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -37,7 +37,7 @@ import org.bukkit.inventory.MainHand;
@ -17,7 +17,7 @@ index 4289aadc6..1f5145d49 100644
public PlayerConnection playerConnection;
public final MinecraftServer server;
public final PlayerInteractManager playerInteractManager;
@@ -1461,13 +1461,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1465,13 +1465,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT);
this.server.server.getPluginManager().callEvent(event);
}
@ -40,7 +40,7 @@ index 4289aadc6..1f5145d49 100644
this.ci = packetplayinsettings.e();
this.getDataWatcher().set(EntityPlayer.bq, (byte) packetplayinsettings.f());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5647eb135..447ecf636 100644
index 5647eb135e..447ecf636d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1768,8 +1768,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -1,4 +1,4 @@
From 4ee6bc1ec61b188bafb6d3ceef0d69b229465218 Mon Sep 17 00:00:00 2001
From cfca191373edfe3183204448a202e179a526e830 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
@ -13,7 +13,7 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 747f5eeb6..2a54723a6 100644
index 26adb55409..b407d80ae6 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -615,6 +615,12 @@ public abstract class EntityHuman extends EntityLiving {
@ -30,7 +30,7 @@ index 747f5eeb6..2a54723a6 100644
return entityitem;
}
diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java
index a56ac3da8..2f1be1995 100644
index a56ac3da80..2f1be1995d 100644
--- a/src/main/java/net/minecraft/server/WorldMap.java
+++ b/src/main/java/net/minecraft/server/WorldMap.java
@@ -31,6 +31,7 @@ public class WorldMap extends PersistentBase {
@ -102,10 +102,10 @@ index a56ac3da8..2f1be1995 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 9121aa2e4..9c20b5f6f 100644
index 7b3e3487fa..23f3d7eb51 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1104,6 +1104,7 @@ public class WorldServer extends World {
@@ -1105,6 +1105,7 @@ public class WorldServer extends World {
{
if ( iter.next().trackee == entity )
{
@ -114,7 +114,7 @@ index 9121aa2e4..9c20b5f6f 100644
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
index 256a13178..5768cd512 100644
index 256a131781..5768cd512e 100644
--- a/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
+++ b/src/main/java/org/bukkit/craftbukkit/map/RenderData.java
@@ -5,7 +5,7 @@ import org.bukkit.map.MapCursor;

View File

@ -1,4 +1,4 @@
From 39993e55a99aafb6e160327db8d81fc95c84bc0c Mon Sep 17 00:00:00 2001
From 188c4e80539d150665d81235bc988b53d4fc932c 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 9c20b5f6f..48737366f 100644
index 23f3d7eb51..e69f82dcd1 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -993,6 +993,7 @@ public class WorldServer extends World {
@@ -994,6 +994,7 @@ public class WorldServer extends World {
// CraftBukkit start
private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot

View File

@ -1,14 +1,14 @@
From 20405ad1a330c2f8ae512f7a5847e77c60507495 Mon Sep 17 00:00:00 2001
From 0c006970ef9bbf08b0d317a44df34104f25612e8 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 31 Jul 2016 16:33:03 -0500
Subject: [PATCH] Re-track players that dismount from other players
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 1f5145d49..b2c070397 100644
index d4bba876d0..ae1f0d5783 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -993,6 +993,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -997,6 +997,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (entity1 != entity && this.playerConnection != null) {
this.playerConnection.a(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
}
@ -23,7 +23,7 @@ index 1f5145d49..b2c070397 100644
}
@@ -1009,7 +1017,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1013,7 +1021,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (!this.isSpectator()) {
super.b(blockposition);
}

View File

@ -1,4 +1,4 @@
From bde47603ed2163a6a9335a3bd9a087972d9aeec7 Mon Sep 17 00:00:00 2001
From 7f770d5475c7bf8ae56d1eb2f24e4cdc88a27a46 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 21 Sep 2016 23:48:39 -0400
Subject: [PATCH] Auto fix bad Y levels on player login
@ -6,10 +6,10 @@ Subject: [PATCH] Auto fix bad Y levels on player login
Bring down to a saner Y level if super high, as this can cause the server to crash
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index b2c070397..cb4d49b1e 100644
index ae1f0d5783..a5701623bf 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -193,6 +193,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -197,6 +197,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@Override
public void a(NBTTagCompound nbttagcompound) {
super.a(nbttagcompound);

View File

@ -1,11 +1,11 @@
From e6ba1a2e2785f34574ea5ee7c0f93dbde806c2aa Mon Sep 17 00:00:00 2001
From 7db41031dd776df0570cfc2c86a08345d3d5bc2f 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
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 8cf3076f4..721eceeff 100644
index 8cf3076f4e..721eceeffc 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -298,4 +298,9 @@ public class PaperWorldConfig {
@ -19,10 +19,10 @@ index 8cf3076f4..721eceeff 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 034e8684d..1efddb533 100644
index c6a79644ef..8fdae388e3 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -526,6 +526,12 @@ public class Chunk implements IChunkAccess {
@@ -532,6 +532,12 @@ public class Chunk implements IChunkAccess {
"Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16));
e.printStackTrace();
ServerInternalException.reportInternalException(e);

View File

@ -1,11 +1,11 @@
From a289a83b759623cd1ca4d8cd8aba88fbbb176047 Mon Sep 17 00:00:00 2001
From b1dc43a6bec6886fc0525ee34cd394fbd1a38d74 Mon Sep 17 00:00:00 2001
From: vemacs <d@nkmem.es>
Date: Wed, 23 Nov 2016 08:31:45 -0500
Subject: [PATCH] Cache user authenticator threads
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index cb4d49b1e..8aef7e480 100644
index a5701623bf..d3bdec7995 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -4,7 +4,9 @@ import com.google.common.collect.Lists;
@ -27,7 +27,7 @@ index cb4d49b1e..8aef7e480 100644
private final AdvancementDataPlayer advancementDataPlayer;
private final ServerStatisticManager serverStatisticManager;
private float lastHealthScored = Float.MIN_VALUE;
@@ -367,13 +369,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -371,13 +373,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
while (!this.removeQueue.isEmpty()) {
int i = Math.min(this.removeQueue.size(), Integer.MAX_VALUE);
int[] aint = new int[i];
@ -50,7 +50,7 @@ index cb4d49b1e..8aef7e480 100644
this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(aint));
}
@@ -1328,7 +1337,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1332,7 +1341,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.lastHealthSent = -1.0F;
this.lastFoodSent = -1;
// this.recipeBook.a((RecipeBook) entityplayer.recipeBook); // CraftBukkit

View File

@ -1,4 +1,4 @@
From 6060dd5bf706c1c2a6bf4672884a80c859ae23bf Mon Sep 17 00:00:00 2001
From e0662983efb699fc39eef3764e2dbb9ba07f1811 Mon Sep 17 00:00:00 2001
From: Alfie Cleveland <alfeh@me.com>
Date: Tue, 27 Dec 2016 01:57:57 +0000
Subject: [PATCH] Properly fix item duplication bug
@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug
Credit to prplz for figuring out the real issue
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 8aef7e480..68b19a3fc 100644
index d3bdec7995..1296eb04f0 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1796,7 +1796,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1800,7 +1800,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@Override
protected boolean isFrozen() {
@ -19,7 +19,7 @@ index 8aef7e480..68b19a3fc 100644
@Override
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 16b70221e..cc6a2aaeb 100644
index 16b70221ea..cc6a2aaeb3 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2525,7 +2525,7 @@ public class PlayerConnection implements PacketListenerPlayIn {

View File

@ -1,11 +1,11 @@
From b25e2d534653a255280c644681141cf999a1dc7b Mon Sep 17 00:00:00 2001
From f0e1f1fa1e613324eec3095d858a8cf79f02b85c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 27 Dec 2016 15:02:42 -0500
Subject: [PATCH] String based Action Bar API
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index 628b73a12..2f10dab36 100644
index 9fa88d79d8..ee2174a9ca 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -2,6 +2,7 @@ package net.minecraft.server;
@ -16,7 +16,7 @@ index 628b73a12..2f10dab36 100644
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.CraftWorld;
@@ -24,6 +25,24 @@ public final class MCUtil {
@@ -94,6 +95,24 @@ public final class MCUtil {
private MCUtil() {}
@ -42,7 +42,7 @@ index 628b73a12..2f10dab36 100644
public static boolean isMainThread() {
return MinecraftServer.getServer().isMainThread();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 447ecf636..3a2a88618 100644
index 447ecf636d..3a2a886180 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -217,6 +217,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -1,14 +1,14 @@
From d29b34d68e68ffcf2b8233a257389f7f3216392c Mon Sep 17 00:00:00 2001
From 306788514e502ec1f8ac21c5f937bbd4b0e1a2cc 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 1627aeeef..4fefdb9ce 100644
index c575ff57dd..86e1b403b2 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -110,7 +110,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -139,7 +139,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 1627aeeef..4fefdb9ce 100644
this.definedStructureManager = definedstructuremanager;
this.w = worldserver.getWorldProvider().getDimensionManager().a(file);
this.world = worldserver;
@@ -360,7 +360,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -389,7 +389,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 1627aeeef..4fefdb9ce 100644
// Spigot end
while (longiterator.hasNext()) { // Spigot
long j = longiterator.nextLong();
@@ -382,7 +382,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -411,7 +411,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
Runnable runnable;

View File

@ -1,4 +1,4 @@
From 7c1bfbef421a19f61008320ef8e3d26ba6ae8098 Mon Sep 17 00:00:00 2001
From 60ac711495320c6a94f4032fb25a0cd98facd648 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 15 Jan 2018 22:11:48 -0500
Subject: [PATCH] Basic PlayerProfile API
@ -7,7 +7,7 @@ Establishes base extension of profile systems for future edits too
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
new file mode 100644
index 000000000..b151a13c1
index 0000000000..b151a13c1b
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
@@ -0,0 +1,280 @@
@ -293,7 +293,7 @@ index 000000000..b151a13c1
+}
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java
new file mode 100644
index 000000000..25836b975
index 0000000000..25836b975b
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java
@@ -0,0 +1,30 @@
@ -329,7 +329,7 @@ index 000000000..25836b975
+}
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java
new file mode 100644
index 000000000..3bcdb8f93
index 0000000000..3bcdb8f93f
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java
@@ -0,0 +1,17 @@
@ -352,7 +352,7 @@ index 000000000..3bcdb8f93
+}
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
new file mode 100644
index 000000000..4b2a67423
index 0000000000..4b2a67423f
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
@@ -0,0 +1,29 @@
@ -387,7 +387,7 @@ index 000000000..4b2a67423
+}
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java
new file mode 100644
index 000000000..3aceb0ea8
index 0000000000..3aceb0ea8a
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java
@@ -0,0 +1,11 @@
@ -403,7 +403,7 @@ index 000000000..3aceb0ea8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index 2f10dab36..670f8313a 100644
index ee2174a9ca..2a22bc6f3e 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -1,7 +1,10 @@
@ -417,7 +417,7 @@ index 2f10dab36..670f8313a 100644
import org.apache.commons.lang.exception.ExceptionUtils;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
@@ -158,6 +161,10 @@ public final class MCUtil {
@@ -228,6 +231,10 @@ public final class MCUtil {
return run.get();
}
@ -429,7 +429,7 @@ index 2f10dab36..670f8313a 100644
* Calculates distance between 2 entities
* @param e1
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7016dac2d..c15ca642d 100644
index 7016dac2d7..c15ca642d0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1296,7 +1296,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@ -450,7 +450,7 @@ index 7016dac2d..c15ca642d 100644
return this.minecraftSessionService;
}
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index 581199e6d..a072222bc 100644
index 581199e6dc..a072222bc5 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -43,7 +43,7 @@ public class UserCache {
@ -486,7 +486,7 @@ index 581199e6d..a072222bc 100644
private UserCacheEntry(GameProfile gameprofile, Date date) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 530156f70..96112243a 100644
index 530156f705..96112243a6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -197,6 +197,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;

View File

@ -1,4 +1,4 @@
From 0fa723c95f0e6c1eabde7c0a72a4ef58d5fb10a0 Mon Sep 17 00:00:00 2001
From 111b99a26dc954eb72b251d2509ac50568afe1b4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 14 Jan 2018 17:36:02 -0500
Subject: [PATCH] PlayerNaturallySpawnCreaturesEvent
@ -9,10 +9,10 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 4fefdb9ce..426beb181 100644
index 86e1b403b2..bf80af2354 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -852,12 +852,24 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -881,12 +881,24 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
chunkRange = (chunkRange > world.spigotConfig.viewDistance) ? (byte) world.spigotConfig.viewDistance : chunkRange;
chunkRange = (chunkRange > 8) ? 8 : chunkRange;

View File

@ -1,4 +1,4 @@
From 50345a69210dc593487981be003c2d2e516aa4bf Mon Sep 17 00:00:00 2001
From 2a1b3e555dfff49e833776ac75b648013a211515 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 fe1a87ba5..9ee58acf7 100644
index 69d2e2c3b5..62a16173b9 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 fe1a87ba5..9ee58acf7 100644
boolean tickingEntities;
private final MinecraftServer server;
private final WorldNBTStorage dataManager;
@@ -1400,12 +1400,17 @@ public class WorldServer extends World {
@@ -1402,12 +1402,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) {
@ -43,7 +43,7 @@ index fe1a87ba5..9ee58acf7 100644
if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 63b1cb2a4..59036635d 100644
index 63b1cb2a4c..59036635d7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2250,11 +2250,17 @@ public class CraftWorld implements World {

View File

@ -1,4 +1,4 @@
From 741de755a8d799b1867c66b78d561cbc3ac661de Mon Sep 17 00:00:00 2001
From 4b7038782910fbfc830ff3d0b058230fb2a3908a 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
@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 4280dacdc..1f3513874 100644
index 4721c288ba..36748ccb73 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -164,7 +164,7 @@ public abstract class EntityHuman extends EntityLiving {
@ -34,10 +34,10 @@ index 4280dacdc..1f3513874 100644
this.activeContainer = this.defaultContainer;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 68b19a3fc..5e2e0674a 100644
index 1296eb04f0..a9a16eace9 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -362,7 +362,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -366,7 +366,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
// Paper end
if (!this.world.isClientSide && !this.activeContainer.canUse(this)) {
@ -46,7 +46,7 @@ index 68b19a3fc..5e2e0674a 100644
this.activeContainer = this.defaultContainer;
}
@@ -536,7 +536,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -540,7 +540,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
// SPIGOT-943 - only call if they have an inventory open
if (this.activeContainer != this.defaultContainer) {
@ -55,7 +55,7 @@ index 68b19a3fc..5e2e0674a 100644
}
String deathMessage = event.getDeathMessage();
@@ -1056,7 +1056,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1060,7 +1060,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
return OptionalInt.empty();
} else {
if (this.activeContainer != this.defaultContainer) {
@ -64,7 +64,7 @@ index 68b19a3fc..5e2e0674a 100644
}
this.nextContainerCounter();
@@ -1116,7 +1116,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1120,7 +1120,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
// CraftBukkit end
if (this.activeContainer != this.defaultContainer) {
@ -73,7 +73,7 @@ index 68b19a3fc..5e2e0674a 100644
}
// this.nextContainerCounter(); // CraftBukkit - moved up
@@ -1180,7 +1180,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1184,7 +1184,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@Override
public void closeInventory() {
@ -88,7 +88,7 @@ index 68b19a3fc..5e2e0674a 100644
this.m();
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 8757b6751..4f04410f9 100644
index 8757b6751e..4f04410f9b 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2039,7 +2039,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
@ -101,7 +101,7 @@ index 8757b6751..4f04410f9 100644
this.player.m();
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 002f7e844..fd0f5c6f2 100644
index 002f7e844a..fd0f5c6f29 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -403,7 +403,7 @@ public abstract class PlayerList {
@ -114,10 +114,10 @@ index 002f7e844..fd0f5c6f2 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 9ee58acf7..ae7df6141 100644
index 62a16173b9..f0c912be43 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1046,7 +1046,7 @@ public class WorldServer extends World {
@@ -1047,7 +1047,7 @@ public class WorldServer extends World {
{
if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity )
{
@ -126,7 +126,7 @@ index 9ee58acf7..ae7df6141 100644
}
}
}
@@ -1069,7 +1069,7 @@ public class WorldServer extends World {
@@ -1070,7 +1070,7 @@ public class WorldServer extends World {
{
if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity )
{
@ -136,7 +136,7 @@ index 9ee58acf7..ae7df6141 100644
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index cd8ad2704..e169679c8 100644
index cd8ad27047..e169679c88 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -619,8 +619,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@ -155,7 +155,7 @@ index cd8ad2704..e169679c8 100644
@Override
public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f4affa693..c1f392716 100644
index f4affa693a..c1f3927164 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -786,7 +786,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -168,7 +168,7 @@ index f4affa693..c1f392716 100644
// Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index caf277439..f931fa48b 100644
index caf277439a..f931fa48b4 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1293,8 +1293,19 @@ public class CraftEventFactory {

View File

@ -1,4 +1,4 @@
From d2d62998ed68f66af8cfa85e33aea7a3d94c1bee Mon Sep 17 00:00:00 2001
From c028e6bde7f7c652ca0827017bfdea624603fbe5 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 ae7df6141..389036405 100644
index f0c912be43..d46a664bdb 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1031,7 +1031,8 @@ public class WorldServer extends World {
@@ -1032,7 +1032,8 @@ public class WorldServer extends World {
if (entity1 == null) {
return false;
} else {

View File

@ -1,4 +1,4 @@
From 5dd454f6d8e206f785b33b548a9571230b95b1e0 Mon Sep 17 00:00:00 2001
From 2178fef21e20a74545ee6cb6ab61548a87cd76f3 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
@ -6,7 +6,7 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
Add -Ddebug.entities=true to your JVM flags to gain more information
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 591e2ad56..e5987be45 100644
index 591e2ad56c..e5987be450 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -76,6 +76,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -19,10 +19,10 @@ index 591e2ad56..e5987be45 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 426beb181..7edca1744 100644
index bf80af2354..e93741a8e8 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -1031,6 +1031,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1062,6 +1062,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 426beb181..7edca1744 100644
this.trackedEntities.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.track(this.world.getPlayers());
if (entity instanceof EntityPlayer) {
@@ -1073,7 +1074,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1104,7 +1105,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.a();
}
@ -40,7 +40,7 @@ index 426beb181..7edca1744 100644
protected void g() {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9987adb6f..9d9e8fed2 100644
index 9987adb6f4..9d9e8fed27 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -67,6 +67,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@ -52,7 +52,7 @@ index 9987adb6f..9d9e8fed2 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 389036405..224f6d151 100644
index d46a664bdb..3d5a50ddcc 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 389036405..224f6d151 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) {
@@ -993,8 +996,28 @@ public class WorldServer extends World {
@@ -994,8 +997,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 389036405..224f6d151 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)) {
@@ -1166,7 +1189,24 @@ public class WorldServer extends World {
@@ -1168,7 +1191,24 @@ public class WorldServer extends World {
}
}

View File

@ -1,4 +1,4 @@
From 94b5f2ac086c6844aeea8e603c73ad062e6ba24e Mon Sep 17 00:00:00 2001
From 2f7135a6499499a1f67c56a25881f026a74ee1b2 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
@ -21,7 +21,7 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt
They had 'callq' (invoke) instead of 'mov' (get from memory) instructions.
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
index 71089442c..c439a8d01 100644
index 71089442c1..c439a8d019 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
@@ -7,25 +7,22 @@ import javax.annotation.concurrent.Immutable;
@ -110,7 +110,7 @@ index 71089442c..c439a8d01 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 1cdf0346f..5a505b753 100644
index 5dbd3e60fe..e9ea232a78 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
@ -176,7 +176,7 @@ index 1cdf0346f..5a505b753 100644
return this;
}
@@ -439,23 +450,23 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@@ -439,26 +450,26 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
}
public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) {
@ -189,16 +189,19 @@ index 1cdf0346f..5a505b753 100644
+ return this.d(this.x + i, this.y + j, this.z + k);
}
public final void setX(final int x) { this.o(x); } // Paper - OBFHELPER
public void o(int i) {
- this.b = i;
+ this.x = i; // Paper change to x
}
public final void setY(final int y) { this.p(y); } // Paper - OBFHELPER
public void p(int i) {
- this.c = i;
+ this.y = i; // Paper change to y
}
public final void setZ(final int z) { this.q(z); } // Paper - OBFHELPER
public void q(int i) {
- this.d = i;
+ this.z = i; // Paper change to z

View File

@ -1,4 +1,4 @@
From f50d2da0dac7ab2bfb2cb1d67f325a6f03b4aead Mon Sep 17 00:00:00 2001
From f2538725efa773c32f5c14be02a9c19ef3f931f3 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,18 +6,18 @@ 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 1efddb533..6774c6480 100644
index 8fdae388e3..28e5105ffe 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -410,6 +410,7 @@ public class Chunk implements IChunkAccess {
entity.chunkY = k;
@@ -416,6 +416,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);
+ this.markDirty(); // Paper
}
@Override
@@ -436,6 +437,7 @@ public class Chunk implements IChunkAccess {
@@ -442,6 +443,7 @@ public class Chunk implements IChunkAccess {
return;
}
entityCounts.decrement(entity.getMinecraftKeyString());

View File

@ -1,4 +1,4 @@
From fc2b2e371a21fe3a22451d658507557f4d2a5885 Mon Sep 17 00:00:00 2001
From 0acebe52e93af5833c06aa7223868da0e572226e 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 6774c6480..b156f5428 100644
index 28e5105ffe..2004f7fbe1 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -402,6 +402,25 @@ public class Chunk implements IChunkAccess {
@@ -407,6 +407,25 @@ public class Chunk implements IChunkAccess {
if (k >= this.entitySlices.length) {
k = this.entitySlices.length - 1;
}
@ -38,15 +38,15 @@ index 6774c6480..b156f5428 100644
if (!entity.inChunk || entity.getCurrentChunk() != this) entityCounts.increment(entity.getMinecraftKeyString()); // Paper
entity.inChunk = true;
@@ -410,6 +429,7 @@ public class Chunk implements IChunkAccess {
entity.chunkY = k;
@@ -416,6 +435,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);
+ entity.entitySlice = this.entitySlices[k]; // Paper
this.markDirty(); // Paper
}
@@ -433,6 +453,9 @@ public class Chunk implements IChunkAccess {
@@ -439,6 +459,9 @@ public class Chunk implements IChunkAccess {
}
// Paper start
if (entity.currentChunk != null && entity.currentChunk.get() == this) entity.setCurrentChunk(null);
@ -57,7 +57,7 @@ index 6774c6480..b156f5428 100644
return;
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 8e23f336a..e761f7148 100644
index 8e23f336a8..e761f71487 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -71,6 +71,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke

View File

@ -1,4 +1,4 @@
From 9dbb6eb1aa5d92972f3e2c0c0513c6d0e004c4db Mon Sep 17 00:00:00 2001
From b6ec7c795015192dd516d7c7cd8a741fbd66b9d7 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
@ -11,7 +11,7 @@ This will ensure that dead entities are skipped from iteration since
they shouldn't of been in the list in the first place.
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index eecf27370..d704fc79c 100644
index eecf27370b..d704fc79c0 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -179,6 +179,7 @@ public class PaperCommand extends Command {
@ -23,10 +23,10 @@ index eecf27370..d704fc79c 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 b156f5428..c7c600b80 100644
index 2004f7fbe1..7ecff4443a 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -671,6 +671,7 @@ public class Chunk implements IChunkAccess {
@@ -679,6 +679,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
Entity entity1 = (Entity) iterator.next();
@ -34,7 +34,7 @@ index b156f5428..c7c600b80 100644
if (entity1.getBoundingBox().c(axisalignedbb) && entity1 != entity) {
if (predicate == null || predicate.test(entity1)) {
@@ -708,6 +709,7 @@ public class Chunk implements IChunkAccess {
@@ -716,6 +717,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
T entity = (T) iterator.next(); // CraftBukkit - decompile error
@ -42,7 +42,7 @@ index b156f5428..c7c600b80 100644
if ((entitytypes == null || entity.getEntityType() == entitytypes) && entity.getBoundingBox().c(axisalignedbb) && predicate.test(entity)) {
list.add(entity);
@@ -729,6 +731,7 @@ public class Chunk implements IChunkAccess {
@@ -737,6 +739,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
T t0 = (T) iterator.next(); // CraftBukkit - decompile error
@ -51,7 +51,7 @@ index b156f5428..c7c600b80 100644
if (oclass.isInstance(t0) && t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { // Spigot - instance check
list.add(t0);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index e761f7148..ca794328a 100644
index e761f71487..ca794328a7 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -196,6 +196,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -63,7 +63,7 @@ index e761f7148..ca794328a 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 224f6d151..ba0389f2f 100644
index 3d5a50ddcc..12cdb0cc9a 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -904,7 +904,7 @@ public class WorldServer extends World {
@ -75,7 +75,7 @@ index 224f6d151..ba0389f2f 100644
if (entity instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
@@ -1223,6 +1223,7 @@ public class WorldServer extends World {
@@ -1225,6 +1225,7 @@ public class WorldServer extends World {
entity.origin = entity.getBukkitEntity().getLocation();
}
// Paper end
@ -83,7 +83,7 @@ index 224f6d151..ba0389f2f 100644
new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
}
@@ -1235,6 +1236,7 @@ public class WorldServer extends World {
@@ -1237,6 +1238,7 @@ public class WorldServer extends World {
this.removeEntityFromChunk(entity);
this.entitiesById.remove(entity.getId());
this.unregisterEntity(entity);
@ -92,7 +92,7 @@ index 224f6d151..ba0389f2f 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index a257dce8f..0fb47579f 100644
index a257dce8f0..0fb47579f6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1010,6 +1010,7 @@ public class CraftWorld implements World {

View File

@ -1,11 +1,11 @@
From cdec3794b84a3c3c819fecd813fc2dbabc1bd4c9 Mon Sep 17 00:00:00 2001
From 5b1eeb8047141b4b62bdac06095b41e77a9a0f36 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
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index fd0f5c6f2..e46436623 100644
index fd0f5c6f29..e46436623c 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -923,8 +923,25 @@ public abstract class PlayerList {
@ -46,10 +46,10 @@ index fd0f5c6f2..e46436623 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 ba0389f2f..1e8079f91 100644
index 12cdb0cc9a..f12cadc735 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1269,7 +1269,7 @@ public class WorldServer extends World {
@@ -1271,7 +1271,7 @@ public class WorldServer extends World {
}
// CraftBukkit end
this.globalEntityList.add(entitylightning);
@ -58,7 +58,7 @@ index ba0389f2f..1e8079f91 100644
}
@Override
@@ -1401,7 +1401,7 @@ public class WorldServer extends World {
@@ -1403,7 +1403,7 @@ public class WorldServer extends World {
BlockActionData blockactiondata = (BlockActionData) this.I.removeFirst();
if (this.a(blockactiondata)) {
@ -68,7 +68,7 @@ index ba0389f2f..1e8079f91 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0fb47579f..bc151d8d2 100644
index 0fb47579f6..bc151d8d25 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2085,7 +2085,7 @@ public class CraftWorld implements World {

View File

@ -1,4 +1,4 @@
From a37fd61973e5e77832a167141998b6d5e9ae5f72 Mon Sep 17 00:00:00 2001
From 001436f06bc138cabc999f2070aaf5be26f0074b Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Tue, 21 Aug 2018 01:39:35 +0100
Subject: [PATCH] Improve death events
@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using
internal code.
diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java
index 6daa400d2..38fe29f8a 100644
index 6daa400d27..38fe29f8a2 100644
--- a/src/main/java/net/minecraft/server/CombatTracker.java
+++ b/src/main/java/net/minecraft/server/CombatTracker.java
@@ -175,6 +175,7 @@ public class CombatTracker {
@ -27,7 +27,7 @@ index 6daa400d2..38fe29f8a 100644
int i = this.f ? 300 : 100;
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 845993bb4..16c55a9fa 100644
index 845993bb4e..16c55a9fa0 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1503,6 +1503,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -47,7 +47,7 @@ index 845993bb4..16c55a9fa 100644
protected void k(double d0, double d1, double d2) {
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
index 42b9a339e..8ad131e4f 100644
index 42b9a339e9..8ad131e4fc 100644
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
@@ -701,7 +701,8 @@ public class EntityArmorStand extends EntityLiving {
@ -61,7 +61,7 @@ index 42b9a339e..8ad131e4f 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
index 2be6c7bde..82a32d5db 100644
index 2be6c7bde9..82a32d5dbf 100644
--- a/src/main/java/net/minecraft/server/EntityFox.java
+++ b/src/main/java/net/minecraft/server/EntityFox.java
@@ -571,15 +571,25 @@ public class EntityFox extends EntityAnimal {
@ -94,7 +94,7 @@ index 2be6c7bde..82a32d5db 100644
public static boolean a(EntityFox entityfox, EntityLiving entityliving) {
diff --git a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java
index 80717ad9a..53aac5bcc 100644
index 80717ad9ac..53aac5bccd 100644
--- a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java
@@ -55,11 +55,19 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract {
@ -119,7 +119,7 @@ index 80717ad9a..53aac5bcc 100644
public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index fa097e055..eed3e7c58 100644
index fa097e0551..eed3e7c58e 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -89,7 +89,7 @@ public abstract class EntityLiving extends Entity {
@ -279,7 +279,7 @@ index fa097e055..eed3e7c58 100644
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 5e2e0674a..e6252e5f1 100644
index a9a16eace9..52bbe4fc02 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -75,6 +75,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -293,7 +293,7 @@ index 5e2e0674a..e6252e5f1 100644
// CraftBukkit start
public String displayName;
@@ -533,6 +537,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -537,6 +541,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
String deathmessage = defaultMessage.getString();
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage, keepInventory);
@ -309,7 +309,7 @@ index 5e2e0674a..e6252e5f1 100644
// SPIGOT-943 - only call if they have an inventory open
if (this.activeContainer != this.defaultContainer) {
@@ -671,8 +684,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -675,8 +688,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
}
}
@ -330,7 +330,7 @@ index 5e2e0674a..e6252e5f1 100644
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
index 90fdf89c8..b761a41dc 100644
index 90fdf89c81..b761a41dcd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
@@ -821,6 +821,22 @@ public enum CraftSound {
@ -357,7 +357,7 @@ index 90fdf89c8..b761a41dc 100644
this.minecraftKey = minecraftKey;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 352ef3669..a2bda708c 100644
index 352ef3669d..a2bda708cd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1730,7 +1730,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -378,7 +378,7 @@ index 352ef3669..a2bda708c 100644
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index f006b441a..39ce40bd5 100644
index f006b441ad..39ce40bd58 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -749,9 +749,16 @@ public class CraftEventFactory {

View File

@ -1,4 +1,4 @@
From a802670c7c392d9a70dc8ac6b4d8523f0b02142d Mon Sep 17 00:00:00 2001
From 53100d2c99d2a53b62adb36f41a95f7ff63cbb42 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 22 Sep 2018 15:56:59 -0400
Subject: [PATCH] Catch JsonParseException in Entity and TE names
@ -13,7 +13,7 @@ Shulkers) may need to be changed in order for it to re-save properly
No more crashing though.
diff --git a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java
index 786712297..ef2a496ed 100644
index 7867122974..ef2a496eda 100644
--- a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java
+++ b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java
@@ -59,7 +59,7 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener {
@ -26,7 +26,7 @@ index 786712297..ef2a496ed 100644
if (nbttagcompound.hasKeyOfType("TrackOutput", 1)) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 16c55a9fa..4619f2c92 100644
index 16c55a9fa0..4619f2c928 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1679,7 +1679,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -39,10 +39,10 @@ index 16c55a9fa..4619f2c92 100644
this.setCustomNameVisible(nbttagcompound.getBoolean("CustomNameVisible"));
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index 670f8313a..d49e210a3 100644
index 2a22bc6f3e..3a482466ec 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -339,4 +339,19 @@ public final class MCUtil {
@@ -409,4 +409,19 @@ public final class MCUtil {
return null;
}
}
@ -63,7 +63,7 @@ index 670f8313a..d49e210a3 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/TileEntityBanner.java b/src/main/java/net/minecraft/server/TileEntityBanner.java
index 93911a825..d35604edb 100644
index 93911a8251..d35604edb2 100644
--- a/src/main/java/net/minecraft/server/TileEntityBanner.java
+++ b/src/main/java/net/minecraft/server/TileEntityBanner.java
@@ -60,7 +60,7 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity {
@ -76,7 +76,7 @@ index 93911a825..d35604edb 100644
if (this.hasWorld()) {
diff --git a/src/main/java/net/minecraft/server/TileEntityContainer.java b/src/main/java/net/minecraft/server/TileEntityContainer.java
index 473ec2cbd..ab6b86e4e 100644
index 473ec2cbde..ab6b86e4e9 100644
--- a/src/main/java/net/minecraft/server/TileEntityContainer.java
+++ b/src/main/java/net/minecraft/server/TileEntityContainer.java
@@ -17,7 +17,7 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento

View File

@ -1,11 +1,11 @@
From 0b660f804b58ed6c574577d1fee517a40024cd4d Mon Sep 17 00:00:00 2001
From f4e1ede0e866a8f95fcf9a7adf08311a6509edb2 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
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 487b0d5cd..b8789c8ec 100644
index 487b0d5cd6..b8789c8ecc 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -242,6 +242,28 @@ public class PaperWorldConfig {
@ -38,7 +38,7 @@ index 487b0d5cd..b8789c8ec 100644
private void fixedInhabitedTime() {
if (PaperConfig.version < 16) {
diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java
index 7c518983a..bdb534deb 100644
index 7c518983a9..bdb534deb4 100644
--- a/src/main/java/net/minecraft/server/EntityLightning.java
+++ b/src/main/java/net/minecraft/server/EntityLightning.java
@@ -64,6 +64,17 @@ public class EntityLightning extends Entity {
@ -69,10 +69,10 @@ index 7c518983a..bdb534deb 100644
--this.lifeTicks;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 1e8079f91..b4443f3a6 100644
index f12cadc735..78a9b31891 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1269,7 +1269,7 @@ public class WorldServer extends World {
@@ -1271,7 +1271,7 @@ public class WorldServer extends World {
}
// CraftBukkit end
this.globalEntityList.add(entitylightning);

View File

@ -1,11 +1,11 @@
From baccdcbf7b3f1fc9ce3500295d5d40e6b85cc651 Mon Sep 17 00:00:00 2001
From 6372e87abbe429925f311fbb2ce2d9acdf5a5eae Mon Sep 17 00:00:00 2001
From: Caleb Bassham <caleb.bassham@gmail.com>
Date: Fri, 28 Sep 2018 02:32:19 -0500
Subject: [PATCH] Call player spectator target events
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index e6252e5f1..8858bea04 100644
index 52bbe4fc02..10ca229cb4 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -60,7 +60,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -17,7 +17,7 @@ index e6252e5f1..8858bea04 100644
public boolean worldChangeInvuln;
private boolean cm; private void setHasSeenCredits(boolean has) { this.cm = has; } // Paper - OBFHELPER
private final RecipeBookServer recipeBook;
@@ -1585,15 +1585,35 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1589,15 +1589,35 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity);
}
@ -58,7 +58,7 @@ index e6252e5f1..8858bea04 100644
}
@Override
@@ -1601,7 +1621,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1605,7 +1625,6 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
if (this.portalCooldown > 0 && !this.worldChangeInvuln) {
--this.portalCooldown;
}

View File

@ -1,11 +1,11 @@
From a1271937315bc0dc157ead606a5fd85836ba797f Mon Sep 17 00:00:00 2001
From 655b742944b6011c3aa6bb1f915c073d75d46e8b Mon Sep 17 00:00:00 2001
From: GreenMeanie <GreenMeanieMC@gmail.com>
Date: Sat, 20 Oct 2018 22:34:02 -0400
Subject: [PATCH] Reset players airTicks on respawn
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 4619f2c92..03469c965 100644
index 4619f2c928..03469c9657 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2326,6 +2326,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -17,10 +17,10 @@ index 4619f2c92..03469c965 100644
return 300;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 8858bea04..f2f34593b 100644
index 10ca229cb4..f33580f8c5 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1861,6 +1861,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1865,6 +1865,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
this.setHealth(this.getMaxHealth());

View File

@ -1,4 +1,4 @@
From 9a59cfe70b2c3dceb979d50b8f89a269da141629 Mon Sep 17 00:00:00 2001
From 21cc9d9b68ee8a9fda20da52a53f25e8108a4a40 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 15 Nov 2018 13:38:37 +0000
Subject: [PATCH] force entity dismount during teleportation
@ -20,7 +20,7 @@ this is going to be the best soultion all around.
Improvements/suggestions welcome!
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 03469c965..db404e4cd 100644
index 03469c9657..db404e4cd5 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2027,12 +2027,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -72,7 +72,7 @@ index 03469c965..db404e4cd 100644
if (event.isCancelled()) {
return false;
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index d6df01868..2edb99b63 100644
index 308ac18f7e..584166f225 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -968,9 +968,11 @@ public abstract class EntityHuman extends EntityLiving {
@ -91,7 +91,7 @@ index d6df01868..2edb99b63 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index eed3e7c58..4e64a80a8 100644
index eed3e7c58e..4e64a80a8a 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2735,11 +2735,13 @@ public abstract class EntityLiving extends Entity {
@ -112,10 +112,10 @@ index eed3e7c58..4e64a80a8 100644
this.a(entity);
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index f2f34593b..83b7ac459 100644
index f33580f8c5..68e12cf987 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1015,11 +1015,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1019,11 +1019,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
}

View File

@ -1,14 +1,14 @@
From ddc742b1592154f7339cf8c9c2370b0bb66c8d93 Mon Sep 17 00:00:00 2001
From 2e30cfa761e3ef1b77286c72cdfc389d699dd8df Mon Sep 17 00:00:00 2001
From: connorhartley <vectrixu+gh@gmail.com>
Date: Mon, 7 Jan 2019 14:43:48 -0600
Subject: [PATCH] Workaround for vehicle tracking issue on disconnect
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index f51893892..959e2c1c1 100644
index d3bfb72e39..4d614b9ef1 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -1290,6 +1290,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1294,6 +1294,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void n() {
this.cq = true;
this.ejectPassengers();

View File

@ -1,4 +1,4 @@
From 0d84c8471a87f0c6581a3d2adcec70194f4bdef2 Mon Sep 17 00:00:00 2001
From a96ad5506ec97cf42f230431261432fb88cdf57e 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
@ -10,7 +10,7 @@ persistenting Living Entity, SPAWNER for spawners,
or DEFAULT since data was not stored.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index f8132a1fa..716d30b8d 100644
index f8132a1fa4..716d30b8de 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -72,6 +72,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -59,7 +59,7 @@ index f8132a1fa..716d30b8d 100644
} catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 9d715d891..49437f212 100644
index 9d715d891d..49437f2124 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -251,7 +251,7 @@ public abstract class PlayerList {
@ -72,10 +72,10 @@ index 9d715d891..49437f212 100644
});
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b4443f3a6..f8d7bba34 100644
index 78a9b31891..7492284703 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -996,6 +996,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
@ -84,7 +84,7 @@ index b4443f3a6..f8d7bba34 100644
if (entity.valid) {
MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 915ccb180..dfa15372b 100644
index 915ccb1807..dfa15372b8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1051,5 +1051,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View File

@ -1,4 +1,4 @@
From c0b7aacc207555016590a0786d1f4449b78f77b2 Mon Sep 17 00:00:00 2001
From 4539d1b910705487353d67cd2d680ee5657f706d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 27 Mar 2019 23:01:33 -0400
Subject: [PATCH] PlayerDeathEvent#getItemsToKeep
@ -8,10 +8,10 @@ Exposes a mutable array on items a player should keep on death
Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 959e2c1c1..6483c4a0b 100644
index 4d614b9ef1..77ad4774ec 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -510,6 +510,46 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -514,6 +514,46 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
});
}
@ -58,7 +58,7 @@ index 959e2c1c1..6483c4a0b 100644
@Override
public void die(DamageSource damagesource) {
boolean flag = this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES);
@@ -596,7 +636,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -600,7 +640,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.dropExperience();
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
if (!event.getKeepInventory()) {

View File

@ -1,4 +1,4 @@
From 922ad8a3b70e9fc1a8d8c58d6081a050eef9e1d1 Mon Sep 17 00:00:00 2001
From dedc72add5794be5eb8848f7fe4c6c525c55f6e6 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 f8d7bba34..3c94aa48c 100644
index 7492284703..4a648f88ba 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -703,7 +703,7 @@ public class WorldServer extends World {
@ -31,7 +31,7 @@ index f8d7bba34..3c94aa48c 100644
entity.inChunk = false;
} else {
this.getChunkAt(i, k).a(entity);
@@ -1028,7 +1028,7 @@ public class WorldServer extends World {
@@ -1029,7 +1029,7 @@ public class WorldServer extends World {
return false;
}
// CraftBukkit end

View File

@ -1,4 +1,4 @@
From 0080550b42ff659ffcbaea501571e8c4208e4549 Mon Sep 17 00:00:00 2001
From a83fe1ede08bcf43c4155c8469f7b8e2b2b59245 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
@ -33,7 +33,7 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 4ba72275b..572679e4d 100644
index 4ba72275b9..572679e4d1 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -442,4 +442,43 @@ public class PaperWorldConfig {
@ -81,10 +81,10 @@ index 4ba72275b..572679e4d 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index c7c600b80..64c327669 100644
index 7ecff4443a..d9c53cdc4b 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -391,6 +391,7 @@ public class Chunk implements IChunkAccess {
@@ -396,6 +396,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;
@ -93,7 +93,7 @@ index c7c600b80..64c327669 100644
int k = MathHelper.floor(entity.locY() / 16.0D);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 716d30b8d..7c7cd851c 100644
index 716d30b8de..7c7cd851c0 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2743,6 +2743,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -105,7 +105,7 @@ index 716d30b8d..7c7cd851c 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 7edca1744..314c77767 100644
index e93741a8e8..b3fa3bd874 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 7edca1744..314c77767 100644
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.Executor;
@@ -602,19 +606,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -631,19 +635,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
for (int j = 0; j < i; ++j) {
List<Entity> entityslice = aentityslice[j]; // Spigot
@ -201,7 +201,7 @@ index 7edca1744..314c77767 100644
if (list == null) {
list = Lists.newArrayList(new Entity[]{entity});
} else {
@@ -622,6 +662,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -651,6 +691,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
}
@ -210,7 +210,7 @@ index 7edca1744..314c77767 100644
if (list != null) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 3c94aa48c..f973b0799 100644
index 4a648f88ba..36d5466138 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;
@ -222,7 +222,7 @@ index 3c94aa48c..f973b0799 100644
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Queues;
@@ -1055,8 +1057,23 @@ public class WorldServer extends World {
@@ -1056,8 +1058,23 @@ public class WorldServer extends World {
if (entity1 == null) {
return false;
} else {
@ -248,7 +248,7 @@ index 3c94aa48c..f973b0799 100644
return true;
}
}
@@ -1195,7 +1212,7 @@ public class WorldServer extends World {
@@ -1197,7 +1214,7 @@ public class WorldServer extends World {
}
Entity old = this.entitiesByUUID.put(entity.getUniqueID(), entity);

View File

@ -1,4 +1,4 @@
From 3254c8c658ade5ab399d1d63b6d3402a48e8cc6e Mon Sep 17 00:00:00 2001
From c5d691e244cfd8140cea50a7c15406bceceb97c7 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
@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world
This lets you disable it for some worlds and lower it for others.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 572679e4d..071e5e7f7 100644
index 572679e4d1..071e5e7f72 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -481,4 +481,10 @@ public class PaperWorldConfig {
@ -21,7 +21,7 @@ index 572679e4d..071e5e7f7 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3ede5ce2a..eaa26e1a5 100644
index 3ede5ce2a6..eaa26e1a50 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -586,6 +586,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@ -72,7 +72,7 @@ index 3ede5ce2a..eaa26e1a5 100644
// CraftBukkit start
// this.nextTick = SystemUtils.getMonotonicMillis() + 10L;
diff --git a/src/main/java/net/minecraft/server/WorldLoadListener.java b/src/main/java/net/minecraft/server/WorldLoadListener.java
index d6762d385..7b6f5b2da 100644
index d6762d3853..7b6f5b2da0 100644
--- a/src/main/java/net/minecraft/server/WorldLoadListener.java
+++ b/src/main/java/net/minecraft/server/WorldLoadListener.java
@@ -9,4 +9,6 @@ public interface WorldLoadListener {
@ -83,7 +83,7 @@ index d6762d385..7b6f5b2da 100644
+ void setChunkRadius(int radius); // Paper - allow changing chunk radius
}
diff --git a/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java b/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java
index 3868572ae..ae77805f7 100644
index 3868572aed..ae77805f71 100644
--- a/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java
+++ b/src/main/java/net/minecraft/server/WorldLoadListenerLogger.java
@@ -7,16 +7,24 @@ import org.apache.logging.log4j.Logger;
@ -114,10 +114,10 @@ index 3868572ae..ae77805f7 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 f973b0799..9be58e785 100644
index 36d5466138..32da4eb4e0 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1576,13 +1576,85 @@ public class WorldServer extends World {
@@ -1578,13 +1578,85 @@ public class WorldServer extends World {
return ((PersistentIdCounts) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().a(PersistentIdCounts::new, "idcounts")).a();
}
@ -207,7 +207,7 @@ index f973b0799..9be58e785 100644
public LongSet getForceLoadedChunks() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 428749238..9787d5332 100644
index 4287492381..9787d53326 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1913,15 +1913,21 @@ public class CraftWorld implements World {

View File

@ -1,4 +1,4 @@
From 32c84bc51770d5feb0a8e83cfa6649ca9c164aa7 Mon Sep 17 00:00:00 2001
From b9b9ced96a391744942042339a109ed7e6e9dde4 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 1 Jun 2019 13:00:55 -0700
Subject: [PATCH] Chunk debug command
@ -32,7 +32,7 @@ https://bugs.mojang.com/browse/MC-141484?focusedCommentId=528273&page=com.atlass
https://bugs.mojang.com/browse/MC-141484?focusedCommentId=528577&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-528577
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index d704fc79c..09efbf725 100644
index d704fc79c0..09efbf7250 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -28,14 +28,14 @@ public class PaperCommand extends Command {
@ -185,7 +185,7 @@ index d704fc79c..09efbf725 100644
* Ported from MinecraftForge - author: LexManos <LexManos@gmail.com> - License: LGPLv2.1
*/
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index a3ef6dba7..0b43e4eb4 100644
index 3ef7e4561f..35153af515 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -22,7 +22,7 @@ import org.apache.logging.log4j.Logger;
@ -198,7 +198,7 @@ index a3ef6dba7..0b43e4eb4 100644
public final ChunkGenerator<?> chunkGenerator;
private final WorldServer world;
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index d49e210a3..25a87c2d3 100644
index 3a482466ec..b6aeca05f7 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -4,7 +4,13 @@ import com.destroystokyo.paper.block.TargetBlockInfo;
@ -227,7 +227,7 @@ index d49e210a3..25a87c2d3 100644
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
@@ -354,4 +364,170 @@ public final class MCUtil {
@@ -424,4 +434,170 @@ public final class MCUtil {
return null;
}
@ -399,7 +399,7 @@ index d49e210a3..25a87c2d3 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 3c6fe0596..43d9a5634 100644
index 3093154bb7..3a0f0314b2 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -26,7 +26,7 @@ public class PlayerChunk {
@ -412,7 +412,7 @@ index 3c6fe0596..43d9a5634 100644
private int dirtyCount;
private int r;
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 314c77767..c17a53915 100644
index b3fa3bd874..803fda511f 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -58,7 +58,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@ -434,7 +434,7 @@ index 314c77767..c17a53915 100644
private final DefinedStructureManager definedStructureManager;
private final File w;
diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java
index 77bb6b092..7a8397815 100644
index 77bb6b092a..7a8397815a 100644
--- a/src/main/java/net/minecraft/server/Ticket.java
+++ b/src/main/java/net/minecraft/server/Ticket.java
@@ -6,8 +6,8 @@ public final class Ticket<T> implements Comparable<Ticket<?>> {

View File

@ -1,11 +1,11 @@
From 522dba5da6503c5a65909606ade341f964ba4fdc Mon Sep 17 00:00:00 2001
From 42b7bda5cbafcb1c1ac04c305d09a038e5b9f435 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
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 071e5e7f7..486761521 100644
index 071e5e7f72..4867615215 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -487,4 +487,19 @@ public class PaperWorldConfig {
@ -29,7 +29,7 @@ index 071e5e7f7..486761521 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 64c327669..14ec31f0a 100644
index d9c53cdc4b..76e87c211b 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 {
@ -42,10 +42,10 @@ index 64c327669..14ec31f0a 100644
private long inhabitedTime;
@Nullable
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 0b43e4eb4..99ce73c45 100644
index 35153af515..191b2759a0 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -340,6 +340,15 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -436,6 +436,15 @@ public class ChunkProviderServer extends IChunkProvider {
} // Paper - Timings
}
@ -62,7 +62,7 @@ index 0b43e4eb4..99ce73c45 100644
public void close() throws IOException {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index eaa26e1a5..6fa08c60b 100644
index eaa26e1a50..6fa08c60bd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -168,6 +168,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@ -107,49 +107,161 @@ index eaa26e1a5..6fa08c60b 100644
this.methodProfiler.enter("snooper");
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && !this.snooper.d() && this.ticks > 100) { // Spigot
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 3a0f0314b2..c91312facf 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -40,6 +40,9 @@ public class PlayerChunk {
private final PlayerChunkMap chunkMap; // Paper
+ long lastAutoSaveTime; // Paper - incremental autosave
+ long inactiveTimeStart; // Paper - incremental autosave
+
public PlayerChunk(ChunkCoordIntPair chunkcoordintpair, int i, LightEngine lightengine, PlayerChunk.c playerchunk_c, PlayerChunk.d playerchunk_d) {
this.statusFutures = new AtomicReferenceArray(PlayerChunk.CHUNK_STATUSES.size());
this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
@@ -376,7 +379,19 @@ public class PlayerChunk {
boolean flag2 = playerchunk_state.isAtLeast(PlayerChunk.State.BORDER);
boolean flag3 = playerchunk_state1.isAtLeast(PlayerChunk.State.BORDER);
+ boolean prevHasBeenLoaded = this.hasBeenLoaded; // Paper
this.hasBeenLoaded |= flag3;
+ // Paper start - incremental autosave
+ if (this.hasBeenLoaded & !prevHasBeenLoaded) {
+ long timeSinceAutoSave = this.inactiveTimeStart - this.lastAutoSaveTime;
+ if (timeSinceAutoSave < 0) {
+ // safest bet is to assume autosave is needed here
+ timeSinceAutoSave = this.chunkMap.world.paperConfig.autoSavePeriod;
+ }
+ this.lastAutoSaveTime = this.chunkMap.world.getTime() - timeSinceAutoSave;
+ this.chunkMap.autoSaveQueue.add(this);
+ }
+ // Paper end
if (!flag2 && flag3) {
// Paper start - cache ticking ready status
int expectCreateCount = ++this.fullChunkCreateCount;
@@ -490,8 +505,32 @@ public class PlayerChunk {
}
public void m() {
+ boolean prev = this.hasBeenLoaded; // Paper
+ this.hasBeenLoaded = getChunkState(this.ticketLevel).isAtLeast(PlayerChunk.State.BORDER);
+ // Paper start - incremental autosave
+ if (prev != this.hasBeenLoaded) {
+ if (this.hasBeenLoaded) {
+ long timeSinceAutoSave = this.inactiveTimeStart - this.lastAutoSaveTime;
+ if (timeSinceAutoSave < 0) {
+ // safest bet is to assume autosave is needed here
+ timeSinceAutoSave = this.chunkMap.world.paperConfig.autoSavePeriod;
+ }
+ this.lastAutoSaveTime = this.chunkMap.world.getTime() - timeSinceAutoSave;
+ this.chunkMap.autoSaveQueue.add(this);
+ } else {
+ this.inactiveTimeStart = this.chunkMap.world.getTime();
+ this.chunkMap.autoSaveQueue.remove(this);
+ }
+ }
+ // Paper end
+ }
+
+ // Paper start - incremental autosave
+ public boolean setHasBeenLoaded() {
this.hasBeenLoaded = getChunkState(this.ticketLevel).isAtLeast(PlayerChunk.State.BORDER);
+ return this.hasBeenLoaded;
}
+ // Paper end
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 c17a53915..3a02b6269 100644
index 803fda511f..40d80f3810 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -302,6 +302,36 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -331,6 +331,64 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
+ // Paper start - derived from below
+ // Paper start - incremental autosave
+ final it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<PlayerChunk> autoSaveQueue = new it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<>((playerchunk1, playerchunk2) -> {
+ int timeCompare = Long.compare(playerchunk1.lastAutoSaveTime, playerchunk2.lastAutoSaveTime);
+ if (timeCompare != 0) {
+ return timeCompare;
+ }
+
+ return Long.compare(MCUtil.getCoordinateKey(playerchunk1.location), MCUtil.getCoordinateKey(playerchunk2.location));
+ });
+
+ protected void saveIncrementally() {
+ int savedThisTick = 0;
+ for (PlayerChunk playerchunk : visibleChunks.values()) {
+ if (playerchunk.hasBeenLoaded()) {
+ // optimized since we search far less chunks to hit ones that need to be saved
+ List<PlayerChunk> reschedule = new ArrayList<>(this.world.paperConfig.maxAutoSaveChunksPerTick);
+ long currentTick = this.world.getTime();
+ long maxSaveTime = currentTick - this.world.paperConfig.autoSavePeriod;
+
+ IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow(null); // CraftBukkit - decompile error
+ for (Iterator<PlayerChunk> iterator = this.autoSaveQueue.iterator(); iterator.hasNext();) {
+ PlayerChunk playerchunk = iterator.next();
+ if (playerchunk.lastAutoSaveTime > maxSaveTime) {
+ break;
+ }
+
+ iterator.remove();
+
+ if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
+ boolean shouldSave = true;
+ IChunkAccess ichunkaccess = playerchunk.getChunkSave().getNow(null);
+ if (ichunkaccess instanceof Chunk) {
+ boolean shouldSave = ((Chunk)ichunkaccess).lastSaved <= maxSaveTime;
+
+ if (ichunkaccess instanceof Chunk) {
+ shouldSave = ((Chunk) ichunkaccess).lastSaved + world.paperConfig.autoSavePeriod <= world.getTime();
+ if (shouldSave && this.saveChunk(ichunkaccess)) {
+ ++savedThisTick;
+
+ if (!playerchunk.setHasBeenLoaded()) {
+ // do not fall through to reschedule logic
+ playerchunk.inactiveTimeStart = currentTick;
+ if (savedThisTick >= this.world.paperConfig.maxAutoSaveChunksPerTick) {
+ break;
+ }
+ continue;
+ }
+
+ if (shouldSave && this.saveChunk(ichunkaccess)) {
+ ++savedThisTick;
+ playerchunk.m();
+ }
+ }
+
+ if (savedThisTick >= world.paperConfig.maxAutoSaveChunksPerTick) {
+ return;
+ }
+ }
+
+ reschedule.add(playerchunk);
+
+ if (savedThisTick >= this.world.paperConfig.maxAutoSaveChunksPerTick) {
+ break;
+ }
+ }
+
+ for (int i = 0, len = reschedule.size(); i < len; ++i) {
+ PlayerChunk playerchunk = reschedule.get(i);
+ playerchunk.lastAutoSaveTime = this.world.getTime();
+ this.autoSaveQueue.add(playerchunk);
+ }
+ }
+ // paper end
+ // Paper end
+
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 {
this.world.unloadChunk(chunk);
}
+ this.autoSaveQueue.remove(playerchunk); // Paper
this.lightEngine.a(ichunkaccess.getPos());
this.lightEngine.queueUpdate();
@@ -622,6 +681,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
playerchunk.a(new ProtoChunkExtension(chunk));
}
+ chunk.setLastSaved(this.world.getTime() - 1); // Paper - avoid autosaving newly generated/loaded chunks
+
chunk.a(() -> {
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 9be58e785..7bf0b8708 100644
index 32da4eb4e0..fae30a1c1b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -810,11 +810,44 @@ public class WorldServer extends World {

View File

@ -1,4 +1,4 @@
From 3edbd083e20ae90b37ce5ab04b6108c4cf7fac21 Mon Sep 17 00:00:00 2001
From 778b5824bbdcb4d38ddddc037e4687ba6ae2aebd 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
@ -8,19 +8,19 @@ This patch also adds a chunk status cache on region files (note that
its only purpose is to cache the status on DISK)
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 99ce73c45..761399e28 100644
index 191b2759a0..9e75647953 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -28,7 +28,7 @@ public class ChunkProviderServer extends IChunkProvider {
private final WorldServer world;
private final Thread serverThread;
public final Thread serverThread; // Paper - private -> public
private final LightEngineThreaded lightEngine;
- private final ChunkProviderServer.a serverThreadQueue;
+ public final ChunkProviderServer.a serverThreadQueue; // Paper private -> public
public final PlayerChunkMap playerChunkMap;
private final WorldPersistentData worldPersistentData;
private long lastTickTime;
@@ -109,6 +109,21 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -205,6 +205,21 @@ public class ChunkProviderServer extends IChunkProvider {
return playerChunk.getFullChunk();
}
@ -43,7 +43,7 @@ index 99ce73c45..761399e28 100644
@Nullable
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 6371f2f5b..961228e9d 100644
index 6371f2f5b1..961228e9df 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -391,6 +391,17 @@ public class ChunkRegionLoader {
@ -65,7 +65,7 @@ index 6371f2f5b..961228e9d 100644
if (nbttagcompound != null) {
ChunkStatus chunkstatus = ChunkStatus.a(nbttagcompound.getCompound("Level").getString("Status"));
diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java
index efdf611e6..134a4f0b7 100644
index efdf611e66..134a4f0b7d 100644
--- a/src/main/java/net/minecraft/server/ChunkStatus.java
+++ b/src/main/java/net/minecraft/server/ChunkStatus.java
@@ -176,6 +176,7 @@ public class ChunkStatus {
@ -95,7 +95,7 @@ index efdf611e6..134a4f0b7 100644
return (ChunkStatus) IRegistry.CHUNK_STATUS.get(MinecraftKey.a(s));
}
diff --git a/src/main/java/net/minecraft/server/IChunkLoader.java b/src/main/java/net/minecraft/server/IChunkLoader.java
index f0a052eec..2f95174fc 100644
index f0a052eec2..2f95174fcc 100644
--- a/src/main/java/net/minecraft/server/IChunkLoader.java
+++ b/src/main/java/net/minecraft/server/IChunkLoader.java
@@ -8,7 +8,7 @@ import javax.annotation.Nullable;
@ -108,10 +108,10 @@ index f0a052eec..2f95174fc 100644
@Nullable
private PersistentStructureLegacy c;
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 43d9a5634..6f2cca07e 100644
index c91312facf..5108d3ee98 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -70,6 +70,19 @@ public class PlayerChunk {
@@ -114,6 +114,19 @@ public class PlayerChunk {
Either<IChunkAccess, PlayerChunk.Failure> either = (Either<IChunkAccess, PlayerChunk.Failure>) statusFuture.getNow(null);
return either == null ? null : (Chunk) either.left().orElse(null);
}
@ -132,10 +132,10 @@ index 43d9a5634..6f2cca07e 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 3a02b6269..6257eafe0 100644
index 40d80f3810..6c4804232a 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -907,11 +907,61 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -967,12 +967,62 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@Nullable
@ -165,8 +165,8 @@ index 3a02b6269..6257eafe0 100644
+ RegionFile regionFile = this.getIOWorker().getRegionFileCache().getRegionFileIfLoaded(chunkPos);
+
+ return regionFile == null ? null : regionFile.getStatusIfCached(chunkPos.x, chunkPos.z);
+ }
+
}
+ public ChunkStatus getChunkStatusOnDisk(ChunkCoordIntPair chunkPos) throws IOException {
+ RegionFile regionFile = this.getIOWorker().getRegionFileCache().getFile(chunkPos, false);
+
@ -194,13 +194,14 @@ index 3a02b6269..6257eafe0 100644
+ public IChunkAccess getUnloadingChunk(int chunkX, int chunkZ) {
+ PlayerChunk chunkHolder = this.pendingUnload.get(ChunkCoordIntPair.pair(chunkX, chunkZ));
+ return chunkHolder == null ? null : chunkHolder.getAvailableChunkNow();
}
+ }
+ // Paper end
+
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
// Spigot start
return isOutsideOfRange(chunkcoordintpair, false);
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 6b543f89d..d37abf2cf 100644
index 6b543f89d4..d37abf2cf3 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -36,6 +36,30 @@ public class RegionFile implements AutoCloseable {
@ -249,7 +250,7 @@ index 6b543f89d..d37abf2cf 100644
this.c();
} finally {
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index b3d1bb5fd..e07ae9854 100644
index b3d1bb5fd8..e07ae98540 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -18,7 +18,14 @@ public final class RegionFileCache implements AutoCloseable {
@ -279,7 +280,7 @@ index b3d1bb5fd..e07ae9854 100644
throwable = throwable1;
throw throwable1;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 9787d5332..f56ec3d34 100644
index 9787d53326..f56ec3d341 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -18,6 +18,7 @@ import java.util.Objects;

View File

@ -1,4 +1,4 @@
From 81ca8a38e7ed63416c92b49cfcabeba9ed3edc1c Mon Sep 17 00:00:00 2001
From e602e81e6efe942af77eebd833748d97b5ad9e9b 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 6257eafe0..4e9edd759 100644
index 6c4804232a..8bd212388a 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -783,8 +783,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -843,8 +843,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
NBTTagCompound nbttagcompound;
if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) {

View File

@ -1,11 +1,11 @@
From 59d051b8d575a77e737688f5abc99fdc894e92f6 Mon Sep 17 00:00:00 2001
From 74d8489304e14d2b6ffd00976fc48142492ca132 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
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 486761521..df24e3297 100644
index 4867615215..df24e3297b 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -1,7 +1,11 @@
@ -66,7 +66,7 @@ index 486761521..df24e3297 100644
}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java
new file mode 100644
index 000000000..f7e376ce6
index 0000000000..f7e376ce6a
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java
@@ -0,0 +1,46 @@
@ -118,7 +118,7 @@ index 000000000..f7e376ce6
+}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
new file mode 100644
index 000000000..23626bef3
index 0000000000..23626bef3a
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
@@ -0,0 +1,782 @@
@ -906,7 +906,7 @@ index 000000000..23626bef3
+}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java
new file mode 100644
index 000000000..a68bace35
index 0000000000..a68bace353
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java
@@ -0,0 +1,81 @@
@ -993,7 +993,7 @@ index 000000000..a68bace35
+}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java
new file mode 100644
index 000000000..067dfb2f1
index 0000000000..067dfb2f14
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java
@@ -0,0 +1,31 @@
@ -1030,7 +1030,7 @@ index 000000000..067dfb2f1
+}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java
new file mode 100644
index 000000000..cc586827a
index 0000000000..cc586827aa
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java
@@ -0,0 +1,56 @@
@ -1092,7 +1092,7 @@ index 000000000..cc586827a
+}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java
new file mode 100644
index 000000000..37093419c
index 0000000000..37093419cf
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java
@@ -0,0 +1,84 @@
@ -1181,10 +1181,10 @@ index 000000000..37093419c
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 14ec31f0a..863a2222f 100644
index 76e87c211b..3fdcc2e5d4 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -315,7 +315,7 @@ public class Chunk implements IChunkAccess {
@@ -320,7 +320,7 @@ public class Chunk implements IChunkAccess {
return null;
}
@ -1194,7 +1194,7 @@ index 14ec31f0a..863a2222f 100644
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 961228e9d..a950ad801 100644
index 961228e9df..a950ad801d 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -57,7 +57,7 @@ public class ChunkRegionLoader {
@ -1216,7 +1216,7 @@ index 961228e9d..a950ad801 100644
protochunk.a(biomestorage);
object = protochunk;
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
index 0d5deee36..4526527ac 100644
index 0d5deee365..4526527aca 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
@@ -6,21 +6,31 @@ public class ChunkSection {
@ -1255,7 +1255,7 @@ index 0d5deee36..4526527ac 100644
public IBlockData getType(int i, int j, int k) {
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
index 2c1d1b1a5..44aed6727 100644
index 2c1d1b1a55..44aed67274 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
@@ -3,6 +3,7 @@ package net.minecraft.server;
@ -1377,7 +1377,7 @@ index 2c1d1b1a5..44aed6727 100644
if (this.h == this.b) {
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index e156804f7..96a785af2 100644
index e156804f7a..96a785af27 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -42,7 +42,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
@ -1440,7 +1440,7 @@ index e156804f7..96a785af2 100644
public void a() {
this.o();
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 47710067a..ef7ade797 100644
index 47710067a6..ef7ade797b 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -1,5 +1,6 @@
@ -1533,10 +1533,10 @@ index 47710067a..ef7ade797 100644
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 6f2cca07e..7a1578afa 100644
index 5108d3ee98..b556a8fefa 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -176,6 +176,11 @@ public class PlayerChunk {
@@ -220,6 +220,11 @@ public class PlayerChunk {
World world = chunk.getWorld();
if (this.dirtyCount == 64) {
@ -1548,7 +1548,7 @@ index 6f2cca07e..7a1578afa 100644
this.s = -1;
}
@@ -208,7 +213,7 @@ public class PlayerChunk {
@@ -252,7 +257,7 @@ public class PlayerChunk {
this.a(world, blockposition);
}
} else if (this.dirtyCount == 64) {
@ -1558,10 +1558,10 @@ index 6f2cca07e..7a1578afa 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 4e9edd759..6728e84b2 100644
index 8bd212388a..be3dcf375b 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -545,7 +545,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -603,7 +603,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PlayerChunkMap.LOGGER.error("Couldn't load chunk {}", chunkcoordintpair, exception);
}
@ -1570,7 +1570,7 @@ index 4e9edd759..6728e84b2 100644
}, this.executor);
}
@@ -1260,7 +1260,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1322,7 +1322,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private void a(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) {
if (apacket[0] == null) {
@ -1580,7 +1580,7 @@ index 4e9edd759..6728e84b2 100644
}
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
index e2e5c17c2..ce4340a47 100644
index e2e5c17c24..ce4340a476 100644
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
@@ -264,6 +264,8 @@ public class PlayerInteractManager {
@ -1593,7 +1593,7 @@ index e2e5c17c2..ce4340a47 100644
public void a(BlockPosition blockposition, PacketPlayInBlockDig.EnumPlayerDigType packetplayinblockdig_enumplayerdigtype, String s) {
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
index 39339fa27..f376e2106 100644
index 39339fa275..f376e21068 100644
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
@@ -45,16 +45,28 @@ public class ProtoChunk implements IChunkAccess {
@ -1636,7 +1636,7 @@ index 39339fa27..f376e2106 100644
return this.j[i];
diff --git a/src/main/java/net/minecraft/server/TicketType.java b/src/main/java/net/minecraft/server/TicketType.java
index a905a29e7..335b64435 100644
index a905a29e75..335b644351 100644
--- a/src/main/java/net/minecraft/server/TicketType.java
+++ b/src/main/java/net/minecraft/server/TicketType.java
@@ -21,6 +21,7 @@ public class TicketType<T> {
@ -1648,7 +1648,7 @@ index a905a29e7..335b64435 100644
public static <T> TicketType<T> a(String s, Comparator<T> comparator) {
return new TicketType<>(s, comparator, 0L);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index d981dfd43..a1b777ac0 100644
index d981dfd434..a1b777ac03 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2,6 +2,8 @@ package net.minecraft.server;
@ -1685,7 +1685,7 @@ index d981dfd43..a1b777ac0 100644
if (iblockdata1 == null) {
// CraftBukkit start - remove blockstate if failed
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java
index 7772d5900..4570ed999 100644
index 7772d59005..4570ed9991 100644
--- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java
@@ -21,9 +21,11 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData {

View File

@ -1,14 +1,14 @@
From e618559325fb1981a036d690cbb52dbe40349ee7 Mon Sep 17 00:00:00 2001
From 90d7d42ae7fae9a7933c728771736312bd08504c 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 53172dac2..691ef0048 100644
index e9d3424103..0f652e58e1 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1390,6 +1390,7 @@ public class WorldServer extends World {
@@ -1392,6 +1392,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 53172dac2..691ef0048 100644
Iterator iterator = this.navigators.iterator();
while (iterator.hasNext()) {
@@ -1400,6 +1401,7 @@ public class WorldServer extends World {
@@ -1402,6 +1403,7 @@ public class WorldServer extends World {
}
}

View File

@ -1,4 +1,4 @@
From 5977ff695cb879dc9a1d3d4c6a7a1a7e15a6800d Mon Sep 17 00:00:00 2001
From 9bc42552b2b41e2263f1f39db6b9d0d3f819b91b 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 863a2222f..f2a04cb6a 100644
index 3fdcc2e5d4..59d8a8719e 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,9 +28,9 @@ index 863a2222f..f2a04cb6a 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) {
@@ -430,6 +434,13 @@ public class Chunk implements IChunkAccess {
entity.chunkY = k;
@@ -436,6 +440,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);
+ // Paper start
+ if (entity instanceof EntityItem) {
@ -42,7 +42,7 @@ index 863a2222f..f2a04cb6a 100644
entity.entitySlice = this.entitySlices[k]; // Paper
this.markDirty(); // Paper
}
@@ -460,6 +471,11 @@ public class Chunk implements IChunkAccess {
@@ -466,6 +477,11 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}
@ -54,7 +54,7 @@ index 863a2222f..f2a04cb6a 100644
entityCounts.decrement(entity.getMinecraftKeyString());
this.markDirty(); // Paper
// Paper end
@@ -727,9 +743,29 @@ public class Chunk implements IChunkAccess {
@@ -735,9 +751,29 @@ public class Chunk implements IChunkAccess {
i = MathHelper.clamp(i, 0, this.entitySlices.length - 1);
j = MathHelper.clamp(j, 0, this.entitySlices.length - 1);
@ -85,7 +85,7 @@ index 863a2222f..f2a04cb6a 100644
T t0 = (T) iterator.next(); // CraftBukkit - decompile error
if (t0.shouldBeRemoved) continue; // Paper
diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java
index 498f38109..a2d1ef360 100644
index 498f381099..a2d1ef3602 100644
--- a/src/main/java/net/minecraft/server/IEntitySelector.java
+++ b/src/main/java/net/minecraft/server/IEntitySelector.java
@@ -11,6 +11,7 @@ public final class IEntitySelector {

View File

@ -1,4 +1,4 @@
From cba242fa2b307d951063e3d724d73dd4cb1bfecd Mon Sep 17 00:00:00 2001
From b2c12a10d2992373cd9bb7830bdb876772582175 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
@ -121,7 +121,7 @@ tasks required to be executed by the chunk load task (i.e lighting
and some poi tasks).
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
index 3a79cde59..8de6c4816 100644
index 3a79cde595..8de6c4816c 100644
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -63,6 +63,17 @@ public class WorldTimingsHandler {
@ -161,7 +161,7 @@ index 3a79cde59..8de6c4816 100644
public static Timing getTickList(WorldServer worldserver, String timingsType) {
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 546a1cfe0..1d7d1ffbf 100644
index 546a1cfe0a..1d7d1ffbf7 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -1,5 +1,6 @@
@ -237,7 +237,7 @@ index 546a1cfe0..1d7d1ffbf 100644
+ }
}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
index 23626bef3..1edcecd2e 100644
index 23626bef3a..1edcecd2ee 100644
--- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
@@ -9,6 +9,7 @@ import java.util.concurrent.Executors;
@ -318,7 +318,7 @@ index 23626bef3..1edcecd2e 100644
diff --git a/src/main/java/com/destroystokyo/paper/io/IOUtil.java b/src/main/java/com/destroystokyo/paper/io/IOUtil.java
new file mode 100644
index 000000000..5af0ac3d9
index 0000000000..5af0ac3d9e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/IOUtil.java
@@ -0,0 +1,62 @@
@ -386,7 +386,7 @@ index 000000000..5af0ac3d9
+}
diff --git a/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java
new file mode 100644
index 000000000..4f10a8311
index 0000000000..4f10a8311e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java
@@ -0,0 +1,661 @@
@ -1053,7 +1053,7 @@ index 000000000..4f10a8311
+}
diff --git a/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java
new file mode 100644
index 000000000..78bd238f4
index 0000000000..78bd238f4c
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java
@@ -0,0 +1,276 @@
@ -1335,7 +1335,7 @@ index 000000000..78bd238f4
+}
diff --git a/src/main/java/com/destroystokyo/paper/io/QueueExecutorThread.java b/src/main/java/com/destroystokyo/paper/io/QueueExecutorThread.java
new file mode 100644
index 000000000..ee906b594
index 0000000000..ee906b594b
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/QueueExecutorThread.java
@@ -0,0 +1,241 @@
@ -1582,7 +1582,7 @@ index 000000000..ee906b594
+}
diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java
new file mode 100644
index 000000000..305da4786
index 0000000000..305da47868
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java
@@ -0,0 +1,149 @@
@ -1737,7 +1737,7 @@ index 000000000..305da4786
+}
diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java
new file mode 100644
index 000000000..60312b85f
index 0000000000..60312b85f9
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java
@@ -0,0 +1,112 @@
@ -1855,7 +1855,7 @@ index 000000000..60312b85f
+}
diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTask.java
new file mode 100644
index 000000000..1dfa8abfd
index 0000000000..1dfa8abfd8
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTask.java
@@ -0,0 +1,40 @@
@ -1901,7 +1901,7 @@ index 000000000..1dfa8abfd
+}
diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java
new file mode 100644
index 000000000..715a2dd8d
index 0000000000..715a2dd8d2
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java
@@ -0,0 +1,455 @@
@ -2361,10 +2361,10 @@ index 000000000..715a2dd8d
+
+}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 761399e28..58299562e 100644
index 9e75647953..e10035d461 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -124,11 +124,137 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -220,11 +220,137 @@ public class ChunkProviderServer extends IChunkProvider {
return playerChunk.getAvailableChunkNow();
}
@ -2502,7 +2502,7 @@ index 761399e28..58299562e 100644
if (Thread.currentThread() != this.serverThread) {
return (IChunkAccess) CompletableFuture.supplyAsync(() -> {
return this.getChunkAt(i, j, chunkstatus, flag);
@@ -154,8 +280,13 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -250,8 +376,13 @@ public class ChunkProviderServer extends IChunkProvider {
CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = this.getChunkFutureMainThread(i, j, chunkstatus, flag);
if (!completablefuture.isDone()) { // Paper
@ -2516,7 +2516,7 @@ index 761399e28..58299562e 100644
this.world.timings.chunkAwait.stopTiming(); // Paper
} // Paper
ichunkaccess = (IChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
@@ -651,11 +782,12 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -747,11 +878,12 @@ public class ChunkProviderServer extends IChunkProvider {
protected boolean executeNext() {
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
try {
@ -2531,7 +2531,7 @@ index 761399e28..58299562e 100644
} finally {
playerChunkMap.callbackExecutor.run();
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index a950ad801..26f1a4b09 100644
index a950ad801d..26f1a4b095 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
@ -2800,7 +2800,7 @@ index a950ad801..26f1a4b09 100644
nbttagcompound1.set("PostProcessing", a(ichunkaccess.l()));
diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java
index 134a4f0b7..88f167461 100644
index 134a4f0b7d..88f1674616 100644
--- a/src/main/java/net/minecraft/server/ChunkStatus.java
+++ b/src/main/java/net/minecraft/server/ChunkStatus.java
@@ -153,6 +153,7 @@ public class ChunkStatus {
@ -2812,7 +2812,7 @@ index 134a4f0b7..88f167461 100644
return ChunkStatus.r.getInt(chunkstatus.c());
}
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
index 7e5ece9d5..cfe43e882 100644
index 7e5ece9d50..cfe43e882e 100644
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
@@ -91,7 +91,7 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
@ -2825,7 +2825,7 @@ index 7e5ece9d5..cfe43e882 100644
;
}
diff --git a/src/main/java/net/minecraft/server/IChunkLoader.java b/src/main/java/net/minecraft/server/IChunkLoader.java
index 2f95174fc..134c76065 100644
index 2f95174fcc..134c76065b 100644
--- a/src/main/java/net/minecraft/server/IChunkLoader.java
+++ b/src/main/java/net/minecraft/server/IChunkLoader.java
@@ -3,37 +3,49 @@ package net.minecraft.server;
@ -2950,10 +2950,10 @@ index 2f95174fc..134c76065 100644
+// Paper end
}
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index 25a87c2d3..c02c53b50 100644
index b6aeca05f7..bcd5cc9f28 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -530,4 +530,9 @@ public final class MCUtil {
@@ -600,4 +600,9 @@ public final class MCUtil {
out.print(fileData);
}
}
@ -2964,7 +2964,7 @@ index 25a87c2d3..c02c53b50 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6fa08c60b..baeaf772b 100644
index 6fa08c60bd..baeaf772be 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -789,6 +789,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@ -2976,7 +2976,7 @@ index 6fa08c60b..baeaf772b 100644
public String getServerIp() {
diff --git a/src/main/java/net/minecraft/server/NextTickListEntry.java b/src/main/java/net/minecraft/server/NextTickListEntry.java
index e9c405fb5..33cfeabde 100644
index e9c405fb53..33cfeabdee 100644
--- a/src/main/java/net/minecraft/server/NextTickListEntry.java
+++ b/src/main/java/net/minecraft/server/NextTickListEntry.java
@@ -4,7 +4,7 @@ import java.util.Comparator;
@ -2998,7 +2998,7 @@ index e9c405fb5..33cfeabde 100644
this.e = t0;
this.b = i;
diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java
index ed8c4a87b..996c83263 100644
index ed8c4a87b5..996c832638 100644
--- a/src/main/java/net/minecraft/server/NibbleArray.java
+++ b/src/main/java/net/minecraft/server/NibbleArray.java
@@ -71,6 +71,7 @@ public class NibbleArray {
@ -3010,10 +3010,10 @@ index ed8c4a87b..996c83263 100644
return this.a == null ? new NibbleArray() : new NibbleArray((byte[]) this.a.clone());
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 7a1578afa..d26365eb1 100644
index b556a8fefa..b82ea26eb6 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -83,6 +83,18 @@ public class PlayerChunk {
@@ -127,6 +127,18 @@ public class PlayerChunk {
}
return null;
}
@ -3032,7 +3032,7 @@ index 7a1578afa..d26365eb1 100644
// Paper end
public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
@@ -310,7 +322,7 @@ public class PlayerChunk {
@@ -354,7 +366,7 @@ public class PlayerChunk {
ChunkStatus chunkstatus = getChunkStatus(this.oldTicketLevel);
ChunkStatus chunkstatus1 = getChunkStatus(this.ticketLevel);
boolean flag = this.oldTicketLevel <= PlayerChunkMap.GOLDEN_TICKET;
@ -3041,7 +3041,7 @@ index 7a1578afa..d26365eb1 100644
PlayerChunk.State playerchunk_state = getChunkState(this.oldTicketLevel);
PlayerChunk.State playerchunk_state1 = getChunkState(this.ticketLevel);
// CraftBukkit start
@@ -340,6 +352,12 @@ public class PlayerChunk {
@@ -384,6 +396,12 @@ public class PlayerChunk {
}
});
@ -3055,7 +3055,7 @@ index 7a1578afa..d26365eb1 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 6728e84b2..8ce6cf8ec 100644
index be3dcf375b..9fa6d2b526 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 {
@ -3076,7 +3076,7 @@ index 6728e84b2..8ce6cf8ec 100644
private final File w;
private final PlayerMap playerMap;
public final Int2ObjectMap<PlayerChunkMap.EntityTracker> trackedEntities;
@@ -134,7 +134,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -163,7 +163,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;
@ -3085,7 +3085,7 @@ index 6728e84b2..8ce6cf8ec 100644
this.setViewDistance(i);
}
@@ -181,7 +181,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -210,7 +210,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@Nullable
@ -3094,7 +3094,7 @@ index 6728e84b2..8ce6cf8ec 100644
return (PlayerChunk) this.visibleChunks.get(i);
}
@@ -295,6 +295,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -324,6 +324,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
public void close() throws IOException {
try {
this.p.close();
@ -3102,25 +3102,7 @@ index 6728e84b2..8ce6cf8ec 100644
this.m.close();
} finally {
super.close();
@@ -318,7 +319,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
shouldSave = ((Chunk) ichunkaccess).lastSaved + world.paperConfig.autoSavePeriod <= world.getTime();
}
- if (shouldSave && this.saveChunk(ichunkaccess)) {
+ if (shouldSave && this.saveChunk(ichunkaccess, true)) { // Paper - async chunk io
++savedThisTick;
playerchunk.m();
}
@@ -350,7 +351,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return (IChunkAccess) completablefuture.join();
}).filter((ichunkaccess) -> {
return ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk;
- }).filter(this::saveChunk).forEach((ichunkaccess) -> {
+ }).filter((chunk) -> this.saveChunk(chunk, true)).forEach((ichunkaccess) -> { // Paper - async io for chunk save
mutableboolean.setTrue();
});
} while (mutableboolean.isTrue());
@@ -358,18 +359,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -415,7 +416,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
this.b(() -> {
return true;
});
@ -3130,12 +3112,7 @@ index 6728e84b2..8ce6cf8ec 100644
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName());
} else {
this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> {
IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow(null); // CraftBukkit - decompile error
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
- this.saveChunk(ichunkaccess);
+ this.saveChunk(ichunkaccess, true); // Paper
playerchunk.m();
@@ -427,6 +429,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
});
@ -3143,7 +3120,7 @@ index 6728e84b2..8ce6cf8ec 100644
}
}
@@ -379,11 +382,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -436,11 +439,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
protected void unloadChunks(BooleanSupplier booleansupplier) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
@ -3159,7 +3136,7 @@ index 6728e84b2..8ce6cf8ec 100644
}
gameprofilerfiller.exit();
@@ -423,6 +430,60 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -480,6 +487,60 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@ -3220,7 +3197,7 @@ index 6728e84b2..8ce6cf8ec 100644
private void a(long i, PlayerChunk playerchunk) {
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave();
Consumer<IChunkAccess> consumer = (ichunkaccess) -> { // CraftBukkit - decompile error
@@ -436,13 +497,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -493,7 +554,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
((Chunk) ichunkaccess).setLoaded(false);
}
@ -3229,20 +3206,21 @@ index 6728e84b2..8ce6cf8ec 100644
if (this.loadedChunks.remove(i) && ichunkaccess instanceof Chunk) {
Chunk chunk = (Chunk) ichunkaccess;
this.world.unloadChunk(chunk);
@@ -501,6 +562,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
this.autoSaveQueue.remove(playerchunk); // Paper
+ try {
+ this.asyncSave(ichunkaccess); // Paper - async chunk saving
+ } catch (Throwable ex) {
+ LOGGER.fatal("Failed to prepare async save, attempting synchronous save", ex);
+ this.saveChunk(ichunkaccess, true);
+ this.saveChunk(ichunkaccess);
+ }
+
this.lightEngine.a(ichunkaccess.getPos());
this.lightEngine.queueUpdate();
this.worldLoadListener.a(ichunkaccess.getPos(), (ChunkStatus) null);
@@ -512,27 +580,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -570,27 +638,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@ -3290,7 +3268,7 @@ index 6728e84b2..8ce6cf8ec 100644
} catch (ReportedException reportedexception) {
Throwable throwable = reportedexception.getCause();
@@ -546,7 +619,27 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -604,7 +677,27 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
return Either.left(new ProtoChunk(chunkcoordintpair, ChunkConverter.a, this.world)); // Paper - Anti-Xray
@ -3319,7 +3297,7 @@ index 6728e84b2..8ce6cf8ec 100644
}
private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> b(PlayerChunk playerchunk, ChunkStatus chunkstatus) {
@@ -761,18 +854,43 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -821,18 +914,43 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return this.u.get();
}
@ -3350,7 +3328,7 @@ index 6728e84b2..8ce6cf8ec 100644
public boolean saveChunk(IChunkAccess ichunkaccess) {
- this.m.a(ichunkaccess.getPos());
+ // Paper start - async param
+ return this.saveChunk(ichunkaccess, false);
+ return this.saveChunk(ichunkaccess, true);
+ }
+ public boolean saveChunk(IChunkAccess ichunkaccess, boolean async) {
+ try (co.aikar.timings.Timing ignored = this.world.timings.chunkSave.startTiming()) {
@ -3371,7 +3349,7 @@ index 6728e84b2..8ce6cf8ec 100644
ichunkaccess.setLastSaved(this.world.getTime());
ichunkaccess.setNeedsSaving(false);
@@ -783,28 +901,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -843,28 +961,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
NBTTagCompound nbttagcompound;
if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) {
@ -3409,7 +3387,7 @@ index 6728e84b2..8ce6cf8ec 100644
}
protected void setViewDistance(int i) {
@@ -908,6 +1033,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -968,6 +1093,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@ -3452,7 +3430,7 @@ index 6728e84b2..8ce6cf8ec 100644
@Nullable
public NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { // Paper - private -> public
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
@@ -930,33 +1091,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -990,33 +1151,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - chunk status cache "api"
public ChunkStatus getChunkStatusOnDiskIfCached(ChunkCoordIntPair chunkPos) {
@ -3519,7 +3497,7 @@ index 6728e84b2..8ce6cf8ec 100644
}
public IChunkAccess getUnloadingChunk(int chunkX, int chunkZ) {
@@ -965,6 +1148,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1025,6 +1208,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
// Paper end
@ -3559,7 +3537,7 @@ index 6728e84b2..8ce6cf8ec 100644
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
// Spigot start
return isOutsideOfRange(chunkcoordintpair, false);
@@ -1309,6 +1525,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1371,6 +1587,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
@ -3568,7 +3546,7 @@ index 6728e84b2..8ce6cf8ec 100644
return this.m;
}
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index d37abf2cf..df728e2c0 100644
index d37abf2cf3..df728e2c0a 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -36,6 +36,8 @@ public class RegionFile implements AutoCloseable {
@ -3613,7 +3591,7 @@ index d37abf2cf..df728e2c0 100644
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index e07ae9854..0f201000f 100644
index e07ae98540..0f201000f6 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -9,7 +9,7 @@ import java.io.File;
@ -3718,7 +3696,7 @@ index e07ae9854..0f201000f 100644
return regionfile != null ? regionfile.chunkExists(pos) : false;
diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java
index db9f0196b..a6d8ef5eb 100644
index db9f0196bd..a6d8ef5eb4 100644
--- a/src/main/java/net/minecraft/server/RegionFileSection.java
+++ b/src/main/java/net/minecraft/server/RegionFileSection.java
@@ -20,28 +20,29 @@ import javax.annotation.Nullable;
@ -3854,7 +3832,7 @@ index db9f0196b..a6d8ef5eb 100644
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/TicketType.java b/src/main/java/net/minecraft/server/TicketType.java
index 335b64435..481d95480 100644
index 335b644351..481d954808 100644
--- a/src/main/java/net/minecraft/server/TicketType.java
+++ b/src/main/java/net/minecraft/server/TicketType.java
@@ -22,6 +22,7 @@ public class TicketType<T> {
@ -3866,7 +3844,7 @@ index 335b64435..481d95480 100644
public static <T> TicketType<T> a(String s, Comparator<T> comparator) {
return new TicketType<>(s, comparator, 0L);
diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java
index c999f8c9b..b59ef1a63 100644
index c999f8c9bf..b59ef1a633 100644
--- a/src/main/java/net/minecraft/server/VillagePlace.java
+++ b/src/main/java/net/minecraft/server/VillagePlace.java
@@ -24,8 +24,16 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
@ -3955,7 +3933,7 @@ index c999f8c9b..b59ef1a63 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 691ef0048..541c1535e 100644
index 0f652e58e1..5eb52817f1 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 {
@ -4048,7 +4026,7 @@ index 691ef0048..541c1535e 100644
// CraftBukkit start
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index f56ec3d34..1a6a88b17 100644
index f56ec3d341..1a6a88b178 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -555,22 +555,23 @@ public class CraftWorld implements World {
@ -4110,7 +4088,7 @@ index f56ec3d34..1a6a88b17 100644
@Override
public int getViewDistance() {
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 07936eeba..5bdcdcf9e 100644
index 07936eeba2..5bdcdcf9e8 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -6,6 +6,7 @@ import java.lang.management.ThreadInfo;

View File

@ -1,4 +1,4 @@
From 75474a2f173a6ecb18037b0a2b74c8f3691545ed Mon Sep 17 00:00:00 2001
From 087ba4eb1b20e81032cb81fd141eedbeae580ded Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 19 Jul 2019 03:29:14 -0700
Subject: [PATCH] Reduce sync loads
@ -11,7 +11,7 @@ it must be enabled by setting the startup flag -Dpaper.debug-sync-loads=true
To get a debug log for sync loads, the command is /paper syncloadinfo
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index 09efbf725..132397b3f 100644
index 09efbf7250..132397b3f3 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -1,9 +1,13 @@
@ -91,7 +91,7 @@ index 09efbf725..132397b3f 100644
if (args.length < 2 || args[1].equals("*")) {
diff --git a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
new file mode 100644
index 000000000..59aec1032
index 0000000000..59aec10329
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java
@@ -0,0 +1,172 @@
@ -268,10 +268,10 @@ index 000000000..59aec1032
+ }
+}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 58299562e..3eb867684 100644
index e10035d461..92b22b9996 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -284,6 +284,7 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -380,6 +380,7 @@ public class ChunkProviderServer extends IChunkProvider {
this.world.asyncChunkTaskManager.raisePriority(x, z, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY);
com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.world, x, z);
// Paper end
@ -280,7 +280,7 @@ index 58299562e..3eb867684 100644
this.serverThreadQueue.awaitTasks(completablefuture::isDone);
com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0944ce045..9df079d8a 100644
index 0944ce0458..9df079d8af 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1198,7 +1198,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@ -311,7 +311,7 @@ index 0944ce045..9df079d8a 100644
if (chunk != null) {
chunk.a(oclass, axisalignedbb, list, predicate);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 541c1535e..4c74a85e0 100644
index 5eb52817f1..6d362316f7 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -154,6 +154,12 @@ public class WorldServer extends World {

View File

@ -1,11 +1,11 @@
From a98286788491d9065c6dabcc7773377b467014f4 Mon Sep 17 00:00:00 2001
From 9106fe90feeffa795cf88d9c30295b11eaf7e889 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
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
index 8de6c4816..e25544f11 100644
index 8de6c4816c..e25544f116 100644
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -62,6 +62,7 @@ public class WorldTimingsHandler {
@ -25,7 +25,7 @@ index 8de6c4816..e25544f11 100644
poiUnload = Timings.ofSafe(name + "Chunk unload - POI");
chunkUnload = Timings.ofSafe(name + "Chunk unload - Chunk");
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 9d9260ad0..fd3dbea62 100644
index 9d9260ad07..fd3dbea628 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -613,4 +613,9 @@ public class PaperWorldConfig {
@ -40,7 +40,7 @@ index 9d9260ad0..fd3dbea62 100644
}
diff --git a/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java b/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java
new file mode 100644
index 000000000..9ebd7ecb7
index 0000000000..9ebd7ecb7a
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java
@@ -0,0 +1,253 @@
@ -299,7 +299,7 @@ index 000000000..9ebd7ecb7
+}
diff --git a/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java b/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java
new file mode 100644
index 000000000..4f13d3ff8
index 0000000000..4f13d3ff83
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java
@@ -0,0 +1,241 @@
@ -545,10 +545,10 @@ index 000000000..4f13d3ff8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 3eb867684..d1e541ad6 100644
index 92b22b9996..72919e4c64 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -560,7 +560,22 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -656,7 +656,22 @@ public class ChunkProviderServer extends IChunkProvider {
this.world.timings.countNaturalMobs.startTiming(); // Paper - timings
int l = this.chunkMapDistance.b();
EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values();
@ -572,7 +572,7 @@ index 3eb867684..d1e541ad6 100644
this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings
this.world.getMethodProfiler().exit();
@@ -625,8 +640,23 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -721,8 +736,23 @@ public class ChunkProviderServer extends IChunkProvider {
if (enumcreaturetype != EnumCreatureType.MISC && (!enumcreaturetype.c() || this.allowAnimals) && (enumcreaturetype.c() || this.allowMonsters) && (!enumcreaturetype.d() || flag2)) {
int k1 = limit * l / ChunkProviderServer.b; // CraftBukkit - use per-world limits
@ -599,7 +599,7 @@ index 3eb867684..d1e541ad6 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 6483c4a0b..83405b641 100644
index 77ad4774ec..22606d894e 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -80,6 +80,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -614,7 +614,7 @@ index 6483c4a0b..83405b641 100644
// CraftBukkit start
public String displayName;
@@ -110,6 +115,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -114,6 +119,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.displayName = this.getName();
this.canPickUpLoot = true;
this.maxHealthCache = this.getMaxHealth();
@ -622,7 +622,7 @@ index 6483c4a0b..83405b641 100644
}
// Yes, this doesn't match Vanilla, but it's the best we can do for now.
@@ -1765,6 +1771,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -1769,6 +1775,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
@ -631,7 +631,7 @@ index 6483c4a0b..83405b641 100644
return this.cs;
}
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 79f854966..4100e367a 100644
index 79f8549660..4100e367a4 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -254,6 +254,7 @@ public class EntityTypes<T extends Entity> {
@ -643,7 +643,7 @@ index 79f854966..4100e367a 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 8ce6cf8ec..1df6a1f19 100644
index 9fa6d2b526..36657465f2 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 8ce6cf8ec..1df6a1f19 100644
// CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback()
public final CallbackExecutor callbackExecutor = new CallbackExecutor();
@@ -136,6 +137,24 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -165,6 +166,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);
@ -682,7 +682,7 @@ index 8ce6cf8ec..1df6a1f19 100644
private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) {
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index fdac5bb3a..58bbf2f9d 100644
index fdac5bb3a2..58bbf2f9d2 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -3,6 +3,7 @@ package net.minecraft.server;
@ -755,7 +755,7 @@ index fdac5bb3a..58bbf2f9d 100644
@Nullable
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index b3d23de1b..909af91ca 100644
index 9055df2ca1..5ec0acc302 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1024,7 +1024,20 @@ public class WorldServer extends World {

View File

@ -1,14 +1,14 @@
From 7b5a4dafc73b631ad1d1aadee0c0cd601f82071c Mon Sep 17 00:00:00 2001
From 262186e4bfad4cce5fc6ae9ec41be8f1e9d88e5a Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Wed, 9 Oct 2019 21:51:43 -0500
Subject: [PATCH] Fix stuck in sneak when changing worlds (MC-10657)
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 83405b641..41a3ad104 100644
index 22606d894e..0b35a4b143 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -976,6 +976,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -980,6 +980,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.lastHealthSent = -1.0F;
this.lastFoodSent = -1;
@ -18,7 +18,7 @@ index 83405b641..41a3ad104 100644
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver.getWorld());
this.world.getServer().getPluginManager().callEvent(changeEvent);
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index f702619aa..7b79ee4fe 100644
index f702619aa2..7b79ee4fe5 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -729,6 +729,8 @@ public abstract class PlayerList {

View File

@ -1,14 +1,14 @@
From b213d93c2fec628178a313d8ea64ce8ca7f02927 Mon Sep 17 00:00:00 2001
From 4eb744dc8be173a1d78c9729dfea41151b4cda46 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 15 Dec 2019 19:41:28 +0000
Subject: [PATCH] Fix spawn radius being treated as 0
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 41a3ad104..27d529efe 100644
index 0b35a4b143..4ca28c8b64 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -123,7 +123,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -127,7 +127,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public final BlockPosition getSpawnPoint(WorldServer worldserver) {
BlockPosition blockposition = worldserver.getSpawn();

View File

@ -1,14 +1,14 @@
From 95db5e56cb5f4c3dcd1277a07333b20669e12755 Mon Sep 17 00:00:00 2001
From 9e075ab344d25cb7cec6f3afc5a76cc2970280d1 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 24 Dec 2019 00:35:42 +0000
Subject: [PATCH] PlayerDeathEvent#shouldDropExperience
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 27d529efe..d09afc889 100644
index 4ca28c8b64..15230a834c 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -639,7 +639,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -643,7 +643,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.releaseShoulderEntities();
// SPIGOT-5478 must be called manually now

View File

@ -0,0 +1,88 @@
From 17c2e5b74e4cb8b5317863e8e7b17a96b93efef3 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 25 Jan 2020 17:04:35 -0800
Subject: [PATCH] Optimise getChunkAt calls for loaded chunks
bypass the need to get a player chunk, then get the either,
then unwrap it...
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 72919e4c64..42c559ad4f 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -356,6 +356,12 @@ public class ChunkProviderServer extends IChunkProvider {
return this.getChunkAt(i, j, chunkstatus, flag);
}, this.serverThreadQueue).join();
} else {
+ // Paper start - optimise for loaded chunks
+ Chunk ifLoaded = this.getChunkAtIfLoadedMainThread(i, j);
+ if (ifLoaded != null) {
+ return ifLoaded;
+ }
+ // Paper end
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
gameprofilerfiller.c("getChunk");
@@ -406,39 +412,7 @@ public class ChunkProviderServer extends IChunkProvider {
if (Thread.currentThread() != this.serverThread) {
return null;
} else {
- this.world.getMethodProfiler().c("getChunkNow");
- long k = ChunkCoordIntPair.pair(i, j);
-
- for (int l = 0; l < 4; ++l) {
- if (k == this.cachePos[l] && this.cacheStatus[l] == ChunkStatus.FULL) {
- IChunkAccess ichunkaccess = this.cacheChunk[l];
-
- return ichunkaccess instanceof Chunk ? (Chunk) ichunkaccess : null;
- }
- }
-
- PlayerChunk playerchunk = this.getChunk(k);
-
- if (playerchunk == null) {
- return null;
- } else {
- Either<IChunkAccess, PlayerChunk.Failure> either = (Either) playerchunk.b(ChunkStatus.FULL).getNow(null); // Craftbukkit - decompile error
-
- if (either == null) {
- return null;
- } else {
- IChunkAccess ichunkaccess1 = (IChunkAccess) either.left().orElse(null); // Craftbukkit - decompile error
-
- if (ichunkaccess1 != null) {
- this.a(k, ichunkaccess1, ChunkStatus.FULL);
- if (ichunkaccess1 instanceof Chunk) {
- return (Chunk) ichunkaccess1;
- }
- }
-
- return null;
- }
- }
+ return this.getChunkAtIfLoadedMainThread(i, j); // Paper - optimise for loaded chunks
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8a2bb79ad9..abd8b751ba 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -271,6 +271,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@Override
public Chunk getChunkAt(int i, int j) {
+ // Paper start - optimise this for loaded chunks
+ if (Thread.currentThread() == this.serverThread) {
+ Chunk ifLoaded = ((WorldServer) this).getChunkProvider().getChunkAtIfLoadedMainThread(i, j);
+ if (ifLoaded != null) {
+ return ifLoaded;
+ }
+ }
+ // Paper end
return (Chunk) this.getChunkAt(i, j, ChunkStatus.FULL);
}
--
2.25.0.windows.1

View File

@ -106,6 +106,7 @@ done
# dont forget \ at end of each line but last
importLibrary com.mojang authlib com/mojang/authlib yggdrasil/YggdrasilGameProfileRepository.java
importLibrary com.mojang datafixerupper com/mojang/datafixers/util Either.java
########################################################
########################################################