diff --git a/.github/ISSUE_TEMPLATE/behavior-bug---plugin-incompatibility.md b/.github/ISSUE_TEMPLATE/behavior-bug---plugin-incompatibility.md
index 72ab6a7961..8e504d24c1 100644
--- a/.github/ISSUE_TEMPLATE/behavior-bug---plugin-incompatibility.md
+++ b/.github/ISSUE_TEMPLATE/behavior-bug---plugin-incompatibility.md
@@ -4,6 +4,9 @@ about: Server Bug or Plugin Incompatibility
---
+
+
+
### What behaviour is expected:
___What you expected to see___
@@ -16,8 +19,8 @@ ___This may include a build schematic, a video, or detailed instructions to help
### Plugin list:
___A list of your plugins___
-### Paper build number:
-___This can be found by running `/version` on your server. `latest` is not a proper version number; we require the output of `/version` so we can properly track down the issue.___
+### Paper version:
+___Paste the output of running `/version` on your server WITH the Minecraft version. `latest` is not a version; we require the output of `/version` so we can properly track down the issue.___
### Anything else:
___Anything else you think may help us resolve the problem___
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index 066b2d920a..4d73ef7953 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -4,6 +4,8 @@ about: Suggest an idea for this project
---
+
+
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
diff --git a/.github/ISSUE_TEMPLATE/performance-problem.md b/.github/ISSUE_TEMPLATE/performance-problem.md
index 8b50dae939..15f324b995 100644
--- a/.github/ISSUE_TEMPLATE/performance-problem.md
+++ b/.github/ISSUE_TEMPLATE/performance-problem.md
@@ -4,6 +4,9 @@ about: Report performance problems or areas of concern
---
+
+
+
### Timings or Profile link:
___We ask that all timings/profiles are a link, not a screenshot. Screenshots inhibit our ability to figure out the real cause of the issue.___
@@ -20,5 +23,5 @@ ___Gist/pastebin/hastebin links___
___The more information we receive, the quicker and more effective we can be at finding the solution to the
issue.___
-### Paper build number:
-___This can be found by running `/version` on your server. `latest` is not a proper version number; we require the output of `/version` so we can properly track down the issue.___
+### Paper version:
+___Paste the output of running `/version` on your server WITH the Minecraft version. `latest` is not a version; we require the output of `/version` so we can properly track down the issue.___
diff --git a/.github/ISSUE_TEMPLATE/server-crash---stacktrace.md b/.github/ISSUE_TEMPLATE/server-crash---stacktrace.md
index 52a2e23a5b..ce43c364a7 100644
--- a/.github/ISSUE_TEMPLATE/server-crash---stacktrace.md
+++ b/.github/ISSUE_TEMPLATE/server-crash---stacktrace.md
@@ -4,6 +4,9 @@ about: Report server crashes and/or scary stacktraces
---
+
+
+
### Link/paste of stack trace
You can also simply just use code formatting in markdown!
@@ -18,5 +21,5 @@ ___A list of your plugins___
### Actions to reproduce (if known):
___This may include a build schematic, a video, or detailed instructions to help reconstruct the issue___
-### Paper build number:
-___This can be found by running `/version` on your server. `latest` is not a proper version number; we require the output of `/version` so we can properly track down the issue.___
+### Paper version:
+___Paste the output of running `/version` on your server WITH the Minecraft version. `latest` is not a version; we require the output of `/version` so we can properly track down the issue.___
diff --git a/.travis.yml b/.travis.yml
index d6fd711072..66e0062c66 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
language: java
-sudo: required
-dist: trusty
+dist: focal
+os: linux
jdk:
- oraclejdk8
- openjdk11
diff --git a/Paper-MojangAPI/pom.xml b/Paper-MojangAPI/pom.xml
index 4c7c62c787..03a17db372 100644
--- a/Paper-MojangAPI/pom.xml
+++ b/Paper-MojangAPI/pom.xml
@@ -10,7 +10,7 @@
com.destroystokyo.paper
paper-mojangapi
- 1.16.1-R0.1-SNAPSHOT
+ 1.16.2-R0.1-SNAPSHOT
jar
Paper-MojangAPI
diff --git a/SHIT_TO_CHECK.md b/SHIT_TO_CHECK.md
index d6eeb9a774..4d45751d17 100644
--- a/SHIT_TO_CHECK.md
+++ b/SHIT_TO_CHECK.md
@@ -5,4 +5,5 @@
* Make sure the flat bedrock setting doesn't do anything stupid
* Check DataBits foreach
* lighting is bork (load chunk, fly away, come back, everything or parts are black)
-* chunk generation seems slow with a lot of it happening
\ No newline at end of file
+* chunk generation seems slow with a lot of it happening
+* Fix IDE Debug JVM Flag for new versions of minecraft
diff --git a/Spigot-API-Patches/0219-Brand-support.patch b/Spigot-API-Patches/0220-Brand-support.patch
similarity index 100%
rename from Spigot-API-Patches/0219-Brand-support.patch
rename to Spigot-API-Patches/0220-Brand-support.patch
diff --git a/Spigot-API-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-API-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch
index ff37525d21..87734f2f91 100644
--- a/Spigot-API-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch
+++ b/Spigot-API-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch
@@ -9,10 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/ArmorStand.java
+++ b/src/main/java/org/bukkit/entity/ArmorStand.java
@@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity {
- * @param marker whether this is a marker
- */
- void setMarker(boolean marker);
-+
+ */
+ ADDING;
+ }
+ // Paper start
+ /**
+ * Tests if this armor stand can move.
diff --git a/Spigot-API-Patches/Add-Material-Tags.patch b/Spigot-API-Patches/Add-Material-Tags.patch
index 35bff2b47d..82c406174a 100644
--- a/Spigot-API-Patches/Add-Material-Tags.patch
+++ b/Spigot-API-Patches/Add-Material-Tags.patch
@@ -518,7 +518,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
+ .endsWith("_SPAWN_EGG")
-+ .ensureSize("SPAWN_EGGS", 63);
++ .ensureSize("SPAWN_EGGS", 64);
+
+ /**
+ * Covers all colors of stained glass.
diff --git a/Spigot-API-Patches/Add-Mob-Goal-API.patch b/Spigot-API-Patches/Add-Mob-Goal-API.patch
index 76fc3d5e28..d7212f3286 100644
--- a/Spigot-API-Patches/Add-Mob-Goal-API.patch
+++ b/Spigot-API-Patches/Add-Mob-Goal-API.patch
@@ -356,6 +356,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ GoalKey SLIME_RANDOM_JUMP = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_random_jump"));
+ GoalKey SPIDER_MELEE_ATTACK = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider_melee_attack"));
+ GoalKey SPIDER_NEAREST_ATTACKABLE_TARGET = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider_nearest_attackable_target"));
++ GoalKey STRIDER_GO_TO_LAVA = GoalKey.of(Strider.class, NamespacedKey.minecraft("strider_go_to_lava"));
+ GoalKey SQUID = GoalKey.of(Squid.class, NamespacedKey.minecraft("squid"));
+ GoalKey SQUID_FLEE = GoalKey.of(Squid.class, NamespacedKey.minecraft("squid_flee"));
+ GoalKey TURTLE_BREED = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_breed"));
diff --git a/Spigot-API-Patches/Add-item-slot-convenience-methods.patch b/Spigot-API-Patches/Add-item-slot-convenience-methods.patch
index ef9b23cf95..cd7c308bee 100644
--- a/Spigot-API-Patches/Add-item-slot-convenience-methods.patch
+++ b/Spigot-API-Patches/Add-item-slot-convenience-methods.patch
@@ -177,6 +177,80 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
}
+diff --git a/src/main/java/org/bukkit/inventory/SmithingInventory.java b/src/main/java/org/bukkit/inventory/SmithingInventory.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/org/bukkit/inventory/SmithingInventory.java
++++ b/src/main/java/org/bukkit/inventory/SmithingInventory.java
+@@ -0,0 +0,0 @@
+ package org.bukkit.inventory;
+
++import org.jetbrains.annotations.Nullable; // Paper
++
+ /**
+ * Interface to the inventory of a Smithing table.
+ */
+-public interface SmithingInventory extends Inventory { }
++public interface SmithingInventory extends Inventory {
++
++ // Paper start
++ /**
++ * Gets the input equipment (first slot).
++ *
++ * @return input equipment item
++ */
++ @Nullable
++ default ItemStack getInputEquipment() {
++ return getItem(0);
++ }
++
++ /**
++ * Sets the input equipment (first slot).
++ *
++ * @param itemStack item to set
++ */
++ default void setInputEquipment(@Nullable ItemStack itemStack) {
++ setItem(0, itemStack);
++ }
++
++ /**
++ * Gets the input mineral (second slot).
++ *
++ * @return input mineral item
++ */
++ @Nullable
++ default ItemStack getInputMineral() {
++ return getItem(1);
++ }
++
++ /**
++ * Sets the input mineral (second slot).
++ *
++ * @param itemStack item to set
++ */
++ default void setInputMineral(@Nullable ItemStack itemStack) {
++ setItem(1, itemStack);
++ }
++
++ /**
++ * Gets the result item.
++ *
++ * @return result
++ */
++ @Nullable
++ default ItemStack getResult() {
++ return getItem(2);
++ }
++
++ /**
++ * Sets the result item.
++ *
++ * @param itemStack item to set
++ */
++ default void setResult(@Nullable ItemStack itemStack) {
++ setItem(2, itemStack);
++ }
++ // Paper end
++}
diff --git a/src/main/java/org/bukkit/inventory/StonecutterInventory.java b/src/main/java/org/bukkit/inventory/StonecutterInventory.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/StonecutterInventory.java
diff --git a/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch b/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch
index 60beec2e6e..40f0ce2b34 100644
--- a/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch
+++ b/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch
@@ -12,7 +12,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
*/
@Deprecated
public void setShoulderEntityRight(@Nullable Entity entity);
-+
+ // Paper start - Add method to open already placed sign
+ /**
+ * Opens an editor window for the specified sign
@@ -21,4 +20,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ void openSign(@NotNull org.bukkit.block.Sign sign);
+ // Paper end
- }
+
+ /**
+ * Make the entity drop the item in their hand.
diff --git a/Spigot-API-Patches/Add-moon-phase-API.patch b/Spigot-API-Patches/Add-moon-phase-API.patch
new file mode 100644
index 0000000000..b49930cf04
--- /dev/null
+++ b/Spigot-API-Patches/Add-moon-phase-API.patch
@@ -0,0 +1,65 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: BillyGalbreath
+Date: Sun, 23 Aug 2020 16:32:03 +0200
+Subject: [PATCH] Add moon phase API
+
+
+diff --git a/src/main/java/io/papermc/paper/world/MoonPhase.java b/src/main/java/io/papermc/paper/world/MoonPhase.java
+new file mode 100644
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
+--- /dev/null
++++ b/src/main/java/io/papermc/paper/world/MoonPhase.java
+@@ -0,0 +0,0 @@
++package io.papermc.paper.world;
++
++import org.jetbrains.annotations.NotNull;
++
++import java.util.HashMap;
++import java.util.Map;
++
++public enum MoonPhase {
++ FULL_MOON(0L),
++ WANING_GIBBOUS(1L),
++ LAST_QUARTER(2L),
++ WANING_CRESCENT(3L),
++ NEW_MOON(4L),
++ WAXING_CRESCENT(5L),
++ FIRST_QUARTER(6L),
++ WAXING_GIBBOUS(7L);
++
++ private final long day;
++
++ MoonPhase(long day) {
++ this.day = day;
++ }
++
++ private static final Map BY_DAY = new HashMap<>();
++
++ static {
++ for (MoonPhase phase : values()) {
++ BY_DAY.put(phase.day, phase);
++ }
++ }
++
++ @NotNull
++ public static MoonPhase getPhase(long day) {
++ return BY_DAY.get(day % 8L);
++ }
++}
+diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/org/bukkit/World.java
++++ b/src/main/java/org/bukkit/World.java
+@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
+ * @return The amount of Players in this world
+ */
+ int getPlayerCount();
++
++ /**
++ * @return the current moon phase at the current time in the world
++ */
++ @NotNull
++ io.papermc.paper.world.MoonPhase getMoonPhase();
+ // Paper end
+
+ /**
diff --git a/Spigot-API-Patches/Add-more-Zombie-API.patch b/Spigot-API-Patches/Add-more-Zombie-API.patch
index e1760159a6..805f9554fc 100644
--- a/Spigot-API-Patches/Add-more-Zombie-API.patch
+++ b/Spigot-API-Patches/Add-more-Zombie-API.patch
@@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/buk
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Zombie.java
+++ b/src/main/java/org/bukkit/entity/Zombie.java
-@@ -0,0 +0,0 @@ public interface Zombie extends Monster {
+@@ -0,0 +0,0 @@ public interface Zombie extends Monster, Ageable {
* @param time new conversion time
*/
void setConversionTime(int time);
diff --git a/Spigot-API-Patches/Add-setMaxPlayers-API.patch b/Spigot-API-Patches/Add-setMaxPlayers-API.patch
new file mode 100644
index 0000000000..5544f22500
--- /dev/null
+++ b/Spigot-API-Patches/Add-setMaxPlayers-API.patch
@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mariell Hoversholm
+Date: Sat, 22 Aug 2020 23:59:25 +0200
+Subject: [PATCH] Add #setMaxPlayers API
+
+
+diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/org/bukkit/Bukkit.java
++++ b/src/main/java/org/bukkit/Bukkit.java
+@@ -0,0 +0,0 @@ public final class Bukkit {
+ return server.getMaxPlayers();
+ }
+
++ // Paper start
++ /**
++ * Set the maximum amount of players which can login to this server.
++ *
++ * @param maxPlayers the amount of players this server allows
++ */
++ public static void setMaxPlayers(int maxPlayers) {
++ server.setMaxPlayers(maxPlayers);
++ }
++ // Paper end
++
+ /**
+ * Get the game port that the server runs on.
+ *
+diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/org/bukkit/Server.java
++++ b/src/main/java/org/bukkit/Server.java
+@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
+ */
+ public int getMaxPlayers();
+
++ // Paper start
++ /**
++ * Set the maximum amount of players which can login to this server.
++ *
++ * @param maxPlayers the amount of players this server allows
++ */
++ public void setMaxPlayers(int maxPlayers);
++ // Paper end
++
+ /**
+ * Get the game port that the server runs on.
+ *
diff --git a/Spigot-API-Patches/Expand-ArmorStand-API.patch b/Spigot-API-Patches/Expand-ArmorStand-API.patch
index 08915ac801..2b7cb53f3b 100644
--- a/Spigot-API-Patches/Expand-ArmorStand-API.patch
+++ b/Spigot-API-Patches/Expand-ArmorStand-API.patch
@@ -11,14 +11,6 @@ diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/ArmorStand.java
+++ b/src/main/java/org/bukkit/entity/ArmorStand.java
-@@ -0,0 +0,0 @@
- package org.bukkit.entity;
-
- import org.bukkit.inventory.EntityEquipment;
-+import org.bukkit.inventory.EquipmentSlot;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.util.EulerAngle;
- import org.jetbrains.annotations.NotNull;
@@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity {
* Returns the item the armor stand is currently holding.
*
diff --git a/Spigot-API-Patches/Make-plugins-list-alphabetical.patch b/Spigot-API-Patches/Make-plugins-list-alphabetical.patch
index 401da7cf91..9c773aa032 100644
--- a/Spigot-API-Patches/Make-plugins-list-alphabetical.patch
+++ b/Spigot-API-Patches/Make-plugins-list-alphabetical.patch
@@ -56,26 +56,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return "(" + plugins.size() + "): " + pluginList.toString();
+ // Paper end
}
-
- // Spigot start
- @NotNull
- private BaseComponent[] getPluginListSpigot() {
-- Plugin[] plugins = Bukkit.getPluginManager().getPlugins();
-- ComponentBuilder pluginList = new ComponentBuilder("Plugins (" + plugins.length + "): ");
-+ // Paper start
-+ TreeMap plugins = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
-+ for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
-+ plugins.put(plugin.getDescription().getName(), plugin);
-+ }
-+ ComponentBuilder pluginList = new ComponentBuilder("Plugins (" + plugins.size() + "): ");
-+ // Paper end
-
- int index = 0;
-- for (Plugin plugin : plugins) {
-+ // Paper start
-+ for (Map.Entry entry : plugins.entrySet()) {
-+ Plugin plugin = entry.getValue();
-+ // Paper end
- if (index++ > 0) {
- pluginList.append(", ", FormatRetention.NONE).color(net.md_5.bungee.api.ChatColor.WHITE);
- }
++
+ }
diff --git a/Spigot-API-Patches/POM-changes.patch b/Spigot-API-Patches/POM-changes.patch
index ca290017ed..49f97fad5f 100644
--- a/Spigot-API-Patches/POM-changes.patch
+++ b/Spigot-API-Patches/POM-changes.patch
@@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- spigot-api
+ com.destroystokyo.paper
+ paper-api
- 1.16.1-R0.1-SNAPSHOT
+ 1.16.2-R0.1-SNAPSHOT
jar
- Spigot-API
diff --git a/Spigot-API-Patches/Remove-Precondition-on-name-for-AttributeModifier.patch b/Spigot-API-Patches/Remove-Precondition-on-name-for-AttributeModifier.patch
deleted file mode 100644
index 3d9614c5c5..0000000000
--- a/Spigot-API-Patches/Remove-Precondition-on-name-for-AttributeModifier.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Aikar
-Date: Sat, 22 Sep 2018 18:41:01 -0400
-Subject: [PATCH] Remove Precondition on name for AttributeModifier
-
-Vanilla allows empty names
-
-diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
-+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
-@@ -0,0 +0,0 @@ public class AttributeModifier implements ConfigurationSerializable {
-
- public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull Operation operation, @Nullable EquipmentSlot slot) {
- Validate.notNull(uuid, "UUID cannot be null");
-- Validate.notEmpty(name, "Name cannot be empty");
-+ //Validate.notEmpty(name, "Name cannot be empty"); // Paper
- Validate.notNull(operation, "Operation cannot be null");
- this.uuid = uuid;
-- this.name = name;
-+ this.name = name != null ? name : ""; // Paper
- this.amount = amount;
- this.operation = operation;
- this.slot = slot;
diff --git a/Spigot-Server-Patches/0563-Brand-support.patch b/Spigot-Server-Patches/0563-Brand-support.patch
new file mode 100644
index 0000000000..c1789d2900
--- /dev/null
+++ b/Spigot-Server-Patches/0563-Brand-support.patch
@@ -0,0 +1,19 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: DigitalRegent
+Date: Sat, 11 Apr 2020 13:10:58 +0200
+Subject: [PATCH] Brand support
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
+ // Paper start - brand support
+ @Override
+ public String getClientBrandName() {
+- return getHandle().playerConnection.getClientBrandName();
++ return getHandle().playerConnection != null ? getHandle().playerConnection.getClientBrandName() : null;
+ }
+ // Paper end
+
diff --git a/Spigot-Server-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-Server-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch
index 32820d3025..e500ed615f 100644
--- a/Spigot-Server-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch
+++ b/Spigot-Server-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch
@@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public EntityArmorStand(EntityTypes extends EntityArmorStand> entitytypes, World world) {
super(entitytypes, world);
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
-
- return this.getEntityType().l().a(f);
+ private EntitySize s(boolean flag) {
+ return flag ? EntityArmorStand.bp : (this.isBaby() ? EntityArmorStand.bq : this.getEntityType().l());
}
+
+ // Paper start
@@ -35,10 +35,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
@@ -0,0 +0,0 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand {
- public void setMarker(boolean marker) {
- getHandle().setMarker(marker);
+ public boolean hasEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) {
+ return (getHandle().bv & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).c() + lockType.ordinal() * 8)) != 0;
}
-+
+ // Paper start
+ @Override
+ public boolean canMove() {
diff --git a/Spigot-Server-Patches/Add-EntityZapEvent.patch b/Spigot-Server-Patches/Add-EntityZapEvent.patch
index ba5de3cfb8..df1fbe895a 100644
--- a/Spigot-Server-Patches/Add-EntityZapEvent.patch
+++ b/Spigot-Server-Patches/Add-EntityZapEvent.patch
@@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
@@ -0,0 +0,0 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
EntityVillager.LOGGER.info("Villager {} was struck by lightning {}.", this, entitylightning);
- EntityWitch entitywitch = (EntityWitch) EntityTypes.WITCH.a(this.world);
+ EntityWitch entitywitch = (EntityWitch) EntityTypes.WITCH.a((World) worldserver);
+ // Paper start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) {
@@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
+
entitywitch.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
- entitywitch.prepare(this.world, this.world.getDamageScaler(entitywitch.getChunkCoordinates()), EnumMobSpawn.CONVERSION, (GroupDataEntity) null, (NBTTagCompound) null);
+ entitywitch.prepare(worldserver, worldserver.getDamageScaler(entitywitch.getChunkCoordinates()), EnumMobSpawn.CONVERSION, (GroupDataEntity) null, (NBTTagCompound) null);
entitywitch.setNoAI(this.isNoAI());
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
diff --git a/Spigot-Server-Patches/Add-LivingEntity-getTargetEntity.patch b/Spigot-Server-Patches/Add-LivingEntity-getTargetEntity.patch
index 5654137fe9..ef4d59a631 100644
--- a/Spigot-Server-Patches/Add-LivingEntity-getTargetEntity.patch
+++ b/Spigot-Server-Patches/Add-LivingEntity-getTargetEntity.patch
@@ -61,8 +61,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.getPassengers().size() < 1;
}
-+ public final float getCollisionBorderSize() { return bc(); } // Paper - OBFHELPER
- public float bc() {
++ public final float getCollisionBorderSize() { return bf(); } // Paper - OBFHELPER
+ public float bf() {
return 0.0F;
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
diff --git a/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch b/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch
index f2be10dba4..0841ad5f74 100644
--- a/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch
+++ b/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch
@@ -74,7 +74,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public boolean isPersistable() { return a(); } // Paper - OBFHELPER
public boolean a() {
- return this.bh;
+ return this.bi;
}
diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java
new file mode 100644
diff --git a/Spigot-Server-Patches/Add-More-Creeper-API.patch b/Spigot-Server-Patches/Add-More-Creeper-API.patch
index b715d9b89e..b68db0927a 100644
--- a/Spigot-Server-Patches/Add-More-Creeper-API.patch
+++ b/Spigot-Server-Patches/Add-More-Creeper-API.patch
@@ -11,12 +11,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster {
private static final DataWatcherObject POWERED = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
private static final DataWatcherObject d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject isIgnitedDW = d; // Paper OBFHELPER
- private int bv;
+ private int bo;
- private int fuseTicks;
+ public int fuseTicks; // Paper - public
public int maxFuseTicks = 30;
public int explosionRadius = 3;
- private int bz;
+ private int bs;
@@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster {
}
diff --git a/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch b/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch
index c936637787..5613cecd38 100644
--- a/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch
+++ b/Spigot-Server-Patches/Add-PhantomPreSpawnEvent.patch
@@ -69,7 +69,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ entityphantom.spawningEntity = entityhuman.uniqueID; // Paper
entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F);
groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
- worldserver.addEntity(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
+ worldserver.addAllEntities(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
diff --git a/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch b/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch
index a06a43a143..4e23de4004 100644
--- a/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch
+++ b/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch
@@ -54,11 +54,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> {
- this.i().a(new ChatMessage("multiplayer.disconnect.generic"));
+ this.j().a(new ChatMessage("multiplayer.disconnect.generic"));
}
this.packetQueue.clear(); // Free up packet queue.
+ // Paper start - Add PlayerConnectionCloseEvent
-+ final PacketListener packetListener = this.i();
++ final PacketListener packetListener = this.j();
+ if (packetListener instanceof PlayerConnection) {
+ /* Player was logged in */
+ final PlayerConnection playerConnection = (PlayerConnection) packetListener;
diff --git a/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch b/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch
index 46d33f3603..133ef02941 100644
--- a/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch
+++ b/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch
@@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/EntityFireball.java
@@ -0,0 +0,0 @@ public abstract class EntityFireball extends IProjectile {
- MovingObjectPosition movingobjectposition = ProjectileHelper.a(this, this::a, RayTrace.BlockCollisionOption.COLLIDER);
+ MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a);
- if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
+ // Paper start - Call ProjectileCollideEvent
@@ -69,7 +69,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } // Paper
}
- Vec3D vec3d = this.getMot();
+ this.checkBlockCollisions();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
diff --git a/Spigot-Server-Patches/Add-Raw-Byte-ItemStack-Serialization.patch b/Spigot-Server-Patches/Add-Raw-Byte-ItemStack-Serialization.patch
index e32dfeeadd..1dc6c01345 100644
--- a/Spigot-Server-Patches/Add-Raw-Byte-ItemStack-Serialization.patch
+++ b/Spigot-Server-Patches/Add-Raw-Byte-ItemStack-Serialization.patch
@@ -33,16 +33,16 @@ diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
+++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java
-@@ -0,0 +0,0 @@ import io.netty.buffer.ByteBufInputStream; // Paper
-
- public class NBTCompressedStreamTools {
+@@ -0,0 +0,0 @@ public class NBTCompressedStreamTools {
+ return nbttagcompound;
+ }
+ public static NBTTagCompound readNBT(InputStream inputstream) throws IOException { return a(inputstream); } // Paper - OBFHELPER
public static NBTTagCompound a(InputStream inputstream) throws IOException {
DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(inputstream)));
Throwable throwable = null;
@@ -0,0 +0,0 @@ public class NBTCompressedStreamTools {
- return nbttagcompound;
+
}
+ public static void writeNBT(NBTTagCompound nbttagcompound, OutputStream outputstream) throws IOException { a(nbttagcompound, outputstream); } // Paper - OBFHELPER
diff --git a/Spigot-Server-Patches/Add-TNTPrimeEvent.patch b/Spigot-Server-Patches/Add-TNTPrimeEvent.patch
index 0340916701..e6afe9af80 100644
--- a/Spigot-Server-Patches/Add-TNTPrimeEvent.patch
+++ b/Spigot-Server-Patches/Add-TNTPrimeEvent.patch
@@ -9,13 +9,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
@@ -0,0 +0,0 @@ package net.minecraft.server;
-
+ import com.google.common.collect.ImmutableMap;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
+import com.destroystokyo.paper.event.block.TNTPrimeEvent; // Paper - TNTPrimeEvent
import java.util.Map;
import java.util.Random;
-
+ import java.util.function.Function;
@@ -0,0 +0,0 @@ public class BlockFire extends BlockFireAbstract {
world.setTypeAndData(blockposition, this.a(world, blockposition, l), 3);
@@ -128,7 +128,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public class EntityEnderDragon extends EntityInsentient implements IMonster {
@@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
});
- craftBlock.getNMS().dropNaturally(world, blockposition, ItemStack.b);
+ craftBlock.getNMS().dropNaturally((WorldServer) world, blockposition, ItemStack.b);
}
+ // Paper start - TNTPrimeEvent
+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
diff --git a/Spigot-Server-Patches/Add-and-implement-PlayerRecipeBookClickEvent.patch b/Spigot-Server-Patches/Add-and-implement-PlayerRecipeBookClickEvent.patch
index fc799cb21b..773b9d10da 100644
--- a/Spigot-Server-Patches/Add-and-implement-PlayerRecipeBookClickEvent.patch
+++ b/Spigot-Server-Patches/Add-and-implement-PlayerRecipeBookClickEvent.patch
@@ -12,14 +12,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
PlayerConnectionUtils.ensureMainThread(packetplayinautorecipe, this, this.player.getWorldServer());
this.player.resetIdleTimer();
if (!this.player.isSpectator() && this.player.activeContainer.windowId == packetplayinautorecipe.b() && this.player.activeContainer.c(this.player) && this.player.activeContainer instanceof ContainerRecipeBook) {
-- this.minecraftServer.getCraftingManager().a(packetplayinautorecipe.c()).ifPresent((irecipe) -> {
+- this.minecraftServer.getCraftingManager().getRecipe(packetplayinautorecipe.c()).ifPresent((irecipe) -> {
- ((ContainerRecipeBook) this.player.activeContainer).a(packetplayinautorecipe.d(), irecipe, this.player);
- });
+ // Paper start - fire event for clicking recipes in the recipe book
+ com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent event = new com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent(
+ player.getBukkitEntity(), org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(packetplayinautorecipe.c()), packetplayinautorecipe.d());
+ if (event.callEvent()) {
-+ this.minecraftServer.getCraftingManager().a(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getRecipe())).ifPresent((irecipe) -> {
++ this.minecraftServer.getCraftingManager().getRecipe(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getRecipe())).ifPresent((irecipe) -> {
+ ((ContainerRecipeBook) this.player.activeContainer).a(event.isMakeAll(), irecipe, this.player);
+ });
+ }
diff --git a/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch b/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch
index 0763d4b3ec..b902ca656d 100644
--- a/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch
+++ b/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch
@@ -25,11 +25,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
-
- blockposition = new BlockPosition(d0, this.locY(), d1);
+ double d4 = DimensionManager.a(this.world.getDimensionManager(), worldserver.getDimensionManager());
+ BlockPosition blockposition = new BlockPosition(MathHelper.a(this.locX() * d4, d0, d2), this.locY(), MathHelper.a(this.locZ() * d4, d1, d3));
// CraftBukkit start
-- EntityPortalEvent event = CraftEventFactory.callEntityPortalEvent(this, worldserver, blockposition, 128);
-+ EntityPortalEvent event = CraftEventFactory.callEntityPortalEvent(this, worldserver, blockposition, worldserver.paperConfig.portalSearchRadius); // Paper - use portal search radius
+- CraftPortalEvent event = callPortalEvent(this, worldserver, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16);
++ CraftPortalEvent event = callPortalEvent(this, worldserver, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, worldserver.paperConfig.portalSearchRadius, worldserver.paperConfig.portalCreateRadius); // Paper start - configurable portal radius
if (event == null) {
return null;
}
@@ -38,34 +38,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
- // CraftBukkit start
- Location enter = this.getBukkitEntity().getLocation();
- Location exit = (worldserver == null) ? null : new Location(worldserver.getWorld(), d0, d1, d2, f1, f);
-- PlayerPortalEvent event = new PlayerPortalEvent(this.getBukkitEntity(), enter, exit, cause, 128, true, resourcekey == DimensionManager.THE_END ? 0 : 16);
-+ com.destroystokyo.paper.PaperWorldConfig config = worldserver != null ? worldserver.paperConfig : worldserver1.paperConfig; // Paper - portal radius
-+ PlayerPortalEvent event = new PlayerPortalEvent(this.getBukkitEntity(), enter, exit, cause, config.portalSearchRadius, true, resourcekey == DimensionManager.THE_END ? 0 : config.portalCreateRadius); // Paper - portal radius
- Bukkit.getServer().getPluginManager().callEvent(event);
- if (event.isCancelled() || event.getTo() == null) {
- return null;
+ protected CraftPortalEvent callPortalEvent(Entity entity, WorldServer exitWorldServer, BlockPosition exitPosition, TeleportCause cause, int searchRadius, int creationRadius) {
+ Location enter = this.getBukkitEntity().getLocation();
+ Location exit = new Location(exitWorldServer.getWorld(), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ(), yaw, pitch);
+- PlayerPortalEvent event = new PlayerPortalEvent(this.getBukkitEntity(), enter, exit, cause, 128, true, creationRadius);
++ PlayerPortalEvent event = new PlayerPortalEvent(this.getBukkitEntity(), enter, exit, cause, searchRadius, true, creationRadius); // Paper - use searchRadius
+ Bukkit.getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled() || event.getTo() == null || event.getTo().getWorld() == null) {
+ return null;
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
@@ -0,0 +0,0 @@ public class PortalTravelAgent {
- @Nullable
- public ShapeDetector.Shape a(BlockPosition blockposition, Vec3D vec3d, EnumDirection enumdirection, double d0, double d1, boolean flag) { // PAIL: rename to findPortal, d0 = portal offset x, d1 = portal offset z, flag = instanceof EntityHuman
+
+ public Optional findPortal(BlockPosition blockposition, boolean flag) {
// CraftBukkit start
-- return findPortal(blockposition, vec3d, enumdirection, d0, d1, flag, 128);
-+ return findPortal(blockposition, vec3d, enumdirection, d0, d1, flag, world.paperConfig.portalSearchRadius); // Paper
+- return findPortal(blockposition, flag ? 16 : 128); // Search Radius
++ return findPortal(blockposition, flag ? world.paperConfig.portalCreateRadius : world.paperConfig.portalSearchRadius); // Paper - search Radius
}
- @Nullable
-@@ -0,0 +0,0 @@ public class PortalTravelAgent {
- // CraftBukkit end
- VillagePlace villageplace = this.world.x();
-
-- villageplace.a(this.world, blockposition, 128);
-+ villageplace.a(this.world, blockposition, searchRadius); // Paper - This impacts the # of chunks searched for entries
- List list = (List) villageplace.b((villageplacetype) -> {
- return villageplacetype == VillagePlaceType.v;
- }, blockposition, searchRadius, VillagePlace.Occupancy.ANY).collect(Collectors.toList()); // CraftBukkit - searchRadius
+ public Optional findPortal(BlockPosition blockposition, int i) {
diff --git a/Spigot-Server-Patches/Add-effect-to-block-break-naturally.patch b/Spigot-Server-Patches/Add-effect-to-block-break-naturally.patch
index 7fbb466ce8..f7979377ce 100644
--- a/Spigot-Server-Patches/Add-effect-to-block-break-naturally.patch
+++ b/Spigot-Server-Patches/Add-effect-to-block-break-naturally.patch
@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
net.minecraft.server.Block block = iblockdata.getBlock();
@@ -0,0 +0,0 @@ public class CraftBlock implements Block {
// Modelled off EntityHuman#hasBlock
- if (block != Blocks.AIR && (item == null || !iblockdata.isAlwaysDestroyable() || nmsItem.canDestroySpecialBlock(iblockdata))) {
+ if (block != Blocks.AIR && (item == null || !iblockdata.isRequiresSpecialTool() || nmsItem.canDestroySpecialBlock(iblockdata))) {
net.minecraft.server.Block.dropItems(iblockdata, world.getMinecraftWorld(), position, world.getTileEntity(position), null, nmsItem);
+ if (triggerEffect) world.triggerEffect(org.bukkit.Effect.STEP_SOUND.getId(), position, net.minecraft.server.Block.getCombinedId(block.getBlockData())); // Paper
result = true;
diff --git a/Spigot-Server-Patches/Add-entity-liquid-API.patch b/Spigot-Server-Patches/Add-entity-liquid-API.patch
index 2d81e3d85e..1381dd4ed1 100644
--- a/Spigot-Server-Patches/Add-entity-liquid-API.patch
+++ b/Spigot-Server-Patches/Add-entity-liquid-API.patch
@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public boolean isInRain() { // Paper - private -> public
BlockPosition blockposition = this.getChunkCoordinates();
- return this.world.isRainingAt(blockposition) || this.world.isRainingAt(blockposition.a(0.0D, (double) this.size.height, 0.0D));
+ return this.world.isRainingAt(blockposition) || this.world.isRainingAt(new BlockPosition((double) blockposition.getX(), this.getBoundingBox().maxY, (double) blockposition.getZ()));
}
+ public final boolean isInBubbleColumn() { return k(); } // Paper - OBFHELPER
@@ -27,17 +27,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.isInWater() || this.isInRain() || this.k();
}
-+ public final boolean isInWaterOrBubbleColumn() { return aD(); } // Paper - OBFHELPER
- public boolean aD() {
++ public final boolean isInWaterOrBubbleColumn() { return aG(); } // Paper - OBFHELPER
+ public boolean aG() {
return this.isInWater() || this.k();
}
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
- this.inLava = true;
+ return this.O == tag;
}
-+ public final boolean isInLava() { return aN(); } // Paper - OBFHELPER
- public boolean aN() {
- return this.inLava;
++ public final boolean isInLava() { return aP(); } // Paper - OBFHELPER
+ public boolean aP() {
+ return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
diff --git a/Spigot-Server-Patches/Add-exception-reporting-event.patch b/Spigot-Server-Patches/Add-exception-reporting-event.patch
index f0f892dad9..c4b810cfaf 100644
--- a/Spigot-Server-Patches/Add-exception-reporting-event.patch
+++ b/Spigot-Server-Patches/Add-exception-reporting-event.patch
@@ -79,20 +79,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit end
}
}
-diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
-+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
-@@ -0,0 +0,0 @@ import java.util.function.Consumer;
- import java.util.function.Function;
- import java.util.function.Supplier;
- import javax.annotation.Nullable;
-+import com.destroystokyo.paper.exception.ServerInternalException;
-+import org.apache.logging.log4j.LogManager;
-+import org.apache.logging.log4j.Logger;
-
- public class ChunkProviderServer extends IChunkProvider {
-
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -173,7 +159,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
@@ -0,0 +0,0 @@ public final class SpawnerCreature {
- entity = biomebase_biomemeta.c.a(generatoraccess.getMinecraftWorld());
+ entity = biomesettingsmobs_c.c.a((World) worldaccess.getMinecraftWorld());
} catch (Exception exception) {
SpawnerCreature.LOGGER.warn("Failed to create mob", exception);
+ ServerInternalException.reportInternalException(exception); // Paper
@@ -191,11 +177,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
import java.util.Iterator;
import javax.annotation.Nullable;
-
+ import org.apache.logging.log4j.LogManager;
@@ -0,0 +0,0 @@ public class VillageSiege implements MobSpawner {
entityzombie.prepare(worldserver, worldserver.getDamageScaler(entityzombie.getChunkCoordinates()), EnumMobSpawn.EVENT, (GroupDataEntity) null, (NBTTagCompound) null);
} catch (Exception exception) {
- exception.printStackTrace();
+ VillageSiege.LOGGER.warn("Failed to create zombie for village siege at {}", vec3d, exception);
+ ServerInternalException.reportInternalException(exception); // Paper
return;
}
@@ -245,13 +231,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -0,0 +0,0 @@ public class WorldPersistentData {
- nbttagcompound = GameProfileSerializer.a(this.c, DataFixTypes.SAVED_DATA, nbttagcompound1, j, i);
- } catch (Throwable throwable4) {
- throwable = throwable4;
+ }
+ } catch (Throwable throwable6) {
+ throwable = throwable6;
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable); // Paper
- throw throwable4;
+ throw throwable6;
} finally {
- if (pushbackinputstream != null) {
+ if (fileinputstream != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
diff --git a/Spigot-Server-Patches/Add-hand-to-bucket-events.patch b/Spigot-Server-Patches/Add-hand-to-bucket-events.patch
index 728d248a3d..46a269939b 100644
--- a/Spigot-Server-Patches/Add-hand-to-bucket-events.patch
+++ b/Spigot-Server-Patches/Add-hand-to-bucket-events.patch
@@ -99,7 +99,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
- this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition));
+ this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition, f));
}
- public BlockPosition getSpawn() {
@@ -123,8 +123,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ //}
+ // Paper end
- public LongSet getForceLoadedChunks() {
- ForcedChunk forcedchunk = (ForcedChunk) this.getWorldPersistentData().b(ForcedChunk::new, "chunks");
+ public float v() {
+ return this.worldData.d();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
diff --git a/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch
index 236008949c..70cb6abed7 100644
--- a/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch
+++ b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch
@@ -9,10 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
- entity.remove();
}
}
-+
+
+ // Paper start - Add method to open already placed sign
+ @Override
+ public void openSign(org.bukkit.block.Sign sign) {
@@ -21,8 +20,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ net.minecraft.server.TileEntitySign teSign = craftSign.getTileEntity();
+ // Make sign editable temporarily, will be set back to false in PlayerConnection later
+ teSign.isEditable = true;
-+
+ getHandle().openSign(teSign);
+ }
+ // Paper end
- }
+ @Override
+ public boolean dropItem(boolean dropAll) {
+ return getHandle().dropItem(dropAll);
diff --git a/Spigot-Server-Patches/Add-moon-phase-API.patch b/Spigot-Server-Patches/Add-moon-phase-API.patch
new file mode 100644
index 0000000000..3ff89190eb
--- /dev/null
+++ b/Spigot-Server-Patches/Add-moon-phase-API.patch
@@ -0,0 +1,22 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: BillyGalbreath
+Date: Sun, 23 Aug 2020 16:32:11 +0200
+Subject: [PATCH] Add moon phase API
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+@@ -0,0 +0,0 @@ public class CraftWorld implements World {
+ public int getPlayerCount() {
+ return world.players.size();
+ }
++
++ @Override
++ public io.papermc.paper.world.MoonPhase getMoonPhase() {
++ return io.papermc.paper.world.MoonPhase.getPhase(getFullTime() / 24000L);
++ }
+ // Paper end
+
+ private static final Random rand = new Random();
diff --git a/Spigot-Server-Patches/Add-more-Witch-API.patch b/Spigot-Server-Patches/Add-more-Witch-API.patch
index 44ef5dc6a1..3adb90d808 100644
--- a/Spigot-Server-Patches/Add-more-Witch-API.patch
+++ b/Spigot-Server-Patches/Add-more-Witch-API.patch
@@ -20,17 +20,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
-@@ -0,0 +0,0 @@ import java.util.function.Predicate;
- public class EntityWitch extends EntityRaider implements IRangedEntity {
-
+@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
private static final UUID b = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E");
-- private static final AttributeModifier bv = new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION);
-+ private static final AttributeModifier bv = new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION); private static final AttributeModifier DRINKING_SPEED = bv; // Paper - OBFHELPER
- private static final DataWatcherObject bw = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
-- private int bx;
-+ private int bx; public int getPotionUseTimeLeft() { return bx; } public void setPotionUseTimeLeft(int timeLeft) { bx = timeLeft; } // Paper - OBFHELPER
- private PathfinderGoalNearestHealableRaider by;
- private PathfinderGoalNearestAttackableTargetWitch bz;
+ private static final AttributeModifier bo = new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION);
+ private static final DataWatcherObject bp = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i);
+- private int bq;
++ private int bq; public int getPotionUseTimeLeft() { return bq; } public void setPotionUseTimeLeft(int timeLeft) { bq = timeLeft; } // Paper - OBFHELPER
+ private PathfinderGoalNearestHealableRaider br;
+ private PathfinderGoalNearestAttackableTargetWitch bs;
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
return SoundEffects.ENTITY_WITCH_DEATH;
@@ -38,48 +35,47 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public void setDrinkingPotion(boolean drinkingPotion) { v(drinkingPotion); } // Paper - OBFHELPER
public void v(boolean flag) {
- this.getDataWatcher().set(EntityWitch.bw, flag);
+ this.getDataWatcher().set(EntityWitch.bp, flag);
}
+ public boolean isDrinkingPotion() { return m(); } // Paper - OBFHELPER
public boolean m() {
- return (Boolean) this.getDataWatcher().get(EntityWitch.bw);
+ return (Boolean) this.getDataWatcher().get(EntityWitch.bp);
}
@@ -0,0 +0,0 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
}
if (potionregistry != null) {
- // Paper start
-- ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry);
+ ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry);
- org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
- this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
-- // Paper end
-- this.bx = this.getItemInMainHand().k();
++ // Paper start - logic moved into setDrinkingPotion, copy exact impl into the method and then comment out
++ this.setDrinkingPotion(potion);
++// org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
++// this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
++// // Paper end
++// this.bq = this.getItemInMainHand().k();
++// this.v(true);
++// if (!this.isSilent()) {
++// this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
++// }
++//
++// AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
++//
++// attributemodifiable.removeModifier(EntityWitch.bo);
++// attributemodifiable.b(EntityWitch.bo);
+ // Paper end
+- this.bq = this.getItemInMainHand().k();
- this.v(true);
- if (!this.isSilent()) {
- this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
- }
--
+
- AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
-
-- attributemodifiable.removeModifier(EntityWitch.bv);
-- attributemodifiable.b(EntityWitch.bv);
-+ //// Paper start
-+ //ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry);
-+ //org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
-+ //this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
-+ //// Paper end
-+ //this.bx = this.getItemInMainHand().k();
-+ //this.v(true);
-+ //if (!this.isSilent()) {
-+ // this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
-+ //}
-+ //
-+ //AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
-+ //
-+ //attributemodifiable.removeModifier(EntityWitch.bv);
-+ //attributemodifiable.b(EntityWitch.bv);
-+ this.setDrinkingPotion(PotionUtil.addPotionToItemStack(new ItemStack(Items.POTION), potionregistry));
+- attributemodifiable.removeModifier(EntityWitch.bo);
+- attributemodifiable.b(EntityWitch.bo);
}
}
@@ -89,20 +85,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - moved to its own method
+ public void setDrinkingPotion(ItemStack potion) {
-+ setSlot(EnumItemSlot.MAINHAND, CraftItemStack.asNMSCopy(WitchReadyPotionEvent.process((Witch) getBukkitEntity(), CraftItemStack.asCraftMirror(potion))));
-+ setPotionUseTimeLeft(getItemInMainHand().getItemUseMaxDuration());
-+ setDrinkingPotion(true);
++ org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
++ this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
++ // Paper end
++ this.bq = this.getItemInMainHand().k();
++ this.v(true);
+ if (!this.isSilent()) {
+ this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
+ }
++
+ AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
-+ attributemodifiable.removeModifier(EntityWitch.bv);
-+ attributemodifiable.b(EntityWitch.bv);
++
++ attributemodifiable.removeModifier(EntityWitch.bo);
++ attributemodifiable.b(EntityWitch.bo);
+ }
+ // Paper end
+
@Override
- public SoundEffect eM() {
+ public SoundEffect eL() {
return SoundEffects.ENTITY_WITCH_CELEBRATE;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@@ -124,11 +124,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.inventory.ItemStack;
+// Paper end
--public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity { // Paper
-+public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity {
+ public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity { // Paper
public CraftWitch(CraftServer server, EntityWitch entity) {
- super(server, entity);
- }
@@ -0,0 +0,0 @@ public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<
public EntityType getType() {
return EntityType.WITCH;
diff --git a/Spigot-Server-Patches/Add-more-Zombie-API.patch b/Spigot-Server-Patches/Add-more-Zombie-API.patch
index c9676b3ae5..24d5e42f6c 100644
--- a/Spigot-Server-Patches/Add-more-Zombie-API.patch
+++ b/Spigot-Server-Patches/Add-more-Zombie-API.patch
@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
- private int bA;
+ private int bt;
public int drownedConversionTime;
private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field
+ private boolean shouldBurnInDay = true; // Paper
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public EntityZombie(EntityTypes extends EntityZombie> entitytypes, World world) {
super(entitytypes, world);
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
- this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true);
+ super.movementTick();
}
+ // Paper start
@@ -26,18 +26,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, false);
+ }
+ // Paper end
-+
- protected void eQ() {
- this.c(EntityTypes.DROWNED);
- if (!this.isSilent()) {
+ public void startDrownedConversion(int i) {
+ this.lastTick = MinecraftServer.currentTick; // CraftBukkit
+ this.drownedConversionTime = i;
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
}
-+ public boolean shouldBurnInDay() { return U_(); } // Paper - OBFHELPER
- protected boolean U_() {
-- return true;
-+ return shouldBurnInDay;
++ public boolean shouldBurnInDay() { return T_(); } // Paper - OBFHELPER
+ protected boolean T_() {
+ return true;
}
+ // Paper start
@@ -48,10 +46,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
@Override
public boolean damageEntity(DamageSource damagesource, float f) {
- if (super.damageEntity(damagesource, f)) {
+ if (!super.damageEntity(damagesource, f)) {
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
- nbttagcompound.setBoolean("CanBreakDoors", this.eV());
- nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bA : -1);
+ nbttagcompound.setBoolean("CanBreakDoors", this.eU());
+ nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bt : -1);
nbttagcompound.setInt("DrownedConversionTime", this.isDrownConverting() ? this.drownedConversionTime : -1);
+ nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Paper
}
@@ -75,10 +73,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java
@@ -0,0 +0,0 @@ public class CraftZombie extends CraftMonster implements Zombie {
- getHandle().startDrownedConversion(time);
- }
+ @Override
+ public void setAgeLock(boolean b) {
}
-+
+ // Paper start
+ @Override
+ public boolean isDrowning() {
@@ -115,4 +112,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ getHandle().setShouldBurnInDay(shouldBurnInDay);
+ }
+ // Paper end
- }
+
+ @Override
+ public boolean getAgeLock() {
diff --git a/Spigot-Server-Patches/Add-option-to-allow-iron-golems-to-spawn-in-air.patch b/Spigot-Server-Patches/Add-option-to-allow-iron-golems-to-spawn-in-air.patch
index c03f830711..4a23c8998f 100644
--- a/Spigot-Server-Patches/Add-option-to-allow-iron-golems-to-spawn-in-air.patch
+++ b/Spigot-Server-Patches/Add-option-to-allow-iron-golems-to-spawn-in-air.patch
@@ -17,9 +17,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ ironGolemsCanSpawnInAir = getBoolean("iron-golems-can-spawn-in-air", ironGolemsCanSpawnInAir);
+ }
+
- public int bedSearchRadius = 1;
- private void bedSearchRadius() {
- bedSearchRadius = getInt("bed-search-radius", 1);
+ public boolean armorStandEntityLookups = true;
+ private void armorStandEntityLookups() {
+ armorStandEntityLookups = getBoolean("armor-stands-do-collision-entity-lookups", true);
diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityIronGolem.java
diff --git a/Spigot-Server-Patches/Add-option-to-nerf-pigmen-from-nether-portals.patch b/Spigot-Server-Patches/Add-option-to-nerf-pigmen-from-nether-portals.patch
index f41a39e283..988537d5ec 100644
--- a/Spigot-Server-Patches/Add-option-to-nerf-pigmen-from-nether-portals.patch
+++ b/Spigot-Server-Patches/Add-option-to-nerf-pigmen-from-nether-portals.patch
@@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class BlockPortal extends Block {
if (entity != null) {
- entity.portalCooldown = entity.getDefaultPortalCooldown();
+ entity.resetPortalCooldown();
+ entity.fromNetherPortal = true; // Paper
+ if (worldserver.paperConfig.nerfNetherPortalPigmen) ((EntityInsentient) entity).aware = false; // Paper
}
diff --git a/Spigot-Server-Patches/Add-phantom-creative-and-insomniac-controls.patch b/Spigot-Server-Patches/Add-phantom-creative-and-insomniac-controls.patch
index 1d2990ac34..acd8ba9011 100644
--- a/Spigot-Server-Patches/Add-phantom-creative-and-insomniac-controls.patch
+++ b/Spigot-Server-Patches/Add-phantom-creative-and-insomniac-controls.patch
@@ -56,4 +56,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (!entityhuman.isSpectator() && (!worldserver.paperConfig.phantomIgnoreCreative || !entityhuman.isCreative())) { // Paper
BlockPosition blockposition = entityhuman.getChunkCoordinates();
- if (!worldserver.getDimensionManager().hasSkyLight() || blockposition.getY() >= worldserver.getSeaLevel() && worldserver.f(blockposition)) {
+ if (!worldserver.getDimensionManager().hasSkyLight() || blockposition.getY() >= worldserver.getSeaLevel() && worldserver.e(blockposition)) {
diff --git a/Spigot-Server-Patches/Add-setMaxPlayers-API.patch b/Spigot-Server-Patches/Add-setMaxPlayers-API.patch
new file mode 100644
index 0000000000..5fee1e632e
--- /dev/null
+++ b/Spigot-Server-Patches/Add-setMaxPlayers-API.patch
@@ -0,0 +1,37 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mariell Hoversholm
+Date: Sat, 22 Aug 2020 23:59:30 +0200
+Subject: [PATCH] Add #setMaxPlayers API
+
+
+diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/PlayerList.java
++++ b/src/main/java/net/minecraft/server/PlayerList.java
+@@ -0,0 +0,0 @@ public abstract class PlayerList {
+ public final WorldNBTStorage playerFileData;
+ private boolean hasWhitelist;
+ private final IRegistryCustom.Dimension s;
+- protected final int maxPlayers;
++ protected int maxPlayers; public final void setMaxPlayers(int maxPlayers) { this.maxPlayers = maxPlayers; } // Paper - remove final and add setter
+ private int viewDistance;
+ private EnumGamemode u;
+ private boolean v;
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
+ return playerList.getMaxPlayers();
+ }
+
++ // Paper start
++ @Override
++ public void setMaxPlayers(int maxPlayers) {
++ this.playerList.setMaxPlayers(maxPlayers);
++ }
++ // Paper end
++
+ // NOTE: These are dependent on the corresponding call in MinecraftServer
+ // so if that changes this will need to as well
+ @Override
diff --git a/Spigot-Server-Patches/Add-sun-related-API.patch b/Spigot-Server-Patches/Add-sun-related-API.patch
index 7ff0ea595c..a6dedad9f1 100644
--- a/Spigot-Server-Patches/Add-sun-related-API.patch
+++ b/Spigot-Server-Patches/Add-sun-related-API.patch
@@ -12,10 +12,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
-+ public boolean isInDaylight() { return this.eH(); } // Paper - OBFHELPER
- protected boolean eH() {
++ public boolean isInDaylight() { return this.eG(); } // Paper - OBFHELPER
+ protected boolean eG() {
if (this.world.isDay() && !this.world.isClientSide) {
- float f = this.aO();
+ float f = this.aQ();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
diff --git a/Spigot-Server-Patches/Add-tick-times-API-and-mspt-command.patch b/Spigot-Server-Patches/Add-tick-times-API-and-mspt-command.patch
index b070d28109..b3a2f69298 100644
--- a/Spigot-Server-Patches/Add-tick-times-API-and-mspt-command.patch
+++ b/Spigot-Server-Patches/Add-tick-times-API-and-mspt-command.patch
@@ -116,8 +116,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.methodProfiler.exit();
org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant entitytypes, World world) {
super(entitytypes, world);
-@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
- this.rightArmPose = EntityArmorStand.bt;
- this.leftLegPose = EntityArmorStand.bu;
- this.rightLegPose = EntityArmorStand.bv;
+ if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking
- this.G = 0.0F;
- }
-
+ this.handItems = NonNullList.a(2, ItemStack.b);
+ this.armorItems = NonNullList.a(4, ItemStack.b);
+ this.headPose = EntityArmorStand.bj;
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
this.armorItems.set(enumitemslot.b(), itemstack);
}
@@ -129,18 +125,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
public void setLeftLegPose(Vector3f vector3f) {
++ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
this.leftLegPose = vector3f;
this.datawatcher.set(EntityArmorStand.g, vector3f);
-+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
++
}
public void setRightLegPose(Vector3f vector3f) {
- this.rightLegPose = vector3f;
- this.datawatcher.set(EntityArmorStand.bo, vector3f);
+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking
+ this.rightLegPose = vector3f;
+ this.datawatcher.set(EntityArmorStand.bh, vector3f);
}
-
- public Vector3f r() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
@@ -149,9 +144,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
-+ public void updateEntityEquipment() { q(); }; // Paper
- private void q() {
- Map map = this.r();
++ public final void updateEntityEquipment() { p(); }; // Paper - OBFHELPER
+ private void p() {
+ Map map = this.q();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
diff --git a/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
index cb53ca32ab..e2f4b37a42 100644
--- a/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
+++ b/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch
@@ -38,8 +38,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.isInWater() || this.isInRain();
}
-+ public final boolean isInWaterOrRainOrBubble() { return aC(); } // Paper - OBFHELPER
- public boolean aC() {
++ public final boolean isInWaterOrRainOrBubble() { return aF(); } // Paper - OBFHELPER
+ public boolean aF() {
return this.isInWater() || this.isInRain() || this.k();
}
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -53,7 +53,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Nullable public PathfinderGoalFloat goalFloat; // Paper
public PathfinderGoalSelector targetSelector;
private EntityLiving goalTarget;
- private final EntitySenses bv;
+ private final EntitySenses bo;
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
@Override
protected final void doTick() {
@@ -71,7 +71,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
this.world.getMethodProfiler().enter("sensing");
- this.bv.a();
+ this.bo.a();
this.world.getMethodProfiler().exit();
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public final boolean validConditions() { return this.a(); } // Paper - OBFHELPER
@Override
public boolean a() {
- return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cw() || this.a.aN();
+ return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cw() || this.a.aP();
}
+ public void update() { this.e(); } // Paper - OBFHELPER
diff --git a/Spigot-Server-Patches/Anti-Xray.patch b/Spigot-Server-Patches/Anti-Xray.patch
index 87a08d0381..a905b7c393 100644
--- a/Spigot-Server-Patches/Anti-Xray.patch
+++ b/Spigot-Server-Patches/Anti-Xray.patch
@@ -135,7 +135,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private final ChunkSection[] emptyNearbyChunkSections = {Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION};
+ private final int maxBlockYUpdatePosition;
+
-+ public ChunkPacketBlockControllerAntiXray(PaperWorldConfig paperWorldConfig, Executor executor) {
++ public ChunkPacketBlockControllerAntiXray(World world, Executor executor) {
++ PaperWorldConfig paperWorldConfig = world.paperConfig;
+ engineMode = paperWorldConfig.engineMode;
+ maxChunkSectionIndex = paperWorldConfig.maxChunkSectionIndex;
+ updateRadius = paperWorldConfig.updateRadius;
@@ -185,12 +186,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ for (String id : toObfuscate) {
+ Block block = IRegistry.BLOCK.getOptional(new MinecraftKey(id)).orElse(null);
+
-+ if (block != null) {
++ // Don't obfuscate air because air causes unnecessary block updates and causes block updates to fail in the void
++ if (block != null && !block.getBlockData().isAir()) {
+ obfuscateGlobal[ChunkSection.GLOBAL_PALETTE.getOrCreateIdFor(block.getBlockData())] = true;
+ }
+ }
+
-+ ChunkEmpty emptyChunk = new ChunkEmpty(null, new ChunkCoordIntPair(0, 0));
++ ChunkEmpty emptyChunk = new ChunkEmpty(world, new ChunkCoordIntPair(0, 0));
+ BlockPosition zeroPos = new BlockPosition(0, 0, 0);
+
+ for (int i = 0; i < solidGlobal.length; i++) {
@@ -1000,6 +1002,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.sections[j >> 4] = chunksection;
}
+diff --git a/src/main/java/net/minecraft/server/ChunkEmpty.java b/src/main/java/net/minecraft/server/ChunkEmpty.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/ChunkEmpty.java
++++ b/src/main/java/net/minecraft/server/ChunkEmpty.java
+@@ -0,0 +0,0 @@ public class ChunkEmpty extends Chunk {
+ });
+
+ public ChunkEmpty(World world, ChunkCoordIntPair chunkcoordintpair) {
+- super(world, chunkcoordintpair, new BiomeStorage(world.r().b(IRegistry.ay), ChunkEmpty.b));
++ super(world, chunkcoordintpair, new BiomeStorage(MinecraftServer.getServer().getCustomRegistry().b(IRegistry.ay), ChunkEmpty.b)); // Paper - world isnt ready yet for anti xray use here, use server singleton for registry
+ }
+
+ // Paper start
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -1036,7 +1051,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public class ChunkSection {
@@ -0,0 +0,0 @@ public class ChunkSection {
private short e;
- final DataPaletteBlock blockIds;
+ final DataPaletteBlock blockIds; // Paper - package-private
- public ChunkSection(int i) {
- this(i, (short) 0, (short) 0, (short) 0);
@@ -1200,6 +1215,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
int j = along.length * 64 / 4096;
if (this.h == this.b) {
+diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/MinecraftServer.java
++++ b/src/main/java/net/minecraft/server/MinecraftServer.java
+@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant {
+ private List g;
private boolean h;
- private boolean i;
- public PacketPlayOutMapChunk() {}
+ // Paper start - Async-Anti-Xray - Set the ready flag to true
@@ -1222,13 +1249,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.ready = true;
+ }
+ // Paper end
-
++
// Paper start
private final java.util.List extraPackets = new java.util.ArrayList<>();
+ private static final int TE_LIMIT = Integer.getInteger("Paper.excessiveTELimit", 750);
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet {
}
// Paper end
- public PacketPlayOutMapChunk(Chunk chunk, int i, boolean flag) {
+ public PacketPlayOutMapChunk(Chunk chunk, int i) {
+ ChunkPacketInfo chunkPacketInfo = chunk.world.chunkPacketBlockController.getChunkPacketInfo(this, chunk, i); // Paper - Anti-Xray - Add chunk packet info
ChunkCoordIntPair chunkcoordintpair = chunk.getPos();
@@ -1237,12 +1265,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
this.f = new byte[this.a(chunk, i)];
-- this.c = this.a(new PacketDataSerializer(this.k()), chunk, i);
+- this.c = this.a(new PacketDataSerializer(this.j()), chunk, i);
+ // Paper start - Anti-Xray - Add chunk packet info
+ if (chunkPacketInfo != null) {
+ chunkPacketInfo.setData(this.getData());
+ }
-+ this.c = this.writeChunk(new PacketDataSerializer(this.k()), chunk, i, chunkPacketInfo);
++ this.c = this.writeChunk(new PacketDataSerializer(this.j()), chunk, i, chunkPacketInfo);
+ // Paper end
this.g = Lists.newArrayList();
iterator = chunk.getTileEntities().entrySet().iterator();
@@ -1393,14 +1421,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPosition lastPhysicsProblem; // Spigot
@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
- return (CraftServer) Bukkit.getServer();
+ return typeKey;
}
-- 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) {
-+ 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, java.util.concurrent.Executor executor) {
+- protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, final DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
++ protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, final DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper
-+ this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
++ this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
this.generator = gen;
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
@@ -1419,9 +1447,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// Add env and gen to constructor, WorldData -> WorldDataServer
- public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
-- super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env);
-+ super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor
+ public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
+- super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env);
++ super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor
this.pvpMode = minecraftserver.getPVP();
convertable = convertable_conversionsession;
uuid = WorldUUID.getUUID(convertable_conversionsession.folder.toFile());
diff --git a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch
index b8457cb5c4..869df43206 100644
--- a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch
+++ b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch
@@ -2954,7 +2954,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant WorldDataServer
- public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
- super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor
+ public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
+ super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.dragonBattle = null;
}
@@ -4018,9 +4018,9 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/jav
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
-@@ -0,0 +0,0 @@ import net.minecraft.server.GroupDataEntity;
- import net.minecraft.server.IBlockData;
+@@ -0,0 +0,0 @@ import net.minecraft.server.IBlockData;
import net.minecraft.server.IChunkAccess;
+ import net.minecraft.server.IRegistry;
import net.minecraft.server.MinecraftKey;
+import net.minecraft.server.MinecraftServer;
import net.minecraft.server.MovingObjectPosition;
diff --git a/Spigot-Server-Patches/Avoid-blocking-on-Network-Manager-creation.patch b/Spigot-Server-Patches/Avoid-blocking-on-Network-Manager-creation.patch
index b1ff6c6492..dbc7a40619 100644
--- a/Spigot-Server-Patches/Avoid-blocking-on-Network-Manager-creation.patch
+++ b/Spigot-Server-Patches/Avoid-blocking-on-Network-Manager-creation.patch
@@ -26,13 +26,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public ServerConnection(MinecraftServer minecraftserver) {
this.e = minecraftserver;
@@ -0,0 +0,0 @@ public class ServerConnection {
- channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(ServerConnection.this)).addLast("splitter", new PacketSplitter()).addLast("decoder", new PacketDecoder(EnumProtocolDirection.SERVERBOUND)).addLast("prepender", new PacketPrepender()).addLast("encoder", new PacketEncoder(EnumProtocolDirection.CLIENTBOUND));
- NetworkManager networkmanager = new NetworkManager(EnumProtocolDirection.SERVERBOUND);
+ int j = ServerConnection.this.e.k();
+ Object object = j > 0 ? new NetworkManagerServer(j) : new NetworkManager(EnumProtocolDirection.SERVERBOUND);
-- ServerConnection.this.connectedChannels.add(networkmanager);
-+ pending.add(networkmanager); // Paper
- channel.pipeline().addLast("packet_handler", networkmanager);
- networkmanager.setPacketListener(new HandshakeListener(ServerConnection.this.e, networkmanager));
+- ServerConnection.this.connectedChannels.add((NetworkManager) object); // CraftBukkit - decompile error
++ //ServerConnection.this.connectedChannels.add((NetworkManager) object); // CraftBukkit - decompile error
++ pending.add((NetworkManager) object); // Paper
+ channel.pipeline().addLast("packet_handler", (ChannelHandler) object);
+ ((NetworkManager) object).setPacketListener(new HandshakeListener(ServerConnection.this.e, (NetworkManager) object));
}
@@ -0,0 +0,0 @@ public class ServerConnection {
diff --git a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch
index 43ef06d0b6..a757107725 100644
--- a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch
+++ b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch
@@ -433,6 +433,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import com.destroystokyo.paper.profile.CraftPlayerProfile;
+import com.destroystokyo.paper.profile.PlayerProfile;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
+ import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet;
import org.apache.commons.lang.exception.ExceptionUtils;
+import com.mojang.authlib.GameProfile;
import org.bukkit.Location;
@@ -468,23 +469,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -0,0 +0,0 @@ public class UserCache {
- public static final SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
- private static boolean c;
-- private final Map d = new java.util.concurrent.ConcurrentHashMap<>(); // Paper
-+ private final Map d = new java.util.concurrent.ConcurrentHashMap<>();private final Map nameCache = d; // Paper - OBFHELPER // Paper
- private final Map e = new java.util.concurrent.ConcurrentHashMap<>(); // Paper
- private final Deque f = new java.util.concurrent.LinkedBlockingDeque(); // CraftBukkit
- private final GameProfileRepository g;
+ private static final Logger LOGGER = LogManager.getLogger();
+ private static boolean b;
+- private final Map c = Maps.newConcurrentMap();
++ private final Map c = Maps.newConcurrentMap();private final Map nameCache = c; // Paper - OBFHELPER // Paper
+ private final Map d = Maps.newConcurrentMap();
+ private final GameProfileRepository e;
+ private final Gson f = (new GsonBuilder()).create();
@@ -0,0 +0,0 @@ public class UserCache {
- return UserCache.c;
+ return UserCache.b;
}
+ public void saveProfile(GameProfile gameprofile) { a(gameprofile); } // Paper - OBFHELPER
- public void a(GameProfile gameprofile) {
- this.a(gameprofile, (Date) null);
- }
+ public synchronized void a(GameProfile gameprofile) { // Paper - synchronize
+ Calendar calendar = Calendar.getInstance();
+
@@ -0,0 +0,0 @@ public class UserCache {
- return usercache_usercacheentry == null ? null : usercache_usercacheentry.a();
+ return gameprofile;
}
+ // Paper start
@@ -496,16 +497,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
@Nullable
public GameProfile getProfile(UUID uuid) {
- UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.e.get(uuid);
+ UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(uuid);
@@ -0,0 +0,0 @@ public class UserCache {
- class UserCacheEntry {
+ static class UserCacheEntry {
-- private final GameProfile b;
-+ private final GameProfile b;public GameProfile getProfile() { return b; } // Paper - OBFHELPER
- private final Date c;
+- private final GameProfile a;
++ private final GameProfile a;public GameProfile getProfile() { return a; } // Paper - OBFHELPER
+ private final Date b;
+ private volatile long c;
- private UserCacheEntry(GameProfile gameprofile, Date date) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
diff --git a/Spigot-Server-Patches/Cache-user-authenticator-threads.patch b/Spigot-Server-Patches/Cache-user-authenticator-threads.patch
index e5c349a4f2..02db3c60e0 100644
--- a/Spigot-Server-Patches/Cache-user-authenticator-threads.patch
+++ b/Spigot-Server-Patches/Cache-user-authenticator-threads.patch
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import java.util.Deque; // Paper
import java.util.Iterator;
import java.util.List;
- import java.util.OptionalInt;
+ import java.util.Optional;
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public PlayerConnection playerConnection;
public final MinecraftServer server;
@@ -58,11 +58,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Optimize remove queue - vanilla copies player objects, but CB doesn't. This method currently only
+ // Applies to the same player, so we need to not duplicate our removal queue. The rest of this method does "resetting"
+ // type logic so it does need to be called, maybe? This is silly.
-+ //this.removeQueue.addAll(entityplayer.removeQueue);
++ // this.removeQueue.addAll(entityplayer.removeQueue);
+ if (this.removeQueue != entityplayer.removeQueue) {
+ this.removeQueue.addAll(entityplayer.removeQueue);
+ }
+ // Paper end
- this.ck = entityplayer.ck;
- this.cp = entityplayer.cp;
+ this.cd = entityplayer.cd;
+ this.ci = entityplayer.ci;
this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft());
diff --git a/Spigot-Server-Patches/Catch-exceptions-from-dispenser-entity-spawns.patch b/Spigot-Server-Patches/Catch-exceptions-from-dispenser-entity-spawns.patch
index ef9737b84b..9ff195872f 100644
--- a/Spigot-Server-Patches/Catch-exceptions-from-dispenser-entity-spawns.patch
+++ b/Spigot-Server-Patches/Catch-exceptions-from-dispenser-entity-spawns.patch
@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
entitytypes.spawnCreature(isourceblock.getWorld(), itemstack, (EntityHuman) null, isourceblock.getBlockPosition().shift(enumdirection), EnumMobSpawn.DISPENSER, enumdirection != EnumDirection.UP, false);
+ // Paper start
+ } catch (Exception ex){
-+ MinecraftServer.LOGGER.warn("An exception occurred dispensing entity at {}[{}]", world.getWorld().getName(), isourceblock.getBlockPosition(), ex);
++ MinecraftServer.LOGGER.warn("An exception occurred dispensing entity at {}[{}]", worldserver.getWorld().getName(), isourceblock.getBlockPosition(), ex);
+ }
+ // Paper end
+
diff --git a/Spigot-Server-Patches/Check-Drowned-for-Villager-Aggression-Config.patch b/Spigot-Server-Patches/Check-Drowned-for-Villager-Aggression-Config.patch
index 266dd029d2..7ad8a6e3fb 100644
--- a/Spigot-Server-Patches/Check-Drowned-for-Villager-Aggression-Config.patch
+++ b/Spigot-Server-Patches/Check-Drowned-for-Villager-Aggression-Config.patch
@@ -11,9 +11,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity {
this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, 1.0D));
this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityDrowned.class})).a(EntityPigZombie.class));
- this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::j));
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::i));
- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false));
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); // Paper
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
- this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bv));
+ this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bo));
}
diff --git a/Spigot-Server-Patches/Chunk-debug-command.patch b/Spigot-Server-Patches/Chunk-debug-command.patch
index f188ecbbf2..e34f2dc066 100644
--- a/Spigot-Server-Patches/Chunk-debug-command.patch
+++ b/Spigot-Server-Patches/Chunk-debug-command.patch
@@ -201,9 +201,9 @@ diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java
-@@ -0,0 +0,0 @@ import com.destroystokyo.paper.profile.CraftPlayerProfile;
- import com.destroystokyo.paper.profile.PlayerProfile;
+@@ -0,0 +0,0 @@ import com.destroystokyo.paper.profile.PlayerProfile;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
+ import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet;
import org.apache.commons.lang.exception.ExceptionUtils;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
@@ -408,8 +408,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private int n;
- private final ChunkCoordIntPair location;
+ final ChunkCoordIntPair location; // Paper - private -> package
- private final short[] dirtyBlocks;
- private int dirtyCount;
+ private boolean p;
+ private final ShortSet[] dirtyBlocks;
private int r;
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
diff --git a/Spigot-Server-Patches/ChunkMapDistance-CME.patch b/Spigot-Server-Patches/ChunkMapDistance-CME.patch
index 6360b000c5..a13ae349ae 100644
--- a/Spigot-Server-Patches/ChunkMapDistance-CME.patch
+++ b/Spigot-Server-Patches/ChunkMapDistance-CME.patch
@@ -60,6 +60,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return true;
} else {
if (!this.l.isEmpty()) {
+@@ -0,0 +0,0 @@ public abstract class ChunkMapDistance {
+ ObjectIterator objectiterator = this.a.long2ByteEntrySet().iterator();
+
+ while (objectiterator.hasNext()) {
+- it.unimi.dsi.fastutil.longs.Long2ByteMap.Entry it_unimi_dsi_fastutil_longs_long2bytemap_entry = (it.unimi.dsi.fastutil.longs.Long2ByteMap.Entry) objectiterator.next();
++ Long2ByteMap.Entry it_unimi_dsi_fastutil_longs_long2bytemap_entry = (Long2ByteMap.Entry) objectiterator.next(); // Paper - decompile fix
+ byte b0 = it_unimi_dsi_fastutil_longs_long2bytemap_entry.getByteValue();
+ long j = it_unimi_dsi_fastutil_longs_long2bytemap_entry.getLongKey();
+
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
diff --git a/Spigot-Server-Patches/Configurable-Bed-Search-Radius.patch b/Spigot-Server-Patches/Configurable-Bed-Search-Radius.patch
deleted file mode 100644
index 103cea0352..0000000000
--- a/Spigot-Server-Patches/Configurable-Bed-Search-Radius.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Aikar
-Date: Wed, 4 Jul 2018 15:22:06 -0400
-Subject: [PATCH] Configurable Bed Search Radius
-
-Allows you to increase how far to check for a safe place to respawn
-a player near their bed, allowing a better chance to respawn the
-player at their bed should it of became obstructed.
-
-Defaults to vanilla 1.
-
-diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
-@@ -0,0 +0,0 @@ public class PaperWorldConfig {
- private void scanForLegacyEnderDragon() {
- scanForLegacyEnderDragon = getBoolean("game-mechanics.scan-for-legacy-ender-dragon", true);
- }
-+
-+ public int bedSearchRadius = 1;
-+ private void bedSearchRadius() {
-+ bedSearchRadius = getInt("bed-search-radius", 1);
-+ if (bedSearchRadius < 1) {
-+ bedSearchRadius = 1;
-+ }
-+ if (bedSearchRadius > 1) {
-+ log("Bed Search Radius: " + bedSearchRadius);
-+ }
-+ }
- }
-diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/BlockBed.java
-+++ b/src/main/java/net/minecraft/server/BlockBed.java
-@@ -0,0 +0,0 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
-
- public static Optional a(EntityTypes> entitytypes, IWorldReader iworldreader, BlockPosition blockposition, int i) {
- EnumDirection enumdirection = (EnumDirection) iworldreader.getType(blockposition).get(BlockBed.FACING);
-+ // Paper start - configurable bed search radius
-+ if (entitytypes == EntityTypes.PLAYER) return findSafePosition(entitytypes, (World) iworldreader, enumdirection, blockposition);
- int j = blockposition.getX();
- int k = blockposition.getY();
- int l = blockposition.getZ();
-@@ -0,0 +0,0 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
- return Optional.empty();
- }
-
-- public static Optional a(EntityTypes> entitytypes, IWorldReader iworldreader, BlockPosition blockposition) {
-+ private static Optional findSafePosition(EntityTypes> entitytypes, World world, EnumDirection updirection, BlockPosition blockposition){
-+ int radius = world.paperConfig.bedSearchRadius;
-+ double angle = Math.PI / 2;
-+ int tmpX = (int)(updirection.getAdjacentX() * Math.cos(angle) - updirection.getAdjacentZ() * Math.sin(angle));
-+ int tmpZ = (int)(updirection.getAdjacentX() * Math.sin(angle) + updirection.getAdjacentZ() * Math.cos(angle));
-+
-+ EnumDirection rightDirection = EnumDirection.a(tmpX, 0, tmpZ);
-+ EnumDirection downDirection = updirection.opposite();
-+ EnumDirection leftDirection = rightDirection.opposite();
-+
-+ EnumDirection[] corePositionOutDirection = new EnumDirection[6];
-+ corePositionOutDirection[0] = updirection;
-+ corePositionOutDirection[1] = leftDirection;
-+ corePositionOutDirection[2] = leftDirection;
-+ corePositionOutDirection[3] = downDirection;
-+ corePositionOutDirection[4] = rightDirection;
-+ corePositionOutDirection[5] = rightDirection;
-+
-+ BlockPosition[] corePosition = new BlockPosition[6];
-+ corePosition[0] = blockposition.add(updirection.getAdjacentX(), 0, updirection.getAdjacentZ());
-+ corePosition[1] = blockposition.add(leftDirection.getAdjacentX(), 0, leftDirection.getAdjacentZ());
-+ corePosition[2] = corePosition[1].add(downDirection.getAdjacentX(), 0, downDirection.getAdjacentZ());
-+ corePosition[3] = blockposition.add(2 * downDirection.getAdjacentX(), 0, 2 * downDirection.getAdjacentZ());
-+ corePosition[5] = blockposition.add(rightDirection.getAdjacentX(), 0, rightDirection.getAdjacentZ());
-+ corePosition[4] = corePosition[5].add(downDirection.getAdjacentX(), 0, downDirection.getAdjacentZ());
-+
-+ BlockPosition[] tmpPosition = new BlockPosition[8];
-+ EnumDirection[] tmpPositionDirection = new EnumDirection[8];
-+ tmpPositionDirection[0] = rightDirection;
-+ tmpPositionDirection[1] = leftDirection;
-+ tmpPositionDirection[2] = updirection;
-+ tmpPositionDirection[3] = downDirection;
-+ tmpPositionDirection[4] = leftDirection;
-+ tmpPositionDirection[5] = rightDirection;
-+ tmpPositionDirection[6] = downDirection;
-+ tmpPositionDirection[7] = updirection;
-+
-+ BlockPosition pos;
-+ Optional vector;
-+ for (int r = 1; r <= radius; r++) {
-+ int h = 0;
-+ while (h <= 1) {
-+ int numIterated = 0;
-+ for (int index = (int)(Math.random() * corePosition.length); numIterated < corePosition.length; index = (index+1) % corePosition.length) {
-+ numIterated++;
-+
-+ pos = corePosition[index].add(0, h, 0);
-+ vector = isSafeRespawn(entitytypes, world, pos, 0);
-+ if (vector.isPresent()) {
-+ return vector;
-+ }
-+ }
-+ tmpPosition[0] = corePosition[0].add(0, h, 0);
-+ tmpPosition[1] = corePosition[0].add(0, h, 0);
-+ tmpPosition[2] = corePosition[1].add(0, h, 0);
-+ tmpPosition[3] = corePosition[2].add(0, h, 0);
-+ tmpPosition[4] = corePosition[3].add(0, h, 0);
-+ tmpPosition[5] = corePosition[3].add(0, h, 0);
-+ tmpPosition[6] = corePosition[4].add(0, h, 0);
-+ tmpPosition[7] = corePosition[5].add(0, h, 0);
-+ for (int rr = 1; rr <= r; rr++){
-+ numIterated = 0;
-+ for (int index = (int)(Math.random() * tmpPosition.length); numIterated < tmpPosition.length; index = (index+1) % tmpPosition.length) {
-+ numIterated++;
-+ tmpPosition[index] = tmpPosition[index].add(tmpPositionDirection[index].getAdjacentX(), 0, tmpPositionDirection[index].getAdjacentZ());
-+ pos = tmpPosition[index];
-+
-+ vector = isSafeRespawn(entitytypes, world, pos, 0);
-+ if (vector.isPresent()) {
-+ return vector;
-+ }
-+ }
-+ }
-+ switch (h) {
-+ case 0:
-+ h = -1;
-+ break;
-+ case -1:
-+ h = -2;
-+ break;
-+ case -2:
-+ h = Integer.MAX_VALUE;
-+ break;
-+ }
-+ }
-+ for (int index = 0; index < corePosition.length; index++) {
-+ EnumDirection tmp = corePositionOutDirection[index];
-+ corePosition[index] = corePosition[index].add(tmp.getAdjacentX(), 0, tmp.getAdjacentZ());
-+ }
-+ }
-+ return Optional.empty();
-+ }
-+ // Paper end
-+
-+ // Paper start -- add maxBelow param
-+ public static Optional a(EntityTypes> entitytypes, IWorldReader iworldreader, BlockPosition blockposition) { return isSafeRespawn(entitytypes, iworldreader, blockposition, 2); }
-+ public static Optional isSafeRespawn(EntityTypes> entitytypes, IWorldReader iworldreader, BlockPosition blockposition, int maxBelow) {
-+ // Paper end
- VoxelShape voxelshape = iworldreader.getType(blockposition).getCollisionShape(iworldreader, blockposition);
-
- if (voxelshape.c(EnumDirection.EnumAxis.Y) > 0.4375D) {
-@@ -0,0 +0,0 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity {
- } else {
- BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i();
-
-- while (blockposition_mutableblockposition.getY() >= 0 && blockposition.getY() - blockposition_mutableblockposition.getY() <= 2 && iworldreader.getType(blockposition_mutableblockposition).getCollisionShape(iworldreader, blockposition_mutableblockposition).isEmpty()) {
-+ while (blockposition_mutableblockposition.getY() >= 0 && blockposition.getY() - blockposition_mutableblockposition.getY() <= maxBelow && iworldreader.getType(blockposition_mutableblockposition).getCollisionShape(iworldreader, blockposition_mutableblockposition).isEmpty()) { // Paper -- configurable max distance to search below
- blockposition_mutableblockposition.c(EnumDirection.DOWN);
- }
-
diff --git a/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch
index 2767a075d0..5c8a9c04ab 100644
--- a/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch
+++ b/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch
@@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java
@@ -0,0 +0,0 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional
- if (blockposition != null) {
+ if (vec3d != null) {
WorldServer worldserver = loottableinfo.getWorld();
+ // Paper start
+ if (!worldserver.paperConfig.enableTreasureMaps) {
@@ -44,9 +44,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return itemstack;
+ }
+ // Paper end
- BlockPosition blockposition1 = worldserver.a(this.e, blockposition, this.h, this.i);
+ BlockPosition blockposition = worldserver.a(this.e, new BlockPosition(vec3d), this.h, this.i);
- if (blockposition1 != null) {
+ if (blockposition != null) {
diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/VillagerTrades.java
diff --git a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch
index aef440b533..645de3ffa3 100644
--- a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch
+++ b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch
@@ -106,7 +106,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
- return ((PersistentIdCounts) this.getMinecraftServer().D().getWorldPersistentData().a(PersistentIdCounts::new, "idcounts")).a();
+ return ((PersistentIdCounts) this.getMinecraftServer().E().getWorldPersistentData().a(PersistentIdCounts::new, "idcounts")).a();
}
+ // Paper start - helper function for configurable spawn radius
@@ -180,13 +180,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
+
- public void a_(BlockPosition blockposition) {
+ public void a(BlockPosition blockposition, float f) {
- ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c()));
+ // Paper - configurable spawn radius
+ BlockPosition prevSpawn = this.getSpawn();
+ //ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c()));
- this.worldData.setSpawn(blockposition);
+ this.worldData.setSpawn(blockposition, f);
- this.getChunkProvider().removeTicket(TicketType.START, chunkcoordintpair, 11, Unit.INSTANCE);
- this.getChunkProvider().addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
+ if (this.keepSpawnInMemory) {
@@ -194,7 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.removeTicketsForSpawn(this.paperConfig.keepLoadedRange, prevSpawn);
+ this.addTicketsForSpawn(this.paperConfig.keepLoadedRange, blockposition);
+ }
- this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition));
+ this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition, f));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
diff --git a/Spigot-Server-Patches/Configurable-RCON-IP-address.patch b/Spigot-Server-Patches/Configurable-RCON-IP-address.patch
index 87b4c10282..c29a901007 100644
--- a/Spigot-Server-Patches/Configurable-RCON-IP-address.patch
+++ b/Spigot-Server-Patches/Configurable-RCON-IP-address.patch
@@ -16,19 +16,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public final String rconIp; // Paper - Add rcon ip
+
// CraftBukkit start
- public DedicatedServerProperties(Properties properties, OptionSet optionset) {
+ public DedicatedServerProperties(Properties properties, IRegistryCustom iregistrycustom, OptionSet optionset) {
super(properties, optionset);
@@ -0,0 +0,0 @@ public class DedicatedServerProperties extends PropertyManager d = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
- private static final DataWatcherObject bv = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
+ private static final DataWatcherObject bo = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
public static final DataWatcherObject DROWN_CONVERTING = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
if (this.world != null && !this.world.isClientSide) {
diff --git a/Spigot-Server-Patches/Configurable-chance-of-villager-zombie-infection.patch b/Spigot-Server-Patches/Configurable-chance-of-villager-zombie-infection.patch
index c816903f2b..3085084468 100644
--- a/Spigot-Server-Patches/Configurable-chance-of-villager-zombie-infection.patch
+++ b/Spigot-Server-Patches/Configurable-chance-of-villager-zombie-infection.patch
@@ -27,13 +27,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
@Override
- public void a_(EntityLiving entityliving) {
- super.a_(entityliving);
-- if ((this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD) && entityliving instanceof EntityVillager) {
-- if (this.world.getDifficulty() != EnumDifficulty.HARD && this.random.nextBoolean()) {
+ public void a(WorldServer worldserver, EntityLiving entityliving) {
+ super.a(worldserver, entityliving);
+- if ((worldserver.getDifficulty() == EnumDifficulty.NORMAL || worldserver.getDifficulty() == EnumDifficulty.HARD) && entityliving instanceof EntityVillager) {
+- if (worldserver.getDifficulty() != EnumDifficulty.HARD && this.random.nextBoolean()) {
+ // Paper start
-+ if (world.paperConfig.zombieVillagerInfectionChance != 0.0 && (world.paperConfig.zombieVillagerInfectionChance != -1.0 || this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD) && entityliving instanceof EntityVillager) {
-+ if (world.paperConfig.zombieVillagerInfectionChance == -1.0 && this.world.getDifficulty() != EnumDifficulty.HARD && this.random.nextBoolean()) {
++ if (world.paperConfig.zombieVillagerInfectionChance != 0.0 && (world.paperConfig.zombieVillagerInfectionChance != -1.0 || worldserver.getDifficulty() == EnumDifficulty.NORMAL || worldserver.getDifficulty() == EnumDifficulty.HARD) && entityliving instanceof EntityVillager) {
++ if (world.paperConfig.zombieVillagerInfectionChance == -1.0 && worldserver.getDifficulty() != EnumDifficulty.HARD && this.random.nextBoolean()) {
return;
}
+ if (world.paperConfig.zombieVillagerInfectionChance != -1.0 && (this.random.nextDouble() * 100.0) > world.paperConfig.zombieVillagerInfectionChance) {
@@ -41,4 +41,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } // Paper end
EntityVillager entityvillager = (EntityVillager) entityliving;
- EntityZombieVillager entityzombievillager = (EntityZombieVillager) EntityTypes.ZOMBIE_VILLAGER.a(this.world);
+ // CraftBukkit start
diff --git a/Spigot-Server-Patches/Configurable-end-credits.patch b/Spigot-Server-Patches/Configurable-end-credits.patch
index 95723e15ee..f7d8f935a6 100644
--- a/Spigot-Server-Patches/Configurable-end-credits.patch
+++ b/Spigot-Server-Patches/Configurable-end-credits.patch
@@ -24,19 +24,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
- private long ch = SystemUtils.getMonotonicMillis();
+ private long ca = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity;
public boolean worldChangeInvuln;
-- private boolean ck;
-+ private boolean ck; private void setHasSeenCredits(boolean has) { this.ck = has; } // Paper - OBFHELPER
+- private boolean cd;
++ private boolean cd; private void setHasSeenCredits(boolean has) { this.cd = has; } // Paper - OBFHELPER
private final RecipeBookServer recipeBook = new RecipeBookServer();
- private Vec3D cm;
- private int cn;
+ private Vec3D cf;
+ private int cg;
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
+ this.decouple();
this.getWorldServer().removePlayer(this);
if (!this.viewingCredits) {
- this.viewingCredits = true;
+ if (world.paperConfig.disableEndCredits) this.setHasSeenCredits(true); // Paper - Toggle to always disable end credits
- this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.e, this.ck ? 0.0F : 1.0F));
- this.ck = true;
- }
+ this.viewingCredits = true;
+ this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.e, this.cd ? 0.0F : 1.0F));
+ this.cd = true;
diff --git a/Spigot-Server-Patches/Configurable-fishing-time-ranges.patch b/Spigot-Server-Patches/Configurable-fishing-time-ranges.patch
index c90f101c7b..dd5b6eff3e 100644
--- a/Spigot-Server-Patches/Configurable-fishing-time-ranges.patch
+++ b/Spigot-Server-Patches/Configurable-fishing-time-ranges.patch
@@ -26,13 +26,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -0,0 +0,0 @@ public class EntityFishingHook extends IProjectile {
- this.ap = MathHelper.nextInt(this.random, 20, 80);
+ this.ai = MathHelper.nextInt(this.random, 20, 80);
}
} else {
-- this.ao = MathHelper.nextInt(this.random, 100, 600);
-+ this.ao = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper
- this.ao -= this.av * 20 * 5;
-+ this.ao = Math.max(0, this.ao); // Paper - Don't allow negative values;
+- this.ah = MathHelper.nextInt(this.random, 100, 600);
++ this.ah = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper
+ this.ah -= this.ao * 20 * 5;
}
}
-
diff --git a/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch
index 8c6619990c..1b302b0a63 100644
--- a/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch
+++ b/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch
@@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Extracted to own function
+ /*
if (this.locY() < -64.0D) {
- this.ai();
+ this.am();
}
+ */
+ this.performVoidDamage();
@@ -50,7 +50,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!this.world.isClientSide) {
this.setFlag(0, this.fireTicks > 0);
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
- this.world.getMethodProfiler().exit();
+ this.setFireTicks(0);
}
+ // Paper start
@@ -58,21 +58,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.locY() < -64.0D || (this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER
+ && world.paperConfig.doNetherTopVoidDamage()
+ && this.locY() >= world.paperConfig.netherVoidTopDamageHeight)) {
-+
+ this.doVoidDamage();
+ }
+ }
+ // Paper end
-+
- protected void E() {
- if (this.portalCooldown > 0) {
- --this.portalCooldown;
-@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
- this.setFireTicks(0);
- }
-
-+ protected final void doVoidDamage() { this.ai(); } // Paper - OBFHELPER
- protected void ai() {
++ protected final void doVoidDamage() { this.am(); } // Paper - OBFHELPER
+ protected void am() {
this.die();
}
diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java
@@ -87,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Extracted to own function
+ /*
if (this.locY() < -64.0D) {
- this.ai();
+ this.am();
}
+ */
+ this.performVoidDamage();
diff --git a/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch b/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch
index b15a8f6f67..95aa3cc8e6 100644
--- a/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch
+++ b/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch
@@ -21,17 +21,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (event.isCancelled()) {
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
+ } else {
itemstack = this.activeItem.a(this.world, this);
}
-
++
+ // Paper start - save the default replacement item and change it if necessary
+ final ItemStack defaultReplacement = itemstack;
+ if (event != null && event.getReplacement() != null) {
+ itemstack = CraftItemStack.asNMSCopy(event.getReplacement());
+ }
+ // Paper end
- this.a(this.getRaisedHand(), itemstack);
// CraftBukkit end
+
+ if (itemstack != this.activeItem) {
+@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
+ }
+
this.clearActiveItem();
+ // Paper start - if the replacement is anything but the default, update the client inventory
+ if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
diff --git a/Spigot-Server-Patches/Disable-explosion-knockback.patch b/Spigot-Server-Patches/Disable-explosion-knockback.patch
index 4a190a8f62..c006445539 100644
--- a/Spigot-Server-Patches/Disable-explosion-knockback.patch
+++ b/Spigot-Server-Patches/Disable-explosion-knockback.patch
@@ -64,6 +64,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.abilities.isFlying)) {
+ if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.abilities.isFlying) && !world.paperConfig.disableExplosionKnockback) { // Paper - Disable explosion knockback
- this.m.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13));
+ this.n.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13));
}
}
diff --git a/Spigot-Server-Patches/Disable-thunder.patch b/Spigot-Server-Patches/Disable-thunder.patch
index afd1f5970d..94bfb5ea46 100644
--- a/Spigot-Server-Patches/Disable-thunder.patch
+++ b/Spigot-Server-Patches/Disable-thunder.patch
@@ -26,8 +26,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
gameprofilerfiller.enter("thunder");
BlockPosition blockposition;
-- if (flag && this.T() && this.random.nextInt(100000) == 0) {
-+ if (!this.paperConfig.disableThunder && flag && this.T() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder
+- if (flag && this.V() && this.random.nextInt(100000) == 0) {
++ if (!this.paperConfig.disableThunder && flag && this.V() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder
blockposition = this.a(this.a(j, 0, k, 15));
if (this.isRainingAt(blockposition)) {
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);
diff --git a/Spigot-Server-Patches/Do-less-work-if-we-have-a-custom-Bukkit-generator.patch b/Spigot-Server-Patches/Do-less-work-if-we-have-a-custom-Bukkit-generator.patch
index 6fd63597f2..db0d833966 100644
--- a/Spigot-Server-Patches/Do-less-work-if-we-have-a-custom-Bukkit-generator.patch
+++ b/Spigot-Server-Patches/Do-less-work-if-we-have-a-custom-Bukkit-generator.patch
@@ -12,12 +12,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant list = worldchunkmanager.b();
- Random random = new Random(worldserver.getSeed());
-- BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, list, random);
+- BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, (biomebase) -> {
+- return biomebase.b().b();
+- }, random);
- ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
+ // Paper start - moved down
// CraftBukkit start
@@ -30,9 +31,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - if the generator created a spawn for us, then there is no need for us to also create a spawn -
+ // only do it if the generator did not
+ WorldChunkManager worldchunkmanager = chunkgenerator.getWorldChunkManager();
-+ List list = worldchunkmanager.b();
+ Random random = new Random(worldserver.getSeed());
-+ BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, list, random);
++ BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, (biomebase) -> {
++ return biomebase.b().b();
++ }, random);
+ ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
+ // Paper end
diff --git a/Spigot-Server-Patches/Do-not-allow-bees-to-load-chunks-for-beehives.patch b/Spigot-Server-Patches/Do-not-allow-bees-to-load-chunks-for-beehives.patch
index 521514d73d..9028abc3d3 100644
--- a/Spigot-Server-Patches/Do-not-allow-bees-to-load-chunks-for-beehives.patch
+++ b/Spigot-Server-Patches/Do-not-allow-bees-to-load-chunks-for-beehives.patch
@@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB
@Override
public boolean g() {
- if (EntityBee.this.hasHivePos() && EntityBee.this.fe() && EntityBee.this.hivePos.a((IPosition) EntityBee.this.getPositionVector(), 2.0D)) {
+ if (EntityBee.this.hasHivePos() && EntityBee.this.fd() && EntityBee.this.hivePos.a((IPosition) EntityBee.this.getPositionVector(), 2.0D)) {
+ if (!EntityBee.this.world.isLoadedAndInBounds(EntityBee.this.hivePos)) return false; // Paper
TileEntity tileentity = EntityBee.this.world.getTileEntity(EntityBee.this.hivePos);
diff --git a/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch b/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch
index bd4db3be6c..756b6de907 100644
--- a/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch
+++ b/Spigot-Server-Patches/Do-not-load-chunks-for-Pathfinding.patch
@@ -49,8 +49,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (iblockdata.a(Blocks.CACTUS)) {
return PathType.DANGER_CACTUS;
@@ -0,0 +0,0 @@ public class PathfinderNormal extends PathfinderAbstract {
- if (fluid.a((Tag) TagsFluid.LAVA)) {
- return PathType.LAVA;
+ if (iblockaccess.getFluid(blockposition_mutableblockposition).a((Tag) TagsFluid.WATER)) {
+ return PathType.WATER_BORDER;
}
+ } // Paper
}
diff --git a/Spigot-Server-Patches/Don-t-change-the-Entity-Random-seed-for-squids.patch b/Spigot-Server-Patches/Don-t-change-the-Entity-Random-seed-for-squids.patch
index da14abf72b..16835ae2d1 100644
--- a/Spigot-Server-Patches/Don-t-change-the-Entity-Random-seed-for-squids.patch
+++ b/Spigot-Server-Patches/Don-t-change-the-Entity-Random-seed-for-squids.patch
@@ -14,6 +14,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
super(entitytypes, world);
- this.random.setSeed((long) this.getId());
+ //this.random.setSeed((long) this.getId()); // Paper
- this.bB = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
+ this.bu = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
}
diff --git a/Spigot-Server-Patches/Don-t-check-ConvertSigns-boolean-every-sign-save.patch b/Spigot-Server-Patches/Don-t-check-ConvertSigns-boolean-every-sign-save.patch
index ebe095889d..c4a6200bf9 100644
--- a/Spigot-Server-Patches/Don-t-check-ConvertSigns-boolean-every-sign-save.patch
+++ b/Spigot-Server-Patches/Don-t-check-ConvertSigns-boolean-every-sign-save.patch
@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
- private final IChatFormatted[] g;
+ private final FormattedString[] g;
private EnumColor color;
public java.util.UUID signEditor; // Paper
+ private static final boolean CONVERT_LEGACY_SIGNS = Boolean.getBoolean("convertLegacySigns"); // Paper
diff --git a/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch b/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch
index ac41c2cb49..f27b00a383 100644
--- a/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch
+++ b/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch
@@ -4,19 +4,6 @@ Date: Fri, 16 Dec 2016 16:03:19 -0600
Subject: [PATCH] Don't let fishinghooks use portals
-diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/Entity.java
-+++ b/src/main/java/net/minecraft/server/Entity.java
-@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
- public boolean ac;
- public boolean impulse;
- public int portalCooldown;
-- protected boolean inPortal;
-+ protected boolean inPortal; public final boolean inPortal() { return this.inPortal; } // Paper - OBFHELPER
- protected int portalTicks;
- protected BlockPosition ah;
- protected Vec3D ai;
diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityFishingHook.java
@@ -24,8 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityFishingHook extends IProjectile {
this.setMot(this.getMot().a(0.92D));
- this.ac();
-+
+ this.ae();
+ // Paper start - These shouldn't be going through portals
+ if (this.inPortal) {
+ this.die();
diff --git a/Spigot-Server-Patches/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/Spigot-Server-Patches/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
index 4526b7b73b..62ef06f5dc 100644
--- a/Spigot-Server-Patches/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
+++ b/Spigot-Server-Patches/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch
@@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -0,0 +0,0 @@ public class UserCache {
- };
-
gameprofilerepository.findProfilesByNames(new String[]{s}, Agent.MINECRAFT, profilelookupcallback);
-- if (!d() && agameprofile[0] == null) {
-+ if (!d() && agameprofile[0] == null && !org.apache.commons.lang3.StringUtils.isBlank(s)) { // Paper - Don't lookup a profile with a blank name
- UUID uuid = EntityHuman.a(new GameProfile((UUID) null, s));
- GameProfile gameprofile = new GameProfile(uuid, s);
+ GameProfile gameprofile = (GameProfile) atomicreference.get();
+- if (!c() && gameprofile == null) {
++ if (!c() && gameprofile == null && !org.apache.commons.lang3.StringUtils.isBlank(s)) { // Paper - Don't lookup a profile with a blank name
+ UUID uuid = EntityHuman.a(new GameProfile((UUID) null, s));
+
+ gameprofile = new GameProfile(uuid, s);
diff --git a/Spigot-Server-Patches/Don-t-mark-null-chunk-sections-for-block-updates.patch b/Spigot-Server-Patches/Don-t-mark-null-chunk-sections-for-block-updates.patch
new file mode 100644
index 0000000000..b718c4c741
--- /dev/null
+++ b/Spigot-Server-Patches/Don-t-mark-null-chunk-sections-for-block-updates.patch
@@ -0,0 +1,18 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mariell Hoversholm
+Date: Fri, 14 Aug 2020 23:41:19 +0200
+Subject: [PATCH] Don't mark null chunk sections for block updates
+
+
+diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/PlayerChunk.java
++++ b/src/main/java/net/minecraft/server/PlayerChunk.java
+@@ -0,0 +0,0 @@ public class PlayerChunk {
+ this.a(world, blockposition, iblockdata);
+ } else {
+ ChunkSection chunksection = chunk.getSections()[sectionposition.getY()];
++ if (chunksection == null) chunksection = new ChunkSection(sectionposition.getY(), chunk, world, true); // Paper - make a new chunk section if none was found
+ PacketPlayOutMultiBlockChange packetplayoutmultiblockchange = new PacketPlayOutMultiBlockChange(sectionposition, shortset, chunksection, this.x);
+
+ this.a(packetplayoutmultiblockchange, false);
diff --git a/Spigot-Server-Patches/Don-t-move-existing-players-to-world-spawn.patch b/Spigot-Server-Patches/Don-t-move-existing-players-to-world-spawn.patch
index 875b09ea4f..ec87e6d681 100644
--- a/Spigot-Server-Patches/Don-t-move-existing-players-to-world-spawn.patch
+++ b/Spigot-Server-Patches/Don-t-move-existing-players-to-world-spawn.patch
@@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.serverStatisticManager = minecraftserver.getPlayerList().getStatisticManager(this);
this.advancementDataPlayer = minecraftserver.getPlayerList().f(this);
this.G = 1.0F;
-- this.b(worldserver);
-+ //this.b(worldserver); // Paper - don't move to spawn on login, only first join
+- this.c(worldserver);
++ //this.c(worldserver); // Paper - don't move to spawn on login, only first join
this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
@@ -26,8 +26,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
// CraftBukkit end
-+ public final void moveToSpawn(WorldServer worldserver) { b(worldserver); } // Paper - OBFHELPER
- private void b(WorldServer worldserver) {
++ public final void moveToSpawn(WorldServer worldserver) { c(worldserver); } // Paper - OBFHELPER
+ private void c(WorldServer worldserver) {
BlockPosition blockposition = worldserver.getSpawn();
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
diff --git a/Spigot-Server-Patches/Don-t-require-FACING-data.patch b/Spigot-Server-Patches/Don-t-require-FACING-data.patch
new file mode 100644
index 0000000000..08a415add6
--- /dev/null
+++ b/Spigot-Server-Patches/Don-t-require-FACING-data.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mariell Hoversholm
+Date: Sun, 23 Aug 2020 19:01:04 +0200
+Subject: [PATCH] Don't require FACING data
+
+
+diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java
++++ b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java
+@@ -0,0 +0,0 @@ import org.bukkit.event.block.BlockDispenseEvent;
+ // CraftBukkit end
+
+ public class DispenseBehaviorItem implements IDispenseBehavior {
++ private EnumDirection enumdirection; // Paper
+
+ public DispenseBehaviorItem() {}
+
+ @Override
+ public final ItemStack dispense(ISourceBlock isourceblock, ItemStack itemstack) {
++ enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); // Paper - cache facing direction
+ ItemStack itemstack1 = this.a(isourceblock, itemstack);
+
+ this.a(isourceblock);
+- this.a(isourceblock, (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
++ this.a(isourceblock, enumdirection); // Paper - cache facing direction
+ return itemstack1;
+ }
+
+ protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
+- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
++ // Paper - cached enum direction
+ IPosition iposition = BlockDispenser.a(isourceblock);
+ ItemStack itemstack1 = itemstack.cloneAndSubtract(1);
+
diff --git a/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch
index c541487bda..fe838c4214 100644
--- a/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch
+++ b/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch
@@ -103,7 +103,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public final void setUUID(UUID uuid) { a_(uuid); } // Paper - OBFHELPER
public void a_(UUID uuid) {
this.uniqueID = uuid;
- this.al = this.uniqueID.toString();
+ this.ae = this.uniqueID.toString();
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -200,7 +200,7 @@ diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
-@@ -0,0 +0,0 @@ import com.google.common.collect.ImmutableList;
+@@ -0,0 +0,0 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Iterables;
import co.aikar.timings.TimingHistory; // Paper
import co.aikar.timings.Timings; // Paper
@@ -213,16 +213,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (entity1 == null) {
return false;
} else {
-- WorldServer.LOGGER.error("Keeping entity {} that already exists with UUID {}", EntityTypes.getName(entity1.getEntityType()), entity.getUniqueID().toString()); // CraftBukkit // paper
+ // Paper start
+ if (entity1.dead) {
+ unregisterEntity(entity1); // remove the existing entity
+ return false;
+ }
+ // Paper end
-+ WorldServer.LOGGER.error("Keeping entity {} that already exists with UUID {}", entity1, entity.getUniqueID().toString()); // CraftBukkit // paper
- WorldServer.LOGGER.error("Deleting duplicate entity {}", entity); // CraftBukkit // paper
-+
+ WorldServer.LOGGER.warn("Trying to add entity with duplicated UUID {}. Existing {}#{}, new: {}#{}", uuid, EntityTypes.getName(entity1.getEntityType()), entity1.getId(), EntityTypes.getName(entity.getEntityType()), entity.getId()); // CraftBukkit // Paper
+ // Paper start
+ if (DEBUG_ENTITIES && entity.world.paperConfig.duplicateUUIDMode != PaperWorldConfig.DuplicateUUIDMode.NOTHING) {
+ if (entity1.addedToWorldStack != null) {
diff --git a/Spigot-Server-Patches/EnderDragon-Events.patch b/Spigot-Server-Patches/EnderDragon-Events.patch
index 35ea45a96c..ef0a19b150 100644
--- a/Spigot-Server-Patches/EnderDragon-Events.patch
+++ b/Spigot-Server-Patches/EnderDragon-Events.patch
@@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ else entitydragonfireball.die(); // Paper
this.c = 0;
if (this.d != null) {
- while (!this.d.b()) {
+ while (!this.d.c()) {
diff --git a/src/main/java/net/minecraft/server/EntityDragonFireball.java b/src/main/java/net/minecraft/server/EntityDragonFireball.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityDragonFireball.java
diff --git a/Spigot-Server-Patches/Enderman.teleportRandomly.patch b/Spigot-Server-Patches/Enderman.teleportRandomly.patch
index 9acdb7359d..c797bd6630 100644
--- a/Spigot-Server-Patches/Enderman.teleportRandomly.patch
+++ b/Spigot-Server-Patches/Enderman.teleportRandomly.patch
@@ -13,8 +13,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
super.mobTick();
}
-+ public final boolean teleportRandomly() { return this.eM(); } // Paper - OBFHELPER
- protected boolean eM() {
++ public final boolean teleportRandomly() { return this.eL(); } // Paper - OBFHELPER
+ protected boolean eL() {
if (!this.world.s_() && this.isAlive()) {
double d0 = this.locX() + (this.random.nextDouble() - 0.5D) * 64.0D;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
diff --git a/Spigot-Server-Patches/EndermanEscapeEvent.patch b/Spigot-Server-Patches/EndermanEscapeEvent.patch
index 51f67b3941..582906b5f7 100644
--- a/Spigot-Server-Patches/EndermanEscapeEvent.patch
+++ b/Spigot-Server-Patches/EndermanEscapeEvent.patch
@@ -33,13 +33,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) {
if (!super.setGoalTarget(entityliving, reason, fireEvent)) {
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
- if (this.world.isDay() && this.ticksLived >= this.bz + 600) {
- float f = this.aO();
+ if (this.world.isDay() && this.ticksLived >= this.bs + 600) {
+ float f = this.aQ();
-- if (f > 0.5F && this.world.f(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
-+ if (f > 0.5F && this.world.f(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper
+- if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
++ if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper
this.setGoalTarget((EntityLiving) null);
- this.eM();
+ this.eL();
}
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
if (this.isInvulnerable(damagesource)) {
@@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} else if (damagesource instanceof EntityDamageSourceIndirect) {
+ if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
for (int i = 0; i < 64; ++i) {
- if (this.eM()) {
+ if (this.eL()) {
return true;
}
}
@@ -57,9 +57,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} else {
boolean flag = super.damageEntity(damagesource, f);
-- if (!this.world.s_() && this.random.nextInt(10) != 0) {
-+ if (!this.world.s_() && this.random.nextInt(10) != 0 && this.tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper
- this.eM();
+- if (!this.world.s_() && !(damagesource.getEntity() instanceof EntityLiving) && this.random.nextInt(10) != 0) {
++ if (!this.world.s_() && !(damagesource.getEntity() instanceof EntityLiving) && this.random.nextInt(10) != 0 && this.tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - use to be critical hits as else, but mojang removed critical hits in 1.16.2 due to MC-185684
+ this.eL();
}
@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
@@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.c != null && !this.i.isPassenger()) {
if (this.i.g((EntityHuman) this.c)) {
- if (this.c.h((Entity) this.i) < 16.0D) {
-+ if (this.c.h((Entity) this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) {
- this.i.eM();
++ if (this.c.h((Entity) this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { // Paper
+ this.i.eL();
}
diff --git a/Spigot-Server-Patches/Ensure-Entity-AABB-s-are-never-invalid.patch b/Spigot-Server-Patches/Ensure-Entity-AABB-s-are-never-invalid.patch
index 77f5bba843..a333dff3ee 100644
--- a/Spigot-Server-Patches/Ensure-Entity-AABB-s-are-never-invalid.patch
+++ b/Spigot-Server-Patches/Ensure-Entity-AABB-s-are-never-invalid.patch
@@ -8,99 +8,12 @@ diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
-@@ -0,0 +0,0 @@
- package net.minecraft.server;
-
-+import co.aikar.timings.MinecraftTimings;
-+import co.aikar.timings.Timing;
- import com.google.common.collect.Iterables;
- import com.google.common.collect.Lists;
- import com.google.common.collect.Sets;
- import it.unimi.dsi.fastutil.objects.Object2DoubleArrayMap;
- import it.unimi.dsi.fastutil.objects.Object2DoubleMap;
--import java.util.Arrays;
--import java.util.Collection;
--import java.util.Collections;
--import java.util.Iterator;
--import java.util.List;
--import java.util.Locale;
--import java.util.Optional;
--import java.util.Random;
--import java.util.Set;
--import java.util.UUID;
--import java.util.concurrent.atomic.AtomicInteger;
--import java.util.stream.Stream;
--import javax.annotation.Nullable;
- import org.apache.logging.log4j.LogManager;
- import org.apache.logging.log4j.Logger;
--
--// CraftBukkit start
- import org.bukkit.Bukkit;
- import org.bukkit.Server;
- import org.bukkit.block.BlockFace;
- import org.bukkit.command.CommandSender;
--import org.bukkit.entity.Hanging;
--import org.bukkit.entity.LivingEntity;
--import org.bukkit.entity.Vehicle;
--import co.aikar.timings.MinecraftTimings; // Paper
--import co.aikar.timings.Timing; // Paper
--import org.bukkit.event.entity.EntityCombustByEntityEvent;
--import org.bukkit.event.hanging.HangingBreakByEntityEvent;
--import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
--import org.bukkit.event.vehicle.VehicleEnterEvent;
--import org.bukkit.event.vehicle.VehicleExitEvent;
- import org.bukkit.craftbukkit.CraftWorld;
- import org.bukkit.craftbukkit.entity.CraftEntity;
- import org.bukkit.craftbukkit.entity.CraftPlayer;
- import org.bukkit.craftbukkit.event.CraftEventFactory;
-+import org.bukkit.entity.Hanging;
-+import org.bukkit.entity.LivingEntity;
- import org.bukkit.entity.Pose;
-+import org.bukkit.entity.Vehicle;
- import org.bukkit.event.entity.EntityAirChangeEvent;
-+import org.bukkit.event.entity.EntityCombustByEntityEvent;
- import org.bukkit.event.entity.EntityCombustEvent;
- import org.bukkit.event.entity.EntityDropItemEvent;
- import org.bukkit.event.entity.EntityPortalEvent;
- import org.bukkit.event.entity.EntityPoseChangeEvent;
-+import org.bukkit.event.hanging.HangingBreakByEntityEvent;
- import org.bukkit.event.player.PlayerTeleportEvent;
-+import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
-+import org.bukkit.event.vehicle.VehicleEnterEvent;
-+import org.bukkit.event.vehicle.VehicleExitEvent;
- import org.bukkit.plugin.PluginManager;
-+
-+import javax.annotation.Nullable;
-+import java.util.Arrays;
-+import java.util.Collection;
-+import java.util.Collections;
-+import java.util.Iterator;
-+import java.util.List;
-+import java.util.Locale;
-+import java.util.Optional;
-+import java.util.Random;
-+import java.util.Set;
-+import java.util.UUID;
-+import java.util.concurrent.atomic.AtomicInteger;
-+import java.util.stream.Stream;
-+
-+// CraftBukkit start
- // CraftBukkit end
-
- public abstract class Entity implements INamableTileEntity, ICommandListener, KeyedObject { // Paper
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public void setPosition(double d0, double d1, double d2) {
this.setPositionRaw(d0, d1, d2);
-- float f = this.size.width / 2.0F;
-- float f1 = this.size.height;
-+ // Paper start - move into setPositionRaw
-+ //float f = this.size.width / 2.0F;
-+ //float f1 = this.size.height;
-
-- this.a(new AxisAlignedBB(d0 - (double) f, d1, d2 - (double) f, d0 + (double) f, d1 + (double) f1, d2 + (double) f));
-+ //this.a(new AxisAlignedBB(d0 - (double) f, d1, d2 - (double) f, d0 + (double) f, d1 + (double) f1, d2 + (double) f));
-+ // Paper end
+- this.a(this.size.a(d0, d1, d2));
++ //this.a(this.size.a(d0, d1, d2)); // Paper - move into setPositionRaw
if (valid) ((WorldServer) world).chunkCheck(this); // CraftBukkit
}
@@ -119,9 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - never allow AABB to become desynced from position
+ // hanging has its own special logic
+ if (!(this instanceof EntityHanging) && (this.loc.x != d0 || this.loc.y != d1 || this.loc.z != d2)) {
-+ float f = this.size.width / 2.0F;
-+ float f1 = this.size.height;
-+ this.setBoundingBox(new AxisAlignedBB(d0 - (double) f, d1, d2 - (double) f, d0 + (double) f, d1 + (double) f1, d2 + (double) f));
++ this.setBoundingBox(this.size.a(d0, d1, d2));
+ }
+ // Paper end
if (this.loc.x != d0 || this.loc.y != d1 || this.loc.z != d2) {
diff --git a/Spigot-Server-Patches/Ensure-Entity-is-never-double-registered.patch b/Spigot-Server-Patches/Ensure-Entity-is-never-double-registered.patch
index 5247e488c2..9f0c804159 100644
--- a/Spigot-Server-Patches/Ensure-Entity-is-never-double-registered.patch
+++ b/Spigot-Server-Patches/Ensure-Entity-is-never-double-registered.patch
@@ -76,4 +76,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ entity.isQueuedForRegister = false; // Paper
this.entitiesById.put(entity.getId(), entity);
if (entity instanceof EntityEnderDragon) {
- EntityComplexPart[] aentitycomplexpart = ((EntityEnderDragon) entity).eK();
+ EntityComplexPart[] aentitycomplexpart = ((EntityEnderDragon) entity).eJ();
diff --git a/Spigot-Server-Patches/Ensure-EntityRaider-respects-game-and-entity-rules-f.patch b/Spigot-Server-Patches/Ensure-EntityRaider-respects-game-and-entity-rules-f.patch
index 18a1927e0b..c13ad11390 100644
--- a/Spigot-Server-Patches/Ensure-EntityRaider-respects-game-and-entity-rules-f.patch
+++ b/Spigot-Server-Patches/Ensure-EntityRaider-respects-game-and-entity-rules-f.patch
@@ -23,6 +23,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public boolean a() {
+ if (!getRaider().world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) || !getRaider().canPickupLoot()) return false; // Paper - respect game and entity rules for picking up items
- Raid raid = this.b.fb();
+ Raid raid = this.b.fa();
- if (this.b.fc() && !this.b.fb().a() && this.b.eO() && !ItemStack.matches(this.b.getEquipment(EnumItemSlot.HEAD), Raid.s())) {
+ if (this.b.fb() && !this.b.fa().a() && this.b.eN() && !ItemStack.matches(this.b.getEquipment(EnumItemSlot.HEAD), Raid.s())) {
diff --git a/Spigot-Server-Patches/Ensure-safe-gateway-teleport.patch b/Spigot-Server-Patches/Ensure-safe-gateway-teleport.patch
index 477b3b7fed..fda28f4b91 100644
--- a/Spigot-Server-Patches/Ensure-safe-gateway-teleport.patch
+++ b/Spigot-Server-Patches/Ensure-safe-gateway-teleport.patch
@@ -9,16 +9,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java
+++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java
@@ -0,0 +0,0 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick
- --this.c;
} else if (!this.world.isClientSide) {
- List list = this.world.a(Entity.class, new AxisAlignedBB(this.getPosition()));
--
+ List list = this.world.a(Entity.class, new AxisAlignedBB(this.getPosition()), TileEntityEndGateway::a);
+
- if (!list.isEmpty()) {
-- this.a((Entity) list.get(this.world.random.nextInt(list.size())));
+- this.b((Entity) list.get(this.world.random.nextInt(list.size())));
+ // Paper start
+ for (Entity entity : list) {
+ if (entity.canPortal()) {
-+ this.a(entity);
++ this.b(entity);
+ break;
+ }
}
diff --git a/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch b/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch
index 71094e7dd4..2da75b46b5 100644
--- a/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch
+++ b/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch
@@ -18,14 +18,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
- public boolean ac;
+ public boolean Y;
public boolean impulse;
public int portalCooldown;
-- protected boolean inPortal; public final boolean inPortal() { return this.inPortal; } // Paper - OBFHELPER
+- protected boolean inPortal;
+ public boolean inPortal; // Paper - public
protected int portalTicks;
- protected BlockPosition ah;
- protected Vec3D ai;
+ protected BlockPosition ac;
+ private boolean invulnerable;
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
@@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} else {
if (enummovetype == EnumMoveType.PISTON) {
+ this.activatedTick = MinecraftServer.currentTick + 20; // Paper
- vec3d = this.a(vec3d);
+ vec3d = this.b(vec3d);
if (vec3d.equals(Vec3D.a)) {
return;
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -55,9 +55,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
vec3d = this.a(vec3d, enummovetype);
- Vec3D vec3d1 = this.f(vec3d);
+ Vec3D vec3d1 = this.g(vec3d);
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
- return this.al;
+ return this.ae;
}
+ public final boolean isPushedByWater() { return this.bU(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it!
@@ -86,9 +86,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Nullable
- private Entity leashHolder;
+ public Entity leashHolder; // Paper - private -> public
- private int bE;
+ private int bx;
@Nullable
- private NBTTagCompound bF;
+ private NBTTagCompound by;
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
return this.lookController;
}
@@ -112,25 +112,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
- protected float aU;
- protected int aV; protected int getKillCount() { return this.aV; } // Paper - OBFHELPER
+ protected float aN;
+ protected int aO;protected int getKillCount() { return this.aO; } // Paper - OBFHELPER
public float lastDamage;
- protected boolean jumping;
+ public boolean jumping; // Paper protected -> public
- public float aY;
- public float aZ;
- public float ba;
+ public float aR;
+ public float aS;
+ public float aT;
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityLlama.java
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
@@ -0,0 +0,0 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
- return this.bJ != null;
+ return this.bC != null;
}
-+ public final boolean inCaravan() { return this.fD(); } // Paper - OBFHELPER
- public boolean fD() {
- return this.bI != null;
++ public final boolean inCaravan() { return this.fC(); } // Paper - OBFHELPER
+ public boolean fC() {
+ return this.bB != null;
}
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@@ -166,22 +166,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ protected void mobTick(boolean inactive) {
this.world.getMethodProfiler().enter("villagerBrain");
- this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error
-- this.world.getMethodProfiler().exit();
+ if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
- if (this.bM) {
- this.bM = false;
- }
+ this.world.getMethodProfiler().exit();
+ if (this.bF) {
+ this.bF = false;
@@ -0,0 +0,0 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
- this.bC = null;
+ this.bv = null;
}
- if (!this.isNoAI() && this.random.nextInt(100) == 0) {
+ if (!inactive && !this.isNoAI() && this.random.nextInt(100) == 0) { // Paper
- Raid raid = ((WorldServer) this.world).c_(this.getChunkCoordinates());
+ Raid raid = ((WorldServer) this.world).b_(this.getChunkCoordinates());
if (raid != null && raid.v() && !raid.a()) {
@@ -0,0 +0,0 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
- if (this.getVillagerData().getProfession() == VillagerProfession.NONE && this.eO()) {
+ if (this.getVillagerData().getProfession() == VillagerProfession.NONE && this.eN()) {
this.eT();
}
+ if (inactive) return; // Paper
@@ -192,8 +191,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
-+ private void doReputationTick() { fv(); } // Paper - OBFHELPER
- private void fv() {
++ private void doReputationTick() { fw(); } // Paper - OBFHELPER
+ private void fw() {
long i = this.world.getTime();
diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
@@ -201,17 +200,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
+++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
@@ -0,0 +0,0 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
- return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound);
+ return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound);
}
-+ public final int getUnhappy() { return eL(); } // Paper - OBFHELPER
- public int eL() {
- return (Integer) this.datawatcher.get(EntityVillagerAbstract.bw);
++ public final int getUnhappy() { return eK(); } // Paper - OBFHELPER
+ public int eK() {
+ return (Integer) this.datawatcher.get(EntityVillagerAbstract.bp);
}
+ public final void setUnhappy(int i) { s(i); } // Paper - OBFHELPER
public void s(int i) {
- this.datawatcher.set(EntityVillagerAbstract.bw, i);
+ this.datawatcher.set(EntityVillagerAbstract.bp, i);
}
diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
@@ -243,8 +242,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
protected int c;
protected int d;
private int g;
-- protected BlockPosition e;
-+ protected BlockPosition e; public BlockPosition getTarget() { return e; } public void setTarget(BlockPosition pos) { this.e = pos; getEntity().movingTarget = pos != BlockPosition.ZERO ? pos : null; } // Paper - OBFHELPER
+- protected BlockPosition e;public final BlockPosition getTargetPosition() { return this.e; } // Paper - OBFHELPER
++ protected BlockPosition e; public final BlockPosition getTargetPosition() { return this.e; } public void setTargetPosition(BlockPosition pos) { this.e = pos; getEntity().movingTarget = pos != BlockPosition.ZERO ? pos : null; } // Paper - OBFHELPER
private boolean h;
private final int i;
private final int j;
@@ -256,7 +255,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Override
+ public void onTaskReset() {
+ super.onTaskReset();
-+ setTarget(BlockPosition.ZERO);
++ setTargetPosition(BlockPosition.ZERO);
+ }
+ // Paper end
@@ -266,7 +265,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, i1, k - 1, j1);
if (this.a.a((BlockPosition) blockposition_mutableblockposition) && this.a(this.a.world, blockposition_mutableblockposition)) {
this.e = blockposition_mutableblockposition;
-+ setTarget(blockposition_mutableblockposition.immutableCopy()); // Paper
++ setTargetPosition(blockposition_mutableblockposition.immutableCopy()); // Paper
return true;
}
}
diff --git a/Spigot-Server-Patches/Entity-Jump-API.patch b/Spigot-Server-Patches/Entity-Jump-API.patch
index da44758b6a..3de6c1dcc6 100644
--- a/Spigot-Server-Patches/Entity-Jump-API.patch
+++ b/Spigot-Server-Patches/Entity-Jump-API.patch
@@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
- } else if (this.aN() && (!this.onGround || d7 > d8)) {
+ } else if (this.aP() && (!this.onGround || d7 > d8)) {
this.c((Tag) TagsFluid.LAVA);
} else if ((this.onGround || flag && d7 <= d8) && this.jumpTicks == 0) {
+ if (new com.destroystokyo.paper.event.entity.EntityJumpEvent(getBukkitLivingEntity()).callEvent()) { // Paper
@@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityPanda extends EntityAnimal {
EntityPanda entitypanda = (EntityPanda) iterator.next();
- if (!entitypanda.isBaby() && entitypanda.onGround && !entitypanda.isInWater() && entitypanda.fi()) {
+ if (!entitypanda.isBaby() && entitypanda.onGround && !entitypanda.isInWater() && entitypanda.fh()) {
+ if (new com.destroystokyo.paper.event.entity.EntityJumpEvent(getBukkitLivingEntity()).callEvent()) { // Paper
entitypanda.jump();
+ } else { this.setJumping(false); } // Paper - setJumping(false) stops a potential loop
diff --git a/Spigot-Server-Patches/Entity-fromMobSpawner.patch b/Spigot-Server-Patches/Entity-fromMobSpawner.patch
index 62c20bc626..48b9e4424a 100644
--- a/Spigot-Server-Patches/Entity-fromMobSpawner.patch
+++ b/Spigot-Server-Patches/Entity-fromMobSpawner.patch
@@ -41,13 +41,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract {
+ }
+ // Spigot End
}
- // Spigot End
- }
+ entity.spawnedViaMobSpawner = true; // Paper
- // Spigot Start
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
- Entity vehicle = entity.getVehicle();
+ // Spigot Start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
+ Entity vehicle = entity.getVehicle();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
diff --git a/Spigot-Server-Patches/Entity-getEntitySpawnReason.patch b/Spigot-Server-Patches/Entity-getEntitySpawnReason.patch
index 7dc4b1a3e8..4eab3abf73 100644
--- a/Spigot-Server-Patches/Entity-getEntitySpawnReason.patch
+++ b/Spigot-Server-Patches/Entity-getEntitySpawnReason.patch
@@ -63,13 +63,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract {
- // Spigot End
- }
+ // Spigot End
+ }
entity.spawnedViaMobSpawner = true; // Paper
-+ entity.spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER; // Paper
- // Spigot Start
- flag = true; // Paper
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
++ entity.spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER; // Paper
+ flag = true; // Paper
+ // Spigot Start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
diff --git a/Spigot-Server-Patches/EntityPathfindEvent.patch b/Spigot-Server-Patches/EntityPathfindEvent.patch
index ce1659a0b7..fc162ac9f9 100644
--- a/Spigot-Server-Patches/EntityPathfindEvent.patch
+++ b/Spigot-Server-Patches/EntityPathfindEvent.patch
@@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return null;
} else if (this.a.locY() < 0.0D) {
@@ -0,0 +0,0 @@ public abstract class NavigationAbstract {
- } else if (this.c != null && !this.c.b() && set.contains(this.p)) {
+ } else if (this.c != null && !this.c.c() && set.contains(this.p)) {
return this.c;
} else {
+ // Paper start - Pathfind event
diff --git a/Spigot-Server-Patches/EntityTransformedEvent.patch b/Spigot-Server-Patches/EntityTransformedEvent.patch
deleted file mode 100644
index 0d5fbe354f..0000000000
--- a/Spigot-Server-Patches/EntityTransformedEvent.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Anthony MacAllister
-Date: Thu, 26 Jul 2018 15:30:03 -0400
-Subject: [PATCH] EntityTransformedEvent
-
-
-diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityInsentient.java
-+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
-@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
- if (CraftEventFactory.callEntityTransformEvent(this, t0, EntityTransformEvent.TransformReason.DROWNED).isCancelled()) {
- return null;
- }
-+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), t0.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.DROWNED).callEvent()) return null; // Paper
- this.world.addEntity(t0, CreatureSpawnEvent.SpawnReason.DROWNED);
- // CraftBukkit end
- this.die();
-diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityMushroomCow.java
-+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java
-@@ -0,0 +0,0 @@ public class EntityMushroomCow extends EntityCow implements IShearable {
- if (CraftEventFactory.callEntityTransformEvent(this, entitycow, EntityTransformEvent.TransformReason.SHEARED).isCancelled()) {
- return;
- }
-+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitycow.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.SHEARED).callEvent()) return; // Paper
- this.world.addEntity(entitycow, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SHEARED);
-
- this.die(); // CraftBukkit - from above
-diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityVillager.java
-+++ b/src/main/java/net/minecraft/server/EntityVillager.java
-@@ -0,0 +0,0 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
- if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) {
- return;
- }
-+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitywitch.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.LIGHTNING).callEvent()) return; // Paper
- this.world.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
- // CraftBukkit end
- this.die();
-diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityZombie.java
-+++ b/src/main/java/net/minecraft/server/EntityZombie.java
-@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster {
- if (CraftEventFactory.callEntityTransformEvent(this, entityzombievillager, EntityTransformEvent.TransformReason.INFECTION).isCancelled()) {
- return;
- }
-+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entityvillager.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.INFECTED).callEvent()) return; // Paper
- entityvillager.die(); // CraftBukkit - from above
- this.world.addEntity(entityzombievillager, CreatureSpawnEvent.SpawnReason.INFECTION); // CraftBukkit - add SpawnReason
- // CraftBukkit end
-diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityZombieVillager.java
-+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java
-@@ -0,0 +0,0 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo
- ((ZombieVillager) getBukkitEntity()).setConversionTime(-1); // SPIGOT-5208: End conversion to stop event spam
- return;
- }
-+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entityvillager.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.CURED).callEvent()) return; // Paper
- this.die(); // CraftBukkit - from above
- worldserver.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED); // CraftBukkit - add SpawnReason
- // CraftBukkit end
diff --git a/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
index 0d0006482c..bdbc3c1a61 100644
--- a/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
+++ b/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch
@@ -15,15 +15,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
-- protected void dropExperience(World world, BlockPosition blockposition, int i) {
-+ protected void dropExperience(World world, BlockPosition blockposition, int i, EntityPlayer player) { // Paper
- if (!world.isClientSide && world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS)) {
+- protected void dropExperience(WorldServer worldserver, BlockPosition blockposition, int i) {
++ protected void dropExperience(WorldServer worldserver, BlockPosition blockposition, int i, EntityPlayer player) { // Paper
+ if (worldserver.getGameRules().getBoolean(GameRules.DO_TILE_DROPS)) {
while (i > 0) {
int j = EntityExperienceOrb.getOrbValue(i);
i -= j;
-- world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j));
-+ world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.BLOCK_BREAK, player)); // Paper
+- worldserver.addEntity(new EntityExperienceOrb(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j));
++ worldserver.addEntity(new EntityExperienceOrb(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.BLOCK_BREAK, player)); // Paper
}
}
@@ -45,11 +45,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityAnimal.java
+++ b/src/main/java/net/minecraft/server/EntityAnimal.java
@@ -0,0 +0,0 @@ public abstract class EntityAnimal extends EntityAgeable {
- if (world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
+ if (worldserver.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
// CraftBukkit start - use event experience
if (experience > 0) {
-- world.addEntity(new EntityExperienceOrb(world, this.locX(), this.locY(), this.locZ(), experience));
-+ world.addEntity(new EntityExperienceOrb(world, this.locX(), this.locY(), this.locZ(), experience, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer, entityageable)); // Paper
+- worldserver.addEntity(new EntityExperienceOrb(worldserver, this.locX(), this.locY(), this.locZ(), experience));
++ worldserver.addEntity(new EntityExperienceOrb(worldserver, this.locX(), this.locY(), this.locZ(), experience, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer, entityageable)); // Paper
}
// CraftBukkit end
}
diff --git a/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch
index 1c014a4a1d..c6bf353ea2 100644
--- a/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch
+++ b/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch
@@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
- this.datawatcher.set(EntityHuman.bs, nbttagcompound);
+ this.datawatcher.set(EntityHuman.bl, nbttagcompound);
}
-+ public float getCooldownPeriod() { return this.eR(); } // Paper - OBFHELPER
- public float eR() {
++ public float getCooldownPeriod() { return this.eQ(); } // Paper - OBFHELPER
+ public float eQ() {
return (float) (1.0D / this.b(GenericAttributes.ATTACK_SPEED) * 20.0D);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
diff --git a/Spigot-Server-Patches/Fix-MC-124320.patch b/Spigot-Server-Patches/Fix-MC-124320.patch
deleted file mode 100644
index c8c060d0d6..0000000000
--- a/Spigot-Server-Patches/Fix-MC-124320.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: BillyGalbreath
-Date: Thu, 23 Aug 2018 09:25:30 -0500
-Subject: [PATCH] Fix MC-124320
-
-
-diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/Block.java
-+++ b/src/main/java/net/minecraft/server/Block.java
-@@ -0,0 +0,0 @@ public class Block extends BlockBase implements IMaterial {
- return this == block;
- }
-
-+ public static IBlockData getValidBlockForPosition(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { return Block.b(iblockdata, generatoraccess, blockposition); } // Paper - OBFHELPER
- public static IBlockData b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
- IBlockData iblockdata1 = iblockdata;
- BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
-diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityEnderman.java
-+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
-@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
- if (block.a((Tag) TagsBlock.ENDERMAN_HOLDABLE) && flag) {
- // CraftBukkit start - Pickup event
- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
-- this.enderman.setCarried(iblockdata);
-+ //this.enderman.setCarried(iblockdata); // Paper - moved down
- world.a(blockposition, false);
-+ this.enderman.setCarried(Block.getValidBlockForPosition(iblockdata, this.enderman.world, blockposition)); // Paper - Fix MC-124320
- }
- // CraftBukkit end
- }
-@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
-
- static class PathfinderGoalEndermanPlaceBlock extends PathfinderGoal {
-
-+ private EntityEnderman getEnderman() { return this.a; } // Paper - OBFHELPER
- private final EntityEnderman a;
-
- public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) {
-@@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
- IBlockData iblockdata = world.getType(blockposition);
- BlockPosition blockposition1 = blockposition.down();
- IBlockData iblockdata1 = world.getType(blockposition1);
-- IBlockData iblockdata2 = this.a.getCarried();
-+ IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320
-
- if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
- // CraftBukkit start - Place event
diff --git a/Spigot-Server-Patches/Fix-MC-187716-Use-configured-height.patch b/Spigot-Server-Patches/Fix-MC-187716-Use-configured-height.patch
new file mode 100644
index 0000000000..7c4a1b7309
--- /dev/null
+++ b/Spigot-Server-Patches/Fix-MC-187716-Use-configured-height.patch
@@ -0,0 +1,45 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: William Blake Galbreath
+Date: Sat, 15 Aug 2020 08:04:49 -0500
+Subject: [PATCH] Fix MC-187716 Use configured height
+
+
+diff --git a/src/main/java/net/minecraft/server/WorldGenSurfaceNether.java b/src/main/java/net/minecraft/server/WorldGenSurfaceNether.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/WorldGenSurfaceNether.java
++++ b/src/main/java/net/minecraft/server/WorldGenSurfaceNether.java
+@@ -0,0 +0,0 @@ public class WorldGenSurfaceNether extends WorldGenSurface= 0; --k2) {
++ for (int k2 = k; k2 >= 0; --k2) { // Paper - fix MC-187716 - use configured height
+ blockposition_mutableblockposition.d(k1, k2, l1);
+ IBlockData iblockdata4 = ichunkaccess.getType(blockposition_mutableblockposition);
+
+diff --git a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java
++++ b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java
+@@ -0,0 +0,0 @@ public abstract class WorldGenSurfaceNetherAbstract extends WorldGenSurface= 0; --k2) {
++ for (int k2 = k; k2 >= 0; --k2) { // Paper - fix MC-187716 - use configured height
+ blockposition_mutableblockposition.d(k1, k2, l1);
+ IBlockData iblockdata5 = ichunkaccess.getType(blockposition_mutableblockposition);
+ int l2;
+diff --git a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherForest.java b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherForest.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherForest.java
++++ b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherForest.java
+@@ -0,0 +0,0 @@ public class WorldGenSurfaceNetherForest extends WorldGenSurface= 0; --k2) {
++ for (int k2 = k; k2 >= 0; --k2) { // Paper - fix MC-187716 - use configured height
+ blockposition_mutableblockposition.d(k1, k2, l1);
+ IBlockData iblockdata3 = worldgensurfaceconfigurationbase.a();
+ IBlockData iblockdata4 = ichunkaccess.getType(blockposition_mutableblockposition);
diff --git a/Spigot-Server-Patches/Fix-MC-197271.patch b/Spigot-Server-Patches/Fix-MC-197271.patch
new file mode 100644
index 0000000000..ec0a8b8df9
--- /dev/null
+++ b/Spigot-Server-Patches/Fix-MC-197271.patch
@@ -0,0 +1,51 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: ishland
+Date: Sun, 23 Aug 2020 10:57:44 +0200
+Subject: [PATCH] Fix MC-197271
+
+This patch only fixes an issue for servers running OpenJ9.
+
+diff --git a/src/main/java/net/minecraft/server/RegistryGeneration.java b/src/main/java/net/minecraft/server/RegistryGeneration.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/RegistryGeneration.java
++++ b/src/main/java/net/minecraft/server/RegistryGeneration.java
+@@ -0,0 +0,0 @@ public class RegistryGeneration {
+ public static final IRegistry g = a(IRegistry.aw, () -> {
+ return ProcessorLists.b;
+ });
+- public static final IRegistry h = a(IRegistry.ax, WorldGenFeaturePieces::a);
++ public static final IRegistry h = a(IRegistry.ax, () -> WorldGenFeaturePieces.a()); // Paper - MC-197271
+ public static final IRegistry WORLDGEN_BIOME = a(IRegistry.ay, () -> {
+ return BiomeRegistry.a;
+ });
+- public static final IRegistry j = a(IRegistry.ar, GeneratorSettingBase::i);
++ public static final IRegistry j = a(IRegistry.ar, () -> GeneratorSettingBase.i()); // Paper - MC-197271
+
+ private static IRegistry a(ResourceKey extends IRegistry> resourcekey, Supplier supplier) {
+ return a(resourcekey, Lifecycle.stable(), supplier);
+@@ -0,0 +0,0 @@ public class RegistryGeneration {
+ MinecraftKey minecraftkey = resourcekey.a();
+
+ RegistryGeneration.k.put(minecraftkey, supplier);
+- IRegistryWritable iregistrywritable = RegistryGeneration.l;
++ IRegistryWritable iregistrywritable = (IRegistryWritable) RegistryGeneration.l; // Paper - decompile fix
+
+- return (IRegistryWritable) iregistrywritable.a(resourcekey, (Object) r0, lifecycle);
++ return (R) iregistrywritable.a((ResourceKey) resourcekey, r0, lifecycle); // Paper - decompile fix
+ }
+
+ public static T a(IRegistry super T> iregistry, String s, T t0) {
+@@ -0,0 +0,0 @@ public class RegistryGeneration {
+ }
+
+ public static T a(IRegistry iregistry, MinecraftKey minecraftkey, T t0) {
+- return ((IRegistryWritable) iregistry).a(ResourceKey.a(iregistry.f(), minecraftkey), t0, Lifecycle.stable());
++ return (T) ((IRegistryWritable) iregistry).a(ResourceKey.a(iregistry.f(), minecraftkey), t0, Lifecycle.stable()); // Paper - decompile fix
+ }
+
+ public static T a(IRegistry iregistry, int i, ResourceKey resourcekey, T t0) {
+- return ((IRegistryWritable) iregistry).a(i, resourcekey, t0, Lifecycle.stable());
++ return (T) ((IRegistryWritable) iregistry).a(i, resourcekey, t0, Lifecycle.stable()); // Paper - decompile fix
+ }
+
+ public static void a() {}
diff --git a/Spigot-Server-Patches/Fix-MC-99259-Wither-Boss-Bar-doesn-t-update-until-in.patch b/Spigot-Server-Patches/Fix-MC-99259-Wither-Boss-Bar-doesn-t-update-until-in.patch
new file mode 100644
index 0000000000..7130dee881
--- /dev/null
+++ b/Spigot-Server-Patches/Fix-MC-99259-Wither-Boss-Bar-doesn-t-update-until-in.patch
@@ -0,0 +1,22 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
+Date: Thu, 20 Aug 2020 19:24:13 -0700
+Subject: [PATCH] Fix MC-99259 Wither Boss Bar doesn't update until
+ invulnerability period is over
+
+
+diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/EntityWither.java
++++ b/src/main/java/net/minecraft/server/EntityWither.java
+@@ -0,0 +0,0 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
+ this.heal(1.0F, EntityRegainHealthEvent.RegainReason.REGEN); // CraftBukkit
+ }
+
+- this.bossBattle.setProgress(this.getHealth() / this.getMaxHealth());
++ //this.bossBattle.setProgress(this.getHealth() / this.getMaxHealth()); // Paper - Moved down
+ }
++ this.bossBattle.setProgress(this.getHealth() / this.getMaxHealth()); // Paper - Fix MC-99259 (Boss bar does not update until Wither invulnerability period ends)
+ }
+
+ public static boolean c(IBlockData iblockdata) {
diff --git a/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch
index de1a6466b3..f84095cb86 100644
--- a/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch
+++ b/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch
@@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- public void a(EnumDifficulty enumdifficulty, boolean flag) {
- if (flag || !this.saveData.isDifficultyLocked()) {
- this.saveData.setDifficulty(this.saveData.isHardcore() ? EnumDifficulty.HARD : enumdifficulty);
-- this.ba();
+- this.bb();
- this.getPlayerList().getPlayers().forEach(this::a);
+ // Paper start - fix per world difficulty
+ public void a(WorldServer world, EnumDifficulty enumdifficulty, boolean flag) {
diff --git a/Spigot-Server-Patches/Fix-SPIGOT-5989.patch b/Spigot-Server-Patches/Fix-SPIGOT-5989.patch
index 96dbb61a07..77a0aa5607 100644
--- a/Spigot-Server-Patches/Fix-SPIGOT-5989.patch
+++ b/Spigot-Server-Patches/Fix-SPIGOT-5989.patch
@@ -25,8 +25,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Optional optional;
if (blockposition != null) {
-- optional = EntityHuman.getBed(worldserver1, blockposition, flag1, flag);
-+ optional = EntityHuman.getBed(worldserver1, blockposition, flag1, true); // Paper - Fix SPIGOT-5989
+- optional = EntityHuman.getBed(worldserver1, blockposition, f, flag1, flag);
++ optional = EntityHuman.getBed(worldserver1, blockposition, f, flag1, true); // Paper - Fix SPIGOT-5989
} else {
optional = Optional.empty();
}
diff --git a/Spigot-Server-Patches/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/Spigot-Server-Patches/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
new file mode 100644
index 0000000000..4b9b1d611e
--- /dev/null
+++ b/Spigot-Server-Patches/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch
@@ -0,0 +1,46 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: William Blake Galbreath
+Date: Sat, 22 Aug 2020 23:36:21 +0200
+Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
+
+
+diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/WorldServer.java
++++ b/src/main/java/net/minecraft/server/WorldServer.java
+@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
+ }
+ // Paper end
+
++ public final void setSpawn(BlockPosition blockposition, float f) { this.a(blockposition, f); } // Paper - OBFHELPER
+ public void a(BlockPosition blockposition, float f) {
+ // Paper - configurable spawn radius
+ BlockPosition prevSpawn = this.getSpawn();
+ //ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c()));
+
+ this.worldData.setSpawn(blockposition, f);
++ new org.bukkit.event.world.SpawnChangeEvent(getWorld(), MCUtil.toLocation(this, prevSpawn)).callEvent(); // Paper
+ if (this.keepSpawnInMemory) {
+ // if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add
+ this.removeTicketsForSpawn(this.paperConfig.keepLoadedRange, prevSpawn);
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+@@ -0,0 +0,0 @@ public class CraftWorld implements World {
+ public boolean setSpawnLocation(int x, int y, int z, float angle) {
+ try {
+ Location previousLocation = getSpawnLocation();
+- world.worldData.setSpawn(new BlockPosition(x, y, z), angle);
++ world.setSpawn(new BlockPosition(x, y, z), angle); // Paper - use WorldServer#setSpawn
+
++ // Paper start - move to nms.World
+ // Notify anyone who's listening.
+- SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
+- server.getPluginManager().callEvent(event);
++ // SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation);
++ // server.getPluginManager().callEvent(event);
++ // Paper end
+
+ return true;
+ } catch (Exception e) {
diff --git a/Spigot-Server-Patches/Fix-SpongeAbsortEvent-handling.patch b/Spigot-Server-Patches/Fix-SpongeAbsortEvent-handling.patch
index 22dbbed314..3acd4206e2 100644
--- a/Spigot-Server-Patches/Fix-SpongeAbsortEvent-handling.patch
+++ b/Spigot-Server-Patches/Fix-SpongeAbsortEvent-handling.patch
@@ -11,13 +11,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -0,0 +0,0 @@ public class Block extends BlockBase implements IMaterial {
- iblockdata.dropNaturally(world, blockposition, ItemStack.b);
}
--
-+ public static void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, @Nullable TileEntity tileentity) { a(iblockdata, world, blockposition, tileentity); }
- public static void a(IBlockData iblockdata, World world, BlockPosition blockposition, @Nullable TileEntity tileentity) {
- if (world instanceof WorldServer) {
- a(iblockdata, (WorldServer) world, blockposition, tileentity).forEach((itemstack) -> {
+
++ public static void dropNaturally(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, @Nullable TileEntity tileentity) { a(iblockdata, generatoraccess, blockposition, tileentity); }
+ public static void a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, @Nullable TileEntity tileentity) {
+ if (generatoraccess instanceof WorldServer) {
+ a(iblockdata, (WorldServer) generatoraccess, blockposition, tileentity).forEach((itemstack) -> {
diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockSponge.java
diff --git a/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch b/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch
index 2c8403088e..ff5698a9c5 100644
--- a/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch
+++ b/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch
@@ -204,8 +204,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
- private final RegionFileBitSet freeSectors;
- public final File file;
+ protected final RegionFileBitSet freeSectors;
+ public final File file; // Paper
+ // Paper start - Cache chunk status
+ private final ChunkStatus[] statuses = new ChunkStatus[32 * 32];
@@ -272,12 +272,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
try {
NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream);
-- regionfile.setOversized(chunkcoordintpair.x, chunkcoordintpair.z, false); // We don't do this anymore
+ regionfile.setStatus(chunkcoordintpair.x, chunkcoordintpair.z, ChunkRegionLoader.getStatus(nbttagcompound)); // Paper - cache status on disk
-+ regionfile.setOversized(chunkcoordintpair.x, chunkcoordintpair.z, false);
+ regionfile.setOversized(chunkcoordintpair.x, chunkcoordintpair.z, false); // Paper - We don't do this anymore, mojang stores differently, but clear old meta flag if it exists to get rid of our own meta file once last oversized is gone
} catch (Throwable throwable1) {
throwable = throwable1;
- throw throwable1;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
diff --git a/Spigot-Server-Patches/Fix-enderdragon-exp-dupe.patch b/Spigot-Server-Patches/Fix-enderdragon-exp-dupe.patch
index f986ea7e3c..5a9ebdb591 100644
--- a/Spigot-Server-Patches/Fix-enderdragon-exp-dupe.patch
+++ b/Spigot-Server-Patches/Fix-enderdragon-exp-dupe.patch
@@ -13,14 +13,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
public void saveData(NBTTagCompound nbttagcompound) {
super.saveData(nbttagcompound);
- nbttagcompound.setInt("DragonPhase", this.bN.a().getControllerPhase().b());
+ nbttagcompound.setInt("DragonPhase", this.bG.a().getControllerPhase().b());
+ nbttagcompound.setInt("Paper.DeathTick", this.deathAnimationTicks); // Paper
}
@Override
@@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
if (nbttagcompound.hasKey("DragonPhase")) {
- this.bN.setControllerPhase(DragonControllerPhase.getById(nbttagcompound.getInt("DragonPhase")));
+ this.bG.setControllerPhase(DragonControllerPhase.getById(nbttagcompound.getInt("DragonPhase")));
}
+ this.deathAnimationTicks = nbttagcompound.getInt("Paper.DeathTick"); // Paper
diff --git a/Spigot-Server-Patches/Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch b/Spigot-Server-Patches/Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch
new file mode 100644
index 0000000000..217528e1a6
--- /dev/null
+++ b/Spigot-Server-Patches/Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch
@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: William Blake Galbreath
+Date: Sat, 15 Aug 2020 09:32:00 -0500
+Subject: [PATCH] Fix incorrect return for WorldServer#addAllEntitiesSafely
+
+
+diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/WorldServer.java
++++ b/src/main/java/net/minecraft/server/WorldServer.java
+@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
+ if (entity.co().anyMatch(this::isUUIDTaken)) {
+ return false;
+ } else {
+- return this.addAllEntities(entity, reason); // CraftBukkit
++ // Paper start - this method is _only_ designed to return false on duplicate uuids
++ // fixes issues with things such as a plugin cancelling spawn of a /summon
++ this.addAllEntities(entity, reason); // CraftBukkit
++ return true;
++ // Paper end
+ }
+ }
+
diff --git a/Spigot-Server-Patches/Fix-items-not-falling-correctly.patch b/Spigot-Server-Patches/Fix-items-not-falling-correctly.patch
index 440e168649..ffe447b03f 100644
--- a/Spigot-Server-Patches/Fix-items-not-falling-correctly.patch
+++ b/Spigot-Server-Patches/Fix-items-not-falling-correctly.patch
@@ -22,8 +22,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
-- if (!this.onGround || b(this.getMot()) > 9.999999747378752E-6D || (this.ticksLived + this.getId()) % 4 == 0) {
-+ if (!this.onGround || b(this.getMot()) > 9.999999747378752E-6D || this.ticksLived % 4 == 3) { // Paper - Ensure checking item movement is always offset from Spigot's entity activation range check
+- if (!this.onGround || c(this.getMot()) > 9.999999747378752E-6D || (this.ticksLived + this.getId()) % 4 == 0) {
++ if (!this.onGround || c(this.getMot()) > 9.999999747378752E-6D || this.ticksLived % 4 == 0) { // Paper - Ensure checking item movement is always offset from Spigot's entity activation range check
this.move(EnumMoveType.SELF, this.getMot());
- float f = 0.98F;
+ float f1 = 0.98F;
diff --git a/Spigot-Server-Patches/Fix-items-vanishing-through-end-portal.patch b/Spigot-Server-Patches/Fix-items-vanishing-through-end-portal.patch
index 6001012c5c..b7d864913e 100644
--- a/Spigot-Server-Patches/Fix-items-vanishing-through-end-portal.patch
+++ b/Spigot-Server-Patches/Fix-items-vanishing-through-end-portal.patch
@@ -17,12 +17,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
+ BlockPosition blockposition1;
- if (blockposition == null) { // CraftBukkit
- if (this.world.getTypeKey() == DimensionManager.THE_END && worldserver.getTypeKey() == DimensionManager.OVERWORLD) { // CraftBukkit
+ if (flag1) {
+ // Paper start - Ensure spawn chunk is always loaded before calculating Y coordinate
+ this.world.getChunkAtWorldCoords(this.world.getSpawn());
+ // Paper end
- // CraftBukkit start
- EntityPortalEvent event = CraftEventFactory.callEntityPortalEvent(this, worldserver, worldserver.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSpawn()), 0);
- if (event == null) {
+ blockposition1 = WorldServer.a;
+ } else {
+ blockposition1 = worldserver.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSpawn());
diff --git a/Spigot-Server-Patches/Fix-numerous-item-duplication-issues-and-teleport-is.patch b/Spigot-Server-Patches/Fix-numerous-item-duplication-issues-and-teleport-is.patch
index b302e074b9..c90ab214e9 100644
--- a/Spigot-Server-Patches/Fix-numerous-item-duplication-issues-and-teleport-is.patch
+++ b/Spigot-Server-Patches/Fix-numerous-item-duplication-issues-and-teleport-is.patch
@@ -48,14 +48,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.world.getMethodProfiler().enter("changeDimension");
// CraftBukkit start
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
- entity.bukkitEntity = this.getBukkitEntity();
+ entity.bukkitEntity = this.getBukkitEntity();
- if (this instanceof EntityInsentient) {
-- ((EntityInsentient)this).unleash(true, false); // Unleash to prevent duping of leads.
-+ ((EntityInsentient)this).unleash(true, true); // Paper drop lead
+ if (this instanceof EntityInsentient) {
+- ((EntityInsentient) this).unleash(true, false); // Unleash to prevent duping of leads.
++ ((EntityInsentient) this).unleash(true, true); // Paper drop lead
+ }
+ // CraftBukkit end
}
- // CraftBukkit end
- }
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
diff --git a/Spigot-Server-Patches/Fix-piston-physics-inconsistency-MC-188840.patch b/Spigot-Server-Patches/Fix-piston-physics-inconsistency-MC-188840.patch
index 9a2ff8f2a3..01afaaa425 100644
--- a/Spigot-Server-Patches/Fix-piston-physics-inconsistency-MC-188840.patch
+++ b/Spigot-Server-Patches/Fix-piston-physics-inconsistency-MC-188840.patch
@@ -83,11 +83,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/TileEntityPiston.java
+++ b/src/main/java/net/minecraft/server/TileEntityPiston.java
@@ -0,0 +0,0 @@ public class TileEntityPiston extends TileEntity implements ITickable {
- IBlockData iblockdata = Block.b(this.a, (GeneratorAccess) this.world, this.position);
+ IBlockData iblockdata = Block.b(this.a, (GeneratorAccess) this.world, this.position);
- if (iblockdata.isAir()) {
-- this.world.setTypeAndData(this.position, this.a, 84);
+ if (iblockdata.isAir()) {
+- this.world.setTypeAndData(this.position, this.a, 84);
+ this.world.setTypeAndData(this.position, this.a, com.destroystokyo.paper.PaperConfig.allowPistonDuplication ? 84 : (84 | 2)); // Paper - force notify (flag 2), it's possible the set type by the piston block (which doesn't notify) set this block to air
- Block.a(this.a, iblockdata, this.world, this.position, 3);
- } else {
- if (iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C)) {
+ Block.a(this.a, iblockdata, this.world, this.position, 3);
+ } else {
+ if (iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C)) {
diff --git a/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch b/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch
index 69449fc646..4eec2445e9 100644
--- a/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch
+++ b/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch
@@ -15,4 +15,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver1.getGameRules().getBoolean(GameRules.REDUCED_DEBUG_INFO) ? 22 : 23))); // Paper - fix this rule not being initialized on the client
this.d(entityplayer);
entityplayer.getStatisticManager().c();
- entityplayer.B().a(entityplayer);
+ entityplayer.getRecipeBook().a(entityplayer);
diff --git a/Spigot-Server-Patches/Fix-sign-edit-memory-leak.patch b/Spigot-Server-Patches/Fix-sign-edit-memory-leak.patch
index 3fb3a8a859..08c03092c3 100644
--- a/Spigot-Server-Patches/Fix-sign-edit-memory-leak.patch
+++ b/Spigot-Server-Patches/Fix-sign-edit-memory-leak.patch
@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
private EntityHuman c;
- private final IChatFormatted[] g;
+ private final FormattedString[] g;
private EnumColor color;
+ public java.util.UUID signEditor; // Paper
diff --git a/Spigot-Server-Patches/Fix-some-rails-connecting-improperly.patch b/Spigot-Server-Patches/Fix-some-rails-connecting-improperly.patch
index 0bfcb91058..31d82e2b18 100644
--- a/Spigot-Server-Patches/Fix-some-rails-connecting-improperly.patch
+++ b/Spigot-Server-Patches/Fix-some-rails-connecting-improperly.patch
@@ -9,13 +9,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/BlockMinecartDetector.java
+++ b/src/main/java/net/minecraft/server/BlockMinecartDetector.java
@@ -0,0 +0,0 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
- }
private void a(World world, BlockPosition blockposition, IBlockData iblockdata) {
-+ if (iblockdata.getBlock() != this) { return; } // Paper - not our block, don't do anything
- boolean flag = (Boolean) iblockdata.get(BlockMinecartDetector.POWERED);
- boolean flag1 = false;
- List list = this.a(world, blockposition, EntityMinecartAbstract.class, (Predicate) null);
+ if (this.canPlace(iblockdata, world, blockposition)) {
++ if (iblockdata.getBlock() != this) { return; } // Paper - not our block, don't do anything
+ boolean flag = (Boolean) iblockdata.get(BlockMinecartDetector.POWERED);
+ boolean flag1 = false;
+ List list = this.a(world, blockposition, EntityMinecartAbstract.class, (Predicate) null);
diff --git a/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java b/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java
diff --git a/Spigot-Server-Patches/Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch b/Spigot-Server-Patches/Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch
index 7f90dd3320..f682048736 100644
--- a/Spigot-Server-Patches/Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch
+++ b/Spigot-Server-Patches/Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch
@@ -9,14 +9,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
- this.lastHealthSent = -1.0F;
- this.lastFoodSent = -1;
+ this.lastHealthSent = -1.0F;
+ this.lastFoodSent = -1;
+ setSneaking(false); // Paper - fix MC-10657
+
- // CraftBukkit start
- PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
- this.world.getServer().getPluginManager().callEvent(changeEvent);
+ // CraftBukkit start
+ PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
+ this.world.getServer().getPluginManager().callEvent(changeEvent);
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
diff --git a/Spigot-Server-Patches/Fix-this-stupid-bullshit.patch b/Spigot-Server-Patches/Fix-this-stupid-bullshit.patch
index 78ecbd7fe5..17d990e8da 100644
--- a/Spigot-Server-Patches/Fix-this-stupid-bullshit.patch
+++ b/Spigot-Server-Patches/Fix-this-stupid-bullshit.patch
@@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -0,0 +0,0 @@ public class Main {
Calendar deadline = Calendar.getInstance();
- deadline.add(Calendar.DAY_OF_YEAR, -21);
+ deadline.add(Calendar.DAY_OF_YEAR, -7);
if (buildDate.before(deadline.getTime())) {
- System.err.println("*** Error, this build is outdated ***");
+ // Paper start - This is some stupid bullshit
diff --git a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch
index 9963ca01c4..a353e25266 100644
--- a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch
+++ b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch
@@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper End
// Spigot End
- protected void v() {
+ protected void w() {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= 0 && l < this.x;
boolean flag2 = k + 4 >= 0 && k < this.x;
diff --git a/Spigot-Server-Patches/Handle-Oversized-Tile-Entities-in-chunks.patch b/Spigot-Server-Patches/Handle-Oversized-Tile-Entities-in-chunks.patch
index 0c0af7d473..9b4d6b7548 100644
--- a/Spigot-Server-Patches/Handle-Oversized-Tile-Entities-in-chunks.patch
+++ b/Spigot-Server-Patches/Handle-Oversized-Tile-Entities-in-chunks.patch
@@ -13,23 +13,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet {
+ private boolean h;
public PacketPlayOutMapChunk() {}
-
+ // Paper start
+ private final java.util.List extraPackets = new java.util.ArrayList<>();
+ private static final int TE_LIMIT = Integer.getInteger("Paper.excessiveTELimit", 750);
-+
+
+ @Override
+ public java.util.List getExtraPackets() {
+ return extraPackets;
+ }
+ // Paper end
- public PacketPlayOutMapChunk(Chunk chunk, int i, boolean flag) {
+ public PacketPlayOutMapChunk(Chunk chunk, int i) {
ChunkCoordIntPair chunkcoordintpair = chunk.getPos();
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet {
- this.c = this.a(new PacketDataSerializer(this.k()), chunk, i);
+ this.c = this.a(new PacketDataSerializer(this.j()), chunk, i);
this.g = Lists.newArrayList();
iterator = chunk.getTileEntities().entrySet().iterator();
+ int totalTileEntities = 0; // Paper
diff --git a/Spigot-Server-Patches/Here-s-Johnny.patch b/Spigot-Server-Patches/Here-s-Johnny.patch
index af5164a214..89177e3e06 100644
--- a/Spigot-Server-Patches/Here-s-Johnny.patch
+++ b/Spigot-Server-Patches/Here-s-Johnny.patch
@@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private static final Predicate b = (enumdifficulty) -> {
return enumdifficulty == EnumDifficulty.NORMAL || enumdifficulty == EnumDifficulty.HARD;
};
-- private boolean bv;
-+ private boolean bv; public boolean isJohnny() { return bv; } public void setJohnny(boolean johnny) { bv = johnny; } // Paper - OBFHELPER
+- private boolean bo;
++ private boolean bo; public boolean isJohnny() { return bo; } public void setJohnny(boolean johnny) { bo = johnny; } // Paper - OBFHELPER
public EntityVindicator(EntityTypes extends EntityVindicator> entitytypes, World world) {
super(entitytypes, world);
diff --git a/Spigot-Server-Patches/Hook-into-CB-plugin-rewrites.patch b/Spigot-Server-Patches/Hook-into-CB-plugin-rewrites.patch
index 80ee39cb53..5b2c7135e4 100644
--- a/Spigot-Server-Patches/Hook-into-CB-plugin-rewrites.patch
+++ b/Spigot-Server-Patches/Hook-into-CB-plugin-rewrites.patch
@@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if ( Boolean.getBoolean( "debug.rewriteForIde" ) )
+ {
+ // unversion incoming calls for pre-relocate debug work
-+ final String NMS_REVISION_PACKAGE = "v1_16_R1/";
++ final String NMS_REVISION_PACKAGE = "v1_16_R2/";
+
+ getAndRemove.put( "net/minecraft/".concat( "server/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE );
+ getAndRemove.put( "org/bukkit/".concat( "craftbukkit/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE );
diff --git a/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
index 4345b70327..fea2e2005a 100644
--- a/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
+++ b/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch
@@ -631,6 +631,14 @@ diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
+@@ -0,0 +0,0 @@
+ package net.minecraft.server;
+
+ import com.mojang.datafixers.util.Either;
++import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper
+ import it.unimi.dsi.fastutil.shorts.ShortArraySet;
+ import it.unimi.dsi.fastutil.shorts.ShortSet;
+ import java.util.List;
@@ -0,0 +0,0 @@ public class PlayerChunk {
private CompletableFuture chunkSave;
public int oldTicketLevel;
@@ -639,11 +647,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- final ChunkCoordIntPair location; // Paper - private -> package
+ volatile int n; public final int getCurrentPriority() { return n; } // Paper - OBFHELPER - make volatile since this is concurrently accessed
+ public final ChunkCoordIntPair location; // Paper - private -> public
- private final short[] dirtyBlocks;
- private int dirtyCount;
+ private boolean p;
+ private final ShortSet[] dirtyBlocks;
private int r;
@@ -0,0 +0,0 @@ public class PlayerChunk {
- private boolean hasBeenLoaded;
+ private boolean x;
private final PlayerChunkMap chunkMap; // Paper
+ public WorldServer getWorld() { return chunkMap.world; } // Paper
@@ -658,7 +666,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ volatile int neighborPriority = -1;
+ volatile int priorityBoost = 0;
+ public final java.util.concurrent.ConcurrentHashMap neighbors = new java.util.concurrent.ConcurrentHashMap<>();
-+ public final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap neighborPriorities = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>();
++ public final Long2ObjectOpenHashMap neighborPriorities = new Long2ObjectOpenHashMap<>();
+
+ private int getDemandedPriority() {
+ int priority = neighborPriority; // if we have a neighbor priority, use it
@@ -844,7 +852,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.entityTickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
}
-- this.v.a(this.location, this::k, this.ticketLevel, this::d);
+- this.u.a(this.location, this::k, this.ticketLevel, this::d);
+ // Paper start - raise IO/load priority if priority changes, use our preferred priority
+ priorityBoost = chunkMap.chunkDistanceManager.getChunkPriority(location);
+ int priority = getDemandedPriority();
@@ -858,7 +866,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ chunkMap.world.asyncChunkTaskManager.raisePriority(location.x, location.z, ioPriority);
+ }
+ if (getCurrentPriority() != priority) {
-+ this.v.a(this.location, this::getCurrentPriority, priority, this::setPriority); // use preferred priority
++ this.u.a(this.location, this::getCurrentPriority, priority, this::setPriority); // use preferred priority
+ int neighborsPriority = getNeighborsPriority();
+ this.neighbors.forEach((neighbor, neighborDesired) -> neighbor.setNeighborPriority(this, neighborsPriority));
+ }
@@ -884,6 +892,14 @@ diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/j
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
+@@ -0,0 +0,0 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
+ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
+ import it.unimi.dsi.fastutil.longs.Long2ByteMap;
+ import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap;
++import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; // Paper
+ import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
+ import it.unimi.dsi.fastutil.longs.Long2ObjectMap.Entry;
+ import it.unimi.dsi.fastutil.longs.LongIterator;
@@ -0,0 +0,0 @@ import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -980,7 +996,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return playerchunk == null || unloadQueue.contains(playerchunk.location.pair());
+ }
+
-+ private void updateChunkPriorityMap(it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap map, long chunk, int level) {
++ private void updateChunkPriorityMap(Long2IntOpenHashMap map, long chunk, int level) {
+ int prev = map.getOrDefault(chunk, -1);
+ if (level > prev) {
+ map.put(chunk, level);
@@ -993,7 +1009,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return;
+ }
+ player.lastHighPriorityChecked = currentTick;
-+ it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap priorities = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap();
++ Long2IntOpenHashMap priorities = new Long2IntOpenHashMap();
+
+ int viewDistance = getEffectiveNoTickViewDistance();
+ BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition();
diff --git a/Spigot-Server-Patches/Implement-EntityKnockbackByEntityEvent.patch b/Spigot-Server-Patches/Implement-EntityKnockbackByEntityEvent.patch
index 8b7ed21d67..8317c3e3a0 100644
--- a/Spigot-Server-Patches/Implement-EntityKnockbackByEntityEvent.patch
+++ b/Spigot-Server-Patches/Implement-EntityKnockbackByEntityEvent.patch
@@ -16,14 +16,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- ((EntityLiving) entity).a((float) i * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)));
+ ((EntityLiving) entity).doKnockback((float) i * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); // Paper
} else {
- entity.h((double) (-MathHelper.sin(this.yaw * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 0.017453292F) * (float) i * 0.5F));
+ entity.i((double) (-MathHelper.sin(this.yaw * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 0.017453292F) * (float) i * 0.5F));
}
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h((Entity) entityliving) < 9.0D) {
// CraftBukkit start - Only apply knockback if the damage hits
if (entityliving.damageEntity(DamageSource.playerAttack(this).sweep(), f4)) {
- entityliving.a(0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)));
-+ entityliving.doKnockback(0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this);
++ entityliving.doKnockback(0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); // Paper
}
// CraftBukkit end
}
@@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (flag) {
if (f1 > 0.0F && entity instanceof EntityLiving) {
- ((EntityLiving) entity).a(f1 * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)));
-+ ((EntityLiving) entity).doKnockback(f1 * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this);
++ ((EntityLiving) entity).doKnockback(f1 * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); // Paper
this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D));
}
@@ -47,18 +47,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
}
- this.aw = (float) (MathHelper.d(d1, d0) * 57.2957763671875D - (double) this.yaw);
+ this.ap = (float) (MathHelper.d(d1, d0) * 57.2957763671875D - (double) this.yaw);
- this.a(0.4F, d0, d1);
+ this.doKnockback(0.4F, d0, d1, entity1); // Paper
} else {
- this.aw = (float) ((int) (Math.random() * 2.0D) * 180);
+ this.ap = (float) ((int) (Math.random() * 2.0D) * 180);
}
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
}
- protected void f(EntityLiving entityliving) {
+ protected void e(EntityLiving entityliving) {
- entityliving.a(0.5F, entityliving.locX() - this.locX(), entityliving.locZ() - this.locZ());
-+ entityliving.doKnockback(0.5F, entityliving.locX() - this.locX(), entityliving.locZ() - this.locZ(), this);
++ entityliving.doKnockback(0.5F, entityliving.locX() - this.locX(), entityliving.locZ() - this.locZ(), this); // Paper
}
private boolean f(DamageSource damagesource) {
diff --git a/Spigot-Server-Patches/Implement-EntityTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/Implement-EntityTeleportEndGatewayEvent.patch
index 6cae15a8b4..e8bd4c4b18 100644
--- a/Spigot-Server-Patches/Implement-EntityTeleportEndGatewayEvent.patch
+++ b/Spigot-Server-Patches/Implement-EntityTeleportEndGatewayEvent.patch
@@ -22,10 +22,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (!event.callEvent()) {
+ return;
+ }
++ // Paper end
+ entity1.resetPortalCooldown();
- entity1.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D);
-+ entity.enderTeleportAndLoad(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ());
-+ // Paper end - EntityTeleportEndGatewayEvent
++ entity1.enderTeleportAndLoad(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ()); // Paper
}
this.h();
diff --git a/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch b/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch
index 2bbe2df646..f04a5e3c17 100644
--- a/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch
+++ b/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch
@@ -14,9 +14,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving {
private final NonNullList armorItems;
private boolean armorStandInvisible;
- public long bp;
-- private int bA;
-+ private int bA; public final void setDisabledSlots(int i) { bA = i; } public final int getDisabledSlots() { return bA; } // Paper - OBFHELPER
+ public long bi;
+- public int bv; //PAIL private -> public, rename disabledSlots
++ public int bv; public final void setDisabledSlots(int i) { bv = i; } public final int getDisabledSlots() { return bv; } // Paper - OBFHELPER
public Vector3f headPose;
public Vector3f bodyPose;
public Vector3f leftArmPose;
@@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public final boolean isSlotDisabled(EnumItemSlot slot) { return this.d(slot); } // Paper - OBFHELPER
private boolean d(EnumItemSlot enumitemslot) {
- return (this.bA & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms();
+ return (this.bv & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
diff --git a/Spigot-Server-Patches/Implement-Mob-Goal-API.patch b/Spigot-Server-Patches/Implement-Mob-Goal-API.patch
index fdfd3254c8..caaf42ccf5 100644
--- a/Spigot-Server-Patches/Implement-Mob-Goal-API.patch
+++ b/Spigot-Server-Patches/Implement-Mob-Goal-API.patch
@@ -142,6 +142,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ deobfuscationMap.put("shulker_e", "shulker_peek");
+ deobfuscationMap.put("squid_a", "squid_flee");
+ deobfuscationMap.put("skeleton_abstract_1", "skeleton_melee");
++ deobfuscationMap.put("strider_a", "strider_go_to_lava");
+ deobfuscationMap.put("turtle_a", "turtle_breed");
+ deobfuscationMap.put("turtle_b", "turtle_go_home");
+ deobfuscationMap.put("turtle_c", "turtle_goto_water");
@@ -253,6 +254,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ bukkitMap.put(EntityZombieVillager.class, ZombieVillager.class);
+ bukkitMap.put(EntityHoglin.class, Hoglin.class);
+ bukkitMap.put(EntityPiglin.class, Piglin.class);
++ bukkitMap.put(EntityPiglinAbstract.class, PiglinAbstract.class);
++ bukkitMap.put(EntityPiglinBrute.class, PiglinBrute.class);
+ bukkitMap.put(EntityStrider.class, Strider.class);
+ bukkitMap.put(EntityZoglin.class, Zoglin.class);
+ }
diff --git a/Spigot-Server-Patches/Implement-Player-Client-Options-API.patch b/Spigot-Server-Patches/Implement-Player-Client-Options-API.patch
index 1fb03c1d3c..369df9816b 100644
--- a/Spigot-Server-Patches/Implement-Player-Client-Options-API.patch
+++ b/Spigot-Server-Patches/Implement-Player-Client-Options-API.patch
@@ -89,14 +89,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
- private static final Map b = ImmutableMap.builder().put(EntityPose.STANDING, EntityHuman.bo).put(EntityPose.SLEEPING, EntityHuman.ao).put(EntityPose.FALL_FLYING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SWIMMING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SPIN_ATTACK, EntitySize.b(0.6F, 0.6F)).put(EntityPose.CROUCHING, EntitySize.b(0.6F, 1.5F)).put(EntityPose.DYING, EntitySize.c(0.2F, 0.2F)).build();
+ private static final Map b = ImmutableMap.builder().put(EntityPose.STANDING, EntityHuman.bh).put(EntityPose.SLEEPING, EntityHuman.ah).put(EntityPose.FALL_FLYING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SWIMMING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SPIN_ATTACK, EntitySize.b(0.6F, 0.6F)).put(EntityPose.CROUCHING, EntitySize.b(0.6F, 1.5F)).put(EntityPose.DYING, EntitySize.c(0.2F, 0.2F)).build();
private static final DataWatcherObject c = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c);
private static final DataWatcherObject d = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.b);
-- protected static final DataWatcherObject bp = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a);
-+ protected static final DataWatcherObject bp = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); public static DataWatcherObject getSkinPartsWatcher() { return bp; } // Paper - OBFHELPER
- protected static final DataWatcherObject bq = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a);
- protected static final DataWatcherObject br = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
- protected static final DataWatcherObject bs = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
+- protected static final DataWatcherObject bi = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a);
++ protected static final DataWatcherObject bi = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); public static DataWatcherObject getSkinPartsWatcher() { return bi; } // Paper - OBFHELPER
+ protected static final DataWatcherObject bj = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a);
+ protected static final DataWatcherObject bk = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
+ protected static final DataWatcherObject bl = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -112,10 +112,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public int lastSentExp = -99999999;
public int invulnerableTicks = 60;
- private EnumChatVisibility cf;
-- private boolean cg = true;
-+ private boolean cg = true; public boolean hasChatColorsEnabled() { return this.cg; } // Paper - OBFHELPER
- private long ch = SystemUtils.getMonotonicMillis();
+ private EnumChatVisibility bY;
+- private boolean bZ = true;
++ private boolean bZ = true; public boolean hasChatColorsEnabled() { return this.bZ; } // Paper - OBFHELPER
+ private long ca = SystemUtils.getMonotonicMillis();
private Entity spectatedEntity;
public boolean worldChangeInvuln;
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -159,8 +159,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import com.destroystokyo.paper.PaperSkinParts;
+import com.destroystokyo.paper.ClientOption;
import com.destroystokyo.paper.Title;
- import com.destroystokyo.paper.profile.CraftPlayerProfile;
- import com.destroystokyo.paper.profile.PlayerProfile;
+ import com.google.common.base.Preconditions;
+ import com.google.common.collect.ImmutableSet;
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setViewDistance(int viewDistance) {
throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
diff --git a/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch b/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch
index 731e33773e..d50a033311 100644
--- a/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch
+++ b/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch
@@ -24,21 +24,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (this.locale == null || !this.locale.equals(packetplayinsettings.locale)) { // Paper - check for null
PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(getBukkitEntity(), packetplayinsettings.locale);
this.server.server.getPluginManager().callEvent(event);
++ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.locale, packetplayinsettings.locale).callEvent(); // Paper
}
this.locale = packetplayinsettings.locale;
this.clientViewDistance = packetplayinsettings.viewDistance;
- // CraftBukkit end
-+ // Paper start - add PlayerLocaleChangeEvent
-+ // Since the field is initialized to null, this event should always fire the first time the packet is received
-+ String oldLocale = this.locale;
-+ this.locale = packetplayinsettings.locale;
-+ if (!this.locale.equals(oldLocale)) {
-+ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent();
-+ }
-+ // Paper end
- this.cf = packetplayinsettings.d();
- this.cg = packetplayinsettings.e();
- this.getDataWatcher().set(EntityPlayer.bp, (byte) packetplayinsettings.f());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
diff --git a/Spigot-Server-Patches/Implement-alternative-item-despawn-rate.patch b/Spigot-Server-Patches/Implement-alternative-item-despawn-rate.patch
index 37a7771eb3..c1f2d2733d 100644
--- a/Spigot-Server-Patches/Implement-alternative-item-despawn-rate.patch
+++ b/Spigot-Server-Patches/Implement-alternative-item-despawn-rate.patch
@@ -123,5 +123,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
+
@Override
- public Packet> O() {
+ public Packet> P() {
return new PacketPlayOutSpawnEntity(this);
diff --git a/Spigot-Server-Patches/Import-fastutil-classes.patch b/Spigot-Server-Patches/Import-fastutil-classes.patch
new file mode 100644
index 0000000000..d7768bd32a
--- /dev/null
+++ b/Spigot-Server-Patches/Import-fastutil-classes.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mariell Hoversholm
+Date: Wed, 12 Aug 2020 11:33:04 +0200
+Subject: [PATCH] Import fastutil classes
+
+
+diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/DataWatcher.java
++++ b/src/main/java/net/minecraft/server/DataWatcher.java
+@@ -0,0 +0,0 @@ import java.util.Map;
+ import java.util.concurrent.locks.ReadWriteLock;
+ import java.util.concurrent.locks.ReentrantReadWriteLock;
+ import javax.annotation.Nullable;
++import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; // Paper
+ import org.apache.commons.lang3.ObjectUtils;
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+@@ -0,0 +0,0 @@ public class DataWatcher {
+ private static final Logger LOGGER = LogManager.getLogger();
+ private static final Map, Integer> b = Maps.newHashMap();
+ private final Entity entity;
+- private final it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap> entries = new it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<>(); // Spigot - use better map // PAIL
++ private final Int2ObjectOpenHashMap- > entries = new Int2ObjectOpenHashMap<>(); // Spigot - use better map // PAIL
+ // private final ReadWriteLock lock = new ReentrantReadWriteLock(); // Spigot - not required
+ private boolean f = true;
+ private boolean g;
diff --git a/Spigot-Server-Patches/Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch b/Spigot-Server-Patches/Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch
index 1501ff3910..b6fc68bc8d 100644
--- a/Spigot-Server-Patches/Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch
+++ b/Spigot-Server-Patches/Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch
@@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private void d(E e0, EntityTargetEvent.TargetReason reason) {
// CraftBukkit start
- EntityLiving old = e0.getBehaviorController().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null);
-- EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(e0, old, (old != null && !old.isAlive()) ? EntityTargetEvent.TargetReason.TARGET_DIED : EntityTargetEvent.TargetReason.FORGOT_TARGET);
+- EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(e0, null, (old != null && !old.isAlive()) ? EntityTargetEvent.TargetReason.TARGET_DIED : EntityTargetEvent.TargetReason.FORGOT_TARGET);
+ // Paper start - fix this event
+ //EntityLiving old = e0.getBehaviorController().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null);
+ EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(e0, null, reason);
diff --git a/Spigot-Server-Patches/Improve-Legacy-Component-serialization-size.patch b/Spigot-Server-Patches/Improve-Legacy-Component-serialization-size.patch
index 34ac1ddeaf..004a3e112b 100644
--- a/Spigot-Server-Patches/Improve-Legacy-Component-serialization-size.patch
+++ b/Spigot-Server-Patches/Improve-Legacy-Component-serialization-size.patch
@@ -14,8 +14,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Separate pattern with no group 3, new lines are part of previous string
private static final Pattern INCREMENTAL_PATTERN_KEEP_NEWLINES = Pattern.compile("(" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + "[0-9a-fk-orx])|((?:(?:https?):\\/\\/)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + " ]|$))))", Pattern.CASE_INSENSITIVE);
// ChatColor.b does not explicitly reset, its more of empty
-+ private static final ChatModifier EMPTY = ChatModifier.b.setItalic(false); // Paper - OBFHELPER
- private static final ChatModifier RESET = ChatModifier.b.setBold(false).setItalic(false).setUnderline(false).setStrikethrough(false).setRandom(false);
++ private static final ChatModifier EMPTY = ChatModifier.a.setItalic(false); // Paper - OBFHELPER
+ private static final ChatModifier RESET = ChatModifier.a.setBold(false).setItalic(false).setUnderline(false).setStrikethrough(false).setRandom(false);
private final List list = new ArrayList();
@@ -0,0 +0,0 @@ public final class CraftChatMessage {
diff --git a/Spigot-Server-Patches/Improve-death-events.patch b/Spigot-Server-Patches/Improve-death-events.patch
index 197f4561f8..2c10cffee9 100644
--- a/Spigot-Server-Patches/Improve-death-events.patch
+++ b/Spigot-Server-Patches/Improve-death-events.patch
@@ -42,10 +42,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.fallDistance = 0.0F;
}
-+ public final void onKill(EntityLiving entityLiving) { this.a_(entityLiving); } // Paper - OBFHELPER
- public void a_(EntityLiving entityliving) {}
++ public final void onKill(WorldServer worldserver, EntityLiving entityLiving) { this.a(worldserver, entityLiving); } // Paper - OBFHELPER
+ public void a(WorldServer worldserver, EntityLiving entityliving) {}
- protected void k(double d0, double d1, double d2) {
+ protected void l(double d0, double d1, double d2) {
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
@@ -123,14 +123,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
- protected float aS;
- protected float aT;
- protected float aU;
-- protected int aV;
-+ protected int aV; protected int getKillCount() { return this.aV; } // Paper - OBFHELPER
+ protected float aL;
+ protected float aM;
+ protected float aN;
+- protected int aO;
++ protected int aO;protected int getKillCount() { return this.aO; } // Paper - OBFHELPER
public float lastDamage;
protected boolean jumping;
- public float aY;
+ public float aR;
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
public Set collidableExemptions = new HashSet<>();
public boolean canPickUpLoot;
@@ -165,9 +165,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Entity entity = damagesource.getEntity();
EntityLiving entityliving = this.getKillingEntity();
-+ /* // Paper - move down to make death event cancellable
- if (this.aV >= 0 && entityliving != null) {
- entityliving.a(this, this.aV, damagesource);
++ /* // Paper - move down to make death event cancellable - this is the runKillTrigger below
+ if (this.aO >= 0 && entityliving != null) {
+ entityliving.a(this, this.aO, damagesource);
}
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
if (this.isSleeping()) {
@@ -177,28 +177,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.killed = true;
- this.getCombatTracker().g();
-+ //this.getCombatTracker().g(); // Paper
- if (!this.world.isClientSide) {
++ // this.getCombatTracker().g(); // Paper - moved into if below as .reset()
+ if (this.world instanceof WorldServer) {
+ if (entity != null) {
+- entity.a((WorldServer) this.world, this);
++ // entity.a((WorldServer) this.world, this); // Paper - move below into if for onKill
+ }
+
- this.d(damagesource);
++ // Paper start
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = this.d(damagesource);
+ if (deathEvent == null || !deathEvent.isCancelled()) {
+ if (this.getKillCount() >= 0 && entityliving != null) {
+ entityliving.runKillTrigger(this, this.getKillCount(), damagesource);
+ }
-+ if (entity != null) {
-+ entity.onKill(this);
-+ }
+ if (this.isSleeping()) {
+ this.entityWakeup();
+ }
+ this.getCombatTracker().reset();
++ if (entity != null) {
++ entity.onKill((WorldServer) this.world, this);
++ }
+ } else {
+ this.killed = false;
+ this.setHealth((float) deathEvent.getReviveHealth());
+ }
+ // Paper end
-+
- this.g(entityliving);
+ this.f(entityliving);
}
+ if (this.killed) { // Paper
diff --git a/Spigot-Server-Patches/Improved-Watchdog-Support.patch b/Spigot-Server-Patches/Improved-Watchdog-Support.patch
index 78f879447e..59af55de21 100644
--- a/Spigot-Server-Patches/Improved-Watchdog-Support.patch
+++ b/Spigot-Server-Patches/Improved-Watchdog-Support.patch
@@ -105,7 +105,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
r0.run();
} catch (Exception exception) {
+ if (exception.getCause() instanceof ThreadDeath) throw exception; // Paper
- IAsyncTaskHandler.LOGGER.fatal("Error executing task on {}", this.bh(), exception);
+ IAsyncTaskHandler.LOGGER.fatal("Error executing task on {}", this.bi(), exception);
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -159,7 +159,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
MinecraftServer.LOGGER.info("Stopping server");
MinecraftTimings.stopServer(); // Paper
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant bF;
+- protected int bd;
++ protected int bd; protected final int getEatTimeTicks() { return this.bd; } protected final void setEatTimeTicks(int value) { this.bd = value; } // Paper - OBFHELPER
+ protected int be;
+ private BlockPosition bx;
+ private Optional by;
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
- return ((Byte) this.datawatcher.get(EntityLiving.an) & 2) > 0 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND;
+ return ((Byte) this.datawatcher.get(EntityLiving.ag) & 2) > 0 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND;
}
+ // Paper start - lag compensate eating
@@ -28,19 +28,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ protected int totalEatTimeTicks;
+ // Paper end
+
- private void u() {
+ private void t() {
if (this.isHandRaised()) {
if (ItemStack.d(this.b(this.getRaisedHand()), this.activeItem)) {
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
this.b(this.activeItem, 5);
}
-- if (--this.bk == 0 && !this.world.isClientSide && !this.activeItem.m()) {
+- if (--this.bd == 0 && !this.world.isClientSide && !this.activeItem.m()) {
+ // Paper start - lag compensate eating
+ // we add 1 to the expected time to avoid lag compensating when we should not
-+ boolean shouldLagCompensate
-+ = this.activeItem.getItem().isFood() && this.eatStartTime != -1 && (System.nanoTime() - this.eatStartTime) > ((1 + this.totalEatTimeTicks) * 50 * (1000 * 1000));
-+ if ((--this.bk == 0 || shouldLagCompensate) && !this.world.isClientSide && !this.activeItem.m()) {
++ boolean shouldLagCompensate = this.activeItem.getItem().isFood() && this.eatStartTime != -1 && (System.nanoTime() - this.eatStartTime) > ((1 + this.totalEatTimeTicks) * 50 * (1000 * 1000));
++ if ((--this.bd == 0 || shouldLagCompensate) && !this.world.isClientSide && !this.activeItem.m()) {
+ this.setEatTimeTicks(0);
+ // Paper end
this.s();
@@ -50,9 +49,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!itemstack.isEmpty() && !this.isHandRaised() || forceUpdate) { // Paper use override flag
this.activeItem = itemstack;
-- this.bk = itemstack.k();
+- this.bd = itemstack.k();
+ // Paper start - lag compensate eating
-+ this.bk = this.totalEatTimeTicks = itemstack.k();
++ this.bd = this.totalEatTimeTicks = itemstack.k();
+ this.eatStartTime = System.nanoTime();
+ // Paper end
if (!this.world.isClientSide) {
@@ -62,9 +61,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
} else if (!this.isHandRaised() && !this.activeItem.isEmpty()) {
this.activeItem = ItemStack.b;
-- this.bk = 0;
+- this.bd = 0;
+ // Paper start - lag compensate eating
-+ this.bk = this.totalEatTimeTicks = 0;
++ this.bd = this.totalEatTimeTicks = 0;
+ this.eatStartTime = -1L;
+ // Paper end
}
@@ -74,9 +73,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
this.activeItem = ItemStack.b;
-- this.bk = 0;
+- this.bd = 0;
+ // Paper start - lag compensate eating
-+ this.bk = this.totalEatTimeTicks = 0;
++ this.bd = this.totalEatTimeTicks = 0;
+ this.eatStartTime = -1L;
+ // Paper end
}
diff --git a/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch
index 9e9a69abfb..fb2289b678 100644
--- a/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch
+++ b/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch
@@ -10,21 +10,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
- private float bB;
+ private float bu;
private int jumpTicks;
- private float bD;
+ private float bw;
- protected ItemStack activeItem;
+ public ItemStack activeItem; // Paper - public
- protected int bk;
- protected int bl;
- private BlockPosition bE;
+ protected int bd;
+ protected int be;
+ private BlockPosition bx;
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
return this.activeItem;
}
+ public int getItemUseRemainingTime() { return this.dY(); } // Paper - OBFHELPER
public int dY() {
- return this.bk;
+ return this.bd;
}
+ public int getHandRaisedTime() { return this.dZ(); } // Paper - OBFHELPER
diff --git a/Spigot-Server-Patches/LivingEntity-setKiller.patch b/Spigot-Server-Patches/LivingEntity-setKiller.patch
index 4edf41b263..14d6fe494b 100644
--- a/Spigot-Server-Patches/LivingEntity-setKiller.patch
+++ b/Spigot-Server-Patches/LivingEntity-setKiller.patch
@@ -9,14 +9,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity {
- public float aL;
+ public float aE;
@Nullable
public EntityHuman killer;
- protected int lastDamageByPlayerTime;
+ public int lastDamageByPlayerTime; // Paper - protected -> public
protected boolean killed;
protected int ticksFarFromPlayer;
- protected float aQ;
+ protected float aJ;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
diff --git a/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch b/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch
index 78e44aeffa..647c6a14cd 100644
--- a/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch
+++ b/Spigot-Server-Patches/Load-Chunks-for-Login-Asynchronously.patch
@@ -22,14 +22,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
- this.pitch = MathHelper.a(f1, -90.0F, 90.0F) % 360.0F;
- this.lastYaw = this.yaw;
- this.lastPitch = this.pitch;
+ this.lastY = d1;
+ this.lastZ = d4;
+ this.setPosition(d3, d1, d4);
- world.getChunkAt((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4); // CraftBukkit
+ if (valid) world.getChunkAt((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4); // CraftBukkit // Paper
}
- public void c(Vec3D vec3d) {
+ public void d(Vec3D vec3d) {
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -149,7 +149,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (nbttagcompound != null) {
@@ -0,0 +0,0 @@ public abstract class PlayerList {
- entityplayer.B().a(entityplayer);
+ entityplayer.getRecipeBook().a(entityplayer);
this.sendScoreboard(worldserver1.getScoreboard(), entityplayer);
this.server.invalidatePingSample();
+ // Paper start - async load spawn in chunk
diff --git a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch
index daa7956fa2..c5e39e616c 100644
--- a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch
+++ b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch
@@ -585,7 +585,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- this.lootTable = null;
+ //this.lootTable = null; // Paper
+ this.lootableData.processRefill(entityhuman); // Paper
- LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).set(LootContextParameters.POSITION, this.getChunkCoordinates()).a(this.lootTableSeed);
+ LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).set(LootContextParameters.ORIGIN, this.getPositionVector()).a(this.lootTableSeed);
if (entityhuman != null) {
diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java
@@ -641,7 +641,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- this.lootTable = null;
+ //this.lootTable = null; // Paper
+ this.lootableData.processRefill(entityhuman); // Paper
- LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).set(LootContextParameters.POSITION, new BlockPosition(this.position)).a(this.lootTableSeed);
+ LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).set(LootContextParameters.ORIGIN, Vec3D.a((BaseBlockPosition) this.position)).a(this.lootTableSeed);
if (entityhuman != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
diff --git a/Spigot-Server-Patches/MC-145656-Fix-Follow-Range-Initial-Target.patch b/Spigot-Server-Patches/MC-145656-Fix-Follow-Range-Initial-Target.patch
index a3f188ac35..6f243e25a6 100644
--- a/Spigot-Server-Patches/MC-145656-Fix-Follow-Range-Initial-Target.patch
+++ b/Spigot-Server-Patches/MC-145656-Fix-Follow-Range-Initial-Target.patch
@@ -38,9 +38,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.b > 0.0D) {
double d0 = this.g ? entityliving1.A(entityliving) : 1.0D;
-- double d1 = this.b * d0;
-+ double d1 = (useFollowRange ? getFollowRange(entityliving) : this.b) * d0; // Paper
- double d2 = entityliving.g(entityliving1.locX(), entityliving1.locY(), entityliving1.locZ());
+- double d1 = Math.max(this.b * d0, 2.0D);
++ double d1 = Math.max((useFollowRange ? getFollowRange(entityliving) : this.b) * d0, 2.0D); // Paper
+ double d2 = entityliving.h(entityliving1.locX(), entityliving1.locY(), entityliving1.locZ());
if (d2 > d1 * d1) {
@@ -0,0 +0,0 @@ public class PathfinderTargetCondition {
diff --git a/Spigot-Server-Patches/MC-197883-Bandaid-decode-issue.patch b/Spigot-Server-Patches/MC-197883-Bandaid-decode-issue.patch
new file mode 100644
index 0000000000..d0eb22b1ef
--- /dev/null
+++ b/Spigot-Server-Patches/MC-197883-Bandaid-decode-issue.patch
@@ -0,0 +1,28 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aikar
+Date: Fri, 21 Aug 2020 21:05:28 -0400
+Subject: [PATCH] MC-197883: Bandaid decode issue
+
+Mojang has a mix of type and name in the data sets, but you can only
+use one.
+
+This will retry as name if type is asked for and not found.
+
+diff --git a/src/main/java/com/mojang/serialization/codecs/KeyDispatchCodec.java b/src/main/java/com/mojang/serialization/codecs/KeyDispatchCodec.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/com/mojang/serialization/codecs/KeyDispatchCodec.java
++++ b/src/main/java/com/mojang/serialization/codecs/KeyDispatchCodec.java
+@@ -0,0 +0,0 @@ public class KeyDispatchCodec extends MapCodec {
+
+ @Override
+ public DataResult decode(final DynamicOps ops, final MapLike input) {
+- final T elementName = input.get(typeKey);
++ // Paper start - bandaid MC-197883
++ T elementName = input.get(typeKey);
++ if (elementName == null && "type".equals(typeKey)) {
++ elementName = input.get("name");
++ }
++ // Paper end
+ if (elementName == null) {
+ return DataResult.error("Input does not contain a key [" + typeKey + "]: " + input);
+ }
diff --git a/Spigot-Server-Patches/MC-Dev-fixes.patch b/Spigot-Server-Patches/MC-Dev-fixes.patch
index 9c2d91305d..faa6cd03c1 100644
--- a/Spigot-Server-Patches/MC-Dev-fixes.patch
+++ b/Spigot-Server-Patches/MC-Dev-fixes.patch
@@ -54,171 +54,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/BiomeBase.java
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
- public class BiomeBase {
+ public final 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
++ // Paper start
++ private static class dProxy extends BiomeBase.d {
++ private dProxy(Precipitation biomebase_precipitation, float f, TemperatureModifier biomebase_temperaturemodifier, float f1) {
++ super(biomebase_precipitation, f, biomebase_temperaturemodifier, f1);
++ }
++ };
++ // Paper end
+ public static final Codec b = RecordCodecBuilder.create((instance) -> {
+- return instance.group(BiomeBase.d.a.forGetter((biomebase) -> {
++ return instance.group(dProxy.a.forGetter((biomebase) -> { // Paper
+ return biomebase.j;
+ }), BiomeBase.Geography.r.fieldOf("category").forGetter((biomebase) -> {
+ return biomebase.o;
+@@ -0,0 +0,0 @@ public final class BiomeBase {
+ })).apply(instance, BiomeBase::new);
});
- 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;
-@@ -0,0 +0,0 @@ public class BiomeBase {
-
- @Nullable
- public static BiomeBase a(BiomeBase biomebase) {
-- 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) {
-@@ -0,0 +0,0 @@ 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;
- });
-@@ -0,0 +0,0 @@ public class BiomeBase {
-
- 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
-
- return this.getTemperature() - (f + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F;
- } else {
-diff --git a/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java b/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java
-+++ b/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java
-@@ -0,0 +0,0 @@ public class BiomeFrozenDeepOcean extends BiomeBase {
- }
-
- 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 {
-diff --git a/src/main/java/net/minecraft/server/BiomeFrozenOcean.java b/src/main/java/net/minecraft/server/BiomeFrozenOcean.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/BiomeFrozenOcean.java
-+++ b/src/main/java/net/minecraft/server/BiomeFrozenOcean.java
-@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/Biomes.java
-+++ b/src/main/java/net/minecraft/server/Biomes.java
-@@ -0,0 +0,0 @@ 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;
+ public static final Codec c = RecordCodecBuilder.create((instance) -> {
+- return instance.group(BiomeBase.d.a.forGetter((biomebase) -> {
++ return instance.group(dProxy.a.forGetter((biomebase) -> { // Paper
+ return biomebase.j;
+ }), BiomeBase.Geography.r.fieldOf("category").forGetter((biomebase) -> {
+ return biomebase.o;
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
@@ -262,6 +122,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.n = j2 != 0;
blockposition_mutableblockposition = this.h.d(i1 + l1, j1 + i2, k1 + j2);
}
+@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
+ };
+ }
+
+- public static Iterable a(BlockPosition blockposition, int i, EnumDirection enumdirection, EnumDirection enumdirection1) {
++ public static Iterable a(BlockPosition blockposition, int I, EnumDirection enumdirection, EnumDirection enumdirection1) { // Paper - decompile fix
+ Validate.validState(enumdirection.n() != enumdirection1.n(), "The two directions cannot be on the same axis", new Object[0]);
+ return () -> {
+ return new AbstractIterator() {
+ private final EnumDirection[] e = new EnumDirection[]{enumdirection, enumdirection1, enumdirection.opposite(), enumdirection1.opposite()};
+ private final BlockPosition.MutableBlockPosition f = blockposition.i().c(enumdirection1);
+- private final int g = 4 * i;
++ private final int g = 4 * I;
+ private int h = -1;
+ private int i;
+ private int j;
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
@@ -292,6 +168,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}));
CraftingManager.LOGGER.info("Loaded {} recipes", map1.size());
}
+diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
++++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
+@@ -0,0 +0,0 @@ public class EnderDragonBattle {
+ }
+ }
+
+- worldgenendtrophy.b((WorldGenFeatureConfiguration) WorldGenFeatureConfiguration.k).a(this.world, this.world.getChunkProvider().getChunkGenerator(), new Random(), this.exitPortalLocation);
++ worldgenendtrophy.b(WorldGenFeatureConfiguration.k).a(this.world, this.world.getChunkProvider().getChunkGenerator(), new Random(), this.exitPortalLocation); // Paper - decompile fix
+ }
+
+ private EntityEnderDragon o() {
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityVindicator.java
@@ -313,8 +202,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public enum EnumProtocol {
-- HANDSHAKING(-1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketHandshakingInSetProtocol.class, PacketHandshakingInSetProtocol::new))), PLAY(0, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketPlayOutSpawnEntity.class, PacketPlayOutSpawnEntity::new).a(PacketPlayOutSpawnEntityExperienceOrb.class, PacketPlayOutSpawnEntityExperienceOrb::new).a(PacketPlayOutSpawnEntityLiving.class, PacketPlayOutSpawnEntityLiving::new).a(PacketPlayOutSpawnEntityPainting.class, PacketPlayOutSpawnEntityPainting::new).a(PacketPlayOutNamedEntitySpawn.class, PacketPlayOutNamedEntitySpawn::new).a(PacketPlayOutAnimation.class, PacketPlayOutAnimation::new).a(PacketPlayOutStatistic.class, PacketPlayOutStatistic::new).a(PacketPlayOutBlockBreak.class, PacketPlayOutBlockBreak::new).a(PacketPlayOutBlockBreakAnimation.class, PacketPlayOutBlockBreakAnimation::new).a(PacketPlayOutTileEntityData.class, PacketPlayOutTileEntityData::new).a(PacketPlayOutBlockAction.class, PacketPlayOutBlockAction::new).a(PacketPlayOutBlockChange.class, PacketPlayOutBlockChange::new).a(PacketPlayOutBoss.class, PacketPlayOutBoss::new).a(PacketPlayOutServerDifficulty.class, PacketPlayOutServerDifficulty::new).a(PacketPlayOutChat.class, PacketPlayOutChat::new).a(PacketPlayOutMultiBlockChange.class, PacketPlayOutMultiBlockChange::new).a(PacketPlayOutTabComplete.class, PacketPlayOutTabComplete::new).a(PacketPlayOutCommands.class, PacketPlayOutCommands::new).a(PacketPlayOutTransaction.class, PacketPlayOutTransaction::new).a(PacketPlayOutCloseWindow.class, PacketPlayOutCloseWindow::new).a(PacketPlayOutWindowItems.class, PacketPlayOutWindowItems::new).a(PacketPlayOutWindowData.class, PacketPlayOutWindowData::new).a(PacketPlayOutSetSlot.class, PacketPlayOutSetSlot::new).a(PacketPlayOutSetCooldown.class, PacketPlayOutSetCooldown::new).a(PacketPlayOutCustomPayload.class, PacketPlayOutCustomPayload::new).a(PacketPlayOutCustomSoundEffect.class, PacketPlayOutCustomSoundEffect::new).a(PacketPlayOutKickDisconnect.class, PacketPlayOutKickDisconnect::new).a(PacketPlayOutEntityStatus.class, PacketPlayOutEntityStatus::new).a(PacketPlayOutExplosion.class, PacketPlayOutExplosion::new).a(PacketPlayOutUnloadChunk.class, PacketPlayOutUnloadChunk::new).a(PacketPlayOutGameStateChange.class, PacketPlayOutGameStateChange::new).a(PacketPlayOutOpenWindowHorse.class, PacketPlayOutOpenWindowHorse::new).a(PacketPlayOutKeepAlive.class, PacketPlayOutKeepAlive::new).a(PacketPlayOutMapChunk.class, PacketPlayOutMapChunk::new).a(PacketPlayOutWorldEvent.class, PacketPlayOutWorldEvent::new).a(PacketPlayOutWorldParticles.class, PacketPlayOutWorldParticles::new).a(PacketPlayOutLightUpdate.class, PacketPlayOutLightUpdate::new).a(PacketPlayOutLogin.class, PacketPlayOutLogin::new).a(PacketPlayOutMap.class, PacketPlayOutMap::new).a(PacketPlayOutOpenWindowMerchant.class, PacketPlayOutOpenWindowMerchant::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMove.class, PacketPlayOutEntity.PacketPlayOutRelEntityMove::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook.class, PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook::new).a(PacketPlayOutEntity.PacketPlayOutEntityLook.class, PacketPlayOutEntity.PacketPlayOutEntityLook::new).a(PacketPlayOutEntity.class, PacketPlayOutEntity::new).a(PacketPlayOutVehicleMove.class, PacketPlayOutVehicleMove::new).a(PacketPlayOutOpenBook.class, PacketPlayOutOpenBook::new).a(PacketPlayOutOpenWindow.class, PacketPlayOutOpenWindow::new).a(PacketPlayOutOpenSignEditor.class, PacketPlayOutOpenSignEditor::new).a(PacketPlayOutAutoRecipe.class, PacketPlayOutAutoRecipe::new).a(PacketPlayOutAbilities.class, PacketPlayOutAbilities::new).a(PacketPlayOutCombatEvent.class, PacketPlayOutCombatEvent::new).a(PacketPlayOutPlayerInfo.class, PacketPlayOutPlayerInfo::new).a(PacketPlayOutLookAt.class, PacketPlayOutLookAt::new).a(PacketPlayOutPosition.class, PacketPlayOutPosition::new).a(PacketPlayOutRecipes.class, PacketPlayOutRecipes::new).a(PacketPlayOutEntityDestroy.class, PacketPlayOutEntityDestroy::new).a(PacketPlayOutRemoveEntityEffect.class, PacketPlayOutRemoveEntityEffect::new).a(PacketPlayOutResourcePackSend.class, PacketPlayOutResourcePackSend::new).a(PacketPlayOutRespawn.class, PacketPlayOutRespawn::new).a(PacketPlayOutEntityHeadRotation.class, PacketPlayOutEntityHeadRotation::new).a(PacketPlayOutSelectAdvancementTab.class, PacketPlayOutSelectAdvancementTab::new).a(PacketPlayOutWorldBorder.class, PacketPlayOutWorldBorder::new).a(PacketPlayOutCamera.class, PacketPlayOutCamera::new).a(PacketPlayOutHeldItemSlot.class, PacketPlayOutHeldItemSlot::new).a(PacketPlayOutViewCentre.class, PacketPlayOutViewCentre::new).a(PacketPlayOutViewDistance.class, PacketPlayOutViewDistance::new).a(PacketPlayOutSpawnPosition.class, PacketPlayOutSpawnPosition::new).a(PacketPlayOutScoreboardDisplayObjective.class, PacketPlayOutScoreboardDisplayObjective::new).a(PacketPlayOutEntityMetadata.class, PacketPlayOutEntityMetadata::new).a(PacketPlayOutAttachEntity.class, PacketPlayOutAttachEntity::new).a(PacketPlayOutEntityVelocity.class, PacketPlayOutEntityVelocity::new).a(PacketPlayOutEntityEquipment.class, PacketPlayOutEntityEquipment::new).a(PacketPlayOutExperience.class, PacketPlayOutExperience::new).a(PacketPlayOutUpdateHealth.class, PacketPlayOutUpdateHealth::new).a(PacketPlayOutScoreboardObjective.class, PacketPlayOutScoreboardObjective::new).a(PacketPlayOutMount.class, PacketPlayOutMount::new).a(PacketPlayOutScoreboardTeam.class, PacketPlayOutScoreboardTeam::new).a(PacketPlayOutScoreboardScore.class, PacketPlayOutScoreboardScore::new).a(PacketPlayOutUpdateTime.class, PacketPlayOutUpdateTime::new).a(PacketPlayOutTitle.class, PacketPlayOutTitle::new).a(PacketPlayOutEntitySound.class, PacketPlayOutEntitySound::new).a(PacketPlayOutNamedSoundEffect.class, PacketPlayOutNamedSoundEffect::new).a(PacketPlayOutStopSound.class, PacketPlayOutStopSound::new).a(PacketPlayOutPlayerListHeaderFooter.class, PacketPlayOutPlayerListHeaderFooter::new).a(PacketPlayOutNBTQuery.class, PacketPlayOutNBTQuery::new).a(PacketPlayOutCollect.class, PacketPlayOutCollect::new).a(PacketPlayOutEntityTeleport.class, PacketPlayOutEntityTeleport::new).a(PacketPlayOutAdvancements.class, PacketPlayOutAdvancements::new).a(PacketPlayOutUpdateAttributes.class, PacketPlayOutUpdateAttributes::new).a(PacketPlayOutEntityEffect.class, PacketPlayOutEntityEffect::new).a(PacketPlayOutRecipeUpdate.class, PacketPlayOutRecipeUpdate::new).a(PacketPlayOutTags.class, PacketPlayOutTags::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketPlayInTeleportAccept.class, PacketPlayInTeleportAccept::new).a(PacketPlayInTileNBTQuery.class, PacketPlayInTileNBTQuery::new).a(PacketPlayInDifficultyChange.class, PacketPlayInDifficultyChange::new).a(PacketPlayInChat.class, PacketPlayInChat::new).a(PacketPlayInClientCommand.class, PacketPlayInClientCommand::new).a(PacketPlayInSettings.class, PacketPlayInSettings::new).a(PacketPlayInTabComplete.class, PacketPlayInTabComplete::new).a(PacketPlayInTransaction.class, PacketPlayInTransaction::new).a(PacketPlayInEnchantItem.class, PacketPlayInEnchantItem::new).a(PacketPlayInWindowClick.class, PacketPlayInWindowClick::new).a(PacketPlayInCloseWindow.class, PacketPlayInCloseWindow::new).a(PacketPlayInCustomPayload.class, PacketPlayInCustomPayload::new).a(PacketPlayInBEdit.class, PacketPlayInBEdit::new).a(PacketPlayInEntityNBTQuery.class, PacketPlayInEntityNBTQuery::new).a(PacketPlayInUseEntity.class, PacketPlayInUseEntity::new).a(PacketPlayInJigsawGenerate.class, PacketPlayInJigsawGenerate::new).a(PacketPlayInKeepAlive.class, PacketPlayInKeepAlive::new).a(PacketPlayInDifficultyLock.class, PacketPlayInDifficultyLock::new).a(PacketPlayInFlying.PacketPlayInPosition.class, PacketPlayInFlying.PacketPlayInPosition::new).a(PacketPlayInFlying.PacketPlayInPositionLook.class, PacketPlayInFlying.PacketPlayInPositionLook::new).a(PacketPlayInFlying.PacketPlayInLook.class, PacketPlayInFlying.PacketPlayInLook::new).a(PacketPlayInFlying.class, PacketPlayInFlying::new).a(PacketPlayInVehicleMove.class, PacketPlayInVehicleMove::new).a(PacketPlayInBoatMove.class, PacketPlayInBoatMove::new).a(PacketPlayInPickItem.class, PacketPlayInPickItem::new).a(PacketPlayInAutoRecipe.class, PacketPlayInAutoRecipe::new).a(PacketPlayInAbilities.class, PacketPlayInAbilities::new).a(PacketPlayInBlockDig.class, PacketPlayInBlockDig::new).a(PacketPlayInEntityAction.class, PacketPlayInEntityAction::new).a(PacketPlayInSteerVehicle.class, PacketPlayInSteerVehicle::new).a(PacketPlayInRecipeDisplayed.class, PacketPlayInRecipeDisplayed::new).a(PacketPlayInItemName.class, PacketPlayInItemName::new).a(PacketPlayInResourcePackStatus.class, PacketPlayInResourcePackStatus::new).a(PacketPlayInAdvancements.class, PacketPlayInAdvancements::new).a(PacketPlayInTrSel.class, PacketPlayInTrSel::new).a(PacketPlayInBeacon.class, PacketPlayInBeacon::new).a(PacketPlayInHeldItemSlot.class, PacketPlayInHeldItemSlot::new).a(PacketPlayInSetCommandBlock.class, PacketPlayInSetCommandBlock::new).a(PacketPlayInSetCommandMinecart.class, PacketPlayInSetCommandMinecart::new).a(PacketPlayInSetCreativeSlot.class, PacketPlayInSetCreativeSlot::new).a(PacketPlayInSetJigsaw.class, PacketPlayInSetJigsaw::new).a(PacketPlayInStruct.class, PacketPlayInStruct::new).a(PacketPlayInUpdateSign.class, PacketPlayInUpdateSign::new).a(PacketPlayInArmAnimation.class, PacketPlayInArmAnimation::new).a(PacketPlayInSpectate.class, PacketPlayInSpectate::new).a(PacketPlayInUseItem.class, PacketPlayInUseItem::new).a(PacketPlayInBlockPlace.class, PacketPlayInBlockPlace::new))), STATUS(1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketStatusInStart.class, PacketStatusInStart::new).a(PacketStatusInPing.class, PacketStatusInPing::new)).a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketStatusOutServerInfo.class, PacketStatusOutServerInfo::new).a(PacketStatusOutPong.class, PacketStatusOutPong::new))), LOGIN(2, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketLoginOutDisconnect.class, PacketLoginOutDisconnect::new).a(PacketLoginOutEncryptionBegin.class, PacketLoginOutEncryptionBegin::new).a(PacketLoginOutSuccess.class, PacketLoginOutSuccess::new).a(PacketLoginOutSetCompression.class, PacketLoginOutSetCompression::new).a(PacketLoginOutCustomPayload.class, PacketLoginOutCustomPayload::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketLoginInStart.class, PacketLoginInStart::new).a(PacketLoginInEncryptionBegin.class, PacketLoginInEncryptionBegin::new).a(PacketLoginInCustomPayload.class, PacketLoginInCustomPayload::new)));
-+ HANDSHAKING(-1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a()).a(PacketHandshakingInSetProtocol.class, PacketHandshakingInSetProtocol::new))), PLAY(0, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a()).a(PacketPlayOutSpawnEntity.class, PacketPlayOutSpawnEntity::new).a(PacketPlayOutSpawnEntityExperienceOrb.class, PacketPlayOutSpawnEntityExperienceOrb::new).a(PacketPlayOutSpawnEntityLiving.class, PacketPlayOutSpawnEntityLiving::new).a(PacketPlayOutSpawnEntityPainting.class, PacketPlayOutSpawnEntityPainting::new).a(PacketPlayOutNamedEntitySpawn.class, PacketPlayOutNamedEntitySpawn::new).a(PacketPlayOutAnimation.class, PacketPlayOutAnimation::new).a(PacketPlayOutStatistic.class, PacketPlayOutStatistic::new).a(PacketPlayOutBlockBreak.class, PacketPlayOutBlockBreak::new).a(PacketPlayOutBlockBreakAnimation.class, PacketPlayOutBlockBreakAnimation::new).a(PacketPlayOutTileEntityData.class, PacketPlayOutTileEntityData::new).a(PacketPlayOutBlockAction.class, PacketPlayOutBlockAction::new).a(PacketPlayOutBlockChange.class, PacketPlayOutBlockChange::new).a(PacketPlayOutBoss.class, PacketPlayOutBoss::new).a(PacketPlayOutServerDifficulty.class, PacketPlayOutServerDifficulty::new).a(PacketPlayOutChat.class, PacketPlayOutChat::new).a(PacketPlayOutMultiBlockChange.class, PacketPlayOutMultiBlockChange::new).a(PacketPlayOutTabComplete.class, PacketPlayOutTabComplete::new).a(PacketPlayOutCommands.class, PacketPlayOutCommands::new).a(PacketPlayOutTransaction.class, PacketPlayOutTransaction::new).a(PacketPlayOutCloseWindow.class, PacketPlayOutCloseWindow::new).a(PacketPlayOutWindowItems.class, PacketPlayOutWindowItems::new).a(PacketPlayOutWindowData.class, PacketPlayOutWindowData::new).a(PacketPlayOutSetSlot.class, PacketPlayOutSetSlot::new).a(PacketPlayOutSetCooldown.class, PacketPlayOutSetCooldown::new).a(PacketPlayOutCustomPayload.class, PacketPlayOutCustomPayload::new).a(PacketPlayOutCustomSoundEffect.class, PacketPlayOutCustomSoundEffect::new).a(PacketPlayOutKickDisconnect.class, PacketPlayOutKickDisconnect::new).a(PacketPlayOutEntityStatus.class, PacketPlayOutEntityStatus::new).a(PacketPlayOutExplosion.class, PacketPlayOutExplosion::new).a(PacketPlayOutUnloadChunk.class, PacketPlayOutUnloadChunk::new).a(PacketPlayOutGameStateChange.class, PacketPlayOutGameStateChange::new).a(PacketPlayOutOpenWindowHorse.class, PacketPlayOutOpenWindowHorse::new).a(PacketPlayOutKeepAlive.class, PacketPlayOutKeepAlive::new).a(PacketPlayOutMapChunk.class, PacketPlayOutMapChunk::new).a(PacketPlayOutWorldEvent.class, PacketPlayOutWorldEvent::new).a(PacketPlayOutWorldParticles.class, PacketPlayOutWorldParticles::new).a(PacketPlayOutLightUpdate.class, PacketPlayOutLightUpdate::new).a(PacketPlayOutLogin.class, PacketPlayOutLogin::new).a(PacketPlayOutMap.class, PacketPlayOutMap::new).a(PacketPlayOutOpenWindowMerchant.class, PacketPlayOutOpenWindowMerchant::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMove.class, PacketPlayOutEntity.PacketPlayOutRelEntityMove::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook.class, PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook::new).a(PacketPlayOutEntity.PacketPlayOutEntityLook.class, PacketPlayOutEntity.PacketPlayOutEntityLook::new).a(PacketPlayOutEntity.class, PacketPlayOutEntity::new).a(PacketPlayOutVehicleMove.class, PacketPlayOutVehicleMove::new).a(PacketPlayOutOpenBook.class, PacketPlayOutOpenBook::new).a(PacketPlayOutOpenWindow.class, PacketPlayOutOpenWindow::new).a(PacketPlayOutOpenSignEditor.class, PacketPlayOutOpenSignEditor::new).a(PacketPlayOutAutoRecipe.class, PacketPlayOutAutoRecipe::new).a(PacketPlayOutAbilities.class, PacketPlayOutAbilities::new).a(PacketPlayOutCombatEvent.class, PacketPlayOutCombatEvent::new).a(PacketPlayOutPlayerInfo.class, PacketPlayOutPlayerInfo::new).a(PacketPlayOutLookAt.class, PacketPlayOutLookAt::new).a(PacketPlayOutPosition.class, PacketPlayOutPosition::new).a(PacketPlayOutRecipes.class, PacketPlayOutRecipes::new).a(PacketPlayOutEntityDestroy.class, PacketPlayOutEntityDestroy::new).a(PacketPlayOutRemoveEntityEffect.class, PacketPlayOutRemoveEntityEffect::new).a(PacketPlayOutResourcePackSend.class, PacketPlayOutResourcePackSend::new).a(PacketPlayOutRespawn.class, PacketPlayOutRespawn::new).a(PacketPlayOutEntityHeadRotation.class, PacketPlayOutEntityHeadRotation::new).a(PacketPlayOutSelectAdvancementTab.class, PacketPlayOutSelectAdvancementTab::new).a(PacketPlayOutWorldBorder.class, PacketPlayOutWorldBorder::new).a(PacketPlayOutCamera.class, PacketPlayOutCamera::new).a(PacketPlayOutHeldItemSlot.class, PacketPlayOutHeldItemSlot::new).a(PacketPlayOutViewCentre.class, PacketPlayOutViewCentre::new).a(PacketPlayOutViewDistance.class, PacketPlayOutViewDistance::new).a(PacketPlayOutSpawnPosition.class, PacketPlayOutSpawnPosition::new).a(PacketPlayOutScoreboardDisplayObjective.class, PacketPlayOutScoreboardDisplayObjective::new).a(PacketPlayOutEntityMetadata.class, PacketPlayOutEntityMetadata::new).a(PacketPlayOutAttachEntity.class, PacketPlayOutAttachEntity::new).a(PacketPlayOutEntityVelocity.class, PacketPlayOutEntityVelocity::new).a(PacketPlayOutEntityEquipment.class, PacketPlayOutEntityEquipment::new).a(PacketPlayOutExperience.class, PacketPlayOutExperience::new).a(PacketPlayOutUpdateHealth.class, PacketPlayOutUpdateHealth::new).a(PacketPlayOutScoreboardObjective.class, PacketPlayOutScoreboardObjective::new).a(PacketPlayOutMount.class, PacketPlayOutMount::new).a(PacketPlayOutScoreboardTeam.class, PacketPlayOutScoreboardTeam::new).a(PacketPlayOutScoreboardScore.class, PacketPlayOutScoreboardScore::new).a(PacketPlayOutUpdateTime.class, PacketPlayOutUpdateTime::new).a(PacketPlayOutTitle.class, PacketPlayOutTitle::new).a(PacketPlayOutEntitySound.class, PacketPlayOutEntitySound::new).a(PacketPlayOutNamedSoundEffect.class, PacketPlayOutNamedSoundEffect::new).a(PacketPlayOutStopSound.class, PacketPlayOutStopSound::new).a(PacketPlayOutPlayerListHeaderFooter.class, PacketPlayOutPlayerListHeaderFooter::new).a(PacketPlayOutNBTQuery.class, PacketPlayOutNBTQuery::new).a(PacketPlayOutCollect.class, PacketPlayOutCollect::new).a(PacketPlayOutEntityTeleport.class, PacketPlayOutEntityTeleport::new).a(PacketPlayOutAdvancements.class, PacketPlayOutAdvancements::new).a(PacketPlayOutUpdateAttributes.class, PacketPlayOutUpdateAttributes::new).a(PacketPlayOutEntityEffect.class, PacketPlayOutEntityEffect::new).a(PacketPlayOutRecipeUpdate.class, PacketPlayOutRecipeUpdate::new).a(PacketPlayOutTags.class, PacketPlayOutTags::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a()).a(PacketPlayInTeleportAccept.class, PacketPlayInTeleportAccept::new).a(PacketPlayInTileNBTQuery.class, PacketPlayInTileNBTQuery::new).a(PacketPlayInDifficultyChange.class, PacketPlayInDifficultyChange::new).a(PacketPlayInChat.class, PacketPlayInChat::new).a(PacketPlayInClientCommand.class, PacketPlayInClientCommand::new).a(PacketPlayInSettings.class, PacketPlayInSettings::new).a(PacketPlayInTabComplete.class, PacketPlayInTabComplete::new).a(PacketPlayInTransaction.class, PacketPlayInTransaction::new).a(PacketPlayInEnchantItem.class, PacketPlayInEnchantItem::new).a(PacketPlayInWindowClick.class, PacketPlayInWindowClick::new).a(PacketPlayInCloseWindow.class, PacketPlayInCloseWindow::new).a(PacketPlayInCustomPayload.class, PacketPlayInCustomPayload::new).a(PacketPlayInBEdit.class, PacketPlayInBEdit::new).a(PacketPlayInEntityNBTQuery.class, PacketPlayInEntityNBTQuery::new).a(PacketPlayInUseEntity.class, PacketPlayInUseEntity::new).a(PacketPlayInJigsawGenerate.class, PacketPlayInJigsawGenerate::new).a(PacketPlayInKeepAlive.class, PacketPlayInKeepAlive::new).a(PacketPlayInDifficultyLock.class, PacketPlayInDifficultyLock::new).a(PacketPlayInFlying.PacketPlayInPosition.class, PacketPlayInFlying.PacketPlayInPosition::new).a(PacketPlayInFlying.PacketPlayInPositionLook.class, PacketPlayInFlying.PacketPlayInPositionLook::new).a(PacketPlayInFlying.PacketPlayInLook.class, PacketPlayInFlying.PacketPlayInLook::new).a(PacketPlayInFlying.class, PacketPlayInFlying::new).a(PacketPlayInVehicleMove.class, PacketPlayInVehicleMove::new).a(PacketPlayInBoatMove.class, PacketPlayInBoatMove::new).a(PacketPlayInPickItem.class, PacketPlayInPickItem::new).a(PacketPlayInAutoRecipe.class, PacketPlayInAutoRecipe::new).a(PacketPlayInAbilities.class, PacketPlayInAbilities::new).a(PacketPlayInBlockDig.class, PacketPlayInBlockDig::new).a(PacketPlayInEntityAction.class, PacketPlayInEntityAction::new).a(PacketPlayInSteerVehicle.class, PacketPlayInSteerVehicle::new).a(PacketPlayInRecipeDisplayed.class, PacketPlayInRecipeDisplayed::new).a(PacketPlayInItemName.class, PacketPlayInItemName::new).a(PacketPlayInResourcePackStatus.class, PacketPlayInResourcePackStatus::new).a(PacketPlayInAdvancements.class, PacketPlayInAdvancements::new).a(PacketPlayInTrSel.class, PacketPlayInTrSel::new).a(PacketPlayInBeacon.class, PacketPlayInBeacon::new).a(PacketPlayInHeldItemSlot.class, PacketPlayInHeldItemSlot::new).a(PacketPlayInSetCommandBlock.class, PacketPlayInSetCommandBlock::new).a(PacketPlayInSetCommandMinecart.class, PacketPlayInSetCommandMinecart::new).a(PacketPlayInSetCreativeSlot.class, PacketPlayInSetCreativeSlot::new).a(PacketPlayInSetJigsaw.class, PacketPlayInSetJigsaw::new).a(PacketPlayInStruct.class, PacketPlayInStruct::new).a(PacketPlayInUpdateSign.class, PacketPlayInUpdateSign::new).a(PacketPlayInArmAnimation.class, PacketPlayInArmAnimation::new).a(PacketPlayInSpectate.class, PacketPlayInSpectate::new).a(PacketPlayInUseItem.class, PacketPlayInUseItem::new).a(PacketPlayInBlockPlace.class, PacketPlayInBlockPlace::new))), STATUS(1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a()).a(PacketStatusInStart.class, PacketStatusInStart::new).a(PacketStatusInPing.class, PacketStatusInPing::new)).a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a()).a(PacketStatusOutServerInfo.class, PacketStatusOutServerInfo::new).a(PacketStatusOutPong.class, PacketStatusOutPong::new))), LOGIN(2, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a()).a(PacketLoginOutDisconnect.class, PacketLoginOutDisconnect::new).a(PacketLoginOutEncryptionBegin.class, PacketLoginOutEncryptionBegin::new).a(PacketLoginOutSuccess.class, PacketLoginOutSuccess::new).a(PacketLoginOutSetCompression.class, PacketLoginOutSetCompression::new).a(PacketLoginOutCustomPayload.class, PacketLoginOutCustomPayload::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a()).a(PacketLoginInStart.class, PacketLoginInStart::new).a(PacketLoginInEncryptionBegin.class, PacketLoginInEncryptionBegin::new).a(PacketLoginInCustomPayload.class, PacketLoginInCustomPayload::new))); // Paper - fix decompile error
+- HANDSHAKING(-1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketHandshakingInSetProtocol.class, PacketHandshakingInSetProtocol::new))), PLAY(0, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketPlayOutSpawnEntity.class, PacketPlayOutSpawnEntity::new).a(PacketPlayOutSpawnEntityExperienceOrb.class, PacketPlayOutSpawnEntityExperienceOrb::new).a(PacketPlayOutSpawnEntityLiving.class, PacketPlayOutSpawnEntityLiving::new).a(PacketPlayOutSpawnEntityPainting.class, PacketPlayOutSpawnEntityPainting::new).a(PacketPlayOutNamedEntitySpawn.class, PacketPlayOutNamedEntitySpawn::new).a(PacketPlayOutAnimation.class, PacketPlayOutAnimation::new).a(PacketPlayOutStatistic.class, PacketPlayOutStatistic::new).a(PacketPlayOutBlockBreak.class, PacketPlayOutBlockBreak::new).a(PacketPlayOutBlockBreakAnimation.class, PacketPlayOutBlockBreakAnimation::new).a(PacketPlayOutTileEntityData.class, PacketPlayOutTileEntityData::new).a(PacketPlayOutBlockAction.class, PacketPlayOutBlockAction::new).a(PacketPlayOutBlockChange.class, PacketPlayOutBlockChange::new).a(PacketPlayOutBoss.class, PacketPlayOutBoss::new).a(PacketPlayOutServerDifficulty.class, PacketPlayOutServerDifficulty::new).a(PacketPlayOutChat.class, PacketPlayOutChat::new).a(PacketPlayOutTabComplete.class, PacketPlayOutTabComplete::new).a(PacketPlayOutCommands.class, PacketPlayOutCommands::new).a(PacketPlayOutTransaction.class, PacketPlayOutTransaction::new).a(PacketPlayOutCloseWindow.class, PacketPlayOutCloseWindow::new).a(PacketPlayOutWindowItems.class, PacketPlayOutWindowItems::new).a(PacketPlayOutWindowData.class, PacketPlayOutWindowData::new).a(PacketPlayOutSetSlot.class, PacketPlayOutSetSlot::new).a(PacketPlayOutSetCooldown.class, PacketPlayOutSetCooldown::new).a(PacketPlayOutCustomPayload.class, PacketPlayOutCustomPayload::new).a(PacketPlayOutCustomSoundEffect.class, PacketPlayOutCustomSoundEffect::new).a(PacketPlayOutKickDisconnect.class, PacketPlayOutKickDisconnect::new).a(PacketPlayOutEntityStatus.class, PacketPlayOutEntityStatus::new).a(PacketPlayOutExplosion.class, PacketPlayOutExplosion::new).a(PacketPlayOutUnloadChunk.class, PacketPlayOutUnloadChunk::new).a(PacketPlayOutGameStateChange.class, PacketPlayOutGameStateChange::new).a(PacketPlayOutOpenWindowHorse.class, PacketPlayOutOpenWindowHorse::new).a(PacketPlayOutKeepAlive.class, PacketPlayOutKeepAlive::new).a(PacketPlayOutMapChunk.class, PacketPlayOutMapChunk::new).a(PacketPlayOutWorldEvent.class, PacketPlayOutWorldEvent::new).a(PacketPlayOutWorldParticles.class, PacketPlayOutWorldParticles::new).a(PacketPlayOutLightUpdate.class, PacketPlayOutLightUpdate::new).a(PacketPlayOutLogin.class, PacketPlayOutLogin::new).a(PacketPlayOutMap.class, PacketPlayOutMap::new).a(PacketPlayOutOpenWindowMerchant.class, PacketPlayOutOpenWindowMerchant::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMove.class, PacketPlayOutEntity.PacketPlayOutRelEntityMove::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook.class, PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook::new).a(PacketPlayOutEntity.PacketPlayOutEntityLook.class, PacketPlayOutEntity.PacketPlayOutEntityLook::new).a(PacketPlayOutEntity.class, PacketPlayOutEntity::new).a(PacketPlayOutVehicleMove.class, PacketPlayOutVehicleMove::new).a(PacketPlayOutOpenBook.class, PacketPlayOutOpenBook::new).a(PacketPlayOutOpenWindow.class, PacketPlayOutOpenWindow::new).a(PacketPlayOutOpenSignEditor.class, PacketPlayOutOpenSignEditor::new).a(PacketPlayOutAutoRecipe.class, PacketPlayOutAutoRecipe::new).a(PacketPlayOutAbilities.class, PacketPlayOutAbilities::new).a(PacketPlayOutCombatEvent.class, PacketPlayOutCombatEvent::new).a(PacketPlayOutPlayerInfo.class, PacketPlayOutPlayerInfo::new).a(PacketPlayOutLookAt.class, PacketPlayOutLookAt::new).a(PacketPlayOutPosition.class, PacketPlayOutPosition::new).a(PacketPlayOutRecipes.class, PacketPlayOutRecipes::new).a(PacketPlayOutEntityDestroy.class, PacketPlayOutEntityDestroy::new).a(PacketPlayOutRemoveEntityEffect.class, PacketPlayOutRemoveEntityEffect::new).a(PacketPlayOutResourcePackSend.class, PacketPlayOutResourcePackSend::new).a(PacketPlayOutRespawn.class, PacketPlayOutRespawn::new).a(PacketPlayOutEntityHeadRotation.class, PacketPlayOutEntityHeadRotation::new).a(PacketPlayOutMultiBlockChange.class, PacketPlayOutMultiBlockChange::new).a(PacketPlayOutSelectAdvancementTab.class, PacketPlayOutSelectAdvancementTab::new).a(PacketPlayOutWorldBorder.class, PacketPlayOutWorldBorder::new).a(PacketPlayOutCamera.class, PacketPlayOutCamera::new).a(PacketPlayOutHeldItemSlot.class, PacketPlayOutHeldItemSlot::new).a(PacketPlayOutViewCentre.class, PacketPlayOutViewCentre::new).a(PacketPlayOutViewDistance.class, PacketPlayOutViewDistance::new).a(PacketPlayOutSpawnPosition.class, PacketPlayOutSpawnPosition::new).a(PacketPlayOutScoreboardDisplayObjective.class, PacketPlayOutScoreboardDisplayObjective::new).a(PacketPlayOutEntityMetadata.class, PacketPlayOutEntityMetadata::new).a(PacketPlayOutAttachEntity.class, PacketPlayOutAttachEntity::new).a(PacketPlayOutEntityVelocity.class, PacketPlayOutEntityVelocity::new).a(PacketPlayOutEntityEquipment.class, PacketPlayOutEntityEquipment::new).a(PacketPlayOutExperience.class, PacketPlayOutExperience::new).a(PacketPlayOutUpdateHealth.class, PacketPlayOutUpdateHealth::new).a(PacketPlayOutScoreboardObjective.class, PacketPlayOutScoreboardObjective::new).a(PacketPlayOutMount.class, PacketPlayOutMount::new).a(PacketPlayOutScoreboardTeam.class, PacketPlayOutScoreboardTeam::new).a(PacketPlayOutScoreboardScore.class, PacketPlayOutScoreboardScore::new).a(PacketPlayOutUpdateTime.class, PacketPlayOutUpdateTime::new).a(PacketPlayOutTitle.class, PacketPlayOutTitle::new).a(PacketPlayOutEntitySound.class, PacketPlayOutEntitySound::new).a(PacketPlayOutNamedSoundEffect.class, PacketPlayOutNamedSoundEffect::new).a(PacketPlayOutStopSound.class, PacketPlayOutStopSound::new).a(PacketPlayOutPlayerListHeaderFooter.class, PacketPlayOutPlayerListHeaderFooter::new).a(PacketPlayOutNBTQuery.class, PacketPlayOutNBTQuery::new).a(PacketPlayOutCollect.class, PacketPlayOutCollect::new).a(PacketPlayOutEntityTeleport.class, PacketPlayOutEntityTeleport::new).a(PacketPlayOutAdvancements.class, PacketPlayOutAdvancements::new).a(PacketPlayOutUpdateAttributes.class, PacketPlayOutUpdateAttributes::new).a(PacketPlayOutEntityEffect.class, PacketPlayOutEntityEffect::new).a(PacketPlayOutRecipeUpdate.class, PacketPlayOutRecipeUpdate::new).a(PacketPlayOutTags.class, PacketPlayOutTags::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketPlayInTeleportAccept.class, PacketPlayInTeleportAccept::new).a(PacketPlayInTileNBTQuery.class, PacketPlayInTileNBTQuery::new).a(PacketPlayInDifficultyChange.class, PacketPlayInDifficultyChange::new).a(PacketPlayInChat.class, PacketPlayInChat::new).a(PacketPlayInClientCommand.class, PacketPlayInClientCommand::new).a(PacketPlayInSettings.class, PacketPlayInSettings::new).a(PacketPlayInTabComplete.class, PacketPlayInTabComplete::new).a(PacketPlayInTransaction.class, PacketPlayInTransaction::new).a(PacketPlayInEnchantItem.class, PacketPlayInEnchantItem::new).a(PacketPlayInWindowClick.class, PacketPlayInWindowClick::new).a(PacketPlayInCloseWindow.class, PacketPlayInCloseWindow::new).a(PacketPlayInCustomPayload.class, PacketPlayInCustomPayload::new).a(PacketPlayInBEdit.class, PacketPlayInBEdit::new).a(PacketPlayInEntityNBTQuery.class, PacketPlayInEntityNBTQuery::new).a(PacketPlayInUseEntity.class, PacketPlayInUseEntity::new).a(PacketPlayInJigsawGenerate.class, PacketPlayInJigsawGenerate::new).a(PacketPlayInKeepAlive.class, PacketPlayInKeepAlive::new).a(PacketPlayInDifficultyLock.class, PacketPlayInDifficultyLock::new).a(PacketPlayInFlying.PacketPlayInPosition.class, PacketPlayInFlying.PacketPlayInPosition::new).a(PacketPlayInFlying.PacketPlayInPositionLook.class, PacketPlayInFlying.PacketPlayInPositionLook::new).a(PacketPlayInFlying.PacketPlayInLook.class, PacketPlayInFlying.PacketPlayInLook::new).a(PacketPlayInFlying.class, PacketPlayInFlying::new).a(PacketPlayInVehicleMove.class, PacketPlayInVehicleMove::new).a(PacketPlayInBoatMove.class, PacketPlayInBoatMove::new).a(PacketPlayInPickItem.class, PacketPlayInPickItem::new).a(PacketPlayInAutoRecipe.class, PacketPlayInAutoRecipe::new).a(PacketPlayInAbilities.class, PacketPlayInAbilities::new).a(PacketPlayInBlockDig.class, PacketPlayInBlockDig::new).a(PacketPlayInEntityAction.class, PacketPlayInEntityAction::new).a(PacketPlayInSteerVehicle.class, PacketPlayInSteerVehicle::new).a(PacketPlayInRecipeSettings.class, PacketPlayInRecipeSettings::new).a(PacketPlayInRecipeDisplayed.class, PacketPlayInRecipeDisplayed::new).a(PacketPlayInItemName.class, PacketPlayInItemName::new).a(PacketPlayInResourcePackStatus.class, PacketPlayInResourcePackStatus::new).a(PacketPlayInAdvancements.class, PacketPlayInAdvancements::new).a(PacketPlayInTrSel.class, PacketPlayInTrSel::new).a(PacketPlayInBeacon.class, PacketPlayInBeacon::new).a(PacketPlayInHeldItemSlot.class, PacketPlayInHeldItemSlot::new).a(PacketPlayInSetCommandBlock.class, PacketPlayInSetCommandBlock::new).a(PacketPlayInSetCommandMinecart.class, PacketPlayInSetCommandMinecart::new).a(PacketPlayInSetCreativeSlot.class, PacketPlayInSetCreativeSlot::new).a(PacketPlayInSetJigsaw.class, PacketPlayInSetJigsaw::new).a(PacketPlayInStruct.class, PacketPlayInStruct::new).a(PacketPlayInUpdateSign.class, PacketPlayInUpdateSign::new).a(PacketPlayInArmAnimation.class, PacketPlayInArmAnimation::new).a(PacketPlayInSpectate.class, PacketPlayInSpectate::new).a(PacketPlayInUseItem.class, PacketPlayInUseItem::new).a(PacketPlayInBlockPlace.class, PacketPlayInBlockPlace::new))), STATUS(1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketStatusInStart.class, PacketStatusInStart::new).a(PacketStatusInPing.class, PacketStatusInPing::new)).a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketStatusOutServerInfo.class, PacketStatusOutServerInfo::new).a(PacketStatusOutPong.class, PacketStatusOutPong::new))), LOGIN(2, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketLoginOutDisconnect.class, PacketLoginOutDisconnect::new).a(PacketLoginOutEncryptionBegin.class, PacketLoginOutEncryptionBegin::new).a(PacketLoginOutSuccess.class, PacketLoginOutSuccess::new).a(PacketLoginOutSetCompression.class, PacketLoginOutSetCompression::new).a(PacketLoginOutCustomPayload.class, PacketLoginOutCustomPayload::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketLoginInStart.class, PacketLoginInStart::new).a(PacketLoginInEncryptionBegin.class, PacketLoginInEncryptionBegin::new).a(PacketLoginInCustomPayload.class, PacketLoginInCustomPayload::new)));
++ // Paper - fix decompile error - add generic names to < > like PacketListenerPlayOut
++ HANDSHAKING(-1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a()).a(PacketHandshakingInSetProtocol.class, PacketHandshakingInSetProtocol::new))), PLAY(0, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a()).a(PacketPlayOutSpawnEntity.class, PacketPlayOutSpawnEntity::new).a(PacketPlayOutSpawnEntityExperienceOrb.class, PacketPlayOutSpawnEntityExperienceOrb::new).a(PacketPlayOutSpawnEntityLiving.class, PacketPlayOutSpawnEntityLiving::new).a(PacketPlayOutSpawnEntityPainting.class, PacketPlayOutSpawnEntityPainting::new).a(PacketPlayOutNamedEntitySpawn.class, PacketPlayOutNamedEntitySpawn::new).a(PacketPlayOutAnimation.class, PacketPlayOutAnimation::new).a(PacketPlayOutStatistic.class, PacketPlayOutStatistic::new).a(PacketPlayOutBlockBreak.class, PacketPlayOutBlockBreak::new).a(PacketPlayOutBlockBreakAnimation.class, PacketPlayOutBlockBreakAnimation::new).a(PacketPlayOutTileEntityData.class, PacketPlayOutTileEntityData::new).a(PacketPlayOutBlockAction.class, PacketPlayOutBlockAction::new).a(PacketPlayOutBlockChange.class, PacketPlayOutBlockChange::new).a(PacketPlayOutBoss.class, PacketPlayOutBoss::new).a(PacketPlayOutServerDifficulty.class, PacketPlayOutServerDifficulty::new).a(PacketPlayOutChat.class, PacketPlayOutChat::new).a(PacketPlayOutTabComplete.class, PacketPlayOutTabComplete::new).a(PacketPlayOutCommands.class, PacketPlayOutCommands::new).a(PacketPlayOutTransaction.class, PacketPlayOutTransaction::new).a(PacketPlayOutCloseWindow.class, PacketPlayOutCloseWindow::new).a(PacketPlayOutWindowItems.class, PacketPlayOutWindowItems::new).a(PacketPlayOutWindowData.class, PacketPlayOutWindowData::new).a(PacketPlayOutSetSlot.class, PacketPlayOutSetSlot::new).a(PacketPlayOutSetCooldown.class, PacketPlayOutSetCooldown::new).a(PacketPlayOutCustomPayload.class, PacketPlayOutCustomPayload::new).a(PacketPlayOutCustomSoundEffect.class, PacketPlayOutCustomSoundEffect::new).a(PacketPlayOutKickDisconnect.class, PacketPlayOutKickDisconnect::new).a(PacketPlayOutEntityStatus.class, PacketPlayOutEntityStatus::new).a(PacketPlayOutExplosion.class, PacketPlayOutExplosion::new).a(PacketPlayOutUnloadChunk.class, PacketPlayOutUnloadChunk::new).a(PacketPlayOutGameStateChange.class, PacketPlayOutGameStateChange::new).a(PacketPlayOutOpenWindowHorse.class, PacketPlayOutOpenWindowHorse::new).a(PacketPlayOutKeepAlive.class, PacketPlayOutKeepAlive::new).a(PacketPlayOutMapChunk.class, PacketPlayOutMapChunk::new).a(PacketPlayOutWorldEvent.class, PacketPlayOutWorldEvent::new).a(PacketPlayOutWorldParticles.class, PacketPlayOutWorldParticles::new).a(PacketPlayOutLightUpdate.class, PacketPlayOutLightUpdate::new).a(PacketPlayOutLogin.class, PacketPlayOutLogin::new).a(PacketPlayOutMap.class, PacketPlayOutMap::new).a(PacketPlayOutOpenWindowMerchant.class, PacketPlayOutOpenWindowMerchant::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMove.class, PacketPlayOutEntity.PacketPlayOutRelEntityMove::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook.class, PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook::new).a(PacketPlayOutEntity.PacketPlayOutEntityLook.class, PacketPlayOutEntity.PacketPlayOutEntityLook::new).a(PacketPlayOutEntity.class, PacketPlayOutEntity::new).a(PacketPlayOutVehicleMove.class, PacketPlayOutVehicleMove::new).a(PacketPlayOutOpenBook.class, PacketPlayOutOpenBook::new).a(PacketPlayOutOpenWindow.class, PacketPlayOutOpenWindow::new).a(PacketPlayOutOpenSignEditor.class, PacketPlayOutOpenSignEditor::new).a(PacketPlayOutAutoRecipe.class, PacketPlayOutAutoRecipe::new).a(PacketPlayOutAbilities.class, PacketPlayOutAbilities::new).a(PacketPlayOutCombatEvent.class, PacketPlayOutCombatEvent::new).a(PacketPlayOutPlayerInfo.class, PacketPlayOutPlayerInfo::new).a(PacketPlayOutLookAt.class, PacketPlayOutLookAt::new).a(PacketPlayOutPosition.class, PacketPlayOutPosition::new).a(PacketPlayOutRecipes.class, PacketPlayOutRecipes::new).a(PacketPlayOutEntityDestroy.class, PacketPlayOutEntityDestroy::new).a(PacketPlayOutRemoveEntityEffect.class, PacketPlayOutRemoveEntityEffect::new).a(PacketPlayOutResourcePackSend.class, PacketPlayOutResourcePackSend::new).a(PacketPlayOutRespawn.class, PacketPlayOutRespawn::new).a(PacketPlayOutEntityHeadRotation.class, PacketPlayOutEntityHeadRotation::new).a(PacketPlayOutMultiBlockChange.class, PacketPlayOutMultiBlockChange::new).a(PacketPlayOutSelectAdvancementTab.class, PacketPlayOutSelectAdvancementTab::new).a(PacketPlayOutWorldBorder.class, PacketPlayOutWorldBorder::new).a(PacketPlayOutCamera.class, PacketPlayOutCamera::new).a(PacketPlayOutHeldItemSlot.class, PacketPlayOutHeldItemSlot::new).a(PacketPlayOutViewCentre.class, PacketPlayOutViewCentre::new).a(PacketPlayOutViewDistance.class, PacketPlayOutViewDistance::new).a(PacketPlayOutSpawnPosition.class, PacketPlayOutSpawnPosition::new).a(PacketPlayOutScoreboardDisplayObjective.class, PacketPlayOutScoreboardDisplayObjective::new).a(PacketPlayOutEntityMetadata.class, PacketPlayOutEntityMetadata::new).a(PacketPlayOutAttachEntity.class, PacketPlayOutAttachEntity::new).a(PacketPlayOutEntityVelocity.class, PacketPlayOutEntityVelocity::new).a(PacketPlayOutEntityEquipment.class, PacketPlayOutEntityEquipment::new).a(PacketPlayOutExperience.class, PacketPlayOutExperience::new).a(PacketPlayOutUpdateHealth.class, PacketPlayOutUpdateHealth::new).a(PacketPlayOutScoreboardObjective.class, PacketPlayOutScoreboardObjective::new).a(PacketPlayOutMount.class, PacketPlayOutMount::new).a(PacketPlayOutScoreboardTeam.class, PacketPlayOutScoreboardTeam::new).a(PacketPlayOutScoreboardScore.class, PacketPlayOutScoreboardScore::new).a(PacketPlayOutUpdateTime.class, PacketPlayOutUpdateTime::new).a(PacketPlayOutTitle.class, PacketPlayOutTitle::new).a(PacketPlayOutEntitySound.class, PacketPlayOutEntitySound::new).a(PacketPlayOutNamedSoundEffect.class, PacketPlayOutNamedSoundEffect::new).a(PacketPlayOutStopSound.class, PacketPlayOutStopSound::new).a(PacketPlayOutPlayerListHeaderFooter.class, PacketPlayOutPlayerListHeaderFooter::new).a(PacketPlayOutNBTQuery.class, PacketPlayOutNBTQuery::new).a(PacketPlayOutCollect.class, PacketPlayOutCollect::new).a(PacketPlayOutEntityTeleport.class, PacketPlayOutEntityTeleport::new).a(PacketPlayOutAdvancements.class, PacketPlayOutAdvancements::new).a(PacketPlayOutUpdateAttributes.class, PacketPlayOutUpdateAttributes::new).a(PacketPlayOutEntityEffect.class, PacketPlayOutEntityEffect::new).a(PacketPlayOutRecipeUpdate.class, PacketPlayOutRecipeUpdate::new).a(PacketPlayOutTags.class, PacketPlayOutTags::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a()).a(PacketPlayInTeleportAccept.class, PacketPlayInTeleportAccept::new).a(PacketPlayInTileNBTQuery.class, PacketPlayInTileNBTQuery::new).a(PacketPlayInDifficultyChange.class, PacketPlayInDifficultyChange::new).a(PacketPlayInChat.class, PacketPlayInChat::new).a(PacketPlayInClientCommand.class, PacketPlayInClientCommand::new).a(PacketPlayInSettings.class, PacketPlayInSettings::new).a(PacketPlayInTabComplete.class, PacketPlayInTabComplete::new).a(PacketPlayInTransaction.class, PacketPlayInTransaction::new).a(PacketPlayInEnchantItem.class, PacketPlayInEnchantItem::new).a(PacketPlayInWindowClick.class, PacketPlayInWindowClick::new).a(PacketPlayInCloseWindow.class, PacketPlayInCloseWindow::new).a(PacketPlayInCustomPayload.class, PacketPlayInCustomPayload::new).a(PacketPlayInBEdit.class, PacketPlayInBEdit::new).a(PacketPlayInEntityNBTQuery.class, PacketPlayInEntityNBTQuery::new).a(PacketPlayInUseEntity.class, PacketPlayInUseEntity::new).a(PacketPlayInJigsawGenerate.class, PacketPlayInJigsawGenerate::new).a(PacketPlayInKeepAlive.class, PacketPlayInKeepAlive::new).a(PacketPlayInDifficultyLock.class, PacketPlayInDifficultyLock::new).a(PacketPlayInFlying.PacketPlayInPosition.class, PacketPlayInFlying.PacketPlayInPosition::new).a(PacketPlayInFlying.PacketPlayInPositionLook.class, PacketPlayInFlying.PacketPlayInPositionLook::new).a(PacketPlayInFlying.PacketPlayInLook.class, PacketPlayInFlying.PacketPlayInLook::new).a(PacketPlayInFlying.class, PacketPlayInFlying::new).a(PacketPlayInVehicleMove.class, PacketPlayInVehicleMove::new).a(PacketPlayInBoatMove.class, PacketPlayInBoatMove::new).a(PacketPlayInPickItem.class, PacketPlayInPickItem::new).a(PacketPlayInAutoRecipe.class, PacketPlayInAutoRecipe::new).a(PacketPlayInAbilities.class, PacketPlayInAbilities::new).a(PacketPlayInBlockDig.class, PacketPlayInBlockDig::new).a(PacketPlayInEntityAction.class, PacketPlayInEntityAction::new).a(PacketPlayInSteerVehicle.class, PacketPlayInSteerVehicle::new).a(PacketPlayInRecipeSettings.class, PacketPlayInRecipeSettings::new).a(PacketPlayInRecipeDisplayed.class, PacketPlayInRecipeDisplayed::new).a(PacketPlayInItemName.class, PacketPlayInItemName::new).a(PacketPlayInResourcePackStatus.class, PacketPlayInResourcePackStatus::new).a(PacketPlayInAdvancements.class, PacketPlayInAdvancements::new).a(PacketPlayInTrSel.class, PacketPlayInTrSel::new).a(PacketPlayInBeacon.class, PacketPlayInBeacon::new).a(PacketPlayInHeldItemSlot.class, PacketPlayInHeldItemSlot::new).a(PacketPlayInSetCommandBlock.class, PacketPlayInSetCommandBlock::new).a(PacketPlayInSetCommandMinecart.class, PacketPlayInSetCommandMinecart::new).a(PacketPlayInSetCreativeSlot.class, PacketPlayInSetCreativeSlot::new).a(PacketPlayInSetJigsaw.class, PacketPlayInSetJigsaw::new).a(PacketPlayInStruct.class, PacketPlayInStruct::new).a(PacketPlayInUpdateSign.class, PacketPlayInUpdateSign::new).a(PacketPlayInArmAnimation.class, PacketPlayInArmAnimation::new).a(PacketPlayInSpectate.class, PacketPlayInSpectate::new).a(PacketPlayInUseItem.class, PacketPlayInUseItem::new).a(PacketPlayInBlockPlace.class, PacketPlayInBlockPlace::new))), STATUS(1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a()).a(PacketStatusInStart.class, PacketStatusInStart::new).a(PacketStatusInPing.class, PacketStatusInPing::new)).a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a()).a(PacketStatusOutServerInfo.class, PacketStatusOutServerInfo::new).a(PacketStatusOutPong.class, PacketStatusOutPong::new))), LOGIN(2, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a()).a(PacketLoginOutDisconnect.class, PacketLoginOutDisconnect::new).a(PacketLoginOutEncryptionBegin.class, PacketLoginOutEncryptionBegin::new).a(PacketLoginOutSuccess.class, PacketLoginOutSuccess::new).a(PacketLoginOutSetCompression.class, PacketLoginOutSetCompression::new).a(PacketLoginOutCustomPayload.class, PacketLoginOutCustomPayload::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a()).a(PacketLoginInStart.class, PacketLoginInStart::new).a(PacketLoginInEncryptionBegin.class, PacketLoginInEncryptionBegin::new).a(PacketLoginInCustomPayload.class, PacketLoginInCustomPayload::new)));
private static final EnumProtocol[] e = new EnumProtocol[4];
private static final Map>, EnumProtocol> f = Maps.newHashMap();
@@ -357,6 +247,65 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return true;
}
}
+diff --git a/src/main/java/net/minecraft/server/IBlockDataHolder.java b/src/main/java/net/minecraft/server/IBlockDataHolder.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/IBlockDataHolder.java
++++ b/src/main/java/net/minecraft/server/IBlockDataHolder.java
+@@ -0,0 +0,0 @@ public abstract class IBlockDataHolder {
+ } else {
+ IBlockState> iblockstate = (IBlockState) entry.getKey();
+
+- return iblockstate.getName() + "=" + this.a(iblockstate, (Comparable) entry.getValue());
++ return iblockstate.getName() + "=" + this.a((IBlockState) iblockstate, (Comparable) entry.getValue()); // Paper - decompile fix
+ }
+ }
+
+- private > String a(IBlockState iblockstate, Comparable> comparable) {
++ private > String a(IBlockState iblockstate, T comparable) { // Paper - decompile error
+ return iblockstate.a(comparable);
+ }
+ };
+@@ -0,0 +0,0 @@ public abstract class IBlockDataHolder {
+ }
+
+ public > S a(IBlockState iblockstate) {
+- return this.set(iblockstate, (Comparable) a(iblockstate.getValues(), (Object) this.get(iblockstate)));
++ return this.set(iblockstate, a(iblockstate.getValues(), this.get(iblockstate))); // Paper - decompile error
+ }
+
+ protected static T a(Collection collection, T t0) {
+- Iterator iterator = collection.iterator();
++ Iterator iterator = collection.iterator(); // Paper
+
+ do {
+ if (!iterator.hasNext()) {
+@@ -0,0 +0,0 @@ public abstract class IBlockDataHolder {
+ if (comparable == null) {
+ throw new IllegalArgumentException("Cannot get property " + iblockstate + " as it does not exist in " + this.c);
+ } else {
+- return (Comparable) iblockstate.getType().cast(comparable);
++ return iblockstate.getType().cast(comparable); // Paper - decompile error
+ }
+ }
+
+@@ -0,0 +0,0 @@ public abstract class IBlockDataHolder {
+ if (comparable == null) {
+ throw new IllegalArgumentException("Cannot set property " + iblockstate + " as it does not exist in " + this.c);
+ } else if (comparable == v0) {
+- return this;
++ return (S) this; // Paper - decompile error
+ } else {
+ S s0 = this.e.get(iblockstate, v0);
+
+@@ -0,0 +0,0 @@ public abstract class IBlockDataHolder {
+ return codec.dispatch("Name", (iblockdataholder) -> {
+ return iblockdataholder.c;
+ }, (object) -> {
+- S s0 = (IBlockDataHolder) function.apply(object);
++ S s0 = function.apply(object); // Paper - decompile error
+
+ return s0.getStateMap().isEmpty() ? Codec.unit(s0) : s0.d.fieldOf("Properties").codec();
+ });
diff --git a/src/main/java/net/minecraft/server/IBlockState.java b/src/main/java/net/minecraft/server/IBlockState.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/IBlockState.java
@@ -408,7 +357,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ T t1 = iterator.next(); // Paper - decompile fix
if (pathfindertargetcondition.a(entityliving, t1)) {
- double d4 = t1.g(d0, d1, d2);
+ double d4 = t1.h(d0, d1, d2);
@@ -0,0 +0,0 @@ public interface IEntityAccess {
default List a(Class extends T> oclass, PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, AxisAlignedBB axisalignedbb) {
List list = this.a(oclass, axisalignedbb, (Predicate) null);
@@ -633,6 +582,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
this.c.set(i, t0);
+@@ -0,0 +0,0 @@ public class RegistryBlockID implements Registry {
+ this.a(t0, this.a);
+ }
+
++ // Paper start - decompile fix
++ @Override
++ public int a(T t) {
++ return getId(t);
++ }
++ // Paper end
++
+ public int getId(T t0) {
+ Integer integer = (Integer) this.b.get(t0);
+
diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/RegistryID.java
@@ -648,7 +611,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.d = (K[]) (new Object[i]); // Paper - decompile fix
}
++ // Paper start - decompile fix
++ @Override
++ public int a(K k) {
++ return getId(k);
++ }
++ // Paper end
++
public int getId(@Nullable K k0) {
+ return this.c(this.b(k0, this.d(k0)));
+ }
@@ -0,0 +0,0 @@ public class RegistryID implements Registry {
K[] ak = this.b;
int[] aint = this.c;
@@ -661,11 +633,31 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.e = 0;
this.f = 0;
+diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java
+index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+--- a/src/main/java/net/minecraft/server/ServerStatisticManager.java
++++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java
+@@ -0,0 +0,0 @@ public class ServerStatisticManager extends StatisticManager {
+ ObjectIterator objectiterator = this.a.object2IntEntrySet().iterator();
+
+ while (objectiterator.hasNext()) {
+- it.unimi.dsi.fastutil.objects.Object2IntMap.Entry> it_unimi_dsi_fastutil_objects_object2intmap_entry = (it.unimi.dsi.fastutil.objects.Object2IntMap.Entry) objectiterator.next();
++ Object2IntMap.Entry> it_unimi_dsi_fastutil_objects_object2intmap_entry = (Object2IntMap.Entry) objectiterator.next(); // Paper - decompile fix
+ Statistic> statistic = (Statistic) it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey();
+
+ ((JsonObject) map.computeIfAbsent(statistic.getWrapper(), (statisticwrapper) -> {
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
@@ -0,0 +0,0 @@ public abstract class StructureGenerator
+ public static final StructureGenerator BASTION_REMNANT = a("Bastion_Remnant", new WorldGenFeatureBastionRemnant(WorldGenFeatureVillageConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES);
+ public static final List> t = ImmutableList.of(StructureGenerator.PILLAGER_OUTPOST, StructureGenerator.VILLAGE, StructureGenerator.NETHER_FOSSIL);
+ private static final MinecraftKey w = new MinecraftKey("jigsaw");
+- private static final Map x = ImmutableMap.builder().put(new MinecraftKey("nvi"), StructureGenerator.w).put(new MinecraftKey("pcp"), StructureGenerator.w).put(new MinecraftKey("bastionremnant"), StructureGenerator.w).put(new MinecraftKey("runtime"), StructureGenerator.w).build();
++ private static final Map x = ImmutableMap.builder().put(new MinecraftKey("nvi"), StructureGenerator.w).put(new MinecraftKey("pcp"), StructureGenerator.w).put(new MinecraftKey("bastionremnant"), StructureGenerator.w).put(new MinecraftKey("runtime"), StructureGenerator.w).build(); // Paper - decompile fix
+ private final Codec>> y;
+
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);
@@ -802,15 +794,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- 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.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.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.rn, 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.rn, 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 - add to ImmutableMap..builder()
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.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.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.rk, 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.rk, 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())); // Paper - add to ImmutableMap..builder()
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.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)})));
+ 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.rj), 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java
diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch
index 68d687af01..e5b676708e 100644
--- a/Spigot-Server-Patches/MC-Utils.patch
+++ b/Spigot-Server-Patches/MC-Utils.patch
@@ -2336,13 +2336,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/BlockBase.java
+++ b/src/main/java/net/minecraft/server/BlockBase.java
@@ -0,0 +0,0 @@ public abstract class BlockBase {
- return this.a != null ? this.a.e : Block.a(this.getCollisionShape(iblockaccess, blockposition));
+ return this.a != null ? this.a.d : Block.a(this.getCollisionShape(iblockaccess, blockposition));
}
+ public final IBlockData getBlockData() { return p(); } // Paper - OBFHELPER
protected abstract IBlockData p();
- public boolean isAlwaysDestroyable() {
+ public boolean isRequiresSpecialTool() {
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
@@ -2729,6 +2729,17 @@ diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/m
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
+@@ -0,0 +0,0 @@ import java.util.function.Consumer;
+ import java.util.function.Function;
+ import java.util.function.Supplier;
+ import javax.annotation.Nullable;
++import com.destroystokyo.paper.exception.ServerInternalException;
++import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper
++import org.apache.logging.log4j.LogManager;
++import org.apache.logging.log4j.Logger;
+
+ public class ChunkProviderServer extends IChunkProvider {
+
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
private final ChunkMapDistance chunkMapDistance;
public final ChunkGenerator chunkGenerator;
@@ -2744,7 +2755,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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);
++ final Long2ObjectOpenHashMap loadedChunkMap = new Long2ObjectOpenHashMap<>(8192, 0.5f);
+
+ private final Chunk[] lastLoadedChunks = new Chunk[4 * 4];
+ private final long[] lastLoadedChunkKeys = new long[4 * 4];
@@ -3053,30 +3064,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void b(PacketDataSerializer packetdataserializer) {
this.a();
packetdataserializer.writeByte(this.i);
-diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/Entity.java
-+++ b/src/main/java/net/minecraft/server/Entity.java
-@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
-
- }
-
-- @Nullable
-- public AxisAlignedBB ay() {
-+
-+ @Nullable public final AxisAlignedBB getCollisionBox(){return ay();} //Paper - OBFHELPER
-+ @Nullable public AxisAlignedBB ay() {
- return null;
- }
-
-@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
- return EnumInteractionResult.PASS;
- }
-
-+ public final AxisAlignedBB getHardCollisionBox(Entity entity){ return j(entity);}//Paper - OBFHELPER
- @Nullable
- 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityCreature.java
@@ -3137,11 +3124,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper
+
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
- super(worldserver, worldserver.getSpawn(), gameprofile);
+ super(worldserver, worldserver.getSpawn(), worldserver.v(), gameprofile);
this.spawnDimension = World.OVERWORLD;
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.G = 1.0F;
- this.b(worldserver);
+ this.c(worldserver);
+ this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
+
@@ -3161,14 +3148,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.function.Function;
import java.util.stream.Stream;
@@ -0,0 +0,0 @@ public class EntityTypes {
- return this.bq.height;
+ return this.br.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.be.create(this, world);
+ return this.bf.create(this, world);
}
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
@@ -3196,16 +3183,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/IBlockAccess.java
+++ b/src/main/java/net/minecraft/server/IBlockAccess.java
@@ -0,0 +0,0 @@ public interface IBlockAccess {
- @Nullable
TileEntity getTileEntity(BlockPosition blockposition);
-+ IBlockData getTypeIfLoaded(BlockPosition blockposition); // Paper - if loaded util
IBlockData getType(BlockPosition blockposition);
-
-+ Fluid getFluidIfLoaded(BlockPosition blockposition); // Paper - if loaded util
- Fluid getFluid(BlockPosition blockposition);
-
+ // Paper start - if loaded util
++ IBlockData getTypeIfLoaded(BlockPosition blockposition);
+ default Material getMaterialIfLoaded(BlockPosition blockposition) {
+ IBlockData type = this.getTypeIfLoaded(blockposition);
+ return type == null ? null : type.getMaterial();
@@ -3215,11 +3197,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ IBlockData type = this.getTypeIfLoaded(blockposition);
+ return type == null ? null : type.getBlock();
+ }
++ Fluid getFluidIfLoaded(BlockPosition blockposition);
+ // Paper end
-+
- default int h(BlockPosition blockposition) {
- return this.getType(blockposition).f();
- }
+
+ Fluid getFluid(BlockPosition blockposition);
+
diff --git a/src/main/java/net/minecraft/server/IOWorker.java b/src/main/java/net/minecraft/server/IOWorker.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/IOWorker.java
@@ -3309,6 +3291,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+import com.destroystokyo.paper.block.TargetBlockInfo;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
++import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet;
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.bukkit.Location;
+import org.bukkit.block.BlockFace;
@@ -3517,7 +3500,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ // assumes the sets have the same comparator, and if this comparator is null then assume T is Comparable
+ public static void mergeSortedSets(final java.util.function.Consumer consumer, final java.util.Comparator super T> comparator, final java.util.SortedSet...sets) {
-+ final it.unimi.dsi.fastutil.objects.ObjectRBTreeSet all = new it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<>(comparator);
++ final ObjectRBTreeSet all = new ObjectRBTreeSet<>(comparator);
+ // note: this is done in log(n!) ~ nlogn time. It could be improved if it were to mimic what mergesort does.
+ for (java.util.SortedSet set : sets) {
+ if (set != null) {
@@ -3820,7 +3803,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } catch (java.lang.InterruptedException ignored) {} // Paper
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
LOGGER.info("Saving usercache.json");
- this.getUserCache().c();
+ this.getUserCache().b();
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/NBTTagCompound.java
@@ -3865,8 +3848,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
-+ private void sendPacketQueue() { this.o(); } // Paper - OBFHELPER
- private void o() {
++ private void sendPacketQueue() { this.p(); } // Paper - OBFHELPER
+ private void p() {
if (this.channel != null && this.channel.isOpen()) {
Queue queue = this.packetQueue;
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> {
@@ -3912,12 +3895,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet {
private NBTTagCompound d;
@Nullable
- private BiomeStorage e;
+ private int[] e;
- private byte[] f;
+ private byte[] f; private byte[] getData() { return this.f; } // Paper - OBFHELPER
private List g;
private boolean h;
- private boolean i;
+
@@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet {
return bytebuf;
}
@@ -3944,8 +3927,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public int oldTicketLevel;
private int ticketLevel;
@@ -0,0 +0,0 @@ public class PlayerChunk {
- public final PlayerChunk.d players;
private boolean hasBeenLoaded;
+ private boolean x;
+ private final PlayerChunkMap chunkMap; // Paper
+
@@ -4090,7 +4073,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@@ -0,0 +0,0 @@ public class PlayerChunk {
- throw (IllegalStateException) SystemUtils.c(new IllegalStateException());
+ throw (IllegalStateException) SystemUtils.c((Throwable) (new IllegalStateException()));
}
- this.entityTickingFuture = playerchunkmap.b(this.location);
@@ -4168,7 +4151,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+ this.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps
} else {
- SectionPosition sectionposition = entityplayer.N();
+ SectionPosition sectionposition = entityplayer.O();
@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (!flag2) {
@@ -4257,7 +4240,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
- return this.d.resolve(s);
+ return this.e.resolve(s);
}
+ @Nullable public synchronized DataInputStream getReadStream(ChunkCoordIntPair chunkCoordIntPair) throws IOException { return a(chunkCoordIntPair);} // Paper - OBFHELPER
@@ -4363,7 +4346,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit end
@@ -0,0 +0,0 @@ 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) {
+ protected World(WorldDataMutable worlddatamutable, ResourceKey