+Date: Sat, 6 Jun 2020 18:13:16 +0200
+Subject: [PATCH] Support components in ItemMeta
+
+
+diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+index 7e0b1d363829031075b6822d7b35ccde9fc05da9..5db838cab09888c3b3537e122e0e381a78e1dbb7 100644
+--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
++++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+@@ -42,6 +42,18 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+ @NotNull
+ String getDisplayName();
+
++ // Paper start
++ /**
++ * Gets the display name that is set.
++ *
++ * Plugins should check that hasDisplayName() returns true
++ * before calling this method.
++ *
++ * @return the display name that is set
++ */
++ @NotNull
++ net.md_5.bungee.api.chat.BaseComponent[] getDisplayNameComponent();
++ // Paper end
+ /**
+ * Sets the display name.
+ *
+@@ -49,6 +61,14 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+ */
+ void setDisplayName(@Nullable String name);
+
++ // Paper start
++ /**
++ * Sets the display name.
++ *
++ * @param component the name component to set
++ */
++ void setDisplayNameComponent(@Nullable net.md_5.bungee.api.chat.BaseComponent[] component);
++ // Paper end
+ /**
+ * Checks for existence of a localized name.
+ *
+@@ -92,6 +112,17 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+ @Nullable
+ List getLore();
+
++ /**
++ * Gets the lore that is set.
++ *
++ * Plugins should check if hasLore() returns true
before
++ * calling this method.
++ *
++ * @return a list of lore that is set
++ */
++ @Nullable
++ List getLoreComponents();
++
+ /**
+ * Sets the lore for this item.
+ * Removes lore when given null.
+@@ -100,6 +131,14 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+ */
+ void setLore(@Nullable List lore);
+
++ /**
++ * Sets the lore for this item.
++ * Removes lore when given null.
++ *
++ * @param lore the lore that will be set
++ */
++ void setLoreComponents(@Nullable List lore);
++
+ /**
+ * Checks for existence of custom model data.
+ *
diff --git a/Spigot-Server-Patches/0001-POM-Changes.patch b/Spigot-Server-Patches/0001-POM-Changes.patch
index d0e2a7092..c0c8c10cb 100644
--- a/Spigot-Server-Patches/0001-POM-Changes.patch
+++ b/Spigot-Server-Patches/0001-POM-Changes.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] POM Changes
diff --git a/pom.xml b/pom.xml
-index 9fc92e347f24a0210a9190513e93cba3b6772557..3554314526b3f33ad02df2adfd42d45118d75526 100644
+index db08e98c60084b16ee18455ce014a6ea305f89c5..52834690de9f07c9c4838dbef50031567c1a72dc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,15 +1,14 @@
@@ -16,7 +16,7 @@ index 9fc92e347f24a0210a9190513e93cba3b6772557..3554314526b3f33ad02df2adfd42d451
- spigot
+ paper
jar
- 1.15.2-R0.1-SNAPSHOT
+ 1.16.1-R0.1-SNAPSHOT
- Spigot
- https://www.spigotmc.org/
+ Paper
@@ -27,7 +27,7 @@ index 9fc92e347f24a0210a9190513e93cba3b6772557..3554314526b3f33ad02df2adfd42d451
+
UTF-8
unknown
- 1.15.2
+ 1.16.1
@@ -19,16 +18,22 @@
@@ -56,7 +56,7 @@ index 9fc92e347f24a0210a9190513e93cba3b6772557..3554314526b3f33ad02df2adfd42d451
compile
@@ -50,6 +55,17 @@
- 7.3.1
+ 8.0.1
compile
+
@@ -190,18 +190,18 @@ index 9fc92e347f24a0210a9190513e93cba3b6772557..3554314526b3f33ad02df2adfd42d451
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 91e2d0b9d9f698f54b49636944a6282adcff5b4b..3fb78997d8c4d913770a9a6a35f34e2c61b896fa 100644
+index 4ac80c20ba970a2078fe62c452e7fdfb8ad0b46e..a5c4b7f28f13f0aad4712912f60ba5fc6785539a 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -186,7 +186,7 @@ public class Main {
}
- if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
+ if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
- Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L);
+ Date buildDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(Main.class.getPackage().getImplementationVendor()); // Paper
Calendar deadline = Calendar.getInstance();
- deadline.add(Calendar.DAY_OF_YEAR, -21);
+ deadline.add(Calendar.DAY_OF_YEAR, -3);
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 93046379d0cefd5d3236fc59e698809acdc18f80..674096cab190d62622f9947853b056f57d43a2a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
diff --git a/Spigot-Server-Patches/0002-Paper-config-files.patch b/Spigot-Server-Patches/0002-Paper-config-files.patch
index f8d47ac48..827cabcf4 100644
--- a/Spigot-Server-Patches/0002-Paper-config-files.patch
+++ b/Spigot-Server-Patches/0002-Paper-config-files.patch
@@ -268,10 +268,10 @@ index 0000000000000000000000000000000000000000..41c79650b169b87fbc70cf502438a545
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
new file mode 100644
-index 0000000000000000000000000000000000000000..273cdb598b3606b962dcc92564c84ad351b7a74f
+index 0000000000000000000000000000000000000000..68d3cb02dbfdc9d6f9d3682a2659c9430b50c490
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
-@@ -0,0 +1,184 @@
+@@ -0,0 +1,185 @@
+package com.destroystokyo.paper;
+
+import com.google.common.base.Throwables;
@@ -291,6 +291,7 @@ index 0000000000000000000000000000000000000000..273cdb598b3606b962dcc92564c84ad3
+import net.minecraft.server.MinecraftServer;
+import org.bukkit.Bukkit;
+import org.bukkit.command.Command;
++import org.bukkit.configuration.ConfigurationSection;
+import org.bukkit.configuration.InvalidConfigurationException;
+import org.bukkit.configuration.file.YamlConfiguration;
+
@@ -530,10 +531,10 @@ index 0000000000000000000000000000000000000000..a738657394bcccd859ef260a801736d4
+ }
+}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-index 87c4b4c6b7793808308c0bfab957f9fd6425f452..beb6b63fa483f0a7b29f5403bebf7ee47b27cd29 100644
+index 062a82c37723b7f032103ba2904877ae79b1ae01..5585b5646b5f3650aa3b795be06f920699a85403 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-@@ -270,15 +270,15 @@ public class ChunkProviderServer extends IChunkProvider {
+@@ -273,15 +273,15 @@ public class ChunkProviderServer extends IChunkProvider {
}
}
@@ -543,27 +544,27 @@ index 87c4b4c6b7793808308c0bfab957f9fd6425f452..beb6b63fa483f0a7b29f5403bebf7ee4
+ @Override public boolean a(Entity entity) {
long i = ChunkCoordIntPair.pair(MathHelper.floor(entity.locX()) >> 4, MathHelper.floor(entity.locZ()) >> 4);
- return this.a(i, PlayerChunk::b);
+ return this.a(i, (Function>>) PlayerChunk::b); // CraftBukkit - decompile error
}
- @Override
- public boolean a(ChunkCoordIntPair chunkcoordintpair) {
+ public final boolean isEntityTickingChunk(ChunkCoordIntPair chunkcoordintpair) { return this.a(chunkcoordintpair); } // Paper - OBFHELPER
+ @Override public boolean a(ChunkCoordIntPair chunkcoordintpair) {
- return this.a(chunkcoordintpair.pair(), PlayerChunk::b);
+ return this.a(chunkcoordintpair.pair(), (Function>>) PlayerChunk::b); // CraftBukkit - decompile error
}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
-index 136d1b50f1cfe71aa5ce1495d9ffdf4a3cbd5aac..9eed98e3796be6d49dc51af9038a7376c94edeee 100644
+index 27e6872c675647d7e61040b76183dac4e347a40c..aa68eb71b131c1d529ded6c651621cfab071b3c4 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
-@@ -170,6 +170,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
- org.spigotmc.SpigotConfig.init((File) options.valueOf("spigot-settings"));
+@@ -148,6 +148,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
+ org.spigotmc.SpigotConfig.init((java.io.File) options.valueOf("spigot-settings"));
org.spigotmc.SpigotConfig.registerCommands();
// Spigot end
+ // Paper start
+ try {
-+ com.destroystokyo.paper.PaperConfig.init((File) options.valueOf("paper-settings"));
++ com.destroystokyo.paper.PaperConfig.init((java.io.File) options.valueOf("paper-settings"));
+ } catch (Exception e) {
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
+ return false;
@@ -571,14 +572,14 @@ index 136d1b50f1cfe71aa5ce1495d9ffdf4a3cbd5aac..9eed98e3796be6d49dc51af9038a7376
+ com.destroystokyo.paper.PaperConfig.registerCommands();
+ // Paper end
- this.setSpawnAnimals(dedicatedserverproperties.spawnAnimals);
- this.setSpawnNPCs(dedicatedserverproperties.spawnNpcs);
+ this.setPVP(dedicatedserverproperties.pvp);
+ this.setAllowFlight(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
-index 9fddbae24c7cb7b24e3899714ced1375b928654f..f4863852b04c5fa55b79acabe40ce59909b9bbbd 100644
+index 4ee11b6fbbb49b1f52fe2cf64f77c1bdd2fd3907..51499ef45faa2bba5f180ee333c09af73d3b708e 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -135,9 +135,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
- private static final DataWatcherObject aC = DataWatcher.a(Entity.class, DataWatcherRegistry.i);
+ private static final DataWatcherObject aA = DataWatcher.a(Entity.class, DataWatcherRegistry.i);
protected static final DataWatcherObject POSE = DataWatcher.a(Entity.class, DataWatcherRegistry.s);
public boolean inChunk;
- public int chunkX;
@@ -587,23 +588,23 @@ index 9fddbae24c7cb7b24e3899714ced1375b928654f..f4863852b04c5fa55b79acabe40ce599
+ public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER
+ public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER
+ public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER
+ private boolean aB;
public long Z;
public long aa;
- public long ab;
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
-index 158cc1beb2d6b00642d025a5dd6797c4a20464bd..29e776ca19621b93d5b295d12f0576e6980cf11a 100644
+index 62f62c2c98fbaff163d9079091e6f39db2d77fa0..484e78746aa62bb0b12968165bf8e056b27152f3 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
-@@ -3,6 +3,7 @@ package net.minecraft.server;
- import com.mojang.datafixers.DataFixUtils;
- import java.util.Collections;
+@@ -2,6 +2,7 @@ package net.minecraft.server;
+
+ import com.google.common.collect.ImmutableSet;
import java.util.Optional;
+import java.util.Set; // Paper
import java.util.UUID;
import java.util.function.Function;
import java.util.stream.Stream;
-@@ -435,4 +436,10 @@ public class EntityTypes {
- return new EntityTypes<>(this.a, this.b, this.c, this.d, this.e, this.f, this.g);
+@@ -463,4 +464,10 @@ public class EntityTypes {
+ return new EntityTypes<>(this.a, this.b, this.d, this.e, this.f, this.g, this.c, this.j, this.h, this.i);
}
}
+
@@ -614,10 +615,10 @@ index 158cc1beb2d6b00642d025a5dd6797c4a20464bd..29e776ca19621b93d5b295d12f0576e6
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
-index ad43b48073f5d59e6f6b5b2ec3de8cc9f03f9956..2e1eabba14a3757d03fd90741651001e78c6322f 100644
+index d5e1da2eeea7c06289f52509af844df59e8a29b2..63d3d43f74bed94cd03aa3b7254e66302be861d5 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
-@@ -70,6 +70,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
+@@ -77,6 +77,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public boolean populating;
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
@@ -626,27 +627,27 @@ index ad43b48073f5d59e6f6b5b2ec3de8cc9f03f9956..2e1eabba14a3757d03fd90741651001e
public final SpigotTimings.WorldTimingsHandler timings; // Spigot
public static BlockPosition lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter;
-@@ -90,6 +92,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
+@@ -93,6 +95,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
- protected World(WorldData worlddata, DimensionManager dimensionmanager, BiFunction bifunction, GameProfilerFiller gameprofilerfiller, boolean flag, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
- this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot
+ protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
+ this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot
+ this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper
this.generator = gen;
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-index be30f6bf6a978dfe14af1aca1099cb9a6f7ab443..ad1dcf53040695a1b3194efa92b549172bea56ec 100644
+index d05c57ce64b7d880ffd7dbd387d56f05f05cd3f0..239fa2404859d233161764cceec5cd0fc37899b9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
-@@ -769,6 +769,7 @@ public final class CraftServer implements Server {
+@@ -803,6 +803,7 @@ public final class CraftServer implements Server {
}
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
+ com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper
for (WorldServer world : console.getWorlds()) {
- world.worldData.setDifficulty(config.difficulty);
+ world.worldDataServer.setDifficulty(config.difficulty);
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
-@@ -796,6 +797,7 @@ public final class CraftServer implements Server {
+@@ -836,6 +837,7 @@ public final class CraftServer implements Server {
world.ticksPerAmbientSpawns = this.getTicksPerAmbientSpawns();
}
world.spigotConfig.init(); // Spigot
@@ -654,7 +655,7 @@ index be30f6bf6a978dfe14af1aca1099cb9a6f7ab443..ad1dcf53040695a1b3194efa92b54917
}
pluginManager.clearPlugins();
-@@ -803,6 +805,7 @@ public final class CraftServer implements Server {
+@@ -843,6 +845,7 @@ public final class CraftServer implements Server {
resetRecipes();
reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
@@ -662,7 +663,7 @@ index be30f6bf6a978dfe14af1aca1099cb9a6f7ab443..ad1dcf53040695a1b3194efa92b54917
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions");
-@@ -2000,4 +2003,35 @@ public final class CraftServer implements Server {
+@@ -2079,4 +2082,35 @@ public final class CraftServer implements Server {
{
return spigot;
}
@@ -699,7 +700,7 @@ index be30f6bf6a978dfe14af1aca1099cb9a6f7ab443..ad1dcf53040695a1b3194efa92b54917
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
-index 3fb78997d8c4d913770a9a6a35f34e2c61b896fa..daa65aaf8c9616e5e058f3337fc4fc0895d13364 100644
+index a5c4b7f28f13f0aad4712912f60ba5fc6785539a..3d15661eb1f15f74213ecb7e8eceb1f231ad2c1c 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -129,6 +129,14 @@ public class Main {
@@ -718,7 +719,7 @@ index 3fb78997d8c4d913770a9a6a35f34e2c61b896fa..daa65aaf8c9616e5e058f3337fc4fc08
};
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
-index a52cbba6e681bc96a15a3eea62831a1628f921a7..98ed975a6241395b6119d5b3a62d24329aa1f05b 100644
+index 0005d4226467cc25b55f9863eb5b7aaeb4dd6917..5c394d26e2d2dbc5d65e38c1273b7e5d02464f3a 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -39,36 +39,36 @@ public class SpigotWorldConfig
diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch
index 315c5c35b..4a58b7cc1 100644
--- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch
+++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch
@@ -49,111 +49,224 @@ index a3afe60b0d85cf90bf7a170dc0a0b61a796381a7..85f799a713db0c822d46b689010f9f6b
} else {
System.arraycopy(this.b, 0, au, 0, this.c);
if (au.length > this.c) {
-diff --git a/src/main/java/net/minecraft/server/BehaviorFindPosition.java b/src/main/java/net/minecraft/server/BehaviorFindPosition.java
-index 37006ec1bbb8fa285257edacdf337591595852a2..35eb3a5a61145e94d5b0c77c0eb13bfa46fac23b 100644
---- a/src/main/java/net/minecraft/server/BehaviorFindPosition.java
-+++ b/src/main/java/net/minecraft/server/BehaviorFindPosition.java
-@@ -53,7 +53,7 @@ public class BehaviorFindPosition extends Behavior {
- villageplace.a(this.a.c(), (blockposition1) -> {
- return blockposition1.equals(blockposition);
- }, blockposition, 1);
-- entitycreature.getBehaviorController().setMemory(this.b, (Object) GlobalPos.create(worldserver.getWorldProvider().getDimensionManager(), blockposition));
-+ entitycreature.getBehaviorController().setMemory(this.b, GlobalPos.create(worldserver.getWorldProvider().getDimensionManager(), blockposition));
- PacketDebug.c(worldserver, blockposition);
- });
- } else if (this.f < 5) {
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
-index 960dce23072bbb5fad36760677f0fe2efb661552..253890e53702f9ba1c6628cc860a4ca10756626a 100644
+index 6c2ed9c1b8567abcdb11bdc3dbaeed217a2f61e7..ae0ac8d383ca11a683465d8c83a8b8a66e567079 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 {
+@@ -26,76 +26,31 @@ import org.apache.logging.log4j.Logger;
+ public class BiomeBase {
+
+ public static final Logger LOGGER = LogManager.getLogger();
+- public static final Codec b = RecordCodecBuilder.create((instance) -> {
+- RecordCodecBuilder recordcodecbuilder = BiomeBase.Precipitation.d.fieldOf("precipitation").forGetter((biomebase) -> {
+- return biomebase.o;
+- });
+- RecordCodecBuilder recordcodecbuilder1 = BiomeBase.Geography.r.fieldOf("category").forGetter((biomebase) -> {
+- return biomebase.n;
+- });
+- RecordCodecBuilder recordcodecbuilder2 = Codec.FLOAT.fieldOf("depth").forGetter((biomebase) -> {
+- return biomebase.h;
+- });
+- RecordCodecBuilder recordcodecbuilder3 = Codec.FLOAT.fieldOf("scale").forGetter((biomebase) -> {
+- return biomebase.i;
+- });
+- RecordCodecBuilder recordcodecbuilder4 = Codec.FLOAT.fieldOf("temperature").forGetter((biomebase) -> {
+- return biomebase.j;
+- });
+- RecordCodecBuilder recordcodecbuilder5 = Codec.FLOAT.fieldOf("downfall").forGetter((biomebase) -> {
+- return biomebase.k;
+- });
+- RecordCodecBuilder recordcodecbuilder6 = BiomeFog.a.fieldOf("effects").forGetter((biomebase) -> {
+- return biomebase.p;
+- });
+- RecordCodecBuilder recordcodecbuilder7 = Codec.INT.fieldOf("sky_color").forGetter((biomebase) -> {
+- return biomebase.t;
+- });
+- RecordCodecBuilder recordcodecbuilder8 = WorldGenSurfaceComposite.a.fieldOf("surface_builder").forGetter((biomebase) -> {
+- return biomebase.m;
+- });
+- Codec codec = WorldGenStage.Features.c;
+- Codec codec1 = WorldGenCarverWrapper.a.listOf();
+- Logger logger = BiomeBase.LOGGER;
+-
+- logger.getClass();
+- RecordCodecBuilder recordcodecbuilder9 = Codec.simpleMap(codec, codec1.promotePartial(SystemUtils.a("Carver: ", logger::error)), INamable.a(WorldGenStage.Features.values())).fieldOf("carvers").forGetter((biomebase) -> {
+- return biomebase.q;
+- });
+-
+- codec1 = WorldGenStage.Decoration.k;
+- Codec codec2 = WorldGenFeatureConfigured.b.listOf();
+- Logger logger1 = BiomeBase.LOGGER;
+-
+- logger1.getClass();
+- RecordCodecBuilder recordcodecbuilder10 = Codec.simpleMap(codec1, codec2.promotePartial(SystemUtils.a("Feature: ", logger1::error)), INamable.a(WorldGenStage.Decoration.values())).fieldOf("features").forGetter((biomebase) -> {
+- return biomebase.r;
+- });
+-
+- codec2 = StructureFeature.a.listOf();
+- logger1 = BiomeBase.LOGGER;
+- logger1.getClass();
+- RecordCodecBuilder recordcodecbuilder11 = codec2.promotePartial(SystemUtils.a("Structure start: ", logger1::error)).fieldOf("starts").forGetter((biomebase) -> {
+- return (List) biomebase.u.values().stream().sorted(Comparator.comparing((structurefeature) -> {
+- return IRegistry.STRUCTURE_FEATURE.getKey(structurefeature.b);
+- })).collect(Collectors.toList());
+- });
+- Codec codec3 = EnumCreatureType.g;
+- Codec codec4 = BiomeBase.BiomeMeta.b.listOf();
+- Logger logger2 = BiomeBase.LOGGER;
+-
+- logger2.getClass();
+- return instance.group(recordcodecbuilder, recordcodecbuilder1, recordcodecbuilder2, recordcodecbuilder3, recordcodecbuilder4, recordcodecbuilder5, recordcodecbuilder6, recordcodecbuilder7, recordcodecbuilder8, recordcodecbuilder9, recordcodecbuilder10, recordcodecbuilder11, Codec.simpleMap(codec3, codec4.promotePartial(SystemUtils.a("Spawn data: ", logger2::error)), INamable.a(EnumCreatureType.values())).fieldOf("spawners").forGetter((biomebase) -> {
+- return biomebase.v;
+- }), BiomeBase.d.a.listOf().fieldOf("climate_parameters").forGetter((biomebase) -> {
+- return biomebase.x;
+- }), Codec.STRING.optionalFieldOf("parent").forGetter((biomebase) -> {
+- return Optional.ofNullable(biomebase.l);
+- })).apply(instance, BiomeBase::new);
++ // Paper decompile error - Spigots stupid decompiler
++ public static final Codec b = RecordCodecBuilder.create(i -> {
++ Codec k1 = WorldGenStage.Decoration.k; // Erase type - WorldGenstage.Decoration has wrong type
++ return i.group(
++ Precipitation.d.fieldOf("precipitation").forGetter(biome -> biome.o),
++ Geography.r.fieldOf("category").forGetter(biome -> biome.n),
++ Codec.FLOAT.fieldOf("depth").forGetter(biome -> biome.h),
++ Codec.FLOAT.fieldOf("scale").forGetter(biome -> biome.i),
++ Codec.FLOAT.fieldOf("temperature").forGetter(biome -> biome.j),
++ Codec.FLOAT.fieldOf("downfall").forGetter(biome -> biome.k),
++ BiomeFog.a.fieldOf("effects").forGetter(biome -> biome.p),
++ Codec.INT.fieldOf("sky_color").forGetter(biome -> biome.t),
++ WorldGenSurfaceComposite.a.fieldOf("surface_builder").forGetter(biome -> biome.m),
++ Codec.simpleMap(WorldGenStage.Features.c, WorldGenCarverWrapper.a.listOf().promotePartial(SystemUtils.a("Carver: ", LOGGER::error)), INamable.a(WorldGenStage.Features.values())).fieldOf("carvers").forGetter(biome -> biome.q),
++ Codec.simpleMap((Codec) k1, WorldGenFeatureConfigured.b.listOf().promotePartial(SystemUtils.a("Feature: ", LOGGER::error)), INamable.a(WorldGenStage.Decoration.values())).fieldOf("features").forGetter(biome -> biome.r),
++ StructureFeature.a.listOf().promotePartial(SystemUtils.a("Structure start: ", LOGGER::error)).fieldOf("starts").forGetter(biome -> biome.u.values().stream().sorted(Comparator.comparing(cf -> IRegistry.STRUCTURE_FEATURE.getKey(cf.b))).collect(Collectors.toList())),
++ Codec.simpleMap(EnumCreatureType.g, BiomeMeta.b.listOf().promotePartial(SystemUtils.a("Spawn data: ", LOGGER::error)), INamable.a(EnumCreatureType.values())).fieldOf("spawners").forGetter(biome -> biome.v),
++ d.a.listOf().fieldOf("climate_parameters").forGetter(biome -> biome.x),
++ Codec.STRING.optionalFieldOf("parent").forGetter(biome -> Optional.ofNullable(biome.l))
++ ).apply(i, BiomeBase::new);
++ // Paper end
+ });
+ public static final Set c = Sets.newHashSet();
+- public static final RegistryBlockID d = new RegistryBlockID<>();
+- protected static final NoiseGenerator3 e = new NoiseGenerator3(new SeededRandom(1234L), ImmutableList.of(0));
++ public static final RegistryBlockID reg = new RegistryBlockID<>(); // Paper - decompile error - rename
++ protected static final NoiseGenerator3 NOISE_GENERATOR_3 = new NoiseGenerator3(new SeededRandom(1234L), ImmutableList.of(0)); // Paper - decompile error - rename
+ public static final NoiseGenerator3 f = new NoiseGenerator3(new SeededRandom(2345L), ImmutableList.of(0));
+ @Nullable
+ protected String g;
+@@ -130,7 +85,7 @@ public class BiomeBase {
@Nullable
public static BiomeBase a(BiomeBase biomebase) {
-- return (BiomeBase) BiomeBase.c.fromId(IRegistry.BIOME.a((Object) biomebase));
-+ return (BiomeBase) BiomeBase.c.fromId(IRegistry.BIOME.a(biomebase)); // Paper - decompile fix
+- return (BiomeBase) BiomeBase.d.fromId(IRegistry.BIOME.a((Object) biomebase));
++ return (BiomeBase) BiomeBase.reg.fromId(IRegistry.BIOME.a(biomebase)); // Paper - decompile fix / rename
}
public static WorldGenCarverWrapper a(WorldGenCarverAbstract worldgencarverabstract, C c0) {
-@@ -236,7 +236,7 @@ public abstract class BiomeBase {
+@@ -197,7 +152,7 @@ public class BiomeBase {
+ }, Function.identity()));
+ this.v = map2;
+ this.x = list1;
+- this.l = (String) optional.orElse((Object) null);
++ this.l = (String) optional.orElse(null); // Paper - decompile fix
+ Stream stream = map1.values().stream().flatMap(Collection::stream).filter((worldgenfeatureconfigured) -> {
+ return worldgenfeatureconfigured.d == WorldGenerator.DECORATED_FLOWER;
+ });
+@@ -250,7 +205,7 @@ public class BiomeBase {
- @Nullable
- public C b(StructureGenerator structuregenerator) {
-- return (WorldGenFeatureConfiguration) this.t.get(structuregenerator);
-+ return (C) this.t.get(structuregenerator); // Paper - decompile fix
- }
+ protected float a(BlockPosition blockposition) {
+ if (blockposition.getY() > 64) {
+- float f = (float) (BiomeBase.e.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D);
++ float f = (float) (BiomeBase.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - decompile error - rename
- public List> g() {
-diff --git a/src/main/java/net/minecraft/server/BlockDataAbstract.java b/src/main/java/net/minecraft/server/BlockDataAbstract.java
-index ab03b556823a3daee07cc6a57112d01ee52b677f..1cf97cefc9d113583214f340e72b35d5560d1e5d 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 implements IBlockDataHolder {
- }
-
- private > String a(IBlockState iblockstate, Comparable> comparable) {
-- return iblockstate.a(comparable);
-+ return iblockstate.a((T) comparable); // Paper - decompiler fix
- }
- };
- protected final O a;
-@@ -42,11 +42,11 @@ public abstract class BlockDataAbstract implements IBlockDataHolder {
- }
-
- public > S a(IBlockState iblockstate) {
-- return this.set(iblockstate, (Comparable) a(iblockstate.getValues(), this.get(iblockstate)));
-+ return this.set(iblockstate, a(iblockstate.getValues(), this.get(iblockstate))); // Paper - decompile fix
- }
-
- protected static T a(Collection collection, T t0) {
-- Iterator iterator = collection.iterator();
-+ Iterator iterator = collection.iterator(); // Paper - decompiler fix
-
- do {
- if (!iterator.hasNext()) {
-@@ -89,7 +89,7 @@ public abstract class BlockDataAbstract implements IBlockDataHolder {
- if (comparable == null) {
- throw new IllegalArgumentException("Cannot get property " + iblockstate + " as it does not exist in " + this.a);
+ return this.getTemperature() - (f + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F;
} else {
-- return (Comparable) iblockstate.b().cast(comparable);
-+ return iblockstate.b().cast(comparable); // Paper - decompiler fix
+diff --git a/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java b/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java
+index 2ac69bf2ae5cbb763fc95c948725373a5c9b95b3..fdc66fc1e3440b6678a1318e9a109f2b41bc8847 100644
+--- a/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java
++++ b/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java
+@@ -58,7 +58,7 @@ public class BiomeFrozenDeepOcean extends BiomeBase {
}
- }
-@@ -100,7 +100,7 @@ public abstract class BlockDataAbstract implements IBlockDataHolder {
- if (comparable == null) {
- throw new IllegalArgumentException("Cannot set property " + iblockstate + " as it does not exist in " + this.a);
- } else if (comparable == v0) {
-- return this;
-+ return (S) this; // Paper - decompiler fix
+ if (blockposition.getY() > 64) {
+- float f1 = (float) (BiomeFrozenDeepOcean.e.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D);
++ float f1 = (float) (BiomeFrozenDeepOcean.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - rename
+
+ return f - (f1 + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F;
} else {
- S s0 = this.e.get(iblockstate, v0);
+diff --git a/src/main/java/net/minecraft/server/BiomeFrozenOcean.java b/src/main/java/net/minecraft/server/BiomeFrozenOcean.java
+index 0d0ccaec8c497c9d222c7593684ed2d913d1881e..4b18e29ccb0cb15568367abb507b844011bd7f80 100644
+--- a/src/main/java/net/minecraft/server/BiomeFrozenOcean.java
++++ b/src/main/java/net/minecraft/server/BiomeFrozenOcean.java
+@@ -57,7 +57,7 @@ public final class BiomeFrozenOcean extends BiomeBase {
+ }
+ if (blockposition.getY() > 64) {
+- float f1 = (float) (BiomeFrozenOcean.e.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D);
++ float f1 = (float) (BiomeFrozenOcean.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - rename
+
+ return f - (f1 + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F;
+ } else {
+diff --git a/src/main/java/net/minecraft/server/Biomes.java b/src/main/java/net/minecraft/server/Biomes.java
+index 0aa66addb2cb472b2ab90000d3f0e0f967353e0f..eaa527f4fe289a9492b12591154a60e5aa045252 100644
+--- a/src/main/java/net/minecraft/server/Biomes.java
++++ b/src/main/java/net/minecraft/server/Biomes.java
+@@ -88,7 +88,7 @@ public abstract class Biomes {
+ private static BiomeBase a(int i, String s, BiomeBase biomebase) {
+ IRegistry.a(IRegistry.BIOME, i, s, biomebase);
+ if (biomebase.b()) {
+- BiomeBase.d.a(biomebase, IRegistry.BIOME.a(IRegistry.BIOME.get(new MinecraftKey(biomebase.l))));
++ BiomeBase.reg.a(biomebase, IRegistry.BIOME.a(IRegistry.BIOME.get(new MinecraftKey(biomebase.l))));
+ }
+
+ return biomebase;
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
-index e40f9c153b4f1f8f11ea467e6bd8e670959282d6..c88a62f6b72a8851b95587bb49c898569d74e0c6 100644
+index 8eb94bcb605f882c9ce096fc758df5e3ae3ab28d..886b43e2b8f21c358b4d6785c677f14c91d191f3 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
- OfInt ofint = dynamic.asIntStream().spliterator();
- int[] aint = new int[3];
+@@ -220,8 +220,8 @@ public class BlockPosition extends BaseBlockPosition {
+ };
+ }
-- if (ofint.tryAdvance((i) -> {
-+ if (ofint.tryAdvance((Consumer super Integer>) (i) -> { // Paper - decomile fix
- aint[0] = i;
-- }) && ofint.tryAdvance((i) -> {
-+ }) && ofint.tryAdvance((Consumer super Integer>) (i) -> { // Paper - decompile fix
- aint[1] = i;
- })) {
-- ofint.tryAdvance((i) -> {
-+ ofint.tryAdvance((Consumer super Integer>) (i) -> { // Paper - decompile fix
- aint[2] = i;
- });
- }
+- public static Iterable a(BlockPosition blockposition, int i, int j, int k) {
+- int l = i + j + k;
++ public static Iterable a(BlockPosition blockposition, int p_i, int p_j, int p_k) { // Paper - decompile issues - variable name conflicts to inner class field refs
++ int l_decompiled = p_i + p_j + p_k; // Paper - decompile issues
+ int i1 = blockposition.getX();
+ int j1 = blockposition.getY();
+ int k1 = blockposition.getZ();
+@@ -249,15 +249,15 @@ public class BlockPosition extends BaseBlockPosition {
+ ++this.l;
+ if (this.l > this.j) {
+ ++this.i;
+- if (this.i > l) {
++ if (this.i > l_decompiled) { // Paper - use proper l above (first line of this method)
+ return (BlockPosition) this.endOfData();
+ }
+
+- this.j = Math.min(i, this.i);
++ this.j = Math.min(p_i, this.i); // Paper - decompile issues
+ this.l = -this.j;
+ }
+
+- this.k = Math.min(j, this.i - Math.abs(this.l));
++ this.k = Math.min(p_j, this.i - Math.abs(this.l)); // Paper - decompile issues
+ this.m = -this.k;
+ }
+
+@@ -265,7 +265,7 @@ public class BlockPosition extends BaseBlockPosition {
+ int i2 = this.m;
+ int j2 = this.i - Math.abs(l1) - Math.abs(i2);
+
+- if (j2 <= k) {
++ if (j2 <= p_k) { // Paper - decompile issues
+ this.n = j2 != 0;
+ blockposition_mutableblockposition = this.h.d(i1 + l1, j1 + i2, k1 + j2);
+ }
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
-index 28cfbaae287653d21e06f0017396b937e99fc3ad..1486d460c8ec3d117b4dc3d28b2c3f1b632e187b 100644
+index 771841e08591955e61c7bcc5b09c8457652c1b9c..8162c11d14b8e88c2b572f9ddf6b7a15977047f8 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 & INamable> extends BlockState
+@@ -20,10 +20,10 @@ public class BlockStateEnum & INamable> extends IBlockState
protected BlockStateEnum(String s, Class oclass, Collection collection) {
super(s, oclass);
this.a = ImmutableSet.copyOf(collection);
@@ -166,24 +279,11 @@ index 28cfbaae287653d21e06f0017396b937e99fc3ad..1486d460c8ec3d117b4dc3d28b2c3f1b
String s1 = ((INamable) t0).getName();
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 68a601bac587294b46a79be6df7ee4e6e38e5f28..efdf611e66ffd782291de749d8a48f3bf08f2129 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 {
- return (CompletableFuture) function.apply(ichunkaccess);
- });
- private static final List q = ImmutableList.of(ChunkStatus.FULL, ChunkStatus.FEATURES, ChunkStatus.LIQUID_CARVERS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS);
-- private static final IntList r = (IntList) SystemUtils.a((Object) (new IntArrayList(a().size())), (intarraylist) -> {
-+ private static final IntList r = (IntList) SystemUtils.a((new IntArrayList(a().size())), (java.util.function.Consumer)(IntArrayList intarraylist) -> { // Paper - decompile fix
- int i = 0;
-
- 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 ca9ed573914558d51318c713b14665480efdc5bf..f0d7a91fa06632d5731e277a9199aa9804d3a96a 100644
+index fbb708f5f7e4d2da9d96b595498da436b088a408..f27c7041cdc2f062f0abb222b02026194ab33c60 100644
--- a/src/main/java/net/minecraft/server/CraftingManager.java
+++ b/src/main/java/net/minecraft/server/CraftingManager.java
-@@ -63,7 +63,7 @@ public class CraftingManager extends ResourceDataJson {
+@@ -64,7 +64,7 @@ public class CraftingManager extends ResourceDataJson {
}
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
@@ -193,7 +293,7 @@ index ca9ed573914558d51318c713b14665480efdc5bf..f0d7a91fa06632d5731e277a9199aa98
CraftingManager.LOGGER.info("Loaded {} recipes", map1.size());
}
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
-index 7d44348c78b0e468cef5c137d3a69aeb5704d881..73ecdd22ea1157abe00795d90c3e7b748650dbc8 100644
+index 4ab6e82a1415c40f3e2eee7414bf7de97f53b420..9c152b79164710d3d4175d0acbc9548d61390097 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 {
@@ -205,21 +305,8 @@ index 7d44348c78b0e468cef5c137d3a69aeb5704d881..73ecdd22ea1157abe00795d90c3e7b74
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 035f05e82769445f213c225a731db6d95626f6cd..7c9ba128620f54c9cd691d350d1ee225d867fe70 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 {
- 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 447f6a55b619402447b5cf4db9b22ea8cfc7d51d..1890c760f9ffd7628d6ae3db40c36f5272379227 100644
+index 8886cedfe8809fe4711b5f2451e3e6456d2a6513..b77a0f0c2ee30df44b113aa6c8d4fa9206d3e2ba 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 implements Mailbox implements
+diff --git a/src/main/java/net/minecraft/server/IBlockState.java b/src/main/java/net/minecraft/server/IBlockState.java
+index 88f1f201240ef0479c4f0f93f4caca454bbe7e9e..d63a4e4916ed5f5d901be0f4dd2c13cf66239055 100644
+--- a/src/main/java/net/minecraft/server/IBlockState.java
++++ b/src/main/java/net/minecraft/server/IBlockState.java
+@@ -16,12 +16,10 @@ public abstract class IBlockState> {
+ private final Codec> e;
- public static Dynamic a(DynamicOps dynamicops, IBlockData iblockdata) {
- ImmutableMap, Comparable>> immutablemap = iblockdata.getStateMap();
-- Object object;
-+ T object; // Paper - decompile fix
-
- if (immutablemap.isEmpty()) {
- object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString())));
- } else {
-- object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString()), dynamicops.createString("Properties"), dynamicops.createMap((Map) immutablemap.entrySet().stream().map((entry) -> {
-+ object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).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)))));
- }
-@@ -348,9 +348,9 @@ public class IBlockData extends BlockDataAbstract implements
- if (!iblockdata.o()) {
- this.f = null;
- } else {
-- this.f = new VoxelShape[IBlockData.a.a.length];
-+ this.f = new VoxelShape[a.length]; // Paper - decompile fix
- VoxelShape voxelshape = block.i(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO);
-- EnumDirection[] aenumdirection = IBlockData.a.a;
-+ EnumDirection[] aenumdirection = a; // Paper - decompile fix
-
- i = aenumdirection.length;
-
-@@ -366,7 +366,7 @@ public class IBlockData extends BlockDataAbstract implements
- return this.g.b(enumdirection_enumaxis) < 0.0D || this.g.c(enumdirection_enumaxis) > 1.0D;
- });
- this.i = new boolean[6];
-- EnumDirection[] aenumdirection1 = IBlockData.a.a;
-+ EnumDirection[] aenumdirection1 = a; // Paper - decompile fix
- int k = aenumdirection1.length;
-
- for (i = 0; i < k; ++i) {
+ protected IBlockState(String s, Class oclass) {
+- this.d = Codec.STRING.comapFlatMap((s1) -> {
+- return (DataResult) this.b(s1).map(DataResult::success).orElseGet(() -> {
+- return DataResult.error("Unable to read property: " + this + " with value: " + s1);
+- });
+- }, this::a);
+- this.e = this.d.xmap(this::b, IBlockState.a::b);
++ this.d = Codec.STRING.comapFlatMap((s1) -> this.b(s1).map(DataResult::success).orElseGet(() -> { // Paper - decompile error
++ return DataResult.error("Unable to read property: " + this + " with value: " + s1);
++ }), this::a);
++ this.e = this.d.xmap(this::b, (IBlockState.a param) -> param.b()); // Paper - decompile fix
+ this.a = oclass;
+ this.b = s;
+ }
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
-index 534e70671a624e58ed98df9dd62bd7f5ffdf91af..d5c284cdd10d33f5f1b7f456d6a384a44eafb139 100644
+index 2517b70ddeb985ae7d708c6a1708b42c6a67dd00..c469b5db81fb040fc27cd2e4f7cd61797f56a62d 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 {
- return Stream.empty();
- } else {
- AxisAlignedBB axisalignedbb1 = axisalignedbb.g(1.0E-7D);
-- Stream stream = this.getEntities(entity, axisalignedbb1).stream().filter((entity1) -> {
-+ Stream stream = this.getEntities(entity, axisalignedbb1).stream().filter((entity1) -> { // Paper - decompile fix
- return !set.contains(entity1);
- }).filter((entity1) -> {
- return entity == null || !entity.isSameVehicle(entity1);
-@@ -55,7 +55,6 @@ public interface IEntityAccess {
- return Stream.of(entity1.au(), entity == null ? null : entity.j(entity1));
- }).filter(Objects::nonNull);
-
-- axisalignedbb1.getClass();
- return stream.filter(axisalignedbb1::c).map(VoxelShapes::a);
- }
- }
-@@ -157,22 +156,22 @@ public interface IEntityAccess {
+@@ -150,22 +150,22 @@ public interface IEntityAccess {
@Nullable
default T a(Class extends T> oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) {
@@ -336,7 +387,7 @@ index 534e70671a624e58ed98df9dd62bd7f5ffdf91af..d5c284cdd10d33f5f1b7f456d6a384a4
if (pathfindertargetcondition.a(entityliving, t1)) {
double d4 = t1.g(d0, d1, d2);
-@@ -205,10 +204,10 @@ public interface IEntityAccess {
+@@ -198,10 +198,10 @@ public interface IEntityAccess {
default List a(Class extends T> oclass, PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, AxisAlignedBB axisalignedbb) {
List list = this.a(oclass, axisalignedbb, (Predicate) null);
List list1 = Lists.newArrayList();
@@ -350,45 +401,34 @@ index 534e70671a624e58ed98df9dd62bd7f5ffdf91af..d5c284cdd10d33f5f1b7f456d6a384a4
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 a986f2912fc04a7fdd49d648cbcd570464597937..c5658c0779b0e0d51fd4921456b6fef0711d7be3 100644
+index c5a95f51ba43b94fd07f8df6576f45c3dd0216a3..38ccfd78639a85abcefb915c5c231be5881cebc1 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 {
- if (throwable != null) {
- completablefuture.completeExceptionally(throwable);
- } else {
-- completablefuture.complete((Object) null);
-+ completablefuture.complete(null); // Paper - Decompile fix
- }
+@@ -83,7 +83,7 @@ public class IOWorker implements AutoCloseable {
+ return this.a(() -> {
+ try {
+ this.d.a();
+- return Either.left((Object) null);
++ return Either.left(null); // Paper - decompile error
+ } catch (Exception exception) {
+ IOWorker.LOGGER.warn("Failed to synchronized chunks", exception);
+ return Either.right(exception);
+@@ -117,13 +117,13 @@ public class IOWorker implements AutoCloseable {
+ }
- });
-@@ -106,7 +106,7 @@ public class IOWorker implements AutoCloseable {
- }));
+ private void c() {
+- this.c.a((Object) (new PairedQueue.b(IOWorker.Priority.LOW.ordinal(), this::b)));
++ this.c.a((new PairedQueue.b(IOWorker.Priority.LOW.ordinal(), this::b))); // Paper - decompile error
+ }
- completablefuture1.whenComplete((object, throwable) -> {
-- completablefuture.complete((Object) null);
-+ completablefuture.complete(null); // Paper - decompile fix
- });
- };
- });
-@@ -165,7 +165,7 @@ public class IOWorker implements AutoCloseable {
private void a(ChunkCoordIntPair chunkcoordintpair, IOWorker.a ioworker_a) {
try {
- this.e.write(chunkcoordintpair, ioworker_a.a);
+ this.d.write(chunkcoordintpair, ioworker_a.a);
- ioworker_a.b.complete((Object) null);
+ ioworker_a.b.complete(null); // Paper - decompile fix
} catch (Exception exception) {
IOWorker.LOGGER.error("Failed to store chunk {}", chunkcoordintpair, exception);
ioworker_a.b.completeExceptionally(exception);
-@@ -176,7 +176,7 @@ public class IOWorker implements AutoCloseable {
- private void g() {
- try {
- this.e.close();
-- this.h.complete((Object) null);
-+ this.h.complete(null); // Paper - decompile fix
- } 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 1e1f7ec6e6e6fc698a8a5118ce21321d104dc5eb..75d9065b32731dc635d9d09c48fb9643172381a9 100644
--- a/src/main/java/net/minecraft/server/LightEngineStorageSky.java
@@ -407,18 +447,9 @@ index 1e1f7ec6e6e6fc698a8a5118ce21321d104dc5eb..75d9065b32731dc635d9d09c48fb9643
++k;
if (k >= l) {
diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java
-index ef315377579ca425ecb8d41aaf59eb1dd5b39e12..8776799de033f02b0f87e9ea7e4a4ce912e94dd4 100644
+index 8b1f9116afd92b13426eb0e97066297705d202fb..a9dc8466278f9ec2becbcb643e6e1c973df72b82 100644
--- a/src/main/java/net/minecraft/server/LightEngineThreaded.java
+++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java
-@@ -110,7 +110,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
- }
-
- private void a(int i, int j, IntSupplier intsupplier, LightEngineThreaded.Update lightenginethreaded_update, Runnable runnable) {
-- this.e.a((Object) ChunkTaskQueueSorter.a(() -> {
-+ this.e.a(ChunkTaskQueueSorter.a(() -> { // Paper - decompile error
- this.c.add(Pair.of(lightenginethreaded_update, runnable));
- if (this.c.size() >= this.f) {
- this.b();
@@ -167,7 +167,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable {
public void queueUpdate() {
@@ -428,24 +459,37 @@ index ef315377579ca425ecb8d41aaf59eb1dd5b39e12..8776799de033f02b0f87e9ea7e4a4ce9
this.b();
this.g.set(false);
}));
+diff --git a/src/main/java/net/minecraft/server/LootEntryAbstract.java b/src/main/java/net/minecraft/server/LootEntryAbstract.java
+index 8cc8c60d3297a4ed98f3950a3971d83499ad1dfa..788078c209b8bcbd551cf0a52eb6172928d7b5f9 100644
+--- a/src/main/java/net/minecraft/server/LootEntryAbstract.java
++++ b/src/main/java/net/minecraft/server/LootEntryAbstract.java
+@@ -36,7 +36,7 @@ public abstract class LootEntryAbstract implements LootEntryChildren {
+
+ // CraftBukkit start
+ @Override
+- public final void a(JsonObject jsonobject, T t0, JsonSerializationContext jsonserializationcontext) {
++ public void a(JsonObject jsonobject, T t0, JsonSerializationContext jsonserializationcontext) { // Paper - remove final
+ if (!org.apache.commons.lang3.ArrayUtils.isEmpty(t0.d)) {
+ jsonobject.add("conditions", jsonserializationcontext.serialize(t0.d));
+ }
diff --git a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java
-index fa11b2fc6364dc6fb6a951e092ea01f5e74c2c1d..5fe0da76bd172c2c552b2dd210e89be214c4385c 100644
+index 3aa5cc4281cdba8738890e9ffd5c7a129e60c310..32a98e758b9df48005ddc5283eacdc5123a32c39 100644
--- a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java
+++ b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java
-@@ -69,7 +69,7 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional
- }
+@@ -73,7 +73,7 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional
+ public b() {}
public void a(JsonObject jsonobject, LootItemFunctionExplorationMap lootitemfunctionexplorationmap, JsonSerializationContext jsonserializationcontext) {
- super.a(jsonobject, (LootItemFunctionConditional) lootitemfunctionexplorationmap, jsonserializationcontext);
+ super.a(jsonobject, lootitemfunctionexplorationmap, jsonserializationcontext); // Paper - decompile fix
- if (!lootitemfunctionexplorationmap.d.equals("Buried_Treasure")) {
- jsonobject.add("destination", jsonserializationcontext.serialize(lootitemfunctionexplorationmap.d));
+ if (!lootitemfunctionexplorationmap.e.equals(LootItemFunctionExplorationMap.a)) {
+ jsonobject.add("destination", jsonserializationcontext.serialize(lootitemfunctionexplorationmap.e.i()));
}
diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java
-index 59bb53543113660cd2514350a24a4908a8464f24..3ed6a1e785f68c4bb6c5afe024c43150915968a3 100644
+index 998101592723abb26c91d1f92e98be1cf24c954d..ee9069c744df63cbb7f21dd9d28d6d554593674c 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 {
+@@ -123,7 +123,7 @@ public abstract class LootSelectorEntry extends LootEntryAbstract {
@Override
public T b(LootItemFunction.a lootitemfunction_a) {
this.c.add(lootitemfunction_a.b());
@@ -454,7 +498,7 @@ index 59bb53543113660cd2514350a24a4908a8464f24..3ed6a1e785f68c4bb6c5afe024c43150
}
protected LootItemFunction[] a() {
-@@ -134,12 +134,12 @@ public abstract class LootSelectorEntry extends LootEntryAbstract {
+@@ -132,12 +132,12 @@ public abstract class LootSelectorEntry extends LootEntryAbstract {
public T a(int i) {
this.a = i;
@@ -469,6 +513,22 @@ index 59bb53543113660cd2514350a24a4908a8464f24..3ed6a1e785f68c4bb6c5afe024c43150
}
}
+diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
+index ea3685df509101f3fed8b07088baef3ffdb4b85a..5e2dff9a30615b5580710f872a92ab9f07fca6cf 100644
+--- a/src/main/java/net/minecraft/server/MinecraftServer.java
++++ b/src/main/java/net/minecraft/server/MinecraftServer.java
+@@ -1549,9 +1549,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrantmap(resourcepackrepository::a).filter(Objects::nonNull).map(ResourcePackLoader::d).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error
+ }, this).thenCompose((immutablelist) -> {
+- return DataPackResources.a(immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this);
++ return DataPackResources.a((List) immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); // Paper - decompile error
+ }).thenAcceptAsync((datapackresources) -> {
+ this.dataPackResources.close();
+ this.dataPackResources = datapackresources;
diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java
index 829a7ae0a2b77205fb8e8c5754d0d4333afa224d..8b9e47b4c7f5dc464fa617a59583df9e30a54045 100644
--- a/src/main/java/net/minecraft/server/NBTBase.java
@@ -482,8 +542,29 @@ index 829a7ae0a2b77205fb8e8c5754d0d4333afa224d..8b9e47b4c7f5dc464fa617a59583df9e
default String asString() {
return this.toString();
+diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
+index db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..c9be8c7f40917056091f63d36311a10d6302acbb 100644
+--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
++++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
+@@ -11,6 +11,7 @@ import java.io.InputStream;
+ import java.io.OutputStream;
+ import java.util.zip.GZIPInputStream;
+ import java.util.zip.GZIPOutputStream;
++import io.netty.buffer.ByteBufInputStream; // Paper
+
+ public class NBTCompressedStreamTools {
+
+@@ -75,7 +76,7 @@ public class NBTCompressedStreamTools {
+
+ public static NBTTagCompound a(DataInput datainput, NBTReadLimiter nbtreadlimiter) throws IOException {
+ // Spigot start
+- if ( datainput instanceof io.netty.buffer.ByteBufInputStream )
++ if ( datainput instanceof ByteBufInputStream) // Paper
+ {
+ datainput = new DataInputStream(new org.spigotmc.LimitStream((InputStream) datainput, nbtreadlimiter));
+ }
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
-index 22035b6c0b76687404e4df92f5796dbf244c50bc..5406f4c40f86e74f8ed4e7e986b23d19141ddc30 100644
+index b8bb5027ecccfc9b664145a1bfe3755f1a8af3eb..ad8a506bb430b26fe147a657a2f826daf9bf4d45 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 {
@@ -517,31 +598,6 @@ index 8471920b8b92f0bbd0d3ee827e1b0a120f405f6c..e9c405fb5376c5733b9b0191cd530917
});
}
-diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java
-index 737afc7d71f415e942602efb4bd91fba6c6baa72..db9f0196bda4c987de6cf63eea437b7154d47b57 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 implements AutoC
- Optional optional = this.d(i);
-
- if (optional.isPresent()) {
-- return (MinecraftSerializable) optional.get();
-+ return optional.get(); // Paper - decompile fix
- } else {
-- R r0 = (MinecraftSerializable) this.f.apply(() -> {
-+ R r0 = this.f.apply(() -> { // Paper - decompile fix
- this.a(i);
- });
-
-@@ -124,7 +124,7 @@ public class RegionFileSection implements AutoC
- for (int l = 0; l < 16; ++l) {
- long i1 = SectionPosition.a(chunkcoordintpair, l).v();
- Optional optional = optionaldynamic.get(Integer.toString(l)).get().map((dynamic2) -> {
-- return (MinecraftSerializable) this.e.apply(() -> {
-+ return this.e.apply(() -> { // Paper - decompile fix
- this.a(i1);
- }, dynamic2);
- });
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 7f89562e90ede1bdd06b71c0798d986ccbb7886e..4efcb8b595750891b421e524812542f0f67e9f3f 100644
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
@@ -556,7 +612,7 @@ index 7f89562e90ede1bdd06b71c0798d986ccbb7886e..4efcb8b595750891b421e524812542f0
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 4cb78c6a3feb15eb15f76f967e724829655e8617..e15d286710ed66a01bfb6b60f8735b837efb3fd7 100644
+index 2dc20b5c930c6845af41b35d69cdb03db639d63e..6cdd4d46d987132c3c241800b5d59cee2dfa25e2 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 implements Registry {
@@ -571,7 +627,7 @@ index 4cb78c6a3feb15eb15f76f967e724829655e8617..e15d286710ed66a01bfb6b60f8735b83
}
public int getId(@Nullable K k0) {
-@@ -55,9 +55,9 @@ public class RegistryID implements Registry {
+@@ -59,9 +59,9 @@ public class RegistryID implements Registry {
K[] ak = this.b;
int[] aint = this.c;
@@ -583,11 +639,24 @@ index 4cb78c6a3feb15eb15f76f967e724829655e8617..e15d286710ed66a01bfb6b60f8735b83
this.e = 0;
this.f = 0;
+diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
+index 68510457b527e61bf60bf1e7dfd664578172c00a..eefad79a01de61eff5e0bd3f709bfda030ebe20d 100644
+--- a/src/main/java/net/minecraft/server/StructureGenerator.java
++++ b/src/main/java/net/minecraft/server/StructureGenerator.java
+@@ -42,7 +42,7 @@ public abstract class StructureGenerator
+ private static > F a(String s, F f0, WorldGenStage.Decoration worldgenstage_decoration) {
+ StructureGenerator.a.put(s.toLowerCase(Locale.ROOT), f0);
+ StructureGenerator.u.put(f0, worldgenstage_decoration);
+- return (StructureGenerator) IRegistry.a(IRegistry.STRUCTURE_FEATURE, s.toLowerCase(Locale.ROOT), (Object) f0);
++ return (F) IRegistry.>a(IRegistry.STRUCTURE_FEATURE, s.toLowerCase(Locale.ROOT), f0); // Paper - decomp fix
+ }
+
+ public StructureGenerator(Codec codec) {
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
-index 8534585eb17cd46f1e392d8f09bb671abe27ef52..7b92ecfff94e3c4a69269139ebed75fc59bbd4f1 100644
+index a1a5460e429356b52a75037c809cec85bd99084a..80ee8d196436e271833503a0e123401d1b3314a9 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 {
+@@ -55,8 +55,8 @@ public class SystemUtils {
return Collectors.toMap(Entry::getKey, Entry::getValue);
}
@@ -598,7 +667,7 @@ index 8534585eb17cd46f1e392d8f09bb671abe27ef52..7b92ecfff94e3c4a69269139ebed75fc
}
public static String a(String s, @Nullable MinecraftKey minecraftkey) {
-@@ -168,8 +168,8 @@ public class SystemUtils {
+@@ -224,8 +224,8 @@ public class SystemUtils {
public static T b(Iterable iterable, @Nullable T t0) {
Iterator iterator = iterable.iterator();
@@ -609,16 +678,16 @@ index 8534585eb17cd46f1e392d8f09bb671abe27ef52..7b92ecfff94e3c4a69269139ebed75fc
for (object1 = null; iterator.hasNext(); object1 = object) {
object = iterator.next();
-@@ -194,7 +194,7 @@ public class SystemUtils {
+@@ -250,7 +250,7 @@ public class SystemUtils {
}
- public static Strategy i() {
+ public static Strategy k() {
- return SystemUtils.IdentityHashingStrategy.INSTANCE;
+ return (Strategy) SystemUtils.IdentityHashingStrategy.INSTANCE; // Paper - decompile fix
}
public static CompletableFuture> b(List extends CompletableFuture extends V>> list) {
-@@ -205,7 +205,7 @@ public class SystemUtils {
+@@ -261,7 +261,7 @@ public class SystemUtils {
list.forEach((completablefuture1) -> {
int i = list1.size();
@@ -628,10 +697,10 @@ index 8534585eb17cd46f1e392d8f09bb671abe27ef52..7b92ecfff94e3c4a69269139ebed75fc
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 8dbb33e749a282ab1e41bfdc616a22744dc7b162..8082569022384a3ba03fb4a6f1ae12b443598dcb 100644
+index b64fc6e3dc8f628ead2c243baa48f2872bd8da0c..35f4d2d9591e625ab0bbeab7b606761e74965eec 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 implements Mailbox, AutoCloseable, Runnable {
+@@ -99,7 +99,7 @@ public class ThreadedMailbox implements Mailbox, AutoCloseable, Runnable {
public void run() {
try {
@@ -654,10 +723,10 @@ index ee2059cf8ef0a0372e02b91a4bf6fa8a0ab31bca..77bb6b092a0763ff27f90f0401a8a81b
}
diff --git a/src/main/java/net/minecraft/server/TileEntityPiston.java b/src/main/java/net/minecraft/server/TileEntityPiston.java
-index 79df42f5e53464f07e76d22cd1317637145e2056..489175abd8e582a3c082364fec357c4f061a22d7 100644
+index dc52856856796524e4519c34ab92e37031013759..5b941321a7fdc561e6b794a1dce5d600083c505d 100644
--- a/src/main/java/net/minecraft/server/TileEntityPiston.java
+++ b/src/main/java/net/minecraft/server/TileEntityPiston.java
-@@ -137,7 +137,7 @@ public class TileEntityPiston extends TileEntity implements ITickable {
+@@ -140,7 +140,7 @@ public class TileEntityPiston extends TileEntity implements ITickable {
private static void a(EnumDirection enumdirection, Entity entity, double d0, EnumDirection enumdirection1) {
TileEntityPiston.h.set(enumdirection);
entity.move(EnumMoveType.PISTON, new Vec3D(d0 * (double) enumdirection1.getAdjacentX(), d0 * (double) enumdirection1.getAdjacentY(), d0 * (double) enumdirection1.getAdjacentZ()));
@@ -667,28 +736,31 @@ index 79df42f5e53464f07e76d22cd1317637145e2056..489175abd8e582a3c082364fec357c4f
private void g(float f) {
diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java
-index c137484f66a022f7f4581d0657210d60c619c5fa..c999f8c9bf8a59e19b3d6d1b7ad8b5fb6e48b928 100644
+index bc2fab806ee1cc7628841a065436f0339f17ecce..b8c15047771bd4527b86e514a3b950b2ffc6eef0 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 {
+@@ -170,9 +170,9 @@ public class VillagePlace extends RegionFileSection {
}
private static boolean a(ChunkSection chunksection) {
-- Stream stream = VillagePlaceType.e();
-+ Stream stream = VillagePlaceType.e(); // Paper - decompile fix
+- Set set = VillagePlaceType.x;
++ Set set = VillagePlaceType.x; // Paper - decompile error
- chunksection.getClass();
- return stream.anyMatch(chunksection::a);
-@@ -185,7 +185,7 @@ public class VillagePlace extends RegionFileSection {
+- set.getClass();
++ //set.getClass(); // Paper - decompile error
+ return chunksection.a(set::contains);
+ }
+
+@@ -190,7 +190,7 @@ public class VillagePlace extends RegionFileSection {
SectionPosition.b(new ChunkCoordIntPair(blockposition), Math.floorDiv(i, 16)).map((sectionposition) -> {
- return Pair.of(sectionposition, this.d(sectionposition.v()));
+ return Pair.of(sectionposition, this.d(sectionposition.s()));
}).filter((pair) -> {
- return !(Boolean) ((Optional) pair.getSecond()).map(VillagePlaceSection::a).orElse(false);
+ return !(Boolean) (pair.getSecond()).map(VillagePlaceSection::a).orElse(false); // Paper - decompile fix
}).map((pair) -> {
- return ((SectionPosition) pair.getFirst()).u();
+ return ((SectionPosition) pair.getFirst()).r();
}).filter((chunkcoordintpair) -> {
-@@ -237,7 +237,7 @@ public class VillagePlace extends RegionFileSection {
+@@ -242,7 +242,7 @@ public class VillagePlace extends RegionFileSection {
private final Predicate super VillagePlaceRecord> d;
@@ -698,25 +770,25 @@ index c137484f66a022f7f4581d0657210d60c619c5fa..c999f8c9bf8a59e19b3d6d1b7ad8b5fb
}
diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java
-index a06a31534e5bdfddcd3914f68e5b60ae0ec43117..3bcf0b385d1f707176dae9c3ee49370e2e6dd481 100644
+index b0ec371c058c428a909faafe027e58e9c7f0cb38..532460e7549192dfe6170e2bf489edb46b8b5737 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;
+@@ -14,12 +14,12 @@ import javax.annotation.Nullable;
public class VillagerTrades {
- public static final Map> a = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
+ public static final Map> a = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // Paper - decompile fix
hashmap.put(VillagerProfession.FARMER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WHEAT, 20, 16, 2), new VillagerTrades.b(Items.POTATO, 26, 16, 2), new VillagerTrades.b(Items.CARROT, 22, 16, 2), new VillagerTrades.b(Items.BEETROOT, 15, 16, 2), new VillagerTrades.h(Items.BREAD, 1, 6, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Blocks.PUMPKIN, 6, 12, 10), new VillagerTrades.h(Items.PUMPKIN_PIE, 1, 4, 5), new VillagerTrades.h(Items.APPLE, 1, 4, 16, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.COOKIE, 3, 18, 10), new VillagerTrades.b(Blocks.MELON, 4, 12, 20)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Blocks.CAKE, 1, 1, 12, 15), new VillagerTrades.i(MobEffects.NIGHT_VISION, 100, 15), new VillagerTrades.i(MobEffects.JUMP, 160, 15), new VillagerTrades.i(MobEffects.WEAKNESS, 140, 15), new VillagerTrades.i(MobEffects.BLINDNESS, 120, 15), new VillagerTrades.i(MobEffects.POISON, 280, 15), new VillagerTrades.i(MobEffects.SATURATION, 7, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.GOLDEN_CARROT, 3, 3, 30), new VillagerTrades.h(Items.GLISTERING_MELON_SLICE, 4, 3, 30)})));
-- hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.pT, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())})));
-+ hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.pT, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); // Paper - decompile fix
+- hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.rm, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())})));
++ hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.rm, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); //
hashmap.put(VillagerProfession.SHEPHERD, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Blocks.WHITE_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.BROWN_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.BLACK_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.GRAY_WOOL, 18, 16, 2), new VillagerTrades.h(Items.SHEARS, 2, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WHITE_DYE, 12, 16, 10), new VillagerTrades.b(Items.GRAY_DYE, 12, 16, 10), new VillagerTrades.b(Items.BLACK_DYE, 12, 16, 10), new VillagerTrades.b(Items.LIGHT_BLUE_DYE, 12, 16, 10), new VillagerTrades.b(Items.LIME_DYE, 12, 16, 10), new VillagerTrades.h(Blocks.WHITE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.ORANGE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.MAGENTA_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.YELLOW_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIME_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.PINK_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.CYAN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.PURPLE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BROWN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.GREEN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.RED_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BLACK_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.WHITE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.ORANGE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.MAGENTA_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.YELLOW_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIME_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.PINK_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.CYAN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.PURPLE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BROWN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.GREEN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.RED_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BLACK_CARPET, 1, 4, 16, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.YELLOW_DYE, 12, 16, 20), new VillagerTrades.b(Items.LIGHT_GRAY_DYE, 12, 16, 20), new VillagerTrades.b(Items.ORANGE_DYE, 12, 16, 20), new VillagerTrades.b(Items.RED_DYE, 12, 16, 20), new VillagerTrades.b(Items.PINK_DYE, 12, 16, 20), new VillagerTrades.h(Blocks.WHITE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.YELLOW_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.RED_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BLACK_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BLUE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BROWN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.CYAN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.GRAY_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.GREEN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIGHT_BLUE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIGHT_GRAY_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIME_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.MAGENTA_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.ORANGE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.PINK_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.PURPLE_BED, 3, 1, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BROWN_DYE, 12, 16, 30), new VillagerTrades.b(Items.PURPLE_DYE, 12, 16, 30), new VillagerTrades.b(Items.BLUE_DYE, 12, 16, 30), new VillagerTrades.b(Items.GREEN_DYE, 12, 16, 30), new VillagerTrades.b(Items.MAGENTA_DYE, 12, 16, 30), new VillagerTrades.b(Items.CYAN_DYE, 12, 16, 30), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 12, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.PAINTING, 2, 3, 30)})));
- hashmap.put(VillagerProfession.FLETCHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STICK, 32, 16, 2), new VillagerTrades.h(Items.ARROW, 1, 16, 1), new VillagerTrades.g(Blocks.GRAVEL, 10, Items.FLINT, 10, 12, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FLINT, 26, 12, 10), new VillagerTrades.h(Items.BOW, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 14, 16, 20), new VillagerTrades.h(Items.CROSSBOW, 3, 1, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FEATHER, 24, 16, 30), new VillagerTrades.e(Items.BOW, 2, 3, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.dE, 8, 12, 30), new VillagerTrades.e(Items.CROSSBOW, 3, 3, 15), new VillagerTrades.j(Items.ARROW, 5, Items.TIPPED_ARROW, 5, 2, 12, 30)})));
-- hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pR, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.am, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build()));
-+ hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pR, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.am, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); // Paper - decompile fix
- 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.FLETCHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STICK, 32, 16, 2), new VillagerTrades.h(Items.ARROW, 1, 16, 1), new VillagerTrades.g(Blocks.GRAVEL, 10, Items.FLINT, 10, 12, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FLINT, 26, 12, 10), new VillagerTrades.h(Items.BOW, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 14, 16, 20), new VillagerTrades.h(Items.CROSSBOW, 3, 1, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FEATHER, 24, 16, 30), new VillagerTrades.e(Items.BOW, 2, 3, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.es, 8, 12, 30), new VillagerTrades.e(Items.CROSSBOW, 3, 3, 15), new VillagerTrades.j(Items.ARROW, 5, Items.TIPPED_ARROW, 5, 2, 12, 30)})));
+- hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.rj, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build()));
++ hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.rj, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); // Integer, IMerchantRecipeOption[]
+ 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.dP, 11, 16, 10), new VillagerTrades.k(13, StructureGenerator.MONUMENT, MapIcon.Type.MONUMENT, 12, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COMPASS, 1, 12, 20), new VillagerTrades.k(14, StructureGenerator.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)})));
+ 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.ri), 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 e8daa74986f07163fd5318f431398b4f0efde6e8..71d2ae2a9c5a05351241b5a313e66ca15b0624ef 100644
--- a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
@@ -730,18 +802,6 @@ index e8daa74986f07163fd5318f431398b4f0efde6e8..71d2ae2a9c5a05351241b5a313e66ca1
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 555cf6be79985b686eb71cffe25453648f4cbc17..22e14fe1e98c8439f8db74c9464137a497fdaf7c 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
- builder.put(dynamicops.createString("type"), dynamicops.createString(IRegistry.t.getKey(this.a).toString())).put(dynamicops.createString("entries"), this.b.a(dynamicops, (iblockdata) -> {
- return IBlockData.a(dynamicops, iblockdata);
- }));
-- return (new Dynamic(dynamicops, dynamicops.createMap(builder.build()))).getValue();
-+ return (new Dynamic(dynamicops, dynamicops.createMap(builder.build()))).getValue(); // Paper - decompile fix
- }
- }
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index 55fe7625af2207062f69188e9ab345ea68fac6ca..19e68a78310de787bca701bc2597c64e34a77d7c 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch
index 10a690c4b..0468e151a 100644
--- a/Spigot-Server-Patches/0004-MC-Utils.patch
+++ b/Spigot-Server-Patches/0004-MC-Utils.patch
@@ -2259,10 +2259,10 @@ index 0000000000000000000000000000000000000000..9df0006c1a283f77c4d01d9fce9062fc
+ }
+}
diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java
-index 4f60b931a143ebf70a8469913ec445ff13da4d8d..3e90b57b6fd5dcb6cb1325861306e2ff84d0cccb 100644
+index 277d7a124e9a21803fe4d5a66fc0b311df2cfba7..02c09f39848399a86d46bd17569b4f01a7b5ab1f 100644
--- a/src/main/java/net/minecraft/server/AxisAlignedBB.java
+++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java
-@@ -186,10 +186,12 @@ public class AxisAlignedBB {
+@@ -190,10 +190,12 @@ public class AxisAlignedBB {
return this.d(vec3d.x, vec3d.y, vec3d.z);
}
@@ -2275,7 +2275,7 @@ index 4f60b931a143ebf70a8469913ec445ff13da4d8d..3e90b57b6fd5dcb6cb1325861306e2ff
public boolean a(double d0, double d1, double d2, double d3, double d4, double d5) {
return this.minX < d3 && this.maxX > d0 && this.minY < d4 && this.maxY > d1 && this.minZ < d5 && this.maxZ > d2;
}
-@@ -202,6 +204,7 @@ public class AxisAlignedBB {
+@@ -206,6 +208,7 @@ public class AxisAlignedBB {
return d0 >= this.minX && d0 < this.maxX && d1 >= this.minY && d1 < this.maxY && d2 >= this.minZ && d2 < this.maxZ;
}
@@ -2284,15 +2284,15 @@ index 4f60b931a143ebf70a8469913ec445ff13da4d8d..3e90b57b6fd5dcb6cb1325861306e2ff
double d0 = this.b();
double d1 = this.c();
diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java
-index a3b5793e4824718c8bf3d0a4f963de0ca94a738e..3f09c24e1cd1bba2809b70b1fa6e89773537d834 100644
+index ff4b23927bb0e0ac8221d71fe2543cbee54f913a..ee28d0335418a0053f8448ab5e12ebba5a9a3b2d 100644
--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java
+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java
-@@ -80,6 +80,7 @@ public class BaseBlockPosition implements Comparable {
+@@ -98,6 +98,7 @@ public class BaseBlockPosition implements Comparable {
return this.distanceSquared(iposition.getX(), iposition.getY(), iposition.getZ(), true) < d0 * d0;
}
-+ public final double distanceSquared(BaseBlockPosition baseblockposition) { return m(baseblockposition); } // Paper - OBFHELPER
- public double m(BaseBlockPosition baseblockposition) {
++ public final double distanceSquared(BaseBlockPosition baseblockposition) { return j(baseblockposition); } // Paper - OBFHELPER
+ public double j(BaseBlockPosition baseblockposition) {
return this.distanceSquared((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ(), true);
}
diff --git a/src/main/java/net/minecraft/server/BlockAccessAir.java b/src/main/java/net/minecraft/server/BlockAccessAir.java
@@ -2318,23 +2318,23 @@ index eff6ebcd30b538cbaedaa031a46a59ea956253ba..30cbfc8eac20910aa55951e3dce63862
@Override
public IBlockData getType(BlockPosition blockposition) {
return Blocks.AIR.getBlockData();
-diff --git a/src/main/java/net/minecraft/server/BlockDataAbstract.java b/src/main/java/net/minecraft/server/BlockDataAbstract.java
-index 1cf97cefc9d113583214f340e72b35d5560d1e5d..2040f183490d515b913df048ae8ab07bbecaa9a4 100644
---- a/src/main/java/net/minecraft/server/BlockDataAbstract.java
-+++ b/src/main/java/net/minecraft/server/BlockDataAbstract.java
-@@ -78,6 +78,7 @@ public abstract class BlockDataAbstract implements IBlockDataHolder {
- return Collections.unmodifiableCollection(this.d.keySet());
- }
+diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java
+index 47324feca49786b49563d3d0e854e74ad27c190b..26d446077bb563ca3c5bb0339695b3364a3e41bf 100644
+--- a/src/main/java/net/minecraft/server/BlockBase.java
++++ b/src/main/java/net/minecraft/server/BlockBase.java
+@@ -632,6 +632,7 @@ public abstract class BlockBase {
+ return this.a != null ? this.a.e : Block.a(this.getCollisionShape(iblockaccess, blockposition));
+ }
-+ public final > boolean hasProperty(IBlockState iblockstate) { return this.b(iblockstate); } // Paper - OBFHELPER
- public > boolean b(IBlockState iblockstate) {
- return this.d.containsKey(iblockstate);
- }
++ public IBlockData getBlockData() { return p(); } // Paper - OBFHELPER
+ protected abstract IBlockData p();
+
+ public boolean isAlwaysDestroyable() {
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
-index c88a62f6b72a8851b95587bb49c898569d74e0c6..f8ac39e1b019b0918996f745d99f6ed09db0fd11 100644
+index 886b43e2b8f21c358b4d6785c677f14c91d191f3..f1ad6ad22a59b28d2e8aeb2c0f4c21bce6070bc5 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
-@@ -120,6 +120,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
+@@ -98,6 +98,7 @@ public class BlockPosition extends BaseBlockPosition {
return d0 == 0.0D && d1 == 0.0D && d2 == 0.0D ? this : new BlockPosition((double) this.getX() + d0, (double) this.getY() + d1, (double) this.getZ() + d2);
}
@@ -2342,7 +2342,7 @@ index c88a62f6b72a8851b95587bb49c898569d74e0c6..f8ac39e1b019b0918996f745d99f6ed0
public BlockPosition b(int i, int j, int k) {
return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k);
}
-@@ -210,6 +211,8 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
+@@ -188,6 +189,8 @@ public class BlockPosition extends BaseBlockPosition {
return new BlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX());
}
@@ -2351,62 +2351,70 @@ index c88a62f6b72a8851b95587bb49c898569d74e0c6..f8ac39e1b019b0918996f745d99f6ed0
public BlockPosition immutableCopy() {
return this;
}
-@@ -264,6 +267,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
- super(i, j, k);
- }
-
-+ public static BlockPosition.PooledBlockPosition acquire() { return r(); } // Paper - OBFHELPER
- public static BlockPosition.PooledBlockPosition r() {
- return f(0, 0, 0);
- }
-@@ -402,6 +406,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
- return this.d;
+@@ -368,6 +371,7 @@ public class BlockPosition extends BaseBlockPosition {
+ return super.a(enumblockrotation).immutableCopy();
}
+ public BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return d(i, j, k);} // Paper - OBFHELPER
public BlockPosition.MutableBlockPosition d(int i, int j, int k) {
- this.b = i;
- this.c = j;
-@@ -413,6 +418,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
- return this.c(entity.locX(), entity.locY(), entity.locZ());
+ this.o(i);
+ this.p(j);
+@@ -375,6 +379,7 @@ public class BlockPosition extends BaseBlockPosition {
+ return this;
}
+ public BlockPosition.MutableBlockPosition setValues(double d0, double d1, double d2) { return c(d0, d1, d2);} // Paper - OBFHELPER
public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) {
return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
}
-@@ -441,14 +447,17 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
- return this.d(this.b + i, this.c + j, this.d + k);
+@@ -424,16 +429,19 @@ public class BlockPosition extends BaseBlockPosition {
+ }
}
-+ public final void setX(final int x) { this.o(x); } // Paper - OBFHELPER
++ public final void setX(final int x) { super.o(x); } // Paper - OBFHELPER
+ @Override
public void o(int i) {
- this.b = i;
+ super.o(i);
}
-+ public final void setY(final int y) { this.p(y); } // Paper - OBFHELPER
++ public final void setY(final int y) { super.p(y); } // Paper - OBFHELPER
+ @Override
public void p(int i) {
- this.c = i;
+ super.p(i);
}
-+ public final void setZ(final int z) { this.q(z); } // Paper - OBFHELPER
++ public final void setZ(final int z) { super.q(z); } // Paper - OBFHELPER
+ @Override
public void q(int i) {
- this.d = i;
+ super.q(i);
+@@ -444,4 +452,13 @@ public class BlockPosition extends BaseBlockPosition {
+ return new BlockPosition(this);
}
+ }
++
++ // Paper start
++ public static class PooledBlockPosition extends BlockPosition.MutableBlockPosition implements AutoCloseable {
++ @Deprecated
++ public void close() {}
++ @Deprecated
++ public static BlockPosition.PooledBlockPosition acquire() { return new PooledBlockPosition(); }
++ }
++ // Paper end
+ }
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
-index 55373cae078ddaf6c7c974abf59183698f669c24..9397b58f047c837f8a9146723e4cd9a4d6b787a7 100644
+index 3cdcdc60df4f28197cf19c59ea42a92ae4af3819..7c7826cf3adb19814984ab627e4c4726d8933244 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
-@@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
- public class Chunk implements IChunkAccess {
+@@ -26,7 +26,7 @@ public class Chunk implements IChunkAccess {
private static final Logger LOGGER = LogManager.getLogger();
+ @Nullable
- public static final ChunkSection a = null;
-+ public static final ChunkSection a = null; public static final ChunkSection EMPTY_CHUNK_SECTION = Chunk.a; // Paper - OBFHELPER
++ public static final ChunkSection a = null; public static final ChunkSection EMPTY_CHUNK_SECTION = a; // Paper - OBFHELPER
private final ChunkSection[] sections;
private BiomeStorage d;
private final Map e;
-@@ -48,7 +48,7 @@ public class Chunk implements IChunkAccess {
+@@ -49,7 +49,7 @@ public class Chunk implements IChunkAccess {
private Supplier u;
@Nullable
private Consumer v;
@@ -2415,16 +2423,16 @@ index 55373cae078ddaf6c7c974abf59183698f669c24..9397b58f047c837f8a9146723e4cd9a4
private volatile boolean x;
public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage) {
-@@ -65,7 +65,7 @@ public class Chunk implements IChunkAccess {
+@@ -66,7 +66,7 @@ public class Chunk implements IChunkAccess {
this.n = new ShortList[16];
this.entitySlices = (List[]) (new List[16]); // Spigot
- this.world = world;
+ this.world = (WorldServer) world; // CraftBukkit - type
- this.loc = chunkcoordintpair;
+ this.loc = chunkcoordintpair; this.coordinateKey = MCUtil.getCoordinateKey(chunkcoordintpair); // Paper - cache coordinate key
this.i = chunkconverter;
HeightMap.Type[] aheightmap_type = HeightMap.Type.values();
int j = aheightmap_type.length;
-@@ -108,6 +108,110 @@ public class Chunk implements IChunkAccess {
+@@ -109,6 +109,110 @@ public class Chunk implements IChunkAccess {
public boolean needsDecoration;
// CraftBukkit end
@@ -2535,7 +2543,7 @@ index 55373cae078ddaf6c7c974abf59183698f669c24..9397b58f047c837f8a9146723e4cd9a4
public Chunk(World world, ProtoChunk protochunk) {
this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null);
Iterator iterator = protochunk.y().iterator();
-@@ -213,6 +317,18 @@ public class Chunk implements IChunkAccess {
+@@ -214,6 +318,18 @@ public class Chunk implements IChunkAccess {
}
}
@@ -2554,7 +2562,7 @@ index 55373cae078ddaf6c7c974abf59183698f669c24..9397b58f047c837f8a9146723e4cd9a4
@Override
public Fluid getFluid(BlockPosition blockposition) {
return this.a(blockposition.getX(), blockposition.getY(), blockposition.getZ());
-@@ -352,6 +468,7 @@ public class Chunk implements IChunkAccess {
+@@ -353,6 +469,7 @@ public class Chunk implements IChunkAccess {
entity.chunkX = this.loc.x;
entity.chunkY = k;
entity.chunkZ = this.loc.z;
@@ -2562,7 +2570,7 @@ index 55373cae078ddaf6c7c974abf59183698f669c24..9397b58f047c837f8a9146723e4cd9a4
this.entitySlices[k].add(entity);
}
-@@ -374,6 +491,7 @@ public class Chunk implements IChunkAccess {
+@@ -375,6 +492,7 @@ public class Chunk implements IChunkAccess {
}
this.entitySlices[i].remove(entity);
@@ -2570,7 +2578,7 @@ index 55373cae078ddaf6c7c974abf59183698f669c24..9397b58f047c837f8a9146723e4cd9a4
}
@Override
-@@ -395,6 +513,7 @@ public class Chunk implements IChunkAccess {
+@@ -396,6 +514,7 @@ public class Chunk implements IChunkAccess {
return this.a(blockposition, Chunk.EnumTileEntityState.CHECK);
}
@@ -2578,7 +2586,7 @@ index 55373cae078ddaf6c7c974abf59183698f669c24..9397b58f047c837f8a9146723e4cd9a4
@Nullable
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
// CraftBukkit start
-@@ -506,7 +625,25 @@ public class Chunk implements IChunkAccess {
+@@ -507,7 +626,25 @@ public class Chunk implements IChunkAccess {
// CraftBukkit start
public void loadCallback() {
@@ -2604,7 +2612,7 @@ index 55373cae078ddaf6c7c974abf59183698f669c24..9397b58f047c837f8a9146723e4cd9a4
if (server != null) {
/*
* If it's a new world, the first few chunks are generated inside
-@@ -545,6 +682,22 @@ public class Chunk implements IChunkAccess {
+@@ -546,6 +683,22 @@ public class Chunk implements IChunkAccess {
server.getPluginManager().callEvent(unloadEvent);
// note: saving can be prevented, but not forced if no saving is actually required
this.mustNotSave = !unloadEvent.isSaveChunk();
@@ -2628,10 +2636,10 @@ index 55373cae078ddaf6c7c974abf59183698f669c24..9397b58f047c837f8a9146723e4cd9a4
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java
-index 11c4d23ba988dac5f3fd85142083c77fb603e673..a03e4c5b8693395f4a145ca565b074d6aed1913f 100644
+index b703382204a3ccd57e642cff18c7c28fef157cc0..8eecdcde510661ec3a13a25a04ba394f6b6dc012 100644
--- a/src/main/java/net/minecraft/server/ChunkCache.java
+++ b/src/main/java/net/minecraft/server/ChunkCache.java
-@@ -8,7 +8,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
+@@ -10,7 +10,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
protected final int b;
protected final IChunkAccess[][] c;
protected boolean d;
@@ -2640,7 +2648,7 @@ index 11c4d23ba988dac5f3fd85142083c77fb603e673..a03e4c5b8693395f4a145ca565b074d6
public ChunkCache(World world, BlockPosition blockposition, BlockPosition blockposition1) {
this.e = world;
-@@ -27,7 +27,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
+@@ -29,7 +29,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
for (k = this.a; k <= i; ++k) {
for (l = this.b; l <= j; ++l) {
@@ -2649,7 +2657,7 @@ index 11c4d23ba988dac5f3fd85142083c77fb603e673..a03e4c5b8693395f4a145ca565b074d6
}
}
-@@ -52,7 +52,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
+@@ -54,7 +54,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
int k = i - this.a;
int l = j - this.b;
@@ -2658,7 +2666,7 @@ index 11c4d23ba988dac5f3fd85142083c77fb603e673..a03e4c5b8693395f4a145ca565b074d6
IChunkAccess ichunkaccess = this.c[k][l];
return (IChunkAccess) (ichunkaccess != null ? ichunkaccess : new ChunkEmpty(this.e, new ChunkCoordIntPair(i, j)));
-@@ -71,6 +71,29 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
+@@ -73,6 +73,29 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess {
return this.a(i, j);
}
@@ -2689,7 +2697,7 @@ index 11c4d23ba988dac5f3fd85142083c77fb603e673..a03e4c5b8693395f4a145ca565b074d6
@Override
public TileEntity getTileEntity(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
-index 260644bf0be4c5b2d96033f11382f88231048ce3..5a975f6bc60922ac872ec9c00c9150ce7dcad046 100644
+index 2837823547bdc9655376af3af89c43d84719d513..35b8a85d1280ba3be757b14b14388954ac1617d4 100644
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
@@ -11,27 +11,33 @@ public class ChunkCoordIntPair {
@@ -2729,22 +2737,22 @@ index 260644bf0be4c5b2d96033f11382f88231048ce3..5a975f6bc60922ac872ec9c00c9150ce
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-index beb6b63fa483f0a7b29f5403bebf7ee47b27cd29..64d84b334d211fe39e808d2c8b5d457757fb1359 100644
+index 5585b5646b5f3650aa3b795be06f920699a85403..359441cd993a95f933f23aebcec8180f314a5f09 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-@@ -23,7 +23,7 @@ public class ChunkProviderServer extends IChunkProvider {
+@@ -24,7 +24,7 @@ public class ChunkProviderServer extends IChunkProvider {
private final ChunkMapDistance chunkMapDistance;
- public final ChunkGenerator> chunkGenerator;
+ public final ChunkGenerator chunkGenerator;
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 PlayerChunkMap playerChunkMap;
-@@ -35,6 +35,169 @@ public class ChunkProviderServer extends IChunkProvider {
- private final ChunkStatus[] cacheStatus = new ChunkStatus[4];
+@@ -37,6 +37,167 @@ public class ChunkProviderServer extends IChunkProvider {
private final IChunkAccess[] cacheChunk = new IChunkAccess[4];
-
+ @Nullable
+ private SpawnerCreature.d p;
+ // Paper start
+ final com.destroystokyo.paper.util.concurrent.WeakSeqLock loadedChunkMapSeqLock = new com.destroystokyo.paper.util.concurrent.WeakSeqLock();
+ final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f);
@@ -2863,7 +2871,7 @@ index beb6b63fa483f0a7b29f5403bebf7ee47b27cd29..64d84b334d211fe39e808d2c8b5d4577
+ }
+ ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(x, z);
+ Long identifier = Long.valueOf(this.chunkFutureAwaitCounter++);
-+ this.addTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
++ this.chunkMapDistance.addTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
+ this.tickDistanceManager();
+
+ PlayerChunk chunk = this.playerChunkMap.getUpdatingChunk(chunkPos.pair());
@@ -2900,18 +2908,16 @@ index beb6b63fa483f0a7b29f5403bebf7ee47b27cd29..64d84b334d211fe39e808d2c8b5d4577
+ }
+ } finally {
+ // due to odd behaviour with CB unload implementation we need to have these AFTER the load callback.
-+ ChunkProviderServer.this.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, ticketLevel, chunkPos);
-+ ChunkProviderServer.this.removeTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
++ ChunkProviderServer.this.chunkMapDistance.addTicketAtLevel(TicketType.UNKNOWN, chunkPos, ticketLevel, chunkPos);
++ ChunkProviderServer.this.chunkMapDistance.removeTicketAtLevel(TicketType.FUTURE_AWAIT, chunkPos, ticketLevel, identifier);
+ }
+ }, this.serverThreadQueue);
+ }
+ // Paper end
-+
-+
- public ChunkProviderServer(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator> chunkgenerator, int i, WorldLoadListener worldloadlistener, Supplier supplier) {
+
+ public ChunkProviderServer(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator chunkgenerator, int i, boolean flag, WorldLoadListener worldloadlistener, Supplier supplier) {
this.world = worldserver;
- this.serverThreadQueue = new ChunkProviderServer.a(worldserver);
-@@ -87,6 +250,49 @@ public class ChunkProviderServer extends IChunkProvider {
+@@ -90,6 +251,49 @@ public class ChunkProviderServer extends IChunkProvider {
this.cacheChunk[0] = ichunkaccess;
}
@@ -2961,11 +2967,25 @@ index beb6b63fa483f0a7b29f5403bebf7ee47b27cd29..64d84b334d211fe39e808d2c8b5d4577
@Nullable
@Override
public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) {
+@@ -372,10 +576,9 @@ public class ChunkProviderServer extends IChunkProvider {
+
+ this.p = spawnercreature_d;
+ this.world.getMethodProfiler().exit();
+- List list = Lists.newArrayList(this.playerChunkMap.f());
+-
+- Collections.shuffle(list);
+- list.forEach((playerchunk) -> {
++ //List list = Lists.newArrayList(this.playerChunkMap.f()); // Paper
++ //Collections.shuffle(list); // Paper
++ this.playerChunkMap.f().forEach((playerchunk) -> { // Paper - no... just no...
+ Optional optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
+
+ if (optional.isPresent()) {
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
-index 652067757a6b9510b19c339072f1f4183e8d64b6..638b0e39798a3f75566fcf9ea48b81024e60b471 100644
+index b0f7ea97d4795655b6c30b296fd929806dac4ef1..882c2733beaff1df68b892d44fc77cacf4364ff4 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
-@@ -132,6 +132,7 @@ public class ChunkSection {
+@@ -133,6 +133,7 @@ public class ChunkSection {
return this.blockIds;
}
@@ -2974,39 +2994,39 @@ index 652067757a6b9510b19c339072f1f4183e8d64b6..638b0e39798a3f75566fcf9ea48b8102
packetdataserializer.writeShort(this.nonEmptyBlockCount);
this.blockIds.b(packetdataserializer);
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
-index 7ca3a1d0c592df0038953c9fd81783f9bb5c8beb..2edd9b87146a3d1b6623b0efb17b28b524f18c2f 100644
+index cd572c76522b2ee900a03fd5cf6753f3297c1ccd..2c3580c1c7bcd6afc83a45550c0f672a592e0c38 100644
--- a/src/main/java/net/minecraft/server/DataBits.java
+++ b/src/main/java/net/minecraft/server/DataBits.java
@@ -83,6 +83,7 @@ public class DataBits {
- }
+ return (int) (k >> l & this.d);
}
+ public long[] getDataBits() { return this.a(); } // Paper - OBFHELPER
public long[] a() {
- return this.a;
+ return this.b;
}
diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java
-index 75ba69886872f737ff102cb68ec229feb268f94a..45403fbe308cbc6192536d5df606cf8643a65e13 100644
+index b7f4330bbe3b51e6792043cbd0c46c73aad457cb..75b721933ccbe8edc1cd7ea5cc4562214e26b66d 100644
--- a/src/main/java/net/minecraft/server/DataPalette.java
+++ b/src/main/java/net/minecraft/server/DataPalette.java
-@@ -4,10 +4,12 @@ import javax.annotation.Nullable;
+@@ -5,10 +5,12 @@ import javax.annotation.Nullable;
public interface DataPalette {
+ default int getOrCreateIdFor(T object) { return this.a(object); } // Paper - OBFHELPER
int a(T t0);
- boolean b(T t0);
+ boolean a(Predicate predicate);
+ @Nullable default T getObject(int dataBits) { return this.a(dataBits); } // Paper - OBFHELPER
@Nullable
T a(int i);
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
-index 774a8f543424853be5fc8c0367d734ddf196d7f9..d5f5a51872dfabdbb828b6c20d61893aed2efec7 100644
+index 8856981da86219bdb036aa6246152f382ff8a818..4c6979903d287f7f37d9029f6ce2551742f26164 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
-@@ -11,7 +11,7 @@ import java.util.stream.Collectors;
+@@ -10,7 +10,7 @@ import java.util.stream.Collectors;
public class DataPaletteBlock implements DataPaletteExpandable {
@@ -3015,7 +3035,7 @@ index 774a8f543424853be5fc8c0367d734ddf196d7f9..d5f5a51872dfabdbb828b6c20d61893a
private final DataPaletteExpandable c = (i, object) -> {
return 0;
};
-@@ -19,9 +19,9 @@ public class DataPaletteBlock implements DataPaletteExpandable {
+@@ -18,9 +18,9 @@ public class DataPaletteBlock implements DataPaletteExpandable {
private final Function e;
private final Function f;
private final T g;
@@ -3028,7 +3048,7 @@ index 774a8f543424853be5fc8c0367d734ddf196d7f9..d5f5a51872dfabdbb828b6c20d61893a
private final ReentrantLock j = new ReentrantLock();
public void a() {
-@@ -56,6 +56,7 @@ public class DataPaletteBlock implements DataPaletteExpandable {
+@@ -55,6 +55,7 @@ public class DataPaletteBlock implements DataPaletteExpandable {
return j << 8 | k << 4 | i;
}
@@ -3036,7 +3056,7 @@ index 774a8f543424853be5fc8c0367d734ddf196d7f9..d5f5a51872dfabdbb828b6c20d61893a
private void b(int i) {
if (i != this.i) {
this.i = i;
-@@ -133,6 +134,7 @@ public class DataPaletteBlock implements DataPaletteExpandable {
+@@ -132,6 +133,7 @@ public class DataPaletteBlock implements DataPaletteExpandable {
return t0 == null ? this.g : t0;
}
@@ -3044,32 +3064,24 @@ index 774a8f543424853be5fc8c0367d734ddf196d7f9..d5f5a51872dfabdbb828b6c20d61893a
public void b(PacketDataSerializer packetdataserializer) {
this.a();
packetdataserializer.writeByte(this.i);
-diff --git a/src/main/java/net/minecraft/server/DimensionManager.java b/src/main/java/net/minecraft/server/DimensionManager.java
-index 5724fe6e57d3671b4978aecaf217ac4c2e0d7f82..393bc4dc700bbf8653db0662c7957f676b0a647a 100644
---- a/src/main/java/net/minecraft/server/DimensionManager.java
-+++ b/src/main/java/net/minecraft/server/DimensionManager.java
-@@ -55,6 +55,7 @@ public class DimensionManager implements MinecraftSerializable {
- return this.folder.isEmpty() ? file : new File(file, this.folder);
- }
-
-+ public WorldServer world; // Paper - store ref to world this manager is for
- public WorldProvider getWorldProvider(World world) {
- return (WorldProvider) this.providerFactory.apply(world, this);
- }
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
-index f4863852b04c5fa55b79acabe40ce59909b9bbbd..7e01f6a1807f9885a7f4b163ce6bb626d8786a9a 100644
+index 51499ef45faa2bba5f180ee333c09af73d3b708e..9da321fc0e02e4a2e47f515011df33714affd368 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
-@@ -1033,6 +1033,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
+@@ -983,8 +983,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
}
-+ public final AxisAlignedBB getCollisionBox(){return au();} //Paper - OBFHELPER
- @Nullable
- public AxisAlignedBB au() {
+- @Nullable
+- public AxisAlignedBB ay() {
++
++ @Nullable public final AxisAlignedBB getCollisionBox(){return ay();} //Paper - OBFHELPER
++ @Nullable public AxisAlignedBB ay() {
return null;
-@@ -1842,6 +1843,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
- return false;
+ }
+
+@@ -1774,6 +1775,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
+ return EnumInteractionResult.PASS;
}
+ public final AxisAlignedBB getHardCollisionBox(Entity entity){ return j(entity);}//Paper - OBFHELPER
@@ -3077,7 +3089,7 @@ index f4863852b04c5fa55b79acabe40ce59909b9bbbd..7e01f6a1807f9885a7f4b163ce6bb626
public AxisAlignedBB j(Entity entity) {
return null;
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
-index fe69161e5b9e69c75696a3434a681d0489f3863e..b40c8d2f83a80bcb8925632a1e7d6bb4cc0caebf 100644
+index e83d587fd4feee1e36c18c49b98e669c09f5de20..c94197a50269622e8995685119bac984c45e6833 100644
--- a/src/main/java/net/minecraft/server/EntityCreature.java
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
@@ -6,6 +6,8 @@ import org.bukkit.event.entity.EntityUnleashEvent;
@@ -3090,10 +3102,10 @@ index fe69161e5b9e69c75696a3434a681d0489f3863e..b40c8d2f83a80bcb8925632a1e7d6bb4
super(entitytypes, world);
}
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
-index bdfb1738539d0e0c9043ecb63950a5e7fce1c532..0b06fa2b664830d40cdb93968bc2f8c98415d1bf 100644
+index b309d9a13b35f5c04c3a0f048e858df99d8ac617..e5455d99e3f5607a5754e5760d42853a62dddb82 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
-@@ -146,6 +146,7 @@ public abstract class EntityInsentient extends EntityLiving {
+@@ -160,6 +160,7 @@ public abstract class EntityInsentient extends EntityLiving {
return this.goalTarget;
}
@@ -3102,19 +3114,19 @@ index bdfb1738539d0e0c9043ecb63950a5e7fce1c532..0b06fa2b664830d40cdb93968bc2f8c9
// CraftBukkit start - fire event
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
-index 9d1adaaa2c0dbd3773f81a1b54aac98fd16ae26d..3ace8ee854c11abd607dc27b93fe61a0982a73de 100644
+index 8ff295ed373cc316e56e4a01a268f98b7b773bd5..dccb315440f7429fe881bd0d12af8f1ae8e35c3d 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
-@@ -129,6 +129,7 @@ public abstract class EntityLiving extends Entity {
- public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
+@@ -137,6 +137,7 @@ public abstract class EntityLiving extends Entity {
public boolean collides = true;
+ public Set collidableExemptions = new HashSet<>();
public boolean canPickUpLoot;
+ public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
@Override
public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
-index 00c3b666d7b568f1619d885de6ca7ab2ce0daa7a..e5322fbae5140ce784dad49b690767af8c52ce1c 100644
+index fb0f281261455c9f127abd8d3b336135ad84fc27..ebdd990829edb8e423f482fa4352fe2d468efcba 100644
--- a/src/main/java/net/minecraft/server/EntityMonster.java
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
@@ -5,6 +5,7 @@ import java.util.function.Predicate;
@@ -3126,21 +3138,21 @@ index 00c3b666d7b568f1619d885de6ca7ab2ce0daa7a..e5322fbae5140ce784dad49b690767af
super(entitytypes, world);
this.f = 5;
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
-index 541ddc928b9a4e6a7bf5c6a4f64d78422d241d90..26e32aa1dbd6de0ba971c32f8daef0d92d65b683 100644
+index 6a38418d40763705639d361e47201f8b26216052..5bf3c279b86ed0fa416ee7dd9923172d6e6261a5 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
-@@ -87,6 +87,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
+@@ -91,6 +91,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public Integer clientViewDistance;
// CraftBukkit end
+ public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper
+
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
- super((World) worldserver, gameprofile);
- playerinteractmanager.player = this;
-@@ -98,6 +100,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
- this.H = 1.0F;
- this.a(worldserver);
+ super(worldserver, worldserver.getSpawn(), gameprofile);
+ this.spawnDimension = World.OVERWORLD;
+@@ -102,6 +104,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
+ this.G = 1.0F;
+ this.b(worldserver);
+ this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
+
@@ -3148,30 +3160,30 @@ index 541ddc928b9a4e6a7bf5c6a4f64d78422d241d90..26e32aa1dbd6de0ba971c32f8daef0d9
this.displayName = this.getName();
this.canPickUpLoot = true;
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
-index 29e776ca19621b93d5b295d12f0576e6980cf11a..4328273b1fca165320097dbac0650b31fae4e5ca 100644
+index 484e78746aa62bb0b12968165bf8e056b27152f3..9a772e40ad8f9858e6278b99d9d1ff5dc54513cb 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
-@@ -4,6 +4,7 @@ import com.mojang.datafixers.DataFixUtils;
- import java.util.Collections;
+@@ -3,6 +3,7 @@ package net.minecraft.server;
+ import com.google.common.collect.ImmutableSet;
import java.util.Optional;
import java.util.Set; // Paper
+import java.util.Map; // Paper
import java.util.UUID;
import java.util.function.Function;
import java.util.stream.Stream;
-@@ -290,8 +291,8 @@ public class EntityTypes {
- return this.bj.height;
+@@ -305,8 +306,8 @@ public class EntityTypes {
+ return this.bq.height;
}
- @Nullable
- public T a(World world) {
+ public T create(World world) { return this.a(world); } // Paper - OBFHELPER
+ @Nullable public T a(World world) { // Paper - OBFHELPER
- return this.ba.create(this, world);
+ return this.be.create(this, world);
}
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
-index 1890c760f9ffd7628d6ae3db40c36f5272379227..7e5ece9d50af7151ad4cc084e3680dae41ac92be 100644
+index b77a0f0c2ee30df44b113aa6c8d4fa9206d3e2ba..1ba26ee10f338edbec0f580bb55d083a3d6d2284 100644
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
@@ -68,6 +68,15 @@ public abstract class IAsyncTaskHandler implements Mailbox implements
- return this.c != null && this.c.f != null ? this.c.f[enumdirection.ordinal()] : VoxelShapes.a(this.j(iblockaccess, blockposition), enumdirection);
- }
-
-+ public final boolean exceedsCube(){ return f();} // Paper - OBFHELPER
- public boolean f() {
- return this.c == null || this.c.h;
+ return this.getType(blockposition).f();
}
diff --git a/src/main/java/net/minecraft/server/IOWorker.java b/src/main/java/net/minecraft/server/IOWorker.java
-index c5658c0779b0e0d51fd4921456b6fef0711d7be3..b90baef0f54bdb8f5ee51cdde149f64e39887ef5 100644
+index 38ccfd78639a85abcefb915c5c231be5881cebc1..8668b8f3941f37a7bc30a55c33baf74bd8ac49e3 100644
--- a/src/main/java/net/minecraft/server/IOWorker.java
+++ b/src/main/java/net/minecraft/server/IOWorker.java
-@@ -22,7 +22,7 @@ public class IOWorker implements AutoCloseable {
- private final Thread b;
- private final AtomicBoolean c = new AtomicBoolean();
- private final Queue d = Queues.newConcurrentLinkedQueue();
-- private final RegionFileCache e;
-+ private final RegionFileCache e; public RegionFileCache getRegionFileCache() { return e; } // Paper - OBFHELPER
- private final Map f = Maps.newLinkedHashMap();
- private boolean g = true;
- private CompletableFuture h = new CompletableFuture();
+@@ -21,7 +21,7 @@ public class IOWorker implements AutoCloseable {
+ private static final Logger LOGGER = LogManager.getLogger();
+ private final AtomicBoolean b = new AtomicBoolean();
+ private final ThreadedMailbox c;
+- private final RegionFileCache d;
++ private final RegionFileCache d;public RegionFileCache getRegionFileCache() { return d; } // Paper - OBFHELPER
+ private final Map e = Maps.newLinkedHashMap();
+
+ protected IOWorker(File file, boolean flag, String s) {
diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java
-index ba315131e1633ce8b9b8824b00d2be47950d6f19..cbe2aa4c0acbdcc0b453fdad9a192a3e264406c6 100644
+index 284283c5f062107df88e77edaf092cf23302a109..b6d6905260cdd32873010f24ef5a3505e66159be 100644
--- a/src/main/java/net/minecraft/server/IWorldReader.java
+++ b/src/main/java/net/minecraft/server/IWorldReader.java
-@@ -4,6 +4,7 @@ import javax.annotation.Nullable;
+@@ -5,6 +5,7 @@ import javax.annotation.Nullable;
public interface IWorldReader extends IBlockLightAccess, ICollisionAccess, BiomeManager.Provider {
@@ -3257,31 +3257,19 @@ index ba315131e1633ce8b9b8824b00d2be47950d6f19..cbe2aa4c0acbdcc0b453fdad9a192a3e
IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag);
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
-index 75308712d0642d5ab168de653023349df8aee5ed..aa7501d366b15e7f7f64b7d98a1dccff99f731d2 100644
+index dc5625f54a54db35e5dfa630f1414887c736b704..76091ab3f149decc0d3c848b79edd24e20cf181d 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
-@@ -37,10 +37,19 @@ import org.bukkit.event.world.StructureGrowEvent;
- public final class ItemStack {
-
+@@ -49,7 +49,7 @@ public final class ItemStack {
+ })).apply(instance, ItemStack::new);
+ });
private static final Logger LOGGER = LogManager.getLogger();
-- public static final ItemStack a = new ItemStack((Item) null);
-+ public static final ItemStack a = new ItemStack((Item) null);public static final ItemStack NULL_ITEM = a; // Paper - OBFHELPER
- public static final DecimalFormat b = H();
- private int count;
- private int e;
-+ // Paper start
-+ private org.bukkit.craftbukkit.inventory.CraftItemStack bukkitStack;
-+ public org.bukkit.inventory.ItemStack getBukkitStack() {
-+ if (bukkitStack == null || bukkitStack.getHandle() != this) {
-+ bukkitStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(this);
-+ }
-+ return bukkitStack;
-+ }
-+ // Paper end
- @Deprecated
- private Item item;
- private NBTTagCompound tag;
-@@ -593,6 +602,17 @@ public final class ItemStack {
+- public static final ItemStack b = new ItemStack((Item) null);
++ public static final ItemStack b = new ItemStack((Item) null);public static final ItemStack NULL_ITEM = b; // Paper - OBFHELPER
+ public static final DecimalFormat c = (DecimalFormat) SystemUtils.a((new DecimalFormat("#.##")), (decimalformat) -> { // CraftBukkit - decompile error
+ decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT));
+ });
+@@ -606,6 +606,24 @@ public final class ItemStack {
return this.tag != null ? this.tag.getList("Enchantments", 10) : new NBTTagList();
}
@@ -3295,11 +3283,18 @@ index 75308712d0642d5ab168de653023349df8aee5ed..aa7501d366b15e7f7f64b7d98a1dccff
+ public static ItemStack fromBukkitCopy(org.bukkit.inventory.ItemStack itemstack) {
+ return CraftItemStack.asNMSCopy(itemstack);
+ }
++ private org.bukkit.craftbukkit.inventory.CraftItemStack bukkitStack;
++ public org.bukkit.inventory.ItemStack getBukkitStack() {
++ if (bukkitStack == null || bukkitStack.getHandle() != this) {
++ bukkitStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(this);
++ }
++ return bukkitStack;
++ }
+ // Paper end
public void setTag(@Nullable NBTTagCompound nbttagcompound) {
this.tag = nbttagcompound;
if (this.getItem().usesDurability()) {
-@@ -685,6 +705,7 @@ public final class ItemStack {
+@@ -698,6 +716,7 @@ public final class ItemStack {
return this.tag != null && this.tag.hasKeyOfType("Enchantments", 9) ? !this.tag.getList("Enchantments", 10).isEmpty() : false;
}
@@ -3307,7 +3302,7 @@ index 75308712d0642d5ab168de653023349df8aee5ed..aa7501d366b15e7f7f64b7d98a1dccff
public void a(String s, NBTBase nbtbase) {
this.getOrCreateTag().set(s, nbtbase);
}
-@@ -761,6 +782,7 @@ public final class ItemStack {
+@@ -783,6 +802,7 @@ public final class ItemStack {
// CraftBukkit start
@Deprecated
public void setItem(Item item) {
@@ -3317,10 +3312,10 @@ index 75308712d0642d5ab168de653023349df8aee5ed..aa7501d366b15e7f7f64b7d98a1dccff
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
new file mode 100644
-index 0000000000000000000000000000000000000000..16302c4ac6d3e40318a762cea0afcf3f94715216
+index 0000000000000000000000000000000000000000..da7a325d070e194cd1664ed20dcb3a762c9a517a
--- /dev/null
+++ b/src/main/java/net/minecraft/server/MCUtil.java
-@@ -0,0 +1,514 @@
+@@ -0,0 +1,502 @@
+package net.minecraft.server;
+
+import com.destroystokyo.paper.block.TargetBlockInfo;
@@ -3782,24 +3777,12 @@ index 0000000000000000000000000000000000000000..16302c4ac6d3e40318a762cea0afcf3f
+ asyncExecutor.execute(run);
+ }
+
-+ @Nullable
-+ public static TileEntityHopper getHopper(World world, BlockPosition pos) {
-+ Chunk chunk = world.getChunkIfLoaded(pos.getX() >> 4, pos.getZ() >> 4);
-+ if (chunk != null && chunk.getType(new BlockPosition(pos.getX(), pos.getY(), pos.getZ())).getBlock() == Blocks.HOPPER) {
-+ TileEntity tileEntity = chunk.getTileEntityImmediately(pos);
-+ if (tileEntity instanceof TileEntityHopper) {
-+ return (TileEntityHopper) tileEntity;
-+ }
-+ }
-+ return null;
-+ }
-+
+ @Nonnull
-+ public static World getNMSWorld(@Nonnull org.bukkit.World world) {
++ public static WorldServer getNMSWorld(@Nonnull org.bukkit.World world) {
+ return ((CraftWorld) world).getHandle();
+ }
+
-+ public static World getNMSWorld(@Nonnull org.bukkit.entity.Entity entity) {
++ public static WorldServer getNMSWorld(@Nonnull org.bukkit.entity.Entity entity) {
+ return getNMSWorld(entity.getWorld());
+ }
+
@@ -3836,12 +3819,12 @@ index 0000000000000000000000000000000000000000..16302c4ac6d3e40318a762cea0afcf3f
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index b4a0bd79511a3b1185a165991c937375aeecf3d1..786d38438cc1bd5a736b2dfa80aca9b9c6253e65 100644
+index 5e2dff9a30615b5580710f872a92ab9f07fca6cf..70604fbf6bdd5166fc91d57fb4db4a8337bc4727 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -741,6 +741,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant map;
+ public final Map map; // Paper
- private NBTTagCompound(Map map) {
+ protected NBTTagCompound(Map map) {
this.map = map;
-@@ -123,11 +123,15 @@ public class NBTTagCompound implements NBTBase {
+@@ -133,10 +133,14 @@ public class NBTTagCompound implements NBTBase {
this.map.put(s, NBTTagLong.a(i));
}
+ public void setUUID(String prefix, UUID uuid) { a(prefix, uuid); } // Paper - OBFHELPER
public void a(String s, UUID uuid) {
- this.setLong(s + "Most", uuid.getMostSignificantBits());
- this.setLong(s + "Least", uuid.getLeastSignificantBits());
+ this.map.put(s, GameProfileSerializer.a(uuid));
}
+
+ @Nullable public UUID getUUID(String prefix) { return a(prefix); } // Paper - OBFHELPER
+ @Nullable
public UUID a(String s) {
- return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least"));
+ return GameProfileSerializer.a(this.get(s));
}
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
-index 6700582e362b3ff2e0aa4a203981f75de0f22d89..3ccf1663669c79a63a6b3a9f6dc17a6e25e91915 100644
+index 69718caa347bc75ed243041797a6b53d90fc553c..c2fdccfb9192aa7ec55fd67c169cba71a695075c 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
-@@ -159,6 +159,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> {
+@@ -158,6 +158,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> {
}
@@ -3890,7 +3872,7 @@ index 6700582e362b3ff2e0aa4a203981f75de0f22d89..3ccf1663669c79a63a6b3a9f6dc17a6e
private void b(Packet> packet, @Nullable GenericFutureListener extends Future super Void>> genericfuturelistener) {
EnumProtocol enumprotocol = EnumProtocol.a(packet);
EnumProtocol enumprotocol1 = (EnumProtocol) this.channel.attr(NetworkManager.c).get();
-@@ -199,6 +200,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> {
+@@ -198,6 +199,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> {
}
@@ -3898,7 +3880,7 @@ index 6700582e362b3ff2e0aa4a203981f75de0f22d89..3ccf1663669c79a63a6b3a9f6dc17a6e
private void o() {
if (this.channel != null && this.channel.isOpen()) {
Queue queue = this.packetQueue;
-@@ -327,9 +329,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> {
+@@ -326,9 +328,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> {
static class QueuedPacket {
@@ -3911,10 +3893,10 @@ index 6700582e362b3ff2e0aa4a203981f75de0f22d89..3ccf1663669c79a63a6b3a9f6dc17a6e
public QueuedPacket(Packet> packet, @Nullable GenericFutureListener extends Future super Void>> genericfuturelistener) {
this.a = packet;
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
-index 81b6f4581f8e4d956668535a44342f991d677267..d9574a9ace96d8c5666e62a5aed96a67021b91d8 100644
+index f574a28b68cf4d3745ee5f1a3756e19dbc23ca92..6e049c2e2a142ce022b9dc278a3bb302f723e42c 100644
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
-@@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf {
+@@ -36,6 +36,7 @@ public class PacketDataSerializer extends ByteBuf {
this.a = bytebuf;
}
@@ -3935,7 +3917,7 @@ index 90223deae3376fd6828eddf3831dab96650afef2..63c4dbd327beb7b6ab42eb44650d68ac
throw new SkipEncodeException(throwable);
} else {
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
-index 677e3e5f687e81ffb6c6aec134e2a19b90bd61cf..3a1d0deb0dec880d73185690e2a7c769a2731479 100644
+index cb0b7e7157b629c259b0ccb946c29cbcb3c6fa98..e336437207f9d6adbab69ef2785c129ff2ec1b36 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -17,7 +17,7 @@ public class PacketPlayOutMapChunk implements Packet {
@@ -3946,8 +3928,8 @@ index 677e3e5f687e81ffb6c6aec134e2a19b90bd61cf..3a1d0deb0dec880d73185690e2a7c769
+ private byte[] f; private byte[] getData() { return this.f; } // Paper - OBFHELPER
private List g;
private boolean h;
-
-@@ -129,6 +129,7 @@ public class PacketPlayOutMapChunk implements Packet {
+ private boolean i;
+@@ -133,6 +133,7 @@ public class PacketPlayOutMapChunk implements Packet {
return bytebuf;
}
@@ -3956,7 +3938,7 @@ index 677e3e5f687e81ffb6c6aec134e2a19b90bd61cf..3a1d0deb0dec880d73185690e2a7c769
int j = 0;
ChunkSection[] achunksection = chunk.getSections();
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
-index 5c5bf010d07b65f1328541843b0f24ce5d50e6ac..6e9f402fb0faccc222b4289deb36e2d85a66eb7c 100644
+index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51434733d8 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -19,9 +19,9 @@ public class PlayerChunk {
@@ -3972,7 +3954,7 @@ index 5c5bf010d07b65f1328541843b0f24ce5d50e6ac..6e9f402fb0faccc222b4289deb36e2d8
private CompletableFuture chunkSave;
public int oldTicketLevel;
private int ticketLevel;
-@@ -38,6 +38,8 @@ public class PlayerChunk {
+@@ -37,6 +37,8 @@ public class PlayerChunk {
public final PlayerChunk.d players;
private boolean hasBeenLoaded;
@@ -3981,7 +3963,7 @@ index 5c5bf010d07b65f1328541843b0f24ce5d50e6ac..6e9f402fb0faccc222b4289deb36e2d8
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;
-@@ -53,8 +55,47 @@ public class PlayerChunk {
+@@ -52,8 +54,47 @@ public class PlayerChunk {
this.ticketLevel = this.oldTicketLevel;
this.n = this.oldTicketLevel;
this.a(i);
@@ -4029,7 +4011,7 @@ index 5c5bf010d07b65f1328541843b0f24ce5d50e6ac..6e9f402fb0faccc222b4289deb36e2d8
// CraftBukkit start
public Chunk getFullChunk() {
if (!getChunkState(this.oldTicketLevel).isAtLeast(PlayerChunk.State.BORDER)) return null; // note: using oldTicketLevel for isLoaded checks
-@@ -63,6 +104,14 @@ public class PlayerChunk {
+@@ -62,6 +103,14 @@ public class PlayerChunk {
return either == null ? null : (Chunk) either.left().orElse(null);
}
// CraftBukkit end
@@ -4044,7 +4026,7 @@ index 5c5bf010d07b65f1328541843b0f24ce5d50e6ac..6e9f402fb0faccc222b4289deb36e2d8
public CompletableFuture> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
CompletableFuture> completablefuture = (CompletableFuture) this.statusFutures.get(chunkstatus.c());
-@@ -74,14 +123,17 @@ public class PlayerChunk {
+@@ -73,14 +122,17 @@ public class PlayerChunk {
return getChunkStatus(this.ticketLevel).b(chunkstatus) ? this.getStatusFutureUnchecked(chunkstatus) : PlayerChunk.UNLOADED_CHUNK_ACCESS_FUTURE;
}
@@ -4062,7 +4044,7 @@ index 5c5bf010d07b65f1328541843b0f24ce5d50e6ac..6e9f402fb0faccc222b4289deb36e2d8
public CompletableFuture> c() {
return this.fullChunkFuture;
}
-@@ -335,13 +387,27 @@ public class PlayerChunk {
+@@ -322,13 +374,27 @@ public class PlayerChunk {
this.hasBeenLoaded |= flag3;
if (!flag2 && flag3) {
@@ -4091,7 +4073,7 @@ index 5c5bf010d07b65f1328541843b0f24ce5d50e6ac..6e9f402fb0faccc222b4289deb36e2d8
this.a(((CompletableFuture>) completablefuture).thenApply((either1) -> { // CraftBukkit - decompile error
playerchunkmap.getClass();
return either1.ifLeft(playerchunkmap::a);
-@@ -352,12 +418,24 @@ public class PlayerChunk {
+@@ -339,12 +405,24 @@ public class PlayerChunk {
boolean flag5 = playerchunk_state1.isAtLeast(PlayerChunk.State.TICKING);
if (!flag4 && flag5) {
@@ -4118,7 +4100,7 @@ index 5c5bf010d07b65f1328541843b0f24ce5d50e6ac..6e9f402fb0faccc222b4289deb36e2d8
this.tickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
}
-@@ -369,12 +447,24 @@ public class PlayerChunk {
+@@ -356,12 +434,24 @@ public class PlayerChunk {
throw (IllegalStateException) SystemUtils.c(new IllegalStateException());
}
@@ -4146,10 +4128,10 @@ index 5c5bf010d07b65f1328541843b0f24ce5d50e6ac..6e9f402fb0faccc222b4289deb36e2d8
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-index 7ad30548e2ad221494d6870b0b3a08e1d2f3ed06..b505244516321292e56609eaa54693d84e0bf617 100644
+index 5f692d719fd270120207ebcf6d0a2a24e8d59f7b..3e2e355177e32856dac07dc8b98658ad1b717045 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
-@@ -99,6 +99,28 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -101,6 +101,26 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
};
// CraftBukkit end
@@ -4171,14 +4153,12 @@ index 7ad30548e2ad221494d6870b0b3a08e1d2f3ed06..b505244516321292e56609eaa54693d8
+ int chunkZ = MCUtil.getChunkCoordinate(player.locZ());
+ // Note: players need to be explicitly added to distance maps before they can be updated
+ }
-+
-+
+ // Paper end
+
- public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator> chunkgenerator, WorldLoadListener worldloadlistener, Supplier supplier, int i) {
- super(new File(worldserver.getWorldProvider().getDimensionManager().a(file), "region"), datafixer);
+ public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier supplier, int i, boolean flag) {
+ super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag);
this.visibleChunks = this.updatingChunks.clone();
-@@ -187,6 +209,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -190,6 +210,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
};
}
@@ -4193,15 +4173,15 @@ index 7ad30548e2ad221494d6870b0b3a08e1d2f3ed06..b505244516321292e56609eaa54693d8
private CompletableFuture, PlayerChunk.Failure>> a(ChunkCoordIntPair chunkcoordintpair, int i, IntFunction intfunction) {
List>> list = Lists.newArrayList();
int j = chunkcoordintpair.x;
-@@ -867,6 +897,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -900,6 +928,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (!flag1) {
this.chunkDistanceManager.a(SectionPosition.a((Entity) entityplayer), entityplayer);
}
+ this.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps
} else {
- SectionPosition sectionposition = entityplayer.K();
+ SectionPosition sectionposition = entityplayer.N();
-@@ -874,6 +905,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -907,6 +936,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (!flag2) {
this.chunkDistanceManager.b(sectionposition, entityplayer);
}
@@ -4209,7 +4189,7 @@ index 7ad30548e2ad221494d6870b0b3a08e1d2f3ed06..b505244516321292e56609eaa54693d8
}
for (int k = i - this.viewDistance; k <= i + this.viewDistance; ++k) {
-@@ -984,6 +1016,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1017,6 +1047,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
}
@@ -4219,7 +4199,7 @@ index 7ad30548e2ad221494d6870b0b3a08e1d2f3ed06..b505244516321292e56609eaa54693d8
@Override
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
-index 8cc5f417fe2ad2370b52236e8f5497688553aeba..f40cb14d5301631161f1701043ee987359d9a8e9 100644
+index 92922db3f57877507c6443c49f4c021aee667b1d..b8d3c4d35cee2ba4678f6d22b8ea956d598d9d9b 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -67,9 +67,9 @@ public class PlayerConnection implements PacketListenerPlayIn {
@@ -4236,7 +4216,7 @@ index 8cc5f417fe2ad2370b52236e8f5497688553aeba..f40cb14d5301631161f1701043ee9873
private volatile int chatThrottle;
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java
-index 08768a3c877bfe26c2a9533af390068b172a5996..d103cfaace4f42aaad677103f4eef578490699da 100644
+index c027fb94881be14396cba879087861df35023500..3b65711b91c51ac7b4b5b2b0144ffd279fe60eeb 100644
--- a/src/main/java/net/minecraft/server/PlayerInventory.java
+++ b/src/main/java/net/minecraft/server/PlayerInventory.java
@@ -17,7 +17,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity {
@@ -4261,10 +4241,10 @@ index b3824898daa80da791cdc8cfd06900e9a0b3b5b5..bf4172be525d5bdd7c152117afce8bf0
MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry);
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
-index 6e65306a275fe91ce82b28e4e6155f91dceaa3f2..39339fa27551b06a9bfd8ea67b1ec8c66726f488 100644
+index f92fbf136158336b65217a504ecd422bfcc4964f..070449198273e6c42e72c891882b82361d1c8dbd 100644
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
-@@ -80,6 +80,18 @@ public class ProtoChunk implements IChunkAccess {
+@@ -81,6 +81,18 @@ public class ProtoChunk implements IChunkAccess {
}
@@ -4284,10 +4264,10 @@ index 6e65306a275fe91ce82b28e4e6155f91dceaa3f2..39339fa27551b06a9bfd8ea67b1ec8c6
public IBlockData getType(BlockPosition blockposition) {
int i = blockposition.getY();
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
-index 7b6e0e86b00c7750267f0090b79b738696f115c4..187c4e0f58b7de58dfd2194afb194cbed0a58957 100644
+index 43c5b8258d9cd15d86d4160e9c614c7ca6152962..1ce85ab949213efb9eae6daddca6ac8fb15dd472 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
-@@ -88,6 +88,7 @@ public class RegionFile implements AutoCloseable {
+@@ -93,6 +93,7 @@ public class RegionFile implements AutoCloseable {
return this.d.resolve(s);
}
@@ -4296,11 +4276,11 @@ index 7b6e0e86b00c7750267f0090b79b738696f115c4..187c4e0f58b7de58dfd2194afb194cbe
public synchronized DataInputStream a(ChunkCoordIntPair chunkcoordintpair) throws IOException {
int i = this.getOffset(chunkcoordintpair);
diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
-index 8c123f265e674ca99bc06e4d64f212148f6cac1a..9d0e8c2d43ba56d53bc30c0a3e2d7d170d8be474 100644
+index a2ec45a6b8bd63299508113e3522436cea2507e5..478d252953c65792df9f0068a4c1afd1985151ab 100644
--- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
+++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
-@@ -108,6 +108,26 @@ public class RegionLimitedWorldAccess implements GeneratorAccess {
- return i >= ichunkaccess.getPos().x && i <= ichunkaccess1.getPos().x && j >= ichunkaccess.getPos().z && j <= ichunkaccess1.getPos().z;
+@@ -101,6 +101,26 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed {
+ return i >= this.n.x && i <= this.o.x && j >= this.n.z && j <= this.o.z;
}
+ // Paper start - if loaded util
@@ -4339,10 +4319,10 @@ index 4efcb8b595750891b421e524812542f0f67e9f3f..60948afa4ead71010dc27c7cef3e5acd
return this.b.size();
}
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
-index 7b92ecfff94e3c4a69269139ebed75fc59bbd4f1..7e224ebeff3bf34270df173a47b08d3290c00670 100644
+index 80ee8d196436e271833503a0e123401d1b3314a9..275c1d2d1eb2649de9a9b5aece6e88c21362efba 100644
--- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
-@@ -58,7 +58,7 @@ public class SystemUtils {
+@@ -68,7 +68,7 @@ public class SystemUtils {
}
public static long getMonotonicNanos() {
@@ -4364,7 +4344,7 @@ index f82db93f88223ffddc55deec8f21efc5b774d900..75ab9f185b3231113dfa387c956a707b
public static TicketType a(String s, Comparator comparator) {
return new TicketType<>(s, comparator, 0L);
diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java
-index 143be566c683ae035997f9a4058381a109f3de23..0e30d8c9933dc6595b9715ef6dc99cc8910892cb 100644
+index 3c08ae0cf92ab1f5395662e957ab4d9c03e13deb..86f6f082fe2991ea9065b09c9680b76ca1cf7154 100644
--- a/src/main/java/net/minecraft/server/VoxelShapes.java
+++ b/src/main/java/net/minecraft/server/VoxelShapes.java
@@ -21,10 +21,12 @@ public final class VoxelShapes {
@@ -4381,7 +4361,7 @@ index 143be566c683ae035997f9a4058381a109f3de23..0e30d8c9933dc6595b9715ef6dc99cc8
return VoxelShapes.b;
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
-index 2e1eabba14a3757d03fd90741651001e78c6322f..45ded8cd3aee69083f6196765208d8c2430f0a02 100644
+index 63d3d43f74bed94cd03aa3b7254e66302be861d5..bd5a2eee9cb435a5ee75a39cea231151fba00387 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -22,6 +22,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot
@@ -4392,15 +4372,16 @@ index 2e1eabba14a3757d03fd90741651001e78c6322f..45ded8cd3aee69083f6196765208d8c2
import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.event.block.BlockPhysicsEvent;
// CraftBukkit end
-@@ -94,6 +95,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
- this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot
- this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper
+@@ -95,7 +96,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
+
+ protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
+ this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot
+- this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper
++ this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper
this.generator = gen;
-+ if (dimensionmanager.world == null) dimensionmanager.world = (WorldServer) this; // Paper
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
- this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit
-@@ -183,6 +185,39 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
+@@ -247,6 +248,39 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
return (Chunk) this.getChunkAt(i, j, ChunkStatus.FULL);
}
@@ -4408,7 +4389,7 @@ index 2e1eabba14a3757d03fd90741651001e78c6322f..45ded8cd3aee69083f6196765208d8c2
+ @Nullable
+ @Override
+ public IChunkAccess getChunkIfLoadedImmediately(int x, int z) {
-+ return ((ChunkProviderServer)this.chunkProvider).getChunkAtIfLoadedImmediately(x, z);
++ return ((WorldServer)this).chunkProvider.getChunkAtIfLoadedImmediately(x, z);
+ }
+
+ @Override
@@ -4439,8 +4420,8 @@ index 2e1eabba14a3757d03fd90741651001e78c6322f..45ded8cd3aee69083f6196765208d8c2
+
@Override
public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) {
- IChunkAccess ichunkaccess = this.chunkProvider.getChunkAt(i, j, chunkstatus, flag);
-@@ -336,8 +371,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
+ IChunkAccess ichunkaccess = this.getChunkProvider().getChunkAt(i, j, chunkstatus, flag);
+@@ -405,8 +439,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
@@ -4453,20 +4434,32 @@ index 2e1eabba14a3757d03fd90741651001e78c6322f..45ded8cd3aee69083f6196765208d8c2
return this.setTypeAndData(blockposition, fluid.getBlockData(), 3 | (flag ? 64 : 0));
diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java
-index 020e5c171a44f8886395849d718efd6f90659bab..3db276f176301ebf15d5a2ba44d0edb5c7ec6097 100644
+index ddc4570139fd9b82f4b740697e84775f5ff0a75a..d039e715624d33fc3ec9e87d5ad992415e7dc6b9 100644
--- a/src/main/java/net/minecraft/server/WorldBorder.java
+++ b/src/main/java/net/minecraft/server/WorldBorder.java
-@@ -35,6 +35,8 @@ public class WorldBorder {
+@@ -37,6 +37,7 @@ public class WorldBorder {
return this.b(entity.locX(), entity.locZ());
}
-+ public final VoxelShape asVoxelShape(){ return a();} // Paper - OBFHELPER
-+
- public VoxelShape a() {
- return this.i.m();
++ public final VoxelShape asVoxelShape(){ return c();} // Paper - OBFHELPER
+ public VoxelShape c() {
+ return this.j.m();
}
+diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
+index bd6dfddb3c076cf92588dd508975db0eee5c2962..d643ff0a0ae9d45711c9a40fc12af68157604a33 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 implements GeneratorAccessSeed {
+ private final Map entitiesByUUID = Maps.newHashMap();
+ private final Queue entitiesToAdd = Queues.newArrayDeque();
+ private final List players = Lists.newArrayList();
+- private final ChunkProviderServer chunkProvider;
++ public final ChunkProviderServer chunkProvider; // Paper - public
+ boolean tickingEntities;
+ private final MinecraftServer server;
+ public final WorldDataServer worldDataServer; // CraftBukkit - type
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
-index e181df6f4d08b88835db7342f97e0b848bcf01ef..4a9132c7016b076ab35b5d66ce81bbd247e1a3ce 100644
+index 62cdb32a63cdcbaee80946f73d23817bbb455488..721a1c6bd4505cb132e7004c45b795d4959389e3 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -85,6 +85,7 @@ public final class CraftItemStack extends ItemStack {
@@ -4478,7 +4471,7 @@ index e181df6f4d08b88835db7342f97e0b848bcf01ef..4a9132c7016b076ab35b5d66ce81bbd2
/**
* Mirror
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
-index 9ad17c560c8d99a396543ab9f97c34de648f6544..533c0bc55fc7ac4cc1f493f898a85a6617371031 100644
+index 9ad17c560c8d99a396543ab9f97c34de648f6544..4bf48f77f3f7cd62a91590543f5af441c8268029 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -43,6 +43,7 @@ import org.bukkit.scheduler.BukkitWorker;
@@ -4501,6 +4494,32 @@ index 9ad17c560c8d99a396543ab9f97c34de648f6544..533c0bc55fc7ac4cc1f493f898a85a66
public BukkitTask runTaskTimer(Plugin plugin, Object runnable, long delay, long period) {
validate(plugin, runnable);
if (delay < 0L) {
+@@ -400,13 +406,20 @@ public class CraftScheduler implements BukkitScheduler {
+ task.run();
+ task.timings.stopTiming(); // Spigot
+ } catch (final Throwable throwable) {
+- task.getOwner().getLogger().log(
++ // Paper start
++ String msg = String.format(
++ "Task #%s for %s generated an exception",
++ task.getTaskId(),
++ task.getOwner().getDescription().getFullName());
++ if (task.getOwner() == MINECRAFT) {
++ net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
++ } else {
++ task.getOwner().getLogger().log(
+ Level.WARNING,
+- String.format(
+- "Task #%s for %s generated an exception",
+- task.getTaskId(),
+- task.getOwner().getDescription().getFullName()),
++ msg,
+ throwable);
++ }
++ // Paper end
+ } finally {
+ currentTask = null;
+ }
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
index 3f55381c152b9841b524f623c9b32360e97cb8ed..d85e21b75054067b926ecfee89d62c6dd0744189 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
@@ -4666,11 +4685,11 @@ index 0000000000000000000000000000000000000000..49dc0c441b9dd7e7745cf15ced67f383
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
-index d8358a0f031ca6e5d5dc1700172175446f74384e..d0b813008ca21fe6aa9b514ed4325596113fd459 100644
+index eb87f3720977e4e980d26e9cfd4fed0a808636dd..b6c39bf77e716addc9d2a1e915687bc770e937f4 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
-@@ -196,4 +196,22 @@ public class DummyGeneratorAccess implements GeneratorAccess {
- public boolean a(BlockPosition blockposition, boolean flag, Entity entity) {
+@@ -187,4 +187,22 @@ public class DummyGeneratorAccess implements GeneratorAccess {
+ public boolean a(BlockPosition blockposition, boolean flag, Entity entity, int i) {
throw new UnsupportedOperationException("Not supported yet.");
}
+
diff --git a/Spigot-Server-Patches/0005-Paper-Metrics.patch b/Spigot-Server-Patches/0005-Paper-Metrics.patch
index 0ac402ed6..999be8eb7 100644
--- a/Spigot-Server-Patches/0005-Paper-Metrics.patch
+++ b/Spigot-Server-Patches/0005-Paper-Metrics.patch
@@ -647,10 +647,10 @@ index 0000000000000000000000000000000000000000..e257d6b36e0e78dac5b8320017d92776
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
-index 273cdb598b3606b962dcc92564c84ad351b7a74f..b6d470e594ce196f560ac6c94ced904b0081b205 100644
+index 68d3cb02dbfdc9d6f9d3682a2659c9430b50c490..b367bb8ea184489f433f8acc798466c38816ae62 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
-@@ -41,6 +41,7 @@ public class PaperConfig {
+@@ -42,6 +42,7 @@ public class PaperConfig {
private static boolean verbose;
private static boolean fatalError;
/*========================================================================*/
@@ -658,7 +658,7 @@ index 273cdb598b3606b962dcc92564c84ad351b7a74f..b6d470e594ce196f560ac6c94ced904b
public static void init(File configFile) {
CONFIG_FILE = configFile;
-@@ -83,6 +84,11 @@ public class PaperConfig {
+@@ -84,6 +85,11 @@ public class PaperConfig {
for (Map.Entry entry : commands.entrySet()) {
MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Paper", entry.getValue());
}
diff --git a/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch b/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch
index cb079c224..48fd21a4f 100644
--- a/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch
+++ b/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch
@@ -19,7 +19,7 @@ index 41c79650b169b87fbc70cf502438a5453a04f23d..b839769ceae8932bb121a0b96fde1e7d
MutablePair> 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/Entity.java b/src/main/java/net/minecraft/server/Entity.java
-index 7e01f6a1807f9885a7f4b163ce6bb626d8786a9a..6c7816fdc1ef476969cb70c8ea697b60746d6ab4 100644
+index 9da321fc0e02e4a2e47f515011df33714affd368..ee93b977b5f78855fd58a2055ca4e17255f3388b 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -49,7 +49,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
@@ -31,7 +31,7 @@ index 7e01f6a1807f9885a7f4b163ce6bb626d8786a9a..6c7816fdc1ef476969cb70c8ea697b60
// CraftBukkit start
private static final int CURRENT_LEVEL = 2;
-@@ -1708,12 +1708,31 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
+@@ -1670,12 +1670,31 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
return true;
}
@@ -63,18 +63,18 @@ index 7e01f6a1807f9885a7f4b163ce6bb626d8786a9a..6c7816fdc1ef476969cb70c8ea697b60
+ // Paper end
}
- protected abstract void a(NBTTagCompound nbttagcompound);
+ protected abstract void loadData(NBTTagCompound nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
-index 4328273b1fca165320097dbac0650b31fae4e5ca..8427ee2ee8b90d5deb686412bb2eefb9a574b75a 100644
+index 9a772e40ad8f9858e6278b99d9d1ff5dc54513cb..b9fe08301409bc1f0d61a7566c26e720ff720d80 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
-@@ -237,6 +237,7 @@ public class EntityTypes {
+@@ -248,6 +248,7 @@ public class EntityTypes {
}
}
+ public boolean isPersistable() { return a(); } // Paper - OBFHELPER
public boolean a() {
- return this.bc;
+ return this.bh;
}
diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java
new file mode 100644
@@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..743142d0303fa25fe48a2abb07040d12
+ }
+}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
-index 40752f7617d5aa6b5ae55cd9a1b2eeb57c276adb..9071bb7ece6d38d85b4ea11e53671f3ec5210b28 100644
+index 6d06812f5fb6366ccd2673e9155be869b9bc0f6d..3cae7ef750371cee741c2f27799c1bb5864a278a 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -11,7 +11,7 @@ import org.bukkit.inventory.InventoryHolder;
diff --git a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch
index bdd856382..fd87bcbea 100644
--- a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch
+++ b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch
@@ -8,19 +8,10 @@ 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 9397b58f047c837f8a9146723e4cd9a4d6b787a7..e1ac0c479ebfa2da69575db2032dd1415c4a41a5 100644
+index 7c7826cf3adb19814984ab627e4c4726d8933244..bd92ed2e6d4766f4f16ec3002c41b36b5a7e0358 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 {
- private final ChunkSection[] sections;
- private BiomeStorage d;
- private final Map e;
-- public boolean loaded;
-+ public boolean loaded; public boolean isLoaded() { return loaded; } // Paper - OBFHELPER
- public final World world;
- public final Map heightMap;
- private final ChunkConverter i;
-@@ -55,11 +55,36 @@ public class Chunk implements IChunkAccess {
+@@ -56,11 +56,36 @@ public class Chunk implements IChunkAccess {
this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, (ChunkSection[]) null, (Consumer) null);
}
@@ -58,7 +49,7 @@ index 9397b58f047c837f8a9146723e4cd9a4d6b787a7..e1ac0c479ebfa2da69575db2032dd141
this.l = Maps.newHashMap();
this.m = Maps.newHashMap();
this.n = new ShortList[16];
-@@ -465,6 +490,7 @@ public class Chunk implements IChunkAccess {
+@@ -466,6 +491,7 @@ public class Chunk implements IChunkAccess {
}
entity.inChunk = true;
@@ -66,7 +57,7 @@ index 9397b58f047c837f8a9146723e4cd9a4d6b787a7..e1ac0c479ebfa2da69575db2032dd141
entity.chunkX = this.loc.x;
entity.chunkY = k;
entity.chunkZ = this.loc.z;
-@@ -477,6 +503,7 @@ public class Chunk implements IChunkAccess {
+@@ -478,6 +504,7 @@ public class Chunk implements IChunkAccess {
((HeightMap) this.heightMap.get(heightmap_type)).a(along);
}
@@ -74,7 +65,7 @@ index 9397b58f047c837f8a9146723e4cd9a4d6b787a7..e1ac0c479ebfa2da69575db2032dd141
public void b(Entity entity) {
this.a(entity, entity.chunkY);
}
-@@ -490,7 +517,12 @@ public class Chunk implements IChunkAccess {
+@@ -491,7 +518,12 @@ public class Chunk implements IChunkAccess {
i = this.entitySlices.length - 1;
}
@@ -89,28 +80,19 @@ index 9397b58f047c837f8a9146723e4cd9a4d6b787a7..e1ac0c479ebfa2da69575db2032dd141
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
-index 6c7816fdc1ef476969cb70c8ea697b60746d6ab4..0d8262b1d2722e716f95db4c9a8a132c54b613cf 100644
+index ee93b977b5f78855fd58a2055ca4e17255f3388b..e3f2e259b2c5e478bde45554995b9c742d9e2008 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
- private static final DataWatcherObject aB = DataWatcher.a(Entity.class, DataWatcherRegistry.i);
- private static final DataWatcherObject aC = DataWatcher.a(Entity.class, DataWatcherRegistry.i);
- protected static final DataWatcherObject POSE = DataWatcher.a(Entity.class, DataWatcherRegistry.s);
-- public boolean inChunk;
-+ public boolean inChunk; public boolean isAddedToChunk() { return inChunk; } // Paper - OBFHELPER
- public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER
- public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER
- public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER
@@ -178,7 +178,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public boolean isChunkLoaded() {
-- return world.isChunkLoaded((int) Math.floor(this.locX) >> 4, (int) Math.floor(this.locZ) >> 4);
+- return world.isChunkLoaded((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4);
+ return getCurrentChunk() != null;
}
// CraftBukkit end
-@@ -1709,6 +1709,43 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
+@@ -1671,6 +1671,23 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
// Paper start
@@ -124,38 +106,18 @@ index 6c7816fdc1ef476969cb70c8ea697b60746d6ab4..0d8262b1d2722e716f95db4c9a8a132c
+ */
+ public Chunk getCurrentChunk() {
+ final Chunk chunk = currentChunk != null ? currentChunk.get() : null;
-+ if (chunk != null && chunk.isLoaded()) {
++ if (chunk != null && chunk.loaded) {
+ return chunk;
+ }
+
-+ return !isAddedToChunk() ? null : ((ChunkProviderServer) world.chunkProvider).getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ());
-+ }
-+
-+ /**
-+ * Returns the chunk at the location, using the entities local cache if avail
-+ * Will only return null if the location specified is not loaded
-+ */
-+ public Chunk getCurrentChunkAt(int x, int z) {
-+ Chunk chunk = getCurrentChunk();
-+ if (chunk != null && getChunkX() == chunk.getPos().x && getChunkZ() == chunk.getPos().z) {
-+ return chunk;
-+ }
-+ return ((ChunkProviderServer) world.chunkProvider).getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ());
-+ }
-+ /**
-+ * Returns the chunk at the entities current location, using the entities local cache if avail
-+ * Ideally this is always the same as getCurrentChunk, but only becomes different in registration issues.
-+ * Will only return null if the location specified is not loaded
-+ */
-+ public Chunk getChunkAtLocation() {
-+ return getCurrentChunkAt((int)Math.floor(locX) >> 4, (int)Math.floor(locZ) >> 4);
++ return !inChunk ? null : ((WorldServer)world).getChunkProvider().getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ());
+ }
+
private MinecraftKey entityKey;
private String entityKeyString;
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
-index 9071bb7ece6d38d85b4ea11e53671f3ec5210b28..820180ab3f7053c348caa80cc21f15dfa3d26afd 100644
+index 3cae7ef750371cee741c2f27799c1bb5864a278a..f8d859cda8186d706304b4e182bca34573f09433 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
@@ -166,7 +128,7 @@ index 9071bb7ece6d38d85b4ea11e53671f3ec5210b28..820180ab3f7053c348caa80cc21f15df
+ private java.lang.ref.WeakReference currentChunk = null;
+ public Chunk getCurrentChunk() {
+ final Chunk chunk = currentChunk != null ? currentChunk.get() : null;
-+ return chunk != null && chunk.isLoaded() ? chunk : null;
++ return chunk != null && chunk.loaded ? chunk : null;
+ }
+ public void setCurrentChunk(Chunk chunk) {
+ this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null;
@@ -175,10 +137,10 @@ index 9071bb7ece6d38d85b4ea11e53671f3ec5210b28..820180ab3f7053c348caa80cc21f15df
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index 27e2379f2dd6e9e06ae7a973ab8654cdcacf66c0..9672dd7c2166bba88832b1743b97e16561fe434c 100644
+index 305de86630b442fe1fa27431fca1ac989d16dc61..e867168be3c17548490f30944ca56a635cc3b054 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-@@ -137,6 +137,7 @@ import net.minecraft.server.EntityZombieHusk;
+@@ -141,6 +141,7 @@ import net.minecraft.server.EntityZombieHusk;
import net.minecraft.server.EntityZombieVillager;
import net.minecraft.server.IChatBaseComponent;
import net.minecraft.server.NBTTagCompound;
@@ -186,7 +148,7 @@ index 27e2379f2dd6e9e06ae7a973ab8654cdcacf66c0..9672dd7c2166bba88832b1743b97e165
import org.bukkit.EntityEffect;
import org.bukkit.Location;
import org.bukkit.Server;
-@@ -178,6 +179,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+@@ -182,6 +183,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
this.entity = entity;
}
diff --git a/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch b/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch
index c1622b5e1..57cb42608 100644
--- a/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch
+++ b/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch
@@ -6,10 +6,10 @@ 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 e1ac0c479ebfa2da69575db2032dd1415c4a41a5..f1b9b937e8ced0c718db463c94d716422113c396 100644
+index bd92ed2e6d4766f4f16ec3002c41b36b5a7e0358..eb08c7467595394fff9adf4f162aba9d71d7a7c2 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 {
+@@ -57,15 +57,19 @@ public class Chunk implements IChunkAccess {
}
// Paper start
@@ -29,7 +29,7 @@ index e1ac0c479ebfa2da69575db2032dd1415c4a41a5..f1b9b937e8ced0c718db463c94d71642
}
return replaced;
}
-@@ -74,6 +78,7 @@ public class Chunk implements IChunkAccess {
+@@ -75,6 +79,7 @@ public class Chunk implements IChunkAccess {
TileEntity removed = super.remove(key);
if (removed != null) {
removed.setCurrentChunk(null);
@@ -37,7 +37,7 @@ index e1ac0c479ebfa2da69575db2032dd1415c4a41a5..f1b9b937e8ced0c718db463c94d71642
}
return removed;
}
-@@ -489,6 +494,7 @@ public class Chunk implements IChunkAccess {
+@@ -490,6 +495,7 @@ public class Chunk implements IChunkAccess {
k = this.entitySlices.length - 1;
}
@@ -45,7 +45,7 @@ index e1ac0c479ebfa2da69575db2032dd1415c4a41a5..f1b9b937e8ced0c718db463c94d71642
entity.inChunk = true;
entity.setCurrentChunk(this); // Paper
entity.chunkX = this.loc.x;
-@@ -522,6 +528,7 @@ public class Chunk implements IChunkAccess {
+@@ -523,6 +529,7 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}
diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch
index 19951169a..27c0b8507 100644
--- a/Spigot-Server-Patches/0009-Timings-v2.patch
+++ b/Spigot-Server-Patches/0009-Timings-v2.patch
@@ -544,13 +544,14 @@ index 0000000000000000000000000000000000000000..d4ebcf8f66197299256bd6b65710a148
+}
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 0000000000000000000000000000000000000000..fa1c920ea6092259149f9e7f9cd7cc1ed27bf338
+index 0000000000000000000000000000000000000000..944fd203e9f39d6c6fc9e270940c76c98067273a
--- /dev/null
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
-@@ -0,0 +1,118 @@
+@@ -0,0 +1,119 @@
+package co.aikar.timings;
+
+import net.minecraft.server.World;
++import net.minecraft.server.WorldDataServer;
+import net.minecraft.server.WorldServer;
+
+/**
@@ -608,7 +609,7 @@ index 0000000000000000000000000000000000000000..fa1c920ea6092259149f9e7f9cd7cc1e
+ public final Timing miscMobSpawning;
+
+ public WorldTimingsHandler(World server) {
-+ String name = server.worldData.getName() +" - ";
++ String name = ((WorldDataServer) server.getWorldData()).getName() + " - ";
+
+ mobSpawn = Timings.ofSafe(name + "mobSpawn");
+ doChunkUnload = Timings.ofSafe(name + "doChunkUnload");
@@ -663,14 +664,14 @@ index 0000000000000000000000000000000000000000..fa1c920ea6092259149f9e7f9cd7cc1e
+ }
+
+ public static Timing getTickList(WorldServer worldserver, String timingsType) {
-+ return Timings.ofSafe(worldserver.getWorldData().getName() + " - Scheduled " + timingsType);
++ return Timings.ofSafe(((WorldDataServer) worldserver.getWorldData()).getName() + " - Scheduled " + timingsType);
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
-index b6d470e594ce196f560ac6c94ced904b0081b205..f402a29b0904a0094ffe6e42dbdc6fbc0912d9d9 100644
+index b367bb8ea184489f433f8acc798466c38816ae62..a62f4bbb973b9cb6d1ee53f56a0897d70ae176af 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;
+@@ -14,12 +14,15 @@ import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.regex.Pattern;
@@ -678,6 +679,7 @@ index b6d470e594ce196f560ac6c94ced904b0081b205..f402a29b0904a0094ffe6e42dbdc6fbc
import net.minecraft.server.MinecraftServer;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
+ import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
+import co.aikar.timings.Timings;
@@ -685,7 +687,7 @@ index b6d470e594ce196f560ac6c94ced904b0081b205..f402a29b0904a0094ffe6e42dbdc6fbc
public class PaperConfig {
-@@ -187,4 +190,27 @@ public class PaperConfig {
+@@ -188,4 +191,27 @@ public class PaperConfig {
config.addDefault(path, def);
return config.getString(path, config.getString(path));
}
@@ -714,13 +716,13 @@ index b6d470e594ce196f560ac6c94ced904b0081b205..f402a29b0904a0094ffe6e42dbdc6fbc
+ }
}
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
-index cd72a9c84569592f9c82708a17388e594648d19d..5de881371a485957fd8fadc7540a2b549b20dd65 100644
+index c95bbcd46978522a2dce173b4c116aa39c8f2f01..3cc572b0ce757160c7ab4733b98d8ca84f9f325a 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 {
- protected final boolean q;
- protected final SoundEffectType stepSound;
- protected final Material material;
+@@ -24,6 +24,15 @@ public class Block extends BlockBase implements IMaterial {
+ private static final VoxelShape c = a(7.0D, 0.0D, 7.0D, 9.0D, 10.0D, 9.0D);
+ protected final BlockStateList blockStateList;
+ private IBlockData blockData;
+ // Paper start
+ public co.aikar.timings.Timing timing;
+ public co.aikar.timings.Timing getTiming() {
@@ -730,14 +732,14 @@ index cd72a9c84569592f9c82708a17388e594648d19d..5de881371a485957fd8fadc7540a2b54
+ return timing;
+ }
+ // Paper end
- protected final MaterialMapColor t;
- private final float frictionFactor;
- private final float f;
+ @Nullable
+ private String name;
+ @Nullable
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
-index f1b9b937e8ced0c718db463c94d716422113c396..43dc791191cdf2aa3e5cb2768c25e6be4b2cf6b1 100644
+index eb08c7467595394fff9adf4f162aba9d71d7a7c2..09b4594ae6750252b4b13ed4735dad0d00e2aeec 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
-@@ -692,6 +692,7 @@ public class Chunk implements IChunkAccess {
+@@ -693,6 +693,7 @@ public class Chunk implements IChunkAccess {
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(this.bukkitChunk, this.needsDecoration));
if (this.needsDecoration) {
@@ -745,7 +747,7 @@ index f1b9b937e8ced0c718db463c94d716422113c396..43dc791191cdf2aa3e5cb2768c25e6be
this.needsDecoration = false;
java.util.Random random = new java.util.Random();
random.setSeed(world.getSeed());
-@@ -711,6 +712,7 @@ public class Chunk implements IChunkAccess {
+@@ -712,6 +713,7 @@ public class Chunk implements IChunkAccess {
}
}
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
@@ -754,10 +756,10 @@ index f1b9b937e8ced0c718db463c94d716422113c396..43dc791191cdf2aa3e5cb2768c25e6be
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-index 64d84b334d211fe39e808d2c8b5d457757fb1359..83707fa6ae5cf4f564760ca0fb5e8c1932d4a91e 100644
+index 359441cd993a95f933f23aebcec8180f314a5f09..7dd9c5eec53631d25ae511b1e57bdadfe28ce289 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-@@ -318,11 +318,13 @@ public class ChunkProviderServer extends IChunkProvider {
+@@ -319,11 +319,13 @@ public class ChunkProviderServer extends IChunkProvider {
}
gameprofilerfiller.c("getChunkCacheMiss");
@@ -773,7 +775,7 @@ index 64d84b334d211fe39e808d2c8b5d457757fb1359..83707fa6ae5cf4f564760ca0fb5e8c19
ichunkaccess = (IChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
return ichunkaccess1;
}, (playerchunk_failure) -> {
-@@ -515,7 +517,9 @@ public class ChunkProviderServer extends IChunkProvider {
+@@ -510,7 +512,9 @@ public class ChunkProviderServer extends IChunkProvider {
public void save(boolean flag) {
this.tickDistanceManager();
@@ -783,7 +785,7 @@ index 64d84b334d211fe39e808d2c8b5d457757fb1359..83707fa6ae5cf4f564760ca0fb5e8c19
}
@Override
-@@ -552,7 +556,9 @@ public class ChunkProviderServer extends IChunkProvider {
+@@ -547,7 +551,9 @@ public class ChunkProviderServer extends IChunkProvider {
this.tickDistanceManager();
this.world.timings.doChunkMap.stopTiming(); // Spigot
this.world.getMethodProfiler().exitEnter("chunks");
@@ -793,50 +795,44 @@ index 64d84b334d211fe39e808d2c8b5d457757fb1359..83707fa6ae5cf4f564760ca0fb5e8c19
this.world.timings.doChunkUnload.startTiming(); // Spigot
this.world.getMethodProfiler().exitEnter("unload");
this.playerChunkMap.unloadChunks(booleansupplier);
-@@ -583,10 +589,12 @@ public class ChunkProviderServer extends IChunkProvider {
- // CraftBukkit end
+@@ -571,8 +577,10 @@ public class ChunkProviderServer extends IChunkProvider {
+ boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit
this.world.getMethodProfiler().enter("naturalSpawnCount");
+ this.world.timings.countNaturalMobs.startTiming(); // Paper - timings
int l = this.chunkMapDistance.b();
- EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values();
- Object2IntMap object2intmap = this.world.l();
-
+ SpawnerCreature.d spawnercreature_d = SpawnerCreature.a(l, this.world.z(), this::a);
+ this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings
- this.world.getMethodProfiler().exit();
- this.playerChunkMap.f().forEach((playerchunk) -> {
- Optional optional = ((Either) playerchunk.b().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
-@@ -595,11 +603,14 @@ public class ChunkProviderServer extends IChunkProvider {
- Chunk chunk = (Chunk) optional.get();
+ this.p = spawnercreature_d;
+ this.world.getMethodProfiler().exit();
+@@ -583,7 +591,9 @@ public class ChunkProviderServer extends IChunkProvider {
+
+ if (optional.isPresent()) {
this.world.getMethodProfiler().enter("broadcast");
+ this.world.timings.broadcastChunkUpdates.startTiming(); // Paper - timings
- playerchunk.a(chunk);
+ playerchunk.a((Chunk) optional.get());
+ this.world.timings.broadcastChunkUpdates.stopTiming(); // Paper - timings
this.world.getMethodProfiler().exit();
- ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
+ Optional optional1 = ((Either) playerchunk.b().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
- if (!this.playerChunkMap.isOutsideOfRange(chunkcoordintpair)) {
-+ // Paper end
- chunk.setInhabitedTime(chunk.getInhabitedTime() + j);
- if (flag1 && (this.allowMonsters || this.allowAnimals) && this.world.getWorldBorder().isInBounds(chunk.getPos()) && !this.playerChunkMap.isOutsideOfRange(chunkcoordintpair, true)) { // Spigot
- this.world.getMethodProfiler().enter("spawner");
-@@ -650,24 +661,24 @@ public class ChunkProviderServer extends IChunkProvider {
- this.world.getMethodProfiler().exit();
+@@ -597,25 +607,25 @@ public class ChunkProviderServer extends IChunkProvider {
+ SpawnerCreature.a(this.world, chunk, spawnercreature_d, this.allowAnimals, this.allowMonsters, flag2);
+ }
+
+- this.world.timings.doTickTiles.startTiming(); // Spigot
++ this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
+ this.world.a(chunk, k);
+- this.world.timings.doTickTiles.stopTiming(); // Spigot
++ this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
}
-
-- this.world.timings.doTickTiles.startTiming(); // Spigot
-+ this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
- this.world.a(chunk, k);
-- this.world.timings.doTickTiles.stopTiming(); // Spigot
-+ this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
}
}
});
this.world.getMethodProfiler().enter("customSpawners");
if (flag1) {
+ try (co.aikar.timings.Timing ignored = this.world.timings.miscMobSpawning.startTiming()) { // Paper - timings
- this.chunkGenerator.doMobSpawning(this.world, this.allowMonsters, this.allowAnimals);
+ this.world.doMobSpawning(this.allowMonsters, this.allowAnimals);
+ } // Paper - timings
}
@@ -849,9 +845,9 @@ index 64d84b334d211fe39e808d2c8b5d457757fb1359..83707fa6ae5cf4f564760ca0fb5e8c19
- this.world.timings.tracker.stopTiming(); // Spigot
}
- @Override
+ private void a(long i, Consumer consumer) {
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
-index e16d30f2cafcbc5edbcd58d97703686aaf1537d5..13d99de2cd08de02215031a1f699110c13ef35ff 100644
+index 79e0e65a35945a6071cf08f688311ec4d1f71c72..28039aa8421207ce04840cc90e03d21bc8b7269f 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -1,5 +1,6 @@
@@ -861,7 +857,7 @@ index e16d30f2cafcbc5edbcd58d97703686aaf1537d5..13d99de2cd08de02215031a1f699110c
import com.google.common.collect.Maps;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
import it.unimi.dsi.fastutil.longs.LongSet;
-@@ -388,7 +389,6 @@ public class ChunkRegionLoader {
+@@ -392,7 +393,6 @@ public class ChunkRegionLoader {
private static void loadEntities(NBTTagCompound nbttagcompound, Chunk chunk) {
NBTTagList nbttaglist = nbttagcompound.getList("Entities", 10);
World world = chunk.getWorld();
@@ -869,7 +865,7 @@ index e16d30f2cafcbc5edbcd58d97703686aaf1537d5..13d99de2cd08de02215031a1f699110c
for (int i = 0; i < nbttaglist.size(); ++i) {
NBTTagCompound nbttagcompound1 = nbttaglist.getCompound(i);
-@@ -400,8 +400,6 @@ public class ChunkRegionLoader {
+@@ -404,8 +404,6 @@ public class ChunkRegionLoader {
chunk.d(true);
}
@@ -878,7 +874,7 @@ index e16d30f2cafcbc5edbcd58d97703686aaf1537d5..13d99de2cd08de02215031a1f699110c
NBTTagList nbttaglist1 = nbttagcompound.getList("TileEntities", 10);
for (int j = 0; j < nbttaglist1.size(); ++j) {
-@@ -418,8 +416,6 @@ public class ChunkRegionLoader {
+@@ -423,8 +421,6 @@ public class ChunkRegionLoader {
}
}
}
@@ -886,9 +882,9 @@ index e16d30f2cafcbc5edbcd58d97703686aaf1537d5..13d99de2cd08de02215031a1f699110c
-
}
- private static NBTTagCompound a(ChunkCoordIntPair chunkcoordintpair, Map map, Map map1) {
+ private static NBTTagCompound a(ChunkCoordIntPair chunkcoordintpair, Map, StructureStart>> map, Map, LongSet> map1) {
diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java
-index 8d7a6d2403722c7e7ff437f8e153ffa6194679d7..707bd2600d19699f58405eaa23ec36f406ca20ba 100644
+index 6d628c759346701c4097f36c302d1a1ab258bf9c..dd945eb709f75da58889002c9b8f7c22aaeeb30f 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 {
@@ -915,32 +911,23 @@ index 8d7a6d2403722c7e7ff437f8e153ffa6194679d7..707bd2600d19699f58405eaa23ec36f4
return this.b;
}
diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java
-index ba40d5fbb5fe69225d25bdc4e299857f5ab21b40..ee42e1dfa493c3d7f5af8cc7b8e17e80fcb32b71 100644
+index 903cbd10fba18e61a4dc3ced71e22a665b78f177..423e4d12aba9197b936e69dfd4146ceeca3a30c4 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 {
+@@ -69,7 +69,7 @@ public class CustomFunctionData {
} else {
int j;
- try {
+ try (co.aikar.timings.Timing timing = customfunction.getTiming().startTiming()) { // Paper
- this.h = true;
+ this.d = true;
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 9eed98e3796be6d49dc51af9038a7376c94edeee..d6646d7e61b63c116fa87951b0ef3131b68ebe97 100644
+index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e00ed83c9 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;
- import java.util.Locale;
- import java.util.Optional;
- import java.util.Random;
-+import java.util.concurrent.CompletableFuture;
-+import java.util.concurrent.ExecutionException;
- import java.util.function.BooleanSupplier;
- import java.util.regex.Pattern;
- import javax.annotation.Nullable;
-@@ -32,7 +34,7 @@ import org.apache.logging.log4j.Level;
+@@ -28,7 +28,7 @@ import org.apache.logging.log4j.Level;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.LoggerOutputStream;
@@ -949,7 +936,7 @@ index 9eed98e3796be6d49dc51af9038a7376c94edeee..d6646d7e61b63c116fa87951b0ef3131
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.craftbukkit.util.Waitable;
import org.bukkit.event.server.RemoteServerCommandEvent;
-@@ -438,7 +440,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
+@@ -381,7 +381,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
public void handleCommandQueue() {
@@ -958,7 +945,7 @@ index 9eed98e3796be6d49dc51af9038a7376c94edeee..d6646d7e61b63c116fa87951b0ef3131
while (!this.serverCommandQueue.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
-@@ -453,7 +455,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
+@@ -396,7 +396,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
// CraftBukkit end
}
@@ -967,7 +954,7 @@ index 9eed98e3796be6d49dc51af9038a7376c94edeee..d6646d7e61b63c116fa87951b0ef3131
}
@Override
-@@ -679,6 +681,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
+@@ -627,6 +627,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@Override
public String executeRemoteCommand(String s) {
@@ -975,7 +962,7 @@ index 9eed98e3796be6d49dc51af9038a7376c94edeee..d6646d7e61b63c116fa87951b0ef3131
this.remoteControlCommandListener.clearMessages();
this.executeSync(() -> {
// CraftBukkit start - fire RemoteServerCommandEvent
-@@ -687,10 +690,39 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
+@@ -635,10 +636,39 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
if (event.isCancelled()) {
return;
}
@@ -1016,7 +1003,7 @@ index 9eed98e3796be6d49dc51af9038a7376c94edeee..d6646d7e61b63c116fa87951b0ef3131
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
-index 0d8262b1d2722e716f95db4c9a8a132c54b613cf..19d68aa4585ccfc156e9db6024b7a99bbeca4de4 100644
+index e3f2e259b2c5e478bde45554995b9c742d9e2008..98eec5efe474011665bd819d0d0b11abd6a068ea 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;
@@ -1038,27 +1025,27 @@ index 0d8262b1d2722e716f95db4c9a8a132c54b613cf..19d68aa4585ccfc156e9db6024b7a99b
// Spigot start
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
-@@ -504,7 +505,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
+@@ -526,7 +527,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public void move(EnumMoveType enummovetype, Vec3D vec3d) {
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.startTiming(); // Spigot
if (this.noclip) {
- this.a(this.getBoundingBox().b(vec3d));
+ this.a(this.getBoundingBox().c(vec3d));
this.recalcPosition();
-@@ -656,7 +656,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
+@@ -663,7 +663,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.world.getMethodProfiler().exit();
}
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
}
- protected BlockPosition ag() {
+ protected BlockPosition ak() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
-index 3ace8ee854c11abd607dc27b93fe61a0982a73de..690c1ce0f6707b2f5dd787e0fe340af5bd719783 100644
+index dccb315440f7429fe881bd0d12af8f1ae8e35c3d..96a95413f74592ef0a8e9367fd3ed81fc0a2c2fe 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;
+@@ -41,7 +41,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
// CraftBukkit end
@@ -1067,15 +1054,15 @@ index 3ace8ee854c11abd607dc27b93fe61a0982a73de..690c1ce0f6707b2f5dd787e0fe340af5
public abstract class EntityLiving extends Entity {
-@@ -2265,7 +2265,6 @@ public abstract class EntityLiving extends Entity {
+@@ -2335,7 +2335,6 @@ public abstract class EntityLiving extends Entity {
@Override
public void tick() {
- SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot
super.tick();
- this.o();
- this.r();
-@@ -2353,9 +2352,7 @@ public abstract class EntityLiving extends Entity {
+ this.u();
+ this.x();
+@@ -2384,9 +2383,7 @@ public abstract class EntityLiving extends Entity {
}
}
@@ -1085,7 +1072,7 @@ index 3ace8ee854c11abd607dc27b93fe61a0982a73de..690c1ce0f6707b2f5dd787e0fe340af5
double d0 = this.locX() - this.lastX;
double d1 = this.locZ() - this.lastZ;
float f = (float) (d0 * d0 + d1 * d1);
-@@ -2435,8 +2432,6 @@ public abstract class EntityLiving extends Entity {
+@@ -2466,8 +2463,6 @@ public abstract class EntityLiving extends Entity {
if (this.isSleeping()) {
this.pitch = 0.0F;
}
@@ -1093,16 +1080,16 @@ index 3ace8ee854c11abd607dc27b93fe61a0982a73de..690c1ce0f6707b2f5dd787e0fe340af5
- SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot
}
- protected float f(float f, float f1) {
-@@ -2515,7 +2510,6 @@ public abstract class EntityLiving extends Entity {
+ private void q() {
+@@ -2649,7 +2644,6 @@ public abstract class EntityLiving extends Entity {
this.setMot(d4, d5, d6);
this.world.getMethodProfiler().enter("ai");
- SpigotTimings.timerEntityAI.startTiming(); // Spigot
if (this.isFrozen()) {
this.jumping = false;
- this.aZ = 0.0F;
-@@ -2525,7 +2519,6 @@ public abstract class EntityLiving extends Entity {
+ this.aY = 0.0F;
+@@ -2659,7 +2653,6 @@ public abstract class EntityLiving extends Entity {
this.doTick();
this.world.getMethodProfiler().exit();
}
@@ -1110,17 +1097,17 @@ index 3ace8ee854c11abd607dc27b93fe61a0982a73de..690c1ce0f6707b2f5dd787e0fe340af5
this.world.getMethodProfiler().exit();
this.world.getMethodProfiler().enter("jump");
-@@ -2549,9 +2542,7 @@ public abstract class EntityLiving extends Entity {
- this.n();
+@@ -2694,9 +2687,7 @@ public abstract class EntityLiving extends Entity {
+ this.t();
AxisAlignedBB axisalignedbb = this.getBoundingBox();
- SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
- this.e(new Vec3D((double) this.aZ, (double) this.ba, (double) this.bb));
+ this.f(new Vec3D((double) this.aY, (double) this.aZ, (double) this.ba));
- SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
this.world.getMethodProfiler().exit();
this.world.getMethodProfiler().enter("push");
- if (this.bn > 0) {
-@@ -2559,9 +2550,7 @@ public abstract class EntityLiving extends Entity {
+ if (this.bm > 0) {
+@@ -2704,9 +2695,7 @@ public abstract class EntityLiving extends Entity {
this.a(axisalignedbb, this.getBoundingBox());
}
@@ -1128,13 +1115,13 @@ index 3ace8ee854c11abd607dc27b93fe61a0982a73de..690c1ce0f6707b2f5dd787e0fe340af5
this.collideNearby();
- SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
this.world.getMethodProfiler().exit();
- }
-
+ if (!this.world.isClientSide && this.dN() && this.aC()) {
+ this.damageEntity(DamageSource.DROWN, 1.0F);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 786d38438cc1bd5a736b2dfa80aca9b9c6253e65..5429d8eee93980a01cdf008b57e88e1dccc1ef67 100644
+index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb5353113ea039a0 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;
+@@ -65,7 +65,7 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.Main;
import org.bukkit.event.server.ServerLoadEvent;
// CraftBukkit end
@@ -1142,19 +1129,19 @@ index 786d38438cc1bd5a736b2dfa80aca9b9c6253e65..5429d8eee93980a01cdf008b57e88e1d
+import co.aikar.timings.MinecraftTimings; // Paper
import org.spigotmc.SlackActivityAccountant; // Spigot
- public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable, Runnable {
-@@ -128,8 +128,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable {
+@@ -119,8 +119,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant resourcePackRepository;
+ private final ScoreboardServer scoreboardServer;
@Nullable
-@@ -694,6 +694,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= 5000000000L) {
-@@ -1000,14 +1021,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= 5000000000L) {
+@@ -1025,14 +1046,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit
@@ -1231,7 +1218,7 @@ index 786d38438cc1bd5a736b2dfa80aca9b9c6253e65..5429d8eee93980a01cdf008b57e88e1d
}
this.methodProfiler.enter("snooper");
-@@ -1020,6 +1039,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> f(ChunkCoordIntPair chunkcoordintpair) {
return CompletableFuture.supplyAsync(() -> {
@@ -1356,7 +1343,7 @@ index b505244516321292e56609eaa54693d84e0bf617..65134c87772cb6d4d732fc223929cfda
boolean flag = nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8);
if (flag) {
-@@ -522,7 +527,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -524,7 +529,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
PlayerChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", chunkcoordintpair);
@@ -1365,7 +1352,7 @@ index b505244516321292e56609eaa54693d84e0bf617..65134c87772cb6d4d732fc223929cfda
} catch (ReportedException reportedexception) {
Throwable throwable = reportedexception.getCause();
-@@ -549,7 +554,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -561,7 +566,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return "chunkGenerate " + chunkstatus.d();
});
return completablefuture.thenComposeAsync((either) -> {
@@ -1374,7 +1361,7 @@ index b505244516321292e56609eaa54693d84e0bf617..65134c87772cb6d4d732fc223929cfda
try {
CompletableFuture> completablefuture1 = chunkstatus.a(this.world, this.chunkGenerator, this.definedStructureManager, this.lightEngine, (ichunkaccess) -> {
return this.c(playerchunk);
-@@ -602,6 +607,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -614,6 +619,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) -> {
@@ -1382,7 +1369,7 @@ index b505244516321292e56609eaa54693d84e0bf617..65134c87772cb6d4d732fc223929cfda
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
Chunk chunk;
-@@ -653,6 +659,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -665,6 +671,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
return chunk;
@@ -1390,7 +1377,7 @@ index b505244516321292e56609eaa54693d84e0bf617..65134c87772cb6d4d732fc223929cfda
});
}, (runnable) -> {
Mailbox mailbox = this.mailboxMain;
-@@ -1094,6 +1101,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1123,6 +1130,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
PlayerChunkMap.EntityTracker playerchunkmap_entitytracker;
ObjectIterator objectiterator;
@@ -1398,7 +1385,7 @@ index b505244516321292e56609eaa54693d84e0bf617..65134c87772cb6d4d732fc223929cfda
for (objectiterator = this.trackedEntities.values().iterator(); objectiterator.hasNext(); playerchunkmap_entitytracker.trackerEntry.a()) {
playerchunkmap_entitytracker = (PlayerChunkMap.EntityTracker) objectiterator.next();
-@@ -1111,16 +1119,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
+@@ -1140,16 +1148,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
playerchunkmap_entitytracker.e = sectionposition1;
}
}
@@ -1420,7 +1407,7 @@ index b505244516321292e56609eaa54693d84e0bf617..65134c87772cb6d4d732fc223929cfda
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 f40cb14d5301631161f1701043ee987359d9a8e9..87119b4fe5ae27c63d272c8e436e3734eddd8f68 100644
+index b8d3c4d35cee2ba4678f6d22b8ea956d598d9d9b..88fa8d63c5bb2c76ba09db6bb002f6d6b6a42afc 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;
@@ -1441,13 +1428,13 @@ index f40cb14d5301631161f1701043ee987359d9a8e9..87119b4fe5ae27c63d272c8e436e3734
this.player.lastY = this.player.locY();
@@ -211,7 +211,6 @@ public class PlayerConnection implements PacketListenerPlayIn {
this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854
- this.disconnect(new ChatMessage("multiplayer.disconnect.idling", new Object[0]));
+ this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
}
- org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.stopTiming(); // Spigot
}
-@@ -1639,7 +1638,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
+@@ -1684,7 +1683,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
// CraftBukkit end
private void handleCommand(String s) {
@@ -1456,7 +1443,7 @@ index f40cb14d5301631161f1701043ee987359d9a8e9..87119b4fe5ae27c63d272c8e436e3734
// CraftBukkit start - whole method
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getName() + " issued server command: " + s);
-@@ -1650,7 +1649,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
+@@ -1695,7 +1694,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
this.server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -1465,7 +1452,7 @@ index f40cb14d5301631161f1701043ee987359d9a8e9..87119b4fe5ae27c63d272c8e436e3734
return;
}
-@@ -1663,7 +1662,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
+@@ -1708,7 +1707,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return;
} finally {
@@ -1502,7 +1489,7 @@ index 2c671629a43f42da8335e7216f9fd399bb878729..eb3269e0ea3ce33d08e9eee3bca7cf43
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 7e8c50aa92e036b88b1fd725021c31846eb06097..79cfcbce85e779fc8e8589840a27961f59209f3d 100644
+index b9b055923bb70e7b9fc9cd69c28bd06d7836a38c..213e8512247e9873563ad606a7e3a2a3ca409718 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1,5 +1,6 @@
@@ -1512,7 +1499,7 @@ index 7e8c50aa92e036b88b1fd725021c31846eb06097..79cfcbce85e779fc8e8589840a27961f
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
-@@ -898,10 +899,11 @@ public abstract class PlayerList {
+@@ -941,10 +942,11 @@ public abstract class PlayerList {
}
public void savePlayers() {
@@ -1526,20 +1513,19 @@ index 7e8c50aa92e036b88b1fd725021c31846eb06097..79cfcbce85e779fc8e8589840a27961f
public WhiteList getWhitelist() {
diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java
-index 00bbd34b6a2a8185bc6395d6c85bce6353c3cbc4..f533860bbed19ff2915c90186c259b466f41ce90 100644
+index e8ff43662b8397229cb19ea26342b66c88807379..3b8f56c0f0507ebdd9ac20be70688b4c0cfe4cf8 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 implements TickList {
- private final List> h = Lists.newArrayList();
- private final Consumer> i;
+@@ -26,12 +26,17 @@ public class TickListServer implements TickList