diff --git a/gradle.properties b/gradle.properties index 186db47..38d2cf1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = org.plazmamc.plazma -version = 1.19.3-R0.1-SNAPSHOT +version = 1.19.4-R0.1-SNAPSHOT -paperCommit = 155aa36d89b260ef5841615899299756b5983c0a +paperCommit = e8b82590d0c3dd57ac1728b236117d2fcd531c4f org.gradle.caching = true org.gradle.parallel = true diff --git a/patches/api/0001-Pufferfish-API-Changes.patch b/patches/api/0001-Pufferfish-API-Changes.patch index dddfffd..0a7dd13 100644 --- a/patches/api/0001-Pufferfish-API-Changes.patch +++ b/patches/api/0001-Pufferfish-API-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 -Date: Wed, 15 Mar 2023 05:19:29 +0000 +Date: Thu, 23 Mar 2023 10:28:40 +0900 Subject: [PATCH] Pufferfish API Changes Original: Kevin Raneri @@ -20,10 +20,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/build.gradle.kts b/build.gradle.kts -index 9421e45653e68922a51cf0071792e6fa7999d0b8..181e9cd8623995f40e696ccfe49754dc340405d8 100644 +index cad12a2632b9ebb569280441c42869685db1f31a..b83e2c5a0a094002d12aee55ec0cf8d12bf33f3e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -41,6 +41,7 @@ dependencies { +@@ -42,6 +42,7 @@ dependencies { apiAndDocs("net.kyori:adventure-text-logger-slf4j") api("org.apache.logging.log4j:log4j-api:2.17.1") api("org.slf4j:slf4j-api:1.8.0-beta4") @@ -31,7 +31,7 @@ index 9421e45653e68922a51cf0071792e6fa7999d0b8..181e9cd8623995f40e696ccfe49754dc implementation("org.ow2.asm:asm:9.4") implementation("org.ow2.asm:asm-commons:9.4") -@@ -84,6 +85,13 @@ val generateApiVersioningFile by tasks.registering { +@@ -85,6 +86,13 @@ val generateApiVersioningFile by tasks.registering { } } @@ -47,7 +47,7 @@ index 9421e45653e68922a51cf0071792e6fa7999d0b8..181e9cd8623995f40e696ccfe49754dc into("META-INF/maven/${project.group}/${project.name}") diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java new file mode 100644 -index 0000000000000000000000000000000000000000..cfbc75a4525b0596547db496eabe867975081642 +index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8eb08fb68a --- /dev/null +++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java @@ -0,0 +1,161 @@ @@ -69,21 +69,21 @@ index 0000000000000000000000000000000000000000..cfbc75a4525b0596547db496eabe8679 +import org.jetbrains.annotations.Nullable; + +public class SentryContext { -+ ++ + private static final Gson GSON = new Gson(); -+ ++ + public static void setPluginContext(@Nullable Plugin plugin) { + if (plugin != null) { + ThreadContext.put("pufferfishsentry_pluginname", plugin.getName()); + ThreadContext.put("pufferfishsentry_pluginversion", plugin.getDescription().getVersion()); + } + } -+ ++ + public static void removePluginContext() { + ThreadContext.remove("pufferfishsentry_pluginname"); + ThreadContext.remove("pufferfishsentry_pluginversion"); + } -+ ++ + public static void setSenderContext(@Nullable CommandSender sender) { + if (sender != null) { + ThreadContext.put("pufferfishsentry_playername", sender.getName()); @@ -92,15 +92,15 @@ index 0000000000000000000000000000000000000000..cfbc75a4525b0596547db496eabe8679 + } + } + } -+ ++ + public static void removeSenderContext() { + ThreadContext.remove("pufferfishsentry_playername"); + ThreadContext.remove("pufferfishsentry_playerid"); + } -+ ++ + public static void setEventContext(Event event, RegisteredListener registration) { + setPluginContext(registration.getPlugin()); -+ ++ + try { + // Find the player that was involved with this event + Player player = null; @@ -108,36 +108,36 @@ index 0000000000000000000000000000000000000000..cfbc75a4525b0596547db496eabe8679 + player = ((PlayerEvent) event).getPlayer(); + } else { + Class eventClass = event.getClass(); -+ ++ + Field playerField = null; -+ ++ + for (Field field : eventClass.getDeclaredFields()) { + if (field.getType().equals(Player.class)) { + playerField = field; + break; + } + } -+ ++ + if (playerField != null) { + playerField.setAccessible(true); + player = (Player) playerField.get(event); + } + } -+ ++ + if (player != null) { + setSenderContext(player); + } + } catch (Exception e) {} // We can't really safely log exceptions. -+ ++ + ThreadContext.put("pufferfishsentry_eventdata", GSON.toJson(serializeFields(event))); + } -+ ++ + public static void removeEventContext() { + removePluginContext(); + removeSenderContext(); + ThreadContext.remove("pufferfishsentry_eventdata"); + } -+ ++ + private static Map serializeFields(Object object) { + Map fields = new TreeMap<>(); + fields.put("_class", object.getClass().getName()); @@ -146,7 +146,7 @@ index 0000000000000000000000000000000000000000..cfbc75a4525b0596547db496eabe8679 + if (Modifier.isStatic(declaredField.getModifiers())) { + continue; + } -+ ++ + String fieldName = declaredField.getName(); + if (fieldName.equals("handlers")) { + continue; @@ -162,47 +162,47 @@ index 0000000000000000000000000000000000000000..cfbc75a4525b0596547db496eabe8679 + } + return fields; + } -+ ++ + public static class State { -+ ++ + private Plugin plugin; + private Command command; + private String commandLine; + private Event event; + private RegisteredListener registeredListener; -+ ++ + public Plugin getPlugin() { + return plugin; + } -+ ++ + public void setPlugin(Plugin plugin) { + this.plugin = plugin; + } -+ ++ + public Command getCommand() { + return command; + } -+ ++ + public void setCommand(Command command) { + this.command = command; + } -+ ++ + public String getCommandLine() { + return commandLine; + } -+ ++ + public void setCommandLine(String commandLine) { + this.commandLine = commandLine; + } -+ ++ + public Event getEvent() { + return event; + } -+ ++ + public void setEvent(Event event) { + this.event = event; + } -+ ++ + public RegisteredListener getRegisteredListener() { + return registeredListener; + } @@ -480,7 +480,7 @@ index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..301e82369603f3dd6e6c1bd380da4bac if (cloader instanceof PluginClassLoader) { diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 86771934c76dd63b219069b045dbb5511ee0f45d..24ab015fbab6ce789999872791f7ffe4cc64d6d6 100644 +index 1758e8a89c85eea8c2161ddcb5b0e745151a1f5e..fe21d31b463317eb90d58cbca5f098958ca93938 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -48,6 +48,8 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm diff --git a/patches/api/0002-Purpur-API-Changes.patch b/patches/api/0002-Purpur-API-Changes.patch index 5d4cbfe..a087346 100644 --- a/patches/api/0002-Purpur-API-Changes.patch +++ b/patches/api/0002-Purpur-API-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 -Date: Wed, 15 Mar 2023 05:21:29 +0000 +Date: Thu, 23 Mar 2023 10:35:54 +0900 Subject: [PATCH] Purpur API Changes Original: PurpurMC @@ -25,10 +25,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/build.gradle.kts b/build.gradle.kts -index 181e9cd8623995f40e696ccfe49754dc340405d8..e7c5f7eabaf4f2af07dd987a7879f45c4f66658d 100644 +index b83e2c5a0a094002d12aee55ec0cf8d12bf33f3e..b5835fa536f90b7f88a5ee4df78733cf43e1cb23 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -104,6 +104,8 @@ tasks.jar { +@@ -105,6 +105,8 @@ tasks.jar { } tasks.withType { @@ -325,7 +325,7 @@ index ac9b690fcccb60b587e5345f12f1383afd0a73a1..83571abfe9a2eb8736b481de35dfd7fd + // Purpur end } diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java -index f6eb30f53dad684f156102cf7147b2f00c82c71e..f1239a2618b08fa92e0e20692d1c3d20d1558502 100644 +index e3f185dc982d1c38195a4e01ddd485c13ffa58c0..98c2f73ee5c921dab506fc933a0acff400201537 100644 --- a/src/main/java/org/bukkit/ChatColor.java +++ b/src/main/java/org/bukkit/ChatColor.java @@ -3,6 +3,7 @@ package org.bukkit; @@ -336,7 +336,7 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..f1239a2618b08fa92e0e20692d1c3d20 import java.util.regex.Pattern; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -@@ -413,4 +414,77 @@ public enum ChatColor { +@@ -454,4 +455,77 @@ public enum ChatColor { BY_CHAR.put(color.code, color); } } @@ -415,10 +415,10 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..f1239a2618b08fa92e0e20692d1c3d20 + // Purpur end } diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 6bbb47d1f9d8d45326232024e82a0ebaf764fae7..2a22d0639d63a3db4e7bded2d4e91b09bb93a95e 100644 +index 3c5e90f039f0d2991be442168703526405e18e3d..df992c41d736ee4e89773c2621d261d6afcb2148 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -10753,4 +10753,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla +@@ -11066,4 +11066,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla public String getItemTranslationKey() { return Bukkit.getUnsafe().getItemTranslationKey(this); } @@ -865,10 +865,10 @@ index e40f017f87d6b6b4770501b106c76dc69ec69abb..eac5830986cd0638950bbb1e6f10a30e ); this.versionMessage = net.kyori.adventure.text.Component.text() diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java -index cb9e8b53da300a911f84e15ee9be2261cf1cc340..c8a603bb614f891d8eb43acd3eddd0504816566f 100644 +index bea786a8be4402f9384984e48390e745f2988dd6..5eb81fcc18b8fdec5a0e4c699525281fa6ad4d78 100644 --- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java +++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java -@@ -227,6 +227,28 @@ public enum EnchantmentTarget { +@@ -228,6 +228,28 @@ public enum EnchantmentTarget { public boolean includes(@NotNull Material item) { return BREAKABLE.includes(item) || (WEARABLE.includes(item) && !item.equals(Material.ELYTRA)) || item.equals(Material.COMPASS); } @@ -932,10 +932,10 @@ index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c // Paper start /** diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 11cf1bb585e2754bda443b776e9fcaf0a6cc289e..649babbfdd495e8c9471c2f6518d2eb9d9568ba4 100644 +index 365350d38b2eee00d22bad09ab95c6054f11d536..47f644b9cb615e2feeacb810898cf567f1cf04fc 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -927,4 +927,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent +@@ -953,4 +953,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent */ boolean wouldCollideUsing(@NotNull BoundingBox boundingBox); // Paper End - Collision API @@ -1084,10 +1084,10 @@ index 58017fce436cdbda255f7172fbdadb726d4b113c..05600fc8bf2a61aca8094029bc4c208a + // Purpur end } diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index d045f41d929c6101060caf3a9fb48c8ffc036f16..44246068b51e47342d767f15af6881f29461589c 100644 +index 059dfc40edc6c52f95a30e9ac72f45b6aaf5f9a8..216ad2cf780cc432e85cd59a8cd8deb33b701a70 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -1146,4 +1146,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource +@@ -1148,4 +1148,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource */ void setBodyYaw(float bodyYaw); // Paper end @@ -1155,10 +1155,10 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc + // Purpur end } diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index fd890d0a3a2c92ad821ade7711191bdb0e3e3624..9c03265a9e932b3c9b5f0f7ffb4c9e9094f813ec 100644 +index b5fd857896b3afcfa69cce55cbc2696dd625f805..08b5f448e92add21f9f9797d9cea3ac60581dff5 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -2969,4 +2969,139 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -3000,4 +3000,139 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @Override Spigot spigot(); // Spigot end @@ -1299,10 +1299,10 @@ index fd890d0a3a2c92ad821ade7711191bdb0e3e3624..9c03265a9e932b3c9b5f0f7ffb4c9e90 + // Purpur end } diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java -index 10f8f6d45ae9280651c3ebddd1f90acbd7d6ff29..34f9d1b5d66ca96c71a94ebc981752e40019e575 100644 +index 7fbfdb07585c7b28acea1f0c1f58ada0cc744441..21fcca092e2e31baa5ece0de9e44e3fade8c7123 100644 --- a/src/main/java/org/bukkit/entity/Snowman.java +++ b/src/main/java/org/bukkit/entity/Snowman.java -@@ -23,4 +23,20 @@ public interface Snowman extends Golem, RangedEntity { // Paper +@@ -23,4 +23,20 @@ public interface Snowman extends Golem, RangedEntity, io.papermc.paper.entity.Sh * @param derpMode True to remove the pumpkin, false to add a pumpkin */ void setDerp(boolean derpMode); @@ -1410,15 +1410,15 @@ index 01c5e8b71338fbb4b1605e45bf2a2e705188f6b5..118d53ec9d1dc9c01cedfbedaf0b8edc * When a player gets bad omen after killing a patrol captain. */ diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java -index 8d7ad84c2bdafa8c8a385fe31acb887a883194ff..11230fb25270b06700efc61954556bfcd0135699 100644 +index 35aac79a7c58d00e6b3c6c042b291093c9c7af71..7fa8909f07ce768654b9ea7c42c4913b7e2593b7 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryType.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java -@@ -141,7 +141,7 @@ public enum InventoryType { - CHISELED_BOOKSHELF(6, "Chiseled Bookshelf"), +@@ -155,7 +155,7 @@ public enum InventoryType { + // Paper end ; - private final int size; -+ private int size; public void setDefaultSize(int size) { this.size = size; } // Purpur - remove file and add setter ++ private int size; public void setDefaultSize(int size) { this.size = size; } // Purpur - remove final and add setter private final String title; private final boolean isCreatable; @@ -1442,7 +1442,7 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c + // Purpur end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 449d6e1995eedbfaeffdc5d1f1c2295378006aa8..11261c659e3a378f468f4a19e2c24c1bb1f95a2b 100644 +index cd487177f6e391e114c394cd736796e20e0e8982..e5f129b7bbf4257e6be056af71c4e26a01ffd658 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta; @@ -2200,7 +2200,7 @@ index e4b6f278a811acbb0070e311c5c3bdaff7b00474..ee83ecb054099cb85168a9499dfe967a { java.util.Objects.requireNonNullElseGet(desc.getPrefix(), desc::getName), file // Paper - use configured log prefix diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java -index 24e36cdf580da885ac64002673a786b9c5a3f787..d20cc4d4f5b37a3de9cb3cf47af7a908e9dbc2fc 100644 +index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f026703cb80 100644 --- a/src/main/java/org/bukkit/potion/PotionEffect.java +++ b/src/main/java/org/bukkit/potion/PotionEffect.java @@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap; @@ -2211,7 +2211,7 @@ index 24e36cdf580da885ac64002673a786b9c5a3f787..d20cc4d4f5b37a3de9cb3cf47af7a908 import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.configuration.serialization.SerializableAs; import org.bukkit.entity.LivingEntity; -@@ -26,12 +27,14 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -31,12 +32,14 @@ public class PotionEffect implements ConfigurationSerializable { private static final String AMBIENT = "ambient"; private static final String PARTICLES = "has-particles"; private static final String ICON = "has-icon"; @@ -2226,7 +2226,7 @@ index 24e36cdf580da885ac64002673a786b9c5a3f787..d20cc4d4f5b37a3de9cb3cf47af7a908 /** * Creates a potion effect. -@@ -44,6 +47,36 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -49,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable { * @param icon the icon status, see {@link PotionEffect#hasIcon()} */ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon) { @@ -2263,7 +2263,7 @@ index 24e36cdf580da885ac64002673a786b9c5a3f787..d20cc4d4f5b37a3de9cb3cf47af7a908 Preconditions.checkArgument(type != null, "effect type cannot be null"); this.type = type; this.duration = duration; -@@ -51,6 +84,7 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -56,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable { this.ambient = ambient; this.particles = particles; this.icon = icon; @@ -2271,7 +2271,7 @@ index 24e36cdf580da885ac64002673a786b9c5a3f787..d20cc4d4f5b37a3de9cb3cf47af7a908 } /** -@@ -98,36 +132,43 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -103,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable { * @param map the map to deserialize from */ public PotionEffect(@NotNull Map map) { @@ -2322,7 +2322,7 @@ index 24e36cdf580da885ac64002673a786b9c5a3f787..d20cc4d4f5b37a3de9cb3cf47af7a908 @NotNull private static PotionEffectType getEffectType(@NotNull Map map) { int type = getInt(map, TYPE); -@@ -154,17 +195,33 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -159,17 +200,33 @@ public class PotionEffect implements ConfigurationSerializable { return def; } @@ -2364,7 +2364,7 @@ index 24e36cdf580da885ac64002673a786b9c5a3f787..d20cc4d4f5b37a3de9cb3cf47af7a908 } /** -@@ -188,7 +245,7 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -193,7 +250,7 @@ public class PotionEffect implements ConfigurationSerializable { return false; } PotionEffect that = (PotionEffect) obj; @@ -2373,7 +2373,7 @@ index 24e36cdf580da885ac64002673a786b9c5a3f787..d20cc4d4f5b37a3de9cb3cf47af7a908 } /** -@@ -256,6 +313,24 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -289,6 +346,24 @@ public class PotionEffect implements ConfigurationSerializable { return icon; } @@ -2398,7 +2398,7 @@ index 24e36cdf580da885ac64002673a786b9c5a3f787..d20cc4d4f5b37a3de9cb3cf47af7a908 @Override public int hashCode() { int hash = 1; -@@ -270,6 +345,6 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -303,6 +378,6 @@ public class PotionEffect implements ConfigurationSerializable { @Override public String toString() { diff --git a/patches/api/0004-Bump-Bungeecord-Chat-API-to-1.19-R0.1-SNAPSHOT.patch b/patches/api/0004-Bump-Bungeecord-Chat-API-to-1.19-R0.1-SNAPSHOT.patch index 941a745..7bb9da6 100644 --- a/patches/api/0004-Bump-Bungeecord-Chat-API-to-1.19-R0.1-SNAPSHOT.patch +++ b/patches/api/0004-Bump-Bungeecord-Chat-API-to-1.19-R0.1-SNAPSHOT.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Bump Bungeecord Chat API to 1.19-R0.1-SNAPSHOT diff --git a/build.gradle.kts b/build.gradle.kts -index 5c8dd4d3313a791d1fee00ec5d4bc595b76b7d6d..a85f1db096555a6077dd77cbd7572442d3adc848 100644 +index b5835fa536f90b7f88a5ee4df78733cf43e1cb23..42de5c470a2fbb1e0bc9b809c033e3afe30502fa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,7 @@ dependencies { // api dependencies are listed transitively to API consumers api("com.google.guava:guava:31.1-jre") api("com.google.code.gson:gson:2.10") -- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.6") // Paper +- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper + api("net.md-5:bungeecord-chat:1.19-R0.1-SNAPSHOT") // Paper // Plazma api("org.yaml:snakeyaml:1.33") + api("org.joml:joml:1.10.5") // Paper start - api("com.googlecode.json-simple:json-simple:1.1.1") { diff --git a/patches/api/0005-Publish-Packages.patch b/patches/api/0005-Publish-Packages.patch index 0b9b304..a070771 100644 --- a/patches/api/0005-Publish-Packages.patch +++ b/patches/api/0005-Publish-Packages.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Publish Packages diff --git a/build.gradle.kts b/build.gradle.kts -index 2df01c65821d918673819115a743202bf6d9748a..a52b75ab7fdf055b2dc17e1d71bc552152e97a38 100644 +index 42de5c470a2fbb1e0bc9b809c033e3afe30502fa..c2c506afd44c7f14de51bd93004aa8a32ff2103e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -154,3 +154,23 @@ tasks.check { +@@ -155,3 +155,23 @@ tasks.check { dependsOn(scanJar) } // Paper end diff --git a/patches/server/0001-Pufferfish-Server-Changes.patch b/patches/server/0001-Pufferfish-Server-Changes.patch index 6795a2c..f5450d3 100644 --- a/patches/server/0001-Pufferfish-Server-Changes.patch +++ b/patches/server/0001-Pufferfish-Server-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 -Date: Wed, 15 Mar 2023 05:19:29 +0000 +Date: Thu, 23 Mar 2023 10:28:40 +0900 Subject: [PATCH] Pufferfish Server Changes Original: Kevin Raneri @@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/build.gradle.kts b/build.gradle.kts -index 1919a8e9cb7c995b2a9c876ff4980bdc98977133..8d8c5a8bd2a53ac6d9b36e0330a7be6725aa407c 100644 +index 9cf389defdaeb887e9cad4f0fed3f3b95667b238..3c8293f002f11b430083502362fdc801f44aa138 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,12 @@ plugins { @@ -38,7 +38,7 @@ index 1919a8e9cb7c995b2a9c876ff4980bdc98977133..8d8c5a8bd2a53ac6d9b36e0330a7be67 // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") -@@ -42,6 +46,13 @@ dependencies { +@@ -42,6 +46,14 @@ dependencies { runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") @@ -48,14 +48,15 @@ index 1919a8e9cb7c995b2a9c876ff4980bdc98977133..8d8c5a8bd2a53ac6d9b36e0330a7be67 + exclude(group="org.yaml", module="snakeyaml") + } + // Pufferfish end ++ implementation("com.github.technove:Flare:34637f3f87") // Pufferfish - flare + testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test testImplementation("junit:junit:4.13.2") testImplementation("org.hamcrest:hamcrest-library:1.3") -@@ -50,6 +61,14 @@ dependencies { +@@ -50,6 +62,14 @@ dependencies { } - val craftbukkitPackageVersion = "1_19_R2" // Paper + val craftbukkitPackageVersion = "1_19_R3" // Paper + +// Pufferfish Start +tasks.withType { @@ -67,7 +68,7 @@ index 1919a8e9cb7c995b2a9c876ff4980bdc98977133..8d8c5a8bd2a53ac6d9b36e0330a7be67 tasks.jar { archiveClassifier.set("dev") -@@ -62,7 +81,7 @@ tasks.jar { +@@ -62,7 +82,7 @@ tasks.jar { attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", @@ -616,10 +617,10 @@ index 0000000000000000000000000000000000000000..020368da69b9a492155f6de6297f7473 +} diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..6e441a1a28ba72a8b1cc09fe5fca71b3c70627d4 +index 0000000000000000000000000000000000000000..e0076044d0a29e33ee297fe6180a041436075297 --- /dev/null +++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -@@ -0,0 +1,285 @@ +@@ -0,0 +1,317 @@ +package gg.pufferfish.pufferfish; + +import gg.pufferfish.pufferfish.simd.SIMDDetection; @@ -637,6 +638,7 @@ index 0000000000000000000000000000000000000000..6e441a1a28ba72a8b1cc09fe5fca71b3 +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.List; ++import gg.pufferfish.pufferfish.flare.FlareCommand; +import net.minecraft.server.MinecraftServer; +import org.apache.logging.log4j.Level; +import org.bukkit.configuration.ConfigurationSection; @@ -645,6 +647,13 @@ index 0000000000000000000000000000000000000000..6e441a1a28ba72a8b1cc09fe5fca71b3 +import org.simpleyaml.configuration.comments.CommentType; +import org.simpleyaml.configuration.file.YamlFile; +import org.simpleyaml.exceptions.InvalidConfigurationException; ++import org.bukkit.command.SimpleCommandMap; ++ ++import java.lang.reflect.Method; ++import java.lang.reflect.Modifier; ++import java.util.List; ++import java.net.URI; ++import java.util.Collections; + +public class PufferfishConfig { + @@ -895,6 +904,30 @@ index 0000000000000000000000000000000000000000..6e441a1a28ba72a8b1cc09fe5fca71b3 + "This can improve performance by a few percent, but has minor gameplay implications."); + } + ++ public static URI profileWebUrl; ++ private static void profilerOptions() { ++ profileWebUrl = URI.create(getString("flare.url", "https://flare.airplane.gg", "Sets the server to use for profiles.")); ++ ++ setComment("flare", "Configures Flare, the built-in profiler"); ++ } ++ ++ ++ public static String accessToken; ++ private static void airplaneWebServices() { ++ accessToken = getString("web-services.token", ""); ++ // todo lookup token (off-thread) and let users know if their token is valid ++ if (accessToken.length() > 0) { ++ gg.pufferfish.pufferfish.flare.FlareSetup.init(); // Pufferfish ++ SimpleCommandMap commandMap = MinecraftServer.getServer().server.getCommandMap(); ++ if (commandMap.getCommand("flare") == null) { ++ commandMap.register("flare", "Pufferfish", new FlareCommand()); ++ } ++ } ++ ++ setComment("web-services", "Options for connecting to Pufferfish/Airplane's online utilities"); ++ ++ } ++ + + public static boolean disableMethodProfiler; + public static boolean disableOutOfOrderChat; @@ -1070,6 +1103,699 @@ index 0000000000000000000000000000000000000000..e877921370f6009a4bd204d9b17d2d58 + } +} \ No newline at end of file +diff --git a/src/main/java/gg/pufferfish/pufferfish/compat/ServerConfigurations.java b/src/main/java/gg/pufferfish/pufferfish/compat/ServerConfigurations.java +new file mode 100644 +index 0000000000000000000000000000000000000000..4ad189d52b27560424ddb311d0817a334637dc95 +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/compat/ServerConfigurations.java +@@ -0,0 +1,78 @@ ++package gg.pufferfish.pufferfish.compat; ++ ++import co.aikar.timings.TimingsManager; ++import com.google.common.io.Files; ++import org.bukkit.configuration.InvalidConfigurationException; ++import org.bukkit.configuration.file.YamlConfiguration; ++ ++import java.io.ByteArrayOutputStream; ++import java.io.File; ++import java.io.FileInputStream; ++import java.io.IOException; ++import java.nio.charset.StandardCharsets; ++import java.util.Arrays; ++import java.util.HashMap; ++import java.util.List; ++import java.util.Map; ++import java.util.Properties; ++import java.util.stream.Collectors; ++ ++public class ServerConfigurations { ++ ++ public static final String[] configurationFiles = new String[]{ ++ "server.properties", ++ "bukkit.yml", ++ "spigot.yml", ++ // "paper.yml", // TODO: Figure out what to do with this. ++ "pufferfish.yml" ++ }; ++ ++ public static Map getCleanCopies() throws IOException { ++ Map files = new HashMap<>(configurationFiles.length); ++ for (String file : configurationFiles) { ++ files.put(file, getCleanCopy(file)); ++ } ++ return files; ++ } ++ ++ public static String getCleanCopy(String configName) throws IOException { ++ File file = new File(configName); ++ List hiddenConfigs = TimingsManager.hiddenConfigs; ++ ++ switch (Files.getFileExtension(configName)) { ++ case "properties": { ++ Properties properties = new Properties(); ++ try (FileInputStream inputStream = new FileInputStream(file)) { ++ properties.load(inputStream); ++ } ++ for (String hiddenConfig : hiddenConfigs) { ++ properties.remove(hiddenConfig); ++ } ++ ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ++ properties.store(outputStream, ""); ++ return Arrays.stream(outputStream.toString() ++ .split("\n")) ++ .filter(line -> !line.startsWith("#")) ++ .collect(Collectors.joining("\n")); ++ } ++ case "yml": { ++ YamlConfiguration configuration = new YamlConfiguration(); ++ try { ++ configuration.load(file); ++ } catch (InvalidConfigurationException e) { ++ throw new IOException(e); ++ } ++ configuration.options().header(null); ++ for (String key : configuration.getKeys(true)) { ++ if (hiddenConfigs.contains(key)) { ++ configuration.set(key, null); ++ } ++ } ++ return configuration.saveToString(); ++ } ++ default: ++ throw new IllegalArgumentException("Bad file type " + configName); ++ } ++ } ++ ++} +diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/CustomCategories.java b/src/main/java/gg/pufferfish/pufferfish/flare/CustomCategories.java +new file mode 100644 +index 0000000000000000000000000000000000000000..401b42e29bccb5251684062f10b2e0f8b091bc95 +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/flare/CustomCategories.java +@@ -0,0 +1,8 @@ ++package gg.pufferfish.pufferfish.flare; ++ ++import co.technove.flare.live.category.GraphCategory; ++ ++public class CustomCategories { ++ public static final GraphCategory MC_PERF = new GraphCategory("MC Performance"); ++ public static final GraphCategory ENTITIES_AND_CHUNKS = new GraphCategory("Entities & Chunks"); ++} +diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/FlareCommand.java b/src/main/java/gg/pufferfish/pufferfish/flare/FlareCommand.java +new file mode 100644 +index 0000000000000000000000000000000000000000..3785d1512eb650f91d58903672c059e7449598fc +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/flare/FlareCommand.java +@@ -0,0 +1,136 @@ ++package gg.pufferfish.pufferfish.flare; ++ ++import co.technove.flare.exceptions.UserReportableException; ++import co.technove.flare.internal.profiling.ProfileType; ++import gg.pufferfish.pufferfish.PufferfishConfig; ++import net.kyori.adventure.text.Component; ++import net.kyori.adventure.text.event.ClickEvent; ++import net.kyori.adventure.text.format.NamedTextColor; ++import net.kyori.adventure.text.format.TextColor; ++import net.kyori.adventure.text.format.TextDecoration; ++import net.minecraft.server.MinecraftServer; ++import org.apache.logging.log4j.Level; ++import org.bukkit.Bukkit; ++import org.bukkit.command.Command; ++import org.bukkit.command.CommandSender; ++import org.bukkit.command.ConsoleCommandSender; ++import org.bukkit.craftbukkit.scheduler.MinecraftInternalPlugin; ++import org.bukkit.util.StringUtil; ++import org.jetbrains.annotations.NotNull; ++ ++import java.time.Duration; ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.List; ++ ++public class FlareCommand extends Command { ++ ++ private static final String BASE_URL = "https://blog.airplane.gg/flare-tutorial/#setting-the-access-token"; ++ private static final TextColor HEX = TextColor.fromHexString("#e3eaea"); ++ private static final Component PREFIX = Component.text() ++ .append(Component.text("Flare ✈") ++ .color(TextColor.fromHexString("#6a7eda")) ++ .decoration(TextDecoration.BOLD, true) ++ .append(Component.text(" ", HEX) ++ .decoration(TextDecoration.BOLD, false))) ++ .asComponent(); ++ ++ public FlareCommand() { ++ super("flare", "Profile your server with Flare", "/flare", Collections.singletonList("profile")); ++ this.setPermission("airplane.flare"); ++ } ++ ++ @Override ++ public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, String @NotNull [] args) { ++ if (!testPermission(sender)) return true; ++ if (PufferfishConfig.accessToken.length() == 0) { ++ Component clickable = Component.text(BASE_URL, HEX, TextDecoration.UNDERLINED).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, BASE_URL)); ++ ++ sender.sendMessage(PREFIX.append(Component.text("Flare currently requires an access token to use. To learn more, visit ").color(HEX).append(clickable))); ++ return true; ++ } ++ ++ if (!FlareSetup.isSupported()) { ++ sender.sendMessage(PREFIX.append( ++ Component.text("Profiling is not supported in this environment, check your startup logs for the error.", NamedTextColor.RED))); ++ return true; ++ } ++ if (ProfilingManager.isProfiling()) { ++ if (args.length == 1 && args[0].equalsIgnoreCase("status")) { ++ sender.sendMessage(PREFIX.append(Component.text("Current profile has been ran for " + ProfilingManager.getTimeRan().toString(), HEX))); ++ return true; ++ } ++ if (ProfilingManager.stop()) { ++ if (!(sender instanceof ConsoleCommandSender)) { ++ sender.sendMessage(PREFIX.append(Component.text("Profiling has been stopped.", HEX))); ++ } ++ } else { ++ sender.sendMessage(PREFIX.append(Component.text("Profiling has already been stopped.", HEX))); ++ } ++ } else { ++ ProfileType profileType = ProfileType.ITIMER; ++ if (args.length > 0) { ++ try { ++ profileType = ProfileType.valueOf(args[0].toUpperCase()); ++ } catch (Exception e) { ++ sender.sendMessage(PREFIX.append(Component ++ .text("Invalid profile type ", HEX) ++ .append(Component.text(args[0], HEX, TextDecoration.BOLD) ++ .append(Component.text("!", HEX))) ++ )); ++ } ++ } ++ ProfileType finalProfileType = profileType; ++ Bukkit.getScheduler().runTaskAsynchronously(new MinecraftInternalPlugin(), () -> { ++ try { ++ if (ProfilingManager.start(finalProfileType)) { ++ if (!(sender instanceof ConsoleCommandSender)) { ++ sender.sendMessage(PREFIX.append(Component ++ .text("Flare has been started: " + ProfilingManager.getProfilingUri(), HEX) ++ .clickEvent(ClickEvent.openUrl(ProfilingManager.getProfilingUri())) ++ )); ++ sender.sendMessage(PREFIX.append(Component.text(" Run /" + commandLabel + " to stop the Flare.", HEX))); ++ } ++ } else { ++ sender.sendMessage(PREFIX.append(Component ++ .text("Flare has already been started: " + ProfilingManager.getProfilingUri(), HEX) ++ .clickEvent(ClickEvent.openUrl(ProfilingManager.getProfilingUri())) ++ )); ++ } ++ } catch (UserReportableException e) { ++ sender.sendMessage(Component.text("Flare failed to start: " + e.getUserError(), NamedTextColor.RED)); ++ if (e.getCause() != null) { ++ MinecraftServer.LOGGER.warn("Flare failed to start", e); ++ } ++ } ++ }); ++ } ++ return true; ++ } ++ ++ @Override ++ public @NotNull List tabComplete(@NotNull CommandSender sender, @NotNull String alias, String @NotNull [] args) throws IllegalArgumentException { ++ List list = new ArrayList<>(); ++ if (ProfilingManager.isProfiling()) { ++ if (args.length == 1) { ++ String lastWord = args[0]; ++ if (StringUtil.startsWithIgnoreCase("status", lastWord)) { ++ list.add("status"); ++ } ++ if (StringUtil.startsWithIgnoreCase("stop", lastWord)) { ++ list.add("stop"); ++ } ++ } ++ } else { ++ if (args.length <= 1) { ++ String lastWord = args.length == 0 ? "" : args[0]; ++ for (ProfileType value : ProfileType.values()) { ++ if (StringUtil.startsWithIgnoreCase(value.getInternalName(), lastWord)) { ++ list.add(value.name().toLowerCase()); ++ } ++ } ++ } ++ } ++ return list; ++ } ++} +diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/FlareSetup.java b/src/main/java/gg/pufferfish/pufferfish/flare/FlareSetup.java +new file mode 100644 +index 0000000000000000000000000000000000000000..cd22e4dcc8b7b57b10a95ef084637249a98e524f +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/flare/FlareSetup.java +@@ -0,0 +1,33 @@ ++package gg.pufferfish.pufferfish.flare; ++ ++import co.technove.flare.FlareInitializer; ++import co.technove.flare.internal.profiling.InitializationException; ++import net.minecraft.server.MinecraftServer; ++import org.apache.logging.log4j.Level; ++ ++public class FlareSetup { ++ ++ private static boolean initialized = false; ++ private static boolean supported = false; ++ ++ public static void init() { ++ if (initialized) { ++ return; ++ } ++ ++ initialized = true; ++ try { ++ for (String warning : FlareInitializer.initialize()) { ++ MinecraftServer.LOGGER.warn("Flare warning: " + warning); ++ } ++ supported = true; ++ } catch (InitializationException e) { ++ MinecraftServer.LOGGER.warn("Failed to enable Flare:", e); ++ } ++ } ++ ++ public static boolean isSupported() { ++ return supported; ++ } ++ ++} +diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/PluginLookup.java b/src/main/java/gg/pufferfish/pufferfish/flare/PluginLookup.java +new file mode 100644 +index 0000000000000000000000000000000000000000..74aab5eb4b54ffbaf19b8976ffb8ca4a64584006 +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/flare/PluginLookup.java +@@ -0,0 +1,44 @@ ++package gg.pufferfish.pufferfish.flare; ++ ++import com.google.common.cache.Cache; ++import com.google.common.cache.CacheBuilder; ++import org.bukkit.Bukkit; ++import org.bukkit.plugin.Plugin; ++import org.bukkit.plugin.java.PluginClassLoader; ++ ++import java.util.Optional; ++import java.util.concurrent.TimeUnit; ++ ++public class PluginLookup { ++ private static final Cache pluginNameCache = CacheBuilder.newBuilder() ++ .expireAfterAccess(1, TimeUnit.MINUTES) ++ .maximumSize(1024) ++ .build(); ++ ++ public static Optional getPluginForClass(String name) { ++ if (name.startsWith("net.minecraft") || name.startsWith("java.") || name.startsWith("com.mojang") || ++ name.startsWith("com.google") || name.startsWith("it.unimi") || name.startsWith("sun")) { ++ return Optional.empty(); ++ } ++ ++ String existing = pluginNameCache.getIfPresent(name); ++ if (existing != null) { ++ return Optional.ofNullable(existing.isEmpty() ? null : existing); ++ } ++ ++ String newValue = ""; ++ ++ for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { ++ ClassLoader classLoader = plugin.getClass().getClassLoader(); ++ if (classLoader instanceof PluginClassLoader) { ++ if (((PluginClassLoader) classLoader)._airplane_hasClass(name)) { ++ newValue = plugin.getName(); ++ break; ++ } ++ } ++ } ++ ++ pluginNameCache.put(name, newValue); ++ return Optional.ofNullable(newValue.isEmpty() ? null : newValue); ++ } ++} +diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/ProfilingManager.java b/src/main/java/gg/pufferfish/pufferfish/flare/ProfilingManager.java +new file mode 100644 +index 0000000000000000000000000000000000000000..e3f76eb11a261c3347f0cd89b5da309bc2dc82f9 +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/flare/ProfilingManager.java +@@ -0,0 +1,151 @@ ++package gg.pufferfish.pufferfish.flare; ++ ++import co.technove.flare.Flare; ++import co.technove.flare.FlareAuth; ++import co.technove.flare.FlareBuilder; ++import co.technove.flare.exceptions.UserReportableException; ++import co.technove.flare.internal.profiling.ProfileType; ++import gg.pufferfish.pufferfish.PufferfishConfig; ++import gg.pufferfish.pufferfish.PufferfishLogger; ++import gg.pufferfish.pufferfish.compat.ServerConfigurations; ++import gg.pufferfish.pufferfish.flare.collectors.GCEventCollector; ++import gg.pufferfish.pufferfish.flare.collectors.StatCollector; ++import gg.pufferfish.pufferfish.flare.collectors.TPSCollector; ++import gg.pufferfish.pufferfish.flare.collectors.WorldCountCollector; ++import org.bukkit.Bukkit; ++import org.bukkit.craftbukkit.scheduler.MinecraftInternalPlugin; ++import org.bukkit.scheduler.BukkitTask; ++import oshi.SystemInfo; ++import oshi.hardware.CentralProcessor; ++import oshi.hardware.GlobalMemory; ++import oshi.hardware.HardwareAbstractionLayer; ++import oshi.hardware.VirtualMemory; ++import oshi.software.os.OperatingSystem; ++ ++import java.io.IOException; ++import java.net.URI; ++import java.time.Duration; ++import java.util.Objects; ++import java.util.logging.Level; ++ ++public class ProfilingManager { ++ ++ private static Flare currentFlare; ++ private static BukkitTask currentTask = null; ++ ++ public static synchronized boolean isProfiling() { ++ return currentFlare != null && currentFlare.isRunning(); ++ } ++ ++ public static synchronized String getProfilingUri() { ++ return Objects.requireNonNull(currentFlare).getURI().map(URI::toString).orElse("Flare is not running"); ++ } ++ ++ public static Duration getTimeRan() { ++ Flare flare = currentFlare; // copy reference so no need to sync ++ if (flare == null) { ++ return Duration.ofMillis(0); ++ } ++ return flare.getCurrentDuration(); ++ } ++ ++ public static synchronized boolean start(ProfileType profileType) throws UserReportableException { ++ if (currentFlare != null && !currentFlare.isRunning()) { ++ currentFlare = null; // errored out ++ } ++ if (isProfiling()) { ++ return false; ++ } ++ if (Bukkit.isPrimaryThread()) { ++ throw new UserReportableException("Profiles should be started off-thread"); ++ } ++ ++ try { ++ OperatingSystem os = new SystemInfo().getOperatingSystem(); ++ ++ SystemInfo systemInfo = new SystemInfo(); ++ HardwareAbstractionLayer hardware = systemInfo.getHardware(); ++ ++ CentralProcessor processor = hardware.getProcessor(); ++ CentralProcessor.ProcessorIdentifier processorIdentifier = processor.getProcessorIdentifier(); ++ ++ GlobalMemory memory = hardware.getMemory(); ++ VirtualMemory virtualMemory = memory.getVirtualMemory(); ++ ++ FlareBuilder builder = new FlareBuilder() ++ .withProfileType(profileType) ++ .withMemoryProfiling(true) ++ .withAuth(FlareAuth.fromTokenAndUrl(PufferfishConfig.accessToken, PufferfishConfig.profileWebUrl)) ++ ++ .withFiles(ServerConfigurations.getCleanCopies()) ++ .withVersion("Primary Version", Bukkit.getVersion()) ++ .withVersion("Bukkit Version", Bukkit.getBukkitVersion()) ++ .withVersion("Minecraft Version", Bukkit.getMinecraftVersion()) ++ ++ .withGraphCategories(CustomCategories.ENTITIES_AND_CHUNKS, CustomCategories.MC_PERF) ++ .withCollectors(new TPSCollector(), new WorldCountCollector(), new GCEventCollector(), new StatCollector()) ++ .withClassIdentifier(PluginLookup::getPluginForClass) ++ ++ .withHardware(new FlareBuilder.HardwareBuilder() ++ .setCoreCount(processor.getPhysicalProcessorCount()) ++ .setThreadCount(processor.getLogicalProcessorCount()) ++ .setCpuModel(processorIdentifier.getName()) ++ .setCpuFrequency(processor.getMaxFreq()) ++ ++ .setTotalMemory(memory.getTotal()) ++ .setTotalSwap(virtualMemory.getSwapTotal()) ++ .setTotalVirtual(virtualMemory.getVirtualMax()) ++ ) ++ ++ .withOperatingSystem(new FlareBuilder.OperatingSystemBuilder() ++ .setManufacturer(os.getManufacturer()) ++ .setFamily(os.getFamily()) ++ .setVersion(os.getVersionInfo().toString()) ++ .setBitness(os.getBitness()) ++ ); ++ ++ currentFlare = builder.build(); ++ } catch (IOException e) { ++ PufferfishLogger.LOGGER.log(Level.WARNING, "Failed to read configuration files:", e); ++ throw new UserReportableException("Failed to load configuration files, check logs for further details."); ++ } ++ ++ try { ++ currentFlare.start(); ++ } catch (IllegalStateException e) { ++ PufferfishLogger.LOGGER.log(Level.WARNING, "Error starting Flare:", e); ++ throw new UserReportableException("Failed to start Flare, check logs for further details."); ++ } ++ ++ currentTask = Bukkit.getScheduler().runTaskLater(new MinecraftInternalPlugin(), ProfilingManager::stop, 20 * 60 * 15); ++ PufferfishLogger.LOGGER.log(Level.INFO, "Flare has been started: " + getProfilingUri()); ++ return true; ++ } ++ ++ public static synchronized boolean stop() { ++ if (!isProfiling()) { ++ return false; ++ } ++ if (!currentFlare.isRunning()) { ++ currentFlare = null; ++ return true; ++ } ++ PufferfishLogger.LOGGER.log(Level.INFO, "Flare has been stopped: " + getProfilingUri()); ++ try { ++ currentFlare.stop(); ++ } catch (IllegalStateException e) { ++ PufferfishLogger.LOGGER.log(Level.WARNING, "Error occurred stopping Flare", e); ++ } ++ currentFlare = null; ++ ++ try { ++ currentTask.cancel(); ++ } catch (Throwable t) { ++ PufferfishLogger.LOGGER.log(Level.WARNING, "Error occurred stopping Flare", t); ++ } ++ ++ currentTask = null; ++ return true; ++ } ++ ++} +diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/collectors/GCEventCollector.java b/src/main/java/gg/pufferfish/pufferfish/flare/collectors/GCEventCollector.java +new file mode 100644 +index 0000000000000000000000000000000000000000..d426575c669020f369960107da1e2de2f11f082f +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/flare/collectors/GCEventCollector.java +@@ -0,0 +1,66 @@ ++package gg.pufferfish.pufferfish.flare.collectors; ++ ++import co.technove.flare.Flare; ++import co.technove.flare.internal.FlareInternal; ++import co.technove.flare.live.CollectorData; ++import co.technove.flare.live.EventCollector; ++import co.technove.flare.live.LiveEvent; ++import co.technove.flare.live.category.GraphCategory; ++import co.technove.flare.live.formatter.DataFormatter; ++import com.google.common.collect.ImmutableMap; ++import com.sun.management.GarbageCollectionNotificationInfo; ++ ++import javax.management.ListenerNotFoundException; ++import javax.management.Notification; ++import javax.management.NotificationEmitter; ++import javax.management.NotificationListener; ++import javax.management.openmbean.CompositeData; ++import java.lang.management.GarbageCollectorMXBean; ++import java.lang.management.ManagementFactory; ++ ++public class GCEventCollector extends EventCollector implements NotificationListener { ++ ++ private static final CollectorData MINOR_GC = new CollectorData("builtin:gc:minor", "Minor GC", "A small pause in the program to allow Garbage Collection to run.", DataFormatter.MILLISECONDS, GraphCategory.SYSTEM); ++ private static final CollectorData MAJOR_GC = new CollectorData("builtin:gc:major", "Major GC", "A large pause in the program to allow Garbage Collection to run.", DataFormatter.MILLISECONDS, GraphCategory.SYSTEM); ++ private static final CollectorData UNKNOWN_GC = new CollectorData("builtin:gc:generic", "Major GC", "A run of the Garbage Collection.", DataFormatter.MILLISECONDS, GraphCategory.SYSTEM); ++ ++ public GCEventCollector() { ++ super(MINOR_GC, MAJOR_GC, UNKNOWN_GC); ++ } ++ ++ private static CollectorData fromString(String string) { ++ if (string.endsWith("minor GC")) { ++ return MINOR_GC; ++ } else if (string.endsWith("major GC")) { ++ return MAJOR_GC; ++ } ++ return UNKNOWN_GC; ++ } ++ ++ @Override ++ public void start(Flare flare) { ++ for (GarbageCollectorMXBean garbageCollectorBean : ManagementFactory.getGarbageCollectorMXBeans()) { ++ NotificationEmitter notificationEmitter = (NotificationEmitter) garbageCollectorBean; ++ notificationEmitter.addNotificationListener(this, null, null); ++ } ++ } ++ ++ @Override ++ public void stop(Flare flare) { ++ for (GarbageCollectorMXBean garbageCollectorBean : ManagementFactory.getGarbageCollectorMXBeans()) { ++ NotificationEmitter notificationEmitter = (NotificationEmitter) garbageCollectorBean; ++ try { ++ notificationEmitter.removeNotificationListener(this); ++ } catch (ListenerNotFoundException e) { ++ } ++ } ++ } ++ ++ @Override ++ public void handleNotification(Notification notification, Object o) { ++ if (notification.getType().equals(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION)) { ++ GarbageCollectionNotificationInfo gcInfo = GarbageCollectionNotificationInfo.from((CompositeData) notification.getUserData()); ++ reportEvent(new LiveEvent(fromString(gcInfo.getGcAction()), System.currentTimeMillis(), (int) gcInfo.getGcInfo().getDuration(), ImmutableMap.of())); ++ } ++ } ++} +diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/collectors/StatCollector.java b/src/main/java/gg/pufferfish/pufferfish/flare/collectors/StatCollector.java +new file mode 100644 +index 0000000000000000000000000000000000000000..a22c6dbae53667e4c72464fa27153aee30c7946e +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/flare/collectors/StatCollector.java +@@ -0,0 +1,41 @@ ++package gg.pufferfish.pufferfish.flare.collectors; ++ ++import co.technove.flare.live.CollectorData; ++import co.technove.flare.live.LiveCollector; ++import co.technove.flare.live.category.GraphCategory; ++import co.technove.flare.live.formatter.DataFormatter; ++import com.sun.management.OperatingSystemMXBean; ++import oshi.SystemInfo; ++import oshi.hardware.CentralProcessor; ++ ++import java.lang.management.ManagementFactory; ++import java.time.Duration; ++ ++public class StatCollector extends LiveCollector { ++ ++ private static final CollectorData CPU = new CollectorData("builtin:stat:cpu", "CPU Load", "The total amount of CPU usage across all cores.", DataFormatter.PERCENT, GraphCategory.SYSTEM); ++ private static final CollectorData CPU_PROCESS = new CollectorData("builtin:stat:cpu_process", "Process CPU", "The amount of CPU being used by this process.", DataFormatter.PERCENT, GraphCategory.SYSTEM); ++ private static final CollectorData MEMORY = new CollectorData("builtin:stat:memory_used", "Memory", "The amount of memory being used currently.", DataFormatter.BYTES, GraphCategory.SYSTEM); ++ private static final CollectorData MEMORY_TOTAL = new CollectorData("builtin:stat:memory_total", "Memory Total", "The total amount of memory allocated.", DataFormatter.BYTES, GraphCategory.SYSTEM); ++ ++ private final OperatingSystemMXBean bean; ++ private final CentralProcessor processor; ++ ++ public StatCollector() { ++ super(CPU, CPU_PROCESS, MEMORY, MEMORY_TOTAL); ++ this.interval = Duration.ofSeconds(5); ++ ++ this.bean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); ++ this.processor = new SystemInfo().getHardware().getProcessor(); ++ } ++ ++ @Override ++ public void run() { ++ Runtime runtime = Runtime.getRuntime(); ++ ++ this.report(CPU, this.processor.getSystemLoadAverage(1)[0] / 100); // percentage ++ this.report(CPU_PROCESS, this.bean.getProcessCpuLoad()); ++ this.report(MEMORY, runtime.totalMemory() - runtime.freeMemory()); ++ this.report(MEMORY_TOTAL, runtime.totalMemory()); ++ } ++} +diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/collectors/TPSCollector.java b/src/main/java/gg/pufferfish/pufferfish/flare/collectors/TPSCollector.java +new file mode 100644 +index 0000000000000000000000000000000000000000..40447d00aefb5ffedb8a2ee87155a04088f0649f +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/flare/collectors/TPSCollector.java +@@ -0,0 +1,31 @@ ++package gg.pufferfish.pufferfish.flare.collectors; ++ ++import co.technove.flare.live.CollectorData; ++import co.technove.flare.live.LiveCollector; ++import co.technove.flare.live.formatter.SuffixFormatter; ++import gg.pufferfish.pufferfish.flare.CustomCategories; ++import net.minecraft.server.MinecraftServer; ++import org.bukkit.Bukkit; ++ ++import java.time.Duration; ++import java.util.Arrays; ++ ++public class TPSCollector extends LiveCollector { ++ private static final CollectorData TPS = new CollectorData("airplane:tps", "TPS", "Ticks per second, or how fast the server updates. For a smooth server this should be a constant 20TPS.", SuffixFormatter.of("TPS"), CustomCategories.MC_PERF); ++ private static final CollectorData MSPT = new CollectorData("airplane:mspt", "MSPT", "Milliseconds per tick, which can show how well your server is performing. This value should always be under 50mspt.", SuffixFormatter.of("mspt"), CustomCategories.MC_PERF); ++ ++ public TPSCollector() { ++ super(TPS, MSPT); ++ ++ this.interval = Duration.ofSeconds(5); ++ } ++ ++ @Override ++ public void run() { ++ long[] times = MinecraftServer.getServer().tickTimes5s.getTimes(); ++ double mspt = ((double) Arrays.stream(times).sum() / (double) times.length) * 1.0E-6D; ++ ++ this.report(TPS, Math.min(20D, Math.round(Bukkit.getServer().getTPS()[0] * 100d) / 100d)); ++ this.report(MSPT, (double) Math.round(mspt * 100d) / 100d); ++ } ++} +diff --git a/src/main/java/gg/pufferfish/pufferfish/flare/collectors/WorldCountCollector.java b/src/main/java/gg/pufferfish/pufferfish/flare/collectors/WorldCountCollector.java +new file mode 100644 +index 0000000000000000000000000000000000000000..029d840e28d67d26d3c0dd6785e25dbf15f9226c +--- /dev/null ++++ b/src/main/java/gg/pufferfish/pufferfish/flare/collectors/WorldCountCollector.java +@@ -0,0 +1,45 @@ ++package gg.pufferfish.pufferfish.flare.collectors; ++ ++import co.technove.flare.live.CollectorData; ++import co.technove.flare.live.LiveCollector; ++import co.technove.flare.live.formatter.SuffixFormatter; ++import gg.pufferfish.pufferfish.flare.CustomCategories; ++import org.bukkit.Bukkit; ++import org.bukkit.World; ++ ++import java.time.Duration; ++ ++public class WorldCountCollector extends LiveCollector { ++ ++ private static final CollectorData PLAYER_COUNT = new CollectorData("airplane:world:playercount", "Player Count", "The number of players currently on the server.", new SuffixFormatter(" Player", " Players"), CustomCategories.ENTITIES_AND_CHUNKS); ++ private static final CollectorData ENTITY_COUNT = new CollectorData("airplane:world:entitycount", "Entity Count", "The number of entities in all worlds", new SuffixFormatter(" Entity", " Entities"), CustomCategories.ENTITIES_AND_CHUNKS); ++ private static final CollectorData CHUNK_COUNT = new CollectorData("airplane:world:chunkcount", "Chunk Count", "The number of chunks currently loaded.", new SuffixFormatter(" Chunk", " Chunks"), CustomCategories.ENTITIES_AND_CHUNKS); ++ private static final CollectorData TILE_ENTITY_COUNT = new CollectorData("airplane:world:blockentitycount", "Block Entity Count", "The number of block entities currently loaded.", new SuffixFormatter(" Block Entity", " Block Entities"), CustomCategories.ENTITIES_AND_CHUNKS); ++ ++ public WorldCountCollector() { ++ super(PLAYER_COUNT, ENTITY_COUNT, CHUNK_COUNT, TILE_ENTITY_COUNT); ++ ++ this.interval = Duration.ofSeconds(5); ++ } ++ ++ @Override ++ public void run() { ++ if (true) return; // This doesn't work, and it's not worth fixing at the moment. ++ int entities = 0; ++ int chunkCount = 0; ++ int tileEntityCount = 0; ++ ++ if (!Bukkit.isStopping()) { ++ for (World world : Bukkit.getWorlds()) { ++ world.getEntityCount(); ++ chunkCount += world.getChunkCount(); ++ tileEntityCount += world.getTileEntityCount(); ++ } ++ } ++ ++ this.report(PLAYER_COUNT, Bukkit.getOnlinePlayers().size()); ++ this.report(ENTITY_COUNT, entities); ++ this.report(CHUNK_COUNT, chunkCount); ++ this.report(TILE_ENTITY_COUNT, tileEntityCount); ++ } ++} diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/PufferfishSentryAppender.java b/src/main/java/gg/pufferfish/pufferfish/sentry/PufferfishSentryAppender.java new file mode 100644 index 0000000000000000000000000000000000000000..731ef11c7a025ae95ed8a757b530d834733d0621 @@ -1502,10 +2228,10 @@ index 6efb8b10f17c70b05128039376d254e6beda3841..57e8c6673c7cfe447a75f15506e80000 public static long getCoordinateKey(final ChunkPos pair) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 753a917d34a1e1c1521a8916bc8e44a6acd90a46..33a5e900c2cab99c311fa5f5b71a609cf8f802cb 100644 +index 4450d825a5474da211f0e83f845d8c7129fa08aa..6d5e9400892b86562519a893349ca55e566bfb24 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -309,6 +309,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1654,7 +1656,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop chunkConsumer) { diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 190e9761087baec5827d722a8281f0ffb6798341..50cf4d200bc2892f2140c9929193b4b20ad2bd17 100644 +index b7fd8e70413c38923d0719aff803449e392383ac..d5cb594f0b17ec9dc1a19cdb99bba553e70171be 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -170,6 +170,7 @@ public class ServerEntity { - boolean flag4 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L; +@@ -185,6 +185,7 @@ public class ServerEntity { + boolean flag6 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L; - if (!flag4 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround() && !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync + if (!flag6 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround() && !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync + if (flag2 || flag3 || this.entity instanceof AbstractArrow) { // Pufferfish if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) { if (flag2) { packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.isOnGround()); -@@ -179,6 +180,7 @@ public class ServerEntity { - } else { - packet1 = new ClientboundMoveEntityPacket.PosRot(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), (byte) i, (byte) j, this.entity.isOnGround()); +@@ -198,6 +199,7 @@ public class ServerEntity { + flag4 = true; + flag5 = true; } + } // Pufferfish } else { this.wasOnGround = this.entity.isOnGround(); this.teleportDelay = 0; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e84c67f02bce4c2f9c4eeca1b888d53377fb20d7..619ee9d8b99970fb6fce19438f29e09858412ac4 100644 +index 5a5ff40df37db9cbd53c584ed26a3ce4888b29c0..ff2862bf1f511196d1e911e2584262ed728e9a81 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -709,6 +709,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1786,10 +2512,10 @@ index e84c67f02bce4c2f9c4eeca1b888d53377fb20d7..619ee9d8b99970fb6fce19438f29e098 this.getRandomBlockPosition(j, 0, k, 15, blockposition); int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15) + 1; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index bac6b62419d85b3772ef243aa3d5f73311abdda7..2ca19bbe3a71091843fc7175d726c70321d1fee3 100644 +index 2d8488b9aa088b6d5f0c7e557b8ad0b29bc4cd88..24d48fb4a63c2db19c7f957ad2260415fe1db9fe 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1204,6 +1204,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1206,6 +1206,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleEditBook(ServerboundEditBookPacket packet) { @@ -1797,7 +2523,7 @@ index bac6b62419d85b3772ef243aa3d5f73311abdda7..2ca19bbe3a71091843fc7175d726c703 // Paper start if (!this.cserver.isPrimaryThread()) { List pageList = packet.getPages(); -@@ -2352,6 +2353,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2346,6 +2347,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } private boolean updateChatOrder(Instant timestamp) { @@ -1841,19 +2567,19 @@ index 241fec02e6869c638d3a160819b32173a081467b..6a8f9e8f5bf108674c47018def28906e public int getContainerSize() { return this.container1.getContainerSize() + this.container2.getContainerSize(); diff --git a/src/main/java/net/minecraft/world/Container.java b/src/main/java/net/minecraft/world/Container.java -index 540bc9500c35c0db719b00aa26f6fb3a1b08ed9f..806cb760822a99316b08ad95ff8922df717050e2 100644 +index 04b1531572e8fff1e46fe1c94e7fc863841e0f66..47ddc42f2b63d9d3fae5ae6ea93d418352d76c94 100644 --- a/src/main/java/net/minecraft/world/Container.java +++ b/src/main/java/net/minecraft/world/Container.java -@@ -2,6 +2,8 @@ package net.minecraft.world; - +@@ -3,6 +3,8 @@ package net.minecraft.world; import java.util.Set; import java.util.function.Predicate; + import net.minecraft.core.BlockPos; + +import net.minecraft.core.Direction; // Pufferfish import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -@@ -10,6 +12,63 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity; +@@ -13,6 +15,63 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity; // CraftBukkit end public interface Container extends Clearable { @@ -1916,9 +2642,9 @@ index 540bc9500c35c0db719b00aa26f6fb3a1b08ed9f..806cb760822a99316b08ad95ff8922df + // Pufferfish end int LARGE_MAX_STACK_SIZE = 64; - + int DEFAULT_DISTANCE_LIMIT = 8; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1eaab1f6923e6aa34b643293347348e5cc19af3c..3073b34a0e0281b6b0330721bb0440147de28511 100644 +index 9a1e8589e6b371869b2199650172d61ae186c907..8a2429f915da389360dcb16609fef7701b4a863a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -291,7 +291,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1930,7 +2656,7 @@ index 1eaab1f6923e6aa34b643293347348e5cc19af3c..3073b34a0e0281b6b0330721bb044014 private ChunkPos chunkPosition; private Vec3 deltaMovement; private float yRot; -@@ -414,6 +414,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -415,6 +415,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return this.originWorld; } // Paper end @@ -1943,7 +2669,7 @@ index 1eaab1f6923e6aa34b643293347348e5cc19af3c..3073b34a0e0281b6b0330721bb044014 public float getBukkitYaw() { return this.yRot; } -@@ -488,17 +494,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -489,17 +495,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.isLegacyTrackingEntity = isLegacyTrackingEntity; } @@ -1981,7 +2707,7 @@ index 1eaab1f6923e6aa34b643293347348e5cc19af3c..3073b34a0e0281b6b0330721bb044014 for (Entity passenger : passengers) { org.spigotmc.TrackingRange.TrackingRangeType passengerType = passenger.trackingRangeType; int passengerRange = chunkMap.getEntityTrackerRange(passengerType.ordinal()); -@@ -507,6 +532,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -508,6 +533,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { range = passengerRange; } } @@ -1991,7 +2717,7 @@ index 1eaab1f6923e6aa34b643293347348e5cc19af3c..3073b34a0e0281b6b0330721bb044014 return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this)); } -@@ -788,6 +816,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -789,6 +817,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // CraftBukkit end public void baseTick() { @@ -2004,7 +2730,7 @@ index 1eaab1f6923e6aa34b643293347348e5cc19af3c..3073b34a0e0281b6b0330721bb044014 this.level.getProfiler().push("entityBaseTick"); if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Update last hurt when ticking this.feetBlockState = null; -@@ -4092,16 +4126,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4156,16 +4190,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public boolean updateFluidHeightAndDoFluidPushing(TagKey tag, double speed) { @@ -2030,7 +2756,7 @@ index 1eaab1f6923e6aa34b643293347348e5cc19af3c..3073b34a0e0281b6b0330721bb044014 double d1 = 0.0D; boolean flag = this.isPushedByFluid(); boolean flag1 = false; -@@ -4109,14 +4145,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4173,14 +4209,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { int k1 = 0; BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); @@ -2098,7 +2824,7 @@ index 1eaab1f6923e6aa34b643293347348e5cc19af3c..3073b34a0e0281b6b0330721bb044014 if (d2 >= axisalignedbb.minY) { flag1 = true; -@@ -4138,9 +4221,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4202,9 +4285,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // CraftBukkit end } } @@ -2112,10 +2838,10 @@ index 1eaab1f6923e6aa34b643293347348e5cc19af3c..3073b34a0e0281b6b0330721bb044014 if (vec3d.length() > 0.0D) { if (k1 > 0) { diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 41ff954010c11d524ffb90abd22c29a1d8d8f5a0..ac7ee31f2bfe5d4139b793a698317db50b39fe40 100644 +index ceacc0d383e2ee674783d3c0a7df0a951595faca..8af0918d3a62de58a4b2af55022c812bb0e46092 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -293,6 +293,8 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -300,6 +300,8 @@ public class EntityType implements FeatureElement, EntityTypeT private final boolean canSpawnFarFromPlayer; private final int clientTrackingRange; private final int updateInterval; @@ -2125,27 +2851,27 @@ index 41ff954010c11d524ffb90abd22c29a1d8d8f5a0..ac7ee31f2bfe5d4139b793a698317db5 private String descriptionId; @Nullable diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 902a19def9d902e7bfb476688354a070633a3454..f0acc1fd51a49589c33c089562ac80053b4c1ef9 100644 +index dcfb71b5a53df789e366fea2080921d677549a2e..791f672b30f2a4d3b329e2ce0f4fb9c2ca627b01 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -143,7 +143,6 @@ import org.bukkit.event.entity.EntityTeleportEvent; +@@ -141,7 +141,6 @@ import org.bukkit.event.entity.EntityTeleportEvent; import org.bukkit.event.player.PlayerItemConsumeEvent; // CraftBukkit end -import co.aikar.timings.MinecraftTimings; // Paper - public abstract class LivingEntity extends Entity { + public abstract class LivingEntity extends Entity implements Attackable { -@@ -402,7 +401,7 @@ public abstract class LivingEntity extends Entity { +@@ -397,7 +396,7 @@ public abstract class LivingEntity extends Entity implements Attackable { boolean flag = this instanceof net.minecraft.world.entity.player.Player; if (!this.level.isClientSide) { - if (this.isInWall()) { + if ((!gg.pufferfish.pufferfish.PufferfishConfig.enableSuffocationOptimization || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) { // Pufferfish - optimize suffocation - this.hurt(DamageSource.IN_WALL, 1.0F); + this.hurt(this.damageSources().inWall(), 1.0F); } else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) { double d0 = this.level.getWorldBorder().getDistanceToBorder(this) + this.level.getWorldBorder().getDamageSafeZone(); -@@ -1327,6 +1326,15 @@ public abstract class LivingEntity extends Entity { +@@ -1321,6 +1320,15 @@ public abstract class LivingEntity extends Entity implements Attackable { return this.getHealth() <= 0.0F; } @@ -2161,7 +2887,7 @@ index 902a19def9d902e7bfb476688354a070633a3454..f0acc1fd51a49589c33c089562ac8005 @Override public boolean hurt(DamageSource source, float amount) { if (this.isInvulnerableTo(source)) { -@@ -1934,6 +1942,20 @@ public abstract class LivingEntity extends Entity { +@@ -1929,6 +1937,20 @@ public abstract class LivingEntity extends Entity implements Attackable { return this.lastClimbablePos; } @@ -2182,7 +2908,7 @@ index 902a19def9d902e7bfb476688354a070633a3454..f0acc1fd51a49589c33c089562ac8005 public boolean onClimbable() { if (this.isSpectator()) { return false; -@@ -3647,7 +3669,10 @@ public abstract class LivingEntity extends Entity { +@@ -3609,7 +3631,10 @@ public abstract class LivingEntity extends Entity implements Attackable { Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); // Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists @@ -2195,10 +2921,10 @@ index 902a19def9d902e7bfb476688354a070633a3454..f0acc1fd51a49589c33c089562ac8005 } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 49b983064ea810382b6112f5dc7f93ba4e5710bd..94b45579dc371ee980565aed2f5dee78ebd44427 100644 +index 02cb6b8c1d59855ff4a8aad3024fe12007eca0ee..636e601b004a412d02e5be86e97d489b52c28e1b 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -210,14 +210,16 @@ public abstract class Mob extends LivingEntity { +@@ -215,14 +215,16 @@ public abstract class Mob extends LivingEntity implements Targeting { return this.lookControl; } @@ -2217,7 +2943,7 @@ index 49b983064ea810382b6112f5dc7f93ba4e5710bd..94b45579dc371ee980565aed2f5dee78 this.targetSelector.tick(); } } -@@ -878,16 +880,20 @@ public abstract class Mob extends LivingEntity { +@@ -907,16 +909,20 @@ public abstract class Mob extends LivingEntity implements Targeting { if (i % 2 != 0 && this.tickCount > 1) { this.level.getProfiler().push("targetSelector"); @@ -2354,10 +3080,10 @@ index a7575b5ef56af6f53448d391abb4956e130148ca..e752c83df50fb9b670ecea2abc95426c return false; } diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -index 320c558bbe80d4bbc641e895ec43cfa2b45e8d70..1572a81ce1718964d795f2a2a411402f88901c73 100644 +index f5efdf59617d43de18a2267351fa784c0be3ae83..59338d739b6130f667d151bc27646c4a346886a2 100644 --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -@@ -256,13 +256,22 @@ public class Bat extends AmbientCreature { +@@ -251,13 +251,22 @@ public class Bat extends AmbientCreature { } } @@ -2382,10 +3108,10 @@ index 320c558bbe80d4bbc641e895ec43cfa2b45e8d70..1572a81ce1718964d795f2a2a411402f @Override protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) { diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java -index c0084b1f146a4697194c421519537e612ff737c0..c66a214dfbde7fd8e7a68efaa82ac260178f297f 100644 +index 9b57d2b766f2de2d3fb4a3b5ef4df8d6756a1942..a41d8101c960163803179d3717889aee6182d0bb 100644 --- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java -@@ -228,9 +228,11 @@ public class Allay extends PathfinderMob implements InventoryCarrier { +@@ -223,9 +223,11 @@ public class Allay extends PathfinderMob implements InventoryCarrier { return 0.4F; } @@ -2398,7 +3124,7 @@ index c0084b1f146a4697194c421519537e612ff737c0..c66a214dfbde7fd8e7a68efaa82ac260 this.level.getProfiler().pop(); this.level.getProfiler().push("allayActivityUpdate"); diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -index 0d7f951e3837de7553d93f3d4525276048feb405..02219f5ca614fefffa1ceb3c7036dfe1c90c8676 100644 +index a4e98b02175da96472474b8d7ad5975ce4d2fc43..38d21943fb2940f53c2d0ac2c3b94a6f0e46e700 100644 --- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java @@ -285,9 +285,11 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder { - return this.getDeltaMovement().horizontalDistanceSqr() > 1.0E-6D && this.isInWaterOrBubble(); +@@ -167,9 +167,11 @@ public class Frog extends Animal implements VariantHolder { + return true; } + private int behaviorTick = 0; // Pufferfish @@ -2446,7 +3172,7 @@ index 9058f9f2e561cda9f475f33218bf7a78297de4bc..e591b0a09f5a8475b3ec9cd28bd5d5b6 this.level.getProfiler().pop(); this.level.getProfiler().push("tadpoleActivityUpdate"); diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -index e9f7c08ae3ea9c578971b1ede88788572c20e277..0f365b9dbb160d90ddf5fcd40895305df48ce916 100644 +index cfa904d42734d0fb0c1ed8b18f4d8bc131027962..4fdc3bd591b6df4c28901e4571aa23baf034d885 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java @@ -188,9 +188,11 @@ public class Goat extends Animal { @@ -2462,10 +3188,10 @@ index e9f7c08ae3ea9c578971b1ede88788572c20e277..0f365b9dbb160d90ddf5fcd40895305d this.level.getProfiler().pop(); this.level.getProfiler().push("goatActivityUpdate"); diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index f0ccdfbd7d7be8c6e302609accf8fe9cac8885c4..c58496c84b2b3f86890050813041fa49711f3a01 100644 +index d47b3ac633e7936d30abfda6fc46c2c7412d76fe..453f0f7042bdf204db73be139aa36f211c5455e7 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -255,10 +255,16 @@ public class ItemEntity extends Entity { +@@ -264,10 +264,16 @@ public class ItemEntity extends Entity implements TraceableEntity { if (entityitem.isMergable()) { // Paper Start - Fix items merging through walls if (this.level.paperConfig().fixes.fixItemsMergingThroughWalls) { @@ -2483,7 +3209,7 @@ index f0ccdfbd7d7be8c6e302609accf8fe9cac8885c4..c58496c84b2b3f86890050813041fa49 // Paper End this.tryToMerge(entityitem); diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index f4002ac7cba7d5e41b4f11b98212c625f6a92a65..ff0e09a7387e7dc9ca136d3e48e640b9e9cb4bf3 100644 +index 418d6301f067803e2471e59ac2d52a68cbff249b..c2f5dabb41b172547864decc06aa632d89dff3e1 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java @@ -322,11 +322,17 @@ public class EnderMan extends Monster implements NeutralMob { @@ -2539,7 +3265,7 @@ index afa7ecfa8453da510ec5ccecb1ceeb1d9893d259..b401fb4f276ca81b4bb18426ee56abed this.level.getProfiler().pop(); PiglinAi.updateActivity(this); diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java -index 1ae7408048f951cb94d7cfbea60efc5567b1af84..904826ea563bd2eb469f403df459def62cc1b5e6 100644 +index b2b63d9df3c07696f47281e9be74f1799f50b93e..907d77dd74066c723238155b42028a811365b1f8 100644 --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java @@ -270,11 +270,13 @@ public class Warden extends Monster implements VibrationListener.VibrationListen @@ -2557,7 +3283,7 @@ index 1ae7408048f951cb94d7cfbea60efc5567b1af84..904826ea563bd2eb469f403df459def6 this.level.getProfiler().pop(); super.customServerAiStep(); diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 18eac340386a396c9850f53f30d20a41c1437788..76a9da8209d557b913c49ccd281bf147b9ac4fa4 100644 +index 6023b9eb3001e1a98ab8b970d853c4e7c7603f4d..5402a084ef5fe0b3cfea897a90cffade1eff5b66 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -140,6 +140,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -2589,10 +3315,10 @@ index 18eac340386a396c9850f53f30d20a41c1437788..76a9da8209d557b913c49ccd281bf147 if (this.assignProfessionWhenSpawned) { this.assignProfessionWhenSpawned = false; diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java -index 5bc033bf59d49eda1f8f2574165bbcbeab7faa0f..004091f2026f3c58d9bce49f1b07f6441df8da8a 100644 +index 27c028ab6b1edb6e413af3bbaa27bf30f2d85540..302ca7391109c10e81a7745504b3c530bc3be6ad 100644 --- a/src/main/java/net/minecraft/world/entity/player/Inventory.java +++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java -@@ -681,6 +681,8 @@ public class Inventory implements Container, Nameable { +@@ -682,6 +682,8 @@ public class Inventory implements Container, Nameable { } public boolean contains(ItemStack stack) { @@ -2601,7 +3327,7 @@ index 5bc033bf59d49eda1f8f2574165bbcbeab7faa0f..004091f2026f3c58d9bce49f1b07f644 Iterator iterator = this.compartments.iterator(); while (iterator.hasNext()) { -@@ -695,6 +697,18 @@ public class Inventory implements Container, Nameable { +@@ -696,6 +698,18 @@ public class Inventory implements Container, Nameable { } } } @@ -2621,10 +3347,10 @@ index 5bc033bf59d49eda1f8f2574165bbcbeab7faa0f..004091f2026f3c58d9bce49f1b07f644 return false; } diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index 893975e8587b9036f622e2088c302e33004496d2..a000834c4ea8645a2fcd697e6396f797c42c8fa3 100644 +index 8b2a3a8482018b7db7de81bc295862f783e17ce5..e6f87e1e3c99195ed11c81162cb54e7f5750c4ba 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -43,6 +43,36 @@ public abstract class Projectile extends Entity { +@@ -44,6 +44,36 @@ public abstract class Projectile extends Entity implements TraceableEntity { super(type, world); } @@ -2662,7 +3388,7 @@ index 893975e8587b9036f622e2088c302e33004496d2..a000834c4ea8645a2fcd697e6396f797 if (entity != null) { this.ownerUUID = entity.getUUID(); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java -index cc74eeb45913fab03e85969957215d2811252a83..086feb19f11a6c646b5a1a06aef4df05a4beae8b 100644 +index 08f027cdcaeeca7b545483cb8c5eb8d13e4933b9..992ff554643b149d9c6101562a9754a84263ed7e 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java @@ -27,7 +27,10 @@ import org.bukkit.inventory.InventoryHolder; @@ -2709,10 +3435,10 @@ index cc74eeb45913fab03e85969957215d2811252a83..086feb19f11a6c646b5a1a06aef4df05 } diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java -index e7c06d98532160499f2610f69de27e30a326b16f..830622bd92431df5bc4a57fe6785689f8585e14b 100644 +index f4f3f3a19d3cadaef1ae1a47daa68251a983dcf2..8da06f8bea0239c5206d5d4f4ff48bdeb0a89f9d 100644 --- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java +++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java -@@ -26,8 +26,13 @@ public class ShapelessRecipe implements CraftingRecipe { +@@ -27,8 +27,13 @@ public class ShapelessRecipe implements CraftingRecipe { final CraftingBookCategory category; final ItemStack result; final NonNullList ingredients; @@ -2726,7 +3452,7 @@ index e7c06d98532160499f2610f69de27e30a326b16f..830622bd92431df5bc4a57fe6785689f this.id = id; this.group = group; this.category = category; -@@ -81,6 +86,28 @@ public class ShapelessRecipe implements CraftingRecipe { +@@ -82,6 +87,28 @@ public class ShapelessRecipe implements CraftingRecipe { } public boolean matches(CraftingContainer inventory, Level world) { @@ -2756,7 +3482,7 @@ index e7c06d98532160499f2610f69de27e30a326b16f..830622bd92431df5bc4a57fe6785689f int i = 0; diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java -index d1eefa6ef3e9abfe7af4d8310aa64465fa2d5463..0f4aa330e5b179bb706a31917c671f165e22b9cd 100644 +index 2ee9e8e3c1a28c1823de8e1fe421cc1f3e72f384..cf4a8084158b10bf047d418dda375f8c1fd3216e 100644 --- a/src/main/java/net/minecraft/world/level/BlockGetter.java +++ b/src/main/java/net/minecraft/world/level/BlockGetter.java @@ -73,6 +73,16 @@ public interface BlockGetter extends LevelHeightAccessor { @@ -2777,18 +3503,18 @@ index d1eefa6ef3e9abfe7af4d8310aa64465fa2d5463..0f4aa330e5b179bb706a31917c671f16 default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) { // Paper start - Prevent raytrace from loading chunks diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java -index 663c1d8c1611af915a1bae733920dd75ad73feb1..c15e4d95baacd30f9614dc5526dc8fc12ae5bd06 100644 +index edd2c9d0cf5a81c779011cb4215d496a8987b784..29d1f78dbc8410f9292f409b17705acde55979df 100644 --- a/src/main/java/net/minecraft/world/level/GameRules.java +++ b/src/main/java/net/minecraft/world/level/GameRules.java -@@ -98,6 +98,7 @@ public class GameRules { - public static final GameRules.Key RULE_LAVA_SOURCE_CONVERSION = GameRules.register("lavaSourceConversion", GameRules.Category.UPDATES, GameRules.BooleanValue.create(false)); +@@ -100,6 +100,7 @@ public class GameRules { public static final GameRules.Key RULE_GLOBAL_SOUND_EVENTS = GameRules.register("globalSoundEvents", GameRules.Category.MISC, GameRules.BooleanValue.create(true)); + public static final GameRules.Key RULE_DO_VINES_SPREAD = GameRules.register("doVinesSpread", GameRules.Category.UPDATES, GameRules.BooleanValue.create(true)); private final Map, GameRules.Value> rules; + private final GameRules.Value[] gameruleArray; private static > GameRules.Key register(String name, GameRules.Category category, GameRules.Type type) { GameRules.Key gamerules_gamerulekey = new GameRules.Key<>(name, category); -@@ -116,17 +117,33 @@ public class GameRules { +@@ -118,17 +119,33 @@ public class GameRules { } public GameRules() { @@ -2825,7 +3551,7 @@ index 663c1d8c1611af915a1bae733920dd75ad73feb1..c15e4d95baacd30f9614dc5526dc8fc1 } public CompoundTag createTag() { -@@ -185,6 +202,10 @@ public class GameRules { +@@ -187,6 +204,10 @@ public class GameRules { } public static final class Key> { @@ -2837,10 +3563,10 @@ index 663c1d8c1611af915a1bae733920dd75ad73feb1..c15e4d95baacd30f9614dc5526dc8fc1 final String id; private final GameRules.Category category; diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index db971ca4136c7f922d630f38aa5c78cb04adbdfa..eb0a31c885ea64da00abcd5e67083392138b1ca0 100644 +index 973ecd50f9cb6b86c353586e84d15dcb118ccb60..6aec1983a0236d6aa0507a2b3ad1c08b3330f0fc 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -270,6 +270,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -274,6 +274,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public abstract ResourceKey getTypeKey(); @@ -2855,10 +3581,10 @@ index db971ca4136c7f922d630f38aa5c78cb04adbdfa..eb0a31c885ea64da00abcd5e67083392 + @Override public final int getHeight() { return this.height; } + // Pufferfish end + - protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor + protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper -@@ -292,6 +303,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -296,6 +307,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { }); final DimensionType dimensionmanager = (DimensionType) holder.value(); @@ -2872,7 +3598,7 @@ index db971ca4136c7f922d630f38aa5c78cb04adbdfa..eb0a31c885ea64da00abcd5e67083392 this.dimension = resourcekey; this.isClientSide = flag; if (dimensionmanager.coordinateScale() != 1.0D) { -@@ -407,6 +425,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -413,6 +431,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return null; } @@ -2964,7 +3690,7 @@ index db971ca4136c7f922d630f38aa5c78cb04adbdfa..eb0a31c885ea64da00abcd5e67083392 public boolean isInWorldBounds(BlockPos pos) { return pos.isInsideBuildHeightAndWorldBoundsHorizontal(this); // Paper - use better/optimized check } -@@ -919,13 +1022,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -925,13 +1028,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { try { tickConsumer.accept(entity); MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick @@ -2980,7 +3706,7 @@ index db971ca4136c7f922d630f38aa5c78cb04adbdfa..eb0a31c885ea64da00abcd5e67083392 // Paper end } } -@@ -1452,6 +1555,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1454,6 +1557,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } public ProfilerFiller getProfiler() { @@ -2989,7 +3715,7 @@ index db971ca4136c7f922d630f38aa5c78cb04adbdfa..eb0a31c885ea64da00abcd5e67083392 } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 01b21f520ef1c834b9bafc3de85c1fa4fcf539d6..5521418fa307b3eeb4f02a10c39f05b360d1d06e 100644 +index 15d266fc97eb73338f4f6fb2cfe25d6861e79810..6180679d922ea61d05d452971ec2d506a724d3c3 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java @@ -417,12 +417,12 @@ public final class NaturalSpawner { @@ -3010,7 +3736,7 @@ index 01b21f520ef1c834b9bafc3de85c1fa4fcf539d6..5521418fa307b3eeb4f02a10c39f05b3 return new BlockPos(i, l, j); } diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java -index c4f1173aab1e53412a65793e06238e637910475a..a4c484cacbf6cec7b9225f3f66a05827bf8ef7a3 100644 +index 65012a12e1430956ef55ced56773e6354ac26444..ed439b7e94646141c93a7dd3704d1cdeb5c27e16 100644 --- a/src/main/java/net/minecraft/world/level/biome/Biome.java +++ b/src/main/java/net/minecraft/world/level/biome/Biome.java @@ -66,14 +66,20 @@ public final class Biome { @@ -3035,7 +3761,7 @@ index c4f1173aab1e53412a65793e06238e637910475a..a4c484cacbf6cec7b9225f3f66a05827 }); }); -@@ -114,17 +120,15 @@ public final class Biome { +@@ -118,17 +124,15 @@ public final class Biome { @Deprecated public float getTemperature(BlockPos blockPos) { long l = blockPos.asLong(); @@ -3137,10 +3863,10 @@ index a71414397bd45ee7bcacfeef0041d80dfa25f114..d66806565770cb03a21794f99e5c4b0f @Override diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index d76603c4172aa10889949c6c2acff05fee02a13d..034a0665f56fca37a48972671cebc6ec249db120 100644 +index cba114f554644a37339c93026630c66c43f524b9..746b71ea96ecc441afd45cc779a1777c15d58ff2 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -45,7 +45,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -47,7 +47,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen public static final int MOVE_ITEM_SPEED = 8; public static final int HOPPER_CONTAINER_SIZE = 5; @@ -3151,7 +3877,7 @@ index d76603c4172aa10889949c6c2acff05fee02a13d..034a0665f56fca37a48972671cebc6ec private int cooldownTime; private long tickedGameTime; -@@ -81,14 +84,37 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -83,14 +86,37 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen public HopperBlockEntity(BlockPos pos, BlockState state) { super(BlockEntityType.HOPPER, pos, state); @@ -3191,7 +3917,7 @@ index d76603c4172aa10889949c6c2acff05fee02a13d..034a0665f56fca37a48972671cebc6ec if (!this.tryLoadLootTable(nbt)) { ContainerHelper.loadAllItems(nbt, this.items); } -@@ -160,7 +186,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -162,7 +188,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen flag = HopperBlockEntity.ejectItems(world, pos, state, (Container) blockEntity, blockEntity); // CraftBukkit } @@ -3200,16 +3926,7 @@ index d76603c4172aa10889949c6c2acff05fee02a13d..034a0665f56fca37a48972671cebc6ec flag |= booleansupplier.getAsBoolean(); } -@@ -199,7 +225,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - skipPushModeEventFire = skipHopperEvents; - boolean foundItem = false; - for (int i = 0; i < hopper.getContainerSize(); ++i) { -- final ItemStack item = hopper.getItem(i); -+ final ItemStack item = hopper.getItem(i); // Pufferfish - if (!item.isEmpty()) { - foundItem = true; - ItemStack origItemStack = item; -@@ -408,12 +434,18 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -451,11 +477,18 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen } private static boolean isFullContainer(Container inventory, Direction direction) { @@ -3221,16 +3938,16 @@ index d76603c4172aa10889949c6c2acff05fee02a13d..034a0665f56fca37a48972671cebc6ec } private static boolean isEmptyContainer(Container inv, Direction facing) { - // Paper start - return allMatch(inv, facing, IS_EMPTY_TEST); ++ // Paper start + // Pufferfish start - use bitsets + //return allMatch(inv, facing, IS_EMPTY_TEST); + return inv.isCompletelyEmpty(facing); + // Pufferfish end } - private static boolean allMatch(Container iinventory, Direction enumdirection, java.util.function.BiPredicate test) { - if (iinventory instanceof WorldlyContainer) { -@@ -592,7 +624,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen + + public static boolean suckInItems(Level world, Hopper hopper) { +@@ -636,7 +669,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (HopperBlockEntity.canPlaceItemInContainer(to, stack, slot, side)) { boolean flag = false; @@ -3239,7 +3956,7 @@ index d76603c4172aa10889949c6c2acff05fee02a13d..034a0665f56fca37a48972671cebc6ec if (itemstack1.isEmpty()) { // Spigot start - SPIGOT-6693, InventorySubcontainer#setItem -@@ -745,7 +777,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen +@@ -813,7 +846,10 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @Override protected void setItems(NonNullList list) { @@ -3252,26 +3969,25 @@ index d76603c4172aa10889949c6c2acff05fee02a13d..034a0665f56fca37a48972671cebc6ec public static void entityInside(Level world, BlockPos pos, BlockState state, Entity entity, HopperBlockEntity blockEntity) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java -index d559f93a9a09bac414dd5d58afccad42c127f09b..13e749a3c40f0b2cc002f13675a9a56eedbefdac 100644 +index 79b01e32f89defb6b78f4764600d33d4945af592..6d62cc8fb347ccafd51df05896e616995990f005 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java -@@ -96,13 +96,8 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc +@@ -97,12 +97,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc public boolean isEmpty() { this.unpackLootTable((Player)null); // Paper start -- for (ItemStack itemStack : this.getItems()) { +- for (final ItemStack itemStack : this.getItems()) { - if (!itemStack.isEmpty()) { - return false; - } - } +- return true; + return this.isCompletelyEmpty(null); // Pufferfish - use super // Paper end -- return true; } - @Override diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 28e4b302284f955a73e75d0f4276d55fb51826f5..de7a5f3812a017131fd1b32fbeff10e325b1cd2e 100644 +index 206dc04086a218b510930739a6c573f2653ab0fa..e7e2b0fc88c9320449bcd0e0929269c2508886e4 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -88,6 +88,18 @@ public class LevelChunk extends ChunkAccess { @@ -3302,7 +4018,7 @@ index 28e4b302284f955a73e75d0f4276d55fb51826f5..de7a5f3812a017131fd1b32fbeff10e3 public org.bukkit.Chunk bukkitChunk; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java -index b0c9fce9d4e06cac139e341d218d0b6aac1f1943..f25467ad1c5bac7eaef4b63b2845ad04d7c76e4e 100644 +index 1b80a91fa36c59a31b57ef7ef4a68eacbb0f17f5..b5e118456af6421ae3f85cb8232dc97a8b2d46b7 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java @@ -27,6 +27,7 @@ public class LevelChunkSection { @@ -3351,7 +4067,7 @@ index 4cdfc433df67afcd455422e9baf56f167dd712ae..57fcf3910f45ce371ac2e237b277b103 private void ensureActiveIsNotIterated() { // Paper - replace with better logic, do not delay removals diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java -index 0ffc131baf5c0edc4f2ca0f466fcdb20be4a47b8..3f72703d2063a082546305eeb0a1b21629ddb1b2 100644 +index bf4de7b8fd630c596e096a411a8c84c64c13ebf7..6063665b8848a2cd9f0b262eed36a9dd48db6035 100644 --- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java +++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java @@ -43,6 +43,8 @@ public abstract class FlowingFluid extends Fluid { @@ -3543,10 +4259,10 @@ index ebe65474a4a05ff1637d7f37ebcfe690af59def5..42142c512b12e5b269c19f1e821c50e7 @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bbb8335dae0a3e2761e6bbb8dc723bcf28cd82ba..7ddf52de4b095f63c75b696008fcdde6345fc3c8 100644 +index f9a9d2bb7b6d1bf4a0931438de4d8c7ee0757479..b2d94582037c091bd6a04451bf62b3f9c4923d19 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -261,7 +261,7 @@ import javax.annotation.Nullable; // Paper +@@ -256,7 +256,7 @@ import javax.annotation.Nullable; // Paper import javax.annotation.Nonnull; // Paper public final class CraftServer implements Server { @@ -3555,7 +4271,7 @@ index bbb8335dae0a3e2761e6bbb8dc723bcf28cd82ba..7ddf52de4b095f63c75b696008fcdde6 private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); -@@ -1048,6 +1048,11 @@ public final class CraftServer implements Server { +@@ -1043,6 +1043,11 @@ public final class CraftServer implements Server { plugin.getDescription().getName(), "This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies." )); @@ -3579,8 +4295,45 @@ index f7ea77dd82d978ad307f99c743efacfb34478b3d..009ab06182359862b8f543030ec4fe4e + MinecraftServer.getServer().getRecipeManager().addRecipe(new net.minecraft.world.item.crafting.ShapelessRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), CraftRecipe.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data, true)); } } +diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/MinecraftInternalPlugin.java b/src/main/java/org/bukkit/craftbukkit/scheduler/MinecraftInternalPlugin.java +index d96399e9bf1a58db5a4a22e58abb99e7660e0694..eb19f679ee498e51d02fe9a961cf02699cf75848 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scheduler/MinecraftInternalPlugin.java ++++ b/src/main/java/org/bukkit/craftbukkit/scheduler/MinecraftInternalPlugin.java +@@ -22,7 +22,8 @@ public class MinecraftInternalPlugin extends PluginBase { + private boolean enabled = true; + + private final String pluginName; +- private PluginDescriptionFile pdf; ++ private org.bukkit.plugin.PluginLogger logger; ++ private PluginDescriptionFile pdf; // Pufferfish + + public MinecraftInternalPlugin() { + this.pluginName = "Minecraft"; +@@ -81,7 +82,12 @@ public class MinecraftInternalPlugin extends PluginBase { + + @Override + public PluginLogger getLogger() { +- throw new UnsupportedOperationException("Not supported."); ++ // Pufferfish start ++ if (this.logger == null) { ++ this.logger = new org.bukkit.plugin.PluginLogger(this); // Pufferfish ++ } ++ return this.logger; ++ // Pufferfish end + } + + @Override +@@ -91,7 +97,7 @@ public class MinecraftInternalPlugin extends PluginBase { + + @Override + public Server getServer() { +- throw new UnsupportedOperationException("Not supported."); ++ return org.bukkit.Bukkit.getServer(); // Pufferfish - impl + } + + @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 81ffcca62c2ebb15889d286bfe9138b86ccfe71e..0ccde7fe2a852f7da72f0b3f5a53cb48d28d1840 100644 +index 64c50c52c11214740de7903e5592b8b6b2c170b3..d4f62940504e3ef7a70e13b1f4a7726f23b4c637 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -464,7 +464,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -3592,6 +4345,18 @@ index 81ffcca62c2ebb15889d286bfe9138b86ccfe71e..0ccde7fe2a852f7da72f0b3f5a53cb48 } @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java +index e948ec5a573b22645664eb53bc3e9932246544e4..e3845dc3357bbb74885ae3a1a08525adde581235 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java +@@ -11,6 +11,7 @@ public class ServerShutdownThread extends Thread { + + @Override + public void run() { ++ try { gg.pufferfish.pufferfish.flare.ProfilingManager.stop(); } catch (Throwable t) {} // Pufferfish - shut down Flare if it's running + try { + // Paper start - try to shutdown on main + server.safeShutdown(false, false); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 774556a62eb240da42e84db4502e2ed43495be17..80553face9c70c2a3d897681e7761df85b22d464 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java diff --git a/patches/server/0002-Purpur-Server-Changes.patch b/patches/server/0002-Purpur-Server-Changes.patch index 6f8e6c3..70de1e2 100644 --- a/patches/server/0002-Purpur-Server-Changes.patch +++ b/patches/server/0002-Purpur-Server-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 -Date: Wed, 15 Mar 2023 05:21:28 +0000 +Date: Thu, 23 Mar 2023 10:35:36 +0900 Subject: [PATCH] Purpur Server Changes Original: PurpurMC @@ -25,24 +25,27 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/build.gradle.kts b/build.gradle.kts -index 8d8c5a8bd2a53ac6d9b36e0330a7be6725aa407c..0435c1eb5c1fa6f9180ee8dc36a61afbac0f952e 100644 +index 3c8293f002f11b430083502362fdc801f44aa138..6c5b3f6a2c4f7b20e3388b63c36b7c4bc4cf179f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -7,9 +7,9 @@ plugins { +@@ -7,12 +7,8 @@ plugins { } dependencies { - implementation(project(":pufferfish-api")) // Pufferfish // Paper -+ implementation(project(":purpur-api")) // Purpur - // Pufferfish start +- // Pufferfish start - implementation("io.papermc.paper:paper-mojangapi:1.19.2-R0.1-SNAPSHOT") { -+ implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") { - exclude("io.papermc.paper", "paper-api") +- exclude("io.papermc.paper", "paper-api") +- } +- // Pufferfish end ++ implementation(project(":purpur-api")) // Purpur ++ implementation("io.papermc.paper:paper-mojangapi:1.19.4-R0.1-SNAPSHOT") // Purpur + // Paper start + implementation("org.jline:jline-terminal-jansi:3.21.0") + implementation("net.minecrell:terminalconsoleappender:1.3.0") +@@ -42,6 +38,10 @@ dependencies { } - // Pufferfish end -@@ -42,6 +42,10 @@ dependencies { - runtimeOnly("mysql:mysql-connector-java:8.0.29") - runtimeOnly("com.lmax:disruptor:3.4.4") // Paper + // Paper end + implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur + implementation("org.mozilla:rhino-engine:1.7.14") // Purpur @@ -51,16 +54,16 @@ index 8d8c5a8bd2a53ac6d9b36e0330a7be6725aa407c..0435c1eb5c1fa6f9180ee8dc36a61afb runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5") runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") -@@ -81,7 +85,7 @@ tasks.jar { +@@ -82,7 +82,7 @@ tasks.jar { attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", - "Implementation-Version" to "git-Pufferfish-$implementationVersion", // Pufferfish -+ "Implementation-Version" to "git-Purpur-$implementationVersion", // Purpur ++ "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur "Implementation-Vendor" to date, // Paper "Specification-Title" to "Bukkit", "Specification-Version" to project.version, -@@ -153,7 +157,7 @@ fun TaskContainer.registerRunTask( +@@ -154,7 +154,7 @@ fun TaskContainer.registerRunTask( name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) { @@ -70,7 +73,7 @@ index 8d8c5a8bd2a53ac6d9b36e0330a7be6725aa407c..0435c1eb5c1fa6f9180ee8dc36a61afb standardInput = System.`in` workingDir = rootProject.layout.projectDirectory diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 692c962193cf9fcc6801fc93f3220bdc673d527b..9713263c3bd34ab8a3bfc0a8797ba0b1b88ed733 100644 +index 692c962193cf9fcc6801fc93f3220bdc673d527b..8cde30544e14f8fc2dac32966ae3c21f8cf3a551 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -593,7 +593,7 @@ public class Metrics { @@ -78,7 +81,7 @@ index 692c962193cf9fcc6801fc93f3220bdc673d527b..9713263c3bd34ab8a3bfc0a8797ba0b1 // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { - Metrics metrics = new Metrics("Pufferfish", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish -+ Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Purpur ++ Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); @@ -102,7 +105,7 @@ index 692c962193cf9fcc6801fc93f3220bdc673d527b..9713263c3bd34ab8a3bfc0a8797ba0b1 metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index bf42969859545a8a520923ef1836ffa4a5cc24a0..fba5dbdb7bcbb55400ef18342c9b54612972a718 100644 +index bf42969859545a8a520923ef1836ffa4a5cc24a0..462a6eed350fd660ddaf25d567bb6e97b77d0b2b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java @@ -19,8 +19,10 @@ import java.util.stream.StreamSupport; @@ -162,7 +165,7 @@ index bf42969859545a8a520923ef1836ffa4a5cc24a0..fba5dbdb7bcbb55400ef18342c9b5461 + return Component.text("* You are running the latest version", NamedTextColor.GREEN); // Purpur case -2: - return Component.text("Unknown version", NamedTextColor.YELLOW); -+ return Component.text("* Unknown version", NamedTextColor.RED); // Purpur ++ return Component.text("* Unknown version", NamedTextColor.YELLOW); // Purpur default: - return Component.text("You are " + distance + " version(s) behind", NamedTextColor.YELLOW) + return Component.text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur @@ -209,7 +212,7 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..3cb56595822799926a8141e60a42f5d1 .completer(new ConsoleCommandCompleter(this.server)) .option(LineReader.Option.COMPLETE_IN_WORD, true); diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -index ed74f2b90afaa43ae66fbd4797d23cfac9ea9e88..9b4ebe6a9311aa57609b00b6d40722b1fb39aec5 100644 +index a08c00b8c0488d18be5e182f7892e5ab71d12247..338f693d098b6ab507c30f6411c9a952c34ba8e3 100644 --- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java @@ -136,6 +136,10 @@ public class MobGoalHelper { @@ -258,10 +261,10 @@ index 39844531b03eb8a6c70700b4ecbf0ff1a557424d..632ae75cb3bbc7a3955872d14ad0fbc2 public void removeCommand(String name) { this.children.remove(name); diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -index 6e441a1a28ba72a8b1cc09fe5fca71b3c70627d4..47e77541e558e18758ae0fcc2aa4e47261e928b6 100644 +index e0076044d0a29e33ee297fe6180a041436075297..c0f44f0593aab16d5ceab493f4075772f454732e 100644 --- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java +++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -@@ -28,6 +28,7 @@ public class PufferfishConfig { +@@ -36,6 +36,7 @@ public class PufferfishConfig { private static final YamlFile config = new YamlFile(); private static int updates = 0; @@ -269,7 +272,7 @@ index 6e441a1a28ba72a8b1cc09fe5fca71b3c70627d4..47e77541e558e18758ae0fcc2aa4e472 private static ConfigurationSection convertToBukkit(org.simpleyaml.configuration.ConfigurationSection section) { ConfigurationSection newSection = new MemoryConfiguration(); -@@ -50,7 +51,7 @@ public class PufferfishConfig { +@@ -58,7 +59,7 @@ public class PufferfishConfig { } public static void load() throws IOException { @@ -278,7 +281,7 @@ index 6e441a1a28ba72a8b1cc09fe5fca71b3c70627d4..47e77541e558e18758ae0fcc2aa4e472 if (configFile.exists()) { try { -@@ -224,7 +225,7 @@ public class PufferfishConfig { +@@ -232,7 +233,7 @@ public class PufferfishConfig { public static int activationDistanceMod; private static void dynamicActivationOfBrains() throws IOException { @@ -287,7 +290,7 @@ index 6e441a1a28ba72a8b1cc09fe5fca71b3c70627d4..47e77541e558e18758ae0fcc2aa4e472 startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12, "This value determines how far away an entity has to be", "from the player to start being effected by DEAR."); -@@ -268,7 +269,7 @@ public class PufferfishConfig { +@@ -276,7 +277,7 @@ public class PufferfishConfig { public static boolean throttleInactiveGoalSelectorTick; private static void inactiveGoalSelectorThrottle() { @@ -552,7 +555,7 @@ index 76d0d00cd6742991e3f3ec827a75ee87d856b6c9..38480793e300f9d8f3404617a9a85bae } if (SysoutCatcher.NAG_INTERVAL > 0 || SysoutCatcher.NAG_TIMEOUT > 0) { diff --git a/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java b/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java -index f7e43c693140b7a820b2432db312df8f7b099d4d..7ca119409eaab2052920e8d425bfde87a8ffc205 100644 +index 89bf48fd581ee6580b91e2eb31dd532cb622df5e..e35da199be67e04c34df6bc09afd8d8122cb0487 100644 --- a/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java +++ b/src/main/java/io/papermc/paper/plugin/PluginInitializerManager.java @@ -102,6 +102,7 @@ public class PluginInitializerManager { @@ -565,7 +568,7 @@ index f7e43c693140b7a820b2432db312df8f7b099d4d..7ca119409eaab2052920e8d425bfde87 // This will be the end of me... diff --git a/src/main/java/io/papermc/paper/plugin/provider/source/SparkProviderSource.java b/src/main/java/io/papermc/paper/plugin/provider/source/SparkProviderSource.java new file mode 100644 -index 0000000000000000000000000000000000000000..74e3334ec92e3864b84e299b33ca995224eb7c3f +index 0000000000000000000000000000000000000000..2d6fa262a7f1a298069e74266cb62fed0136833c --- /dev/null +++ b/src/main/java/io/papermc/paper/plugin/provider/source/SparkProviderSource.java @@ -0,0 +1,82 @@ @@ -593,7 +596,7 @@ index 0000000000000000000000000000000000000000..74e3334ec92e3864b84e299b33ca9952 +public class SparkProviderSource extends FileProviderSource { + public static final SparkProviderSource INSTANCE = new SparkProviderSource(); + -+ private static final Logger LOGGER = LogUtils.getLogger(); ++ private static final Logger LOGGER = LogUtils.getClassLogger(); + + public SparkProviderSource() { + super("File '%s' specified by Purpur"::formatted); @@ -724,11 +727,11 @@ index 7b6b51392b123d34382233adcf4c3d4867bdaa32..941f3a0d50329658a9380500ef039d7f if (this.source.acceptsSuccess() && !this.silent) { this.source.sendSystemMessage(message); diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index e92864ecf32dd984f6f87f7b05341e43af3a2977..139a57b38eac74887c950041e890e1613d8d3073 100644 +index 87cc7562e4a166d078fe11b7f6980497fc0bd33e..08bed4f01a27162902aa63bb8d35a9159fdcfc4e 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -145,7 +145,7 @@ public class Commands { - CloneCommands.register(this.dispatcher, commandRegistryAccess); +@@ -149,7 +149,7 @@ public class Commands { + DamageCommand.register(this.dispatcher, commandRegistryAccess); DataCommands.register(this.dispatcher); DataPackCommand.register(this.dispatcher); - DebugCommand.register(this.dispatcher); @@ -736,7 +739,7 @@ index e92864ecf32dd984f6f87f7b05341e43af3a2977..139a57b38eac74887c950041e890e161 DefaultGameModeCommands.register(this.dispatcher); DifficultyCommand.register(this.dispatcher); EffectCommands.register(this.dispatcher, commandRegistryAccess); -@@ -216,6 +216,14 @@ public class Commands { +@@ -222,6 +222,14 @@ public class Commands { SetPlayerIdleTimeoutCommand.register(this.dispatcher); StopCommand.register(this.dispatcher); WhitelistCommand.register(this.dispatcher); @@ -751,7 +754,7 @@ index e92864ecf32dd984f6f87f7b05341e43af3a2977..139a57b38eac74887c950041e890e161 } if (environment.includeIntegrated) { -@@ -303,9 +311,9 @@ public class Commands { +@@ -309,9 +317,9 @@ public class Commands { public int performCommand(ParseResults parseresults, String s, String label) { // CraftBukkit CommandSourceStack commandlistenerwrapper = (CommandSourceStack) parseresults.getContext().getSource(); @@ -763,7 +766,7 @@ index e92864ecf32dd984f6f87f7b05341e43af3a2977..139a57b38eac74887c950041e890e161 byte b0; -@@ -388,7 +396,7 @@ public class Commands { +@@ -394,7 +402,7 @@ public class Commands { b0 = 0; } } finally { @@ -772,7 +775,7 @@ index e92864ecf32dd984f6f87f7b05341e43af3a2977..139a57b38eac74887c950041e890e161 } return b0; -@@ -448,6 +456,7 @@ public class Commands { +@@ -454,6 +462,7 @@ public class Commands { private void runSync(ServerPlayer player, Collection bukkit, RootCommandNode rootcommandnode) { // Paper end - Async command map building new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper @@ -780,7 +783,7 @@ index e92864ecf32dd984f6f87f7b05341e43af3a2977..139a57b38eac74887c950041e890e161 PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit)); event.getPlayer().getServer().getPluginManager().callEvent(event); -@@ -458,6 +467,7 @@ public class Commands { +@@ -464,6 +473,7 @@ public class Commands { } } // CraftBukkit end @@ -843,7 +846,7 @@ index f25b9330e068c7d9e12cb57a7761cfef9ebaf7bc..7e66aaa960ce7b6dda7c064d4c6856cc + // Purpur end } diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index b1d12c78edf21cc29a9f9ca54e7957ddc8875ffb..a3e398d3bcc88f9c0feaa6ca8dc646f3c522c0a9 100644 +index b37e0ff164a894d2033fb94bbbc2f630a0e66bcd..ac335ec4f70830c7687ac4e0aa2a6cba9cb04ae1 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java @@ -41,6 +41,12 @@ public class BlockPos extends Vec3i { @@ -852,7 +855,7 @@ index b1d12c78edf21cc29a9f9ca54e7957ddc8875ffb..a3e398d3bcc88f9c0feaa6ca8dc646f3 + // Purpur start + public BlockPos(net.minecraft.world.entity.Entity entity) { -+ super(entity.getX(), entity.getY(), entity.getZ()); ++ super(entity.getBlockX(), entity.getBlockY(), entity.getBlockZ()); + } + // Purpur end + @@ -860,10 +863,10 @@ index b1d12c78edf21cc29a9f9ca54e7957ddc8875ffb..a3e398d3bcc88f9c0feaa6ca8dc646f3 super(x, y, z); } diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java -index c1172ba542bc07e0c780a50d5b4ce26ac04c1720..a4dc96b1a3bf309584657e3a1e7dfaea967f9425 100644 +index 82bce6109d59cba30178a446f0ff129da6f3692f..eaa620ad86abfb151b43f697973cbc731e2e5e92 100644 --- a/src/main/java/net/minecraft/core/Direction.java +++ b/src/main/java/net/minecraft/core/Direction.java -@@ -247,6 +247,12 @@ public enum Direction implements StringRepresentable { +@@ -248,6 +248,12 @@ public enum Direction implements StringRepresentable { case EAST: var10000 = SOUTH; break; @@ -876,7 +879,7 @@ index c1172ba542bc07e0c780a50d5b4ce26ac04c1720..a4dc96b1a3bf309584657e3a1e7dfaea default: throw new IllegalStateException("Unable to get Y-rotated facing of " + this); } -@@ -359,6 +365,12 @@ public enum Direction implements StringRepresentable { +@@ -360,6 +366,12 @@ public enum Direction implements StringRepresentable { case EAST: var10000 = NORTH; break; @@ -890,10 +893,10 @@ index c1172ba542bc07e0c780a50d5b4ce26ac04c1720..a4dc96b1a3bf309584657e3a1e7dfaea throw new IllegalStateException("Unable to get CCW facing of " + this); } diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 58fa7b99dc7a9745afe6faf31c1804e95ed27dbe..ed137bb15f76bac5a73f3dec215078c21e4953b9 100644 +index 9598aa381978194fee859721731196f0e6ee08fc..2db46452d374f9b53db7bd80be5fbd9c8fce2c3e 100644 --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -51,6 +51,7 @@ import net.minecraft.world.item.SpawnEggItem; +@@ -52,6 +52,7 @@ import net.minecraft.world.item.SpawnEggItem; import net.minecraft.world.item.alchemy.PotionUtils; import net.minecraft.world.item.alchemy.Potions; import net.minecraft.world.level.Level; @@ -901,7 +904,7 @@ index 58fa7b99dc7a9745afe6faf31c1804e95ed27dbe..ed137bb15f76bac5a73f3dec215078c2 import net.minecraft.world.level.block.BaseFireBlock; import net.minecraft.world.level.block.BeehiveBlock; import net.minecraft.world.level.block.Block; -@@ -1161,6 +1162,23 @@ public interface DispenseItemBehavior { +@@ -1167,6 +1168,23 @@ public interface DispenseItemBehavior { } } }); @@ -939,10 +942,10 @@ index d1127d93a85a837933d0d73c24cacac4adc3a5b9..d9a6d273108165f59b995b1fd7748cb5 return true; } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 38c09c65dfa4a7a0c80d36f726c1fd028cbe05f8..52c7f83f525d150ce30e33f220d879d1d125508f 100644 +index fa1d325034dafdb9f1da546a6f9c5e88d2b67749..c5d030379a25e17befafd566e5ec61592bba7eba 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -562,11 +562,20 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -569,11 +569,20 @@ public class Connection extends SimpleChannelInboundHandler> { private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper private static int joinAttemptsThisTick; // Paper private static int currTick; // Paper @@ -964,19 +967,19 @@ index 38c09c65dfa4a7a0c80d36f726c1fd028cbe05f8..52c7f83f525d150ce30e33f220d879d1 } // Paper end diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index 32ee4ed11aefd82dca2e3e78b3108f041fdc3695..bbbb6a15c9351c4276ef8df85508fd263f40c610 100644 +index 9938bb90bef84cf784f9a1ceb02a1a45aa8b48a1..1f4b64a5f812376c499c98cb4be62469bd0b7dbe 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -@@ -89,6 +89,8 @@ public class FriendlyByteBuf extends ByteBuf { - private static final int MAX_PUBLIC_KEY_HEADER_SIZE = 256; +@@ -98,6 +98,8 @@ public class FriendlyByteBuf extends ByteBuf { private static final int MAX_PUBLIC_KEY_LENGTH = 512; + private static final Gson GSON = new Gson(); + public static boolean hasItemSerializeEvent = false; // Purpur + public FriendlyByteBuf(ByteBuf parent) { this.source = parent; } -@@ -632,6 +634,17 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -679,6 +681,17 @@ public class FriendlyByteBuf extends ByteBuf { this.writeBoolean(false); } else { this.writeBoolean(true); @@ -995,18 +998,18 @@ index 32ee4ed11aefd82dca2e3e78b3108f041fdc3695..bbbb6a15c9351c4276ef8df85508fd26 this.writeId(BuiltInRegistries.ITEM, item); diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java -index 27d4aa45e585842c04491839826d405d6f447f0e..b693a26ac6a5729bf91aca9ca0ae332b904d436f 100644 +index d2f0a0755317f5fa9a1ccf7db346aa77fd287d80..03852e7d21d9470a4469676367463fefb38acdc6 100644 --- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java +++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java @@ -47,7 +47,7 @@ public class PacketUtils { if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590 - if (listener.getConnection().isConnected()) { + if (listener.isAcceptingMessages()) { co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings - try (co.aikar.timings.Timing ignored = timing.startTiming()) { // Paper - timings + try { // Paper - timings // Purpur packet.handle(listener); } catch (Exception exception) { - net.minecraft.network.Connection networkmanager = listener.getConnection(); + if (listener.shouldPropagateHandlingExceptions()) { diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerCombatKillPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerCombatKillPacket.java index 53b75f5737a910ffc5448cd9a85eae57f9c1488f..ea95873dd034779e56a8b924cd27f9375be05daf 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerCombatKillPacket.java @@ -1046,10 +1049,10 @@ index 9ec6145fe04ec64bbee8ec6a837719caebdbc6f5..358d610ad020cada1bb83e393deeeaae public ClientboundSetTimePacket(long time, long timeOfDay, boolean doDaylightCycle) { this.gameTime = time; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 33a5e900c2cab99c311fa5f5b71a609cf8f802cb..1772800c123353207e3563a7e2c2b70431aec097 100644 +index 6d5e9400892b86562519a893349ca55e566bfb24..5416b64c3000c9b17a78991218e068bf5ef33db7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -246,7 +246,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -301,10 +302,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { // Purpur + //}; // Purpur - this.status = new ServerStatus(); this.random = RandomSource.create(); this.port = -1; -@@ -924,7 +927,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0; try { this.isSaving = true; -@@ -1439,20 +1464,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper + net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper + worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur - net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - this.profiler.push(() -> { + /*this.profiler.push(() -> { // Purpur @@ -1348,7 +1356,7 @@ index 33a5e900c2cab99c311fa5f5b71a609cf8f802cb..1772800c123353207e3563a7e2c2b704 if (this.tickCount % 20 == 0) { - this.profiler.push("timeSync"); + //this.profiler.push("timeSync"); // Purpur - this.playerList.broadcastAll(new PacketPlayOutUpdateTime(worldserver.getGameTime(), worldserver.getDayTime(), worldserver.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)), worldserver.dimension()); + this.synchronizeTime(worldserver); - this.profiler.pop(); + //this.profiler.pop(); // Purpur } @@ -1371,7 +1379,7 @@ index 33a5e900c2cab99c311fa5f5b71a609cf8f802cb..1772800c123353207e3563a7e2c2b704 } catch (Throwable throwable) { // Spigot Start CrashReport crashreport; -@@ -1556,33 +1583,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! -+ return org.purpurmc.purpur.PurpurConfig.serverModName; // Purpur - Purpur > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return org.purpurmc.purpur.PurpurConfig.serverModName; // Purpur - Purpur > // Pufferfish - Pufferfish > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! } public SystemReport fillSystemReport(SystemReport details) { -@@ -1849,17 +1876,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { this.executeBlocking(() -> { this.saveDebugReport(path.resolve("server")); -@@ -2490,40 +2512,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { final io.papermc.paper.adventure.ChatDecorationProcessor processor = new io.papermc.paper.adventure.ChatDecorationProcessor(this, sender, commandSourceStack, message); -@@ -2744,7 +2775,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop filter) throws CommandSyntaxException { - int i = range.getXSpan() * range.getYSpan() * range.getZSpan(); -- if (i > 32768) { -- throw ERROR_AREA_TOO_LARGE.create(32768, i); -+ // Purpur start -+ if (i > org.purpurmc.purpur.PurpurConfig.commandFillMaxArea) { -+ throw ERROR_AREA_TOO_LARGE.create(org.purpurmc.purpur.PurpurConfig.commandFillMaxArea, i); -+ // Purpur end - } else { - List list = Lists.newArrayList(); - ServerLevel serverLevel = source.getLevel(); diff --git a/src/main/java/net/minecraft/server/commands/GameModeCommand.java b/src/main/java/net/minecraft/server/commands/GameModeCommand.java index 27c0aaf123c3e945eb24e8a3892bd8ac42115733..85e1c1d6eb4472baa958b4f482791e8479dfcbf0 100644 --- a/src/main/java/net/minecraft/server/commands/GameModeCommand.java @@ -1710,7 +1719,7 @@ index 27c0aaf123c3e945eb24e8a3892bd8ac42115733..85e1c1d6eb4472baa958b4f482791e84 for(ServerPlayer serverPlayer : targets) { diff --git a/src/main/java/net/minecraft/server/commands/GiveCommand.java b/src/main/java/net/minecraft/server/commands/GiveCommand.java -index 06e3a868e922f1b7a586d0ca28f64a67ae463b68..32beb045f990d4da6112da4fea295333cb69e2ea 100644 +index ee7d29d85c8b024c9b23cba8ecd4192aa7e8aa7b..7a44bac6e66bc5f5fe14a45a5e7c78c940fb1efb 100644 --- a/src/main/java/net/minecraft/server/commands/GiveCommand.java +++ b/src/main/java/net/minecraft/server/commands/GiveCommand.java @@ -58,6 +58,7 @@ public class GiveCommand { @@ -1722,7 +1731,7 @@ index 06e3a868e922f1b7a586d0ca28f64a67ae463b68..32beb045f990d4da6112da4fea295333 itemstack.setCount(1); entityitem = entityplayer.drop(itemstack, false, false, false); // SPIGOT-2942: Add boolean to call event diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index ad4fdbdcf09f30d10e61ccf47f8fb9ce6bd92e73..fd1b0564d2d2b45128e6f2556fb93ee56bd683b5 100644 +index ad4fdbdcf09f30d10e61ccf47f8fb9ce6bd92e73..582467e3419c23446b20d3076fbfce22115250a8 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -218,9 +218,19 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -1776,18 +1785,17 @@ index ad4fdbdcf09f30d10e61ccf47f8fb9ce6bd92e73..fd1b0564d2d2b45128e6f2556fb93ee5 // CraftBukkit start // this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up -@@ -342,6 +376,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -342,6 +376,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } if (gg.pufferfish.pufferfish.PufferfishConfig.enableAsyncMobSpawning) mobSpawnExecutor.start(); // Pufferfish -+ + org.purpurmc.purpur.task.BossBarTask.startAll(); // Purpur + org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur + return true; } } -@@ -488,7 +526,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -488,7 +525,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } public void handleConsoleInputs() { @@ -1796,7 +1804,7 @@ index ad4fdbdcf09f30d10e61ccf47f8fb9ce6bd92e73..fd1b0564d2d2b45128e6f2556fb93ee5 // Paper start - use proper queue ConsoleInput servercommand; while ((servercommand = this.serverCommandQueue.poll()) != null) { -@@ -505,7 +543,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -505,7 +542,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface // CraftBukkit end } @@ -1806,7 +1814,7 @@ index ad4fdbdcf09f30d10e61ccf47f8fb9ce6bd92e73..fd1b0564d2d2b45128e6f2556fb93ee5 @Override diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java -index c7e4330c93baff1f3027d7c75cf857b673d38970..5134fed0cd0eedbe0c2177bce91b978b20061517 100644 +index 818289e831e3dad29345c43265e2efd7689bc500..1ea3012995c738c67b31e997c138f824f9e69ba1 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java @@ -58,6 +58,7 @@ public class DedicatedServerProperties extends Settings playersInRange = reducedRange ? playerchunk.playersInMobSpawnRange : playerchunk.playersInChunkTickRange; -@@ -1250,24 +1250,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1253,24 +1253,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper start - optimised tracker private final void processTrackQueue() { @@ -1888,7 +1896,7 @@ index d939b1e3bc101e66bc1019cf49d8079665dadfcc..75965afd7b4bed23a5ecf618c7f91ff5 } } // Paper end - optimised tracker -@@ -1282,7 +1282,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1285,7 +1285,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider List list = Lists.newArrayList(); List list1 = this.level.players(); ObjectIterator objectiterator = this.entityMap.values().iterator(); @@ -1897,7 +1905,7 @@ index d939b1e3bc101e66bc1019cf49d8079665dadfcc..75965afd7b4bed23a5ecf618c7f91ff5 ChunkMap.TrackedEntity playerchunkmap_entitytracker; -@@ -1307,17 +1307,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1310,17 +1310,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider playerchunkmap_entitytracker.serverEntity.sendChanges(); } } @@ -2114,10 +2122,10 @@ index c6f5d6756fa0e068a462d9c0ded12e0771abba37..0ae45cf5a084fd412305e8b2f5dabe60 } diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 50cf4d200bc2892f2140c9929193b4b20ad2bd17..0f9a3a6c05fee59c29764f0c0d7a6cb8a2a861b1 100644 +index d5cb594f0b17ec9dc1a19cdb99bba553e70171be..6afee2a744a3498d4a0eee35f77cde444f73d12c 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -69,7 +69,7 @@ public class ServerEntity { +@@ -72,7 +72,7 @@ public class ServerEntity { @Nullable private List> trackedDataValues; // CraftBukkit start @@ -2127,10 +2135,10 @@ index 50cf4d200bc2892f2140c9929193b4b20ad2bd17..0f9a3a6c05fee59c29764f0c0d7a6cb8 public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer> consumer, Set trackedPlayers) { this.trackedPlayers = trackedPlayers; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020478928fc 100644 +index ff2862bf1f511196d1e911e2584262ed728e9a81..43bf3285729ec5cedb3de84f2b60673928b079db 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -214,6 +214,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -212,6 +212,8 @@ public class ServerLevel extends Level implements WorldGenLevel { private final StructureManager structureManager; private final StructureCheck structureCheck; private final boolean tickTime; @@ -2139,7 +2147,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 public long lastMidTickExecuteFailure; // Paper - execute chunk tasks mid tick // CraftBukkit start -@@ -222,6 +224,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -220,6 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public boolean hasPhysicsEvent = true; // Paper public boolean hasEntityMoveEvent = false; // Paper private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current) @@ -2407,7 +2415,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 int l; if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Pufferfish - optimize further random ticking -@@ -901,8 +950,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -900,8 +949,8 @@ public class ServerLevel extends Level implements WorldGenLevel { } // Paper start - optimise random block ticking @@ -2418,7 +2426,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 if (randomTickSpeed > 0) { LevelChunkSection[] sections = chunk.getSections(); int minSection = io.papermc.paper.util.WorldUtil.getMinSection(this); -@@ -936,8 +985,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -935,8 +984,8 @@ public class ServerLevel extends Level implements WorldGenLevel { } } // Paper end - optimise random block ticking @@ -2429,7 +2437,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 } public Optional findLightningRod(BlockPos pos) { -@@ -945,7 +994,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -944,7 +993,7 @@ public class ServerLevel extends Level implements WorldGenLevel { return holder.is(PoiTypes.LIGHTNING_ROD); }, (blockposition1) -> { return blockposition1.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockposition1.getX(), blockposition1.getZ()) - 1; @@ -2438,7 +2446,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 return optional.map((blockposition1) -> { return blockposition1.above(1); -@@ -994,11 +1043,27 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -993,11 +1042,27 @@ public class ServerLevel extends Level implements WorldGenLevel { if (this.canSleepThroughNights()) { if (!this.getServer().isSingleplayer() || this.getServer().isPublished()) { int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); @@ -2467,7 +2475,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 ichatmutablecomponent = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i)); } -@@ -1137,6 +1202,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1136,6 +1201,7 @@ public class ServerLevel extends Level implements WorldGenLevel { private void resetWeatherCycle() { // CraftBukkit start @@ -2475,7 +2483,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - when passing the night // If we stop due to everyone sleeping we should reset the weather duration to some other random value. // Not that everyone ever manages to get the whole server to sleep at the same time.... -@@ -1144,6 +1210,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1143,6 +1209,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setRainTime(0); } // CraftBukkit end @@ -2483,7 +2491,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - when passing the night // CraftBukkit start // If we stop due to everyone sleeping we should reset the weather duration to some other random value. -@@ -1211,24 +1278,24 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1210,24 +1277,24 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot end // Paper start- timings final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity); @@ -2516,7 +2524,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 Iterator iterator = entity.getPassengers().iterator(); while (iterator.hasNext()) { -@@ -1251,17 +1318,17 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1250,17 +1317,17 @@ public class ServerLevel extends Level implements WorldGenLevel { if (passenger instanceof Player || this.entityTickList.contains(passenger)) { // Paper - EAR 2 final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger); @@ -2540,7 +2548,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 // Paper start - EAR 2 if (isActive) { passenger.rideTick(); -@@ -1273,7 +1340,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1272,7 +1339,7 @@ public class ServerLevel extends Level implements WorldGenLevel { vehicle.positionRider(passenger); } // Paper end - EAR 2 @@ -2549,7 +2557,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 Iterator iterator = passenger.getPassengers().iterator(); while (iterator.hasNext()) { -@@ -1282,7 +1349,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1281,7 +1348,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(passenger, entity2); } @@ -2558,7 +2566,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 } } else { passenger.stopRiding(); -@@ -1302,14 +1369,14 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1301,14 +1368,14 @@ public class ServerLevel extends Level implements WorldGenLevel { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); } @@ -2576,7 +2584,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 // Copied from save() // CraftBukkit start - moved from MinecraftServer.saveChunks -@@ -1321,7 +1388,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1320,7 +1387,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData()); } // CraftBukkit end @@ -2585,7 +2593,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 } // Paper end -@@ -1335,7 +1402,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1334,7 +1401,7 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!savingDisabled) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit @@ -2594,7 +2602,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 if (progressListener != null) { progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); } -@@ -1345,11 +1412,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1344,11 +1411,11 @@ public class ServerLevel extends Level implements WorldGenLevel { progressListener.progressStage(Component.translatable("menu.savingChunks")); } @@ -2609,7 +2617,7 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 // Paper - rewrite chunk system - entity saving moved into ChunkHolder } else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system -@@ -2615,7 +2682,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2614,7 +2681,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message // Paper start @@ -2619,10 +2627,10 @@ index 619ee9d8b99970fb6fce19438f29e09858412ac4..a5655ebb233f1e1e1dd7f79fdd948020 } // Paper end diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687120e9119 100644 +index ca5291a9573a62cb5c19539cf5c7aceff11f9829..74238a87d1ff3391aac5812b24b84af228baeaa4 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -268,6 +268,11 @@ public class ServerPlayer extends Player { +@@ -274,6 +274,11 @@ public class ServerPlayer extends Player { public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event @@ -2634,7 +2642,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); -@@ -367,6 +372,7 @@ public class ServerPlayer extends Player { +@@ -373,6 +378,7 @@ public class ServerPlayer extends Player { this.bukkitPickUpLoot = true; this.maxHealthCache = this.getMaxHealth(); this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper @@ -2642,7 +2650,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 } // Yes, this doesn't match Vanilla, but it's the best we can do for now. -@@ -506,6 +512,9 @@ public class ServerPlayer extends Player { +@@ -512,6 +518,9 @@ public class ServerPlayer extends Player { } } @@ -2652,7 +2660,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 } @Override -@@ -572,6 +581,9 @@ public class ServerPlayer extends Player { +@@ -578,6 +587,9 @@ public class ServerPlayer extends Player { } this.getBukkitEntity().setExtraData(nbt); // CraftBukkit @@ -2662,7 +2670,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 } // CraftBukkit start - World fallback code, either respawn location or global spawn -@@ -700,6 +712,15 @@ public class ServerPlayer extends Player { +@@ -706,6 +718,15 @@ public class ServerPlayer extends Player { this.trackStartFallingPosition(); this.trackEnteredOrExitedLavaOnVehicle(); this.advancements.flushDirty(this); @@ -2678,7 +2686,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 } public void doTick() { -@@ -938,6 +959,7 @@ public class ServerPlayer extends Player { +@@ -944,6 +965,7 @@ public class ServerPlayer extends Player { })); Team scoreboardteambase = this.getTeam(); @@ -2686,7 +2694,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 if (scoreboardteambase != null && scoreboardteambase.getDeathMessageVisibility() != Team.Visibility.ALWAYS) { if (scoreboardteambase.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) { this.server.getPlayerList().broadcastSystemToTeam(this, ichatbasecomponent); -@@ -1039,14 +1061,30 @@ public class ServerPlayer extends Player { +@@ -1045,14 +1067,30 @@ public class ServerPlayer extends Player { } @@ -2702,7 +2710,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 return false; } else { + // Purpur start -+ if (source == DamageSource.FALL) { ++ if (source.is(DamageTypeTags.IS_FALL)) { // Purpur + if (getRootVehicle() instanceof net.minecraft.world.entity.vehicle.AbstractMinecart && level.purpurConfig.minecartControllable && !level.purpurConfig.minecartControllableFallDamage) { + return false; + } @@ -2711,14 +2719,14 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 + } + } + // Purpur end - boolean flag = this.server.isDedicatedServer() && this.isPvpAllowed() && "fall".equals(source.msgId); + boolean flag = this.server.isDedicatedServer() && this.isPvpAllowed() && source.is(DamageTypeTags.IS_FALL); -- if (!flag && this.spawnInvulnerableTime > 0 && source != DamageSource.OUT_OF_WORLD) { -+ if (!flag && isSpawnInvulnerable() && source != DamageSource.OUT_OF_WORLD) { // Purpur +- if (!flag && this.spawnInvulnerableTime > 0 && !source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { ++ if (!flag && isSpawnInvulnerable() && !source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { // Purpur return false; } else { - if (source instanceof EntityDamageSource) { -@@ -1149,7 +1187,7 @@ public class ServerPlayer extends Player { + Entity entity = source.getEntity(); +@@ -1161,7 +1199,7 @@ public class ServerPlayer extends Player { PortalInfo shapedetectorshape = this.findDimensionEntryPoint(worldserver); if (shapedetectorshape != null) { @@ -2727,7 +2735,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 worldserver = shapedetectorshape.world; // CraftBukkit if (worldserver == null) { } else // CraftBukkit - empty to fall through to null to event if (resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit -@@ -1172,8 +1210,8 @@ public class ServerPlayer extends Player { +@@ -1184,8 +1222,8 @@ public class ServerPlayer extends Player { worldserver = ((CraftWorld) exit.getWorld()).getHandle(); // CraftBukkit end @@ -2738,7 +2746,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 if (true) { // CraftBukkit this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds -@@ -1184,6 +1222,7 @@ public class ServerPlayer extends Player { +@@ -1196,6 +1234,7 @@ public class ServerPlayer extends Player { playerlist.sendPlayerPermissionLevel(this); worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); this.unsetRemoved(); @@ -2746,7 +2754,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 // CraftBukkit end this.setLevel(worldserver); -@@ -1191,7 +1230,7 @@ public class ServerPlayer extends Player { +@@ -1203,7 +1242,7 @@ public class ServerPlayer extends Player { this.connection.teleport(exit); // CraftBukkit - use internal teleport without event this.connection.resetPosition(); worldserver.addDuringPortalTeleport(this); @@ -2755,7 +2763,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 this.triggerDimensionChangeTriggers(worldserver1); this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities())); playerlist.sendLevelInfo(this, worldserver); -@@ -1220,6 +1259,7 @@ public class ServerPlayer extends Player { +@@ -1232,6 +1271,7 @@ public class ServerPlayer extends Player { } // Paper end @@ -2763,7 +2771,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 return this; } } -@@ -1341,7 +1381,7 @@ public class ServerPlayer extends Player { +@@ -1353,7 +1393,7 @@ public class ServerPlayer extends Player { return entitymonster.isPreventingPlayerRest(this); }); @@ -2772,7 +2780,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 return Either.left(Player.BedSleepingProblem.NOT_SAFE); } } -@@ -1512,6 +1552,7 @@ public class ServerPlayer extends Player { +@@ -1489,6 +1529,7 @@ public class ServerPlayer extends Player { @Override public void openTextEdit(SignBlockEntity sign) { @@ -2780,7 +2788,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 sign.setAllowedPlayerEditor(this.getUUID()); this.connection.send(new ClientboundBlockUpdatePacket(this.level, sign.getBlockPos())); this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos())); -@@ -1738,6 +1779,26 @@ public class ServerPlayer extends Player { +@@ -1715,6 +1756,26 @@ public class ServerPlayer extends Player { this.lastSentExp = -1; // CraftBukkit - Added to reset } @@ -2807,7 +2815,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 @Override public void displayClientMessage(Component message, boolean overlay) { this.sendSystemMessage(message, overlay); -@@ -2007,6 +2068,7 @@ public class ServerPlayer extends Player { +@@ -2014,6 +2075,7 @@ public class ServerPlayer extends Player { } public void sendTexturePack(String url, String hash, boolean required, @Nullable Component resourcePackPrompt) { @@ -2815,7 +2823,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 this.connection.send(new ClientboundResourcePackPacket(url, hash, required, resourcePackPrompt)); } -@@ -2021,8 +2083,63 @@ public class ServerPlayer extends Player { +@@ -2028,8 +2090,63 @@ public class ServerPlayer extends Player { public void resetLastActionTime() { this.lastActionTime = Util.getMillis(); @@ -2879,7 +2887,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 public ServerStatsCounter getStats() { return this.stats; } -@@ -2498,8 +2615,16 @@ public class ServerPlayer extends Player { +@@ -2490,8 +2607,16 @@ public class ServerPlayer extends Player { @Override public boolean isImmobile() { @@ -2897,7 +2905,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 @Override public Scoreboard getScoreboard() { -@@ -2548,4 +2673,50 @@ public class ServerPlayer extends Player { +@@ -2540,4 +2665,50 @@ public class ServerPlayer extends Player { return (CraftPlayer) super.getBukkitEntity(); } // CraftBukkit end @@ -2917,7 +2925,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 + + ServerLevel toLevel = ((CraftWorld) to.getWorld()).getHandle(); + if (this.level == toLevel) { -+ this.connection.internalTeleport(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch(), java.util.EnumSet.noneOf(net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument.class), true); ++ this.connection.internalTeleport(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch(), java.util.EnumSet.noneOf(net.minecraft.world.entity.RelativeMovement.class)); + } else { + this.server.getPlayerList().respawn(this, toLevel, true, to, !toLevel.paperConfig().environment.disableTeleportationSuffocationCheck); + } @@ -2949,7 +2957,7 @@ index 289429eb464548acc80262a49444f49f8f57fc0c..b91bf50a1f450a78c8d16cf5b8772687 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 58b093bb1de78ee3b3b2ea364aa50474883f443a..744c936c3aa9bd7bcf43ac3d78a08ece9cde87c3 100644 +index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..ebf1ac089202c06fd2cc593dc12c21fe2d0a8de8 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -389,6 +389,7 @@ public class ServerPlayerGameMode { @@ -2969,15 +2977,6 @@ index 58b093bb1de78ee3b3b2ea364aa50474883f443a..744c936c3aa9bd7bcf43ac3d78a08ece // return true; // CraftBukkit } else { ItemStack itemstack = this.player.getMainHandItem(); -@@ -481,7 +482,7 @@ public class ServerPlayerGameMode { - player.setItemInHand(hand, itemstack1); - } - -- if (this.isCreative()) { -+ if (this.isCreative() && itemstack1 != ItemStack.EMPTY) { // Purpur - itemstack1.setCount(i); - if (itemstack1.isDamageableItem() && itemstack1.getDamageValue() != j) { - itemstack1.setDamageValue(j); @@ -508,6 +509,7 @@ public class ServerPlayerGameMode { public InteractionHand interactHand; public ItemStack interactItemStack; @@ -3027,10 +3026,10 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..acd7468ee3c86d3456e96e4ec3d7e6a4 Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); hasSetFarWarned = true; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01aaf45cfdd 100644 +index 24d48fb4a63c2db19c7f957ad2260415fe1db9fe..ae3c1bd67c144fe971d4df6df2ca171b431b6fc5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -259,6 +259,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -261,6 +261,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private long keepAliveTime = Util.getMillis(); private boolean keepAlivePending; private long keepAliveChallenge; @@ -3038,7 +3037,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a // CraftBukkit start - multithreaded fields private final AtomicInteger chatSpamTickCount = new AtomicInteger(); private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits -@@ -335,6 +336,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -337,6 +338,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private boolean justTeleported = false; private boolean hasMoved; // Spigot @@ -3059,7 +3058,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a public CraftPlayer getCraftPlayer() { return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity(); } -@@ -390,12 +405,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -392,12 +407,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.aboveGroundVehicleTickCount = 0; } @@ -3088,7 +3087,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a if (this.keepAlivePending) { if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info -@@ -411,7 +441,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -413,7 +443,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } // Paper end @@ -3097,7 +3096,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a // CraftBukkit start for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable -@@ -428,6 +458,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -430,6 +460,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) (this.server.getPlayerIdleTimeout() * 1000 * 60) && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits. @@ -3110,15 +3109,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause } -@@ -716,7 +752,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - to.setY(packet.getY()); - to.setZ(packet.getZ()); - -- - // If the packet contains look information then we update the To location with the correct Yaw & Pitch. - to.setYaw(packet.getYRot()); - to.setPitch(packet.getXRot()); -@@ -732,6 +767,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -734,6 +770,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); @@ -3127,7 +3118,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a // Skip the first time we do this if (true) { // Spigot - don't skip any move events Location oldTo = to.clone(); -@@ -808,6 +845,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -810,6 +848,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (packet.getId() == this.awaitingTeleport) { if (this.awaitingPositionFromClient == null) { this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause @@ -3135,7 +3126,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a return; } -@@ -1212,10 +1250,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1214,10 +1253,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic int maxBookPageSize = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax; double multiplier = Math.max(0.3D, Math.min(1D, io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier)); long byteAllowed = maxBookPageSize; @@ -3148,7 +3139,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a server.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause return; } -@@ -1239,6 +1279,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1241,6 +1282,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (byteTotal > byteAllowed) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); @@ -3156,7 +3147,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a server.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause return; } -@@ -1292,13 +1333,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1294,13 +1336,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic itemstack1.setTag(nbttagcompound.copy()); } @@ -3176,7 +3167,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a this.updateBookPages(pages, (s) -> { return Component.Serializer.toJson(Component.literal(s)); -@@ -1310,10 +1354,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1312,10 +1357,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private void updateBookPages(List list, UnaryOperator unaryoperator, ItemStack itemstack, int slot, ItemStack handItem) { // CraftBukkit ListTag nbttaglist = new ListTag(); @@ -3192,7 +3183,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a Objects.requireNonNull(nbttaglist); stream.forEach(nbttaglist::add); -@@ -1323,11 +1370,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1325,11 +1373,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic for (int j = list.size(); i < j; ++i) { FilteredText filteredtext = (FilteredText) list.get(i); @@ -3206,7 +3197,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a } } -@@ -1340,6 +1387,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1342,6 +1390,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.getInventory().setItem(slot, CraftEventFactory.handleEditBookEvent(player, slot, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent) } @@ -3223,7 +3214,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a @Override public void handleEntityTagQuery(ServerboundEntityTagQuery packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); -@@ -1369,8 +1426,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1371,8 +1429,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); @@ -3241,7 +3232,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a } else { ServerLevel worldserver = this.player.getLevel(); -@@ -1536,7 +1601,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1538,7 +1604,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (!this.player.isChangingDimension() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot flag2 = true; // Paper - diff on change, this should be moved wrongly @@ -3250,7 +3241,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a } this.player.absMoveTo(d0, d1, d2, f, f1); -@@ -1587,6 +1652,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1589,6 +1655,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); @@ -3259,13 +3250,13 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a // Skip the first time we do this if (from.getX() != Double.MAX_VALUE) { Location oldTo = to.clone(); -@@ -1626,6 +1693,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1628,6 +1696,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.resetFallDistance(); } + // Purpur Start -+ if (this.player.level.purpurConfig.dontRunWithScissors && this.player.isSprinting() && (isScissor(this.player.getItemInHand(InteractionHand.MAIN_HAND)) || isScissor(this.player.getItemInHand(InteractionHand.OFF_HAND))) && (int) (Math.random() * 10) == 0) { -+ this.player.hurt(net.minecraft.world.damagesource.DamageSource.SCISSORS, (float) this.player.level.purpurConfig.scissorsRunningDamage); ++ if (this.player.level.purpurConfig.dontRunWithScissors && this.player.isSprinting() && !(this.player.level.purpurConfig.ignoreScissorsInWater && this.player.isInWater()) && !(this.player.level.purpurConfig.ignoreScissorsInLava && this.player.isInLava()) && (isScissor(this.player.getItemInHand(InteractionHand.MAIN_HAND)) || isScissor(this.player.getItemInHand(InteractionHand.OFF_HAND))) && (int) (Math.random() * 10) == 0) { ++ this.player.hurt(this.player.damageSources().magic(), (float) this.player.level.purpurConfig.scissorsRunningDamage); + if (!org.purpurmc.purpur.PurpurConfig.dontRunWithScissors.isBlank()) this.player.sendActionBarMessage(org.purpurmc.purpur.PurpurConfig.dontRunWithScissors); + } + // Purpur End @@ -3273,7 +3264,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a this.player.checkMovementStatistics(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5); this.lastGoodX = this.player.getX(); this.lastGoodY = this.player.getY(); -@@ -1659,6 +1733,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1661,6 +1736,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } // Paper end - optimise out extra getCubes @@ -3286,7 +3277,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a private boolean isPlayerCollidingWithAnythingNew(LevelReader world, AABB box) { Iterable iterable = world.getCollisions(this.player, this.player.getBoundingBox().deflate(9.999999747378752E-6D)); VoxelShape voxelshape = Shapes.create(box.deflate(9.999999747378752E-6D)); -@@ -2015,6 +2095,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2005,6 +2086,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic boolean cancelled; if (movingobjectposition == null || movingobjectposition.getType() != HitResult.Type.BLOCK) { @@ -3294,7 +3285,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack, enumhand); cancelled = event.useItemInHand() == Event.Result.DENY; } else { -@@ -2068,12 +2149,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2058,12 +2140,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleResourcePackResponse(ServerboundResourcePackPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); @@ -3316,7 +3307,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a player.getBukkitEntity().setResourcePackStatus(packStatus); this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit // Paper end -@@ -2359,7 +2449,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2353,7 +2444,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic do { instant1 = (Instant) this.lastChatTimeStamp.get(); if (timestamp.isBefore(instant1)) { @@ -3325,7 +3316,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a } } while (!this.lastChatTimeStamp.compareAndSet(instant1, timestamp)); -@@ -2496,7 +2586,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2490,7 +2581,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } } // Paper End @@ -3334,7 +3325,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); -@@ -2506,7 +2596,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2500,7 +2591,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.cserver.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -3343,7 +3334,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a return; } -@@ -2519,7 +2609,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2513,7 +2604,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; } finally { @@ -3352,15 +3343,15 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a } } // CraftBukkit end -@@ -2765,6 +2855,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - } +@@ -2779,6 +2870,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + AABB axisalignedbb = entity.getBoundingBox(); - if (entity.distanceToSqr(this.player.getEyePosition()) < ServerGamePacketListenerImpl.MAX_INTERACTION_DISTANCE) { + if (axisalignedbb.distanceToSqr(this.player.getEyePosition()) < ServerGamePacketListenerImpl.MAX_INTERACTION_DISTANCE) { + if (entity instanceof Mob mob) mob.ticksSinceLastInteraction = 0; // Purpur packet.dispatch(new ServerboundInteractPacket.Handler() { private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand); -@@ -2778,6 +2869,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2792,6 +2884,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event); @@ -3369,7 +3360,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a // Entity in bucket - SPIGOT-4048 and SPIGOT-6859a if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) { entity.getEntityData().resendPossiblyDesyncedEntity(player); // Paper - The entire mob gets deleted, so resend it. -@@ -3329,6 +3422,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3343,6 +3437,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } } } @@ -3382,7 +3373,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a boolean flag1 = packet.getSlotNum() >= 1 && packet.getSlotNum() <= 45; boolean flag2 = itemstack.isEmpty() || itemstack.getDamageValue() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty(); -@@ -3435,11 +3534,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3449,11 +3549,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic for (int i = 0; i < signText.size(); ++i) { FilteredText filteredtext = (FilteredText) signText.get(i); @@ -3403,7 +3394,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a } SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines); this.cserver.getPluginManager().callEvent(event); -@@ -3461,6 +3566,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3475,6 +3581,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleKeepAlive(ServerboundKeepAlivePacket packet) { @@ -3420,7 +3411,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a //PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // CraftBukkit // Paper - This shouldn't be on the main thread if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) { int i = (int) (Util.getMillis() - this.keepAliveTime); -@@ -3511,6 +3626,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3525,6 +3641,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister"); private static final ResourceLocation MINECRAFT_BRAND = new ResourceLocation("brand"); // Paper - Brand support @@ -3428,7 +3419,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a @Override public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { -@@ -3535,6 +3651,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3549,6 +3666,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex); this.disconnect("Invalid payload UNREGISTER!", org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause } @@ -3443,7 +3434,7 @@ index 2ca19bbe3a71091843fc7175d726c70321d1fee3..f5e1361c04d44ae7f82376aff6e5f01a try { byte[] data = new byte[packet.data.readableBytes()]; diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index a25306fe8a35bb70a490e6a0c01d0340bbc0d781..cd718c7a9f95d003014ea28642b375297872e5f9 100644 +index 2ff578e4a953ffcf5176815ba8e3f06f73499989..f719f8aafe7c75e2ef8fcb05f556a8d6bd94b9a0 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -220,6 +220,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -3465,15 +3456,15 @@ index a25306fe8a35bb70a490e6a0c01d0340bbc0d781..cd718c7a9f95d003014ea28642b37529 } } catch (AuthenticationUnavailableException authenticationunavailableexception) { diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java -index 0725c39d9cbec3282f93975a0ae76f060f70d86d..b1afe7d9fff390cc9668ce9bbb408d64147553e6 100644 +index 2c13147bc063a09bb7907d6f90c3a1e811a09eb1..3edb0c392cec7fdabebad81da1a8b06a700fbfca 100644 --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java -@@ -152,6 +152,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene +@@ -153,6 +153,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene this.connection.send(new ClientboundStatusResponsePacket(ping)); // CraftBukkit end */ -+ if (this.server.getStatus().getVersion() == null) return; // Purpur - do not respond to pings before we know the protocol version - com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.server, this.connection); ++ if (MinecraftServer.getServer().getStatus().version().isEmpty()) return; // Purpur - do not respond to pings before we know the protocol version + com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(MinecraftServer.getServer(), this.connection); // Paper end } diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java @@ -3497,10 +3488,10 @@ index 9ddbfcf80d9a381dace78a62880f85a4d767e0eb..7383c7d3820dce06108eaafd236a7c6c } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 835e439a1af327c67558653ef79ef7e59692a976..82093c413722e280b9fcb46fb0ba03ca629e54fa 100644 +index c0c14766adaac855112f85a203a6163b8adfdded..1a288ebcaade0cc44c7d09478f4f2f8eee7a4269 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -455,6 +455,7 @@ public abstract class PlayerList { +@@ -462,6 +462,7 @@ public abstract class PlayerList { scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); } // Paper end @@ -3508,7 +3499,7 @@ index 835e439a1af327c67558653ef79ef7e59692a976..82093c413722e280b9fcb46fb0ba03ca // CraftBukkit - Moved from above, added world PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ()); } -@@ -564,6 +565,8 @@ public abstract class PlayerList { +@@ -571,6 +572,8 @@ public abstract class PlayerList { } public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer, net.kyori.adventure.text.Component leaveMessage) { // Paper end @@ -3517,7 +3508,7 @@ index 835e439a1af327c67558653ef79ef7e59692a976..82093c413722e280b9fcb46fb0ba03ca ServerLevel worldserver = entityplayer.getLevel(); entityplayer.awardStat(Stats.LEAVE_GAME); -@@ -717,7 +720,7 @@ public abstract class PlayerList { +@@ -724,7 +727,7 @@ public abstract class PlayerList { event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure } else { // return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile) ? IChatBaseComponent.translatable("multiplayer.disconnect.server_full") : null; @@ -3526,7 +3517,7 @@ index 835e439a1af327c67558653ef79ef7e59692a976..82093c413722e280b9fcb46fb0ba03ca event.disallow(PlayerLoginEvent.Result.KICK_FULL, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)); // Spigot // Paper - Adventure } } -@@ -955,6 +958,8 @@ public abstract class PlayerList { +@@ -962,6 +965,8 @@ public abstract class PlayerList { } // Paper end @@ -3535,7 +3526,7 @@ index 835e439a1af327c67558653ef79ef7e59692a976..82093c413722e280b9fcb46fb0ba03ca // CraftBukkit end return entityplayer1; } -@@ -1015,6 +1020,20 @@ public abstract class PlayerList { +@@ -1022,6 +1027,20 @@ public abstract class PlayerList { } // CraftBukkit end @@ -3556,7 +3547,7 @@ index 835e439a1af327c67558653ef79ef7e59692a976..82093c413722e280b9fcb46fb0ba03ca public void broadcastAll(Packet packet, ResourceKey dimension) { Iterator iterator = this.players.iterator(); -@@ -1118,6 +1137,7 @@ public abstract class PlayerList { +@@ -1125,6 +1144,7 @@ public abstract class PlayerList { } else { b0 = (byte) (24 + permissionLevel); } @@ -3564,7 +3555,7 @@ index 835e439a1af327c67558653ef79ef7e59692a976..82093c413722e280b9fcb46fb0ba03ca player.connection.send(new ClientboundEntityEventPacket(player, b0)); } -@@ -1126,6 +1146,27 @@ public abstract class PlayerList { +@@ -1133,6 +1153,27 @@ public abstract class PlayerList { player.getBukkitEntity().recalculatePermissions(); // CraftBukkit this.server.getCommands().sendCommands(player); } // Paper @@ -3592,7 +3583,7 @@ index 835e439a1af327c67558653ef79ef7e59692a976..82093c413722e280b9fcb46fb0ba03ca } public boolean isWhiteListed(GameProfile profile) { -@@ -1187,7 +1228,7 @@ public abstract class PlayerList { +@@ -1194,7 +1235,7 @@ public abstract class PlayerList { public void saveAll(int interval) { io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main @@ -3601,7 +3592,7 @@ index 835e439a1af327c67558653ef79ef7e59692a976..82093c413722e280b9fcb46fb0ba03ca int numSaved = 0; long now = MinecraftServer.currentTick; for (int i = 0; i < this.players.size(); ++i) { -@@ -1198,7 +1239,7 @@ public abstract class PlayerList { +@@ -1205,7 +1246,7 @@ public abstract class PlayerList { } // Paper end } @@ -3645,7 +3636,7 @@ index d13ed3069e944d138442ea440ac3eaf8d44c18d3..29ac7f202aa23f7e6fcdc9829af3d598 } else { handler.accept((Recipe) optional.get()); diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java -index 6d96da16f25e2359e053c45270310886e168f828..de024b88e7328c25748f59288fb7ff575fce1fdc 100644 +index 196c7331138fee2822c76aacd136f9da040e0049..c6c30d99399c5cde2b0ec2f320d81d952b422d78 100644 --- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java +++ b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java @@ -55,7 +55,7 @@ public class ActiveProfiler implements ProfileCollector { @@ -3695,7 +3686,7 @@ index 6d96da16f25e2359e053c45270310886e168f828..de024b88e7328c25748f59288fb7ff57 private ActiveProfiler.PathEntry getCurrentEntry() { diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java -index 5725c6593480fada65facc29664a00a8cc073512..ccb1f998ae3122d1856d77149ff7e7dffeedc71a 100644 +index 2e6e8eac987c4ef6b2dcd3de592d8a51d2b29792..863343a87fe34d72f04af89d75268b477b2adc7a 100644 --- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java +++ b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java @@ -6,32 +6,44 @@ import net.minecraft.util.profiling.metrics.MetricCategory; @@ -3733,7 +3724,7 @@ index 5725c6593480fada65facc29664a00a8cc073512..ccb1f998ae3122d1856d77149ff7e7df } + @io.papermc.paper.annotation.DoNotUse // Purpur - void incrementCounter(String marker, int i); + void incrementCounter(String marker, int num); + @io.papermc.paper.annotation.DoNotUse // Purpur default void incrementCounter(Supplier markerGetter) { @@ -3742,7 +3733,7 @@ index 5725c6593480fada65facc29664a00a8cc073512..ccb1f998ae3122d1856d77149ff7e7df } + @io.papermc.paper.annotation.DoNotUse // Purpur - void incrementCounter(Supplier markerGetter, int i); + void incrementCounter(Supplier markerGetter, int num); static ProfilerFiller tee(final ProfilerFiller a, final ProfilerFiller b) { @@ -41,62 +53,62 @@ public interface ProfilerFiller { @@ -3812,19 +3803,19 @@ index 5725c6593480fada65facc29664a00a8cc073512..ccb1f998ae3122d1856d77149ff7e7df } @Override - public void incrementCounter(String marker, int i) { -- a.incrementCounter(marker, i); -- b.incrementCounter(marker, i); -+ //a.incrementCounter(marker, i); // Purpur -+ //b.incrementCounter(marker, i); // Purpur + public void incrementCounter(String marker, int num) { +- a.incrementCounter(marker, num); +- b.incrementCounter(marker, num); ++ //a.incrementCounter(marker, num); // Purpur ++ //b.incrementCounter(marker, num); // Purpur } @Override - public void incrementCounter(Supplier markerGetter, int i) { -- a.incrementCounter(markerGetter, i); -- b.incrementCounter(markerGetter, i); -+ //a.incrementCounter(markerGetter, i); // Purpur -+ //b.incrementCounter(markerGetter, i); // Purpur + public void incrementCounter(Supplier markerGetter, int num) { +- a.incrementCounter(markerGetter, num); +- b.incrementCounter(markerGetter, num); ++ //a.incrementCounter(markerGetter, num); // Purpur ++ //b.incrementCounter(markerGetter, num); // Purpur } }; } @@ -3848,32 +3839,11 @@ index ccbfcef3e83b1bef364447657bfd08a92d615cf6..aa2331c6df4e79d4bb0add071a0b11d2 } } diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -index 2848cb7c76e94d8349f042dc92daf01322a6ce5a..2e1c34d37b4371fcd7f5616ad5cd5876014ebc9d 100644 +index 93a1e990b0a6caae4143c2f9d09bfb368fa1d6db..615611fe372d6edaef56db058bbf2cf7641e3c26 100644 --- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java +++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -@@ -35,6 +35,20 @@ public class DamageSource { - public static final DamageSource SWEET_BERRY_BUSH = new DamageSource("sweetBerryBush"); - public static final DamageSource FREEZE = (new DamageSource("freeze")).bypassArmor(); - public static final DamageSource STALAGMITE = (new DamageSource("stalagmite")).bypassArmor().setIsFall(); -+ // Purpur start -+ public static final DamageSource SCISSORS = (new DamageSource("scissors") { -+ @Override -+ public Component getLocalizedDeathMessage(LivingEntity entity) { -+ return getLocalizedDeathMessage(org.purpurmc.purpur.PurpurConfig.deathMsgRunWithScissors, entity); -+ } -+ }).bypassArmor(); -+ public static final DamageSource STONECUTTER = (new DamageSource("stonecutter") { -+ @Override -+ public Component getLocalizedDeathMessage(LivingEntity entity) { -+ return getLocalizedDeathMessage(org.purpurmc.purpur.PurpurConfig.deathMsgStonecutter, entity); -+ } -+ }).bypassArmor(); -+ // Purpur end - private boolean damageHelmet; - private boolean bypassArmor; - private boolean bypassInvul; -@@ -265,6 +279,15 @@ public class DamageSource { - return entityliving1 != null ? Component.translatable(s1, entity.getDisplayName(), entityliving1.getDisplayName()) : Component.translatable(s, entity.getDisplayName()); +@@ -126,6 +126,15 @@ public class DamageSource { + } } + // Purpur start @@ -3885,14 +3855,14 @@ index 2848cb7c76e94d8349f042dc92daf01322a6ce5a..2e1c34d37b4371fcd7f5616ad5cd5876 + } + // Purpur end + - public boolean isFire() { - return this.isFireSource; + public String getMsgId() { + return this.type().msgId(); } diff --git a/src/main/java/net/minecraft/world/effect/MobEffect.java b/src/main/java/net/minecraft/world/effect/MobEffect.java -index e708b2c987fac150c22b3367cec2e3e2bcb9914c..434f229c9e67c4ca459ab612345a1754d8be9780 100644 +index 2cc714585fc3790b70a7ad1ab8034543462e2b3b..22d7f04cefafa0115a4504e37380787777091b18 100644 --- a/src/main/java/net/minecraft/world/effect/MobEffect.java +++ b/src/main/java/net/minecraft/world/effect/MobEffect.java -@@ -61,16 +61,16 @@ public class MobEffect { +@@ -60,16 +60,16 @@ public class MobEffect { public void applyEffectTick(LivingEntity entity, int amplifier) { if (this == MobEffects.REGENERATION) { if (entity.getHealth() < entity.getMaxHealth()) { @@ -3901,20 +3871,20 @@ index e708b2c987fac150c22b3367cec2e3e2bcb9914c..434f229c9e67c4ca459ab612345a1754 } } else if (this == MobEffects.POISON) { - if (entity.getHealth() > 1.0F) { -- entity.hurt(CraftEventFactory.POISON, 1.0F); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON +- entity.hurt(entity.damageSources().poison, 1.0F); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON + if (entity.getHealth() > entity.level.purpurConfig.entityMinimalHealthPoison) { // Purpur -+ entity.hurt(CraftEventFactory.POISON, entity.level.purpurConfig.entityPoisonDegenerationAmount); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON // Purpur ++ entity.hurt(entity.damageSources().poison, entity.level.purpurConfig.entityPoisonDegenerationAmount); // CraftBukkit - DamageSource.MAGIC -> CraftEventFactory.POISON // Purpur } } else if (this == MobEffects.WITHER) { -- entity.hurt(DamageSource.WITHER, 1.0F); -+ entity.hurt(DamageSource.WITHER, entity.level.purpurConfig.entityWitherDegenerationAmount); // Purpur +- entity.hurt(entity.damageSources().wither(), 1.0F); ++ entity.hurt(entity.damageSources().wither(), entity.level.purpurConfig.entityWitherDegenerationAmount); // Purpur } else if (this == MobEffects.HUNGER && entity instanceof Player) { - ((Player) entity).causeFoodExhaustion(0.005F * (float) (amplifier + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent + ((Player) entity).causeFoodExhaustion(entity.level.purpurConfig.humanHungerExhaustionAmount * (float) (amplifier + 1), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.HUNGER_EFFECT); // CraftBukkit - EntityExhaustionEvent // Purpur } else if (this == MobEffects.SATURATION && entity instanceof Player) { if (!entity.level.isClientSide) { // CraftBukkit start -@@ -80,7 +80,7 @@ public class MobEffect { +@@ -79,7 +79,7 @@ public class MobEffect { org.bukkit.event.entity.FoodLevelChangeEvent event = CraftEventFactory.callFoodLevelChangeEvent(entityhuman, amplifier + 1 + oldFoodLevel); if (!event.isCancelled()) { @@ -3924,10 +3894,10 @@ index e708b2c987fac150c22b3367cec2e3e2bcb9914c..434f229c9e67c4ca459ab612345a1754 ((ServerPlayer) entityhuman).connection.send(new ClientboundSetHealthPacket(((ServerPlayer) entityhuman).getBukkitEntity().getScaledHealth(), entityhuman.getFoodData().foodLevel, entityhuman.getFoodData().saturationLevel)); diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java -index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb56bac723 100644 +index 14fab63346d56c72cd7534a04760efd10eef4295..745e792482f61c571e2efbd4200dd1bdaef6e474 100644 --- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java +++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java -@@ -13,6 +13,7 @@ import net.minecraft.util.ExtraCodecs; +@@ -14,6 +14,7 @@ import net.minecraft.util.ExtraCodecs; import net.minecraft.util.Mth; import net.minecraft.world.entity.LivingEntity; import org.slf4j.Logger; @@ -3935,7 +3905,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb public class MobEffectInstance implements Comparable { private static final Logger LOGGER = LogUtils.getLogger(); -@@ -23,6 +24,7 @@ public class MobEffectInstance implements Comparable { +@@ -25,6 +26,7 @@ public class MobEffectInstance implements Comparable { private boolean visible; private boolean showIcon; @Nullable @@ -3943,7 +3913,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb private MobEffectInstance hiddenEffect; private final Optional factorData; -@@ -42,17 +44,36 @@ public class MobEffectInstance implements Comparable { +@@ -44,17 +46,36 @@ public class MobEffectInstance implements Comparable { this(type, duration, amplifier, ambient, visible, visible); } @@ -3981,7 +3951,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb this.hiddenEffect = hiddenEffect; this.factorData = factorCalculationData; } -@@ -73,6 +94,7 @@ public class MobEffectInstance implements Comparable { +@@ -75,6 +96,7 @@ public class MobEffectInstance implements Comparable { this.ambient = that.ambient; this.visible = that.visible; this.showIcon = that.showIcon; @@ -3989,7 +3959,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb } public boolean update(MobEffectInstance that) { -@@ -125,6 +147,13 @@ public class MobEffectInstance implements Comparable { +@@ -120,6 +142,13 @@ public class MobEffectInstance implements Comparable { bl = true; } @@ -4003,7 +3973,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb return bl; } -@@ -152,6 +181,17 @@ public class MobEffectInstance implements Comparable { +@@ -163,6 +192,17 @@ public class MobEffectInstance implements Comparable { return this.showIcon; } @@ -4019,9 +3989,9 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb + // Purpur end + public boolean tick(LivingEntity entity, Runnable overwriteCallback) { - if (this.duration > 0) { - if (this.effect.isDurationEffectTick(this.duration, this.amplifier)) { -@@ -208,6 +248,12 @@ public class MobEffectInstance implements Comparable { + if (this.hasRemainingDuration()) { + int i = this.isInfiniteDuration() ? entity.tickCount : this.duration; +@@ -226,6 +266,12 @@ public class MobEffectInstance implements Comparable { string = string + ", Show Icon: false"; } @@ -4034,7 +4004,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb return string; } -@@ -219,7 +265,7 @@ public class MobEffectInstance implements Comparable { +@@ -241,7 +287,7 @@ public class MobEffectInstance implements Comparable { return false; } else { MobEffectInstance mobEffectInstance = (MobEffectInstance)object; @@ -4043,7 +4013,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb } } -@@ -243,6 +289,11 @@ public class MobEffectInstance implements Comparable { +@@ -265,6 +311,11 @@ public class MobEffectInstance implements Comparable { nbt.putBoolean("Ambient", this.isAmbient()); nbt.putBoolean("ShowParticles", this.isVisible()); nbt.putBoolean("ShowIcon", this.showIcon()); @@ -4055,7 +4025,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb if (this.hiddenEffect != null) { CompoundTag compoundTag = new CompoundTag(); this.hiddenEffect.save(compoundTag); -@@ -277,6 +328,13 @@ public class MobEffectInstance implements Comparable { +@@ -299,6 +350,13 @@ public class MobEffectInstance implements Comparable { bl3 = nbt.getBoolean("ShowIcon"); } @@ -4069,7 +4039,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb MobEffectInstance mobEffectInstance = null; if (nbt.contains("HiddenEffect", 10)) { mobEffectInstance = loadSpecifiedEffect(type, nbt.getCompound("HiddenEffect")); -@@ -289,7 +347,7 @@ public class MobEffectInstance implements Comparable { +@@ -311,7 +369,7 @@ public class MobEffectInstance implements Comparable { optional = Optional.empty(); } @@ -4079,7 +4049,7 @@ index 038ba61e4845a4a71bb78ba388ed249d19529b78..6d5080ba244daf3b93d61d28ee0b88eb @Override diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fadad89d2f8d 100644 +index 8a2429f915da389360dcb16609fef7701b4a863a..4ea7bee58188ae7f4117dd705fdcc8f4be4d40ec 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -155,7 +155,7 @@ import org.bukkit.plugin.PluginManager; @@ -4091,6 +4061,15 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada // CraftBukkit start private static final int CURRENT_LEVEL = 2; public boolean preserveMotion = true; // Paper - keep initial motion on first setPositionRotation +@@ -319,7 +319,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + public double xOld; + public double yOld; + public double zOld; +- private float maxUpStep; ++ public float maxUpStep; // Purpur - private -> public + public boolean noPhysics; + protected final RandomSource random; + public int tickCount; @@ -361,7 +361,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { private final Set tags; private final double[] pistonDeltas; @@ -4100,7 +4079,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada private float eyeHeight; public boolean isInPowderSnow; public boolean wasInPowderSnow; -@@ -398,6 +398,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -399,6 +399,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { private UUID originWorld; public boolean freezeLocked = false; // Paper - Freeze Tick Lock API public boolean collidingWithWorldBorder; // Paper @@ -4108,16 +4087,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -419,7 +420,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - public int activatedPriority = gg.pufferfish.pufferfish.PufferfishConfig.maximumActivationPrio; // golf score - public final BlockPos.MutableBlockPos cachedBlockPos = new BlockPos.MutableBlockPos(); // used where needed - // Pufferfish end -- -+ - public float getBukkitYaw() { - return this.yRot; - } -@@ -577,7 +578,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -578,7 +579,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.bb = Entity.INITIAL_AABB; this.stuckSpeedMultiplier = Vec3.ZERO; this.nextStep = 1.0F; @@ -4126,7 +4096,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada this.remainingFireTicks = -this.getFireImmuneTicks(); this.fluidHeight = new Object2DoubleArrayMap(2); this.fluidOnEyes = new HashSet(); -@@ -822,7 +823,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -823,7 +824,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return; } // Pufferfish end - entity TTL @@ -4135,7 +4105,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Update last hurt when ticking this.feetBlockState = null; if (this.isPassenger() && this.getVehicle().isRemoved()) { -@@ -883,7 +884,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -884,7 +885,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } this.firstTick = false; @@ -4144,7 +4114,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada } public void setSharedFlagOnFire(boolean onFire) { -@@ -892,10 +893,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -893,10 +894,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { public void checkOutOfWorld() { // Paper start - Configurable nether ceiling damage @@ -4157,7 +4127,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada this.outOfWorld(); } -@@ -1057,7 +1059,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1058,7 +1060,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } } @@ -4166,7 +4136,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) { movement = movement.multiply(this.stuckSpeedMultiplier); this.stuckSpeedMultiplier = Vec3.ZERO; -@@ -1066,7 +1068,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1067,7 +1069,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { // Paper start - ignore movement changes while inactive. if (isTemporarilyActive && !(this instanceof ItemEntity || this instanceof net.minecraft.world.entity.vehicle.AbstractMinecart) && movement == getDeltaMovement() && movementType == MoverType.SELF) { setDeltaMovement(Vec3.ZERO); @@ -4175,7 +4145,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada return; } // Paper end -@@ -1087,8 +1089,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1088,8 +1090,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z); } @@ -4186,7 +4156,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada boolean flag = !Mth.equal(movement.x, vec3d1.x); boolean flag1 = !Mth.equal(movement.z, vec3d1.z); -@@ -1107,7 +1109,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1108,7 +1110,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.checkFallDamage(vec3d1.y, this.onGround, iblockdata, blockposition); if (this.isRemoved()) { @@ -4195,7 +4165,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada } else { if (this.horizontalCollision) { Vec3 vec3d2 = this.getDeltaMovement(); -@@ -1248,7 +1250,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1249,7 +1251,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.setRemainingFireTicks(-this.getFireImmuneTicks()); } @@ -4204,7 +4174,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada } } // Paper start - detailed watchdog information -@@ -1675,7 +1677,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1676,7 +1678,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public boolean fireImmune() { @@ -4213,7 +4183,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada } public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { -@@ -1740,7 +1742,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1745,7 +1747,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return this.isInWater() || flag; } @@ -4222,7 +4192,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada Entity entity = this.getVehicle(); if (entity instanceof Boat) { -@@ -2326,6 +2328,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2338,6 +2340,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { nbt.putBoolean("Paper.FreezeLock", true); } // Paper end @@ -4234,7 +4204,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada return nbt; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); -@@ -2493,6 +2500,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2506,6 +2513,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { freezeLocked = nbt.getBoolean("Paper.FreezeLock"); } // Paper end @@ -4246,7 +4216,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT"); -@@ -2811,6 +2823,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2822,6 +2834,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.passengers = ImmutableList.copyOf(list); } @@ -4256,10 +4226,11 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada + this.rider = player; + } + // Purpur end ++ + this.gameEvent(GameEvent.ENTITY_MOUNT, entity); } return true; // CraftBukkit - } -@@ -2851,6 +2869,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2863,6 +2882,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return false; } // Spigot end @@ -4274,7 +4245,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada if (this.passengers.size() == 1 && this.passengers.get(0) == entity) { this.passengers = ImmutableList.of(); } else { -@@ -2905,12 +2931,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2922,12 +2949,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return Vec3.directionFromRotation(this.getRotationVector()); } @@ -4291,7 +4262,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada } this.isInsidePortal = true; -@@ -2928,7 +2957,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2945,7 +2975,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { ServerLevel worldserver1 = minecraftserver.getLevel(resourcekey); if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit @@ -4300,7 +4271,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada this.portalTime = i; // Paper start io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver1.getWorld(), org.bukkit.PortalType.NETHER); -@@ -2946,7 +2975,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2963,7 +2993,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } } // Paper // CraftBukkit end @@ -4309,7 +4280,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada } this.isInsidePortal = false; -@@ -2961,7 +2990,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2978,7 +3008,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } this.processPortalCooldown(); @@ -4318,7 +4289,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada } } -@@ -3141,7 +3170,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3160,7 +3190,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public int getMaxAirSupply() { @@ -4327,7 +4298,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada } public int getAirSupply() { -@@ -3411,14 +3440,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3430,14 +3460,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } // Paper end if (this.level instanceof ServerLevel && !this.isRemoved()) { @@ -4344,7 +4315,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada PortalInfo shapedetectorshape = (location == null) ? this.findDimensionEntryPoint(worldserver) : new PortalInfo(new Vec3(location.x(), location.y(), location.z()), Vec3.ZERO, this.yRot, this.xRot, worldserver, null); // CraftBukkit if (shapedetectorshape == null) { -@@ -3452,7 +3481,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3471,7 +3501,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.unRide(); // CraftBukkit end @@ -4353,7 +4324,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada // Paper start - Change lead drop timing to prevent dupe if (this instanceof Mob) { ((Mob) this).dropLeash(true, true); // Paper drop lead -@@ -3475,10 +3504,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3494,10 +3524,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } this.removeAfterChangingDimensions(); @@ -4366,16 +4337,16 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada return entity; } } else { -@@ -3598,7 +3627,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3617,7 +3647,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public boolean canChangeDimensions() { -- return isAlive() && valid; // Paper -+ return isAlive() && valid && (level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer); // Paper // Purpur +- return !this.isPassenger() && !this.isVehicle() && isAlive() && valid; // Paper ++ return !this.isPassenger() && !this.isVehicle() && isAlive() && valid && (level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer); // Paper // Purpur } public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { -@@ -3863,6 +3892,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3908,6 +3938,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return SlotAccess.NULL; } @@ -4396,7 +4367,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada @Override public void sendSystemMessage(Component message) {} -@@ -4125,6 +4168,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4189,6 +4233,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.yRotO = this.getYRot(); } @@ -4409,7 +4380,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada public boolean updateFluidHeightAndDoFluidPushing(TagKey tag, double speed) { if (false && this.touchingUnloadedChunk()) { // Pufferfish - cost of a lookup here is the same cost as below, so skip return false; -@@ -4637,4 +4686,64 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4717,4 +4767,64 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this); } // Paper end @@ -4462,7 +4433,7 @@ index 3073b34a0e0281b6b0330721bb0440147de28511..1ae7ef3d94d4d3d8413a5419eeb9fada + public boolean isSunBurnTick() { + if (this.level.isDay() && !this.level.isClientSide) { + float f = this.getLightLevelDependentMagicValue(); -+ BlockPos blockposition = new BlockPos(this.getX(), this.getEyeY(), this.getZ()); ++ BlockPos blockposition = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ()); + boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow; + + if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && !flag && this.level.canSeeSky(blockposition)) { @@ -4487,10 +4458,10 @@ index 72abebff2018cde2922e97ad6478f93da9aed3ec..412963d7af38a53b6010007278d959a5 private EntitySelector() {} // Paper start diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index ac7ee31f2bfe5d4139b793a698317db50b39fe40..f22ceffdc95224f2de8d19f501b43b266de196d4 100644 +index 8af0918d3a62de58a4b2af55022c812bb0e46092..3fc26a8976f4bfa28c2c6a862aac997d5f721f51 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -301,13 +301,24 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -308,13 +308,24 @@ public class EntityType implements FeatureElement, EntityTypeT private Component description; @Nullable private ResourceLocation lootTable; @@ -4516,7 +4487,7 @@ index ac7ee31f2bfe5d4139b793a698317db50b39fe40..f22ceffdc95224f2de8d19f501b43b26 public static ResourceLocation getKey(EntityType type) { return BuiltInRegistries.ENTITY_TYPE.getKey(type); } -@@ -522,6 +533,16 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -530,6 +541,16 @@ public class EntityType implements FeatureElement, EntityTypeT return this.category; } @@ -4533,7 +4504,7 @@ index ac7ee31f2bfe5d4139b793a698317db50b39fe40..f22ceffdc95224f2de8d19f501b43b26 public String getDescriptionId() { if (this.descriptionId == null) { this.descriptionId = Util.makeDescriptionId("entity", BuiltInRegistries.ENTITY_TYPE.getKey(this)); -@@ -583,6 +604,12 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -591,6 +612,12 @@ public class EntityType implements FeatureElement, EntityTypeT entity.load(nbt); }, () -> { EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id")); @@ -4547,7 +4518,7 @@ index ac7ee31f2bfe5d4139b793a698317db50b39fe40..f22ceffdc95224f2de8d19f501b43b26 } diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index cf5c7e8557b0084039a94ef881a36aa9e3f58daf..a1d271c931cf35f6a73191a1c21933ab0203bf7d 100644 +index 2d3994de8e40eedc78c27ea842b6265b1c5ea822..df8d8f85f8db396b7db9fa6e46aa55c934105394 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java @@ -304,8 +304,8 @@ public class ExperienceOrb extends Entity { @@ -4571,10 +4542,10 @@ index cf5c7e8557b0084039a94ef881a36aa9e3f58daf..a1d271c931cf35f6a73191a1c21933ab if (entry != null) { ItemStack itemstack = (ItemStack) entry.getValue(); diff --git a/src/main/java/net/minecraft/world/entity/GlowSquid.java b/src/main/java/net/minecraft/world/entity/GlowSquid.java -index c1e9b40a4a0f9cdc650caa88b5ea132e06ee2496..5d6cddc221887be20ef75d688817dfe527e73362 100644 +index c1e9b40a4a0f9cdc650caa88b5ea132e06ee2496..6f723171fa71d74b351b5cf0cd167bb6f7ca1691 100644 --- a/src/main/java/net/minecraft/world/entity/GlowSquid.java +++ b/src/main/java/net/minecraft/world/entity/GlowSquid.java -@@ -18,11 +18,49 @@ import net.minecraft.world.level.block.Blocks; +@@ -18,11 +18,45 @@ import net.minecraft.world.level.block.Blocks; public class GlowSquid extends Squid { private static final EntityDataAccessor DATA_DARK_TICKS_REMAINING = SynchedEntityData.defineId(GlowSquid.class, EntityDataSerializers.INT); @@ -4590,10 +4561,6 @@ index c1e9b40a4a0f9cdc650caa88b5ea132e06ee2496..5d6cddc221887be20ef75d688817dfe5 + return level.purpurConfig.glowSquidRidable; + } + -+ @Override -+ public boolean rideableUnderWater() { -+ return true; -+ } + + @Override + public boolean isControllable() { @@ -4624,7 +4591,7 @@ index c1e9b40a4a0f9cdc650caa88b5ea132e06ee2496..5d6cddc221887be20ef75d688817dfe5 @Override protected ParticleOptions getInkParticle() { return ParticleTypes.GLOW_SQUID_INK; -@@ -32,6 +70,7 @@ public class GlowSquid extends Squid { +@@ -32,6 +66,7 @@ public class GlowSquid extends Squid { protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_DARK_TICKS_REMAINING, 0); @@ -4632,7 +4599,7 @@ index c1e9b40a4a0f9cdc650caa88b5ea132e06ee2496..5d6cddc221887be20ef75d688817dfe5 } @Override -@@ -58,12 +97,14 @@ public class GlowSquid extends Squid { +@@ -58,12 +93,14 @@ public class GlowSquid extends Squid { public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); nbt.putInt("DarkTicksRemaining", this.getDarkTicksRemaining()); @@ -4648,10 +4615,10 @@ index c1e9b40a4a0f9cdc650caa88b5ea132e06ee2496..5d6cddc221887be20ef75d688817dfe5 @Override diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5abb40b7df 100644 +index 791f672b30f2a4d3b329e2ce0f4fb9c2ca627b01..8d7c33e16f9eaec2120c5aad75172ff656d1bd17 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -221,9 +221,9 @@ public abstract class LivingEntity extends Entity { +@@ -216,9 +216,9 @@ public abstract class LivingEntity extends Entity implements Attackable { protected int deathScore; public float lastHurt; public boolean jumping; @@ -4664,7 +4631,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a protected int lerpSteps; protected double lerpX; protected double lerpY; -@@ -256,6 +256,7 @@ public abstract class LivingEntity extends Entity { +@@ -251,6 +251,7 @@ public abstract class LivingEntity extends Entity implements Attackable { private boolean skipDropExperience; // CraftBukkit start public int expToDrop; @@ -4672,7 +4639,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a public boolean forceDrops; public ArrayList drops = new ArrayList(); public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes; -@@ -265,6 +266,7 @@ public abstract class LivingEntity extends Entity { +@@ -260,6 +261,7 @@ public abstract class LivingEntity extends Entity implements Attackable { public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper @@ -4680,7 +4647,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a @Override public float getBukkitYaw() { -@@ -289,7 +291,8 @@ public abstract class LivingEntity extends Entity { +@@ -284,7 +286,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.effectsDirty = true; this.useItem = ItemStack.EMPTY; this.lastClimbablePos = Optional.empty(); @@ -4690,7 +4657,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a this.craftAttributes = new CraftAttributeMap(this.attributes); // CraftBukkit // CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor this.entityData.set(LivingEntity.DATA_HEALTH_ID, (float) this.getAttribute(Attributes.MAX_HEALTH).getValue()); -@@ -305,6 +308,8 @@ public abstract class LivingEntity extends Entity { +@@ -300,6 +303,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.brain = this.makeBrain(new Dynamic(dynamicopsnbt, (Tag) dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), (Tag) dynamicopsnbt.emptyMap())))); } @@ -4699,7 +4666,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a public Brain getBrain() { return this.brain; } -@@ -340,6 +345,7 @@ public abstract class LivingEntity extends Entity { +@@ -335,6 +340,7 @@ public abstract class LivingEntity extends Entity implements Attackable { public static AttributeSupplier.Builder createLivingAttributes() { return AttributeSupplier.builder().add(Attributes.MAX_HEALTH).add(Attributes.KNOCKBACK_RESISTANCE).add(Attributes.MOVEMENT_SPEED).add(Attributes.ARMOR).add(Attributes.ARMOR_TOUGHNESS); } @@ -4707,7 +4674,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a @Override protected void checkFallDamage(double heightDifference, boolean onGround, BlockState state, BlockPos landedPosition) { -@@ -352,8 +358,8 @@ public abstract class LivingEntity extends Entity { +@@ -347,8 +353,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.tryAddSoulSpeed(); } @@ -4718,7 +4685,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a if (!state.isAir()) { double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D); -@@ -392,7 +398,7 @@ public abstract class LivingEntity extends Entity { +@@ -387,7 +393,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } super.baseTick(); @@ -4727,15 +4694,15 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a if (this.fireImmune() || this.level.isClientSide) { this.clearFire(); } -@@ -410,6 +416,7 @@ public abstract class LivingEntity extends Entity { +@@ -405,6 +411,7 @@ public abstract class LivingEntity extends Entity implements Attackable { double d1 = this.level.getWorldBorder().getDamagePerBlock(); if (d1 > 0.0D) { + if (level.purpurConfig.teleportIfOutsideBorder && this instanceof ServerPlayer) { ((ServerPlayer) this).teleport(io.papermc.paper.util.MCUtil.toLocation(level, ((ServerLevel) level).getSharedSpawnPos())); return; } // Purpur - this.hurt(DamageSource.IN_WALL, (float) Math.max(1, Mth.floor(-d0 * d1))); + this.hurt(this.damageSources().inWall(), (float) Math.max(1, Mth.floor(-d0 * d1))); } } -@@ -421,7 +428,7 @@ public abstract class LivingEntity extends Entity { +@@ -416,7 +423,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (flag1) { this.setAirSupply(this.decreaseAirSupply(this.getAirSupply())); @@ -4744,16 +4711,16 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a this.setAirSupply(0); Vec3 vec3d = this.getDeltaMovement(); -@@ -433,7 +440,7 @@ public abstract class LivingEntity extends Entity { +@@ -428,7 +435,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level.addParticle(ParticleTypes.BUBBLE, this.getX() + d2, this.getY() + d3, this.getZ() + d4, vec3d.x, vec3d.y, vec3d.z); } -- this.hurt(DamageSource.DROWN, 2.0F); -+ this.hurt(DamageSource.DROWN, (float) this.level.purpurConfig.damageFromDrowning); // Purpur +- this.hurt(this.damageSources().drown(), 2.0F); ++ this.hurt(this.damageSources().drown(), (float) this.level.purpurConfig.damageFromDrowning); // Purpur } } -@@ -494,7 +501,7 @@ public abstract class LivingEntity extends Entity { +@@ -489,7 +496,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.yHeadRotO = this.yHeadRot; this.yRotO = this.getYRot(); this.xRotO = this.getXRot(); @@ -4762,7 +4729,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a } public boolean canSpawnSoulSpeedParticle() { -@@ -787,6 +794,7 @@ public abstract class LivingEntity extends Entity { +@@ -781,6 +788,7 @@ public abstract class LivingEntity extends Entity implements Attackable { dataresult.resultOrPartial(logger::error).ifPresent((nbtbase) -> { nbt.put("Brain", nbtbase); }); @@ -4770,7 +4737,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a } @Override -@@ -871,6 +879,11 @@ public abstract class LivingEntity extends Entity { +@@ -865,6 +873,11 @@ public abstract class LivingEntity extends Entity implements Attackable { this.brain = this.makeBrain(new Dynamic(NbtOps.INSTANCE, nbt.get("Brain"))); } @@ -4782,7 +4749,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a } // CraftBukkit start -@@ -1016,9 +1029,31 @@ public abstract class LivingEntity extends Entity { +@@ -1010,9 +1023,31 @@ public abstract class LivingEntity extends Entity implements Attackable { ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD); EntityType entitytypes = entity.getType(); @@ -4816,7 +4783,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a } return d0; -@@ -1078,6 +1113,7 @@ public abstract class LivingEntity extends Entity { +@@ -1072,6 +1107,7 @@ public abstract class LivingEntity extends Entity implements Attackable { for (flag = false; iterator.hasNext(); flag = true) { // CraftBukkit start MobEffectInstance effect = (MobEffectInstance) iterator.next(); @@ -4824,23 +4791,23 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED); if (event.isCancelled()) { continue; -@@ -1425,13 +1461,13 @@ public abstract class LivingEntity extends Entity { - } - +@@ -1428,13 +1464,13 @@ public abstract class LivingEntity extends Entity implements Attackable { if (entity1 instanceof net.minecraft.world.entity.player.Player) { + net.minecraft.world.entity.player.Player entityhuman = (net.minecraft.world.entity.player.Player) entity1; + - this.lastHurtByPlayerTime = 100; + this.lastHurtByPlayerTime = this.level.purpurConfig.mobLastHurtByPlayerTime; // Purpur - this.lastHurtByPlayer = (net.minecraft.world.entity.player.Player) entity1; + this.lastHurtByPlayer = entityhuman; } else if (entity1 instanceof Wolf) { Wolf entitywolf = (Wolf) entity1; if (entitywolf.isTame()) { - this.lastHurtByPlayerTime = 100; + this.lastHurtByPlayerTime = this.level.purpurConfig.mobLastHurtByPlayerTime; // Purpur - LivingEntity entityliving1 = entitywolf.getOwner(); + LivingEntity entityliving2 = entitywolf.getOwner(); - if (entityliving1 != null && entityliving1.getType() == EntityType.PLAYER) { -@@ -1556,6 +1592,18 @@ public abstract class LivingEntity extends Entity { + if (entityliving2 instanceof net.minecraft.world.entity.player.Player) { +@@ -1545,6 +1581,18 @@ public abstract class LivingEntity extends Entity implements Attackable { } } @@ -4849,7 +4816,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a + for (ItemStack item : player.getInventory().items) { + if (item.getItem() == Items.TOTEM_OF_UNDYING) { + itemstack1 = item; -+ itemstack = item.cloneItemStack(false); ++ itemstack = item.copy(); + break; + } + } @@ -4859,7 +4826,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null; EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot); event.setCancelled(itemstack == null); -@@ -1716,7 +1764,7 @@ public abstract class LivingEntity extends Entity { +@@ -1705,7 +1753,7 @@ public abstract class LivingEntity extends Entity implements Attackable { boolean flag = false; if (this.dead && adversary instanceof WitherBoss) { // Paper @@ -4868,15 +4835,15 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a BlockPos blockposition = this.blockPosition(); BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState(); -@@ -1762,6 +1810,7 @@ public abstract class LivingEntity extends Entity { +@@ -1751,6 +1799,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.dropEquipment(); // CraftBukkit - from below if (this.shouldDropLoot() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { -+ if (!(source == DamageSource.CRAMMING && level.purpurConfig.disableDropsOnCrammingDeath)) { // Purpur ++ if (!(source.is(net.minecraft.world.damagesource.DamageTypes.CRAMMING) && level.purpurConfig.disableDropsOnCrammingDeath)) { // Purpur this.dropFromLootTable(source, flag); // Paper start final boolean prev = this.clearEquipmentSlots; -@@ -1770,6 +1819,7 @@ public abstract class LivingEntity extends Entity { +@@ -1759,6 +1808,7 @@ public abstract class LivingEntity extends Entity implements Attackable { // Paper end this.dropCustomDeathLoot(source, i, flag); this.clearEquipmentSlots = prev; // Paper @@ -4884,17 +4851,17 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a } // CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops, () -> { -@@ -2016,7 +2066,7 @@ public abstract class LivingEntity extends Entity { - MobEffectInstance mobeffect = this.getEffect(MobEffects.JUMP); - float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1); +@@ -2014,7 +2064,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + MobEffectInstance mobeffect = this.getEffect(MobEffects.JUMP); + float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1); -- return Mth.ceil((fallDistance - 3.0F - f2) * damageMultiplier); -+ return Mth.ceil((fallDistance - this.safeFallDistance - f2) * damageMultiplier); // Purpur +- return Mth.ceil((fallDistance - 3.0F - f2) * damageMultiplier); ++ return Mth.ceil((fallDistance - this.safeFallDistance - f2) * damageMultiplier); // Purpur + } } - protected void playBlockFallSound() { -@@ -2233,6 +2283,20 @@ public abstract class LivingEntity extends Entity { - ((ServerPlayer) damagesource.getEntity()).awardStat(Stats.DAMAGE_DEALT_ABSORBED, Math.round(f2 * 10.0F)); +@@ -2237,6 +2287,20 @@ public abstract class LivingEntity extends Entity implements Attackable { + } } + // Purpur start @@ -4914,16 +4881,16 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a if (f > 0 || !human) { if (human) { // PAIL: Be sure to drag all this code from the EntityHuman subclass each update. -@@ -2515,7 +2579,7 @@ public abstract class LivingEntity extends Entity { +@@ -2455,7 +2519,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override protected void outOfWorld() { -- this.hurt(DamageSource.OUT_OF_WORLD, 4.0F); -+ this.hurt(DamageSource.OUT_OF_WORLD, (float) level.purpurConfig.voidDamageDealt); // Purpur +- this.hurt(this.damageSources().outOfWorld(), 4.0F); ++ this.hurt(this.damageSources().outOfWorld(), (float) level.purpurConfig.voidDamageDealt); // Purpur } protected void updateSwingTime() { -@@ -2712,7 +2776,7 @@ public abstract class LivingEntity extends Entity { +@@ -2652,7 +2716,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } protected long lastJumpTime = 0L; // Paper @@ -4932,15 +4899,15 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a double d0 = (double) this.getJumpPower() + this.getJumpBoostPower(); Vec3 vec3d = this.getDeltaMovement(); // Paper start -@@ -2866,6 +2930,7 @@ public abstract class LivingEntity extends Entity { +@@ -2806,6 +2870,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (f3 > 0.0F) { this.playSound(this.getFallDamageSound((int) f3), 1.0F, 1.0F); + if (level.purpurConfig.elytraKineticDamage) // Purpur - this.hurt(DamageSource.FLY_INTO_WALL, f3); + this.hurt(this.damageSources().flyIntoWall(), f3); } } -@@ -3062,10 +3127,10 @@ public abstract class LivingEntity extends Entity { +@@ -3028,10 +3093,10 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.run += (f3 - this.run) * 0.3F; @@ -4954,7 +4921,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a // Paper start - stop large pitch and yaw changes from crashing the server this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F; -@@ -3077,7 +3142,7 @@ public abstract class LivingEntity extends Entity { +@@ -3043,7 +3108,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F; // Paper end @@ -4963,7 +4930,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a this.animStep += f2; if (this.isFallFlying()) { ++this.fallFlyTicks; -@@ -3374,19 +3439,19 @@ public abstract class LivingEntity extends Entity { +@@ -3332,19 +3397,19 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.setDeltaMovement(d4, d5, d6); @@ -4988,7 +4955,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a if (this.jumping && this.isAffectedByFluids()) { double d7; -@@ -3413,8 +3478,8 @@ public abstract class LivingEntity extends Entity { +@@ -3371,8 +3436,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.noJumpDelay = 0; } @@ -4999,19 +4966,19 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a this.xxa *= 0.98F; this.zza *= 0.98F; this.updateFallFlying(); -@@ -3423,8 +3488,8 @@ public abstract class LivingEntity extends Entity { - // SpigotTimings.timerEntityAIMove.startTiming(); // Spigot // Paper - this.travel(new Vec3((double) this.xxa, (double) this.yya, (double) this.zza)); - // SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot // Paper +@@ -3388,8 +3453,8 @@ public abstract class LivingEntity extends Entity implements Attackable { + } + //SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot // Paper + - this.level.getProfiler().pop(); - this.level.getProfiler().push("freezing"); + //this.level.getProfiler().pop(); // Purpur + //this.level.getProfiler().push("freezing"); // Purpur - boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES); - int i; + if (!this.level.isClientSide && !this.isDeadOrDying() && !freezeLocked) { // Paper - Freeze Tick Lock API + int i = this.getTicksFrozen(); -@@ -3444,18 +3509,20 @@ public abstract class LivingEntity extends Entity { - this.hurt(DamageSource.FREEZE, (float) i); +@@ -3406,18 +3471,20 @@ public abstract class LivingEntity extends Entity implements Attackable { + this.hurt(this.damageSources().freeze(), 1.0F); } - this.level.getProfiler().pop(); @@ -5036,7 +5003,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a Location from = new Location(this.level.getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO); Location to = new Location (this.level.getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot()); io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone()); -@@ -3465,12 +3532,48 @@ public abstract class LivingEntity extends Entity { +@@ -3427,12 +3494,48 @@ public abstract class LivingEntity extends Entity implements Attackable { absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch()); } } @@ -5058,7 +5025,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a } // Paper end if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { - this.hurt(DamageSource.DROWN, 1.0F); + this.hurt(this.damageSources().drown(), 1.0F); } + // Purpur start - copied from Zombie @@ -5085,7 +5052,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a } public boolean isSensitiveToWater() { -@@ -3491,7 +3594,16 @@ public abstract class LivingEntity extends Entity { +@@ -3453,7 +3556,16 @@ public abstract class LivingEntity extends Entity implements Attackable { int j = i / 10; if (j % 2 == 0) { @@ -5104,7 +5071,7 @@ index f0acc1fd51a49589c33c089562ac80053b4c1ef9..cc8de71037a1eb5dc08467f9bfb84d5a }); } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945a7c3ef62 100644 +index 636e601b004a412d02e5be86e97d489b52c28e1b..141b25060905f598208cb1a39f4c2b2e9f3ef766 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -65,6 +65,7 @@ import net.minecraft.world.item.ProjectileWeaponItem; @@ -5115,7 +5082,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 import net.minecraft.world.level.GameRules; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.Level; -@@ -133,6 +134,7 @@ public abstract class Mob extends LivingEntity { +@@ -133,6 +134,7 @@ public abstract class Mob extends LivingEntity implements Targeting { private BlockPos restrictCenter; private float restrictRadius; @@ -5123,7 +5090,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 public boolean aware = true; // CraftBukkit protected Mob(EntityType type, Level world) { -@@ -146,8 +148,8 @@ public abstract class Mob extends LivingEntity { +@@ -146,8 +148,8 @@ public abstract class Mob extends LivingEntity implements Targeting { this.restrictRadius = -1.0F; this.goalSelector = new GoalSelector(world.getProfilerSupplier()); this.targetSelector = new GoalSelector(world.getProfilerSupplier()); @@ -5134,7 +5101,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 this.jumpControl = new JumpControl(this); this.bodyRotationControl = this.createBodyControl(); this.navigation = this.createNavigation(world); -@@ -289,6 +291,7 @@ public abstract class Mob extends LivingEntity { +@@ -319,6 +321,7 @@ public abstract class Mob extends LivingEntity implements Targeting { entityliving = null; } } @@ -5142,7 +5109,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 this.target = entityliving; return true; // CraftBukkit end -@@ -329,15 +332,35 @@ public abstract class Mob extends LivingEntity { +@@ -359,15 +362,35 @@ public abstract class Mob extends LivingEntity implements Targeting { @Override public void baseTick() { super.baseTick(); @@ -5180,7 +5147,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 @Override protected void playHurtSound(DamageSource source) { this.resetAmbientSoundTime(); -@@ -527,6 +550,7 @@ public abstract class Mob extends LivingEntity { +@@ -557,6 +580,7 @@ public abstract class Mob extends LivingEntity implements Targeting { } nbt.putBoolean("Bukkit.Aware", this.aware); // CraftBukkit @@ -5188,7 +5155,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 } @Override -@@ -597,6 +621,11 @@ public abstract class Mob extends LivingEntity { +@@ -627,6 +651,11 @@ public abstract class Mob extends LivingEntity implements Targeting { this.aware = nbt.getBoolean("Bukkit.Aware"); } // CraftBukkit end @@ -5200,7 +5167,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 } @Override -@@ -640,8 +669,8 @@ public abstract class Mob extends LivingEntity { +@@ -670,8 +699,8 @@ public abstract class Mob extends LivingEntity implements Targeting { @Override public void aiStep() { super.aiStep(); @@ -5211,7 +5178,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 Vec3i baseblockposition = this.getPickupReach(); List list = this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate((double) baseblockposition.getX(), (double) baseblockposition.getY(), (double) baseblockposition.getZ())); Iterator iterator = list.iterator(); -@@ -660,7 +689,7 @@ public abstract class Mob extends LivingEntity { +@@ -690,7 +719,7 @@ public abstract class Mob extends LivingEntity implements Targeting { } } @@ -5220,7 +5187,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 } protected Vec3i getPickupReach() { -@@ -873,46 +902,46 @@ public abstract class Mob extends LivingEntity { +@@ -902,46 +931,46 @@ public abstract class Mob extends LivingEntity implements Targeting { return; } // Paper end @@ -5245,8 +5212,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 - this.level.getProfiler().pop(); + //this.level.getProfiler().pop(); // Purpur } else { -- this.level.getProfiler().push("targetSelector"); -+ //this.level.getProfiler().push("targetSelector"); // Purpur + this.level.getProfiler().push("targetSelector"); if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking this.targetSelector.tick(); - this.level.getProfiler().pop(); @@ -5287,7 +5253,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 this.sendDebugPackets(); } -@@ -1134,6 +1163,12 @@ public abstract class Mob extends LivingEntity { +@@ -1163,6 +1192,12 @@ public abstract class Mob extends LivingEntity implements Targeting { } @@ -5300,7 +5266,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 @Nullable public static Item getEquipmentForSlot(EquipmentSlot equipmentSlot, int equipmentLevel) { switch (equipmentSlot) { -@@ -1228,7 +1263,7 @@ public abstract class Mob extends LivingEntity { +@@ -1257,7 +1292,7 @@ public abstract class Mob extends LivingEntity implements Targeting { RandomSource randomsource = world.getRandom(); this.getAttribute(Attributes.FOLLOW_RANGE).addPermanentModifier(new AttributeModifier("Random spawn bonus", randomsource.triangle(0.0D, 0.11485000000000001D), AttributeModifier.Operation.MULTIPLY_BASE)); @@ -5309,7 +5275,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 this.setLeftHanded(true); } else { this.setLeftHanded(false); -@@ -1276,6 +1311,7 @@ public abstract class Mob extends LivingEntity { +@@ -1305,6 +1340,7 @@ public abstract class Mob extends LivingEntity implements Targeting { if (!this.isAlive()) { return InteractionResult.PASS; } else if (this.getLeashHolder() == player) { @@ -5317,7 +5283,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 // CraftBukkit start - fire PlayerUnleashEntityEvent // Paper start - drop leash variable org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.getAbilities().instabuild); -@@ -1347,7 +1383,7 @@ public abstract class Mob extends LivingEntity { +@@ -1378,7 +1414,7 @@ public abstract class Mob extends LivingEntity implements Targeting { protected void onOffspringSpawnedFromEgg(Player player, Mob child) {} protected InteractionResult mobInteract(Player player, InteractionHand hand) { @@ -5326,7 +5292,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 } public boolean isWithinRestriction() { -@@ -1658,6 +1694,7 @@ public abstract class Mob extends LivingEntity { +@@ -1684,6 +1720,7 @@ public abstract class Mob extends LivingEntity implements Targeting { this.setLastHurtMob(target); } @@ -5334,13 +5300,13 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 return flag; } -@@ -1674,17 +1711,7 @@ public abstract class Mob extends LivingEntity { +@@ -1700,17 +1737,7 @@ public abstract class Mob extends LivingEntity implements Targeting { } public boolean isSunBurnTick() { - if (this.level.isDay() && !this.level.isClientSide) { - float f = this.getLightLevelDependentMagicValue(); -- BlockPos blockposition = new BlockPos(this.getX(), this.getEyeY(), this.getZ()); +- BlockPos blockposition = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ()); - boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow; - - if (f > 0.5F && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && !flag && this.level.canSeeSky(blockposition)) { @@ -5353,7 +5319,7 @@ index 94b45579dc371ee980565aed2f5dee78ebd44427..43cc8e8f07adecef21c70954918b8945 } @Override -@@ -1728,4 +1755,56 @@ public abstract class Mob extends LivingEntity { +@@ -1754,4 +1781,56 @@ public abstract class Mob extends LivingEntity implements Targeting { return itemmonsteregg == null ? null : new ItemStack(itemmonsteregg); } @@ -5466,24 +5432,14 @@ index e283eb57c25f7de222f9d09dca851169f5f6e488..210a0bee1227e4671909dd553ab22027 } diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java b/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java -index 3f7c6349a99c1cd4e0b2d7fc7a43bedcf5a9d980..3ce566840032e0b7728c6bcc4dd6e12cbd114268 100644 +index 8a720f9ae81d7ea856e28cb27a66adcf04bcb0eb..e0b70d9732a2b7d96999b7e4a497ffa1d8cf86a7 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java -@@ -2,7 +2,9 @@ package net.minecraft.world.entity.ai.attributes; - - import com.google.common.collect.ImmutableMap; - import com.mojang.logging.LogUtils; -+ - import java.util.Map; -+ - import net.minecraft.Util; - import net.minecraft.core.registries.BuiltInRegistries; - import net.minecraft.world.entity.EntityType; -@@ -79,7 +81,87 @@ import org.slf4j.Logger; +@@ -80,7 +80,88 @@ import org.slf4j.Logger; public class DefaultAttributes { private static final Logger LOGGER = LogUtils.getLogger(); -- private static final Map, AttributeSupplier> SUPPLIERS = ImmutableMap., AttributeSupplier>builder().put(EntityType.ALLAY, Allay.createAttributes().build()).put(EntityType.ARMOR_STAND, LivingEntity.createLivingAttributes().build()).put(EntityType.AXOLOTL, Axolotl.createAttributes().build()).put(EntityType.BAT, Bat.createAttributes().build()).put(EntityType.BEE, Bee.createAttributes().build()).put(EntityType.BLAZE, Blaze.createAttributes().build()).put(EntityType.CAT, Cat.createAttributes().build()).put(EntityType.CAMEL, Camel.createAttributes().build()).put(EntityType.CAVE_SPIDER, CaveSpider.createCaveSpider().build()).put(EntityType.CHICKEN, Chicken.createAttributes().build()).put(EntityType.COD, AbstractFish.createAttributes().build()).put(EntityType.COW, Cow.createAttributes().build()).put(EntityType.CREEPER, Creeper.createAttributes().build()).put(EntityType.DOLPHIN, Dolphin.createAttributes().build()).put(EntityType.DONKEY, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put(EntityType.DROWNED, Zombie.createAttributes().build()).put(EntityType.ELDER_GUARDIAN, ElderGuardian.createAttributes().build()).put(EntityType.ENDERMAN, EnderMan.createAttributes().build()).put(EntityType.ENDERMITE, Endermite.createAttributes().build()).put(EntityType.ENDER_DRAGON, EnderDragon.createAttributes().build()).put(EntityType.EVOKER, Evoker.createAttributes().build()).put(EntityType.FOX, Fox.createAttributes().build()).put(EntityType.FROG, Frog.createAttributes().build()).put(EntityType.GHAST, Ghast.createAttributes().build()).put(EntityType.GIANT, Giant.createAttributes().build()).put(EntityType.GLOW_SQUID, GlowSquid.createAttributes().build()).put(EntityType.GOAT, Goat.createAttributes().build()).put(EntityType.GUARDIAN, Guardian.createAttributes().build()).put(EntityType.HOGLIN, Hoglin.createAttributes().build()).put(EntityType.HORSE, AbstractHorse.createBaseHorseAttributes().build()).put(EntityType.HUSK, Zombie.createAttributes().build()).put(EntityType.ILLUSIONER, Illusioner.createAttributes().build()).put(EntityType.IRON_GOLEM, IronGolem.createAttributes().build()).put(EntityType.LLAMA, Llama.createAttributes().build()).put(EntityType.MAGMA_CUBE, MagmaCube.createAttributes().build()).put(EntityType.MOOSHROOM, Cow.createAttributes().build()).put(EntityType.MULE, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put(EntityType.OCELOT, Ocelot.createAttributes().build()).put(EntityType.PANDA, Panda.createAttributes().build()).put(EntityType.PARROT, Parrot.createAttributes().build()).put(EntityType.PHANTOM, Monster.createMonsterAttributes().build()).put(EntityType.PIG, Pig.createAttributes().build()).put(EntityType.PIGLIN, Piglin.createAttributes().build()).put(EntityType.PIGLIN_BRUTE, PiglinBrute.createAttributes().build()).put(EntityType.PILLAGER, Pillager.createAttributes().build()).put(EntityType.PLAYER, Player.createAttributes().build()).put(EntityType.POLAR_BEAR, PolarBear.createAttributes().build()).put(EntityType.PUFFERFISH, AbstractFish.createAttributes().build()).put(EntityType.RABBIT, Rabbit.createAttributes().build()).put(EntityType.RAVAGER, Ravager.createAttributes().build()).put(EntityType.SALMON, AbstractFish.createAttributes().build()).put(EntityType.SHEEP, Sheep.createAttributes().build()).put(EntityType.SHULKER, Shulker.createAttributes().build()).put(EntityType.SILVERFISH, Silverfish.createAttributes().build()).put(EntityType.SKELETON, AbstractSkeleton.createAttributes().build()).put(EntityType.SKELETON_HORSE, SkeletonHorse.createAttributes().build()).put(EntityType.SLIME, Monster.createMonsterAttributes().build()).put(EntityType.SNOW_GOLEM, SnowGolem.createAttributes().build()).put(EntityType.SPIDER, Spider.createAttributes().build()).put(EntityType.SQUID, Squid.createAttributes().build()).put(EntityType.STRAY, AbstractSkeleton.createAttributes().build()).put(EntityType.STRIDER, Strider.createAttributes().build()).put(EntityType.TADPOLE, Tadpole.createAttributes().build()).put(EntityType.TRADER_LLAMA, Llama.createAttributes().build()).put(EntityType.TROPICAL_FISH, AbstractFish.createAttributes().build()).put(EntityType.TURTLE, Turtle.createAttributes().build()).put(EntityType.VEX, Vex.createAttributes().build()).put(EntityType.VILLAGER, Villager.createAttributes().build()).put(EntityType.VINDICATOR, Vindicator.createAttributes().build()).put(EntityType.WARDEN, Warden.createAttributes().build()).put(EntityType.WANDERING_TRADER, Mob.createMobAttributes().build()).put(EntityType.WITCH, Witch.createAttributes().build()).put(EntityType.WITHER, WitherBoss.createAttributes().build()).put(EntityType.WITHER_SKELETON, AbstractSkeleton.createAttributes().build()).put(EntityType.WOLF, Wolf.createAttributes().build()).put(EntityType.ZOGLIN, Zoglin.createAttributes().build()).put(EntityType.ZOMBIE, Zombie.createAttributes().build()).put(EntityType.ZOMBIE_HORSE, ZombieHorse.createAttributes().build()).put(EntityType.ZOMBIE_VILLAGER, Zombie.createAttributes().build()).put(EntityType.ZOMBIFIED_PIGLIN, ZombifiedPiglin.createAttributes().build()).build(); +- private static final Map, AttributeSupplier> SUPPLIERS = ImmutableMap., AttributeSupplier>builder().put(EntityType.ALLAY, Allay.createAttributes().build()).put(EntityType.ARMOR_STAND, LivingEntity.createLivingAttributes().build()).put(EntityType.AXOLOTL, Axolotl.createAttributes().build()).put(EntityType.BAT, Bat.createAttributes().build()).put(EntityType.BEE, Bee.createAttributes().build()).put(EntityType.BLAZE, Blaze.createAttributes().build()).put(EntityType.CAT, Cat.createAttributes().build()).put(EntityType.CAMEL, Camel.createAttributes().build()).put(EntityType.CAVE_SPIDER, CaveSpider.createCaveSpider().build()).put(EntityType.CHICKEN, Chicken.createAttributes().build()).put(EntityType.COD, AbstractFish.createAttributes().build()).put(EntityType.COW, Cow.createAttributes().build()).put(EntityType.CREEPER, Creeper.createAttributes().build()).put(EntityType.DOLPHIN, Dolphin.createAttributes().build()).put(EntityType.DONKEY, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put(EntityType.DROWNED, Zombie.createAttributes().build()).put(EntityType.ELDER_GUARDIAN, ElderGuardian.createAttributes().build()).put(EntityType.ENDERMAN, EnderMan.createAttributes().build()).put(EntityType.ENDERMITE, Endermite.createAttributes().build()).put(EntityType.ENDER_DRAGON, EnderDragon.createAttributes().build()).put(EntityType.EVOKER, Evoker.createAttributes().build()).put(EntityType.FOX, Fox.createAttributes().build()).put(EntityType.FROG, Frog.createAttributes().build()).put(EntityType.GHAST, Ghast.createAttributes().build()).put(EntityType.GIANT, Giant.createAttributes().build()).put(EntityType.GLOW_SQUID, GlowSquid.createAttributes().build()).put(EntityType.GOAT, Goat.createAttributes().build()).put(EntityType.GUARDIAN, Guardian.createAttributes().build()).put(EntityType.HOGLIN, Hoglin.createAttributes().build()).put(EntityType.HORSE, AbstractHorse.createBaseHorseAttributes().build()).put(EntityType.HUSK, Zombie.createAttributes().build()).put(EntityType.ILLUSIONER, Illusioner.createAttributes().build()).put(EntityType.IRON_GOLEM, IronGolem.createAttributes().build()).put(EntityType.LLAMA, Llama.createAttributes().build()).put(EntityType.MAGMA_CUBE, MagmaCube.createAttributes().build()).put(EntityType.MOOSHROOM, Cow.createAttributes().build()).put(EntityType.MULE, AbstractChestedHorse.createBaseChestedHorseAttributes().build()).put(EntityType.OCELOT, Ocelot.createAttributes().build()).put(EntityType.PANDA, Panda.createAttributes().build()).put(EntityType.PARROT, Parrot.createAttributes().build()).put(EntityType.PHANTOM, Monster.createMonsterAttributes().build()).put(EntityType.PIG, Pig.createAttributes().build()).put(EntityType.PIGLIN, Piglin.createAttributes().build()).put(EntityType.PIGLIN_BRUTE, PiglinBrute.createAttributes().build()).put(EntityType.PILLAGER, Pillager.createAttributes().build()).put(EntityType.PLAYER, Player.createAttributes().build()).put(EntityType.POLAR_BEAR, PolarBear.createAttributes().build()).put(EntityType.PUFFERFISH, AbstractFish.createAttributes().build()).put(EntityType.RABBIT, Rabbit.createAttributes().build()).put(EntityType.RAVAGER, Ravager.createAttributes().build()).put(EntityType.SALMON, AbstractFish.createAttributes().build()).put(EntityType.SHEEP, Sheep.createAttributes().build()).put(EntityType.SHULKER, Shulker.createAttributes().build()).put(EntityType.SILVERFISH, Silverfish.createAttributes().build()).put(EntityType.SKELETON, AbstractSkeleton.createAttributes().build()).put(EntityType.SKELETON_HORSE, SkeletonHorse.createAttributes().build()).put(EntityType.SLIME, Monster.createMonsterAttributes().build()).put(EntityType.SNIFFER, Sniffer.createAttributes().build()).put(EntityType.SNOW_GOLEM, SnowGolem.createAttributes().build()).put(EntityType.SPIDER, Spider.createAttributes().build()).put(EntityType.SQUID, Squid.createAttributes().build()).put(EntityType.STRAY, AbstractSkeleton.createAttributes().build()).put(EntityType.STRIDER, Strider.createAttributes().build()).put(EntityType.TADPOLE, Tadpole.createAttributes().build()).put(EntityType.TRADER_LLAMA, Llama.createAttributes().build()).put(EntityType.TROPICAL_FISH, AbstractFish.createAttributes().build()).put(EntityType.TURTLE, Turtle.createAttributes().build()).put(EntityType.VEX, Vex.createAttributes().build()).put(EntityType.VILLAGER, Villager.createAttributes().build()).put(EntityType.VINDICATOR, Vindicator.createAttributes().build()).put(EntityType.WARDEN, Warden.createAttributes().build()).put(EntityType.WANDERING_TRADER, Mob.createMobAttributes().build()).put(EntityType.WITCH, Witch.createAttributes().build()).put(EntityType.WITHER, WitherBoss.createAttributes().build()).put(EntityType.WITHER_SKELETON, AbstractSkeleton.createAttributes().build()).put(EntityType.WOLF, Wolf.createAttributes().build()).put(EntityType.ZOGLIN, Zoglin.createAttributes().build()).put(EntityType.ZOMBIE, Zombie.createAttributes().build()).put(EntityType.ZOMBIE_HORSE, ZombieHorse.createAttributes().build()).put(EntityType.ZOMBIE_VILLAGER, Zombie.createAttributes().build()).put(EntityType.ZOMBIFIED_PIGLIN, ZombifiedPiglin.createAttributes().build()).build(); + private static final Map, AttributeSupplier> SUPPLIERS = ImmutableMap., AttributeSupplier>builder() + .put(EntityType.ALLAY, Allay.createAttributes().build()) + .put(EntityType.ARMOR_STAND, LivingEntity.createLivingAttributes().build()) @@ -5542,6 +5498,7 @@ index 3f7c6349a99c1cd4e0b2d7fc7a43bedcf5a9d980..3ce566840032e0b7728c6bcc4dd6e12c + .put(EntityType.SKELETON, AbstractSkeleton.createAttributes().build()) + .put(EntityType.SKELETON_HORSE, SkeletonHorse.createAttributes().build()) + .put(EntityType.SLIME, Monster.createMonsterAttributes().build()) ++ .put(EntityType.SNIFFER, Sniffer.createAttributes().build()) + .put(EntityType.SNOW_GOLEM, SnowGolem.createAttributes().build()) + .put(EntityType.SPIDER, Spider.createAttributes().build()) + .put(EntityType.SQUID, Squid.createAttributes().build()) @@ -5783,7 +5740,7 @@ index 0951c04533e7c39b969d041271684355770b53c2..02d4ba2ccdce99ca97614baa7c8e4921 world.broadcastEntityEvent(entityvillager2, (byte) 12); return Optional.of(entityvillager2); diff --git a/src/main/java/net/minecraft/world/entity/ai/control/MoveControl.java b/src/main/java/net/minecraft/world/entity/ai/control/MoveControl.java -index e304d7bc0b6b7c167cfc163a9df4d7a3126037e3..bde157ec8f591445cf4660922f70fa904dac213b 100644 +index 3d7586142aa5116964e4fffc6198f55fc6da324b..b4fb0af5bffffb9f0de3a2452c22b09fe92d7129 100644 --- a/src/main/java/net/minecraft/world/entity/ai/control/MoveControl.java +++ b/src/main/java/net/minecraft/world/entity/ai/control/MoveControl.java @@ -29,6 +29,20 @@ public class MoveControl implements Control { @@ -5978,7 +5935,7 @@ index 6558b0d4bea99948fdc2b51751f3cfdc239d4b67..d85dabebbbbe213e791b8a3be3c6df05 if (this.mob.isUsingItem()) { if (!bl && this.seeTime < -60) { diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java -index bd0cbf4390fc7d00b4bd5008cdf8f6f49df4f69b..27e96c4c1377c49f03df032683aac32d96ae1c6f 100644 +index d3e91faee8805e88d850740fb5de9e5c8288c48b..fe526ebf395ff9813b94284fc3f0142323d6a303 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java @@ -40,7 +40,7 @@ public class RemoveBlockGoal extends MoveToBlockGoal { @@ -6036,10 +5993,10 @@ index 79bb13c5614bab1f0749c5f8f57f762c6216c564..2cbc9adc8e417def48be03d08174a583 @Override diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java -index 97257b450e848f53fdb9b5b7affa57b03ea5f459..2f2d9bb31194618ef5bba39cd1cbe7c4919e82c5 100644 +index 7ffe5bef3778d5971ea4ceadf3102725fd0d08cd..6d127ed3da899851ca95b2be6792e2abca1aca12 100644 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java -@@ -171,12 +171,12 @@ public abstract class PathNavigation { +@@ -172,12 +172,12 @@ public abstract class PathNavigation { } } // Paper end @@ -6130,7 +6087,7 @@ index e752c83df50fb9b670ecea2abc95426c2a009b6f..baa4f9026d31de92210300ecb8ee8c1b if (baseEntity == null) { if (this.isCombat && (!targetEntity.canBeSeenAsEnemy() || targetEntity.level.getDifficulty() == Difficulty.PEACEFUL)) { diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -index 1572a81ce1718964d795f2a2a411402f88901c73..efcbb0be9984562fc2777af89a655725960bcfbe 100644 +index 59338d739b6130f667d151bc27646c4a346886a2..bfa1b84cba0dface99fcd3cf573be49f6f1f7d55 100644 --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java @@ -18,6 +18,7 @@ import net.minecraft.world.entity.EntityDimensions; @@ -6162,8 +6119,8 @@ index 1572a81ce1718964d795f2a2a411402f88901c73..efcbb0be9984562fc2777af89a655725 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.batRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.batRidableInWater; + } + + @Override @@ -6247,7 +6204,7 @@ index 1572a81ce1718964d795f2a2a411402f88901c73..efcbb0be9984562fc2777af89a655725 super.customServerAiStep(); BlockPos blockposition = this.blockPosition(); BlockPos blockposition1 = blockposition.above(); -@@ -246,7 +324,7 @@ public class Bat extends AmbientCreature { +@@ -241,7 +319,7 @@ public class Bat extends AmbientCreature { int i = world.getMaxLocalRawBrightness(pos); byte b0 = 4; @@ -6256,7 +6213,7 @@ index 1572a81ce1718964d795f2a2a411402f88901c73..efcbb0be9984562fc2777af89a655725 b0 = 7; } else if (random.nextBoolean()) { return false; -@@ -260,6 +338,7 @@ public class Bat extends AmbientCreature { +@@ -255,6 +333,7 @@ public class Bat extends AmbientCreature { private static boolean isSpookySeason = false; private static final int ONE_HOUR = 20 * 60 * 60; private static int lastSpookyCheck = -ONE_HOUR; @@ -6370,7 +6327,7 @@ index 3c4d142e982c34a23bdb5da1f51c8dcacc0532c1..2ac88f06ebb79e515cd9934ac1e3e2c8 other.resetLove(); world.addFreshEntityWithPassengers(entityageable, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index 337a88a7cd6445004d005ef8d56af1b1cdf800d9..87bd7991a81a2e30ecfccb60e614d7f13acd3744 100644 +index c33e5c51839c8e6ec04c1b302127d2bf0f48664c..d47dc0c3fe8c2b80d7b7eb828a12af6eb32145e4 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java @@ -43,6 +43,7 @@ import net.minecraft.world.entity.EntityType; @@ -6430,8 +6387,8 @@ index 337a88a7cd6445004d005ef8d56af1b1cdf800d9..87bd7991a81a2e30ecfccb60e614d7f1 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.beeRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.beeRidableInWater; + } + + @Override @@ -6506,14 +6463,14 @@ index 337a88a7cd6445004d005ef8d56af1b1cdf800d9..87bd7991a81a2e30ecfccb60e614d7f1 return flag && !this.isHiveNearFire(); } else { @@ -384,6 +455,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { - this.hurt(DamageSource.DROWN, 1.0F); + this.hurt(this.damageSources().drown(), 1.0F); } + if (flag && !this.level.purpurConfig.beeDiesAfterSting) setHasStung(false); else // Purpur if (flag) { ++this.timeSinceSting; - if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, (int) 1, (int) 1200)) == 0) { -@@ -737,6 +809,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { + if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) { +@@ -732,6 +804,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { if (optional.isPresent()) { Bee.this.savedFlowerPos = (BlockPos) optional.get(); Bee.this.navigation.moveTo((double) Bee.this.savedFlowerPos.getX() + 0.5D, (double) Bee.this.savedFlowerPos.getY() + 0.5D, (double) Bee.this.savedFlowerPos.getZ() + 0.5D, 1.2000000476837158D); @@ -6521,7 +6478,7 @@ index 337a88a7cd6445004d005ef8d56af1b1cdf800d9..87bd7991a81a2e30ecfccb60e614d7f1 return true; } else { Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60); -@@ -793,6 +866,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -788,6 +861,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.pollinating = false; Bee.this.navigation.stop(); Bee.this.remainingCooldownBeforeLocatingNewFlower = 200; @@ -6529,7 +6486,7 @@ index 337a88a7cd6445004d005ef8d56af1b1cdf800d9..87bd7991a81a2e30ecfccb60e614d7f1 } @Override -@@ -839,6 +913,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -834,6 +908,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.setWantedPos(); } @@ -6537,7 +6494,7 @@ index 337a88a7cd6445004d005ef8d56af1b1cdf800d9..87bd7991a81a2e30ecfccb60e614d7f1 ++this.successfulPollinatingTicks; if (Bee.this.random.nextFloat() < 0.05F && this.successfulPollinatingTicks > this.lastSoundPlayedTick + 60) { this.lastSoundPlayedTick = this.successfulPollinatingTicks; -@@ -883,16 +958,16 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -878,16 +953,16 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { } } @@ -6558,10 +6515,10 @@ index 337a88a7cd6445004d005ef8d56af1b1cdf800d9..87bd7991a81a2e30ecfccb60e614d7f1 } diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java -index 0114c1cf3b6b0500149a77ebc190cb7fa2832184..fd7fc2d6a28110050b2050355897d551737939a7 100644 +index 72b30a5cdeb8a43702d9ab5f198311929761fad1..fe08d83a49efe5e1648cafc50e9184dbd0db2115 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -96,6 +96,51 @@ public class Cat extends TamableAnimal implements VariantHolder { +@@ -97,6 +97,51 @@ public class Cat extends TamableAnimal implements VariantHolder { super(type, world); } @@ -6572,8 +6529,8 @@ index 0114c1cf3b6b0500149a77ebc190cb7fa2832184..fd7fc2d6a28110050b2050355897d551 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.catRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.catRidableInWater; + } + + @Override @@ -6613,15 +6570,15 @@ index 0114c1cf3b6b0500149a77ebc190cb7fa2832184..fd7fc2d6a28110050b2050355897d551 public ResourceLocation getResourceLocation() { return this.getVariant().texture(); } -@@ -104,6 +149,7 @@ public class Cat extends TamableAnimal implements VariantHolder { +@@ -105,6 +150,7 @@ public class Cat extends TamableAnimal implements VariantHolder { protected void registerGoals() { this.temptGoal = new Cat.CatTemptGoal(this, 0.6D, Cat.TEMPT_INGREDIENT, true); this.goalSelector.addGoal(1, new FloatGoal(this)); + this.goalSelector.addGoal(1, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - this.goalSelector.addGoal(1, new SitWhenOrderedToGoal(this)); - this.goalSelector.addGoal(2, new Cat.CatRelaxOnOwnerGoal(this)); - this.goalSelector.addGoal(3, this.temptGoal); -@@ -115,6 +161,7 @@ public class Cat extends TamableAnimal implements VariantHolder { + this.goalSelector.addGoal(1, new PanicGoal(this, 1.5D)); + this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this)); + this.goalSelector.addGoal(3, new Cat.CatRelaxOnOwnerGoal(this)); +@@ -117,6 +163,7 @@ public class Cat extends TamableAnimal implements VariantHolder { this.goalSelector.addGoal(10, new BreedGoal(this, 0.8D)); this.goalSelector.addGoal(11, new WaterAvoidingRandomStrollGoal(this, 0.8D, 1.0000001E-5F)); this.goalSelector.addGoal(12, new LookAtPlayerGoal(this, Player.class, 10.0F)); @@ -6629,7 +6586,7 @@ index 0114c1cf3b6b0500149a77ebc190cb7fa2832184..fd7fc2d6a28110050b2050355897d551 this.targetSelector.addGoal(1, new NonTameRandomTargetGoal<>(this, Rabbit.class, false, (Predicate) null)); this.targetSelector.addGoal(1, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR)); } -@@ -311,6 +358,14 @@ public class Cat extends TamableAnimal implements VariantHolder { +@@ -308,6 +355,14 @@ public class Cat extends TamableAnimal implements VariantHolder { return Mth.lerp(tickDelta, this.relaxStateOneAmountO, this.relaxStateOneAmount); } @@ -6644,7 +6601,7 @@ index 0114c1cf3b6b0500149a77ebc190cb7fa2832184..fd7fc2d6a28110050b2050355897d551 @Nullable @Override public Cat getBreedOffspring(ServerLevel world, AgeableMob entity) { -@@ -376,6 +431,7 @@ public class Cat extends TamableAnimal implements VariantHolder { +@@ -373,6 +428,7 @@ public class Cat extends TamableAnimal implements VariantHolder { @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { @@ -6652,7 +6609,7 @@ index 0114c1cf3b6b0500149a77ebc190cb7fa2832184..fd7fc2d6a28110050b2050355897d551 ItemStack itemstack = player.getItemInHand(hand); Item item = itemstack.getItem(); -@@ -422,7 +478,7 @@ public class Cat extends TamableAnimal implements VariantHolder { +@@ -419,7 +475,7 @@ public class Cat extends TamableAnimal implements VariantHolder { } } else if (this.isFood(itemstack)) { this.usePlayerItem(player, hand, itemstack); @@ -6662,7 +6619,7 @@ index 0114c1cf3b6b0500149a77ebc190cb7fa2832184..fd7fc2d6a28110050b2050355897d551 this.setOrderedToSit(true); this.level.broadcastEntityEvent(this, (byte) 7); diff --git a/src/main/java/net/minecraft/world/entity/animal/Chicken.java b/src/main/java/net/minecraft/world/entity/animal/Chicken.java -index 72edd4d0698dd18cf2d91c39d68d3b3302d86d62..3355a5b2e906c247ef7af4e1a2c74d49fb050616 100644 +index b4dc621cb1be7cb4bf1cb31f921d4e9f6cffef88..c5e81244331d76535028f8296d10939933010d09 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Chicken.java +++ b/src/main/java/net/minecraft/world/entity/animal/Chicken.java @@ -54,16 +54,65 @@ public class Chicken extends Animal { @@ -6676,8 +6633,8 @@ index 72edd4d0698dd18cf2d91c39d68d3b3302d86d62..3355a5b2e906c247ef7af4e1a2c74d49 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.chickenRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.chickenRidableInWater; + } + + @Override @@ -6742,10 +6699,10 @@ index 72edd4d0698dd18cf2d91c39d68d3b3302d86d62..3355a5b2e906c247ef7af4e1a2c74d49 @Override diff --git a/src/main/java/net/minecraft/world/entity/animal/Cod.java b/src/main/java/net/minecraft/world/entity/animal/Cod.java -index 824e5e4fe7619ae46061c3c978c9a044db8c84ab..de70208403ef6c6c9c82ca4c1fd3b641a40bb45c 100644 +index 824e5e4fe7619ae46061c3c978c9a044db8c84ab..2a45b487e5305e7c40cc8de4ddbb142af4b041de 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cod.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cod.java -@@ -13,6 +13,38 @@ public class Cod extends AbstractSchoolingFish { +@@ -13,6 +13,33 @@ public class Cod extends AbstractSchoolingFish { super(type, world); } @@ -6756,11 +6713,6 @@ index 824e5e4fe7619ae46061c3c978c9a044db8c84ab..de70208403ef6c6c9c82ca4c1fd3b641 + } + + @Override -+ public boolean rideableUnderWater() { -+ return true; -+ } -+ -+ @Override + public boolean isControllable() { + return level.purpurConfig.codControllable; + } @@ -6785,7 +6737,7 @@ index 824e5e4fe7619ae46061c3c978c9a044db8c84ab..de70208403ef6c6c9c82ca4c1fd3b641 public ItemStack getBucketItemStack() { return new ItemStack(Items.COD_BUCKET); diff --git a/src/main/java/net/minecraft/world/entity/animal/Cow.java b/src/main/java/net/minecraft/world/entity/animal/Cow.java -index abae850f5babfd75c7547e88fb7637e9775991d3..35b97e48b19fad137cab03e3599e4c81101eb87a 100644 +index abae850f5babfd75c7547e88fb7637e9775991d3..54d9213d9de26a14a5ca770440d098bf0438373e 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cow.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cow.java @@ -2,6 +2,7 @@ package net.minecraft.world.entity.animal; @@ -6821,8 +6773,8 @@ index abae850f5babfd75c7547e88fb7637e9775991d3..35b97e48b19fad137cab03e3599e4c81 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.cowRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.cowRidableInWater; + } + + @Override @@ -6979,10 +6931,10 @@ index abae850f5babfd75c7547e88fb7637e9775991d3..35b97e48b19fad137cab03e3599e4c81 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java -index 3f100d847fbce6db5b625e99c4f3694576237372..284c1342695aeb652f39c236d14538647465846e 100644 +index e93abb02744b5cd8db88e01b6ccf145498903b11..a077edbe97ce89e11a26fe3ebeb0bdd996593f78 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java +++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java -@@ -78,19 +78,109 @@ public class Dolphin extends WaterAnimal { +@@ -78,19 +78,104 @@ public class Dolphin extends WaterAnimal { public static final Predicate ALLOWED_ITEMS = (entityitem) -> { return !entityitem.hasPickUpDelay() && entityitem.isAlive() && entityitem.isInWater(); }; @@ -7035,11 +6987,6 @@ index 3f100d847fbce6db5b625e99c4f3694576237372..284c1342695aeb652f39c236d1453864 + } + + @Override -+ public boolean rideableUnderWater() { -+ return true; -+ } -+ -+ @Override + public boolean isControllable() { + return level.purpurConfig.dolphinControllable; + } @@ -7093,7 +7040,7 @@ index 3f100d847fbce6db5b625e99c4f3694576237372..284c1342695aeb652f39c236d1453864 return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt); } -@@ -160,17 +250,21 @@ public class Dolphin extends WaterAnimal { +@@ -160,17 +245,21 @@ public class Dolphin extends WaterAnimal { protected void registerGoals() { this.goalSelector.addGoal(0, new BreathAirGoal(this)); this.goalSelector.addGoal(0, new TryFindWaterGoal(this)); @@ -7116,7 +7063,7 @@ index 3f100d847fbce6db5b625e99c4f3694576237372..284c1342695aeb652f39c236d1453864 } public static AttributeSupplier.Builder createAttributes() { -@@ -221,7 +315,7 @@ public class Dolphin extends WaterAnimal { +@@ -221,7 +310,7 @@ public class Dolphin extends WaterAnimal { @Override protected boolean canRide(Entity entity) { @@ -7125,7 +7072,7 @@ index 3f100d847fbce6db5b625e99c4f3694576237372..284c1342695aeb652f39c236d1453864 } @Override -@@ -256,6 +350,11 @@ public class Dolphin extends WaterAnimal { +@@ -256,6 +345,11 @@ public class Dolphin extends WaterAnimal { @Override public void tick() { super.tick(); @@ -7137,7 +7084,7 @@ index 3f100d847fbce6db5b625e99c4f3694576237372..284c1342695aeb652f39c236d1453864 if (this.isNoAi()) { this.setAirSupply(this.getMaxAirSupply()); } else { -@@ -401,6 +500,7 @@ public class Dolphin extends WaterAnimal { +@@ -401,6 +495,7 @@ public class Dolphin extends WaterAnimal { @Override public boolean canUse() { @@ -7146,10 +7093,10 @@ index 3f100d847fbce6db5b625e99c4f3694576237372..284c1342695aeb652f39c236d1453864 } diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java -index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd63225b2c46c 100644 +index 89894bc6a55bc7e456a9d49ac48f6a8192b890ae..f0eb5e0c01923f884b1c7c48e8d67ed5cd429854 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java -@@ -34,6 +34,7 @@ import net.minecraft.util.RandomSource; +@@ -35,6 +35,7 @@ import net.minecraft.util.RandomSource; import net.minecraft.util.StringRepresentable; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; @@ -7157,7 +7104,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.AgeableMob; import net.minecraft.world.entity.Entity; -@@ -87,6 +88,7 @@ import net.minecraft.world.level.block.Blocks; +@@ -88,6 +89,7 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.CaveVines; import net.minecraft.world.level.block.SweetBerryBushBlock; import net.minecraft.world.level.block.state.BlockState; @@ -7165,7 +7112,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 import net.minecraft.world.level.pathfinder.BlockPathTypes; import net.minecraft.world.phys.Vec3; -@@ -140,6 +142,64 @@ public class Fox extends Animal implements VariantHolder { +@@ -141,6 +143,64 @@ public class Fox extends Animal implements VariantHolder { this.setCanPickUpLoot(true); } @@ -7176,8 +7123,8 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.foxRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.foxRidableInWater; + } + + @Override @@ -7230,7 +7177,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 @Override protected void defineSynchedData() { super.defineSynchedData(); -@@ -159,6 +219,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -160,6 +220,7 @@ public class Fox extends Animal implements VariantHolder { return entityliving instanceof AbstractSchoolingFish; }); this.goalSelector.addGoal(0, new Fox.FoxFloatGoal()); @@ -7238,7 +7185,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 this.goalSelector.addGoal(0, new ClimbOnTopOfPowderSnowGoal(this, this.level)); this.goalSelector.addGoal(1, new Fox.FaceplantGoal()); this.goalSelector.addGoal(2, new Fox.FoxPanicGoal(2.2D)); -@@ -185,6 +246,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -186,6 +247,7 @@ public class Fox extends Animal implements VariantHolder { this.goalSelector.addGoal(11, new Fox.FoxSearchForItemsGoal()); this.goalSelector.addGoal(12, new Fox.FoxLookAtPlayerGoal(this, Player.class, 24.0F)); this.goalSelector.addGoal(13, new Fox.PerchAndSearchGoal()); @@ -7246,7 +7193,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 this.targetSelector.addGoal(3, new Fox.DefendTrustedTargetGoal(LivingEntity.class, false, false, (entityliving) -> { return Fox.TRUSTED_TARGET_SELECTOR.test(entityliving) && !this.trusts(entityliving.getUUID()); })); -@@ -341,6 +403,11 @@ public class Fox extends Animal implements VariantHolder { +@@ -342,6 +404,11 @@ public class Fox extends Animal implements VariantHolder { } private void setTargetGoals() { @@ -7258,7 +7205,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 if (this.getVariant() == Fox.Type.RED) { this.targetSelector.addGoal(4, this.landTargetGoal); this.targetSelector.addGoal(4, this.turtleEggTargetGoal); -@@ -374,6 +441,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -375,6 +442,7 @@ public class Fox extends Animal implements VariantHolder { public void setVariant(Fox.Type variant) { this.entityData.set(Fox.DATA_TYPE_ID, variant.getId()); @@ -7266,7 +7213,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 } List getTrustedUUIDs() { -@@ -710,6 +778,29 @@ public class Fox extends Animal implements VariantHolder { +@@ -711,6 +779,29 @@ public class Fox extends Animal implements VariantHolder { return this.getTrustedUUIDs().contains(uuid); } @@ -7296,7 +7243,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 @Override // Paper start - Cancellable death event protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(DamageSource source) { -@@ -757,16 +848,16 @@ public class Fox extends Animal implements VariantHolder { +@@ -758,16 +849,16 @@ public class Fox extends Animal implements VariantHolder { return new Vec3(0.0D, (double) (0.55F * this.getEyeHeight()), (double) (this.getBbWidth() * 0.4F)); } @@ -7316,7 +7263,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 } } -@@ -777,16 +868,16 @@ public class Fox extends Animal implements VariantHolder { +@@ -778,16 +869,16 @@ public class Fox extends Animal implements VariantHolder { } } @@ -7336,7 +7283,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 } } -@@ -904,8 +995,10 @@ public class Fox extends Animal implements VariantHolder { +@@ -905,8 +996,10 @@ public class Fox extends Animal implements VariantHolder { CriteriaTriggers.BRED_ANIMALS.trigger(entityplayer2, this.animal, this.partner, entityfox); } @@ -7349,7 +7296,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 this.animal.resetLove(); this.partner.resetLove(); worldserver.addFreshEntityWithPassengers(entityfox, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason -@@ -1293,7 +1386,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -1294,7 +1387,7 @@ public class Fox extends Animal implements VariantHolder { } protected void onReachedTarget() { @@ -7359,7 +7306,7 @@ index bc2b98c9f34ad2b289f5da91d704bd836edec8c1..31512fb943690ac82c995bcbb3ffd632 if (iblockdata.is(Blocks.SWEET_BERRY_BUSH)) { diff --git a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java -index e73acfa2f5a4066fa1beee1758082a2fe97a43b3..0292690b9c99f66210a03817e512c65ca65bc749 100644 +index 4fbbd74cda7e4f2c623db46c2c94d9697ca5df05..b5f445750a5ccbe7658396bdcc9648dc41f39ced 100644 --- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java @@ -63,14 +63,59 @@ public class IronGolem extends AbstractGolem implements NeutralMob { @@ -7370,7 +7317,7 @@ index e73acfa2f5a4066fa1beee1758082a2fe97a43b3..0292690b9c99f66210a03817e512c65c public IronGolem(EntityType type, Level world) { super(type, world); - this.maxUpStep = 1.0F; + this.setMaxUpStep(1.0F); } + // Purpur start @@ -7380,8 +7327,8 @@ index e73acfa2f5a4066fa1beee1758082a2fe97a43b3..0292690b9c99f66210a03817e512c65c + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.ironGolemRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.ironGolemRidableInWater; + } + + @Override @@ -7472,7 +7419,7 @@ index e73acfa2f5a4066fa1beee1758082a2fe97a43b3..0292690b9c99f66210a03817e512c65c } } diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java -index 68a5ee85e64802e4509ba0d184fc0ceb3cbe2d11..046e851a5c49e58fa4e84d398ffbe11baa9c4072 100644 +index 68a5ee85e64802e4509ba0d184fc0ceb3cbe2d11..b5d0d3aaa0442b4753aef8fdf8f85f017e1dd811 100644 --- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java +++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java @@ -63,6 +63,43 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder(this, Turtle.class, 10, false, false, Turtle.BABY_ON_LAND_SELECTOR)); } diff --git a/src/main/java/net/minecraft/world/entity/animal/Panda.java b/src/main/java/net/minecraft/world/entity/animal/Panda.java -index 9c1e02c3a990cd0f8bba1c84c170b438278c02a7..841838562ffed67127b03e27f61d692d9933fbe3 100644 +index 9c1e02c3a990cd0f8bba1c84c170b438278c02a7..d1e45052fc96b6f81a331c6c73cb68ff96238359 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Panda.java +++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java @@ -108,6 +108,53 @@ public class Panda extends Animal { @@ -7651,8 +7598,8 @@ index 9c1e02c3a990cd0f8bba1c84c170b438278c02a7..841838562ffed67127b03e27f61d692d + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.pandaRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.pandaRidableInWater; + } + + @Override @@ -7771,7 +7718,7 @@ index 9c1e02c3a990cd0f8bba1c84c170b438278c02a7..841838562ffed67127b03e27f61d692d } } diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -index 2d9aa961df034eab21ecfdb6e6d0ce7cf013505d..f11bca0b0c556aa4d6c32c503c4b5f45c645a3fa 100644 +index e6e40770acf71b9079e8f6ac07025319dd8e2e4e..8ca75f748ac7dcf872b5677648ba384992242a07 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java @@ -129,12 +129,88 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) { -@@ -311,13 +391,13 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder { @@ -8190,8 +8132,8 @@ index 7a1fcae6de2dd8247fcb1f1612122edf8f56965a..f158cb5a8a04b9d9fa00c35774d2104a + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.rabbitRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.rabbitRidableInWater; + } + + @Override @@ -8356,10 +8298,10 @@ index 7a1fcae6de2dd8247fcb1f1612122edf8f56965a..f158cb5a8a04b9d9fa00c35774d2104a } diff --git a/src/main/java/net/minecraft/world/entity/animal/Salmon.java b/src/main/java/net/minecraft/world/entity/animal/Salmon.java -index 0af79daa357f53a8871e293b57e16c099e5d3f64..bd1e964c7899a54a2c39afe0691a7573cfe35fc1 100644 +index 0af79daa357f53a8871e293b57e16c099e5d3f64..e0da8d1974f88e1426034620f78a29f9bdb5adf4 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Salmon.java +++ b/src/main/java/net/minecraft/world/entity/animal/Salmon.java -@@ -13,6 +13,38 @@ public class Salmon extends AbstractSchoolingFish { +@@ -13,6 +13,33 @@ public class Salmon extends AbstractSchoolingFish { super(type, world); } @@ -8370,11 +8312,6 @@ index 0af79daa357f53a8871e293b57e16c099e5d3f64..bd1e964c7899a54a2c39afe0691a7573 + } + + @Override -+ public boolean rideableUnderWater() { -+ return true; -+ } -+ -+ @Override + public boolean isControllable() { + return level.purpurConfig.salmonControllable; + } @@ -8399,7 +8336,7 @@ index 0af79daa357f53a8871e293b57e16c099e5d3f64..bd1e964c7899a54a2c39afe0691a7573 public int getMaxSchoolSize() { return 5; diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java -index efac4395fdb79a78fbb18a0f828b1a3c90b102fe..017507e7201ffc4a9486f5fb9edc9dac18e989d7 100644 +index fb3777e158065a6ce306a2a6e66bec053da2aeb4..9399361c8d26a140fa6042988a30a1d3d552e418 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java +++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java @@ -116,10 +116,48 @@ public class Sheep extends Animal implements Shearable { @@ -8413,8 +8350,8 @@ index efac4395fdb79a78fbb18a0f828b1a3c90b102fe..017507e7201ffc4a9486f5fb9edc9dac + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.sheepRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.sheepRidableInWater; + } + + @Override @@ -8479,7 +8416,7 @@ index efac4395fdb79a78fbb18a0f828b1a3c90b102fe..017507e7201ffc4a9486f5fb9edc9dac if (entityitem != null) { diff --git a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java -index 35e53663e4a6c4d56ec4577d08e7b040cc0c720f..00d86c57fabbb464a156dfaceadccd978f0d149c 100644 +index 5437571ce76c62e9cae841e99127867fffb39f43..34fa428268a863e8e36b6340a482ec67f1199efb 100644 --- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java @@ -49,17 +49,56 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM @@ -8499,8 +8436,8 @@ index 35e53663e4a6c4d56ec4577d08e7b040cc0c720f..00d86c57fabbb464a156dfaceadccd97 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.snowGolemRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.snowGolemRidableInWater; + } + + @Override @@ -8563,8 +8500,8 @@ index 35e53663e4a6c4d56ec4577d08e7b040cc0c720f..00d86c57fabbb464a156dfaceadccd97 } @Override -@@ -109,10 +150,11 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM - this.hurt(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING +@@ -103,10 +144,11 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM + this.hurt(this.damageSources().melting, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING } - if (!this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { @@ -8575,8 +8512,8 @@ index 35e53663e4a6c4d56ec4577d08e7b040cc0c720f..00d86c57fabbb464a156dfaceadccd97 + if (getRider() != null && this.isControllable() && !level.purpurConfig.snowGolemLeaveTrailWhenRidden) return; // Purpur - don't leave snow trail when being ridden BlockState iblockdata = Blocks.SNOW.defaultBlockState(); - for (int l = 0; l < 4; ++l) { -@@ -160,10 +202,10 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM + for (int i = 0; i < 4; ++i) { +@@ -154,10 +196,10 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM if (itemstack.is(Items.SHEARS) && this.readyForShearing()) { // CraftBukkit start if (!CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand)) { @@ -8589,7 +8526,7 @@ index 35e53663e4a6c4d56ec4577d08e7b040cc0c720f..00d86c57fabbb464a156dfaceadccd97 this.gameEvent(GameEvent.SHEAR, player); if (!this.level.isClientSide) { itemstack.hurtAndBreak(1, player, (entityhuman1) -> { -@@ -172,17 +214,27 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -166,17 +208,27 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM } return InteractionResult.sidedSuccess(this.level.isClientSide); @@ -8620,10 +8557,10 @@ index 35e53663e4a6c4d56ec4577d08e7b040cc0c720f..00d86c57fabbb464a156dfaceadccd97 this.forceDrops = false; // CraftBukkit } diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java -index a51424d29ac353cf1bec4d1484db0acb63bebba5..8afdb5d4fecbb45bad2ed801fc0e526d15ef07c5 100644 +index 72eea6e512060fc622ca79ca87437f19a64604cc..31c89a6b8f766e1fd03608723c2d03f7f64e2e9b 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java +++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java -@@ -46,13 +46,71 @@ public class Squid extends WaterAnimal { +@@ -46,13 +46,66 @@ public class Squid extends WaterAnimal { public Squid(EntityType type, Level world) { super(type, world); @@ -8639,11 +8576,6 @@ index a51424d29ac353cf1bec4d1484db0acb63bebba5..8afdb5d4fecbb45bad2ed801fc0e526d + } + + @Override -+ public boolean rideableUnderWater() { -+ return true; -+ } -+ -+ @Override + public boolean isControllable() { + return level.purpurConfig.squidControllable; + } @@ -8696,7 +8628,7 @@ index a51424d29ac353cf1bec4d1484db0acb63bebba5..8afdb5d4fecbb45bad2ed801fc0e526d this.goalSelector.addGoal(1, new Squid.SquidFleeGoal()); } -@@ -121,6 +179,7 @@ public class Squid extends WaterAnimal { +@@ -121,6 +174,7 @@ public class Squid extends WaterAnimal { } if (this.isInWaterOrBubble()) { @@ -8704,7 +8636,7 @@ index a51424d29ac353cf1bec4d1484db0acb63bebba5..8afdb5d4fecbb45bad2ed801fc0e526d if (this.tentacleMovement < 3.1415927F) { float f = this.tentacleMovement / 3.1415927F; -@@ -244,11 +303,43 @@ public class Squid extends WaterAnimal { +@@ -244,11 +298,43 @@ public class Squid extends WaterAnimal { @Override public void tick() { @@ -8750,10 +8682,10 @@ index a51424d29ac353cf1bec4d1484db0acb63bebba5..8afdb5d4fecbb45bad2ed801fc0e526d float f1 = Mth.cos(f) * 0.2F; float f2 = -0.1F + this.squid.getRandom().nextFloat() * 0.2F; diff --git a/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java b/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java -index b05b560b7570e97bc234b75f26233909fcf575b3..a3becf90c3309d52d2701c016d4c16970a318f9c 100644 +index b05b560b7570e97bc234b75f26233909fcf575b3..e4b4bf5ef228c0460fdab966d4c9b5c428f78b9a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java +++ b/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java -@@ -42,6 +42,38 @@ public class TropicalFish extends AbstractSchoolingFish implements VariantHolder +@@ -42,6 +42,33 @@ public class TropicalFish extends AbstractSchoolingFish implements VariantHolder super(type, world); } @@ -8764,11 +8696,6 @@ index b05b560b7570e97bc234b75f26233909fcf575b3..a3becf90c3309d52d2701c016d4c1697 + } + + @Override -+ public boolean rideableUnderWater() { -+ return true; -+ } -+ -+ @Override + public boolean isControllable() { + return level.purpurConfig.tropicalFishControllable; + } @@ -8793,11 +8720,11 @@ index b05b560b7570e97bc234b75f26233909fcf575b3..a3becf90c3309d52d2701c016d4c1697 return "entity.minecraft.tropical_fish.predefined." + variant; } diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -index 7f9ec1888eb9c02705426d60cf4e3aa7c6d43115..f4d1e6240c30c4a83dccd7f09691b03131b572f0 100644 +index 81dab77f525ae667614f940c4ff5ec308a9579a2..52eff7a4d3a34a566bc3bc03e6643c494c757156 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -@@ -82,6 +82,43 @@ public class Turtle extends Animal { - this.maxUpStep = 1.0F; +@@ -83,6 +83,43 @@ public class Turtle extends Animal { + this.setMaxUpStep(1.0F); } + // Purpur start @@ -8807,8 +8734,8 @@ index 7f9ec1888eb9c02705426d60cf4e3aa7c6d43115..f4d1e6240c30c4a83dccd7f09691b031 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.turtleRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.turtleRidableInWater; + } + + @Override @@ -8840,7 +8767,7 @@ index 7f9ec1888eb9c02705426d60cf4e3aa7c6d43115..f4d1e6240c30c4a83dccd7f09691b031 public void setHomePos(BlockPos pos) { this.entityData.set(Turtle.HOME_POS, pos.immutable()); // Paper - called with mutablepos... } -@@ -184,6 +221,7 @@ public class Turtle extends Animal { +@@ -185,6 +222,7 @@ public class Turtle extends Animal { @Override protected void registerGoals() { @@ -8848,7 +8775,7 @@ index 7f9ec1888eb9c02705426d60cf4e3aa7c6d43115..f4d1e6240c30c4a83dccd7f09691b031 this.goalSelector.addGoal(0, new Turtle.TurtlePanicGoal(this, 1.2D)); this.goalSelector.addGoal(1, new Turtle.TurtleBreedGoal(this, 1.0D)); this.goalSelector.addGoal(1, new Turtle.TurtleLayEggGoal(this, 1.0D)); -@@ -341,13 +379,15 @@ public class Turtle extends Animal { +@@ -342,13 +380,15 @@ public class Turtle extends Animal { org.bukkit.craftbukkit.event.CraftEventFactory.entityDamage = null; // CraftBukkit } @@ -8865,7 +8792,7 @@ index 7f9ec1888eb9c02705426d60cf4e3aa7c6d43115..f4d1e6240c30c4a83dccd7f09691b031 } private void updateSpeed() { -@@ -366,8 +406,18 @@ public class Turtle extends Animal { +@@ -367,8 +407,18 @@ public class Turtle extends Animal { } @@ -8885,20 +8812,20 @@ index 7f9ec1888eb9c02705426d60cf4e3aa7c6d43115..f4d1e6240c30c4a83dccd7f09691b031 this.updateSpeed(); if (this.operation == MoveControl.Operation.MOVE_TO && !this.turtle.getNavigation().isDone()) { double d0 = this.wantedX - this.turtle.getX(); -@@ -380,7 +430,7 @@ public class Turtle extends Animal { +@@ -384,7 +434,7 @@ public class Turtle extends Animal { - this.turtle.setYRot(this.rotlerp(this.turtle.getYRot(), f, 90.0F)); - this.turtle.yBodyRot = this.turtle.getYRot(); -- float f1 = (float) (this.speedModifier * this.turtle.getAttributeValue(Attributes.MOVEMENT_SPEED)); -+ float f1 = (float) (this.getSpeedModifier() * this.turtle.getAttributeValue(Attributes.MOVEMENT_SPEED)); + this.turtle.setYRot(this.rotlerp(this.turtle.getYRot(), f, 90.0F)); + this.turtle.yBodyRot = this.turtle.getYRot(); +- float f1 = (float) (this.speedModifier * this.turtle.getAttributeValue(Attributes.MOVEMENT_SPEED)); ++ float f1 = (float) (this.getSpeedModifier() * this.turtle.getAttributeValue(Attributes.MOVEMENT_SPEED)); - this.turtle.setSpeed(Mth.lerp(0.125F, this.turtle.getSpeed(), f1)); - this.turtle.setDeltaMovement(this.turtle.getDeltaMovement().add(0.0D, (double) this.turtle.getSpeed() * d1 * 0.1D, 0.0D)); + this.turtle.setSpeed(Mth.lerp(0.125F, this.turtle.getSpeed(), f1)); + this.turtle.setDeltaMovement(this.turtle.getDeltaMovement().add(0.0D, (double) this.turtle.getSpeed() * d1 * 0.1D, 0.0D)); diff --git a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -index 18389f46902bb9879ac6d734723e9a720724dc48..b2b8663a9cff08bacdab91c7bb014ba654241ada 100644 +index 35cfa366baf6747105faa93f1220bb9cc31a5bd5..ff3a6755d04f2280a36bd363ab1722e074e37194 100644 --- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java +++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -@@ -83,6 +83,6 @@ public abstract class WaterAnimal extends PathfinderMob { +@@ -82,6 +82,6 @@ public abstract class WaterAnimal extends PathfinderMob { i = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(i); j = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(j); // Paper end @@ -8907,7 +8834,7 @@ index 18389f46902bb9879ac6d734723e9a720724dc48..b2b8663a9cff08bacdab91c7bb014ba6 } } diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -index a6a50eb4f4ac85751071571876ac804d44ee1ee6..006d5fc7c96a47bf57ab26f374143400138b8b17 100644 +index 612601b2536dc522356d4dd2c2ea1192f6435f72..e0ca657b0aea52ab6a91c256c1bfad1e5028f6e0 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java +++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java @@ -10,6 +10,7 @@ import net.minecraft.network.syncher.EntityDataAccessor; @@ -9004,8 +8931,8 @@ index a6a50eb4f4ac85751071571876ac804d44ee1ee6..006d5fc7c96a47bf57ab26f374143400 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.wolfRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.wolfRidableInWater; + } + + public void onMount(Player rider) { @@ -9163,7 +9090,7 @@ index a6a50eb4f4ac85751071571876ac804d44ee1ee6..006d5fc7c96a47bf57ab26f374143400 return super.mobInteract(player, hand); } diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java -index c66a214dfbde7fd8e7a68efaa82ac260178f297f..e8f42ad6cc32cb21584d8988fcf3d1e4b6552f0c 100644 +index a41d8101c960163803179d3717889aee6182d0bb..e95540122ae6a486ce12a5f50fb4d2d073239554 100644 --- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java @@ -101,10 +101,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier { @@ -9202,8 +9129,8 @@ index c66a214dfbde7fd8e7a68efaa82ac260178f297f..e8f42ad6cc32cb21584d8988fcf3d1e4 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.allayRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.allayRidableInWater; + } + + @Override @@ -9220,7 +9147,7 @@ index c66a214dfbde7fd8e7a68efaa82ac260178f297f..e8f42ad6cc32cb21584d8988fcf3d1e4 @Override protected Brain.Provider brainProvider() { return Brain.provider(Allay.MEMORY_TYPES, Allay.SENSOR_TYPES); -@@ -231,13 +266,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier { +@@ -226,13 +261,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier { private int behaviorTick = 0; // Pufferfish @Override protected void customServerAiStep() { @@ -9238,7 +9165,7 @@ index c66a214dfbde7fd8e7a68efaa82ac260178f297f..e8f42ad6cc32cb21584d8988fcf3d1e4 super.customServerAiStep(); } -@@ -379,9 +414,31 @@ public class Allay extends PathfinderMob implements InventoryCarrier { +@@ -374,9 +409,31 @@ public class Allay extends PathfinderMob implements InventoryCarrier { @Override public boolean wantsToPickUp(ItemStack stack) { @@ -9274,11 +9201,11 @@ index c66a214dfbde7fd8e7a68efaa82ac260178f297f..e8f42ad6cc32cb21584d8988fcf3d1e4 private boolean allayConsidersItemEqual(ItemStack stack, ItemStack stack2) { diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -index 02219f5ca614fefffa1ceb3c7036dfe1c90c8676..867091706521dbb16e66bdf5c9f4136759ab2677 100644 +index 38d21943fb2940f53c2d0ac2c3b94a6f0e46e700..18ce5389040b516a7061d2d8e104f400183fdeec 100644 --- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -@@ -98,6 +98,48 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder getModelRotationValues() { return this.modelRotationValues; -@@ -288,13 +330,13 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder optional = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS); -@@ -520,14 +562,22 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder { - public final AnimationState walkAnimationState = new AnimationState(); - public final AnimationState swimAnimationState = new AnimationState(); +@@ -82,16 +82,69 @@ public class Frog extends Animal implements VariantHolder { + public final AnimationState croakAnimationState = new AnimationState(); + public final AnimationState tongueAnimationState = new AnimationState(); public final AnimationState swimIdleAnimationState = new AnimationState(); + private org.purpurmc.purpur.controller.MoveControllerWASD purpurLandController; // Purpur + private org.purpurmc.purpur.controller.WaterMoveControllerWASD purpurWaterController; // Purpur @@ -9476,7 +9398,7 @@ index d1cc0ffd153c0902f0110adbbcd98f1d2089fa27..d34600bca83e2742c2f26c300e4528f0 + } + }; + // Purpur end - this.maxUpStep = 1.0F; + this.setMaxUpStep(1.0F); } + // Purpur start @@ -9486,8 +9408,8 @@ index d1cc0ffd153c0902f0110adbbcd98f1d2089fa27..d34600bca83e2742c2f26c300e4528f0 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.frogRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.frogRidableInWater; + } + + @Override @@ -9514,7 +9436,7 @@ index d1cc0ffd153c0902f0110adbbcd98f1d2089fa27..d34600bca83e2742c2f26c300e4528f0 @Override protected Brain.Provider brainProvider() { return Brain.provider(MEMORY_TYPES, SENSOR_TYPES); -@@ -180,13 +233,13 @@ public class Frog extends Animal implements VariantHolder { +@@ -170,13 +223,13 @@ public class Frog extends Animal implements VariantHolder { private int behaviorTick = 0; // Pufferfish @Override protected void customServerAiStep() { @@ -9532,7 +9454,7 @@ index d1cc0ffd153c0902f0110adbbcd98f1d2089fa27..d34600bca83e2742c2f26c300e4528f0 super.customServerAiStep(); } -@@ -394,7 +447,7 @@ public class Frog extends Animal implements VariantHolder { +@@ -376,7 +429,7 @@ public class Frog extends Animal implements VariantHolder { return world.getBlockState(pos.below()).is(BlockTags.FROGS_SPAWNABLE_ON) && isBrightEnoughToSpawn(world, pos); } @@ -9542,7 +9464,7 @@ index d1cc0ffd153c0902f0110adbbcd98f1d2089fa27..d34600bca83e2742c2f26c300e4528f0 super(entity); } diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java -index e591b0a09f5a8475b3ec9cd28bd5d5b69809ed73..93fe8efe4ddd4de440fff1ca7a38960203d0ff74 100644 +index e591b0a09f5a8475b3ec9cd28bd5d5b69809ed73..aadc6743deb195ac3368548a75be641ffd3da404 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java @@ -45,13 +45,50 @@ public class Tadpole extends AbstractFish { @@ -9579,8 +9501,8 @@ index e591b0a09f5a8475b3ec9cd28bd5d5b69809ed73..93fe8efe4ddd4de440fff1ca7a389602 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.tadpoleRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.tadpoleRidableInWater; + } + + @Override @@ -9616,10 +9538,10 @@ index e591b0a09f5a8475b3ec9cd28bd5d5b69809ed73..93fe8efe4ddd4de440fff1ca7a389602 } diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -index 0f365b9dbb160d90ddf5fcd40895305df48ce916..8f3817df5996bb63ab15ee1ab1ef38e90715018a 100644 +index 4fdc3bd591b6df4c28901e4571aa23baf034d885..f5c0fc9f30bdf7935200b875ada0ff1011fdb034 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -@@ -89,6 +89,43 @@ public class Goat extends Animal { +@@ -89,6 +89,38 @@ public class Goat extends Animal { return InstrumentItem.create(Items.GOAT_HORN, (Holder) holderset.getRandomElement(randomsource).get()); } @@ -9630,8 +9552,8 @@ index 0f365b9dbb160d90ddf5fcd40895305df48ce916..8f3817df5996bb63ab15ee1ab1ef38e9 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.goatRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.goatRidableInWater; + } + + @Override @@ -9640,11 +9562,6 @@ index 0f365b9dbb160d90ddf5fcd40895305df48ce916..8f3817df5996bb63ab15ee1ab1ef38e9 + } + + @Override -+ public void initAttributes() { -+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level.purpurConfig.goatMaxHealth); -+ } -+ -+ @Override + public int getPurpurBreedTime() { + return this.level.purpurConfig.goatBreedingTicks; + } @@ -9663,7 +9580,7 @@ index 0f365b9dbb160d90ddf5fcd40895305df48ce916..8f3817df5996bb63ab15ee1ab1ef38e9 @Override protected Brain.Provider brainProvider() { return Brain.provider(Goat.MEMORY_TYPES, Goat.SENSOR_TYPES); -@@ -191,13 +228,13 @@ public class Goat extends Animal { +@@ -191,13 +223,14 @@ public class Goat extends Animal { private int behaviorTick = 0; // Pufferfish @Override protected void customServerAiStep() { @@ -9674,7 +9591,8 @@ index 0f365b9dbb160d90ddf5fcd40895305df48ce916..8f3817df5996bb63ab15ee1ab1ef38e9 this.getBrain().tick((ServerLevel) this.level, this); - this.level.getProfiler().pop(); - this.level.getProfiler().push("goatActivityUpdate"); -+ //this.level.getProfiler().pop(); // Purpur ++ //this.level.getProfiler().pop ++ // (); // Purpur + //this.level.getProfiler().push("goatActivityUpdate"); // Purpur GoatAi.updateActivity(this); - this.level.getProfiler().pop(); @@ -9682,7 +9600,7 @@ index 0f365b9dbb160d90ddf5fcd40895305df48ce916..8f3817df5996bb63ab15ee1ab1ef38e9 super.customServerAiStep(); } -@@ -389,6 +426,7 @@ public class Goat extends Animal { +@@ -389,6 +422,7 @@ public class Goat extends Animal { // Paper start - Goat ram API public void ram(net.minecraft.world.entity.LivingEntity entity) { @@ -9691,16 +9609,16 @@ index 0f365b9dbb160d90ddf5fcd40895305df48ce916..8f3817df5996bb63ab15ee1ab1ef38e9 brain.setMemory(MemoryModuleType.RAM_TARGET, entity.position()); brain.eraseMemory(MemoryModuleType.RAM_COOLDOWN_TICKS); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -index 72d660cd2ade39335024897cffb8b8a151a7cb71..8f27e6b495b82361d331c514c78088d358e4f5b4 100644 +index 47cd69f91bbc2e2be9ec970674adc522e21593c8..c044ed3a96f10584fd5aec836624bca1b414182d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -@@ -118,12 +118,48 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -144,12 +144,60 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, protected AbstractHorse(EntityType type, Level world) { super(type, world); + this.moveControl = new net.minecraft.world.entity.ai.control.MoveControl(this); // Purpur - use vanilla controller + this.lookControl = new net.minecraft.world.entity.ai.control.LookControl(this); // Purpur - use vanilla controller - this.maxUpStep = 1.0F; + this.setMaxUpStep(1.0F); this.createInventory(); } @@ -9712,12 +9630,12 @@ index 72d660cd2ade39335024897cffb8b8a151a7cb71..8f27e6b495b82361d331c514c78088d3 + + @Override + public void initAttributes() { -+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.generateRandomMaxHealth(this.random)); -+ this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.generateRandomSpeed(this.random)); -+ this.getAttribute(Attributes.JUMP_STRENGTH).setBaseValue(this.generateRandomJumpStrength(this.random)); ++ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.generateMaxHealth(random)); ++ this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.generateSpeed(random)); ++ this.getAttribute(Attributes.JUMP_STRENGTH).setBaseValue(this.generateJumpStrength(random)); + } + -+ protected double generateRandomMaxHealth(double min, double max) { ++ protected double generateMaxHealth(double min, double max) { + if (min == max) return min; + int diff = Mth.floor(max - min); + double base = max - diff; @@ -9726,15 +9644,27 @@ index 72d660cd2ade39335024897cffb8b8a151a7cb71..8f27e6b495b82361d331c514c78088d3 + return base + random.nextInt(first + 1) + random.nextInt(rest + 1); + } + -+ protected double generateRandomJumpStrength(double min, double max) { ++ protected double generateJumpStrength(double min, double max) { + if (min == max) return min; + return min + (max - min) * this.random.nextDouble(); + } + -+ protected double generateRandomSpeed(double min, double max) { ++ protected double generateSpeed(double min, double max) { + if (min == max) return min; + return min + (max - min) * this.random.nextDouble(); + } ++ ++ protected float generateMaxHealth(RandomSource random) { ++ return 15.0F + (float) random.nextInt(8) + (float) random.nextInt(9); ++ } ++ ++ protected double generateJumpStrength(RandomSource random) { ++ return 0.4000000059604645D + random.nextDouble() * 0.2D + random.nextDouble() * 0.2D + random.nextDouble() * 0.2D; ++ } ++ ++ protected double generateSpeed(RandomSource random) { ++ return (0.44999998807907104D + random.nextDouble() * 0.3D + random.nextDouble() * 0.3D + random.nextDouble() * 0.3D) * 0.25D; ++ } + // Purpur end + @Override @@ -9743,7 +9673,7 @@ index 72d660cd2ade39335024897cffb8b8a151a7cb71..8f27e6b495b82361d331c514c78088d3 this.goalSelector.addGoal(1, new PanicGoal(this, 1.2D)); this.goalSelector.addGoal(1, new RunAroundLikeCrazyGoal(this, 1.2D)); this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D, AbstractHorse.class)); -@@ -134,6 +170,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -160,6 +208,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, if (this.canPerformRearing()) { this.goalSelector.addGoal(9, new RandomStandGoal(this)); } @@ -9751,7 +9681,7 @@ index 72d660cd2ade39335024897cffb8b8a151a7cb71..8f27e6b495b82361d331c514c78088d3 this.addBehaviourGoals(); } -@@ -310,7 +347,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -336,7 +385,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @Override protected int calculateFallDamage(float fallDistance, float damageMultiplier) { @@ -9760,7 +9690,7 @@ index 72d660cd2ade39335024897cffb8b8a151a7cb71..8f27e6b495b82361d331c514c78088d3 } protected int getInventorySize() { -@@ -1200,7 +1237,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -1252,7 +1301,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, entityData = new AgeableMob.AgeableMobGroupData(0.2F); } @@ -9770,7 +9700,7 @@ index 72d660cd2ade39335024897cffb8b8a151a7cb71..8f27e6b495b82361d331c514c78088d3 } diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Donkey.java b/src/main/java/net/minecraft/world/entity/animal/horse/Donkey.java -index e0dfee0e0ce091d5ae0ec740e939c2c50915c104..db56ad11133fb1c3ec33f8d05421184b86174762 100644 +index e0dfee0e0ce091d5ae0ec740e939c2c50915c104..7ad29aacc73ca1cb98b76ad36b92a3edb2256629 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/Donkey.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Donkey.java @@ -15,6 +15,43 @@ public class Donkey extends AbstractChestedHorse { @@ -9779,23 +9709,23 @@ index e0dfee0e0ce091d5ae0ec740e939c2c50915c104..db56ad11133fb1c3ec33f8d05421184b + // Purpur start + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.donkeyRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.donkeyRidableInWater; + } + + @Override -+ public float generateRandomMaxHealth(net.minecraft.util.RandomSource random) { -+ return (float) generateRandomMaxHealth(this.level.purpurConfig.donkeyMaxHealthMin, this.level.purpurConfig.donkeyMaxHealthMax); ++ public float generateMaxHealth(net.minecraft.util.RandomSource random) { ++ return (float) generateMaxHealth(this.level.purpurConfig.donkeyMaxHealthMin, this.level.purpurConfig.donkeyMaxHealthMax); + } + + @Override -+ public double generateRandomJumpStrength(net.minecraft.util.RandomSource random) { -+ return generateRandomJumpStrength(this.level.purpurConfig.donkeyJumpStrengthMin, this.level.purpurConfig.donkeyJumpStrengthMax); ++ public double generateJumpStrength(net.minecraft.util.RandomSource random) { ++ return generateJumpStrength(this.level.purpurConfig.donkeyJumpStrengthMin, this.level.purpurConfig.donkeyJumpStrengthMax); + } + + @Override -+ public double generateRandomSpeed(net.minecraft.util.RandomSource random) { -+ return generateRandomSpeed(this.level.purpurConfig.donkeyMovementSpeedMin, this.level.purpurConfig.donkeyMovementSpeedMax); ++ public double generateSpeed(net.minecraft.util.RandomSource random) { ++ return generateSpeed(this.level.purpurConfig.donkeyMovementSpeedMin, this.level.purpurConfig.donkeyMovementSpeedMax); + } + + @Override @@ -9818,7 +9748,7 @@ index e0dfee0e0ce091d5ae0ec740e939c2c50915c104..db56ad11133fb1c3ec33f8d05421184b protected SoundEvent getAmbientSound() { return SoundEvents.DONKEY_AMBIENT; diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Horse.java b/src/main/java/net/minecraft/world/entity/animal/horse/Horse.java -index 97a92b5576da2f8572a71cab42c40d1368ecb300..ee00e85a1cf1221f22b60f6a43dfd212e1a8a570 100644 +index 79a2b3c8df70a9a73ad44560a4a6129f91db8e16..fb433878731b824b4d595b7f28626f25bdfabbeb 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/Horse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Horse.java @@ -40,6 +40,43 @@ public class Horse extends AbstractHorse implements VariantHolder { @@ -9827,23 +9757,23 @@ index 97a92b5576da2f8572a71cab42c40d1368ecb300..ee00e85a1cf1221f22b60f6a43dfd212 + // Purpur start + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.horseRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.horseRidableInWater; + } + + @Override -+ public float generateRandomMaxHealth(RandomSource random) { -+ return (float) generateRandomMaxHealth(this.level.purpurConfig.horseMaxHealthMin, this.level.purpurConfig.horseMaxHealthMax); ++ public float generateMaxHealth(RandomSource random) { ++ return (float) generateMaxHealth(this.level.purpurConfig.horseMaxHealthMin, this.level.purpurConfig.horseMaxHealthMax); + } + + @Override -+ public double generateRandomJumpStrength(RandomSource random) { -+ return generateRandomJumpStrength(this.level.purpurConfig.horseJumpStrengthMin, this.level.purpurConfig.horseJumpStrengthMax); ++ public double generateJumpStrength(RandomSource random) { ++ return generateJumpStrength(this.level.purpurConfig.horseJumpStrengthMin, this.level.purpurConfig.horseJumpStrengthMax); + } + + @Override -+ public double generateRandomSpeed(RandomSource random) { -+ return generateRandomSpeed(this.level.purpurConfig.horseMovementSpeedMin, this.level.purpurConfig.horseMovementSpeedMax); ++ public double generateSpeed(RandomSource random) { ++ return generateSpeed(this.level.purpurConfig.horseMovementSpeedMin, this.level.purpurConfig.horseMovementSpeedMax); + } + + @Override @@ -9864,9 +9794,9 @@ index 97a92b5576da2f8572a71cab42c40d1368ecb300..ee00e85a1cf1221f22b60f6a43dfd212 + @Override protected void randomizeAttributes(RandomSource random) { - this.getAttribute(Attributes.MAX_HEALTH).setBaseValue((double)this.generateRandomMaxHealth(random)); + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue((double)generateMaxHealth(random::nextInt)); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java -index 7ae0e4b3aa8e861500ddc7b38aa671258b532fcd..beea0545a38b0f044409c2cdb5bbefaf8d783d45 100644 +index 7ae0e4b3aa8e861500ddc7b38aa671258b532fcd..309fd5bccadcc584354d328bd31a6f4591c2d0a0 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java @@ -73,11 +73,86 @@ public class Llama extends AbstractChestedHorse implements VariantHolder public + super.jumpFromGround(); + double d0 = this.moveControl.getSpeedModifier(); + +@@ -435,11 +462,11 @@ public class Sniffer extends Animal { + + @Override + protected void customServerAiStep() { +- this.level.getProfiler().push("snifferBrain"); ++ //this.level.getProfiler().push("snifferBrain"); // Purpur + this.getBrain().tick((ServerLevel) this.level, this); +- this.level.getProfiler().popPush("snifferActivityUpdate"); ++ //this.level.getProfiler().popPush("snifferActivityUpdate"); // Purpur + SnifferAi.updateActivity(this); +- this.level.getProfiler().pop(); ++ //this.level.getProfiler().pop(); // Purpur + super.customServerAiStep(); + } + diff --git a/src/main/java/net/minecraft/world/entity/boss/EnderDragonPart.java b/src/main/java/net/minecraft/world/entity/boss/EnderDragonPart.java index de84a00ce2d2b7c654b08164489624e124568346..998c72513df1dcd2b1316b320b3d5e7ca8e69fd4 100644 --- a/src/main/java/net/minecraft/world/entity/boss/EnderDragonPart.java @@ -10260,10 +10243,10 @@ index de84a00ce2d2b7c654b08164489624e124568346..998c72513df1dcd2b1316b320b3d5e7c protected void defineSynchedData() { } diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java -index 500500468c12d1d44ea6b83a9176b470a954f59a..d542652d376a790c817e09921a432ee826bfa3e5 100644 +index 64f17b4a22454b59968787089253eaba0a04c1f2..e3fe5f18c77e36479eaeb7edfd2a3eb919c342d6 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java -@@ -29,6 +29,12 @@ public class EndCrystal extends Entity { +@@ -30,6 +30,12 @@ public class EndCrystal extends Entity { private static final EntityDataAccessor DATA_SHOW_BOTTOM = SynchedEntityData.defineId(EndCrystal.class, EntityDataSerializers.BOOLEAN); public int time; public boolean generatedByDragonFight = false; // Paper - Fix invulnerable end crystals @@ -10276,11 +10259,11 @@ index 500500468c12d1d44ea6b83a9176b470a954f59a..d542652d376a790c817e09921a432ee8 public EndCrystal(EntityType type, Level world) { super(type, world); -@@ -76,10 +82,70 @@ public class EndCrystal extends Entity { +@@ -77,9 +83,69 @@ public class EndCrystal extends Entity { } } // Paper end -+ if (this.level.purpurConfig.endCrystalCramming > 0 && this.level.getEntitiesOfClass(EndCrystal.class, getBoundingBox()).size() > this.level.purpurConfig.endCrystalCramming) this.hurt(DamageSource.CRAMMING, 6.0F); // Purpur ++ if (this.level.purpurConfig.endCrystalCramming > 0 && this.level.getEntitiesOfClass(EndCrystal.class, getBoundingBox()).size() > this.level.purpurConfig.endCrystalCramming) this.hurt(this.damageSources().cramming(), 6.0F); // Purpur } + // Purpur start @@ -10302,7 +10285,7 @@ index 500500468c12d1d44ea6b83a9176b470a954f59a..d542652d376a790c817e09921a432ee8 + if (targetPhantom.hasLineOfSight(this)) { + if (phantomDamageCooldown <= 0) { + phantomDamageCooldown = 20; -+ targetPhantom.hurt(DamageSource.indirectMagic(this, this), level.purpurConfig.phantomAttackedByCrystalDamage); ++ targetPhantom.hurt(targetPhantom.damageSources().indirectMagic(this, this), level.purpurConfig.phantomAttackedByCrystalDamage); + } + } else { + forgetPhantom(); // no longer in sight @@ -10317,8 +10300,8 @@ index 500500468c12d1d44ea6b83a9176b470a954f59a..d542652d376a790c817e09921a432ee8 + phantomDamageCooldown = 0; + phantomBeamTicks = 60; + targetPhantom = phantom; - } - ++ } ++ + private void forgetPhantom() { + targetPhantom = null; + setBeamTarget(null); @@ -10341,19 +10324,18 @@ index 500500468c12d1d44ea6b83a9176b470a954f59a..d542652d376a790c817e09921a432ee8 + + public Level.ExplosionInteraction getExplosionEffect() { + return showsBottom() ? level.purpurConfig.basedEndCrystalExplosionEffect : level.purpurConfig.baselessEndCrystalExplosionEffect; -+ } + } + // Purpur end -+ + @Override protected void addAdditionalSaveData(CompoundTag nbt) { - if (this.getBeamTarget() != null) { -@@ -123,17 +189,18 @@ public class EndCrystal extends Entity { +@@ -124,17 +190,19 @@ public class EndCrystal extends Entity { // CraftBukkit end this.remove(Entity.RemovalReason.KILLED); - if (!source.isExplosion()) { -+ if (shouldExplode()) { // Purpur - DamageSource damagesource1 = source.getEntity() != null ? DamageSource.explosion(this, source.getEntity()) : null; -- + if (!source.is(DamageTypeTags.IS_EXPLOSION)) { ++ if (shouldExplode()) {// Purpur + DamageSource damagesource1 = source.getEntity() != null ? this.damageSources().explosion(this, source.getEntity()) : null; + // CraftBukkit start - ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, false); + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), getExplosionPower(), hasExplosionFire()); // Purpur @@ -10370,16 +10352,10 @@ index 500500468c12d1d44ea6b83a9176b470a954f59a..d542652d376a790c817e09921a432ee8 this.onDestroyedBy(source); diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e298ae97fd7 100644 +index 3f66986948d0b43a75454389b7ec8517e2d50899..b6ac41633e91f6ee2755d1f05aac4c8046a4aa8a 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -98,14 +98,16 @@ public class EnderDragon extends Mob implements Enemy { - private final Node[] nodes = new Node[24]; - private final int[] nodeAdjacency = new int[24]; - private final BinaryHeap openSet = new BinaryHeap(); -- private Explosion explosionSource = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource() -+ private Explosion explosionSource; // CraftBukkit - reusable source for CraftTNTPrimed.getSource() // Purpur - moved instantiation to ctor - // Paper start - add var for save custom podium +@@ -104,9 +104,11 @@ public class EnderDragon extends Mob implements Enemy { @Nullable private BlockPos podium; // Paper end @@ -10391,10 +10367,11 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 this.subEntities = new EnderDragonPart[]{this.head, this.neck, this.body, this.tail1, this.tail2, this.tail3, this.wing1, this.wing2}; this.setHealth(this.getMaxHealth()); this.noPhysics = true; -@@ -117,7 +119,59 @@ public class EnderDragon extends Mob implements Enemy { +@@ -118,8 +120,59 @@ public class EnderDragon extends Mob implements Enemy { } this.phaseManager = new EnderDragonPhaseManager(this); +- this.explosionSource = new Explosion(world, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // CraftBukkit + + // Purpur start + this.moveControl = new org.purpurmc.purpur.controller.FlyingMoveControllerWASD(this) { @@ -10424,8 +10401,8 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.enderDragonRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.enderDragonRidableInWater; + } + + @Override @@ -10451,7 +10428,7 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 public static AttributeSupplier.Builder createAttributes() { return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 200.0D); -@@ -180,6 +234,37 @@ public class EnderDragon extends Mob implements Enemy { +@@ -182,6 +235,37 @@ public class EnderDragon extends Mob implements Enemy { @Override public void aiStep() { @@ -10489,7 +10466,7 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 this.processFlappingMovement(); if (this.level.isClientSide) { this.setHealth(this.getHealth()); -@@ -193,6 +278,8 @@ public class EnderDragon extends Mob implements Enemy { +@@ -195,6 +279,8 @@ public class EnderDragon extends Mob implements Enemy { float f; if (this.isDeadOrDying()) { @@ -10498,7 +10475,7 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 float f1 = (this.random.nextFloat() - 0.5F) * 8.0F; f = (this.random.nextFloat() - 0.5F) * 4.0F; -@@ -205,9 +292,9 @@ public class EnderDragon extends Mob implements Enemy { +@@ -207,9 +293,9 @@ public class EnderDragon extends Mob implements Enemy { f = 0.2F / ((float) vec3d.horizontalDistance() * 10.0F + 1.0F); f *= (float) Math.pow(2.0D, vec3d.y); @@ -10510,7 +10487,7 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 this.flapTime += f * 0.5F; } else { this.flapTime += f; -@@ -252,7 +339,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -254,7 +340,7 @@ public class EnderDragon extends Mob implements Enemy { } this.phaseManager.getCurrentPhase().doClientTick(); @@ -10519,7 +10496,7 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 DragonPhaseInstance idragoncontroller = this.phaseManager.getCurrentPhase(); idragoncontroller.doServerTick(); -@@ -321,7 +408,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -323,7 +409,7 @@ public class EnderDragon extends Mob implements Enemy { this.tickPart(this.body, (double) (f11 * 0.5F), 0.0D, (double) (-f12 * 0.5F)); this.tickPart(this.wing1, (double) (f12 * 4.5F), 2.0D, (double) (f11 * 4.5F)); this.tickPart(this.wing2, (double) (f12 * -4.5F), 2.0D, (double) (f11 * -4.5F)); @@ -10528,7 +10505,7 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 this.knockBack(this.level.getEntities((Entity) this, this.wing1.getBoundingBox().inflate(4.0D, 2.0D, 4.0D).move(0.0D, -2.0D, 0.0D), EntitySelector.NO_CREATIVE_OR_SPECTATOR)); this.knockBack(this.level.getEntities((Entity) this, this.wing2.getBoundingBox().inflate(4.0D, 2.0D, 4.0D).move(0.0D, -2.0D, 0.0D), EntitySelector.NO_CREATIVE_OR_SPECTATOR)); this.hurt(this.level.getEntities((Entity) this, this.head.getBoundingBox().inflate(1.0D), EntitySelector.NO_CREATIVE_OR_SPECTATOR)); -@@ -365,7 +452,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -367,7 +453,7 @@ public class EnderDragon extends Mob implements Enemy { } if (!this.level.isClientSide) { @@ -10537,7 +10514,7 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 if (this.dragonFight != null) { this.dragonFight.updateDragon(this); } -@@ -497,7 +584,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -499,7 +585,7 @@ public class EnderDragon extends Mob implements Enemy { BlockState iblockdata = this.level.getBlockState(blockposition); if (!iblockdata.isAir() && !iblockdata.is(BlockTags.DRAGON_TRANSPARENT)) { @@ -10546,7 +10523,7 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 // CraftBukkit start - Add blocks to list rather than destroying them // flag1 = this.level.removeBlock(blockposition, false) || flag1; flag1 = true; -@@ -632,7 +719,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -634,7 +720,7 @@ public class EnderDragon extends Mob implements Enemy { boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT); short short0 = 500; @@ -10555,7 +10532,7 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 short0 = 12000; } -@@ -1069,6 +1156,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1069,6 +1155,7 @@ public class EnderDragon extends Mob implements Enemy { @Override protected boolean canRide(Entity entity) { @@ -10564,10 +10541,10 @@ index c7caaebfb4b9f28cbe700d88fdcf232a500e8ca7..d5aeaac49fcbc32d5276168d910f9e29 } diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd80a39e54b 100644 +index e81e8f050bd9df34b6a64c741428503b434f03a3..4781bdd3b6c7d6b686f2fe6af530e82861385342 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -@@ -83,16 +83,31 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -84,16 +84,31 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob return entityliving.getMobType() != MobType.UNDEAD && entityliving.attackable(); }; private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0D).selector(WitherBoss.LIVING_ENTITY_SELECTOR); @@ -10600,7 +10577,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 this.setHealth(this.getMaxHealth()); this.xpReward = 50; } -@@ -107,13 +122,148 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -108,13 +123,148 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob return navigationflying; } @@ -10611,8 +10588,8 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.witherRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.witherRidableInWater; + } + + @Override @@ -10749,7 +10726,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0])); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 0, false, false, WitherBoss.LIVING_ENTITY_SELECTOR)); } -@@ -131,6 +281,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -132,6 +282,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); nbt.putInt("Invul", this.getInvulnerableTicks()); @@ -10757,7 +10734,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 } @Override -@@ -140,6 +291,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -141,6 +292,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob if (this.hasCustomName()) { this.bossEvent.setName(this.getDisplayName()); } @@ -10765,7 +10742,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 } -@@ -255,6 +407,16 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -256,6 +408,16 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @Override protected void customServerAiStep() { @@ -10782,7 +10759,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 int i; if (this.getInvulnerableTicks() > 0) { -@@ -271,7 +433,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -272,7 +434,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob } // CraftBukkit end @@ -10791,7 +10768,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 // CraftBukkit start - Use relative location for far away sounds // this.world.globalLevelEvent(1023, new BlockPosition(this), 0); int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; -@@ -295,7 +457,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -296,7 +458,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob this.setInvulnerableTicks(i); if (this.tickCount % 10 == 0) { @@ -10800,7 +10777,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 } } else { -@@ -355,7 +517,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -356,7 +518,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob if (this.destroyBlocksTick > 0) { --this.destroyBlocksTick; @@ -10809,7 +10786,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 i = Mth.floor(this.getY()); j = Mth.floor(this.getX()); int i1 = Mth.floor(this.getZ()); -@@ -388,8 +550,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -389,8 +551,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob } } @@ -10822,7 +10799,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 } this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth()); -@@ -580,11 +744,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -576,11 +740,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob } public int getAlternativeTarget(int headIndex) { @@ -10836,7 +10813,7 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 } @Override -@@ -599,6 +763,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -595,6 +759,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @Override protected boolean canRide(Entity entity) { @@ -10845,10 +10822,10 @@ index 08a432f76a72ad628b8febe393196286182fbe07..30bce9055aa4a3f108362e57a9937dd8 } diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -index 713a47b38d6054e0b0c50dcdc23ecd3b0077f040..6f433787fe69a3647d5836e22b6634cc33b9838d 100644 +index 3677dd991ae73428984e62e4d6fb757317987887..0545a39af0f21210ff1f5e53f6d712ae24ce43e4 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -@@ -98,10 +98,12 @@ public class ArmorStand extends LivingEntity { +@@ -99,10 +99,12 @@ public class ArmorStand extends LivingEntity { private boolean noTickPoseDirty = false; private boolean noTickEquipmentDirty = false; // Paper end @@ -10861,30 +10838,24 @@ index 713a47b38d6054e0b0c50dcdc23ecd3b0077f040..6f433787fe69a3647d5836e22b6634cc this.handItems = NonNullList.withSize(2, ItemStack.EMPTY); this.armorItems = NonNullList.withSize(4, ItemStack.EMPTY); this.headPose = ArmorStand.DEFAULT_HEAD_POSE; -@@ -111,6 +113,7 @@ public class ArmorStand extends LivingEntity { +@@ -112,6 +114,7 @@ public class ArmorStand extends LivingEntity { this.leftLegPose = ArmorStand.DEFAULT_LEFT_LEG_POSE; this.rightLegPose = ArmorStand.DEFAULT_RIGHT_LEG_POSE; - this.maxUpStep = 0.0F; + this.setMaxUpStep(0.0F); + this.setShowArms(world != null && world.purpurConfig.armorstandPlaceWithArms); // Purpur } public ArmorStand(Level world, double x, double y, double z) { -@@ -595,7 +598,13 @@ public class ArmorStand extends LivingEntity { - } +@@ -609,7 +612,7 @@ public class ArmorStand extends LivingEntity { + private org.bukkit.event.entity.EntityDeathEvent brokenByPlayer(DamageSource damageSource) { // Paper + ItemStack itemstack = new ItemStack(Items.ARMOR_STAND); - private org.bukkit.event.entity.EntityDeathEvent brokenByPlayer(DamageSource damageSource) { // Paper -- drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(new ItemStack(Items.ARMOR_STAND))); // CraftBukkit - add to drops -+ // Purpur start -+ final ItemStack armorStand = new ItemStack(Items.ARMOR_STAND); -+ if (this.level.purpurConfig.persistentDroppableEntityDisplayNames && this.hasCustomName()) { -+ armorStand.setHoverName(this.getCustomName()); -+ } -+ drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(armorStand)); // CraftBukkit - add to drops -+ // Purpur end - return this.brokenByAnything(damageSource); // Paper - } +- if (this.hasCustomName()) { ++ if (this.level.purpurConfig.persistentDroppableEntityDisplayNames && this.hasCustomName()) { // Purpur + itemstack.setHoverName(this.getCustomName()); + } -@@ -667,6 +676,7 @@ public class ArmorStand extends LivingEntity { +@@ -685,6 +688,7 @@ public class ArmorStand extends LivingEntity { @Override public void tick() { @@ -10892,7 +10863,7 @@ index 713a47b38d6054e0b0c50dcdc23ecd3b0077f040..6f433787fe69a3647d5836e22b6634cc // Paper start if (!this.canTick) { if (this.noTickPoseDirty) { -@@ -988,4 +998,18 @@ public class ArmorStand extends LivingEntity { +@@ -1006,4 +1010,18 @@ public class ArmorStand extends LivingEntity { } // Paper end // Paper end @@ -10912,10 +10883,10 @@ index 713a47b38d6054e0b0c50dcdc23ecd3b0077f040..6f433787fe69a3647d5836e22b6634cc + // Purpur end } diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -index 428523feaa4f30260e32ba03937e88200246c693..d2cd7629a69d04937180df04829d12425815588c 100644 +index 30aec9dff249ae629b22318e52902361a9fa4099..25158e04c39146218b21ce5d5c963a24be68b2e2 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -@@ -268,7 +268,13 @@ public class ItemFrame extends HangingEntity { +@@ -272,7 +272,13 @@ public class ItemFrame extends HangingEntity { } if (alwaysDrop) { @@ -10930,7 +10901,7 @@ index 428523feaa4f30260e32ba03937e88200246c693..d2cd7629a69d04937180df04829d1242 } if (!itemstack.isEmpty()) { -@@ -283,6 +289,13 @@ public class ItemFrame extends HangingEntity { +@@ -287,6 +293,13 @@ public class ItemFrame extends HangingEntity { } } @@ -10945,19 +10916,19 @@ index 428523feaa4f30260e32ba03937e88200246c693..d2cd7629a69d04937180df04829d1242 // Paper start - fix MC-252817 (green map markers do not disappear) this.getFramedMapIdFromItem(itemstack).ifPresent((i) -> { diff --git a/src/main/java/net/minecraft/world/entity/decoration/Painting.java b/src/main/java/net/minecraft/world/entity/decoration/Painting.java -index 0c5caad2a5bfc14450cf8d37f988ee176e8d1450..320dce948023e23df32601820146fa64e1b2fa71 100644 +index ad0df80d1adb1d945f40e1b5f7732bb36b2ca2ff..90cab3586d3e3e290475fe8d59a69d89d3c24add 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/Painting.java +++ b/src/main/java/net/minecraft/world/entity/decoration/Painting.java -@@ -124,7 +124,7 @@ public class Painting extends HangingEntity implements VariantHolder { - return entry; -- }).orElseGet(Painting::getDefaultVariant); -+ }).orElseGet(() -> (Holder.Reference) getDefaultVariant()); // Purpur - decompile error +@@ -121,7 +121,7 @@ public class Painting extends HangingEntity implements VariantHolder holder = loadVariant(nbt).orElseGet(Painting::getDefaultVariant); ++ Holder holder = loadVariant(nbt).orElseGet(() -> (Holder.Reference) getDefaultVariant()); // Purpur - decompile error TODO: still needed? this.setVariant(holder); this.direction = Direction.from2DDataValue(nbt.getByte("facing")); super.readAdditionalSaveData(nbt); -@@ -152,7 +152,13 @@ public class Painting extends HangingEntity implements VariantHolder type, Level world) { super(type, world); -@@ -340,6 +346,15 @@ public class ItemEntity extends Entity { +@@ -349,6 +355,15 @@ public class ItemEntity extends Entity implements TraceableEntity { return false; } else if (!this.getItem().getItem().canBeHurtBy(source)) { return false; + // Purpur start + } else if ( -+ (immuneToCactus && source == DamageSource.CACTUS) || -+ (immuneToFire && (source.isFire() || source == DamageSource.IN_FIRE)) || -+ (immuneToLightning && source == DamageSource.LIGHTNING_BOLT) || -+ (immuneToExplosion && source.isExplosion()) ++ (immuneToCactus && source.is(net.minecraft.world.damagesource.DamageTypes.CACTUS)) || ++ (immuneToFire && (source.is(DamageTypeTags.IS_FIRE) && source.is(net.minecraft.world.damagesource.DamageTypes.IN_FIRE)) || ++ (immuneToLightning && source.is(net.minecraft.world.damagesource.DamageTypes.LIGHTNING_BOLT)) || ++ (immuneToExplosion && source.is(DamageTypeTags.IS_EXPLOSION))) + ) { + return false; + // Purpur end } else if (this.level.isClientSide) { return true; } else { -@@ -541,6 +556,12 @@ public class ItemEntity extends Entity { +@@ -547,6 +562,12 @@ public class ItemEntity extends Entity implements TraceableEntity { this.getEntityData().set(ItemEntity.DATA_ITEM, stack); this.getEntityData().markDirty(ItemEntity.DATA_ITEM); // CraftBukkit - SPIGOT-4591, must mark dirty this.despawnRate = level.paperConfig().entities.spawning.altItemDespawnRate.enabled ? level.paperConfig().entities.spawning.altItemDespawnRate.items.getOrDefault(stack.getItem(), level.spigotConfig.itemDespawnRate) : level.spigotConfig.itemDespawnRate; // Paper @@ -11041,10 +11012,10 @@ index c58496c84b2b3f86890050813041fa49711f3a01..9c3db8f774e5c11df18d2c317c874e8a @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -index b8abee145fc92faddef98da913eca7715b6bfc03..0cfe5cb3ce0ac8554bbdb68c6658369306ce634c 100644 +index f2094c52196b45adfd51d8aebcc4c46b779b0925..9c8713ef3aeb2ff203bd0328d15d80c2d78d09e9 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -@@ -65,16 +65,19 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -66,16 +66,19 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo protected AbstractSkeleton(EntityType type, Level world) { super(type, world); this.reassessWeaponGoal(); @@ -11064,7 +11035,7 @@ index b8abee145fc92faddef98da913eca7715b6bfc03..0cfe5cb3ce0ac8554bbdb68c66583693 this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0])); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true)); -@@ -98,35 +101,14 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -99,35 +102,14 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo } // Paper start @@ -11102,7 +11073,7 @@ index b8abee145fc92faddef98da913eca7715b6bfc03..0cfe5cb3ce0ac8554bbdb68c66583693 super.aiStep(); } -@@ -158,11 +140,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -161,11 +143,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo this.reassessWeaponGoal(); this.setCanPickUpLoot(this.level.paperConfig().entities.behavior.mobsCanAlwaysPickUpLoot.skeletons || randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) { @@ -11115,7 +11086,7 @@ index b8abee145fc92faddef98da913eca7715b6bfc03..0cfe5cb3ce0ac8554bbdb68c66583693 this.setItemSlot(EquipmentSlot.HEAD, new ItemStack(randomsource.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN)); this.armorDropChances[EquipmentSlot.HEAD.getIndex()] = 0.0F; } -@@ -189,7 +167,6 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -192,7 +170,6 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo } else { this.goalSelector.addGoal(4, this.meleeGoal); } @@ -11123,7 +11094,7 @@ index b8abee145fc92faddef98da913eca7715b6bfc03..0cfe5cb3ce0ac8554bbdb68c66583693 } } -@@ -202,7 +179,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -205,7 +182,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo double d2 = target.getZ() - this.getZ(); double d3 = Math.sqrt(d0 * d0 + d2 * d2); @@ -11132,7 +11103,7 @@ index b8abee145fc92faddef98da913eca7715b6bfc03..0cfe5cb3ce0ac8554bbdb68c66583693 // CraftBukkit start org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, net.minecraft.world.InteractionHand.MAIN_HAND, 0.8F, true); // Paper if (event.isCancelled()) { -@@ -233,7 +210,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -236,7 +213,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo this.reassessWeaponGoal(); // Paper start if (nbt.contains("Paper.ShouldBurnInDay")) { @@ -11141,7 +11112,7 @@ index b8abee145fc92faddef98da913eca7715b6bfc03..0cfe5cb3ce0ac8554bbdb68c66583693 } // Paper end } -@@ -242,7 +219,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -245,7 +222,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @Override public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); @@ -11151,7 +11122,7 @@ index b8abee145fc92faddef98da913eca7715b6bfc03..0cfe5cb3ce0ac8554bbdb68c66583693 // Paper end diff --git a/src/main/java/net/minecraft/world/entity/monster/Blaze.java b/src/main/java/net/minecraft/world/entity/monster/Blaze.java -index 4595b734abb88df7da6dddf7b24c6c5ffcf6556a..b9d901239b4647d96f4318acd1b80400967718e7 100644 +index 5ae34ded698e501dc5cb97b1d7028863e95742a1..2ad81368f731a937303f17ede20f18c978b6479c 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Blaze.java +++ b/src/main/java/net/minecraft/world/entity/monster/Blaze.java @@ -32,26 +32,73 @@ public class Blaze extends Monster { @@ -11174,8 +11145,8 @@ index 4595b734abb88df7da6dddf7b24c6c5ffcf6556a..b9d901239b4647d96f4318acd1b80400 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.blazeRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.blazeRidableInWater; + } + + @Override @@ -11252,7 +11223,7 @@ index 4595b734abb88df7da6dddf7b24c6c5ffcf6556a..b9d901239b4647d96f4318acd1b80400 if (this.nextHeightOffsetChangeTick <= 0) { this.nextHeightOffsetChangeTick = 100; diff --git a/src/main/java/net/minecraft/world/entity/monster/CaveSpider.java b/src/main/java/net/minecraft/world/entity/monster/CaveSpider.java -index d980b906d9206560741576fa4153c57212f307a0..0ac5264a16c9121c0f6233e83c426199784fe4c9 100644 +index d980b906d9206560741576fa4153c57212f307a0..d23141c44a11050de6ffd12d95a0c2820c3f71e3 100644 --- a/src/main/java/net/minecraft/world/entity/monster/CaveSpider.java +++ b/src/main/java/net/minecraft/world/entity/monster/CaveSpider.java @@ -28,6 +28,38 @@ public class CaveSpider extends Spider { @@ -11266,8 +11237,8 @@ index d980b906d9206560741576fa4153c57212f307a0..0ac5264a16c9121c0f6233e83c426199 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.caveSpiderRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.caveSpiderRidableInWater; + } + + @Override @@ -11295,7 +11266,7 @@ index d980b906d9206560741576fa4153c57212f307a0..0ac5264a16c9121c0f6233e83c426199 public boolean doHurtTarget(Entity target) { if (super.doHurtTarget(target)) { diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java -index 338161d2eb15d9264027961b71678b8d2f020fd8..84e172508ec4591c57a2668d11fac84be6e75f0a 100644 +index 29c62525241e2e03686d1bceee740d4f54f33c54..c32eda28be3eb2c6a6933463d496ea7b6510f27e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java +++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java @@ -59,21 +59,130 @@ public class Creeper extends Monster implements PowerableMob { @@ -11320,8 +11291,8 @@ index 338161d2eb15d9264027961b71678b8d2f020fd8..84e172508ec4591c57a2668d11fac84b + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.creeperRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.creeperRidableInWater; + } + + @Override @@ -11429,7 +11400,7 @@ index 338161d2eb15d9264027961b71678b8d2f020fd8..84e172508ec4591c57a2668d11fac84b this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0])); } -@@ -265,15 +374,17 @@ public class Creeper extends Monster implements PowerableMob { +@@ -263,15 +372,17 @@ public class Creeper extends Monster implements PowerableMob { } public void explodeCreeper() { @@ -11449,7 +11420,7 @@ index 338161d2eb15d9264027961b71678b8d2f020fd8..84e172508ec4591c57a2668d11fac84b this.discard(); this.spawnLingeringCloud(); } else { -@@ -282,7 +393,7 @@ public class Creeper extends Monster implements PowerableMob { +@@ -280,7 +391,7 @@ public class Creeper extends Monster implements PowerableMob { } // CraftBukkit end } @@ -11458,7 +11429,7 @@ index 338161d2eb15d9264027961b71678b8d2f020fd8..84e172508ec4591c57a2668d11fac84b } private void spawnLingeringCloud() { -@@ -324,6 +435,7 @@ public class Creeper extends Monster implements PowerableMob { +@@ -322,6 +433,7 @@ public class Creeper extends Monster implements PowerableMob { com.destroystokyo.paper.event.entity.CreeperIgniteEvent event = new com.destroystokyo.paper.event.entity.CreeperIgniteEvent((org.bukkit.entity.Creeper) getBukkitEntity(), ignited); if (event.callEvent()) { this.entityData.set(Creeper.DATA_IS_IGNITED, event.isIgnited()); @@ -11467,7 +11438,7 @@ index 338161d2eb15d9264027961b71678b8d2f020fd8..84e172508ec4591c57a2668d11fac84b } // Paper end diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -index 1b1305f5eaf5710b72c57ab4c3953e703a23f1e0..68e31cf561f3d76bce6fa4324a75594c776f8964 100644 +index f00773e05654bdeb5463f448293aac99d2208813..a6980d85455234d4f89ff423e013f3c479bd3fe8 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java +++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java @@ -29,6 +29,7 @@ import net.minecraft.world.entity.ai.goal.MoveToBlockGoal; @@ -11489,8 +11460,8 @@ index 1b1305f5eaf5710b72c57ab4c3953e703a23f1e0..68e31cf561f3d76bce6fa4324a75594c + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.drownedRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.drownedRidableInWater; + } + + @Override @@ -11571,7 +11542,7 @@ index 1b1305f5eaf5710b72c57ab4c3953e703a23f1e0..68e31cf561f3d76bce6fa4324a75594c } @Override -@@ -254,8 +320,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -259,8 +325,7 @@ public class Drowned extends Zombie implements RangedAttackMob { this.searchingForLand = targetingUnderwater; } @@ -11581,7 +11552,7 @@ index 1b1305f5eaf5710b72c57ab4c3953e703a23f1e0..68e31cf561f3d76bce6fa4324a75594c private final Drowned drowned; public DrownedMoveControl(Drowned drowned) { -@@ -264,7 +329,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -269,7 +334,7 @@ public class Drowned extends Zombie implements RangedAttackMob { } @Override @@ -11590,7 +11561,7 @@ index 1b1305f5eaf5710b72c57ab4c3953e703a23f1e0..68e31cf561f3d76bce6fa4324a75594c LivingEntity entityliving = this.drowned.getTarget(); if (this.drowned.wantsToSwim() && this.drowned.isInWater()) { -@@ -287,7 +352,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -292,7 +357,7 @@ public class Drowned extends Zombie implements RangedAttackMob { this.drowned.setYRot(this.rotlerp(this.drowned.getYRot(), f, 90.0F)); this.drowned.yBodyRot = this.drowned.getYRot(); @@ -11599,7 +11570,7 @@ index 1b1305f5eaf5710b72c57ab4c3953e703a23f1e0..68e31cf561f3d76bce6fa4324a75594c float f2 = Mth.lerp(0.125F, this.drowned.getSpeed(), f1); this.drowned.setSpeed(f2); -@@ -297,7 +362,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -302,7 +367,7 @@ public class Drowned extends Zombie implements RangedAttackMob { this.drowned.setDeltaMovement(this.drowned.getDeltaMovement().add(0.0D, -0.008D, 0.0D)); } @@ -11609,10 +11580,10 @@ index 1b1305f5eaf5710b72c57ab4c3953e703a23f1e0..68e31cf561f3d76bce6fa4324a75594c } diff --git a/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java b/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java -index d02286d553c600fe7e75f48e278e380d21c5b868..3533414fcb112b75df7226d32b220bfcd6bd869f 100644 +index d02286d553c600fe7e75f48e278e380d21c5b868..916cf5137808003058a787210fc3343d75caf3d9 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java +++ b/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java -@@ -33,6 +33,38 @@ public class ElderGuardian extends Guardian { +@@ -33,6 +33,33 @@ public class ElderGuardian extends Guardian { } @@ -11623,11 +11594,6 @@ index d02286d553c600fe7e75f48e278e380d21c5b868..3533414fcb112b75df7226d32b220bfc + } + + @Override -+ public boolean rideableUnderWater() { -+ return true; -+ } -+ -+ @Override + public boolean isControllable() { + return level.purpurConfig.elderGuardianControllable; + } @@ -11652,13 +11618,13 @@ index d02286d553c600fe7e75f48e278e380d21c5b868..3533414fcb112b75df7226d32b220bfc return Guardian.createAttributes().add(Attributes.MOVEMENT_SPEED, 0.30000001192092896D).add(Attributes.ATTACK_DAMAGE, 8.0D).add(Attributes.MAX_HEALTH, 80.0D); } diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index ff0e09a7387e7dc9ca136d3e48e640b9e9cb4bf3..c029d6eb7893d41432e3de15fbf94768ef595d3f 100644 +index c2f5dabb41b172547864decc06aa632d89dff3e1..7c26e1979cdae52e2e94d24dd8c3164e815226ab 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java @@ -89,12 +89,40 @@ public class EnderMan extends Monster implements NeutralMob { public EnderMan(EntityType type, Level world) { super(type, world); - this.maxUpStep = 1.0F; + this.setMaxUpStep(1.0F); - this.setPathfindingMalus(BlockPathTypes.WATER, -1.0F); + if (isSensitiveToWater()) this.setPathfindingMalus(BlockPathTypes.WATER, -1.0F); // Purpur } @@ -11670,8 +11636,8 @@ index ff0e09a7387e7dc9ca136d3e48e640b9e9cb4bf3..c029d6eb7893d41432e3de15fbf94768 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.endermanRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.endermanRidableInWater; + } + + @Override @@ -11733,18 +11699,24 @@ index ff0e09a7387e7dc9ca136d3e48e640b9e9cb4bf3..c029d6eb7893d41432e3de15fbf94768 float f = this.getLightLevelDependentMagicValue(); if (f > 0.5F && this.level.canSeeSky(this.blockPosition()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper -@@ -404,7 +433,9 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -404,6 +433,8 @@ public class EnderMan extends Monster implements NeutralMob { public boolean hurt(DamageSource source, float amount) { if (this.isInvulnerableTo(source)) { return false; -- } else if (source instanceof IndirectEntityDamageSource) { + } else if (getRider() != null && this.isControllable()) { return super.hurt(source, amount); // Purpur - no teleporting on damage -+ } else if (org.purpurmc.purpur.PurpurConfig.endermanShortHeight && source == DamageSource.IN_WALL) { return false; // Purpur - no suffocation damage if short height -+ } else if (source instanceof IndirectEntityDamageSource && !(this.level.purpurConfig.endermanIgnoreProjectiles && source.getDirectEntity() instanceof net.minecraft.world.entity.projectile.Projectile)) { // Purpur - Entity entity = source.getDirectEntity(); - boolean flag; ++ } else if (org.purpurmc.purpur.PurpurConfig.endermanShortHeight && source.is(net.minecraft.world.damagesource.DamageTypes.IN_WALL)) { return false; // Purpur - no suffocation damage if short height + } else { + boolean flag = source.getDirectEntity() instanceof ThrownPotion; + boolean flag1; +@@ -418,6 +449,7 @@ public class EnderMan extends Monster implements NeutralMob { + } else { + flag1 = flag && this.hurtWithCleanWater(source, (ThrownPotion) source.getDirectEntity(), amount); -@@ -467,7 +498,7 @@ public class EnderMan extends Monster implements NeutralMob { ++ if (!flag1 && this.level.purpurConfig.endermanIgnoreProjectiles) return super.hurt(source, amount); // Purpur + if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start + for (int i = 0; i < 64; ++i) { + if (this.teleport()) { +@@ -464,7 +496,7 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean requiresCustomPersistence() { @@ -11753,7 +11725,7 @@ index ff0e09a7387e7dc9ca136d3e48e640b9e9cb4bf3..c029d6eb7893d41432e3de15fbf94768 } private static class EndermanFreezeWhenLookedAt extends Goal { -@@ -514,7 +545,16 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -511,7 +543,16 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean canUse() { @@ -11771,7 +11743,7 @@ index ff0e09a7387e7dc9ca136d3e48e640b9e9cb4bf3..c029d6eb7893d41432e3de15fbf94768 } @Override -@@ -561,7 +601,16 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -558,7 +599,16 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean canUse() { @@ -11790,7 +11762,7 @@ index ff0e09a7387e7dc9ca136d3e48e640b9e9cb4bf3..c029d6eb7893d41432e3de15fbf94768 @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/Endermite.java b/src/main/java/net/minecraft/world/entity/monster/Endermite.java -index e8c3972b889fd6b348a5b0d18444d28faa813879..c8696832f16e6c4a106befde471ef032bc40c891 100644 +index e8c3972b889fd6b348a5b0d18444d28faa813879..e6ecc47828fea09c80ed3a4c39f0d85f4d820571 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Endermite.java +++ b/src/main/java/net/minecraft/world/entity/monster/Endermite.java @@ -31,20 +31,63 @@ import net.minecraft.world.level.block.state.BlockState; @@ -11811,8 +11783,8 @@ index e8c3972b889fd6b348a5b0d18444d28faa813879..c8696832f16e6c4a106befde471ef032 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.endermiteRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.endermiteRidableInWater; + } + + @Override @@ -11873,7 +11845,7 @@ index e8c3972b889fd6b348a5b0d18444d28faa813879..c8696832f16e6c4a106befde471ef032 @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/Evoker.java b/src/main/java/net/minecraft/world/entity/monster/Evoker.java -index d16988e854c327e3c33b4c7c0d3546468526cfd0..9326096e2459abba9db19988b4d02c99779dd882 100644 +index 1935f1eb28724d8f03a9612a9b4ddefbbc557157..892e0c0306a21ea638649c1324b8115f24c01bd2 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Evoker.java +++ b/src/main/java/net/minecraft/world/entity/monster/Evoker.java @@ -48,10 +48,43 @@ public class Evoker extends SpellcasterIllager { @@ -11887,8 +11859,8 @@ index d16988e854c327e3c33b4c7c0d3546468526cfd0..9326096e2459abba9db19988b4d02c99 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.evokerRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.evokerRidableInWater; + } + + @Override @@ -11938,7 +11910,7 @@ index d16988e854c327e3c33b4c7c0d3546468526cfd0..9326096e2459abba9db19988b4d02c99 } else { List list = Evoker.this.level.getNearbyEntities(Sheep.class, this.wololoTargeting, Evoker.this, Evoker.this.getBoundingBox().inflate(16.0D, 4.0D, 16.0D)); diff --git a/src/main/java/net/minecraft/world/entity/monster/Ghast.java b/src/main/java/net/minecraft/world/entity/monster/Ghast.java -index bb2cb17e4e5ce142eeec18951c8948e3d6b3209c..225a4e549c2cbf64beaba52d26b196af5b868433 100644 +index bb2cb17e4e5ce142eeec18951c8948e3d6b3209c..77dcae6ecd87fade2b529386ba1360836363593a 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Ghast.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ghast.java @@ -44,11 +44,62 @@ public class Ghast extends FlyingMob implements Enemy { @@ -11952,8 +11924,8 @@ index bb2cb17e4e5ce142eeec18951c8948e3d6b3209c..225a4e549c2cbf64beaba52d26b196af + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.ghastRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.ghastRidableInWater; + } + + @Override @@ -12032,7 +12004,7 @@ index bb2cb17e4e5ce142eeec18951c8948e3d6b3209c..225a4e549c2cbf64beaba52d26b196af if (this.floatDuration-- <= 0) { this.floatDuration += this.ghast.getRandom().nextInt(5) + 2; diff --git a/src/main/java/net/minecraft/world/entity/monster/Giant.java b/src/main/java/net/minecraft/world/entity/monster/Giant.java -index 41004c28edb748e12c4f868aa07b4672891197c1..2511ca42039fa91483a316ae13bb7da54f312f13 100644 +index 41004c28edb748e12c4f868aa07b4672891197c1..4e5b9f772ba587b4e108add3758dffa665c1c3f3 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Giant.java +++ b/src/main/java/net/minecraft/world/entity/monster/Giant.java @@ -1,18 +1,123 @@ @@ -12083,8 +12055,8 @@ index 41004c28edb748e12c4f868aa07b4672891197c1..2511ca42039fa91483a316ae13bb7da5 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.giantRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.giantRidableInWater; + } + + @Override @@ -12168,10 +12140,10 @@ index 41004c28edb748e12c4f868aa07b4672891197c1..2511ca42039fa91483a316ae13bb7da5 } } diff --git a/src/main/java/net/minecraft/world/entity/monster/Guardian.java b/src/main/java/net/minecraft/world/entity/monster/Guardian.java -index 2f43700c01a0f0a4749f56d3f6294cf648b10f51..ca0696c9237e71d366aac399f335304ad768d03d 100644 +index 6e0f4f15e49afb989874468b2a459178aef552f5..73e973e10f767d0efe0e0410d97c6892c4ea35d8 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Guardian.java +++ b/src/main/java/net/minecraft/world/entity/monster/Guardian.java -@@ -65,14 +65,55 @@ public class Guardian extends Monster { +@@ -67,14 +67,50 @@ public class Guardian extends Monster { this.xpReward = 10; this.setPathfindingMalus(BlockPathTypes.WATER, 0.0F); this.moveControl = new Guardian.GuardianMoveControl(this); @@ -12194,11 +12166,6 @@ index 2f43700c01a0f0a4749f56d3f6294cf648b10f51..ca0696c9237e71d366aac399f335304a + } + + @Override -+ public boolean rideableUnderWater() { -+ return true; -+ } -+ -+ @Override + public boolean isControllable() { + return level.purpurConfig.guardianControllable; + } @@ -12227,7 +12194,7 @@ index 2f43700c01a0f0a4749f56d3f6294cf648b10f51..ca0696c9237e71d366aac399f335304a this.goalSelector.addGoal(4, new Guardian.GuardianAttackGoal(this)); this.goalSelector.addGoal(5, moveTowardsRestrictionGoal); this.goalSelector.addGoal(7, this.randomStrollGoal); -@@ -81,6 +122,7 @@ public class Guardian extends Monster { +@@ -83,6 +119,7 @@ public class Guardian extends Monster { this.goalSelector.addGoal(9, new RandomLookAroundGoal(this)); this.randomStrollGoal.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK)); moveTowardsRestrictionGoal.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK)); @@ -12235,16 +12202,16 @@ index 2f43700c01a0f0a4749f56d3f6294cf648b10f51..ca0696c9237e71d366aac399f335304a this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 10, true, false, new Guardian.GuardianAttackSelector(this))); } -@@ -330,7 +372,7 @@ public class Guardian extends Monster { +@@ -341,7 +378,7 @@ public class Guardian extends Monster { @Override public void travel(Vec3 movementInput) { - if (this.isEffectiveAi() && this.isInWater()) { + if (this.isControlledByLocalInstance() && this.isInWater()) { - this.moveRelative(0.1F, movementInput); + this.moveRelative(getRider() != null && this.isControllable() ? getSpeed() : 0.1F, movementInput); // Purpur this.move(MoverType.SELF, this.getDeltaMovement()); this.setDeltaMovement(this.getDeltaMovement().scale(0.9D)); if (!this.isMoving() && this.getTarget() == null) { -@@ -437,7 +479,7 @@ public class Guardian extends Monster { +@@ -448,7 +485,7 @@ public class Guardian extends Monster { } } @@ -12253,7 +12220,7 @@ index 2f43700c01a0f0a4749f56d3f6294cf648b10f51..ca0696c9237e71d366aac399f335304a private final Guardian guardian; public GuardianMoveControl(Guardian guardian) { -@@ -445,8 +487,17 @@ public class Guardian extends Monster { +@@ -456,8 +493,17 @@ public class Guardian extends Monster { this.guardian = guardian; } @@ -12272,7 +12239,7 @@ index 2f43700c01a0f0a4749f56d3f6294cf648b10f51..ca0696c9237e71d366aac399f335304a if (this.operation == MoveControl.Operation.MOVE_TO && !this.guardian.getNavigation().isDone()) { Vec3 vec3 = new Vec3(this.wantedX - this.guardian.getX(), this.wantedY - this.guardian.getY(), this.wantedZ - this.guardian.getZ()); double d = vec3.length(); -@@ -456,7 +507,7 @@ public class Guardian extends Monster { +@@ -467,7 +513,7 @@ public class Guardian extends Monster { float h = (float)(Mth.atan2(vec3.z, vec3.x) * (double)(180F / (float)Math.PI)) - 90.0F; this.guardian.setYRot(this.rotlerp(this.guardian.getYRot(), h, 90.0F)); this.guardian.yBodyRot = this.guardian.getYRot(); @@ -12282,7 +12249,7 @@ index 2f43700c01a0f0a4749f56d3f6294cf648b10f51..ca0696c9237e71d366aac399f335304a this.guardian.setSpeed(j); double k = Math.sin((double)(this.guardian.tickCount + this.guardian.getId()) * 0.5D) * 0.05D; diff --git a/src/main/java/net/minecraft/world/entity/monster/Husk.java b/src/main/java/net/minecraft/world/entity/monster/Husk.java -index 4996347c6dde85a2dc9aa37fdf495160093fac64..c865717f915f1bf27a07e09215322bdc6df7e909 100644 +index 4996347c6dde85a2dc9aa37fdf495160093fac64..a7b690c0730d0b10133f24d7ce2d9f6a0e4a7c04 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Husk.java +++ b/src/main/java/net/minecraft/world/entity/monster/Husk.java @@ -20,15 +20,68 @@ public class Husk extends Zombie { @@ -12299,8 +12266,8 @@ index 4996347c6dde85a2dc9aa37fdf495160093fac64..c865717f915f1bf27a07e09215322bdc + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.huskRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.huskRidableInWater; + } + + @Override @@ -12356,7 +12323,7 @@ index 4996347c6dde85a2dc9aa37fdf495160093fac64..c865717f915f1bf27a07e09215322bdc @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java -index 86f7fdd42461db151221d2c0d5cff6953392fa80..4d50e9d2b9b06cae0fe135cc91a90919e82a26cb 100644 +index 10573602c9bc73713cbd6989762d3dbb6f6fcf8c..63577d941dbd21cf93bc6f88bb50922618b6b5d5 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java +++ b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java @@ -59,10 +59,45 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { @@ -12370,8 +12337,8 @@ index 86f7fdd42461db151221d2c0d5cff6953392fa80..4d50e9d2b9b06cae0fe135cc91a90919 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.illusionerRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.illusionerRidableInWater; + } + + @Override @@ -12414,7 +12381,7 @@ index 86f7fdd42461db151221d2c0d5cff6953392fa80..4d50e9d2b9b06cae0fe135cc91a90919 this.targetSelector.addGoal(2, (new NearestAttackableTargetGoal<>(this, Player.class, true)).setUnseenMemoryTicks(300)); this.targetSelector.addGoal(3, (new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)).setUnseenMemoryTicks(300)); diff --git a/src/main/java/net/minecraft/world/entity/monster/MagmaCube.java b/src/main/java/net/minecraft/world/entity/monster/MagmaCube.java -index ea4fa9eba301e462c159cdb970079f6d87d25f4d..2111a99d23d86f5f2e2ce8101dbbf292671a5c47 100644 +index f23d8796aec3e02a3bb23f338903f39b6ef9dcf1..11af95207f5aff52427dc216fb9929b0f536f411 100644 --- a/src/main/java/net/minecraft/world/entity/monster/MagmaCube.java +++ b/src/main/java/net/minecraft/world/entity/monster/MagmaCube.java @@ -25,6 +25,58 @@ public class MagmaCube extends Slime { @@ -12428,8 +12395,8 @@ index ea4fa9eba301e462c159cdb970079f6d87d25f4d..2111a99d23d86f5f2e2ce8101dbbf292 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.magmaCubeRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.magmaCubeRidableInWater; + } + + @Override @@ -12509,7 +12476,7 @@ index 55c245d0dfa369dc6de2197ae37335fba4fae4ae..c9b40515f4c2ff1eedfc9510930c3bae return false; } else { diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e719879de 100644 +index 97fb1d2110a51498f6419841081b500b3f190370..2c00a9fdd3a6ea16ee765339857cf58521c85797 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java @@ -49,6 +49,8 @@ public class Phantom extends FlyingMob implements Enemy { @@ -12535,8 +12502,8 @@ index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.phantomRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.phantomRidableInWater; + } + + @Override @@ -12590,9 +12557,9 @@ index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e + Double value = cache.get().get(size); + if (value == null) { + try { -+ scriptEngine.eval("size = " + size); -+ value = (double) scriptEngine.eval(equation.get()); -+ } catch (Exception e) { ++ value = ((Number) scriptEngine.eval("let size = " + size + "; " + equation.get())).doubleValue(); ++ } catch (javax.script.ScriptException e) { ++ e.printStackTrace(); + value = defaultValue.get(); + } + cache.get().put(size, value); @@ -12713,7 +12680,7 @@ index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e // Paper end } -@@ -253,8 +370,14 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -258,8 +375,14 @@ public class Phantom extends FlyingMob implements Enemy { } public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } @@ -12730,7 +12697,7 @@ index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } // Paper end private static enum AttackPhase { -@@ -264,7 +387,125 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -269,7 +392,125 @@ public class Phantom extends FlyingMob implements Enemy { private AttackPhase() {} } @@ -12857,7 +12824,7 @@ index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e private float speed = 0.1F; -@@ -272,8 +513,19 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -277,8 +518,19 @@ public class Phantom extends FlyingMob implements Enemy { super(entity); } @@ -12878,7 +12845,7 @@ index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e if (Phantom.this.horizontalCollision) { Phantom.this.setYRot(Phantom.this.getYRot() + 180.0F); this.speed = 0.1F; -@@ -319,14 +571,20 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -324,14 +576,20 @@ public class Phantom extends FlyingMob implements Enemy { } } @@ -12901,7 +12868,7 @@ index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e } private class PhantomBodyRotationControl extends BodyRotationControl { -@@ -413,6 +671,12 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -418,6 +676,12 @@ public class Phantom extends FlyingMob implements Enemy { return false; } else if (!entityliving.isAlive()) { return false; @@ -12914,7 +12881,7 @@ index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e } else { if (entityliving instanceof Player) { Player entityhuman = (Player) entityliving; -@@ -558,6 +822,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -563,6 +827,7 @@ public class Phantom extends FlyingMob implements Enemy { this.nextScanTick = reducedTickDelay(60); List list = Phantom.this.level.getNearbyPlayers(this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0D, 64.0D, 16.0D)); @@ -12923,7 +12890,7 @@ index aa8734856ec7b90036afad13bfda46c02e548812..cf6f7c6c5754ab712e06a7bfb8c1ef8e list.sort(Comparator.comparing((Entity e) -> { return e.getY(); }).reversed()); // CraftBukkit - decompile error Iterator iterator = list.iterator(); diff --git a/src/main/java/net/minecraft/world/entity/monster/Pillager.java b/src/main/java/net/minecraft/world/entity/monster/Pillager.java -index cec545c3baa6599d47b9cf1a4b97de8771062a22..1d4fed01ee94678e04962df0f086f53edf3f43a4 100644 +index cec545c3baa6599d47b9cf1a4b97de8771062a22..06a96eb0ef40462932892c611f308eb31411d099 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Pillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Pillager.java @@ -62,15 +62,49 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve @@ -12937,8 +12904,8 @@ index cec545c3baa6599d47b9cf1a4b97de8771062a22..1d4fed01ee94678e04962df0f086f53e + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.pillagerRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.pillagerRidableInWater; + } + + @Override @@ -12977,11 +12944,11 @@ index cec545c3baa6599d47b9cf1a4b97de8771062a22..1d4fed01ee94678e04962df0f086f53e this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)); diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -index 40443f7d0c9f5697f529bfbbd16695c00bbd7322..67815f8c68044b7dc05a6efd5c60dbf05bbcacbb 100644 +index 9258d0f7c5c27b6d3d8f99db947169d6800d8ea9..0099595a5daa9c0ca9e3fd35933038c1c8ecf009 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -@@ -69,14 +69,54 @@ public class Ravager extends Raider { - this.xpReward = 20; +@@ -65,14 +65,54 @@ public class Ravager extends Raider { + this.setPathfindingMalus(BlockPathTypes.LEAVES, 0.0F); } + // Purpur start @@ -12991,8 +12958,8 @@ index 40443f7d0c9f5697f529bfbbd16695c00bbd7322..67815f8c68044b7dc05a6efd5c60dbf0 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.ravagerRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.ravagerRidableInWater; + } + + @Override @@ -13035,7 +13002,7 @@ index 40443f7d0c9f5697f529bfbbd16695c00bbd7322..67815f8c68044b7dc05a6efd5c60dbf0 this.targetSelector.addGoal(2, (new HurtByTargetGoal(this, new Class[]{Raider.class})).setAlertOthers()); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, true, (entityliving) -> { -@@ -151,7 +191,7 @@ public class Ravager extends Raider { +@@ -150,7 +190,7 @@ public class Ravager extends Raider { @Override public void aiStep() { super.aiStep(); @@ -13044,7 +13011,7 @@ index 40443f7d0c9f5697f529bfbbd16695c00bbd7322..67815f8c68044b7dc05a6efd5c60dbf0 if (this.isImmobile()) { this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.0D); } else { -@@ -161,7 +201,7 @@ public class Ravager extends Raider { +@@ -160,7 +200,7 @@ public class Ravager extends Raider { this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(Mth.lerp(0.1D, d1, d0)); } @@ -13053,7 +13020,7 @@ index 40443f7d0c9f5697f529bfbbd16695c00bbd7322..67815f8c68044b7dc05a6efd5c60dbf0 boolean flag = false; AABB axisalignedbb = this.getBoundingBox().inflate(0.2D); Iterator iterator = BlockPos.betweenClosed(Mth.floor(axisalignedbb.minX), Mth.floor(axisalignedbb.minY), Mth.floor(axisalignedbb.minZ), Mth.floor(axisalignedbb.maxX), Mth.floor(axisalignedbb.maxY), Mth.floor(axisalignedbb.maxZ)).iterator(); -@@ -171,7 +211,7 @@ public class Ravager extends Raider { +@@ -170,7 +210,7 @@ public class Ravager extends Raider { BlockState iblockdata = this.level.getBlockState(blockposition); Block block = iblockdata.getBlock(); @@ -13063,10 +13030,10 @@ index 40443f7d0c9f5697f529bfbbd16695c00bbd7322..67815f8c68044b7dc05a6efd5c60dbf0 } } diff --git a/src/main/java/net/minecraft/world/entity/monster/Shulker.java b/src/main/java/net/minecraft/world/entity/monster/Shulker.java -index 9dedb3599d5388c1bcc34558e8e5cb4a8668646f..a31ce1f7ba5150c11cee58599d92241194f1bef2 100644 +index 19657390ddb73992d7b68dc77776faa99c6f1b15..07c78a6c4804f48c948e40819e55654683789bd4 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Shulker.java +++ b/src/main/java/net/minecraft/world/entity/monster/Shulker.java -@@ -21,6 +21,8 @@ import net.minecraft.sounds.SoundSource; +@@ -22,6 +22,8 @@ import net.minecraft.tags.DamageTypeTags; import net.minecraft.util.Mth; import net.minecraft.world.Difficulty; import net.minecraft.world.DifficultyInstance; @@ -13075,7 +13042,7 @@ index 9dedb3599d5388c1bcc34558e8e5cb4a8668646f..a31ce1f7ba5150c11cee58599d922411 import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityDimensions; -@@ -49,6 +51,8 @@ import net.minecraft.world.entity.projectile.AbstractArrow; +@@ -50,6 +52,8 @@ import net.minecraft.world.entity.projectile.AbstractArrow; import net.minecraft.world.entity.projectile.ShulkerBullet; import net.minecraft.world.entity.vehicle.Boat; import net.minecraft.world.item.DyeColor; @@ -13084,7 +13051,7 @@ index 9dedb3599d5388c1bcc34558e8e5cb4a8668646f..a31ce1f7ba5150c11cee58599d922411 import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.block.Blocks; -@@ -94,12 +98,59 @@ public class Shulker extends AbstractGolem implements VariantHolder getVariant() { @@ -13179,7 +13146,7 @@ index 9dedb3599d5388c1bcc34558e8e5cb4a8668646f..a31ce1f7ba5150c11cee58599d922411 } @Nullable -@@ -607,7 +667,7 @@ public class Shulker extends AbstractGolem implements VariantHolder(this, Player.class)); this.targetSelector.addGoal(3, new Spider.SpiderTargetGoal<>(this, IronGolem.class)); diff --git a/src/main/java/net/minecraft/world/entity/monster/Stray.java b/src/main/java/net/minecraft/world/entity/monster/Stray.java -index 118b636a44e4b062e812e433f603b039276337da..c1d36eb62c52c3fd8055e3b6c7d504c83fe3042e 100644 +index 118b636a44e4b062e812e433f603b039276337da..677b304c177a1e2bdaddf3044b44a06395ee6b6e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Stray.java +++ b/src/main/java/net/minecraft/world/entity/monster/Stray.java @@ -21,6 +21,38 @@ public class Stray extends AbstractSkeleton { @@ -13638,8 +13605,8 @@ index 118b636a44e4b062e812e433f603b039276337da..c1d36eb62c52c3fd8055e3b6c7d504c8 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.strayRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.strayRidableInWater; + } + + @Override @@ -13667,10 +13634,10 @@ index 118b636a44e4b062e812e433f603b039276337da..c1d36eb62c52c3fd8055e3b6c7d504c8 BlockPos blockPos = pos; diff --git a/src/main/java/net/minecraft/world/entity/monster/Strider.java b/src/main/java/net/minecraft/world/entity/monster/Strider.java -index 6a511394bb01e025d5e3cf3963618920eee74445..4aafc7d56eb669f6454e3c88189ec765f674e795 100644 +index 66755efc54059dfb8625f028bf0548d188a57aa2..0b5d3837536d526c25ba1e12be142bb476d03519 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Strider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Strider.java -@@ -90,12 +90,44 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -94,12 +94,44 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { super(type, world); this.steering = new ItemBasedSteering(this.entityData, Strider.DATA_BOOST_TIME, Strider.DATA_SADDLE_ID); this.blocksBuilding = true; @@ -13688,8 +13655,8 @@ index 6a511394bb01e025d5e3cf3963618920eee74445..4aafc7d56eb669f6454e3c88189ec765 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.striderRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.striderRidableInWater; + } + + @Override @@ -13716,7 +13683,7 @@ index 6a511394bb01e025d5e3cf3963618920eee74445..4aafc7d56eb669f6454e3c88189ec765 public static boolean checkStriderSpawnRules(EntityType type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) { BlockPos.MutableBlockPos blockposition_mutableblockposition = pos.mutable(); -@@ -157,6 +189,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -161,6 +193,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { @Override protected void registerGoals() { this.panicGoal = new PanicGoal(this, 1.65D); @@ -13724,7 +13691,7 @@ index 6a511394bb01e025d5e3cf3963618920eee74445..4aafc7d56eb669f6454e3c88189ec765 this.goalSelector.addGoal(1, this.panicGoal); this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D)); this.temptGoal = new TemptGoal(this, 1.4D, Strider.TEMPT_ITEMS, false); -@@ -386,7 +419,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -416,7 +449,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { @Override public boolean isSensitiveToWater() { @@ -13733,7 +13700,7 @@ index 6a511394bb01e025d5e3cf3963618920eee74445..4aafc7d56eb669f6454e3c88189ec765 } @Override -@@ -428,6 +461,19 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -458,6 +491,19 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { public InteractionResult mobInteract(Player player, InteractionHand hand) { boolean flag = this.isFood(player.getItemInHand(hand)); @@ -13753,7 +13720,7 @@ index 6a511394bb01e025d5e3cf3963618920eee74445..4aafc7d56eb669f6454e3c88189ec765 if (!flag && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) { if (!this.level.isClientSide) { player.startRiding(this); -@@ -440,7 +486,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -470,7 +516,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { if (!enuminteractionresult.consumesAction()) { ItemStack itemstack = player.getItemInHand(hand); @@ -13763,10 +13730,10 @@ index 6a511394bb01e025d5e3cf3963618920eee74445..4aafc7d56eb669f6454e3c88189ec765 if (flag && !this.isSilent()) { this.level.playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.STRIDER_EAT, this.getSoundSource(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); diff --git a/src/main/java/net/minecraft/world/entity/monster/Vex.java b/src/main/java/net/minecraft/world/entity/monster/Vex.java -index 8804771d73c2521d6dff284de3464fa5788e5ffc..b368d20b6ce18b5cb9af054e1cd518c2a413fbf1 100644 +index bb5c2f90bef5e3c57ffde996853e122d108b2789..4c4c4d52e2be963024106783b4d28713f125e2e6 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Vex.java +++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java -@@ -62,6 +62,65 @@ public class Vex extends Monster { +@@ -63,6 +63,65 @@ public class Vex extends Monster implements TraceableEntity { this.xpReward = 3; } @@ -13777,8 +13744,8 @@ index 8804771d73c2521d6dff284de3464fa5788e5ffc..b368d20b6ce18b5cb9af054e1cd518c2 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.vexRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.vexRidableInWater; + } + + @Override @@ -13832,7 +13799,7 @@ index 8804771d73c2521d6dff284de3464fa5788e5ffc..b368d20b6ce18b5cb9af054e1cd518c2 @Override protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) { return dimensions.height - 0.28125F; -@@ -80,7 +139,7 @@ public class Vex extends Monster { +@@ -81,7 +140,7 @@ public class Vex extends Monster implements TraceableEntity { @Override public void tick() { @@ -13841,7 +13808,7 @@ index 8804771d73c2521d6dff284de3464fa5788e5ffc..b368d20b6ce18b5cb9af054e1cd518c2 super.tick(); this.noPhysics = false; this.setNoGravity(true); -@@ -95,17 +154,19 @@ public class Vex extends Monster { +@@ -96,17 +155,19 @@ public class Vex extends Monster implements TraceableEntity { protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); @@ -13862,7 +13829,7 @@ index 8804771d73c2521d6dff284de3464fa5788e5ffc..b368d20b6ce18b5cb9af054e1cd518c2 } @Override -@@ -233,14 +294,14 @@ public class Vex extends Monster { +@@ -235,14 +296,14 @@ public class Vex extends Monster implements TraceableEntity { return 0.4D; } @@ -13879,7 +13846,7 @@ index 8804771d73c2521d6dff284de3464fa5788e5ffc..b368d20b6ce18b5cb9af054e1cd518c2 if (this.operation == MoveControl.Operation.MOVE_TO) { Vec3 vec3d = new Vec3(this.wantedX - Vex.this.getX(), this.wantedY - Vex.this.getY(), this.wantedZ - Vex.this.getZ()); double d0 = vec3d.length(); -@@ -249,7 +310,7 @@ public class Vex extends Monster { +@@ -251,7 +312,7 @@ public class Vex extends Monster implements TraceableEntity { this.operation = MoveControl.Operation.WAIT; Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().scale(0.5D)); } else { @@ -13889,7 +13856,7 @@ index 8804771d73c2521d6dff284de3464fa5788e5ffc..b368d20b6ce18b5cb9af054e1cd518c2 Vec3 vec3d1 = Vex.this.getDeltaMovement(); diff --git a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -index a9e75a16a7dc0ff5d4f0faa92ebc444559a39325..efbfe0a151686f00051026113c4d1f4d9c9eb241 100644 +index a9e75a16a7dc0ff5d4f0faa92ebc444559a39325..1a333dce35a13b88cb0afdea192585e0bae38442 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java +++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java @@ -58,14 +58,48 @@ public class Vindicator extends AbstractIllager { @@ -13903,8 +13870,8 @@ index a9e75a16a7dc0ff5d4f0faa92ebc444559a39325..efbfe0a151686f00051026113c4d1f4d + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.vindicatorRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.vindicatorRidableInWater; + } + + @Override @@ -13955,10 +13922,10 @@ index a9e75a16a7dc0ff5d4f0faa92ebc444559a39325..efbfe0a151686f00051026113c4d1f4d } diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java -index b7bc64818387288955d0723cd071d4203bd2f121..d308c2bed67977bd6fd2a4509f9a13ae2af9025f 100644 +index 096546d7a97f031060bda7545aa620d522766719..dcf8cdb8343706b55df206fed70fe3a8373e27a6 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Witch.java +++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java -@@ -56,6 +56,38 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -57,6 +57,38 @@ public class Witch extends Raider implements RangedAttackMob { super(type, world); } @@ -13969,8 +13936,8 @@ index b7bc64818387288955d0723cd071d4203bd2f121..d308c2bed67977bd6fd2a4509f9a13ae + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.witchRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.witchRidableInWater; + } + + @Override @@ -13997,7 +13964,7 @@ index b7bc64818387288955d0723cd071d4203bd2f121..d308c2bed67977bd6fd2a4509f9a13ae @Override protected void registerGoals() { super.registerGoals(); -@@ -64,10 +96,12 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -65,10 +97,12 @@ public class Witch extends Raider implements RangedAttackMob { }); this.attackPlayersGoal = new NearestAttackableWitchTargetGoal<>(this, Player.class, 10, true, false, (Predicate) null); this.goalSelector.addGoal(1, new FloatGoal(this)); @@ -14011,7 +13978,7 @@ index b7bc64818387288955d0723cd071d4203bd2f121..d308c2bed67977bd6fd2a4509f9a13ae this.targetSelector.addGoal(2, this.healRaidersGoal); this.targetSelector.addGoal(3, this.attackPlayersGoal); diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java -index 6449213d717271bcc516e393a78dfe1e5c762d68..56f1c52afe32ce71edd44c7bc3ff1ac1f09457a2 100644 +index 6449213d717271bcc516e393a78dfe1e5c762d68..9016fb6da9c86ca9906f6beb2f6927cede50c804 100644 --- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java @@ -35,6 +35,38 @@ public class WitherSkeleton extends AbstractSkeleton { @@ -14025,8 +13992,8 @@ index 6449213d717271bcc516e393a78dfe1e5c762d68..56f1c52afe32ce71edd44c7bc3ff1ac1 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.witherSkeletonRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.witherSkeletonRidableInWater; + } + + @Override @@ -14054,7 +14021,7 @@ index 6449213d717271bcc516e393a78dfe1e5c762d68..56f1c52afe32ce71edd44c7bc3ff1ac1 protected void registerGoals() { this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractPiglin.class, true)); diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java -index 5956a7759964f5e4939f062e93714fba64f53141..70d891d85748039b517a87b2438b04a9010d8af4 100644 +index 5956a7759964f5e4939f062e93714fba64f53141..052eac2c63ecaa052c9fe6ea3d3d1000da8a33fa 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java @@ -67,6 +67,38 @@ public class Zoglin extends Monster implements Enemy, HoglinBase { @@ -14068,8 +14035,8 @@ index 5956a7759964f5e4939f062e93714fba64f53141..70d891d85748039b517a87b2438b04a9 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.zoglinRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.zoglinRidableInWater; + } + + @Override @@ -14119,7 +14086,7 @@ index 5956a7759964f5e4939f062e93714fba64f53141..70d891d85748039b517a87b2438b04a9 } diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 9976205537cfe228735687f1e9c52c74ac025690..ef8cca70661cedecf08a787011342c402eb59a79 100644 +index 9976205537cfe228735687f1e9c52c74ac025690..36d37e544e342e1bc584374580dbb5c883523204 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java @@ -95,22 +95,69 @@ public class Zombie extends Monster { @@ -14146,8 +14113,8 @@ index 9976205537cfe228735687f1e9c52c74ac025690..ef8cca70661cedecf08a787011342c40 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.zombieRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.zombieRidableInWater; + } + + @Override @@ -14330,7 +14297,7 @@ index 9976205537cfe228735687f1e9c52c74ac025690..ef8cca70661cedecf08a787011342c40 @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java -index 71a36cf9b976443cca9ab63cd0eb23253f638562..0fdfcb3a26698f26caf163828f2cf89e2a28054a 100644 +index 71a36cf9b976443cca9ab63cd0eb23253f638562..0c6e8e05014125427513e96c32510125ec34ece9 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java @@ -79,6 +79,58 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -14344,8 +14311,8 @@ index 71a36cf9b976443cca9ab63cd0eb23253f638562..0fdfcb3a26698f26caf163828f2cf89e + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.zombieVillagerRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.zombieVillagerRidableInWater; + } + + @Override @@ -14409,7 +14376,7 @@ index 71a36cf9b976443cca9ab63cd0eb23253f638562..0fdfcb3a26698f26caf163828f2cf89e return InteractionResult.SUCCESS; diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java -index b75945807b425609394c343da56c316a769f0a29..ab33a30995d741898cd034fe0fad99eff3529707 100644 +index b75945807b425609394c343da56c316a769f0a29..d3bcfa017967db0a20c18c65e27c2a0471d2214e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java @@ -63,6 +63,53 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { @@ -14423,8 +14390,8 @@ index b75945807b425609394c343da56c316a769f0a29..ab33a30995d741898cd034fe0fad99ef + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.zombifiedPiglinRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.zombifiedPiglinRidableInWater; + } + + @Override @@ -14494,7 +14461,7 @@ index b75945807b425609394c343da56c316a769f0a29..ab33a30995d741898cd034fe0fad99ef @Nullable diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java -index daa2224b021c966751eb39f269ffbfe6e7f3d426..aba0633361d4d933a3c18049595f3deb1d39da1a 100644 +index daa2224b021c966751eb39f269ffbfe6e7f3d426..63ffb8c04f1408d028af086ba907551a05b96e72 100644 --- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java @@ -67,6 +67,43 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { @@ -14508,8 +14475,8 @@ index daa2224b021c966751eb39f269ffbfe6e7f3d426..aba0633361d4d933a3c18049595f3deb + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.hoglinRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.hoglinRidableInWater; + } + + @Override @@ -14556,7 +14523,7 @@ index daa2224b021c966751eb39f269ffbfe6e7f3d426..aba0633361d4d933a3c18049595f3deb if (this.isConverting()) { ++this.timeInOverworld; diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -index b401fb4f276ca81b4bb18426ee56abed8a9f7a7b..d606a351210486fc8656c0bfd224347150af7faf 100644 +index b401fb4f276ca81b4bb18426ee56abed8a9f7a7b..c8db72dbdaedddb712f20cf0e3a9c731312307a0 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java @@ -97,6 +97,38 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @@ -14570,8 +14537,8 @@ index b401fb4f276ca81b4bb18426ee56abed8a9f7a7b..d606a351210486fc8656c0bfd2243471 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.piglinRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.piglinRidableInWater; + } + + @Override @@ -14622,7 +14589,7 @@ index b401fb4f276ca81b4bb18426ee56abed8a9f7a7b..d606a351210486fc8656c0bfd2243471 protected boolean canReplaceCurrentItem(ItemStack stack) { diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java -index ac75c54e897565e340b66823caeed92ba1d1641a..bc6572b1025d74a7590d7e1cc49132f95af0560a 100644 +index ac75c54e897565e340b66823caeed92ba1d1641a..df4d1745c4957e564bab11d68a37178fdb398543 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java @@ -41,6 +41,38 @@ public class PiglinBrute extends AbstractPiglin { @@ -14636,8 +14603,8 @@ index ac75c54e897565e340b66823caeed92ba1d1641a..bc6572b1025d74a7590d7e1cc49132f9 + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.piglinBruteRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.piglinBruteRidableInWater; + } + + @Override @@ -14687,7 +14654,7 @@ index ac75c54e897565e340b66823caeed92ba1d1641a..bc6572b1025d74a7590d7e1cc49132f9 PiglinBruteAi.maybePlayActivitySound(this); super.customServerAiStep(); diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java -index 904826ea563bd2eb469f403df459def62cc1b5e6..17df2b09542f67cdd1d83f795d9b2aad9ccd4e05 100644 +index 907d77dd74066c723238155b42028a811365b1f8..69e5b4b6c8d5725bc2fb7cd819219e4ff9df45bd 100644 --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java @@ -120,8 +120,32 @@ public class Warden extends Monster implements VibrationListener.VibrationListen @@ -14704,8 +14671,8 @@ index 904826ea563bd2eb469f403df459def62cc1b5e6..17df2b09542f67cdd1d83f795d9b2aad + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.wardenRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.wardenRidableInWater; + } + + @Override @@ -14818,7 +14785,7 @@ index 5f407535298a31a34cfe114dd863fd6a9b977707..29c7e33fe961020e5a0007287fe9b663 } diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 76a9da8209d557b913c49ccd281bf147b9ac4fa4..aed1d9ccffe471b6c2a1d52d2d3d097f6431318b 100644 +index 5402a084ef5fe0b3cfea897a90cffade1eff5b66..26857b0e5134f56df47115031727e0ad68216bc6 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -139,6 +139,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -14841,8 +14808,8 @@ index 76a9da8209d557b913c49ccd281bf147b9ac4fa4..aed1d9ccffe471b6c2a1d52d2d3d097f + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.villagerRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.villagerRidableInWater; + } + + @Override @@ -14883,8 +14850,8 @@ index 76a9da8209d557b913c49ccd281bf147b9ac4fa4..aed1d9ccffe471b6c2a1d52d2d3d097f + interval *= 2; + } + if (this.level.getGameTime() % interval == 0) { -+ // offset Y for short blocks like dirt_path/farmland -+ this.isLobotomized = !canTravelFrom(new BlockPos(getX(), getY() + 0.0625D, getZ())); ++ // offset Y for short blocks like dirt_path/farmland TODO: check that it works ++ this.isLobotomized = !canTravelFrom(this.getBlockPosBelowThatAffectsMyMovement()); + + if (this.isLobotomized) { + this.notLobotomizedCount = 0; @@ -14985,7 +14952,7 @@ index 76a9da8209d557b913c49ccd281bf147b9ac4fa4..aed1d9ccffe471b6c2a1d52d2d3d097f this.startTrading(player); } -@@ -484,7 +586,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -496,7 +598,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler while (iterator.hasNext()) { MerchantOffer merchantrecipe = (MerchantOffer) iterator.next(); @@ -14994,7 +14961,7 @@ index 76a9da8209d557b913c49ccd281bf147b9ac4fa4..aed1d9ccffe471b6c2a1d52d2d3d097f } } -@@ -734,7 +836,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -746,7 +848,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public boolean canBreed() { @@ -15003,7 +14970,7 @@ index 76a9da8209d557b913c49ccd281bf147b9ac4fa4..aed1d9ccffe471b6c2a1d52d2d3d097f } private boolean hungry() { -@@ -926,6 +1028,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -938,6 +1040,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } public boolean hasFarmSeeds() { @@ -15015,7 +14982,7 @@ index 76a9da8209d557b913c49ccd281bf147b9ac4fa4..aed1d9ccffe471b6c2a1d52d2d3d097f return this.getInventory().hasAnyOf(ImmutableSet.of(Items.WHEAT_SEEDS, Items.POTATO, Items.CARROT, Items.BEETROOT_SEEDS)); } -@@ -974,6 +1081,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -986,6 +1093,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } public void spawnGolemIfNeeded(ServerLevel world, long time, int requiredCount) { @@ -15023,13 +14990,13 @@ index 76a9da8209d557b913c49ccd281bf147b9ac4fa4..aed1d9ccffe471b6c2a1d52d2d3d097f if (this.wantsToSpawnGolem(time)) { AABB axisalignedbb = this.getBoundingBox().inflate(10.0D, 10.0D, 10.0D); List list = world.getEntitiesOfClass(Villager.class, axisalignedbb); -@@ -1047,6 +1155,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -1059,6 +1167,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public void startSleeping(BlockPos pos) { + // Purpur start + if (level.purpurConfig.bedExplodeOnVillagerSleep && this.level.getBlockState(pos).getBlock() instanceof net.minecraft.world.level.block.BedBlock) { -+ this.level.explode(null, DamageSource.explosion(this, null), null, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, (float) this.level.purpurConfig.bedExplosionPower, this.level.purpurConfig.bedExplosionFire, this.level.purpurConfig.bedExplosionEffect); ++ this.level.explode(null, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, (float) this.level.purpurConfig.bedExplosionPower, this.level.purpurConfig.bedExplosionFire, this.level.purpurConfig.bedExplosionEffect); + return; + } + // Purpur end @@ -15050,10 +15017,10 @@ index ac70c2c03241e73943bd517a8c69dd05e0873634..0318663a824d2a9515f867a075d148c3 public static final VillagerProfession FISHERMAN = register("fisherman", PoiTypes.FISHERMAN, SoundEvents.VILLAGER_WORK_FISHERMAN); public static final VillagerProfession FLETCHER = register("fletcher", PoiTypes.FLETCHER, SoundEvents.VILLAGER_WORK_FLETCHER); diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -index e92e6fb4cf97f4d5406b5b5d5786bfa5fb55f536..a2ad029160065baa395cfe20fa40881d8252fcb3 100644 +index c9fb50c33ac15fe72bc77167e4647f30942fdc5d..a6a4d5203cb5f35306f8225e56681bc25e06beed 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -@@ -66,6 +66,43 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -69,6 +69,43 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill this.setDespawnDelay(48000); // CraftBukkit - set default from MobSpawnerTrader } @@ -15064,8 +15031,8 @@ index e92e6fb4cf97f4d5406b5b5d5786bfa5fb55f536..a2ad029160065baa395cfe20fa40881d + } + + @Override -+ public boolean rideableUnderWater() { -+ return level.purpurConfig.wanderingTraderRidableInWater; ++ public boolean dismountsUnderwater() { ++ return level.purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level.purpurConfig.wanderingTraderRidableInWater; + } + + @Override @@ -15097,7 +15064,7 @@ index e92e6fb4cf97f4d5406b5b5d5786bfa5fb55f536..a2ad029160065baa395cfe20fa40881d @Override protected void registerGoals() { this.goalSelector.addGoal(0, new FloatGoal(this)); -@@ -73,7 +110,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -76,7 +113,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill return this.canDrinkPotion && this.level.isNight() && !entityvillagertrader.isInvisible(); // Paper - Add more WanderingTrader API })); this.goalSelector.addGoal(0, new UseItemGoal<>(this, new ItemStack(Items.MILK_BUCKET), SoundEvents.WANDERING_TRADER_REAPPEARED, (entityvillagertrader) -> { @@ -15106,7 +15073,7 @@ index e92e6fb4cf97f4d5406b5b5d5786bfa5fb55f536..a2ad029160065baa395cfe20fa40881d })); this.goalSelector.addGoal(1, new TradeWithPlayerGoal(this)); this.goalSelector.addGoal(1, new AvoidEntityGoal<>(this, Zombie.class, 8.0F, 0.5D, 0.5D)); -@@ -86,6 +123,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -89,6 +126,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill this.goalSelector.addGoal(1, new PanicGoal(this, 0.5D)); this.goalSelector.addGoal(1, new LookAtTradingPlayerGoal(this)); this.goalSelector.addGoal(2, new WanderingTrader.WanderToPositionGoal(this, 2.0D, 0.35D)); @@ -15114,7 +15081,7 @@ index e92e6fb4cf97f4d5406b5b5d5786bfa5fb55f536..a2ad029160065baa395cfe20fa40881d this.goalSelector.addGoal(4, new MoveTowardsRestrictionGoal(this, 0.35D)); this.goalSelector.addGoal(8, new WaterAvoidingRandomStrollGoal(this, 0.35D)); this.goalSelector.addGoal(9, new InteractGoal(this, Player.class, 3.0F, 1.0F)); -@@ -113,9 +151,10 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -116,9 +154,10 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill } if (this.getOffers().isEmpty()) { @@ -15128,10 +15095,10 @@ index e92e6fb4cf97f4d5406b5b5d5786bfa5fb55f536..a2ad029160065baa395cfe20fa40881d this.openTradingScreen(player, this.getDisplayName(), 1); } diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java -index 0ae8e9134a3671cdf2a480cd4dd6598653e261ab..7d34bd0d727eeb0afbc1869b076ee2078a67e4d0 100644 +index ae9f9112ce9bec82e7571f679017f1723d9eb982..6f8f03c868b671ea42b45aea97d823fe0d40373e 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java -@@ -159,7 +159,17 @@ public class WanderingTraderSpawner implements CustomSpawner { +@@ -160,7 +160,17 @@ public class WanderingTraderSpawner implements CustomSpawner { int k = pos.getX() + this.random.nextInt(range * 2) - range; int l = pos.getZ() + this.random.nextInt(range * 2) - range; int i1 = world.getHeight(Heightmap.Types.WORLD_SURFACE, k, l); @@ -15151,10 +15118,10 @@ index 0ae8e9134a3671cdf2a480cd4dd6598653e261ab..7d34bd0d727eeb0afbc1869b076ee207 if (NaturalSpawner.isSpawnPositionOk(SpawnPlacements.Type.ON_GROUND, world, blockposition2, EntityType.WANDERING_TRADER)) { blockposition1 = blockposition2; diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325d5287537 100644 +index 2b02800666b358159c8ecb63208a14855f90657b..f96524c4a5d3c51b1ab6d990b30055ad5d8bfaac 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -183,6 +183,8 @@ public abstract class Player extends LivingEntity { +@@ -186,6 +186,8 @@ public abstract class Player extends LivingEntity { public boolean affectsSpawning = true; public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper end @@ -15163,7 +15130,7 @@ index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325 // CraftBukkit start public boolean fauxSleeping; -@@ -194,6 +196,28 @@ public abstract class Player extends LivingEntity { +@@ -197,6 +199,28 @@ public abstract class Player extends LivingEntity { } // CraftBukkit end @@ -15192,7 +15159,7 @@ index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325 public Player(Level world, BlockPos pos, float yaw, GameProfile gameProfile) { super(EntityType.PLAYER, world); this.lastItemInMainHand = ItemStack.EMPTY; -@@ -238,6 +262,12 @@ public abstract class Player extends LivingEntity { +@@ -241,6 +265,12 @@ public abstract class Player extends LivingEntity { @Override public void tick() { @@ -15205,7 +15172,7 @@ index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325 this.noPhysics = this.isSpectator(); if (this.isSpectator()) { this.onGround = false; -@@ -341,6 +371,16 @@ public abstract class Player extends LivingEntity { +@@ -344,6 +374,16 @@ public abstract class Player extends LivingEntity { this.addEffect(new MobEffectInstance(MobEffects.WATER_BREATHING, 200, 0, false, false, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.TURTLE_HELMET); // CraftBukkit } @@ -15222,7 +15189,7 @@ index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325 } protected ItemCooldowns createItemCooldowns() { -@@ -427,7 +467,7 @@ public abstract class Player extends LivingEntity { +@@ -430,7 +470,7 @@ public abstract class Player extends LivingEntity { @Override public int getPortalWaitTime() { @@ -15231,7 +15198,7 @@ index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325 } @Override -@@ -586,7 +626,7 @@ public abstract class Player extends LivingEntity { +@@ -584,7 +624,7 @@ public abstract class Player extends LivingEntity { for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity) list.get(i); @@ -15240,7 +15207,7 @@ index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325 list1.add(entity); } else if (!entity.isRemoved()) { this.touch(entity); -@@ -1276,7 +1316,7 @@ public abstract class Player extends LivingEntity { +@@ -1275,7 +1315,7 @@ public abstract class Player extends LivingEntity { flag2 = flag2 && !level.paperConfig().entities.behavior.disablePlayerCrits; // Paper flag2 = flag2 && !this.isSprinting(); if (flag2) { @@ -15249,7 +15216,7 @@ index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325 } f += f1; -@@ -1949,9 +1989,18 @@ public abstract class Player extends LivingEntity { +@@ -1944,9 +1984,19 @@ public abstract class Player extends LivingEntity { @Override public int getExperienceReward() { if (!this.level.getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY) && !this.isSpectator()) { @@ -15259,11 +15226,12 @@ index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325 + // Purpur start + int toDrop; + try { -+ scriptEngine.eval("expLevel = " + experienceLevel); -+ scriptEngine.eval("expTotal = " + totalExperience); -+ scriptEngine.eval("exp = " + experienceProgress); -+ toDrop = (int) Math.round((Double) scriptEngine.eval(level.purpurConfig.playerDeathExpDropEquation)); -+ } catch (Exception ignore) { ++ toDrop = Math.round(((Number) scriptEngine.eval("let expLevel = " + experienceLevel + "; " + ++ "let expTotal = " + totalExperience + "; " + ++ "let exp = " + experienceProgress + "; " + ++ level.purpurConfig.playerDeathExpDropEquation)).floatValue()); ++ } catch (javax.script.ScriptException e) { ++ e.printStackTrace(); + toDrop = experienceLevel * 7; + } + return Math.min(toDrop, level.purpurConfig.playerDeathExpDropMax); @@ -15271,19 +15239,19 @@ index 1116116e4ba6c5ecec400cd371b70b9e14efd92b..0c632cd0cb932a4cfaf2288c9d109325 } else { return 0; } -@@ -2027,6 +2076,11 @@ public abstract class Player extends LivingEntity { +@@ -2022,6 +2072,11 @@ public abstract class Player extends LivingEntity { return this.inventory.armor; } + @Override -+ public boolean rideableUnderWater() { -+ return this.level.purpurConfig.playerRidableInWater; ++ public boolean dismountsUnderwater() { ++ return !level.purpurConfig.playerRidableInWater; + } + public boolean setEntityOnShoulder(CompoundTag entityNbt) { if (!this.isPassenger() && this.onGround && !this.isInWater() && !this.isInPowderSnow) { if (this.getShoulderEntityLeft().isEmpty()) { -@@ -2305,7 +2359,7 @@ public abstract class Player extends LivingEntity { +@@ -2305,7 +2360,7 @@ public abstract class Player extends LivingEntity { public ItemStack eat(Level world, ItemStack stack) { this.getFoodData().eat(stack.getItem(), stack); this.awardStat(Stats.ITEM_USED.get(stack.getItem())); @@ -15373,7 +15341,7 @@ index 574ebb3a2fcd0e4e426a8a7ee88d722ed3b9c3f5..842b921799111789b37a34b76644c921 } diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index c56bc341ebb1592af9285d5e044951e7ae2ae0b2..ed6a097aa1319e492ff56974fd259c227995523e 100644 +index 5d6d26cfe8f0ab68a3145214b3fc126ca7a71a66..c6fddfa199e0c42e0556ed1ad380885a17208e37 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -72,6 +72,7 @@ public abstract class AbstractArrow extends Projectile { @@ -15407,10 +15375,10 @@ index c56bc341ebb1592af9285d5e044951e7ae2ae0b2..ed6a097aa1319e492ff56974fd259c22 return this.knockback; } diff --git a/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java b/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java -index 3a4b95288d390e72c0d97671ecc2e2ef2f976de1..4a3ba1f44379290b1e89366fa82c4028d888a260 100644 +index 4daa368881e4fa59a9365d7b3810ae7dc1455fa3..a4041580061b2acd150836a1437df66ebb4a62cb 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java -@@ -17,20 +17,20 @@ public class LargeFireball extends Fireball { +@@ -16,20 +16,20 @@ public class LargeFireball extends Fireball { public LargeFireball(EntityType type, Level world) { super(type, world); @@ -15435,10 +15403,10 @@ index 3a4b95288d390e72c0d97671ecc2e2ef2f976de1..4a3ba1f44379290b1e89366fa82c4028 // CraftBukkit start - fire ExplosionPrimeEvent ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity()); diff --git a/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java b/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java -index 4132c1113f5437a776e5e3c1cb306904775aed88..1a945a32c3d3705a318ebca72a365931a8c001b7 100644 +index c4f4a26e016eea744f587461af80461074d48303..10b109de5abc015b61a896d363ad37a006dff554 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java +++ b/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java -@@ -27,6 +27,12 @@ public class LlamaSpit extends Projectile { +@@ -26,6 +26,12 @@ public class LlamaSpit extends Projectile { this.setPos(owner.getX() - (double) (owner.getBbWidth() + 1.0F) * 0.5D * (double) Mth.sin(owner.yBodyRot * 0.017453292F), owner.getEyeY() - 0.10000000149011612D, owner.getZ() + (double) (owner.getBbWidth() + 1.0F) * 0.5D * (double) Mth.cos(owner.yBodyRot * 0.017453292F)); } @@ -15452,10 +15420,10 @@ index 4132c1113f5437a776e5e3c1cb306904775aed88..1a945a32c3d3705a318ebca72a365931 public void tick() { super.tick(); diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index a000834c4ea8645a2fcd697e6396f797c42c8fa3..7e620e7ea23943a8639a437d7937da2784b59f60 100644 +index e6f87e1e3c99195ed11c81162cb54e7f5750c4ba..220690cbd6552b06626f4edf5c71bed5cf1f12c4 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -303,6 +303,6 @@ public abstract class Projectile extends Entity { +@@ -307,6 +307,6 @@ public abstract class Projectile extends Entity implements TraceableEntity { public boolean mayInteract(Level world, BlockPos pos) { Entity entity = this.getOwner(); @@ -15464,7 +15432,7 @@ index a000834c4ea8645a2fcd697e6396f797c42c8fa3..7e620e7ea23943a8639a437d7937da27 } } diff --git a/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java b/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java -index 00ac1cdc4734cc57f15433c5c6e7a3a545739d33..f1601114647b62b0b10064ed43058cb867740a63 100644 +index b9e4955fecabbad8d6762f3d933ea1402e932d9b..895c501f8579799139239701703078ef060cd481 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java @@ -24,7 +24,7 @@ public class SmallFireball extends Fireball { @@ -15477,16 +15445,16 @@ index 00ac1cdc4734cc57f15433c5c6e7a3a545739d33..f1601114647b62b0b10064ed43058cb8 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java -index a725851060f13e734dbd2fbf8c83c9e1af57a8b7..c7c10c89871a3ee6d21da4bb19407a68759b3ade 100644 +index 6cded52e4627c2b6073fa221fc6d6583f1b2a96d..9a84e8cc1d1b2803a061fe9ef6297c9c4aea34c5 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Snowball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Snowball.java -@@ -54,10 +54,40 @@ public class Snowball extends ThrowableItemProjectile { +@@ -53,10 +53,40 @@ public class Snowball extends ThrowableItemProjectile { protected void onHitEntity(EntityHitResult entityHitResult) { super.onHitEntity(entityHitResult); Entity entity = entityHitResult.getEntity(); - int i = entity instanceof Blaze ? 3 : 0; + int i = entity.level.purpurConfig.snowballDamage >= 0 ? entity.level.purpurConfig.snowballDamage : entity instanceof Blaze ? 3 : 0; // Purpur - entity.hurt(DamageSource.thrown(this, this.getOwner()), (float)i); + entity.hurt(this.damageSources().thrown(this, this.getOwner()), (float)i); } + // Purpur start - borrowed and modified code from ThrownPotion#onHitBlock and ThrownPotion#dowseFire @@ -15523,13 +15491,13 @@ index a725851060f13e734dbd2fbf8c83c9e1af57a8b7..c7c10c89871a3ee6d21da4bb19407a68 protected void onHit(HitResult hitResult) { super.onHit(hitResult); diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java -index f224ebbc0efefddede43d87f0300c014077b9931..26991a8259e99c73ac79368642b1812264216c47 100644 +index 39ab9a283d856ba8d578d1378285758e32a24cf0..f35547c6b5951bc6eb4df74b2a94496fd20d69b5 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownEnderpearl.java -@@ -69,10 +69,11 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { +@@ -68,10 +68,11 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { Bukkit.getPluginManager().callEvent(teleEvent); - if (!teleEvent.isCancelled() && !entityplayer.connection.isDisconnected()) { + if (!teleEvent.isCancelled() && entityplayer.connection.isAcceptingMessages()) { - if (this.random.nextFloat() < 0.05F && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) { + if (this.random.nextFloat() < this.level.purpurConfig.enderPearlEndermiteChance && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) { // Purpur Endermite entityendermite = (Endermite) EntityType.ENDERMITE.create(this.level); @@ -15539,17 +15507,17 @@ index f224ebbc0efefddede43d87f0300c014077b9931..26991a8259e99c73ac79368642b18122 entityendermite.moveTo(entity.getX(), entity.getY(), entity.getZ(), entity.getYRot(), entity.getXRot()); this.level.addFreshEntity(entityendermite, CreatureSpawnEvent.SpawnReason.ENDER_PEARL); } -@@ -85,7 +86,7 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { +@@ -84,7 +85,7 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { entityplayer.connection.teleport(teleEvent.getTo()); entity.resetFallDistance(); CraftEventFactory.entityDamage = this; -- entity.hurt(DamageSource.FALL, 5.0F); -+ entity.hurt(DamageSource.FALL, this.level.purpurConfig.enderPearlDamage); // Purpur +- entity.hurt(this.damageSources().fall(), 5.0F); ++ entity.hurt(this.damageSources().fall(), this.level.purpurConfig.enderPearlDamage); // Purpur CraftEventFactory.entityDamage = null; } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java -index fb6e590e4613f59aaa8278932134aa0ca3d9da8f..8e41faaa9610a31415c7c89c266c22f26f7e0bc6 100644 +index db151bf624095014c99d78b4f6748d2c3792abea..fb10fc5a5aa3b6d6220694041778bfd39ffa1cb8 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java @@ -60,7 +60,7 @@ public class ThrownTrident extends AbstractArrow { @@ -15562,10 +15530,10 @@ index fb6e590e4613f59aaa8278932134aa0ca3d9da8f..8e41faaa9610a31415c7c89c266c22f2 if (!this.level.isClientSide && this.pickup == AbstractArrow.Pickup.ALLOWED) { this.spawnAtLocation(this.getPickupItem(), 0.1F); diff --git a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java -index 9665095240a370983878350aed41badacfb6f261..623b90b263257dd633af330a63e4bb9d4d507493 100644 +index 093a00e52062868b4fbf358b307513d0f599f69d..ba753735f3cbb2cb3d0a491d1bd94a04f83b123d 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java +++ b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java -@@ -94,7 +94,7 @@ public class WitherSkull extends AbstractHurtingProjectile { +@@ -95,7 +95,7 @@ public class WitherSkull extends AbstractHurtingProjectile { if (!this.level.isClientSide) { // CraftBukkit start // this.level.explode(this, this.getX(), this.getY(), this.getZ(), 1.0F, false, World.a.MOB); @@ -15575,7 +15543,7 @@ index 9665095240a370983878350aed41badacfb6f261..623b90b263257dd633af330a63e4bb9d if (!event.isCancelled()) { diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java -index e5ccbaf72f29731f1d1aa939b9297b644a408cd4..6c77c67dc6a378b87cd73c6c55b6d41d1542f6f3 100644 +index 99e9d46d42ddd0b451c6aeb847f1b295ebe5c697..f7b03dc1d5316aeb760a52d6f6c50e8aae5f978e 100644 --- a/src/main/java/net/minecraft/world/entity/raid/Raider.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java @@ -319,7 +319,7 @@ public abstract class Raider extends PatrollingMonster { @@ -15588,7 +15556,7 @@ index e5ccbaf72f29731f1d1aa939b9297b644a408cd4..6c77c67dc6a378b87cd73c6c55b6d41d if (this.mob.hasActiveRaid() && !this.mob.getCurrentRaid().isOver() && this.mob.canBeLeader() && !ItemStack.matches(this.mob.getItemBySlot(EquipmentSlot.HEAD), Raid.getLeaderBannerInstance())) { diff --git a/src/main/java/net/minecraft/world/entity/raid/Raids.java b/src/main/java/net/minecraft/world/entity/raid/Raids.java -index feb89eb69994bdd1d2f95d2b9992e69251b2bee7..0670775c2de33e69c75644e5d2ff19db08444040 100644 +index fabce3bc592b1b172b227395a07febdbb66ec3c9..df48bcc8f329e3855bb7426bdfe0e3c72af53bea 100644 --- a/src/main/java/net/minecraft/world/entity/raid/Raids.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raids.java @@ -28,6 +28,7 @@ import net.minecraft.world.phys.Vec3; @@ -15632,7 +15600,7 @@ index feb89eb69994bdd1d2f95d2b9992e69251b2bee7..0670775c2de33e69c75644e5d2ff19db if (!this.raidMap.containsKey(raid.getId())) { this.raidMap.put(raid.getId(), raid); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -index eec7d7a5b558830111831792c42665724613af23..36da85fe7ba6c6931e96bf4cf77cbe5f079299af 100644 +index 9a80cf593bbdd7681bc9395daf4545a98e07636f..cd8239423d964ef9b708d283a329986cb02404e5 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java @@ -106,11 +106,13 @@ public abstract class AbstractMinecart extends Entity { @@ -15736,7 +15704,7 @@ index eec7d7a5b558830111831792c42665724613af23..36da85fe7ba6c6931e96bf4cf77cbe5f Vec3 vec3d5 = this.getDeltaMovement(); double d21 = vec3d5.x; diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java -index 85e1892866cd2ee0cec1552b8541c1f800bdf68c..231c71939982ba4ce9305bc8eb6174ed45102c9f 100644 +index 5095e47b4910167235afdd8f1a7e9c45124ecadb..33de7cca8063618466fe47417e700a5b15c8dc70 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java @@ -222,7 +222,13 @@ public class Boat extends Entity implements VariantHolder { @@ -15754,7 +15722,7 @@ index 85e1892866cd2ee0cec1552b8541c1f800bdf68c..231c71939982ba4ce9305bc8eb6174ed } @Override -@@ -537,6 +543,7 @@ public class Boat extends Entity implements VariantHolder { +@@ -540,6 +546,7 @@ public class Boat extends Entity implements VariantHolder { if (f > 0.0F) { this.landFriction = f; @@ -15763,10 +15731,10 @@ index 85e1892866cd2ee0cec1552b8541c1f800bdf68c..231c71939982ba4ce9305bc8eb6174ed } else { return Boat.Status.IN_AIR; diff --git a/src/main/java/net/minecraft/world/food/FoodData.java b/src/main/java/net/minecraft/world/food/FoodData.java -index 2934b6de1f1fb914a532ee20184df99d1acd8e65..0e753dd68d9506a2a4e5ad74e7f4d04cd4d00494 100644 +index 4a2dcf9bd83dd3fdff43483f887f4f58dc4715cd..3d2e3c7dd3bf5c8f483a933e9f6868586c0d3911 100644 --- a/src/main/java/net/minecraft/world/food/FoodData.java +++ b/src/main/java/net/minecraft/world/food/FoodData.java -@@ -34,8 +34,10 @@ public class FoodData { +@@ -33,8 +33,10 @@ public class FoodData { // CraftBukkit end public void eat(int food, float saturationModifier) { @@ -15777,12 +15745,12 @@ index 2934b6de1f1fb914a532ee20184df99d1acd8e65..0e753dd68d9506a2a4e5ad74e7f4d04c } public void eat(Item item, ItemStack stack) { -@@ -101,7 +103,7 @@ public class FoodData { +@@ -100,7 +102,7 @@ public class FoodData { ++this.tickTimer; if (this.tickTimer >= this.starvationRate) { // CraftBukkit - add regen rate manipulation if (player.getHealth() > 10.0F || enumdifficulty == Difficulty.HARD || player.getHealth() > 1.0F && enumdifficulty == Difficulty.NORMAL) { -- player.hurt(DamageSource.STARVE, 1.0F); -+ player.hurt(DamageSource.STARVE, player.level.purpurConfig.hungerStarvationDamage); // Purpur +- player.hurt(player.damageSources().starve(), 1.0F); ++ player.hurt(player.damageSources().starve(), player.level.purpurConfig.hungerStarvationDamage); // Purpur } this.tickTimer = 0; @@ -15833,7 +15801,7 @@ index b16d9e2eaa589f19c563ee70b1a56d67dbcdecb0..71beab673f04cd051c46ea37f8c84731 public static final FoodProperties BAKED_POTATO = (new FoodProperties.Builder()).nutrition(5).saturationMod(0.6F).build(); public static final FoodProperties BEEF = (new FoodProperties.Builder()).nutrition(3).saturationMod(0.3F).meat().build(); diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 143977055717c2fe27df76231da304e2863b8f1f..cbec8dbc06dfc05150c345246bfd63c8001071d0 100644 +index c84908095a93d42826b21bf5f3490410fb0a5708..20b328704981c088597359fe18c1d67c339c1c0f 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -76,6 +76,7 @@ public abstract class AbstractContainerMenu { @@ -15845,7 +15813,7 @@ index 143977055717c2fe27df76231da304e2863b8f1f..cbec8dbc06dfc05150c345246bfd63c8 // CraftBukkit start public boolean checkReachable = true; diff --git a/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java -index fa0d55946680f1a913493d8a36abe266ace8be52..d662d362d36356a44dd672c25997837a8a66096e 100644 +index 8ae78ae54d87ea7789df754311fa0e8aade0ce91..35479019fb846573f4e2eb5902f3ebe898c4d61f 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java @@ -145,7 +145,13 @@ public abstract class AbstractFurnaceMenu extends RecipeBookMenu { @@ -15864,7 +15832,7 @@ index fa0d55946680f1a913493d8a36abe266ace8be52..d662d362d36356a44dd672c25997837a } else if (this.isFuel(itemstack1)) { if (!this.moveItemStackTo(itemstack1, 1, 2, false)) { diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9a358bf83 100644 +index b7a2295290227045e6426ee0f71707185d95b943..7ade5cd93b3d7b7259bf3246a8b74b0b31407817 100644 --- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java @@ -21,6 +21,13 @@ import org.slf4j.Logger; @@ -15880,8 +15848,8 @@ index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9 + public class AnvilMenu extends ItemCombinerMenu { - private static final Logger LOGGER = LogUtils.getLogger(); -@@ -41,6 +48,8 @@ public class AnvilMenu extends ItemCombinerMenu { + public static final int INPUT_SLOT = 0; +@@ -48,6 +55,8 @@ public class AnvilMenu extends ItemCombinerMenu { public int maximumRepairCost = 40; private CraftInventoryView bukkitEntity; // CraftBukkit end @@ -15890,7 +15858,7 @@ index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9 public AnvilMenu(int syncId, Inventory inventory) { this(syncId, inventory, ContainerLevelAccess.NULL); -@@ -59,12 +68,15 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -75,12 +84,15 @@ public class AnvilMenu extends ItemCombinerMenu { @Override protected boolean mayPickup(Player player, boolean present) { @@ -15907,7 +15875,7 @@ index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9 player.giveExperienceLevels(-this.cost.get()); } -@@ -115,6 +127,12 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -131,6 +143,12 @@ public class AnvilMenu extends ItemCombinerMenu { @Override public void createResult() { @@ -15920,7 +15888,7 @@ index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9 ItemStack itemstack = this.inputSlots.getItem(0); this.cost.set(1); -@@ -191,7 +209,8 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -207,7 +225,8 @@ public class AnvilMenu extends ItemCombinerMenu { int i2 = (Integer) map1.get(enchantment); i2 = l1 == i2 ? i2 + 1 : Math.max(i2, l1); @@ -15930,7 +15898,7 @@ index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9 if (this.player.getAbilities().instabuild || itemstack.is(Items.ENCHANTED_BOOK)) { flag3 = true; -@@ -203,16 +222,16 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -219,16 +238,16 @@ public class AnvilMenu extends ItemCombinerMenu { Enchantment enchantment1 = (Enchantment) iterator1.next(); if (enchantment1 != enchantment && !enchantment.isCompatibleWith(enchantment1)) { @@ -15950,7 +15918,7 @@ index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9 i2 = enchantment.getMaxLevel(); } -@@ -262,6 +281,54 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -278,6 +297,54 @@ public class AnvilMenu extends ItemCombinerMenu { } else if (!this.itemName.equals(itemstack.getHoverName().getString())) { b1 = 1; i += b1; @@ -16005,7 +15973,7 @@ index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9 itemstack1.setHoverName(Component.literal(this.itemName)); } -@@ -274,6 +341,13 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -290,6 +357,13 @@ public class AnvilMenu extends ItemCombinerMenu { this.cost.set(this.maximumRepairCost - 1); // CraftBukkit } @@ -16019,7 +15987,7 @@ index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9 if (this.cost.get() >= this.maximumRepairCost && !this.player.getAbilities().instabuild) { // CraftBukkit itemstack1 = ItemStack.EMPTY; } -@@ -296,11 +370,17 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -312,11 +386,17 @@ public class AnvilMenu extends ItemCombinerMenu { org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), itemstack1); // CraftBukkit sendAllDataToRemote(); // CraftBukkit - SPIGOT-6686: Always send completed inventory to stay in sync with client this.broadcastChanges(); @@ -16039,7 +16007,7 @@ index 506d758efbf16da9467f120321d2359a8832e477..05a8a295fe7970255c07efad8b4ab7e9 public void setItemName(String newItemName) { diff --git a/src/main/java/net/minecraft/world/inventory/ChestMenu.java b/src/main/java/net/minecraft/world/inventory/ChestMenu.java -index 82331715e91c6e9a13c0626164368ae16e754126..15d115917e2c9f7d5669cabe2721df9fcdb4ec7b 100644 +index 0dbfd23bbfc6ad203f048142f8c90ef741849fe1..9a80427d2bb470b6b1638e59aba57216676dcbd2 100644 --- a/src/main/java/net/minecraft/world/inventory/ChestMenu.java +++ b/src/main/java/net/minecraft/world/inventory/ChestMenu.java @@ -67,10 +67,30 @@ public class ChestMenu extends AbstractContainerMenu { @@ -16074,7 +16042,7 @@ index 82331715e91c6e9a13c0626164368ae16e754126..15d115917e2c9f7d5669cabe2721df9f return new ChestMenu(MenuType.GENERIC_9x6, syncId, playerInventory, inventory, 6); } diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java -index 0d464958c63d4bb460bb65cfa5c227b21101a069..02f5dd214cdb59685cb4129bf143904d4cb83011 100644 +index c2fc00509bf3690d359928e8d352d4b3c2ca1491..69ae671be07b1928e778399551991777829e432a 100644 --- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java +++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java @@ -38,6 +38,12 @@ import org.bukkit.event.enchantment.PrepareItemEnchantEvent; @@ -16140,7 +16108,7 @@ index 0d464958c63d4bb460bb65cfa5c227b21101a069..02f5dd214cdb59685cb4129bf143904d }); } diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 233e8626280a8b93dcb8621a1405e8c308c6836b..e74114fed79810e13319a70006e28aa56fd93f18 100644 +index 89838076f3231ff4318ebb2718c9406399b4e4f5..d41987060c2261f1a345752ecc46af1ec23b83ea 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -95,9 +95,11 @@ public class GrindstoneMenu extends AbstractContainerMenu { @@ -16215,7 +16183,7 @@ index 233e8626280a8b93dcb8621a1405e8c308c6836b..e74114fed79810e13319a70006e28aa5 return itemstack; diff --git a/src/main/java/net/minecraft/world/inventory/InventoryMenu.java b/src/main/java/net/minecraft/world/inventory/InventoryMenu.java -index 150701f965006f1c7dc9d801ca0ab0add927d143..4b8669f0b881e524c0cbf570c442ca8a1044d68e 100644 +index da0f5c5e6ca7ce7b38792e6da52c5cdcdbae3b78..4136bcd49fe05d916ab65de0e866145185db4204 100644 --- a/src/main/java/net/minecraft/world/inventory/InventoryMenu.java +++ b/src/main/java/net/minecraft/world/inventory/InventoryMenu.java @@ -4,6 +4,7 @@ import com.mojang.datafixers.util.Pair; @@ -16226,7 +16194,7 @@ index 150701f965006f1c7dc9d801ca0ab0add927d143..4b8669f0b881e524c0cbf570c442ca8a import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.player.Inventory; -@@ -96,7 +97,7 @@ public class InventoryMenu extends RecipeBookMenu { +@@ -95,7 +96,7 @@ public class InventoryMenu extends RecipeBookMenu { public boolean mayPickup(Player playerEntity) { ItemStack itemstack = this.getItem(); @@ -16236,10 +16204,10 @@ index 150701f965006f1c7dc9d801ca0ab0add927d143..4b8669f0b881e524c0cbf570c442ca8a @Override diff --git a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java -index c34a66310969c3c837d09693159b827c1edddd3b..25885eb3b7312bd317fc519ad420109ff6531c7d 100644 +index ff770b9ce68a62418de0c7ed389650626fa1dcb2..102739c0089ff3f6b3432f954304d43a3dfebc35 100644 --- a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java -@@ -140,7 +140,9 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu { +@@ -177,7 +177,9 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu { return ItemStack.EMPTY; } @@ -16274,10 +16242,10 @@ index 59acb1aab21e2dce0f046942f124b50ac1cb8d0f..5058b30994fe38d8db2336267121476e this.activeChest = blockEntity; } diff --git a/src/main/java/net/minecraft/world/item/ArmorItem.java b/src/main/java/net/minecraft/world/item/ArmorItem.java -index 9c8604376228c02f8bbd9a15673fbdf5097e7cb2..26ed7bc8bc76b81b3cb47784de158febb5719a81 100644 +index d7a0cbde8f8c99276307502674c71463fbe7e89c..3500c56cb85d8c76b2acd77976d374eaf487b3b3 100644 --- a/src/main/java/net/minecraft/world/item/ArmorItem.java +++ b/src/main/java/net/minecraft/world/item/ArmorItem.java -@@ -55,7 +55,7 @@ public class ArmorItem extends Item implements Wearable { +@@ -60,7 +60,7 @@ public class ArmorItem extends Item implements Equipable { return false; } else { LivingEntity entityliving = (LivingEntity) list.get(0); @@ -16286,27 +16254,11 @@ index 9c8604376228c02f8bbd9a15673fbdf5097e7cb2..26ed7bc8bc76b81b3cb47784de158feb ItemStack itemstack1 = armor.copyWithCount(1); // Paper - shrink below and single item in event // CraftBukkit start Level world = pointer.getLevel(); -@@ -147,7 +147,14 @@ public class ArmorItem extends Item implements Wearable { - } - - itemstack.setCount(0); -- return InteractionResultHolder.sidedSuccess(itemstack, world.isClientSide()); -+ // Purpur start -+ return InteractionResultHolder.success(world.purpurConfig.playerArmorSwappingCreativeMakesCopy ? itemstack : ItemStack.EMPTY); -+ } else if (world.purpurConfig.playerArmorSwapping && !net.minecraft.world.item.enchantment.EnchantmentHelper.hasBindingCurse(itemstack1)) { -+ user.setItemSlot(enumitemslot, itemstack); -+ user.awardStat(Stats.ITEM_USED.get(this)); -+ user.level.playSound(null, user.getX(), user.getY(), user.getZ(), itemstack.getEquipSound(), net.minecraft.sounds.SoundSource.BLOCKS, 1.0F, 1.0F); // we have to force the sound, for whatever reason -+ return InteractionResultHolder.success(itemstack1); -+ // Purpur end - } else { - return InteractionResultHolder.fail(itemstack); - } diff --git a/src/main/java/net/minecraft/world/item/ArmorStandItem.java b/src/main/java/net/minecraft/world/item/ArmorStandItem.java -index 07850a88f3b8f834669394b733b9dca3968dfabc..d21a6d62d1d8b7c208e72acafc42f975012f7107 100644 +index 7cffc64573008502bdd14ae4906fe51166b12fb3..1feafdbb48cf760cb6ebf95d5be2c32bdb1ad44f 100644 --- a/src/main/java/net/minecraft/world/item/ArmorStandItem.java +++ b/src/main/java/net/minecraft/world/item/ArmorStandItem.java -@@ -62,6 +62,14 @@ public class ArmorStandItem extends Item { +@@ -58,6 +58,14 @@ public class ArmorStandItem extends Item { return InteractionResult.FAIL; } // CraftBukkit end @@ -16322,7 +16274,7 @@ index 07850a88f3b8f834669394b733b9dca3968dfabc..d21a6d62d1d8b7c208e72acafc42f975 world.playSound((Player) null, entityarmorstand.getX(), entityarmorstand.getY(), entityarmorstand.getZ(), SoundEvents.ARMOR_STAND_PLACE, SoundSource.BLOCKS, 0.75F, 0.8F); entityarmorstand.gameEvent(GameEvent.ENTITY_PLACE, context.getPlayer()); diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java -index 1c096338a90d740a3813274278056017fa1ec844..1075e9e60e3243134483429b40bad8c89705fc9b 100644 +index 9c7d0b9cc2fa98d5785c914c0183f7d4b5b1c1ea..89a4ab17ca8d2aa1f52b041c610d7de19bf55e66 100644 --- a/src/main/java/net/minecraft/world/item/AxeItem.java +++ b/src/main/java/net/minecraft/world/item/AxeItem.java @@ -33,29 +33,32 @@ public class AxeItem extends DiggerItem { @@ -16515,10 +16467,10 @@ index 5c6aa9c464784ad5ee366412d080c72d3d22a76f..c03abc9589bf5f37abc1b0d355ed9784 return true; diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java -index caa5f5f5d58b8ddbca0910412b695cb810570623..c4942deb963064c61d4ab95c27ed341a6648dcc8 100644 +index bc4f04c2512191da3c9e1c49f0716bb9128fc754..310e03d8cc07f95927d9806fc80a4215283d2ef5 100644 --- a/src/main/java/net/minecraft/world/item/CrossbowItem.java +++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java -@@ -63,7 +63,7 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { +@@ -64,7 +64,7 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { ItemStack itemstack = user.getItemInHand(hand); if (CrossbowItem.isCharged(itemstack)) { @@ -16527,7 +16479,7 @@ index caa5f5f5d58b8ddbca0910412b695cb810570623..c4942deb963064c61d4ab95c27ed341a CrossbowItem.setCharged(itemstack, false); return InteractionResultHolder.consume(itemstack); } else if (!user.getProjectile(itemstack).isEmpty()) { -@@ -112,7 +112,7 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { +@@ -113,7 +113,7 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { // Paper end int i = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.MULTISHOT, projectile); int j = i == 0 ? 1 : 3; @@ -16536,7 +16488,7 @@ index caa5f5f5d58b8ddbca0910412b695cb810570623..c4942deb963064c61d4ab95c27ed341a ItemStack itemstack1 = shooter.getProjectile(projectile); ItemStack itemstack2 = itemstack1.copy(); -@@ -293,6 +293,14 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { +@@ -294,6 +294,14 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { entityarrow.setPierceLevel((byte) i); } @@ -16551,7 +16503,7 @@ index caa5f5f5d58b8ddbca0910412b695cb810570623..c4942deb963064c61d4ab95c27ed341a return entityarrow; } -@@ -302,7 +310,7 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { +@@ -303,7 +311,7 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { for (int i = 0; i < list.size(); ++i) { ItemStack itemstack1 = (ItemStack) list.get(i); @@ -16588,26 +16540,6 @@ index 58cb992c5defec2f092755cbde661ff10f38bf9d..52f48681407d23f0925f4c9c072d5f0a // Paper start com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) user.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) entityegg.getBukkitEntity()); if (event.callEvent() && world.addFreshEntity(entityegg)) { -diff --git a/src/main/java/net/minecraft/world/item/ElytraItem.java b/src/main/java/net/minecraft/world/item/ElytraItem.java -index 42f79d418ec4e2dbeac9a217d9dc144cda2ef714..250c0e31825f772d3fee7a523f150cb25e8ae558 100644 ---- a/src/main/java/net/minecraft/world/item/ElytraItem.java -+++ b/src/main/java/net/minecraft/world/item/ElytraItem.java -@@ -39,7 +39,14 @@ public class ElytraItem extends Item implements Wearable { - } - - itemStack.setCount(0); -- return InteractionResultHolder.sidedSuccess(itemStack, world.isClientSide()); -+ // Purpur start -+ return InteractionResultHolder.success(world.purpurConfig.playerArmorSwappingCreativeMakesCopy ? itemStack : ItemStack.EMPTY); -+ } else if (world.purpurConfig.playerArmorSwapping) { -+ user.setItemSlot(equipmentSlot, itemStack); -+ user.awardStat(Stats.ITEM_USED.get(this)); -+ user.level.playSound(null, user.getX(), user.getY(), user.getZ(), itemStack.getEquipSound(), net.minecraft.sounds.SoundSource.BLOCKS, 1.0F, 1.0F); // we have to force the sound, for whatever reason -+ return InteractionResultHolder.success(itemStack2); -+ // Purpur end - } else { - return InteractionResultHolder.fail(itemStack); - } diff --git a/src/main/java/net/minecraft/world/item/EnderpearlItem.java b/src/main/java/net/minecraft/world/item/EnderpearlItem.java index 749ab72edc0d2e9c6f1161415ab8d59d3d6ca976..6b27d98d06b163243bb0e1bb979aad03f48d7770 100644 --- a/src/main/java/net/minecraft/world/item/EnderpearlItem.java @@ -16631,10 +16563,10 @@ index 749ab72edc0d2e9c6f1161415ab8d59d3d6ca976..6b27d98d06b163243bb0e1bb979aad03 // Paper end if (user instanceof net.minecraft.server.level.ServerPlayer) { diff --git a/src/main/java/net/minecraft/world/item/FireworkRocketItem.java b/src/main/java/net/minecraft/world/item/FireworkRocketItem.java -index 783791cf501d6ed3975aa82b958d7437158909ba..eb093b151e2d04476e38e3e0666888236c1ab057 100644 +index 82b0bda3e35ec2157a477e1a17b2b46baadc97d9..0fc45b1048a1c4e0dc2bd1ae0437eecbe113cf96 100644 --- a/src/main/java/net/minecraft/world/item/FireworkRocketItem.java +++ b/src/main/java/net/minecraft/world/item/FireworkRocketItem.java -@@ -14,6 +14,7 @@ import net.minecraft.util.ByIdMap; +@@ -15,6 +15,7 @@ import net.minecraft.util.ByIdMap; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; @@ -16642,7 +16574,7 @@ index 783791cf501d6ed3975aa82b958d7437158909ba..eb093b151e2d04476e38e3e066688823 import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.projectile.FireworkRocketEntity; import net.minecraft.world.item.context.UseOnContext; -@@ -68,6 +69,14 @@ public class FireworkRocketItem extends Item { +@@ -69,6 +70,14 @@ public class FireworkRocketItem extends Item { com.destroystokyo.paper.event.player.PlayerElytraBoostEvent event = new com.destroystokyo.paper.event.player.PlayerElytraBoostEvent((org.bukkit.entity.Player) user.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), (org.bukkit.entity.Firework) fireworkRocketEntity.getBukkitEntity()); if (event.callEvent() && world.addFreshEntity(fireworkRocketEntity)) { user.awardStat(Stats.ITEM_USED.get(this)); @@ -16658,10 +16590,10 @@ index 783791cf501d6ed3975aa82b958d7437158909ba..eb093b151e2d04476e38e3e066688823 itemStack.shrink(1); } else ((net.minecraft.server.level.ServerPlayer) user).getBukkitEntity().updateInventory(); diff --git a/src/main/java/net/minecraft/world/item/HangingEntityItem.java b/src/main/java/net/minecraft/world/item/HangingEntityItem.java -index 489558eb0126e7a41e2e379e352bddc034375b61..062152b258224f28e07f96d6135bbb7a9f8a3f9a 100644 +index b2ad6d230de2c29f371178bccde1111c7532ee70..6667926519a0f1c151e53f59cce36e7417dfc1cd 100644 --- a/src/main/java/net/minecraft/world/item/HangingEntityItem.java +++ b/src/main/java/net/minecraft/world/item/HangingEntityItem.java -@@ -41,7 +41,7 @@ public class HangingEntityItem extends Item { +@@ -48,7 +48,7 @@ public class HangingEntityItem extends Item { return InteractionResult.FAIL; } else { Level world = context.getLevel(); @@ -16670,7 +16602,7 @@ index 489558eb0126e7a41e2e379e352bddc034375b61..062152b258224f28e07f96d6135bbb7a if (this.type == EntityType.PAINTING) { Optional optional = Painting.create(world, blockposition1, enumdirection); -@@ -65,6 +65,11 @@ public class HangingEntityItem extends Item { +@@ -72,6 +72,11 @@ public class HangingEntityItem extends Item { if (nbttagcompound != null) { EntityType.updateCustomEntityTag(world, entityhuman, (Entity) object, nbttagcompound); @@ -16727,10 +16659,10 @@ index 180aec596110309aade13d2080f8824d152b07cb..c4aec1e5135a79837918b692e75a7b55 return InteractionResult.PASS; } diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 31eed67d07097c7eb1b06547a9f556bcc709d96c..e2b341ecddb946e9c1e546b9706d86dd030db865 100644 +index a6253272205337b3b855679b3057c2519a807a4c..234d992206f34febc7aff24b78cb3e526254e35f 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -108,6 +108,7 @@ import org.bukkit.event.world.StructureGrowEvent; +@@ -109,6 +109,7 @@ import org.bukkit.event.world.StructureGrowEvent; public final class ItemStack { @@ -16738,7 +16670,7 @@ index 31eed67d07097c7eb1b06547a9f556bcc709d96c..e2b341ecddb946e9c1e546b9706d86dd public static final Codec CODEC = RecordCodecBuilder.create((instance) -> { return instance.group(BuiltInRegistries.ITEM.byNameCodec().fieldOf("id").forGetter((itemstack) -> { return itemstack.item; -@@ -413,6 +414,7 @@ public final class ItemStack { +@@ -414,6 +415,7 @@ public final class ItemStack { world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710 for (BlockState blockstate : blocks) { blockstate.update(true, false); @@ -16746,7 +16678,7 @@ index 31eed67d07097c7eb1b06547a9f556bcc709d96c..e2b341ecddb946e9c1e546b9706d86dd } world.preventPoiUpdated = false; -@@ -442,6 +444,7 @@ public final class ItemStack { +@@ -443,6 +445,7 @@ public final class ItemStack { if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically block.getBlock().onPlace(block, world, newblockposition, oldBlock, true, itemactioncontext); // Paper - pass itemactioncontext } @@ -16754,7 +16686,7 @@ index 31eed67d07097c7eb1b06547a9f556bcc709d96c..e2b341ecddb946e9c1e546b9706d86dd world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point } -@@ -544,6 +547,16 @@ public final class ItemStack { +@@ -558,6 +561,16 @@ public final class ItemStack { return this.isDamageableItem() && this.getDamageValue() > 0; } @@ -16771,7 +16703,7 @@ index 31eed67d07097c7eb1b06547a9f556bcc709d96c..e2b341ecddb946e9c1e546b9706d86dd public int getDamageValue() { return this.tag == null ? 0 : this.tag.getInt("Damage"); } -@@ -563,7 +576,7 @@ public final class ItemStack { +@@ -577,7 +590,7 @@ public final class ItemStack { int j; if (amount > 0) { @@ -16780,7 +16712,7 @@ index 31eed67d07097c7eb1b06547a9f556bcc709d96c..e2b341ecddb946e9c1e546b9706d86dd int k = 0; for (int l = 0; j > 0 && l < amount; ++l) { -@@ -618,6 +631,12 @@ public final class ItemStack { +@@ -632,6 +645,12 @@ public final class ItemStack { if (this.hurt(amount, entity.getRandom(), entity /*instanceof ServerPlayer ? (ServerPlayer) entity : null*/)) { // Paper - pass LivingEntity for EntityItemDamageEvent breakCallback.accept(entity); Item item = this.getItem(); @@ -16793,7 +16725,7 @@ index 31eed67d07097c7eb1b06547a9f556bcc709d96c..e2b341ecddb946e9c1e546b9706d86dd // CraftBukkit start - Check for item breaking if (this.count == 1 && entity instanceof net.minecraft.world.entity.player.Player) { org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent((net.minecraft.world.entity.player.Player) entity, this); -@@ -1141,7 +1160,7 @@ public final class ItemStack { +@@ -1164,7 +1183,7 @@ public final class ItemStack { ListTag nbttaglist = this.tag.getList("Enchantments", 10); @@ -16802,7 +16734,7 @@ index 31eed67d07097c7eb1b06547a9f556bcc709d96c..e2b341ecddb946e9c1e546b9706d86dd processEnchantOrder(this.tag); // Paper } -@@ -1149,6 +1168,12 @@ public final class ItemStack { +@@ -1172,6 +1191,12 @@ public final class ItemStack { return this.tag != null && this.tag.contains("Enchantments", 9) ? !this.tag.getList("Enchantments", 10).isEmpty() : false; } @@ -16816,10 +16748,10 @@ index 31eed67d07097c7eb1b06547a9f556bcc709d96c..e2b341ecddb946e9c1e546b9706d86dd this.getOrCreateTag().put(key, element); } diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java -index 21b74b3473553162c0113b2d365605782080cdfc..803bb632c2fb525b32e9bddc01f1c9112ee0bfba 100644 +index 775823daa5187804d27e5ee696cd75f703bb067c..bc0915913d3d8fbe145ee7e19133c7de922e0c80 100644 --- a/src/main/java/net/minecraft/world/item/Items.java +++ b/src/main/java/net/minecraft/world/item/Items.java -@@ -280,7 +280,7 @@ public class Items { +@@ -292,7 +292,7 @@ public class Items { public static final Item PURPUR_BLOCK = registerBlock(Blocks.PURPUR_BLOCK); public static final Item PURPUR_PILLAR = registerBlock(Blocks.PURPUR_PILLAR); public static final Item PURPUR_STAIRS = registerBlock(Blocks.PURPUR_STAIRS); @@ -16828,7 +16760,7 @@ index 21b74b3473553162c0113b2d365605782080cdfc..803bb632c2fb525b32e9bddc01f1c911 public static final Item CHEST = registerBlock(Blocks.CHEST); public static final Item CRAFTING_TABLE = registerBlock(Blocks.CRAFTING_TABLE); public static final Item FARMLAND = registerBlock(Blocks.FARMLAND); -@@ -1153,7 +1153,7 @@ public class Items { +@@ -1178,7 +1178,7 @@ public class Items { public static final Item LANTERN = registerBlock(Blocks.LANTERN); public static final Item SOUL_LANTERN = registerBlock(Blocks.SOUL_LANTERN); public static final Item SWEET_BERRIES = registerItem("sweet_berries", new ItemNameBlockItem(Blocks.SWEET_BERRY_BUSH, (new Item.Properties()).food(Foods.SWEET_BERRIES))); @@ -16837,7 +16769,7 @@ index 21b74b3473553162c0113b2d365605782080cdfc..803bb632c2fb525b32e9bddc01f1c911 public static final Item CAMPFIRE = registerBlock(Blocks.CAMPFIRE); public static final Item SOUL_CAMPFIRE = registerBlock(Blocks.SOUL_CAMPFIRE); public static final Item SHROOMLIGHT = registerBlock(Blocks.SHROOMLIGHT); -@@ -1236,6 +1236,13 @@ public class Items { +@@ -1278,6 +1278,13 @@ public class Items { ((BlockItem)item).registerBlocks(Item.BY_BLOCK, item); } @@ -17062,7 +16994,7 @@ index 8d4aca59bd7518179520f4d4fb7137778e232d90..e24034d1ce4bb529de084aab69a53122 this.stackingIds.sort(IntComparators.NATURAL_COMPARATOR); diff --git a/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java b/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java -index 3aece8245060dd1ba269c08d226c84247a6f0a83..38703baaef5f04a53081620ce1bf29b45e4d62d1 100644 +index 518d85a13c37a2f7d32ca0718323181048559986..27512787b37381a5236b1b473e9ce3f06df8e2d0 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java +++ b/src/main/java/net/minecraft/world/item/enchantment/ArrowInfiniteEnchantment.java @@ -7,6 +7,14 @@ public class ArrowInfiniteEnchantment extends Enchantment { @@ -17080,7 +17012,7 @@ index 3aece8245060dd1ba269c08d226c84247a6f0a83..38703baaef5f04a53081620ce1bf29b4 @Override public int getMinCost(int level) { return 20; -@@ -24,6 +32,6 @@ public class ArrowInfiniteEnchantment extends Enchantment { +@@ -19,6 +27,6 @@ public class ArrowInfiniteEnchantment extends Enchantment { @Override public boolean checkCompatibility(Enchantment other) { @@ -17089,10 +17021,10 @@ index 3aece8245060dd1ba269c08d226c84247a6f0a83..38703baaef5f04a53081620ce1bf29b4 } } diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentCategory.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentCategory.java -index 6f6106ca4d74d50a7b74b086adc96c58c7906cb6..a19dd0946f853193ff32b2b560db27534b8b4abf 100644 +index 246516e67db0b8b197b287c067d5a0163d8bde22..fc2c35f57436371cb0111aedfd289ac95d506d07 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentCategory.java +++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentCategory.java -@@ -97,6 +97,20 @@ public enum EnchantmentCategory { +@@ -121,6 +121,20 @@ public enum EnchantmentCategory { public boolean canEnchant(Item item) { return item instanceof Vanishable || Block.byItem(item) instanceof Vanishable || BREAKABLE.canEnchant(item); } @@ -17114,7 +17046,7 @@ index 6f6106ca4d74d50a7b74b086adc96c58c7906cb6..a19dd0946f853193ff32b2b560db2753 public abstract boolean canEnchant(Item item); diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java -index 064783822333d11120daa28f3be5099e10510b72..b96b1e4efa35b796a985bf1eb4a7158c1706a34c 100644 +index ecf640b00007a386290f8dfe9935a8aa610079fd..1eec84e217f6dc929091fa7451cd235ef3623822 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java +++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java @@ -46,7 +46,7 @@ public class EnchantmentHelper { @@ -17126,7 +17058,7 @@ index 064783822333d11120daa28f3be5099e10510b72..b96b1e4efa35b796a985bf1eb4a7158c } @Nullable -@@ -274,6 +274,29 @@ public class EnchantmentHelper { +@@ -278,6 +278,29 @@ public class EnchantmentHelper { return getItemEnchantmentLevel(Enchantments.CHANNELING, stack) > 0; } @@ -17157,11 +17089,11 @@ index 064783822333d11120daa28f3be5099e10510b72..b96b1e4efa35b796a985bf1eb4a7158c public static Map.Entry getRandomItemWith(Enchantment enchantment, LivingEntity entity) { return getRandomItemWith(enchantment, entity, (stack) -> { diff --git a/src/main/java/net/minecraft/world/item/enchantment/LootBonusEnchantment.java b/src/main/java/net/minecraft/world/item/enchantment/LootBonusEnchantment.java -index 6b8a1535086aae7e4e3229d05615fb903188f507..60af917083de1b790b1d93d61835a669143068fb 100644 +index 4007c16550683e23b396dfdff29530a82523fe05..8fe09c13643d99639fb242da4367c42ef31b38b4 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/LootBonusEnchantment.java +++ b/src/main/java/net/minecraft/world/item/enchantment/LootBonusEnchantment.java @@ -7,6 +7,14 @@ public class LootBonusEnchantment extends Enchantment { - super(weight, type, slotTypes); + super(weight, target, slotTypes); } + // Purpur start @@ -17176,7 +17108,7 @@ index 6b8a1535086aae7e4e3229d05615fb903188f507..60af917083de1b790b1d93d61835a669 public int getMinCost(int level) { return 15 + (level - 1) * 9; diff --git a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java -index 8a9a701baabdaf066cd9b28c05430f673fcafb4e..17cc3237c7fc8ceda136b2371fabf6f004a991aa 100644 +index fd50d1c2435b82215bc5b3fdbe5044d426bc342e..68ffea572045634f1ad67a6954d480e6ae7833f5 100644 --- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java +++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java @@ -132,7 +132,12 @@ public class MerchantOffer { @@ -17194,7 +17126,7 @@ index 8a9a701baabdaf066cd9b28c05430f673fcafb4e..17cc3237c7fc8ceda136b2371fabf6f0 public ItemStack assemble() { diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index af799b61cec48ca290ed66cb47cfc0b244ac41a7..4e1e1fdbf12768b95dd499bf011009a4c4ca2306 100644 +index 31ac0e5ca26c7bdfa9b710d0bb78d846ddf6863e..feb65fc9ee04141fe6f77400660442ed207547a1 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -55,6 +55,7 @@ public abstract class BaseSpawner { @@ -17219,7 +17151,7 @@ index 3b959f42d958bf0f426853aee56753d6c455fcdb..d17abb283ea818244df0379d6b57fc63 if (range < 0.0D || d < range * range) { return true; diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 5ef6b5ad4dd69a57595914c7af8422ee2f6ad054..d5a7ac1a0b5308a30ab6bdfb401e8cc517926305 100644 +index 59837144c2c0460aca6e8c349eb3d6528111d1dc..4beaedc5ec3562df62a7a9e6b2f40728bd933044 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -86,7 +86,7 @@ public class Explosion { @@ -17260,7 +17192,7 @@ index 5ef6b5ad4dd69a57595914c7af8422ee2f6ad054..d5a7ac1a0b5308a30ab6bdfb401e8cc5 this.level.gameEvent(this.source, GameEvent.EXPLODE, new Vec3(this.x, this.y, this.z)); Set set = Sets.newHashSet(); boolean flag = true; -@@ -363,7 +380,7 @@ public class Explosion { +@@ -372,7 +389,7 @@ public class Explosion { if (!iblockdata.isAir() && iblockdata.isDestroyable()) { // Paper BlockPos blockposition1 = blockposition.immutable(); @@ -17269,7 +17201,7 @@ index 5ef6b5ad4dd69a57595914c7af8422ee2f6ad054..d5a7ac1a0b5308a30ab6bdfb401e8cc5 if (block.dropFromExplosion(this)) { Level world = this.level; -@@ -385,7 +402,7 @@ public class Explosion { +@@ -394,7 +411,7 @@ public class Explosion { this.level.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 3); block.wasExploded(this.level, blockposition, this); @@ -17279,19 +17211,18 @@ index 5ef6b5ad4dd69a57595914c7af8422ee2f6ad054..d5a7ac1a0b5308a30ab6bdfb401e8cc5 } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be2399efd3 100644 +index 6aec1983a0236d6aa0507a2b3ad1c08b3330f0fc..b8001bca2a33ec1e60566948a651400418a6e9e7 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -173,6 +173,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -177,6 +177,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Paper end public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray + public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur -+ public final co.aikar.timings.WorldTimingsHandler timings; // Paper public static BlockPos lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; -@@ -190,6 +192,49 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -194,6 +195,49 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } // Paper end - fix and optimise world upgrading @@ -17341,7 +17272,7 @@ index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be public CraftWorld getWorld() { return this.world; } -@@ -270,7 +315,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -274,7 +318,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public abstract ResourceKey getTypeKey(); @@ -17350,8 +17281,8 @@ index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be // Pufferfish start - ensure these get inlined private final int minBuildHeight, minSection, height, maxBuildHeight, maxSection; -@@ -284,6 +329,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor +@@ -288,6 +332,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper + this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur @@ -17359,7 +17290,7 @@ index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be this.generator = gen; this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); -@@ -666,9 +713,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -672,9 +718,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable { BlockState iblockdata2 = this.getBlockState(pos); if ((flags & 128) == 0 && iblockdata2 != iblockdata1 && (iblockdata2.getLightBlock(this, pos) != iblockdata1.getLightBlock(this, pos) || iblockdata2.getLightEmission() != iblockdata1.getLightEmission() || iblockdata2.useShapeForLightOcclusion() || iblockdata1.useShapeForLightOcclusion())) { @@ -17371,7 +17302,7 @@ index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be } /* -@@ -967,18 +1014,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -973,18 +1019,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } protected void tickBlockEntities() { @@ -17395,7 +17326,7 @@ index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be // Spigot start // Iterator iterator = this.blockEntityTickers.iterator(); int tilesThisCycle = 0; -@@ -1011,10 +1058,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1017,10 +1063,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } this.blockEntityTickers.removeAll(toRemove); @@ -17408,7 +17339,7 @@ index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be spigotConfig.currentPrimedTnt = 0; // Spigot } -@@ -1207,7 +1254,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1213,7 +1259,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @Override public List getEntities(@Nullable Entity except, AABB box, Predicate predicate) { @@ -17417,7 +17348,7 @@ index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be List list = Lists.newArrayList(); ((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call return list; -@@ -1226,7 +1273,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1232,7 +1278,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } public void getEntities(EntityTypeTest filter, AABB box, Predicate predicate, List result, int limit) { @@ -17426,16 +17357,16 @@ index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be // Paper start - optimise this call //TODO use limit if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) { -@@ -1555,7 +1602,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1557,7 +1603,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } public ProfilerFiller getProfiler() { - if (gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish -+ if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur ++ if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish return (ProfilerFiller) this.profiler.get(); } -@@ -1637,4 +1684,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1648,4 +1694,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return null; } // Paper end @@ -17451,7 +17382,7 @@ index eb0a31c885ea64da00abcd5e67083392138b1ca0..fef709fce7309795b6d62d33a220a2be + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 5521418fa307b3eeb4f02a10c39f05b360d1d06e..81ba3c4fa9502cdd2a5c58b0ff51fea6b7553f4a 100644 +index 6180679d922ea61d05d452971ec2d506a724d3c3..132041362b2707946bd386c88bbdf871a317afb7 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java @@ -132,8 +132,8 @@ public final class NaturalSpawner { @@ -17486,7 +17417,7 @@ index 5521418fa307b3eeb4f02a10c39f05b360d1d06e..81ba3c4fa9502cdd2a5c58b0ff51fea6 if (entityhuman != null) { double d2 = entityhuman.distanceToSqr(d0, (double) i, d1); diff --git a/src/main/java/net/minecraft/world/level/block/AnvilBlock.java b/src/main/java/net/minecraft/world/level/block/AnvilBlock.java -index 2aac479ce9886cfef99823a41205eb52b7996d26..ff9945a04ffbda5766bc794fced24f14d8efcdeb 100644 +index 5c5a3b169795bf8a527b316c666cbc2105c66622..020afeca950d2c7fb6c7b179d424548fd90f8b0d 100644 --- a/src/main/java/net/minecraft/world/level/block/AnvilBlock.java +++ b/src/main/java/net/minecraft/world/level/block/AnvilBlock.java @@ -55,6 +55,54 @@ public class AnvilBlock extends FallingBlock { @@ -17582,28 +17513,28 @@ index 3d2b34c5a7c9b00c1164b4f89c2cbff81fc460eb..b5505e926e5cdb447de68e8eb8e46c97 return true; } else { diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java -index 64e68bf6decc765274caaabfd34a5b2d7d82434c..fd83291fc9137527513c492c9e3c670ed5e09236 100644 +index 96434f14525a2159f335b94aad95081f488fadf3..d56bbd43b127a1d663a398b1da7090ff64ab6a6c 100644 --- a/src/main/java/net/minecraft/world/level/block/BedBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java -@@ -98,7 +98,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -97,7 +97,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock Vec3 vec3d = pos.getCenter(); -- world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state -+ if (world.purpurConfig.bedExplode) world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state // Purpur +- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); ++ if (world.purpurConfig.bedExplode) world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, world.purpurConfig.bedExplosionEffect); // Purpur return InteractionResult.SUCCESS; } else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) { if (!this.kickVillagerOutOfBed(world, pos)) { -@@ -150,7 +150,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -149,7 +149,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock Vec3 vec3d = blockposition.getCenter(); -- world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state -+ if (world.purpurConfig.bedExplode) world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, world.purpurConfig.bedExplosionEffect); // Paper - exploded block state // Purpur +- world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); ++ if (world.purpurConfig.bedExplode) world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, (float) world.purpurConfig.bedExplosionPower, world.purpurConfig.bedExplosionFire, world.purpurConfig.bedExplosionEffect); // Purpur return InteractionResult.SUCCESS; } } -@@ -175,7 +175,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -174,7 +174,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock @Override public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) { @@ -17626,7 +17557,7 @@ index 8537581e7ca1f4efb492a2e734f46f947f36cffa..5f89229ff68d923c5cdee40e72e379ba if (i != -1) { world.scheduleTick(blockposition, (Block) this, i); diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 7b71073027f4cf79736546500ededdfbb83d968e..0c348b366623e350393f035d760adc6ee4142687 100644 +index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..773162c3456945605fb664114508622f7d2fcec8 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -63,6 +63,13 @@ import net.minecraft.world.phys.shapes.Shapes; @@ -17673,13 +17604,13 @@ index 7b71073027f4cf79736546500ededdfbb83d968e..0c348b366623e350393f035d760adc6e state.spawnAfterBreak(world.getMinecraftWorld(), pos, ItemStack.EMPTY, true); } @@ -352,13 +363,53 @@ public class Block extends BlockBehaviour implements ItemLike { - public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack stack) { + public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack tool) { if (world instanceof ServerLevel) { - Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, stack).forEach((itemstack1) -> { + Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool).forEach((itemstack1) -> { - Block.popResource(world, pos, itemstack1); + Block.popResource(world, pos, applyDisplayNameAndLoreFromTile(itemstack1, blockEntity)); // Purpur }); - state.spawnAfterBreak((ServerLevel) world, pos, stack, true); + state.spawnAfterBreak((ServerLevel) world, pos, tool, true); } } @@ -17725,10 +17656,10 @@ index 7b71073027f4cf79736546500ededdfbb83d968e..0c348b366623e350393f035d760adc6e + // Purpur end + public static void popResource(Level world, BlockPos pos, ItemStack stack) { - float f = EntityType.ITEM.getHeight() / 2.0F; - // Paper start - don't convert potentially massive numbers to floats -@@ -438,7 +489,17 @@ public class Block extends BlockBehaviour implements ItemLike { - Block.dropResources(state, world, pos, blockEntity, player, stack); + double d0 = (double) EntityType.ITEM.getHeight() / 2.0D; + double d1 = (double) pos.getX() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D); +@@ -434,7 +485,17 @@ public class Block extends BlockBehaviour implements ItemLike { + Block.dropResources(state, world, pos, blockEntity, player, tool); } - public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {} @@ -17746,20 +17677,20 @@ index 7b71073027f4cf79736546500ededdfbb83d968e..0c348b366623e350393f035d760adc6e public boolean isPossibleToRespawnInThis() { return !this.material.isSolid() && !this.material.isLiquid(); -@@ -457,7 +518,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -453,7 +514,7 @@ public class Block extends BlockBehaviour implements ItemLike { } public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) { -- entity.causeFallDamage(fallDistance, 1.0F, DamageSource.FALL); -+ entity.causeFallDamage(fallDistance * fallDistanceMultiplier, fallDamageMultiplier, DamageSource.FALL); // Purpur +- entity.causeFallDamage(fallDistance, 1.0F, entity.damageSources().fall()); ++ entity.causeFallDamage(fallDistance * fallDistanceMultiplier, fallDamageMultiplier, entity.damageSources().fall()); // Purpur } public void updateEntityAfterFallOn(BlockGetter world, Entity entity) { diff --git a/src/main/java/net/minecraft/world/level/block/Blocks.java b/src/main/java/net/minecraft/world/level/block/Blocks.java -index 42f46d338886e2892ee4219d19be4dc97f61616f..c75404ddcb36105b84ff8c21545549bee5b4cb8e 100644 +index f148c7d2954cc17377d0da4af03ea2c1c9397a52..4afc4670f9b00a4087410ec366fe45fe2f2734dc 100644 --- a/src/main/java/net/minecraft/world/level/block/Blocks.java +++ b/src/main/java/net/minecraft/world/level/block/Blocks.java -@@ -1063,8 +1063,8 @@ public class Blocks { +@@ -1087,8 +1087,8 @@ public class Blocks { public static final Block CAVE_VINES = register("cave_vines", new CaveVinesBlock(BlockBehaviour.Properties.of(Material.PLANT).randomTicks().noCollission().lightLevel(CaveVines.emission(14)).instabreak().sound(SoundType.CAVE_VINES))); public static final Block CAVE_VINES_PLANT = register("cave_vines_plant", new CaveVinesPlantBlock(BlockBehaviour.Properties.of(Material.PLANT).noCollission().lightLevel(CaveVines.emission(14)).instabreak().sound(SoundType.CAVE_VINES))); public static final Block SPORE_BLOSSOM = register("spore_blossom", new SporeBlossomBlock(BlockBehaviour.Properties.of(Material.PLANT).instabreak().noCollission().sound(SoundType.SPORE_BLOSSOM))); @@ -17768,9 +17699,9 @@ index 42f46d338886e2892ee4219d19be4dc97f61616f..c75404ddcb36105b84ff8c21545549be + public static final Block AZALEA = register("azalea", new AzaleaBlock(BlockBehaviour.Properties.of(Material.PLANT).randomTicks().instabreak().sound(SoundType.AZALEA).noOcclusion())); // Purpur + public static final Block FLOWERING_AZALEA = register("flowering_azalea", new AzaleaBlock(BlockBehaviour.Properties.of(Material.PLANT).randomTicks().instabreak().sound(SoundType.FLOWERING_AZALEA).noOcclusion())); // Purpur public static final Block MOSS_CARPET = register("moss_carpet", new CarpetBlock(BlockBehaviour.Properties.of(Material.PLANT, MaterialColor.COLOR_GREEN).strength(0.1F).sound(SoundType.MOSS_CARPET))); + public static final Block PINK_PETALS = register("pink_petals", new PinkPetalsBlock(BlockBehaviour.Properties.of(Material.PLANT).noCollission().sound(SoundType.PINK_PETALS).requiredFeatures(FeatureFlags.UPDATE_1_20))); public static final Block MOSS_BLOCK = register("moss_block", new MossBlock(BlockBehaviour.Properties.of(Material.MOSS, MaterialColor.COLOR_GREEN).strength(0.1F).sound(SoundType.MOSS))); - public static final Block BIG_DRIPLEAF = register("big_dripleaf", new BigDripleafBlock(BlockBehaviour.Properties.of(Material.PLANT).strength(0.1F).sound(SoundType.BIG_DRIPLEAF))); -@@ -1127,7 +1127,7 @@ public class Blocks { +@@ -1153,7 +1153,7 @@ public class Blocks { } private static Boolean ocelotOrParrot(BlockState state, BlockGetter world, BlockPos pos, EntityType type) { @@ -17828,10 +17759,10 @@ index 03fde6e47c4a347c62fe9b4a3351769aedf874f6..ca906b0250e5332f7ececf1419ca6d2c + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java -index 1ec242205b82a5a1f10deb2312795cc5dc157a76..44abdcc5b71c289601f412a20ee50ad4388a7a74 100644 +index 7579946ce222b6ab3685a7fd9821bcd5a4babe33..ae2ac1c24c1e502a1968a3008273096281d5f1ca 100644 --- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java -@@ -23,7 +23,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; +@@ -22,7 +22,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit @@ -17840,7 +17771,7 @@ index 1ec242205b82a5a1f10deb2312795cc5dc157a76..44abdcc5b71c289601f412a20ee50ad4 public static final IntegerProperty AGE = BlockStateProperties.AGE_15; public static final int MAX_AGE = 15; -@@ -110,7 +110,7 @@ public class CactusBlock extends Block { +@@ -109,7 +109,7 @@ public class CactusBlock extends Block { BlockState iblockdata2 = world.getBlockState(pos.relative(enumdirection)); material = iblockdata2.getMaterial(); @@ -17849,7 +17780,7 @@ index 1ec242205b82a5a1f10deb2312795cc5dc157a76..44abdcc5b71c289601f412a20ee50ad4 return false; } -@@ -132,4 +132,34 @@ public class CactusBlock extends Block { +@@ -131,4 +131,34 @@ public class CactusBlock extends Block { public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) { return false; } @@ -17885,10 +17816,10 @@ index 1ec242205b82a5a1f10deb2312795cc5dc157a76..44abdcc5b71c289601f412a20ee50ad4 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java -index a4c44cb59dee29cf227dbb51bfc1576d89dfb2e3..551bacade8642e6aad17120d8a901bcc293f2eb2 100644 +index 219c87dcf065e86512f330fbeec59e55f4675083..f8fd3b320494d1c1e8ee3d170f2feebd152230fa 100644 --- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java -@@ -123,7 +123,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB +@@ -122,7 +122,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB BlockPos blockposition = ctx.getClickedPos(); boolean flag = world.getFluidState(blockposition).getType() == Fluids.WATER; @@ -17898,10 +17829,10 @@ index a4c44cb59dee29cf227dbb51bfc1576d89dfb2e3..551bacade8642e6aad17120d8a901bcc @Override diff --git a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java -index f77dd9f9dc89d880386cc2da398cd7ec9c768c43..26c3aa77576a0c3b3df21f1b12189e6a42bdc0a7 100644 +index 05112bc416019daba885a3de1b7f96177665135f..32d7ae44dd4e4987b1085f08cb30a92937e57226 100644 --- a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java -@@ -68,7 +68,7 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements We +@@ -69,7 +69,7 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements Eq SnowGolem entitysnowman = (SnowGolem) EntityType.SNOW_GOLEM.create(world); if (entitysnowman != null) { @@ -17910,7 +17841,7 @@ index f77dd9f9dc89d880386cc2da398cd7ec9c768c43..26c3aa77576a0c3b3df21f1b12189e6a } } else { BlockPattern.BlockPatternMatch shapedetector_shapedetectorcollection1 = this.getOrCreateIronGolemFull().find(world, pos); -@@ -78,7 +78,7 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements We +@@ -79,7 +79,7 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements Eq if (entityirongolem != null) { entityirongolem.setPlayerCreated(true); @@ -17919,7 +17850,7 @@ index f77dd9f9dc89d880386cc2da398cd7ec9c768c43..26c3aa77576a0c3b3df21f1b12189e6a } } } -@@ -86,6 +86,16 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements We +@@ -87,6 +87,16 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements Eq } private static void spawnGolemInWorld(Level world, BlockPattern.BlockPatternMatch patternResult, Entity entity, BlockPos pos) { @@ -17950,12 +17881,12 @@ index 2f85b893dd0abc39fcedec65acc89e1567faf6f0..3ee012a9ef8cada0b2203e53b2f731f6 @Override diff --git a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java -index fc76cd43655e0f4b8a8d87f90f0a48a8678ef16c..a5b27c064096c9572a8fe0dc40e68d0982507103 100644 +index 18b5bce1138d50be32e5da013221be69dc47e21f..58b4a0d97af37f7164db86ef821f04102c6c5ddd 100644 --- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java -@@ -89,4 +89,11 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl +@@ -88,4 +88,11 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) { - world.setBlock(pos, (BlockState) state.setValue(CaveVinesBlock.BERRIES, true), 2); + world.setBlock(pos, state.setValue(BERRIES, Boolean.valueOf(true)), 2); } + + // Purpur start @@ -17966,7 +17897,7 @@ index fc76cd43655e0f4b8a8d87f90f0a48a8678ef16c..a5b27c064096c9572a8fe0dc40e68d09 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java -index c6b57d45383441aa35510e759ce3cb82bc98f305..330ff3bc5fd8625e37b79e1204eddbe88de62c03 100644 +index 5e22d175b1048a58802cdf64ac70a8b56329e915..d81946b400f208c39941128ce823ff7709741c10 100644 --- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java @@ -355,6 +355,7 @@ public class ChestBlock extends AbstractChestBlock implements @@ -17998,21 +17929,21 @@ index a6c25647fb37f59307de0d390f8e8cf55504d7d3..52aae8bd4023b2bb48f12983f54b20fa world.scheduleTick(pos, this, 1); return super.updateShape(state, direction, neighborState, world, pos, neighborPos); diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -index f6268231e39f50bb6adedd85e3c18d746ae3792d..558563aed82adaa44d874a6cbb3e381819c2f638 100644 +index ae90e86327957bb784e2d81694ee7eea288bb455..c5e4bc4bbeacd4875996ba54e795689feb8023af 100644 --- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -@@ -220,26 +220,28 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -228,26 +228,28 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { ItemStack itemstack = player.getItemInHand(hand); if (i < 8 && ComposterBlock.COMPOSTABLES.containsKey(itemstack.getItem())) { - if (i < 7 && !world.isClientSide) { - // Paper start - EntityChangeBlockEvent - double rand = world.getRandom().nextDouble(); -- BlockState dummyBlockState = ComposterBlock.addItem(state, org.bukkit.craftbukkit.util.DummyGeneratorAccess.INSTANCE, pos, itemstack, rand); +- BlockState dummyBlockState = ComposterBlock.addItem(player, state, org.bukkit.craftbukkit.util.DummyGeneratorAccess.INSTANCE, pos, itemstack, rand); - if (state != dummyBlockState && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, dummyBlockState).isCancelled()) { // if block state will change and event cancelled - return InteractionResult.sidedSuccess(world.isClientSide); - } -- BlockState iblockdata1 = ComposterBlock.addItem(state, world, pos, itemstack, player); +- BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, itemstack, rand); - if (iblockdata1 == null) { - return InteractionResult.PASS; - } @@ -18047,8 +17978,8 @@ index f6268231e39f50bb6adedd85e3c18d746ae3792d..558563aed82adaa44d874a6cbb3e3818 + // Purpur end return InteractionResult.sidedSuccess(world.isClientSide); } else if (i == 8) { - ComposterBlock.extractProduce(state, world, pos, (Entity) null); // CraftBukkit - no event for players -@@ -249,6 +251,32 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { + ComposterBlock.extractProduce(player, state, world, pos); +@@ -257,6 +259,32 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { } } @@ -18057,11 +17988,11 @@ index f6268231e39f50bb6adedd85e3c18d746ae3792d..558563aed82adaa44d874a6cbb3e3818 + if (level < 7 && !world.isClientSide) { + // Paper start - EntityChangeBlockEvent + double rand = world.getRandom().nextDouble(); -+ BlockState dummyBlockState = ComposterBlock.addItem(state, org.bukkit.craftbukkit.util.DummyGeneratorAccess.INSTANCE, pos, itemstack, rand); ++ BlockState dummyBlockState = ComposterBlock.addItem(player, state, org.bukkit.craftbukkit.util.DummyGeneratorAccess.INSTANCE, pos, itemstack, rand); + if (state != dummyBlockState && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, dummyBlockState).isCancelled()) { // if block state will change and event cancelled + return state; + } -+ BlockState iblockdata1 = ComposterBlock.addItem(state, world, pos, itemstack, player); ++ BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, itemstack, rand); + if (iblockdata1 == null) { + return iblockdata1; + } @@ -18078,8 +18009,8 @@ index f6268231e39f50bb6adedd85e3c18d746ae3792d..558563aed82adaa44d874a6cbb3e3818 + } + // Purpur end + - public static BlockState insertItem(BlockState iblockdata, ServerLevel worldserver, ItemStack itemstack, BlockPos blockposition, Entity entity) { // CraftBukkit - int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL); + public static BlockState insertItem(Entity user, BlockState state, ServerLevel world, ItemStack stack, BlockPos pos) { + int i = (Integer) state.getValue(ComposterBlock.LEVEL); diff --git a/src/main/java/net/minecraft/world/level/block/CoralBlock.java b/src/main/java/net/minecraft/world/level/block/CoralBlock.java index 88faea00be60a519f56f975a5311df5e1eb3e6b8..cbb726ac367be81e27d3a86643baf7c4f0746edf 100644 @@ -18123,10 +18054,10 @@ index 519d02a2009c4f09c9e8be7196a701f0f042012d..74620e6aee75334498d903c616c090ca + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/DoorBlock.java b/src/main/java/net/minecraft/world/level/block/DoorBlock.java -index fc4793fefe52adfeb0272bf5324c32c1c3946416..58e5acea025287214757cba632e1268e418d7dfa 100644 +index 5ba56ee7d5dd210770e6703be559055d218028d5..b5e90dc00240bccf1a6eca342729a4f4165e22bf 100644 --- a/src/main/java/net/minecraft/world/level/block/DoorBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DoorBlock.java -@@ -167,6 +167,7 @@ public class DoorBlock extends Block { +@@ -165,6 +165,7 @@ public class DoorBlock extends Block { public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { if (this.material == Material.METAL) { return InteractionResult.PASS; @@ -18134,7 +18065,7 @@ index fc4793fefe52adfeb0272bf5324c32c1c3946416..58e5acea025287214757cba632e1268e } else { state = (BlockState) state.cycle(DoorBlock.OPEN); world.setBlock(pos, state, 10); -@@ -262,4 +263,18 @@ public class DoorBlock extends Block { +@@ -260,4 +261,18 @@ public class DoorBlock extends Block { public static boolean isWoodenDoor(BlockState state) { return state.getBlock() instanceof DoorBlock && (state.getMaterial() == Material.WOOD || state.getMaterial() == Material.NETHER_WOOD); } @@ -18211,16 +18142,14 @@ index f4ee3ce287528337a0f9a3b612c157254f895a58..c4a91d7f1320027ee6a2b364303c01eb + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java -index 15c5cccfe02c924c02f605eb47dd0b420b189891..e7658fa9806701505e15cbf1d28ea3bd2ed6f113 100644 +index 41d7cff39fc37955877668337689b4b26cd8c7cf..2deddc746e43896584bd65ba8e7971a80acb4a4d 100644 --- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java -@@ -45,7 +45,15 @@ public class EndPortalBlock extends BaseEntityBlock { - @Override +@@ -46,6 +46,14 @@ public class EndPortalBlock extends BaseEntityBlock { public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper -- if (world instanceof ServerLevel && !entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions() && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) { -+ // Purpur start -+ if (world instanceof ServerLevel && /*!entity.isPassenger() && !entity.isVehicle() &&*/ entity.canChangeDimensions() && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) { + if (world instanceof ServerLevel && entity.canChangeDimensions() && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) { ++ // Purpur start + if (entity.isPassenger() || entity.isVehicle()) { + if (new org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), entity.isPassenger() ? org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_PASSENGER : org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, PlayerTeleportEvent.TeleportCause.END_PORTAL).callEvent()) { + this.entityInside(state, world, pos, entity); @@ -18287,10 +18216,10 @@ index 7385e91f32f070e86a4e0fd3d214f55d832c7979..c3b78dd2d06be7d64920c6bcffcd16c8 }, CONTAINER_TITLE)); player.awardStat(Stats.OPEN_ENDERCHEST); diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java -index d089887030ac7c7a79abca97134ba9291e244059..7068cb39ab264fa0c65febff01236b8de564b883 100644 +index 34d744837e599633a3c2c0b72f253bb0e157f226..69cc276fecd4cac51d38bd3cc7de490ad0ae8ace 100644 --- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java -@@ -98,7 +98,7 @@ public class FarmBlock extends Block { +@@ -100,7 +100,7 @@ public class FarmBlock extends Block { @Override public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) { super.fallOn(world, state, pos, entity, fallDistance); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage. @@ -18299,7 +18228,7 @@ index d089887030ac7c7a79abca97134ba9291e244059..7068cb39ab264fa0c65febff01236b8d // CraftBukkit start - Interact soil org.bukkit.event.Cancellable cancellable; if (entity instanceof Player) { -@@ -112,6 +112,22 @@ public class FarmBlock extends Block { +@@ -114,6 +114,22 @@ public class FarmBlock extends Block { return; } @@ -18322,7 +18251,7 @@ index d089887030ac7c7a79abca97134ba9291e244059..7068cb39ab264fa0c65febff01236b8d if (CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) { return; } -@@ -158,7 +174,7 @@ public class FarmBlock extends Block { +@@ -163,7 +179,7 @@ public class FarmBlock extends Block { } } @@ -18397,14 +18326,14 @@ index 3a1aa4e2405090ccebefb7f5944f36462929e221..f3cf9f06de40054720d1847c1869a9d8 + public abstract int getMaxGrowthAge(); // Purpur } diff --git a/src/main/java/net/minecraft/world/level/block/HayBlock.java b/src/main/java/net/minecraft/world/level/block/HayBlock.java -index c316fb1d3081c1fbf4602dd72e96e57491bc8efd..3b054f2bda6fae31e8ab7bce088e228f800b0d43 100644 +index cfbe1dae76db76cf54a4f5d72aca72d5e893859e..74cb10230d459ac9f300a9d59af504d233ac663e 100644 --- a/src/main/java/net/minecraft/world/level/block/HayBlock.java +++ b/src/main/java/net/minecraft/world/level/block/HayBlock.java -@@ -16,6 +16,6 @@ public class HayBlock extends RotatedPillarBlock { +@@ -15,6 +15,6 @@ public class HayBlock extends RotatedPillarBlock { @Override public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) { -- entity.causeFallDamage(fallDistance, 0.2F, DamageSource.FALL); +- entity.causeFallDamage(fallDistance, 0.2F, world.damageSources().fall()); + super.fallOn(world, state, pos, entity, fallDistance); // Purpur } } @@ -18483,13 +18412,13 @@ index 3c6d97b51c6fec130b80e5965afa2c49d48843c9..b456cb8efd8f0be8a6860c82462ce9bd @Override diff --git a/src/main/java/net/minecraft/world/level/block/IceBlock.java b/src/main/java/net/minecraft/world/level/block/IceBlock.java -index 64206d94a5bf210116d208f9678618b905a61428..d9dbd36be7693cb3f3eafe97e80efc169e3cef65 100644 +index 5ecf02ce83b7496c977adfeb203b8eadb05f9da5..bf7f1ac5c691c0c4c30c124970f4b08a8108ad34 100644 --- a/src/main/java/net/minecraft/world/level/block/IceBlock.java +++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java @@ -31,7 +31,7 @@ public class IceBlock extends HalfTransparentBlock { - public void afterDestroy(Level world, BlockPos pos, ItemStack stack) { + public void afterDestroy(Level world, BlockPos pos, ItemStack tool) { // Paper end - if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) { + if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) == 0) { - if (world.dimensionType().ultraWarm()) { + if (world.isNether() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur world.removeBlock(pos, false); @@ -18552,20 +18481,20 @@ index 43e8ef1d6a65d4fd3fe53a587639ffb814368217..9c22a730772f71b34c63d1e43d48943f } diff --git a/src/main/java/net/minecraft/world/level/block/MagmaBlock.java b/src/main/java/net/minecraft/world/level/block/MagmaBlock.java -index d3540a4daaa8021ae009bfd4d9ef4f1172ab4c56..2b250439f263f64db7920536ed6eaf6440644a11 100644 +index 12ffb5714f088f4aeafa1ad6a36f5b64a86c4c96..293aa5c8f91a997045f8d9f2951fe3a7f01f0642 100644 --- a/src/main/java/net/minecraft/world/level/block/MagmaBlock.java +++ b/src/main/java/net/minecraft/world/level/block/MagmaBlock.java -@@ -28,7 +28,7 @@ public class MagmaBlock extends Block { +@@ -27,7 +27,7 @@ public class MagmaBlock extends Block { @Override public void stepOn(Level world, BlockPos pos, BlockState state, Entity entity) { - if (!entity.isSteppingCarefully() && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entity)) { + if ((!entity.isSteppingCarefully() || world.purpurConfig.magmaBlockDamageWhenSneaking) && entity instanceof LivingEntity && (world.purpurConfig.magmaBlockDamageWithFrostWalker || !EnchantmentHelper.hasFrostWalker((LivingEntity) entity))) { // Purpur org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); // CraftBukkit - entity.hurt(DamageSource.HOT_FLOOR, 1.0F); + entity.hurt(world.damageSources().hotFloor(), 1.0F); org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java -index 192689be9dfc9373876921bd4da0715d58f9421c..307a05fa07bdfbc1586dde5f7672522f9f7dd9ca 100644 +index a6ab0d0defc05e56a91084c49897059670a1324b..589b437e7c97c846410f293e2f014bdcd7cb333e 100644 --- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java @@ -52,7 +52,7 @@ public class NetherPortalBlock extends Block { @@ -18577,13 +18506,11 @@ index 192689be9dfc9373876921bd4da0715d58f9421c..307a05fa07bdfbc1586dde5f7672522f while (world.getBlockState(pos).is((Block) this)) { pos = pos.below(); } -@@ -83,7 +83,15 @@ public class NetherPortalBlock extends Block { - @Override +@@ -84,6 +84,14 @@ public class NetherPortalBlock extends Block { public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper -- if (!entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions()) { -+ // Purpur start -+ if (/*!entity.isPassenger() && !entity.isVehicle() &&*/ entity.canChangeDimensions()) { + if (entity.canChangeDimensions()) { ++ // Purpur start + if (entity.isPassenger() || entity.isVehicle()) { + if (new org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), entity.isPassenger() ? org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_PASSENGER : org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.NETHER_PORTAL).callEvent()) { + this.entityInside(state, world, pos, entity); @@ -18641,10 +18568,10 @@ index e55720c4d2fbdf6aae526910e87a67c29cf906fd..bf4485b4cad324d5aace657ebf284c4d + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java -index df7965c86b9c9e89b07b76c75b638d391ea6cc34..5c183107df821b67e175bba81f4dbe13d1e316bf 100644 +index 50ead76879398222a76f26c36e98800d2d1af167..0b5ce2db558e721807944d9d0f672a77ce2a7fe0 100644 --- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java -@@ -60,11 +60,13 @@ public class NoteBlock extends Block { +@@ -62,11 +62,13 @@ public class NoteBlock extends Block { @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { @@ -18658,7 +18585,7 @@ index df7965c86b9c9e89b07b76c75b638d391ea6cc34..5c183107df821b67e175bba81f4dbe13 boolean flag = NoteBlock.isFeatureFlagEnabled(world) ? direction.getAxis() == Direction.Axis.Y : direction == Direction.DOWN; return flag ? this.setInstrument(world, pos, state) : super.updateShape(state, direction, neighborState, world, pos, neighborPos); -@@ -80,13 +82,14 @@ public class NoteBlock extends Block { +@@ -82,13 +84,14 @@ public class NoteBlock extends Block { state = world.getBlockState(pos); // CraftBukkit - SPIGOT-5617: update in case changed in event } @@ -18687,7 +18614,7 @@ index 7b45d6b9a005036ca5051d089a7be792eb87012f..8806c97ecc6bdd8a64c2d82bb2f58f46 } diff --git a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java -index 1d7149fb6baeaf045c3680b6dec293f074614612..8ba5f519fbc4ee81b36e9052274fc644c4787a3d 100644 +index 6b909d41ccdf6c1ac3ac0c4e673ff52f0d14a238..b8f69063cec4d31c9d9525a04c46ed8904ceff76 100644 --- a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java @@ -188,7 +188,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate @@ -18742,20 +18669,20 @@ index 7fddb6fa8fd30ef88346a59f7867aae792f13772..40893e71fe8447b695350273bef9623b } else { int j = pos.getX(); diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java -index 1b7140ffab0492ab130743a2d158b30efb2cfece..63b536555d97c158003722c21a25394ba50f3533 100644 +index bcea8af63b9911c36873290e5c34567b1eeaacf4..a81fe948398a4d65929d75c821177f09cef67a20 100644 --- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java +++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java -@@ -126,7 +126,7 @@ public class RespawnAnchorBlock extends Block { +@@ -127,7 +127,7 @@ public class RespawnAnchorBlock extends Block { } }; Vec3 vec3 = explodedPos.getCenter(); -- world.explode((Entity)null, DamageSource.badRespawnPointExplosion(vec3, explodedBlockState), explosionDamageCalculator, vec3, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state -+ if (world.purpurConfig.respawnAnchorExplode) world.explode((Entity)null, DamageSource.badRespawnPointExplosion(vec3, explodedBlockState), explosionDamageCalculator, vec3, (float) world.purpurConfig.respawnAnchorExplosionPower, world.purpurConfig.respawnAnchorExplosionFire, world.purpurConfig.respawnAnchorExplosionEffect); // Paper - exploded block state // Purpur +- world.explode((Entity)null, world.damageSources().badRespawnPointExplosion(vec3, explodedBlockState), explosionDamageCalculator, vec3, 5.0F, true, Level.ExplosionInteraction.BLOCK); ++ if (world.purpurConfig.respawnAnchorExplode) world.explode((Entity)null, world.damageSources().badRespawnPointExplosion(vec3, explodedBlockState), explosionDamageCalculator, vec3, (float) world.purpurConfig.respawnAnchorExplosionPower, world.purpurConfig.respawnAnchorExplosionFire, world.purpurConfig.respawnAnchorExplosionEffect); // Paper - exploded block state // Purpur } public static boolean canSetSpawn(Level world) { diff --git a/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java b/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java -index e0998215841e500e5982a242e9f4e646402e1521..11038ba560439dab04c54c31a32d63bed2b4698a 100644 +index 437b44fb68bcbe81d1c431689431225b6a17a1a6..06d091b7c4df949c4abda16c4f73c194a71a4669 100644 --- a/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SculkShriekerBlock.java @@ -130,7 +130,7 @@ public class SculkShriekerBlock extends BaseEntityBlock implements SimpleWaterlo @@ -18873,7 +18800,7 @@ index 14e00c7feb1c051d56a3d27cd00dcef072dd771a..4952fb1aaaafb55baa0fddb389f966a1 } diff --git a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java -index 5af520104f25d597917e99ac09aa9d68c4864e44..c4e5ff55a629ec57889175a0082abf95b8183069 100644 +index 936d844a5a246138c9f9ae4ae6e318242b8f1420..d58dc4aa02fe371deaf879df8692dbe93c648f9b 100644 --- a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java @@ -40,6 +40,58 @@ public class SpawnerBlock extends BaseEntityBlock { @@ -18933,8 +18860,8 @@ index 5af520104f25d597917e99ac09aa9d68c4864e44..c4e5ff55a629ec57889175a0082abf95 + // Purpur end + @Override - public void spawnAfterBreak(BlockState state, ServerLevel world, BlockPos pos, ItemStack stack, boolean dropExperience) { - super.spawnAfterBreak(state, world, pos, stack, dropExperience); + public void spawnAfterBreak(BlockState state, ServerLevel world, BlockPos pos, ItemStack tool, boolean dropExperience) { + super.spawnAfterBreak(state, world, pos, tool, dropExperience); @@ -48,6 +100,7 @@ public class SpawnerBlock extends BaseEntityBlock { @Override @@ -18985,7 +18912,7 @@ index 7304b2659eb45bc4bc9fa7c43e6ca07221d0fc73..df04a571ebd3c04bc7b58c1ee5661a1f } } diff --git a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java -index 0a95842c53a9d0286c57bcb42db97e468e30fb7d..b6742a1efcceb0fb950d995101b6be16b0d05978 100644 +index 0a95842c53a9d0286c57bcb42db97e468e30fb7d..e2d42e7947a237dd060ec1b9b63ac6ca4f37241a 100644 --- a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java @@ -92,4 +92,16 @@ public class StonecutterBlock extends Block { @@ -18998,7 +18925,7 @@ index 0a95842c53a9d0286c57bcb42db97e468e30fb7d..b6742a1efcceb0fb950d995101b6be16 + public void stepOn(Level level, BlockPos pos, BlockState state, net.minecraft.world.entity.Entity entity) { + if (level.purpurConfig.stonecutterDamage > 0.0F && entity instanceof net.minecraft.world.entity.LivingEntity) { + org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); -+ entity.hurt(net.minecraft.world.damagesource.DamageSource.STONECUTTER, level.purpurConfig.stonecutterDamage); ++ entity.hurt(entity.damageSources().magic(), level.purpurConfig.stonecutterDamage); + org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; + } + super.stepOn(level, pos, state, entity); @@ -19054,7 +18981,7 @@ index 6b400a4759c8c8612a3b5c96ca0d87ef9dc71435..992de1ab2c00a2545a857f1b5533926b + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java -index 70d46aafa9c16921e5c5bed3d97b8f402e25038a..a5bd3f463ee8ab402d518d18a28425441af31686 100644 +index 6c1a0e6f961e46a1a89850746a71e97b32514adf..a8c227e2cb62cfa8225798329cde9078d194c776 100644 --- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java @@ -160,7 +160,7 @@ public class TurtleEggBlock extends Block { @@ -19144,10 +19071,10 @@ index b91effe91dad2e1aeea0ea31140f7432833b343f..bb628bd3fe8b185f356968697b17e1c4 if (!world.addFreshEntity(entitywither, SpawnReason.BUILD_WITHER)) { return; diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index cac2768fe520b591990c7bc943ae7e95f49efb31..5ae858b81e6f9903b7296077cf497f62bb8d6995 100644 +index 2a786c9fd29dc2139cf487fa645cd43345d60167..507b3756238ec3054232b805a9b689be6ea12e25 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -43,6 +43,7 @@ import net.minecraft.world.level.Level; +@@ -44,6 +44,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.AbstractFurnaceBlock; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; @@ -19155,7 +19082,7 @@ index cac2768fe520b591990c7bc943ae7e95f49efb31..5ae858b81e6f9903b7296077cf497f62 import net.minecraft.world.phys.Vec3; // CraftBukkit start import org.bukkit.craftbukkit.block.CraftBlock; -@@ -206,6 +207,22 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -207,6 +208,22 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit // Paper end } @@ -19178,7 +19105,7 @@ index cac2768fe520b591990c7bc943ae7e95f49efb31..5ae858b81e6f9903b7296077cf497f62 // CraftBukkit start - add fields and methods private int maxStack = MAX_STACK; public List transaction = new java.util.ArrayList(); -@@ -323,6 +340,21 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -324,6 +341,21 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit } ItemStack itemstack = (ItemStack) blockEntity.items.get(1); @@ -19200,14 +19127,14 @@ index cac2768fe520b591990c7bc943ae7e95f49efb31..5ae858b81e6f9903b7296077cf497f62 boolean flag2 = !((ItemStack) blockEntity.items.get(0)).isEmpty(); boolean flag3 = !itemstack.isEmpty(); -@@ -408,6 +440,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -409,6 +441,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit setChanged(world, pos, state); } + if (usedLavaFromUnderneath) blockEntity.items.set(1, ItemStack.EMPTY); // Purpur } - private static boolean canBurn(@Nullable Recipe recipe, NonNullList slots, int count) { + private static boolean canBurn(RegistryAccess registryManager, @Nullable Recipe recipe, NonNullList slots, int count) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java index 416aa989ebb18a8741cc9d605a1180ab830f6643..e38a0adf5463c48311ad08b8d2e5b5c2d989a3b5 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java @@ -19267,7 +19194,7 @@ index 416aa989ebb18a8741cc9d605a1180ab830f6643..e38a0adf5463c48311ad08b8d2e5b5c2 @Override diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index 928625b5ab054ffa412be8a438f58291cc7a3cc0..c49175dcb7ca4469f729d3afb305fca42da82bcf 100644 +index ef740d1ad6352ca4af299001a081b720bc472d2e..8f82b0ce87afc8890c5b3386d5f6e22c48974b16 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -84,6 +84,16 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -19429,10 +19356,10 @@ index 1b248db497500aa6bd346b306dcb908af77626f3..e438e7e018f643d82ddf5efbf7277987 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java -index 05eab04e4aec4151018f25b59f92ddbbb4c09f87..3b5c502fc211940dd908f1d276fa11e3826abda7 100644 +index 963a596154091b79ca139af6274aa323518ad1ad..4dcac3899a500d8586580bcfd5b4516e1dcdcd4a 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java -@@ -172,7 +172,7 @@ public class ConduitBlockEntity extends BlockEntity { +@@ -171,7 +171,7 @@ public class ConduitBlockEntity extends BlockEntity { if ((l > 1 || i1 > 1 || j1 > 1) && (i == 0 && (i1 == 2 || j1 == 2) || j == 0 && (l == 2 || j1 == 2) || k == 0 && (l == 2 || i1 == 2))) { BlockPos blockposition2 = pos.offset(i, j, k); BlockState iblockdata = world.getBlockState(blockposition2); @@ -19441,7 +19368,7 @@ index 05eab04e4aec4151018f25b59f92ddbbb4c09f87..3b5c502fc211940dd908f1d276fa11e3 int k1 = ablock.length; for (int l1 = 0; l1 < k1; ++l1) { -@@ -192,7 +192,7 @@ public class ConduitBlockEntity extends BlockEntity { +@@ -191,7 +191,7 @@ public class ConduitBlockEntity extends BlockEntity { private static void applyEffects(Level world, BlockPos pos, List activatingBlocks) { int i = activatingBlocks.size(); @@ -19450,7 +19377,7 @@ index 05eab04e4aec4151018f25b59f92ddbbb4c09f87..3b5c502fc211940dd908f1d276fa11e3 int k = pos.getX(); int l = pos.getY(); int i1 = pos.getZ(); -@@ -223,21 +223,21 @@ public class ConduitBlockEntity extends BlockEntity { +@@ -222,21 +222,21 @@ public class ConduitBlockEntity extends BlockEntity { blockEntity.destroyTarget = ConduitBlockEntity.findDestroyTarget(world, pos, blockEntity.destroyTargetUUID); blockEntity.destroyTargetUUID = null; } else if (blockEntity.destroyTarget == null) { @@ -19470,12 +19397,12 @@ index 05eab04e4aec4151018f25b59f92ddbbb4c09f87..3b5c502fc211940dd908f1d276fa11e3 if (blockEntity.destroyTarget != null) { // CraftBukkit start CraftEventFactory.blockDamage = CraftBlock.at(world, pos); -- if (blockEntity.destroyTarget.hurt(DamageSource.MAGIC, 4.0F)) { -+ if (blockEntity.destroyTarget.hurt(DamageSource.MAGIC, world.purpurConfig.conduitDamageAmount)) { // Purpur +- if (blockEntity.destroyTarget.hurt(world.damageSources().magic(), 4.0F)) { ++ if (blockEntity.destroyTarget.hurt(world.damageSources().magic(), world.purpurConfig.conduitDamageAmount)) { // Purpur world.playSound((Player) null, blockEntity.destroyTarget.getX(), blockEntity.destroyTarget.getY(), blockEntity.destroyTarget.getZ(), SoundEvents.CONDUIT_ATTACK_TARGET, SoundSource.BLOCKS, 1.0F, 1.0F); } CraftEventFactory.blockDamage = null; -@@ -263,16 +263,22 @@ public class ConduitBlockEntity extends BlockEntity { +@@ -262,16 +262,22 @@ public class ConduitBlockEntity extends BlockEntity { } private static AABB getDestroyRangeAABB(BlockPos pos) { @@ -19572,7 +19499,7 @@ index 4da4edae517a0efec6e03a719ec47b700509dab1..9e760a8e8244b15daaf0abdfc5f8a51d public CompoundTag getUpdateTag() { return this.saveWithoutMetadata(); diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -index f80545f80948db27d1fbde77d0505c916eb504ed..053ec306027a83cdd06d10197d47d7edf8c213ac 100644 +index c73024cc62490c336ffe26313580e88d25ca7078..43ca8471d7d4d2d561cba7e2a952a16ed200a961 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java @@ -178,6 +178,15 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { @@ -19623,10 +19550,10 @@ index 744d91546d1a810f60a43c15ed74b4158f341a4a..354538daefa603f6df5a139b6bff87db } diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index 25ce337ed266be7bafeacd9eb6f53a9474775fc5..37360b896edecf3f2e09f0f7da6a37d6c769c630 100644 +index 505503a3f59d4b747649275c6f6faa504b7c7b64..bee42ce7c1cb0f5ebd4890c02bc9c5dd727f7fd6 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -77,9 +77,9 @@ import net.minecraft.world.phys.shapes.VoxelShape; +@@ -78,9 +78,9 @@ import net.minecraft.world.phys.shapes.VoxelShape; public abstract class BlockBehaviour implements FeatureElement { protected static final Direction[] UPDATE_SHAPE_ORDER = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP}; @@ -19639,7 +19566,7 @@ index 25ce337ed266be7bafeacd9eb6f53a9474775fc5..37360b896edecf3f2e09f0f7da6a37d6 protected final SoundType soundType; protected final float friction; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index de7a5f3812a017131fd1b32fbeff10e325b1cd2e..79bf9c277fe98df176113de39360fb34ad917577 100644 +index e7e2b0fc88c9320449bcd0e0929269c2508886e4..b367184f415b6e20c2fc02a1e8853003349a0a1b 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -130,7 +130,7 @@ public class LevelChunk extends ChunkAccess { @@ -19669,7 +19596,7 @@ index de7a5f3812a017131fd1b32fbeff10e325b1cd2e..79bf9c277fe98df176113de39360fb34 } } } -@@ -1307,10 +1307,10 @@ public class LevelChunk extends ChunkAccess { +@@ -1319,10 +1319,10 @@ public class LevelChunk extends ChunkAccess { if (LevelChunk.this.isTicking(blockposition)) { try { @@ -19683,7 +19610,7 @@ index de7a5f3812a017131fd1b32fbeff10e325b1cd2e..79bf9c277fe98df176113de39360fb34 BlockState iblockdata = LevelChunk.this.getBlockState(blockposition); if (this.blockEntity.getType().isValid(iblockdata)) { -@@ -1321,7 +1321,7 @@ public class LevelChunk extends ChunkAccess { +@@ -1333,7 +1333,7 @@ public class LevelChunk extends ChunkAccess { LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata}); } @@ -19692,7 +19619,7 @@ index de7a5f3812a017131fd1b32fbeff10e325b1cd2e..79bf9c277fe98df176113de39360fb34 } catch (Throwable throwable) { if (throwable instanceof ThreadDeath) throw throwable; // Paper // Paper start - Prevent tile entity and entity crashes -@@ -1332,7 +1332,7 @@ public class LevelChunk extends ChunkAccess { +@@ -1344,7 +1344,7 @@ public class LevelChunk extends ChunkAccess { // Paper end // Spigot start } finally { @@ -19702,7 +19629,7 @@ index de7a5f3812a017131fd1b32fbeff10e325b1cd2e..79bf9c277fe98df176113de39360fb34 } } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java -index 1782d6957fa0290368e443e2e8d7b3c77ac6b8ef..2c9e9d35cd6500aa0ce3b53122067c6a2a15cbf7 100644 +index 060e064625969610539dbf969ce773b877a7c579..32cd9df202704cdfb8fa06aaf0e738d483054feb 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java @@ -112,6 +112,7 @@ public class EntityStorage implements EntityPersistentStorage { @@ -19714,7 +19641,7 @@ index 1782d6957fa0290368e443e2e8d7b3c77ac6b8ef..2c9e9d35cd6500aa0ce3b53122067c6a final EntityType entityType = entity.getType(); final int saveLimit = level.paperConfig().chunks.entityPerChunkSaveLimit.getOrDefault(entityType, -1); diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java -index 1c3718d9244513d9fc795dceb564a81375734557..69753f0b67a78c565ff455676860dc05b24bb285 100644 +index e8ae4449696d73c8c9b8b27d4d2e20db933a72cc..f55c50f6637a4f930b15565d6ac82bb4f27b9059 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java +++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java @@ -51,7 +51,7 @@ public class PhantomSpawner implements CustomSpawner { @@ -19737,7 +19664,7 @@ index 1c3718d9244513d9fc795dceb564a81375734557..69753f0b67a78c565ff455676860dc05 - if (difficultydamagescaler.isHarderThan(randomsource.nextFloat() * 3.0F)) { + if (difficultydamagescaler.isHarderThan(randomsource.nextFloat() * (float) world.purpurConfig.phantomSpawnLocalDifficultyChance)) { // Purpur ServerStatsCounter serverstatisticmanager = ((ServerPlayer) entityhuman).getStats(); - int j = Mth.clamp(serverstatisticmanager.getValue(Stats.CUSTOM.get(Stats.TIME_SINCE_REST)), (int) 1, Integer.MAX_VALUE); + int j = Mth.clamp(serverstatisticmanager.getValue(Stats.CUSTOM.get(Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE); boolean flag2 = true; @@ -78,7 +78,7 @@ public class PhantomSpawner implements CustomSpawner { @@ -19749,7 +19676,7 @@ index 1c3718d9244513d9fc795dceb564a81375734557..69753f0b67a78c565ff455676860dc05 for (int l = 0; l < k; ++l) { // Paper start diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java -index 3f72703d2063a082546305eeb0a1b21629ddb1b2..93f31a99363e73a24571b66cd5bbaf7b5b9084b2 100644 +index 6063665b8848a2cd9f0b262eed36a9dd48db6035..5536b9e36b4ea99e2aaa62690b5bf00208291a58 100644 --- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java +++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java @@ -226,7 +226,7 @@ public abstract class FlowingFluid extends Fluid { @@ -19853,7 +19780,7 @@ index d23481453717f715124156b5d83f6448f720d049..a8af51a25b0f99c3a64d9150fdfcd6b8 startNode.g = 0.0F; startNode.h = this.getBestH(startNode, positions); // Paper - optimize collection diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java -index 894881018c659d874f28f5744f0b8247cfecb1c1..365c3d01a59d117ee9f238b1c1ded645d6b758d3 100644 +index 94a0fde36dda9404e5eb62d323c71dac1929a46b..a7578e112e80ed2585a7eb4fff9542f6068546be 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java @@ -243,7 +243,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { @@ -19865,24 +19792,24 @@ index 894881018c659d874f28f5744f0b8247cfecb1c1..365c3d01a59d117ee9f238b1c1ded645 node = this.findAcceptedNode(x, y + 1, z, maxYStep - 1, prevFeetY, direction, nodeType); if (node != null && (node.type == BlockPathTypes.OPEN || node.type == BlockPathTypes.WALKABLE) && this.mob.getBbWidth() < 1.0F) { double g = (double)(x - direction.getStepX()) + 0.5D; -@@ -475,7 +475,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { - return BlockPathTypes.DANGER_CACTUS; - } - -- if (blockState.is(Blocks.SWEET_BERRY_BUSH)) { -+ if (blockState.is(Blocks.SWEET_BERRY_BUSH) || blockState.is(Blocks.STONECUTTER)) { // Purpur +@@ -463,7 +463,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { + return BlockPathTypes.BLOCKED; + } else { + // Paper end +- if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) { ++ if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH) || blockState.is(Blocks.STONECUTTER)) { // Purpur return BlockPathTypes.DANGER_OTHER; } -@@ -507,7 +507,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { +@@ -493,7 +493,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { + } else if (!blockState.is(BlockTags.TRAPDOORS) && !blockState.is(Blocks.LILY_PAD) && !blockState.is(Blocks.BIG_DRIPLEAF)) { + if (blockState.is(Blocks.POWDER_SNOW)) { return BlockPathTypes.POWDER_SNOW; - } else if (blockState.is(Blocks.CACTUS)) { - return BlockPathTypes.DAMAGE_CACTUS; -- } else if (blockState.is(Blocks.SWEET_BERRY_BUSH)) { -+ } else if (blockState.is(Blocks.SWEET_BERRY_BUSH) || blockState.is(Blocks.STONECUTTER)) { // Purpur - return BlockPathTypes.DAMAGE_OTHER; - } else if (blockState.is(Blocks.HONEY_BLOCK)) { - return BlockPathTypes.STICKY_HONEY; +- } else if (!blockState.is(Blocks.CACTUS) && !blockState.is(Blocks.SWEET_BERRY_BUSH)) { ++ } else if (!blockState.is(Blocks.CACTUS) && !blockState.is(Blocks.SWEET_BERRY_BUSH) && !blockState.is(Blocks.STONECUTTER)) { // Purpur + if (blockState.is(Blocks.HONEY_BLOCK)) { + return BlockPathTypes.STICKY_HONEY; + } else if (blockState.is(Blocks.COCOA)) { diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java index c461e0d04047db9c0c5ecc04063cebd38bf96ec2..e7554ec800f321e4e34c926c53f2375a8c3aa979 100644 --- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java @@ -19915,10 +19842,10 @@ index 31918fa2eb38e42a5ea5366e559f25ea9d7d59ae..15d8e9261a89da30529ac347462c5209 if (context.hasParam(LootContextParams.LOOTING_MOD)) { i = context.getParamOrNull(LootContextParams.LOOTING_MOD); diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java -index 68cc6f2a78a06293a29317fda72ab3ee79b3533a..cfb2e46b34b2982d6724f18214557fc80cf4adfa 100644 +index ffc76354ead6937daf366c3d87bcb51d3e4c47f5..5b98d42b5d6bc07265fbb017e51a6281c148436a 100644 --- a/src/main/java/net/minecraft/world/phys/AABB.java +++ b/src/main/java/net/minecraft/world/phys/AABB.java -@@ -367,4 +367,10 @@ public class AABB { +@@ -374,4 +374,10 @@ public class AABB { public static AABB ofSize(Vec3 center, double dx, double dy, double dz) { return new AABB(center.x - dx / 2.0D, center.y - dy / 2.0D, center.z - dz / 2.0D, center.x + dx / 2.0D, center.y + dy / 2.0D, center.z + dz / 2.0D); } @@ -19930,7 +19857,7 @@ index 68cc6f2a78a06293a29317fda72ab3ee79b3533a..cfb2e46b34b2982d6724f18214557fc8 + // Purpur } diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java -index 7f1ac2cb29eb84833c0895442d611dfa0504527e..5dea8414964e0d2d1fb15a6baa27227e9722bfc7 100644 +index 1d7c663fa0e550bd0cfb9a4b83ccd7e2968666f0..0043c0087896a6df6910b0500da37d84b287c901 100644 --- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java +++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java @@ -86,20 +86,20 @@ public class LevelTicks implements LevelTickAccess { @@ -20181,19 +20108,19 @@ index 714afc98b5150907b45a00060be4e41582333204..312a6d90c0a09570aef24c205dc2ff27 + // Purpur end - OfflinePlayer API } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7ddf52de4b095f63c75b696008fcdde6345fc3c8..584596c8849b4dd7f955216f313eefb3229b375c 100644 +index b2d94582037c091bd6a04451bf62b3f9c4923d19..bc1a2df0a7ddaf030917e4723994464d77e55d02 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -261,7 +261,7 @@ import javax.annotation.Nullable; // Paper +@@ -256,7 +256,7 @@ import javax.annotation.Nullable; // Paper import javax.annotation.Nonnull; // Paper public final class CraftServer implements Server { - private final String serverName = "Pufferfish"; // Paper // Pufferfish -+ private final String serverName = "Purpur"; // Paper // Purpur ++ private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); -@@ -321,6 +321,20 @@ public final class CraftServer implements Server { +@@ -316,6 +316,20 @@ public final class CraftServer implements Server { this.structureManager = new CraftStructureManager(console.getStructureManager()); Bukkit.setServer(this); @@ -20214,7 +20141,7 @@ index 7ddf52de4b095f63c75b696008fcdde6345fc3c8..584596c8849b4dd7f955216f313eefb3 // Register all the Enchantments and PotionTypes now so we can stop new registration immediately after Enchantments.SHARPNESS.getClass(); -@@ -961,6 +975,7 @@ public final class CraftServer implements Server { +@@ -956,6 +970,7 @@ public final class CraftServer implements Server { org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot this.console.paperConfigurations.reloadConfigs(this.console); @@ -20222,7 +20149,7 @@ index 7ddf52de4b095f63c75b696008fcdde6345fc3c8..584596c8849b4dd7f955216f313eefb3 for (ServerLevel world : this.console.getAllLevels()) { // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) -@@ -976,6 +991,7 @@ public final class CraftServer implements Server { +@@ -971,6 +986,7 @@ public final class CraftServer implements Server { } } world.spigotConfig.init(); // Spigot @@ -20230,7 +20157,7 @@ index 7ddf52de4b095f63c75b696008fcdde6345fc3c8..584596c8849b4dd7f955216f313eefb3 } Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper -@@ -991,6 +1007,7 @@ public final class CraftServer implements Server { +@@ -986,6 +1002,7 @@ public final class CraftServer implements Server { this.reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper @@ -20238,7 +20165,7 @@ index 7ddf52de4b095f63c75b696008fcdde6345fc3c8..584596c8849b4dd7f955216f313eefb3 this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -1433,6 +1450,55 @@ public final class CraftServer implements Server { +@@ -1432,6 +1449,55 @@ public final class CraftServer implements Server { return true; } @@ -20294,7 +20221,7 @@ index 7ddf52de4b095f63c75b696008fcdde6345fc3c8..584596c8849b4dd7f955216f313eefb3 @Override public List getRecipesFor(ItemStack result) { Validate.notNull(result, "Result cannot be null"); -@@ -2705,6 +2771,7 @@ public final class CraftServer implements Server { +@@ -2703,6 +2769,7 @@ public final class CraftServer implements Server { @Override public double[] getTPS() { return new double[] { @@ -20302,7 +20229,7 @@ index 7ddf52de4b095f63c75b696008fcdde6345fc3c8..584596c8849b4dd7f955216f313eefb3 net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(), net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(), net.minecraft.server.MinecraftServer.getServer().tps15.getAverage() -@@ -2751,6 +2818,18 @@ public final class CraftServer implements Server { +@@ -2749,6 +2816,18 @@ public final class CraftServer implements Server { return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); } @@ -20321,7 +20248,7 @@ index 7ddf52de4b095f63c75b696008fcdde6345fc3c8..584596c8849b4dd7f955216f313eefb3 @Override public void restart() { org.spigotmc.RestartCommand.restart(); -@@ -2926,4 +3005,16 @@ public final class CraftServer implements Server { +@@ -2924,4 +3003,16 @@ public final class CraftServer implements Server { } // Paper end @@ -20339,7 +20266,7 @@ index 7ddf52de4b095f63c75b696008fcdde6345fc3c8..584596c8849b4dd7f955216f313eefb3 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index c91bac6f3f1d60c950b93d157531cd8f7500e8d8..6a327616cd590b70170f8441c003a2109640201d 100644 +index 5e9055fdf411029ea2fed91acd6b981f79156418..c6a3b59c65466f9f2b16cefe0059a6e5dd84044c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -2253,6 +2253,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -20392,10 +20319,10 @@ index c91bac6f3f1d60c950b93d157531cd8f7500e8d8..6a327616cd590b70170f8441c003a210 public PersistentDataContainer getPersistentDataContainer() { return this.persistentDataContainer; diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index f30621be24c6c3a4f173436fce1ad1c13507c84f..8a4c8701122edf2f29edbe97e4fa199da2744e9e 100644 +index 4966a1e3dd35357a8ea6a7d2944c84c9c3e9058e..ab05f4151e6ec7404a85ddb3a141ed39d9ed86d7 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -166,6 +166,20 @@ public class Main { +@@ -173,6 +173,20 @@ public class Main { .describedAs("Jar file"); // Paper end @@ -20416,8 +20343,8 @@ index f30621be24c6c3a4f173436fce1ad1c13507c84f..8a4c8701122edf2f29edbe97e4fa199d // Paper start acceptsAll(asList("server-name"), "Name of the server") .withRequiredArg() -@@ -270,7 +284,7 @@ public class Main { - System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper +@@ -277,7 +291,7 @@ public class Main { + System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper } - if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { @@ -20426,7 +20353,7 @@ index f30621be24c6c3a4f173436fce1ad1c13507c84f..8a4c8701122edf2f29edbe97e4fa199d Calendar deadline = Calendar.getInstance(); diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java -index 4e56018b64d11f76c8da43fd8f85c6de72204e36..aa8212432825db65cf485cd93f734ccd9eefcb5a 100644 +index 4e56018b64d11f76c8da43fd8f85c6de72204e36..9607675e6c5bff2183c4420d11fc63eeb5747fb6 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java @@ -21,7 +21,12 @@ public class CraftConsoleCommandSender extends ServerCommandSender implements Co @@ -20437,7 +20364,7 @@ index 4e56018b64d11f76c8da43fd8f85c6de72204e36..aa8212432825db65cf485cd93f734ccd + // Purpur start + String[] parts = message.split("\n"); + for (String part : parts) { -+ this.sendRawMessage(part); ++ this.sendRawMessage(part); + } + // Purpur end } @@ -20496,10 +20423,10 @@ index 75c7645fb5732c43d1da15181cf5c7ee4c3ecd6c..e7f5ea4d8d72672cf03483e720c63894 // Paper start @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 750ac80eed6ba03e138dd4c03f57ddfe4a123276..2d5b125b6420ceb3deb5c05fadae458189fe1c0d 100644 +index 57a0dbb23a32123d30c3b3572f4d129be9d97847..9f1017e2e51bd6e0c9a6a59663e1acbf17675f3b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -206,6 +206,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -209,6 +209,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { this.entity = entity; } @@ -20511,7 +20438,7 @@ index 750ac80eed6ba03e138dd4c03f57ddfe4a123276..2d5b125b6420ceb3deb5c05fadae4581 public static CraftEntity getEntity(CraftServer server, Entity entity) { /* * Order is *EXTREMELY* important -- keep it right! =D -@@ -575,6 +580,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -586,6 +591,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { // Paper end if ((!ignorePassengers && this.entity.isVehicle()) || this.entity.isRemoved()) { // Paper - Teleport passenger API @@ -20522,7 +20449,7 @@ index 750ac80eed6ba03e138dd4c03f57ddfe4a123276..2d5b125b6420ceb3deb5c05fadae4581 return false; } -@@ -1407,4 +1416,37 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1442,4 +1451,37 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return !this.getHandle().level.noCollision(this.getHandle(), aabb); } // Paper End - Collision API @@ -20530,7 +20457,7 @@ index 750ac80eed6ba03e138dd4c03f57ddfe4a123276..2d5b125b6420ceb3deb5c05fadae4581 + // Purpur start + @Override + public org.bukkit.entity.Player getRider() { -+ Player rider = getHandle().getRider(); ++ net.minecraft.world.entity.player.Player rider = getHandle().getRider(); + return rider != null ? (org.bukkit.entity.Player) rider.getBukkitEntity() : null; + } + @@ -20546,7 +20473,7 @@ index 750ac80eed6ba03e138dd4c03f57ddfe4a123276..2d5b125b6420ceb3deb5c05fadae4581 + + @Override + public boolean isRidableInWater() { -+ return getHandle().rideableUnderWater(); ++ return !getHandle().dismountsUnderwater(); + } + + @Override @@ -20561,10 +20488,10 @@ index 750ac80eed6ba03e138dd4c03f57ddfe4a123276..2d5b125b6420ceb3deb5c05fadae4581 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index e54574c60c5cbc4e083c4ca11e0b7dd49bd03478..bf69ec45329720980dc126b03e1a6b67f79a17c0 100644 +index c8cccfcf4d572a9e65fce09621aeed2a7045003c..d27916575c5cd380711e7ce1709d8fac429c39e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -258,6 +258,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -265,6 +265,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @Override public void recalculatePermissions() { this.perm.recalculatePermissions(); @@ -20595,7 +20522,7 @@ index 2966d4d466f44751b2f02afda2273a708c12b251..55f19324f92f98e497da49d3022e0edf + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index ecec5e17807a760769fc0ea79c2a0161cc5db1ef..2042d65e9470fca2c35e492d2f8bb4dbf11813cf 100644 +index a925b5c490e7129b27370aa57b5fad1cf05530c6..ea15690da167ec5e653da6f5afb55b33c45d1622 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java @@ -160,4 +160,51 @@ public class CraftItem extends CraftEntity implements Item { @@ -20651,7 +20578,7 @@ index ecec5e17807a760769fc0ea79c2a0161cc5db1ef..2042d65e9470fca2c35e492d2f8bb4db + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 2cff68a5c448c0e971d95e9264223eb943730968..78ac748859e21a61140e9bff67e4527a8d35b4b6 100644 +index aec588b41f19b2147a4e7267bafa417fbcf7abc0..cf7ba8724ab68f6955b5ebfa1ba46c4397da32b3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -444,7 +444,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -20754,10 +20681,10 @@ index 4d7a2c4c1001aefe9fcd4be8dbcb414f721bfff9..2c7716a9d65ebda209a144b82c2126b6 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c546a465a2f85e1b0e785074af15546637619e8f..08649f51adb40fa69d45b95c2d13aa918fff41bf 100644 +index 1bada55af5d16437da4d16f9ded55f88a6121eb4..2b647aeb75e2207186bf9506fba0d92a745cfae8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -524,10 +524,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -525,10 +525,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setPlayerListName(String name) { @@ -20774,7 +20701,7 @@ index c546a465a2f85e1b0e785074af15546637619e8f..08649f51adb40fa69d45b95c2d13aa91 for (ServerPlayer player : (List) server.getHandle().players) { if (player.getBukkitEntity().canSee(this)) { player.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME, this.getHandle())); -@@ -1313,6 +1318,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1336,6 +1341,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } if (entity.isVehicle() && !ignorePassengers) { // Paper - Teleport API @@ -20785,7 +20712,7 @@ index c546a465a2f85e1b0e785074af15546637619e8f..08649f51adb40fa69d45b95c2d13aa91 return false; } -@@ -2288,6 +2297,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2356,6 +2365,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().getAbilities().walkingSpeed * 2f; } @@ -20814,7 +20741,7 @@ index c546a465a2f85e1b0e785074af15546637619e8f..08649f51adb40fa69d45b95c2d13aa91 private void validateSpeed(float value) { if (value < 0) { if (value < -1f) { -@@ -3081,4 +3112,97 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3148,4 +3179,97 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.spigot; } // Spigot end @@ -20913,7 +20840,7 @@ index c546a465a2f85e1b0e785074af15546637619e8f..08649f51adb40fa69d45b95c2d13aa91 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -index 659e2959c5330e4764ea1edc7f8de9f464f9ff52..c2bac8ae958630acaaa8d758e31428d2ac556ccf 100644 +index 42b7058d93fab8cbee49dba130734e1df9910096..5c6f55527cc0016f09b443528463b3906c433f8b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java @@ -34,4 +34,17 @@ public class CraftSnowman extends CraftGolem implements Snowman, com.destroystok @@ -20994,10 +20921,10 @@ index e43fd3e59fd8c74828ae65965fade27f56beef65..b2f133c8baabba1cffa6e92ea0f85453 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 6a52ae70b5f7fd9953b6b2605cae722f606e7fec..b65c39645aa437fdb1ac745ec18bba11f63f092d 100644 +index cdb8ec04f4a19ec3dbedbd5b17a7d1f3afaa238e..16261aa799c34d7134f4c1489e2ab0a5db7992f0 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -545,6 +545,15 @@ public class CraftEventFactory { +@@ -544,6 +544,15 @@ public class CraftEventFactory { // Paper end craftServer.getPluginManager().callEvent(event); @@ -21013,7 +20940,7 @@ index 6a52ae70b5f7fd9953b6b2605cae722f606e7fec..b65c39645aa437fdb1ac745ec18bba11 return event; } -@@ -982,6 +991,7 @@ public class CraftEventFactory { +@@ -981,6 +990,7 @@ public class CraftEventFactory { damageCause = DamageCause.ENTITY_EXPLOSION; } event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), entity.getBukkitEntity(), damageCause, modifiers, modifierFunctions, source.isCritical()); // Paper - add critical damage API @@ -21021,18 +20948,7 @@ index 6a52ae70b5f7fd9953b6b2605cae722f606e7fec..b65c39645aa437fdb1ac745ec18bba11 } event.setCancelled(cancelled); -@@ -1047,6 +1057,10 @@ public class CraftEventFactory { - cause = DamageCause.MAGIC; - } else if (source == DamageSource.IN_FIRE) { - cause = DamageCause.FIRE; -+ // Purpur start -+ } else if (source == DamageSource.STONECUTTER) { -+ cause = DamageCause.CONTACT; -+ // Purpur end - } else { - throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager, source.msgId)); - } -@@ -1088,6 +1102,7 @@ public class CraftEventFactory { +@@ -1090,6 +1100,7 @@ public class CraftEventFactory { } else { entity.lastDamageCancelled = true; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled } @@ -21040,18 +20956,7 @@ index 6a52ae70b5f7fd9953b6b2605cae722f606e7fec..b65c39645aa437fdb1ac745ec18bba11 return event; } -@@ -1122,6 +1137,10 @@ public class CraftEventFactory { - cause = DamageCause.FREEZE; - } else if (source == DamageSource.GENERIC) { - cause = DamageCause.CUSTOM; -+ // Purpur start -+ } else if (source == DamageSource.SCISSORS) { -+ cause = DamageCause.SUICIDE; -+ // Purpur end - } - - if (cause != null) { -@@ -1147,6 +1166,7 @@ public class CraftEventFactory { +@@ -1149,6 +1160,7 @@ public class CraftEventFactory { EntityDamageEvent event; if (damager != null) { event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, modifiers, modifierFunctions, critical); // Paper - add critical damage API @@ -21060,10 +20965,10 @@ index 6a52ae70b5f7fd9953b6b2605cae722f606e7fec..b65c39645aa437fdb1ac745ec18bba11 event = new EntityDamageEvent(damagee.getBukkitEntity(), cause, modifiers, modifierFunctions); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java -index 1f73834043c2d2be17ae647589653d517db36a1b..39f03d0b74b9bfc2eb62d95f2975bcd15bb25bc2 100644 +index 191e8233deaa859d969d54242e297e722f3d947b..76e26542448d18750ce33d53d54c2a77c0590554 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java -@@ -164,8 +164,19 @@ public class CraftContainer extends AbstractContainerMenu { +@@ -166,8 +166,19 @@ public class CraftContainer extends AbstractContainerMenu { case PLAYER: case CHEST: case ENDER_CHEST: @@ -21085,7 +20990,7 @@ index 1f73834043c2d2be17ae647589653d517db36a1b..39f03d0b74b9bfc2eb62d95f2975bcd1 case DISPENSER: case DROPPER: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index 59457378820d7f2899254a6aeef4c30c926ce543..b280d42a0298c04647945cde7bd5a4f5766c301b 100644 +index 44eba9e20651c29a84def786f4a350750fdbdeeb..15b3e89702a6a8dbfcd820ac9654c9c15b95c52f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -82,7 +82,7 @@ public class CraftInventory implements Inventory { @@ -21326,7 +21231,7 @@ index 138407c2d4b0bc55ddb9aac5d2aa3edadda090fb..a6e9e503a496c18e2501b03ec84f4600 // Paper end - add timings for scoreboard search } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 0ccde7fe2a852f7da72f0b3f5a53cb48d28d1840..2d53d30d603a4627ad96dfff659ad04012aaf7f9 100644 +index d4f62940504e3ef7a70e13b1f4a7726f23b4c637..1dd7f923dd6adb41eafc3ea0c063e3aae6670124 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -464,7 +464,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -21339,7 +21244,7 @@ index 0ccde7fe2a852f7da72f0b3f5a53cb48d28d1840..2d53d30d603a4627ad96dfff659ad040 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 80553face9c70c2a3d897681e7761df85b22d464..fb87620c742ff7912f5e8ccd2a7930dd605576d9 100644 +index 80553face9c70c2a3d897681e7761df85b22d464..99597258e8e88cd9e2c901c4ac3ff7faeeabee2b 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java @@ -11,7 +11,7 @@ public final class Versioning { @@ -21347,12 +21252,12 @@ index 80553face9c70c2a3d897681e7761df85b22d464..fb87620c742ff7912f5e8ccd2a7930dd String result = "Unknown-Version"; - InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.pufferfish.pufferfish/pufferfish-api/pom.properties"); // Pufferfish -+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Purpur ++ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur Properties properties = new Properties(); if (stream != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java -index 0f8c5fad3c999da15c5c22b4baed275cf396a5d2..31ef9cd39ce5d9f0a6cec261dfbc4ff3274d8e03 100644 +index ec771c480156db393c326fa2fbdc2d432fb76f53..71940bf3a4162d12a422a5b3100ad8def85f95ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java +++ b/src/main/java/org/bukkit/craftbukkit/util/permissions/CommandPermissions.java @@ -23,7 +23,15 @@ public final class CommandPermissions { @@ -21374,10 +21279,10 @@ index 0f8c5fad3c999da15c5c22b4baed275cf396a5d2..31ef9cd39ce5d9f0a6cec261dfbc4ff3 DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "seed", "Allows the user to view the seed of the world", PermissionDefault.OP, commands); diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..3e6d3b71931a18263eff11841cb4e916ba44e1b8 +index 0000000000000000000000000000000000000000..0bcbe1f07ff8e552d2abd6e432af5710005acc04 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -0,0 +1,638 @@ +@@ -0,0 +1,636 @@ +package org.purpurmc.purpur; + +import co.aikar.timings.TimingsManager; @@ -21652,7 +21557,6 @@ index 0000000000000000000000000000000000000000..3e6d3b71931a18263eff11841cb4e916 + public static float commandCompassBarProgressPercent = 1.0F; + public static int commandCompassBarTickInterval = 5; + public static boolean commandGamemodeRequiresPermission = false; -+ public static int commandFillMaxArea = 32768; + public static boolean hideHiddenPlayersFromEntitySelector = false; + public static String uptimeFormat = ""; + public static String uptimeDay = "%02d day, "; @@ -21692,7 +21596,6 @@ index 0000000000000000000000000000000000000000..3e6d3b71931a18263eff11841cb4e916 + commandCompassBarTickInterval = getInt("settings.command.compass.tick-interval", commandCompassBarTickInterval); + + commandGamemodeRequiresPermission = getBoolean("settings.command.gamemode.requires-specific-permission", commandGamemodeRequiresPermission); -+ commandFillMaxArea = getInt("settings.command.fill.max-area", commandFillMaxArea); + hideHiddenPlayersFromEntitySelector = getBoolean("settings.command.hide-hidden-players-from-entity-selector", hideHiddenPlayersFromEntitySelector); + uptimeFormat = getString("settings.command.uptime.format", uptimeFormat); + uptimeDay = getString("settings.command.uptime.day", uptimeDay); @@ -22018,13 +21921,12 @@ index 0000000000000000000000000000000000000000..3e6d3b71931a18263eff11841cb4e916 +} diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe63cdeb41d +index 0000000000000000000000000000000000000000..fe903b1e1bd211651e3808becd34a2d28dc57f34 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -0,0 +1,3185 @@ +@@ -0,0 +1,3189 @@ +package org.purpurmc.purpur; + -+//import gg.pufferfish.pufferfish.PufferfishConfig; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.Mth; @@ -22124,7 +22026,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public float armorstandStepHeight = 0.0F; -+ public boolean armorstandSetNameVisible = false; ++ public boolean armorstandSetNameVisible = true; + public boolean armorstandFixNametags = false; + public boolean armorstandMovement = true; + public boolean armorstandWaterMovement = true; @@ -22157,7 +22059,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + public boolean milkCuresBadOmen = true; + public boolean milkClearsBeneficialEffects = true; + public boolean noteBlockIgnoreAbove = false; -+ public boolean persistentDroppableEntityDisplayNames = false; ++ public boolean persistentDroppableEntityDisplayNames = true; + public boolean persistentTileEntityDisplayNames = false; + public boolean projectilesBypassMobGriefing = false; + public boolean tickFluids = true; @@ -22261,6 +22163,8 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + public List itemImmuneToFire = new ArrayList<>(); + public List itemImmuneToLightning = new ArrayList<>(); + public boolean dontRunWithScissors = false; ++ public boolean ignoreScissorsInWater = false; ++ public boolean ignoreScissorsInLava = false; + public double scissorsRunningDamage = 1D; + public float enderPearlDamage = 5.0F; + public int enderPearlCooldown = 20; @@ -22310,6 +22214,8 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + if (item != Items.AIR) itemImmuneToLightning.add(item); + }); + dontRunWithScissors = getBoolean("gameplay-mechanics.item.shears.damage-if-sprinting", dontRunWithScissors); ++ ignoreScissorsInWater = getBoolean("gameplay-mechanics.item.shears.ignore-in-water", ignoreScissorsInWater); ++ ignoreScissorsInLava = getBoolean("gameplay-mechanics.item.shears.ignore-in-lava", ignoreScissorsInLava); + scissorsRunningDamage = getDouble("gameplay-mechanics.item.shears.sprinting-damage", scissorsRunningDamage); + enderPearlDamage = (float) getDouble("gameplay-mechanics.item.ender-pearl.damage", enderPearlDamage); + enderPearlCooldown = getInt("gameplay-mechanics.item.ender-pearl.cooldown", enderPearlCooldown); @@ -22456,8 +22362,6 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + public double playerCriticalDamageMultiplier = 1.5D; + public int playerBurpDelay = 10; + public boolean playerBurpWhenFull = false; -+ public boolean playerArmorSwapping = false; -+ public boolean playerArmorSwappingCreativeMakesCopy = true; + public boolean playerRidableInWater = false; + public boolean playerRemoveBindingWithWeakness = false; + public int shiftRightClickRepairsMendingPoints = 0; @@ -22488,8 +22392,6 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + playerCriticalDamageMultiplier = getDouble("gameplay-mechanics.player.critical-damage-multiplier", playerCriticalDamageMultiplier); + playerBurpDelay = getInt("gameplay-mechanics.player.burp-delay", playerBurpDelay); + playerBurpWhenFull = getBoolean("gameplay-mechanics.player.burp-when-full", playerBurpWhenFull); -+ playerArmorSwapping = getBoolean("gameplay-mechanics.player.armor-click-equip.allow-hot-swapping", playerArmorSwapping); -+ playerArmorSwappingCreativeMakesCopy = getBoolean("gameplay-mechanics.player.armor-click-equip.creative-makes-copy", playerArmorSwappingCreativeMakesCopy); + playerRidableInWater = getBoolean("gameplay-mechanics.player.ridable-in-water", playerRidableInWater); + playerRemoveBindingWithWeakness = getBoolean("gameplay-mechanics.player.curse-of-binding.remove-with-weakness", playerRemoveBindingWithWeakness); + shiftRightClickRepairsMendingPoints = getInt("gameplay-mechanics.player.shift-right-click-repairs-mending-points", shiftRightClickRepairsMendingPoints); @@ -23097,14 +22999,16 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + public boolean babiesAreRidable = true; + public boolean untamedTamablesAreRidable = true; + public boolean useNightVisionWhenRiding = false; ++ public boolean useDismountsUnderwaterTag = true; + private void ridableSettings() { + babiesAreRidable = getBoolean("ridable-settings.babies-are-ridable", babiesAreRidable); + untamedTamablesAreRidable = getBoolean("ridable-settings.untamed-tamables-are-ridable", untamedTamablesAreRidable); + useNightVisionWhenRiding = getBoolean("ridable-settings.use-night-vision", useNightVisionWhenRiding); ++ useDismountsUnderwaterTag = getBoolean("ridable-settings.use-dismounts-underwater-tag", useDismountsUnderwaterTag); + } + + public boolean allayRidable = false; -+ public boolean allayRidableInWater = false; ++ public boolean allayRidableInWater = true; + public boolean allayControllable = true; + public List allayRespectNBT = new ArrayList<>(); + private void allaySettings() { @@ -23131,7 +23035,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean batRidable = false; -+ public boolean batRidableInWater = false; ++ public boolean batRidableInWater = true; + public boolean batControllable = true; + public double batMaxY = 320D; + public double batMaxHealth = 6.0D; @@ -23160,7 +23064,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean beeRidable = false; -+ public boolean beeRidableInWater = false; ++ public boolean beeRidableInWater = true; + public boolean beeControllable = true; + public double beeMaxY = 320D; + public double beeMaxHealth = 10.0D; @@ -23190,7 +23094,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean blazeRidable = false; -+ public boolean blazeRidableInWater = false; ++ public boolean blazeRidableInWater = true; + public boolean blazeControllable = true; + public double blazeMaxY = 320D; + public double blazeMaxHealth = 20.0D; @@ -23229,7 +23133,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean catRidable = false; -+ public boolean catRidableInWater = false; ++ public boolean catRidableInWater = true; + public boolean catControllable = true; + public double catMaxHealth = 10.0D; + public int catSpawnDelay = 1200; @@ -23263,7 +23167,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean caveSpiderRidable = false; -+ public boolean caveSpiderRidableInWater = false; ++ public boolean caveSpiderRidableInWater = true; + public boolean caveSpiderControllable = true; + public double caveSpiderMaxHealth = 12.0D; + public boolean caveSpiderTakeDamageFromWater = false; @@ -23325,7 +23229,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean cowRidable = false; -+ public boolean cowRidableInWater = false; ++ public boolean cowRidableInWater = true; + public boolean cowControllable = true; + public double cowMaxHealth = 10.0D; + public int cowFeedMushrooms = 0; @@ -23358,7 +23262,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean creeperRidable = false; -+ public boolean creeperRidableInWater = false; ++ public boolean creeperRidableInWater = true; + public boolean creeperControllable = true; + public double creeperMaxHealth = 20.0D; + public double creeperChargedChance = 0.0D; @@ -23450,7 +23354,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean drownedRidable = false; -+ public boolean drownedRidableInWater = false; ++ public boolean drownedRidableInWater = true; + public boolean drownedControllable = true; + public double drownedMaxHealth = 20.0D; + public double drownedSpawnReinforcements = 0.1D; @@ -23503,7 +23407,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean enderDragonRidable = false; -+ public boolean enderDragonRidableInWater = false; ++ public boolean enderDragonRidableInWater = true; + public boolean enderDragonControllable = true; + public double enderDragonMaxY = 320D; + public double enderDragonMaxHealth = 200.0D; @@ -23533,7 +23437,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean endermanRidable = false; -+ public boolean endermanRidableInWater = false; ++ public boolean endermanRidableInWater = true; + public boolean endermanControllable = true; + public double endermanMaxHealth = 40.0D; + public boolean endermanAllowGriefing = true; @@ -23573,7 +23477,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean endermiteRidable = false; -+ public boolean endermiteRidableInWater = false; ++ public boolean endermiteRidableInWater = true; + public boolean endermiteControllable = true; + public double endermiteMaxHealth = 8.0D; + public boolean endermiteTakeDamageFromWater = false; @@ -23593,7 +23497,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean evokerRidable = false; -+ public boolean evokerRidableInWater = false; ++ public boolean evokerRidableInWater = true; + public boolean evokerControllable = true; + public double evokerMaxHealth = 24.0D; + public boolean evokerBypassMobGriefing = false; @@ -23615,7 +23519,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean foxRidable = false; -+ public boolean foxRidableInWater = false; ++ public boolean foxRidableInWater = true; + public boolean foxControllable = true; + public double foxMaxHealth = 10.0D; + public boolean foxTypeChangesWithTulips = false; @@ -23641,7 +23545,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean frogRidable = false; -+ public boolean frogRidableInWater = false; ++ public boolean frogRidableInWater = true; + public boolean frogControllable = true; + public float frogRidableJumpHeight = 0.65F; + public int frogBreedingTicks = 6000; @@ -23654,7 +23558,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean ghastRidable = false; -+ public boolean ghastRidableInWater = false; ++ public boolean ghastRidableInWater = true; + public boolean ghastControllable = true; + public double ghastMaxY = 320D; + public double ghastMaxHealth = 10.0D; @@ -23676,7 +23580,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean giantRidable = false; -+ public boolean giantRidableInWater = false; ++ public boolean giantRidableInWater = true; + public boolean giantControllable = true; + public double giantMovementSpeed = 0.5D; + public double giantAttackDamage = 50.0D; @@ -23729,7 +23633,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean goatRidable = false; -+ public boolean goatRidableInWater = false; ++ public boolean goatRidableInWater = true; + public boolean goatControllable = true; + public double goatMaxHealth = 10.0D; + public int goatBreedingTicks = 6000; @@ -23771,7 +23675,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean hoglinRidable = false; -+ public boolean hoglinRidableInWater = false; ++ public boolean hoglinRidableInWater = true; + public boolean hoglinControllable = true; + public double hoglinMaxHealth = 40.0D; + public int hoglinBreedingTicks = 6000; @@ -23823,7 +23727,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean huskRidable = false; -+ public boolean huskRidableInWater = false; ++ public boolean huskRidableInWater = true; + public boolean huskControllable = true; + public double huskMaxHealth = 20.0D; + public double huskSpawnReinforcements = 0.1D; @@ -23851,7 +23755,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean illusionerRidable = false; -+ public boolean illusionerRidableInWater = false; ++ public boolean illusionerRidableInWater = true; + public boolean illusionerControllable = true; + public double illusionerMovementSpeed = 0.5D; + public double illusionerFollowRange = 18.0D; @@ -23879,7 +23783,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean ironGolemRidable = false; -+ public boolean ironGolemRidableInWater = false; ++ public boolean ironGolemRidableInWater = true; + public boolean ironGolemControllable = true; + public boolean ironGolemCanSwim = false; + public double ironGolemMaxHealth = 100.0D; @@ -23941,7 +23845,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean magmaCubeRidable = false; -+ public boolean magmaCubeRidableInWater = false; ++ public boolean magmaCubeRidableInWater = true; + public boolean magmaCubeControllable = true; + public String magmaCubeMaxHealth = "size * size"; + public String magmaCubeAttackDamage = "size"; @@ -23967,7 +23871,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean mooshroomRidable = false; -+ public boolean mooshroomRidableInWater = false; ++ public boolean mooshroomRidableInWater = true; + public boolean mooshroomControllable = true; + public double mooshroomMaxHealth = 10.0D; + public int mooshroomBreedingTicks = 6000; @@ -24019,7 +23923,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean ocelotRidable = false; -+ public boolean ocelotRidableInWater = false; ++ public boolean ocelotRidableInWater = true; + public boolean ocelotControllable = true; + public double ocelotMaxHealth = 10.0D; + public int ocelotBreedingTicks = 6000; @@ -24041,7 +23945,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean pandaRidable = false; -+ public boolean pandaRidableInWater = false; ++ public boolean pandaRidableInWater = true; + public boolean pandaControllable = true; + public double pandaMaxHealth = 20.0D; + public int pandaBreedingTicks = 6000; @@ -24063,7 +23967,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean parrotRidable = false; -+ public boolean parrotRidableInWater = false; ++ public boolean parrotRidableInWater = true; + public boolean parrotControllable = true; + public double parrotMaxY = 320D; + public double parrotMaxHealth = 6.0D; @@ -24087,7 +23991,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean phantomRidable = false; -+ public boolean phantomRidableInWater = false; ++ public boolean phantomRidableInWater = true; + public boolean phantomControllable = true; + public double phantomMaxY = 320D; + public float phantomFlameDamage = 1.0F; @@ -24184,7 +24088,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean piglinRidable = false; -+ public boolean piglinRidableInWater = false; ++ public boolean piglinRidableInWater = true; + public boolean piglinControllable = true; + public double piglinMaxHealth = 16.0D; + public boolean piglinBypassMobGriefing = false; @@ -24210,7 +24114,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean piglinBruteRidable = false; -+ public boolean piglinBruteRidableInWater = false; ++ public boolean piglinBruteRidableInWater = true; + public boolean piglinBruteControllable = true; + public double piglinBruteMaxHealth = 50.0D; + public boolean piglinBruteTakeDamageFromWater = false; @@ -24230,7 +24134,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean pillagerRidable = false; -+ public boolean pillagerRidableInWater = false; ++ public boolean pillagerRidableInWater = true; + public boolean pillagerControllable = true; + public double pillagerMaxHealth = 24.0D; + public boolean pillagerBypassMobGriefing = false; @@ -24252,7 +24156,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean polarBearRidable = false; -+ public boolean polarBearRidableInWater = false; ++ public boolean polarBearRidableInWater = true; + public boolean polarBearControllable = true; + public double polarBearMaxHealth = 30.0D; + public String polarBearBreedableItemString = ""; @@ -24297,7 +24201,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean rabbitRidable = false; -+ public boolean rabbitRidableInWater = false; ++ public boolean rabbitRidableInWater = true; + public boolean rabbitControllable = true; + public double rabbitMaxHealth = 3.0D; + public double rabbitNaturalToast = 0.0D; @@ -24383,7 +24287,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean sheepRidable = false; -+ public boolean sheepRidableInWater = false; ++ public boolean sheepRidableInWater = true; + public boolean sheepControllable = true; + public double sheepMaxHealth = 8.0D; + public int sheepBreedingTicks = 6000; @@ -24409,7 +24313,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean shulkerRidable = false; -+ public boolean shulkerRidableInWater = false; ++ public boolean shulkerRidableInWater = true; + public boolean shulkerControllable = true; + public double shulkerMaxHealth = 30.0D; + public boolean shulkerTakeDamageFromWater = false; @@ -24441,7 +24345,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean silverfishRidable = false; -+ public boolean silverfishRidableInWater = false; ++ public boolean silverfishRidableInWater = true; + public boolean silverfishControllable = true; + public double silverfishMaxHealth = 8.0D; + public boolean silverfishBypassMobGriefing = false; @@ -24463,7 +24367,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean skeletonRidable = false; -+ public boolean skeletonRidableInWater = false; ++ public boolean skeletonRidableInWater = true; + public boolean skeletonControllable = true; + public double skeletonMaxHealth = 20.0D; + public boolean skeletonTakeDamageFromWater = false; @@ -24491,20 +24395,10 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + for (int i = 1; i < 4; i++) { + final float divergence; + try { -+ Entity.scriptEngine.eval("difficulty = " + i); -+ final Object result = Entity.scriptEngine.eval(skeletonBowAccuracy); -+ if (result instanceof Long) { -+ divergence = ((Long) result).floatValue(); -+ } else if (result instanceof Double) { -+ divergence = ((Double) result).floatValue(); -+ } else { -+ set("mobs.skeleton.bow-accuracy", defaultSkeletonBowAccuracy); -+ skeletonBowAccuracy = defaultSkeletonBowAccuracy; -+ divergence = ((Long) Entity.scriptEngine.eval(skeletonBowAccuracy)).floatValue(); -+ } -+ } catch (Exception e) { ++ divergence = ((Number) Entity.scriptEngine.eval("let difficulty = " + i + "; " + skeletonBowAccuracy)).floatValue(); ++ } catch (javax.script.ScriptException e) { + e.printStackTrace(); -+ continue; ++ break; + } + skeletonBowAccuracyMap.put(i, divergence); + } @@ -24540,7 +24434,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean slimeRidable = false; -+ public boolean slimeRidableInWater = false; ++ public boolean slimeRidableInWater = true; + public boolean slimeControllable = true; + public String slimeMaxHealth = "size * size"; + public String slimeAttackDamage = "size"; @@ -24566,7 +24460,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean snowGolemRidable = false; -+ public boolean snowGolemRidableInWater = false; ++ public boolean snowGolemRidableInWater = true; + public boolean snowGolemControllable = true; + public boolean snowGolemLeaveTrailWhenRidden = false; + public double snowGolemMaxHealth = 4.0D; @@ -24601,6 +24495,19 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + snowGolemAlwaysDropExp = getBoolean("mobs.snow_golem.always-drop-exp", snowGolemAlwaysDropExp); + } + ++ public boolean snifferRidable = false; ++ public boolean snifferRidableInWater = true; ++ public boolean snifferControllable = true; ++ public double snifferMaxHealth = 14.0D; ++ public int snifferBreedingTicks = 6000; ++ private void snifferSettings() { ++ snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable); ++ snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater); ++ snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable); ++ snifferMaxHealth = getDouble("mobs.sniffer.attributes.max_health", snifferMaxHealth); ++ snifferBreedingTicks = getInt("mobs.sniffer.breeding-delay-ticks", chickenBreedingTicks); ++ } ++ + public boolean squidRidable = false; + public boolean squidControllable = true; + public double squidMaxHealth = 10.0D; @@ -24646,7 +24553,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean strayRidable = false; -+ public boolean strayRidableInWater = false; ++ public boolean strayRidableInWater = true; + public boolean strayControllable = true; + public double strayMaxHealth = 20.0D; + public boolean strayTakeDamageFromWater = false; @@ -24690,7 +24597,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean tadpoleRidable = false; -+ public boolean tadpoleRidableInWater = false; ++ public boolean tadpoleRidableInWater = true; + public boolean tadpoleControllable = true; + private void tadpoleSettings() { + tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable); @@ -24751,7 +24658,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean turtleRidable = false; -+ public boolean turtleRidableInWater = false; ++ public boolean turtleRidableInWater = true; + public boolean turtleControllable = true; + public double turtleMaxHealth = 30.0D; + public int turtleBreedingTicks = 6000; @@ -24773,7 +24680,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean vexRidable = false; -+ public boolean vexRidableInWater = false; ++ public boolean vexRidableInWater = true; + public boolean vexControllable = true; + public double vexMaxY = 320D; + public double vexMaxHealth = 14.0D; @@ -24795,7 +24702,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean villagerRidable = false; -+ public boolean villagerRidableInWater = false; ++ public boolean villagerRidableInWater = true; + public boolean villagerControllable = true; + public double villagerMaxHealth = 20.0D; + public boolean villagerFollowEmeraldBlock = false; @@ -24852,7 +24759,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean vindicatorRidable = false; -+ public boolean vindicatorRidableInWater = false; ++ public boolean vindicatorRidableInWater = true; + public boolean vindicatorControllable = true; + public double vindicatorMaxHealth = 24.0D; + public double vindicatorJohnnySpawnChance = 0D; @@ -24874,7 +24781,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean wanderingTraderRidable = false; -+ public boolean wanderingTraderRidableInWater = false; ++ public boolean wanderingTraderRidableInWater = true; + public boolean wanderingTraderControllable = true; + public double wanderingTraderMaxHealth = 20.0D; + public boolean wanderingTraderFollowEmeraldBlock = false; @@ -24900,7 +24807,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean wardenRidable = false; -+ public boolean wardenRidableInWater = false; ++ public boolean wardenRidableInWater = true; + public boolean wardenControllable = true; + private void wardenSettings() { + wardenRidable = getBoolean("mobs.warden.ridable", wardenRidable); @@ -24909,7 +24816,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean witchRidable = false; -+ public boolean witchRidableInWater = false; ++ public boolean witchRidableInWater = true; + public boolean witchControllable = true; + public double witchMaxHealth = 26.0D; + public boolean witchTakeDamageFromWater = false; @@ -24929,7 +24836,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean witherRidable = false; -+ public boolean witherRidableInWater = false; ++ public boolean witherRidableInWater = true; + public boolean witherControllable = true; + public double witherMaxY = 320D; + public double witherMaxHealth = 300.0D; @@ -24967,7 +24874,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean witherSkeletonRidable = false; -+ public boolean witherSkeletonRidableInWater = false; ++ public boolean witherSkeletonRidableInWater = true; + public boolean witherSkeletonControllable = true; + public double witherSkeletonMaxHealth = 20.0D; + public boolean witherSkeletonTakeDamageFromWater = false; @@ -24987,7 +24894,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean wolfRidable = false; -+ public boolean wolfRidableInWater = false; ++ public boolean wolfRidableInWater = true; + public boolean wolfControllable = true; + public double wolfMaxHealth = 8.0D; + public DyeColor wolfDefaultCollarColor = DyeColor.RED; @@ -25019,7 +24926,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean zoglinRidable = false; -+ public boolean zoglinRidableInWater = false; ++ public boolean zoglinRidableInWater = true; + public boolean zoglinControllable = true; + public double zoglinMaxHealth = 40.0D; + public boolean zoglinTakeDamageFromWater = false; @@ -25039,7 +24946,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean zombieRidable = false; -+ public boolean zombieRidableInWater = false; ++ public boolean zombieRidableInWater = true; + public boolean zombieControllable = true; + public double zombieMaxHealth = 20.0D; + public double zombieSpawnReinforcements = 0.1D; @@ -25104,7 +25011,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean zombieVillagerRidable = false; -+ public boolean zombieVillagerRidableInWater = false; ++ public boolean zombieVillagerRidableInWater = true; + public boolean zombieVillagerControllable = true; + public double zombieVillagerMaxHealth = 20.0D; + public double zombieVillagerSpawnReinforcements = 0.1D; @@ -25138,7 +25045,7 @@ index 0000000000000000000000000000000000000000..4c6853f2f8171e2b9fd78ba5e6bb5fe6 + } + + public boolean zombifiedPiglinRidable = false; -+ public boolean zombifiedPiglinRidableInWater = false; ++ public boolean zombifiedPiglinRidableInWater = true; + public boolean zombifiedPiglinControllable = true; + public double zombifiedPiglinMaxHealth = 20.0D; + public double zombifiedPiglinSpawnReinforcements = 0.0D; @@ -26006,7 +25913,7 @@ index 0000000000000000000000000000000000000000..ba2a37dad43e238e54632975abea8ee6 +} diff --git a/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java new file mode 100644 -index 0000000000000000000000000000000000000000..5e99789e5156e8ffbf125e77114c547e1f8e7925 +index 0000000000000000000000000000000000000000..f0279d6cdc93f524f321c3c40967fdeeb8d2c46b --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java @@ -0,0 +1,104 @@ @@ -26100,7 +26007,7 @@ index 0000000000000000000000000000000000000000..5e99789e5156e8ffbf125e77114c547e + protected void onHitEntity(EntityHitResult entityHitResult) { + Entity shooter = this.getOwner(); + if (shooter instanceof LivingEntity) { -+ entityHitResult.getEntity().hurt(DamageSource.indirectMobAttack(this, (LivingEntity) shooter).setProjectile(), level.purpurConfig.dolphinSpitDamage); ++ entityHitResult.getEntity().hurt(entityHitResult.getEntity().damageSources().mobProjectile(this, (LivingEntity) shooter), level.purpurConfig.dolphinSpitDamage); + } + } + @@ -26183,7 +26090,7 @@ index 0000000000000000000000000000000000000000..c90256f4c16ffdb2d8e767e837ea36ac +} diff --git a/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java b/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java new file mode 100644 -index 0000000000000000000000000000000000000000..b6a594cd6b08c687cf51c2f5494297ef96ec4b92 +index 0000000000000000000000000000000000000000..1542f038621b97a298a0fb31ab3be912e2bcd0d6 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java @@ -0,0 +1,119 @@ @@ -26286,7 +26193,7 @@ index 0000000000000000000000000000000000000000..b6a594cd6b08c687cf51c2f5494297ef + if (shooter instanceof LivingEntity) { + Entity target = entityHitResult.getEntity(); + if (canGrief || (target instanceof LivingEntity && !(target instanceof ArmorStand))) { -+ boolean hurt = target.hurt(DamageSource.indirectMobAttack(this, (LivingEntity) shooter).setProjectile(), level.purpurConfig.phantomFlameDamage); ++ boolean hurt = target.hurt(target.damageSources().mobProjectile(this, (LivingEntity) shooter), level.purpurConfig.phantomFlameDamage); + if (hurt && level.purpurConfig.phantomFlameFireTime > 0) { + target.setSecondsOnFire(level.purpurConfig.phantomFlameFireTime); + } @@ -27362,466 +27269,6 @@ index e9fa7faaa4451e36b3908cbcbbe0baf213abde96..a810bfd3b8d6bd4d8f2ef8797e4281ae } log.log( Level.SEVERE, "------------------------------" ); -diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png -index a7d785f60c884ee4ee487cc364402d66c3dc2ecc..518591dd83289e041a16e2c2e7d7e7640d4b2e1b 100644 -GIT binary patch -literal 9260 -zcmWk!Wmptl7+qlLS~|W3b}1=IK|*5b5@|#_l0AUP -zC6t~Ie$33hbMG7HJ?G9mbDv4n)lnlSVI~2AK;# -z4OMQt9~6LaN1#s_Fh>FQQNXigV2~Fm&;xWcfNA!dm*#+B)G7nz8bF6QFw6s>Er4EOK&%?bF$4;AfiW&% -zoCBC(2Ns!cigf^wAiz2NZqBnLz$Fx@R=#VuNdgNjK)EK+fB@F$fJ{?BsqoI$ED5Mo -z1rqE4Uti#zCSVl@%tLSX$$)HQ;Jq4~ho`CY^a7vP8(5UvMwUftX}AK<&Iwsa{VUUgUh -z2@c>vB_LZ0XlDV+Z-B?IZf;?2Q{C)P0>ZVx9Q3a7hXhz;0*3DaKX~ub_6P=EnF2ok -zcR7!90-gbPNmi@e3BV~F2=oSCMBV|pg>WmCTgLr-01Q8169d>q-)SS&0%(`GBd$p2 -zE<~Lo5bOy|!S8arrBXcyc!~mEJ_FLt@08Ob4a7eO9#jGH#Xy)lfU>@0405w;9)s13%z-g3FI09k4gZC@SEGh21MSdMw@%zE`WMpeH{Z3F$F%s4K+W4gOWCo -zM2#hp$Mq4nbl;~?VJ4luX8W7#1E`a&x!wY&zb88l -zN1p;u{w(({h5e>J1%Y6K8p;U6z`4mh7wrra#_v{h<9beb_Uu_ssLuklU5mIC>bM*t -zcnDp3!57GGcIWN~=GwhPk`|qj+4X29PCWJ%!mm8dv^)i!1KFLpM5tu4Zu)l4x1`+4 -zuool8`RpVod-L>kH&(y$T!#xcuSSC206r^ApC6SB-*ez^5f|E=>CVr`YArBlJ*aH= -zv9&F3YdaKfe*MZ~i5LpP{mi>QT}i><&#tzbf_0y?pPchedeE97X-j8))~zv`+-R^c -zXW+`~MJv5ye2+%Kvb|-$zve#6Fq3j>e(Z$inlS;)z#xljVJ?019I=wkGZKCb>mY`{ -zC8KIq#mXl@3vR}_b~1^fB_&=iJ$$n&3S*05tirE<8!l{ZZCzis{#|hXxvFTM`o}iR -zq}ASGAx!t@bKd6MjeH3iBEIB}%Yan>#e?6>$^PrcHJlA)z3Hwi9`j3t3g5m_#CTR2 -zJWL`g(S4CEDe2|vYOlPr-diIV^oy)GsZk29-%}jHck!wdB5f==uk13XY9^5>Drj(Jal(oLc`8 -z7D=J9cm#rVYK(uzdmUKaOiVbY*(WAOkmLNmxVRVy4%oluYjcE3ejCZtD>w+KsRMI; -z87X<1i$@!2V<|7#NM2W6ZEQ5}eehW7L)rSeirL`4wOgYhpON3G_`a-$K8jR7b1;WL -z!~?6_@enfHT1uN@893H{iZNi1|9834^3*)D`mGffWf%2a)wvAK&u>(jHANwD#zmPX -zb+%6usxsHvd2-@g4UX8e(%gfc=yCIMYT;LE&!w^Hm;hjMmbIls&Ko=!h)JjeBiK7j -zJg8+Wwf=llHxatzP37JYP2MYV!uiXB_G}g(g)9DJKdnb9^WJMK(TfEmW8+Fb{$ocI -zd_IJNIpT-3}l*&5tlx{G{r8LcDpgZGm&_LCN*L6GgC7m* -z9Ckq~9^@3|Q4>gQQNDOZ2HyVd9pW<)EoE)RyU2C+kH**{1?C-Xq|NDRXjCBSZu!dW -zkWoaF%%=W+tXxD?vrJiW1>QdCcU?IwSAAVKXSF08Ri&so^yCRhU8OJJ-7;U}%kOXh -z;uh`2naxh}@bu)!tqCu)Xf)+K3I8Q5)ZcBvHOp43NX8R{ud%yohLd|fFsJPE=-WnM -zy9)c2e5+K_=dT7ym;4dn(y2MkPN*C+c_fH{ZfAWh`@@h_TYs$2*8y!HC~F*!SDduQi((Yakpx9^)x -zJx6lr@C*IFi6C32_c%iv6B`G$;M6Q37L;6Uui3x9r{WSzT7DwjzcfM?D1LbD#A$qd -zu4>LOEHC&2!$+8)#A2;xEg(p|Jdy(=RRcM>kUoYG*Qz;+&oyU511wbY(v-jRqxsns -z%#|?EAim6T>_zCj2<-iPVp$G)<1~m`qSX7m3`(@)$3!@_Il;X3RXlkq+00DbtS7gY -z>#I3K0|TFc5y9cN<3t=oP_kgwm69oEvtnYz&nRnvO7Njr5W~StAj9NIY?n)l*H$Iz -z2YURl{gS{bBrJXar($8yfT4n#w=5%{AEV-@Grkiy0_J -z=#2;?ULHsk`lZB!Pq?X9XYS_xO{hASO}zKeLGkV?N1%z -z>{sH;{En>vxtZU%K&AU5%Gwj}B-+Pkl=AbytOz{;6ed;B5v9!jh)%X6>$P18-6BW0 -z9}ExHska~pvMsOcE?mMPyWj`s*pbbrIhx_ij%6Esl?wROHn#vuvN1k)+M*(8X8`A{ -zS4o(sjn)kE#;i6MtveA?5(&g98!Mcr!J5=}Qa@!L1e14aJEQmcLzXKl5nn2bAJ$tZtP$P8Z1 -zZ>}d+7jWYR^n<^KOqhO^N==PYrD)O9EEFNs=im5ICPNsHVP!Zx`PfqbpT-5=sn650 -zHSeafmr~){Zr!JcC1%$s2t+!}=}Ip+y3BYtETmoWiR}1P><_9ZZ0FT%gEZStrgdbp -zI0aw6jiD;PvU!g!GH_nZQDTX%5h%9pk4-fdm}0u~yzd;=Cni~sWY3r;O}XL;q&8-M -z47pHP%S*mY4oBx}PU^}#j%4iThs7lM7N=#@Fdn{XdiIW0L(=C2~Fu=G5&Vq%Yr -zY&qWfrH35E^L#BnOgMwRc8B)xMX+GlbUbtr`nPrR=jS(Tb=kQ6o7eVqUZd`0fo9D@ -z`vyo59#*A!saE#!$G7Cxfh7n>ZWX!0gkro``0W{b9=XxNGqu#u6^e-7Kk1lUvA@1| -zbiNNGZAv0UHvN5m{KO8QNS~$+u-B>s_5L`L`jBdrke`Xe{0N -zj*umKyN|_A>O3@@8y|M457h5tzNEqIDV$3|c%QOiW7;H(RNLM9W0najA-;HEwdD>u -zkW^fo^J0f?_u(^NWw(nT>JS~~smIbnC8QxFcuQkHNQUJyj;eYMTmvVN^O|RPDvczq -z>kslY@C$0YBmZR=Y@IEsCWJ9}K@HOu`c4n=$kr9!;n+9We=f8unlK5@c*o|I7(=zG -zS}lWvH_fp;i}4qt9>h_?QzN~ap@7nLh*7DJwfvLZAS*_S4BW3*FwwCv)lD1Vg1t7>@!DLp5Su@bc$d;D_VX! -z57eDlJm5IkuTyc>aw+Wt#V5hkX-B+t+|!Fa@@x7=`8`3dZm3$aHF*y2VcD$(D>J3y -z%YwpO#gY%mqyin8q9uH?7OBC}Uv-@)Hl0)Z2+y3x`{XluljPt{<4TU-m$XDvYU9HDGKSg&cT(@MVe23D -z<wCdy-3tTl}j4kzaCmrni9Diizn#a{@0 -zu;<>ZBofe$`#ML)Z*Aj8mbPS3-(VgSdF3LA8LJgBPj{3IaB~uLBuylKO*>ev*i|tuS(Wff3`Ogj^{GsE -zb-&NcY_)d|4#vv+AW}skSWrN{p$KOp?oug)BPoM*O}*h=wrr-PGYCt{qwP-&I!~hn -z&+*{EI5^09slk8i%kFcTjCcO6Oc}M9iiS}cuLLw0fyMPfjZ_M`;HWDHP^ke=f*5^! -z(0!2p!N9nZ8J+AP5sfunmbw64l@2)3@53_`Q@g&4FYKeDLbz2F-Pl@Er#INAtM()n -z<;MFT;osC}L2=Y4P1?cm)V{7nauSgh -zx4)k@#lLT}(uM?{Z&NvzT8pnJk@-MDvv4wOKsY+l9S8OdOw}cex#$t*B6ppAEloQy -z8u`9L`Ky$*$*G}A=)h6BjVn=_YuPie5epXe0vLKZP=Pxps%a&uGrdg4y#R{YobnDn -zWlMl5J;9|5ev`f`BO3Uh(yuK%@i^`+fAimq+_>*)z(;wrFdXn2nVJw1y_>PcV%p-) -zt#ZCU`}~DIE5y1BiI$qSd5XIebq(uRB-FnL#^x=bDHO-ls3({4R}-PgePOPH8ggGN -z^EAdT|N11qATWCZQ}ZY#=hum&;_xeyp*|O{VN?%jM$?&+DK=8LzLP4?U!YQ_JT0`M -z`m!W@TCB5mlr9&jJ{^cX4Ye=uf(7g!BDG1LQfZM#P5u-^$L1K~rOMk7oWI24W>ZJVoZ8!*NX>jC%2pgw@7$v*amGL8JnA`*TjN)y=JPix$ -zHom^xjfr~ZFvhO?xbJHg&jfEZgboIqN@pk*%G-#&cX5DM>_>dMo{P<(#6bOBlgEyG -zzi7pMrVsz<*TT+n%Xo*+rUVN -ztJqe<9EEg`YU)i$PQ+gn%oA5sG>b*6QUjZVf+Ju4QKWr32^B^>#t1pQ*dNT#SxuC8 -zGNJ9mH6R-92O+m#!DECXMrB|3+|cZ$?^qoag;w8-vr)Z5hx@2MVoazOwqdLo2-lu( -ziwF(a3SNH{+U_=d6KFp}-N^eInrfTZ{p%Yc;K{NXO^Sl0qy(%)%sUXL -zA6Ic}&$4}O+ulD-?|#%otX@aO$zD_RW;|WXeL`u5;iz`2Ja937zabkT*wwyB&2HIU -z%>tpNcvDWCsG=IjRr(V|Z7N`9^tphbhiC}fIrVcS>=>)uMStm;g&z-HK{fFz2ud&X -zKo;y87PhB3IZGZ&D%bJ2dZ<-Z7I$fCrPWl6O0ir})>f~+rM8k@!Q(EpWCD9f!k>me -zRhs@Q3_eZ!{s3QHUMaN0uShhn$y!N+)a -z6F#K#O21}#Wz2NGar1LUq3S|3=0~&VTjxVeqcysO1QIGwgglMcjXc3^9R9i556MW! -zA%G1+Y)mPX16RcVB#B?R~Xl -zIeR6G9EBEoU+Sk|=Q=4gQdT~j9ecG~G45m|E+IkhfuBxT`M%^wZkNkXpL0AjS!$%u -zg-={lr6QW@$p<#-f}T{y|0rAEpY~$9`Ffd=BP+`1#;?ge=@mLGkdmI~u?Dai2i+}> -zr-d}7M&xTHsK7@<3$tPd^Yg3fLzxDa!oOJ_N!hGt&$}5!9&TOIuzhIP>)^&CM1CIF -zY>A-293)fzq2lbB(1wKk=>#3=G1eTT&8(iBSJab=V@AGnDSwOhxKg{m8sa~TR||^x -zH?*-f-l|Zq;GkYEt~~O`56i(Z6gi`*^TxMZuc-f=NMlvry~%u2a>kz*@R^tJ@{7%-A@wfa)Z -z0~dL|Z*tTjEX7ED(M%2gZ|Zi_L4TWr%=BR=y4%;?-COo)8t(xaW)#f?Uhc9^d-1?K -z=UDW-cu8J#%~t1$>T7o{K5NXC7Z^ -z;*V>fuSp>3%L~xxUi%mG*w7fJS9FTtSX8!B_=C>_+{-q^3-7Yf_esz?&oN2)zkaPH -z=7a>>$VgQh6LDY?h_Px)L~(27=d%@0UX!M7G~G|aMRJuU!|xkIYM`l6jEi407=MtW -z4YA)qqP8SmCj;2g*%y+BObhJICRimEtC(yhX|B>fl9#O|OsP0h{YfJM(l{DjCSf;_ -zp3jZ#S5YfJ*b;u0&zd}UOl+UMYMCH3kOBnUGziK -zo__#J<(BObj|aew5%LI%9K>!}5UVhW*2b`jvkYQXN*iuj#{{Oatl}s!dyhU&jWEAS -zdKj4YrSTiJ_b6i{@5nk1r@W#B=YNdtri~y>StL>N%B6Gj6O_fwN*T-2>1Q1KuQAXE -zF|^na>CtL$iCMfa_^Bio0%XY3)>F9Uqzf-cky+Lb_H)#4=L+?00yMptx;^o9v}fkd -zWN%~1Sj%)#ggvPi=IpG67#q)qrgFi21qV^a=2vb1s|%}692RR2)zei^W-5JD7Y!4^ -zKfyt1dP(!slOA11Of$_QuYE4W{Uu+DO027{)!7+#Y;Ih{M{`=>H7?QlKD!&7BO7X`Q1_b071zS3lNp -z@&Iv~QHe@3e;q{$b7pE51fo%ee_qC4)CR?kSh?lvkF}D2UuE>>^dhlmktVcN14leO -zB6JLU^U}S?*F=`1q~sTqli@HC^RzgoXWg7-*R1R~2xL-K^`XjV%3c-JMf~;^ILFoK -z%NIwJAU)}8T@nI{XRp;rWaD7cuvC1dj!R2oZ(K-<6)PFEe1C`3{NVSlqPF<~-&+*O -z8>_z7E5JY^sY(1!jgGp<)OE9!*nx9!RX3U}7tvu5m2XXS(V8#x+t;nz?=xkI(DDsz -z;3foX=tMqziX%?kztoj_MYP1$@9}OUi0@Z>26`$9-KBzz0d+H_Z`PU9?gSA=7?H}0 -z{c+|*bet;11)bfWS<)JER^z_5PKJN$@9unBRX+W*oX^32ly -zKo%s>e!Q4Gb1DeiV*R&fzDz|t8*WBSo1ove3somHjybczT^qp^D^Tpx97n^9WuuqI -zTCFUlzMc<9(@Ng!L9ebpnk>0!&~jV#PR~Lz8p-9KECK6 -z;70`vR#D6@#_MoD+$Wl*AAbY|FVo2J6vOlP={WYAqT#$Q!S^VW9|! -zl45qcN$prx36zxggrb_z0Ri=i%$I(SJ6jHx(uR<;b(=zb>GDa-cZTt=EWQ$^+AKKp -z!qtgInkt}{k=PN-erHn(dHX?T{g44@;}a%oYTE7q*K<=mU`H~sCkX#6pyH?M+0W>N -zUr<(Whv)VbXit9iJY4V&;_6xGNVK9d_P*yRzW_7PgbR$4WPdDP8K}{V;@u;E04A#lw1fxY9qPYX%78 -z?2?m&UC)5IREFbfd%r<*8}KZbL-)2J(s!Ni>DER#ah4jLH0*2GPn -zFP?pTI`d2+=5;~B0pYU=P03Hk<$aGh?7&|CDV>N4L&S*{xjJ6{dn!jPj@;!U64ZH$ -zxcv;Jen{NFvhysj-qs<-RN>Q}{r7$Q(|cMV#FVvG1ygSsC^0)`=DwB(4Z7$pIxu3h -zGr}-!!|aUp$DUaVeC9=coIL@I)g|Fm7a7u6JRy|q_3SIEsEkSTn?R2}SIm-}g0D#x -zbFUgC%_08XTvJ@!3#F5}f?b~Rz6CpeASaHdWnNs?a*HD&&M#AO;^>?RDV?gRN(Q&_ -zi^f)H(H|$Fg#yiJBfM*7wTkz_6un^+@bW^qdO0rV -z#80Zot!buo$fS$UtrjI&1`2u(g>;~*Z@I;ZrS@=@)pCyAT-4)ZtWEg^;2QgIBuYCv -zCOT@SpdJ=?l}vNgolDevUl8e7VBri&69qGAFHzdn>vz;Z2PIH&X0IdJxq5&G|lD{8;FN) -zyoId^NoH`da-U0H$$EV_2u9QwI2NQ6xr#xsr4!7>PZTS-+^Ser28(?H>pkyr(t|p)Hl*Rcc?7hPzry4)mHP -zWLX9>Jcr0gs2&(aNg9b2@BIl*r~2X;kn=eI%P577nIX=auf8fXGcC+->CfU?wHoJM -z@{%ht0!KC%-tamvUWKvNx!08PvLF(w-EK-u?Lgd+WfX$LOYI=5t00MKD|Q)#@9mL5 -zWZQ?eQkgCCqwANoAm&K4|fw*k7ipV -zB1v2pR!seE-oV-2@pAb2ne;%k;&0+LB7z16@)VH1MO9)MHU9kSp)dCNVB91j?4mmO -zv3NP2%#IeX=+W7Ni#8IjoTpc(!3T*dt7!EX8VlAzQq6uvFcs%W{$71OuAvW8Wpseg+*PVYLv?WMN=C|H@$;E_S5fVp$L;GyupU7jZ$kfvC58X?uLqEZijH!v -HqBZh=dic2S - -literal 14310 -zcmXY21yoy2uugDycPmm{N^yd_Q`}vP7YOd|PH`>8wLo!q*HRn`6f5rV?*HD)IX5{c -zxpy-=`|Zxo_svGBD$Agwkf4A-AaprdNp;|J21vifLD%hMrT$lZeEex|7Xe0mqFAZArC{!qp)zJmbab@utqA`6 -z61Z~|e!k$IbXNT?PvGuuzT7G514$8e!}lsR>%nURMm+~pde``@(!O=ISt0%B93;Ez -za-qRi4n0Q>zQ2#2^_y08QOl3jT*!Ir5@<8VrFx(6f9sP|H8ttjftN;wrX>jP4BcG1;MfU5x^L`zc09u!bDBt#+ll=7@ -zB;}A$BKgu}V?#qfHvm`~pt%wG2y{MOc%B!8I`p|pc -zO#?sq!Zd&j8UPmvY4RQnfo>!6{a}GFV!}g@qu<3Wu$07X(O`vikNW$~q!ngF23Ls2 -z53p8js<-B_Qd?xX6rtq43Mdz(jOg2QXx#Wng_9^1^^~KqFNq{Kvb@Ap9}bf&xFA-C -z5+#cQ`#v$A=kd0O=agATcleBaxXf_(dnqbQz|cL9R&&Ni1omTs+6~YApmk)MCghxj -z1}mq&IU>1nEiF=q=PI`%jQbyRd=hVI83Sm{E-4uTc#w;NNwEW)C(C`xvWzY_%`_MmO -zD&g-sEaE)}6(&g)y-N&rNy;5@+{M`}!{60Y8wMgF5;HmO#B~hG`W$;7xLG*yF((rq -zxP6I#r#o`B3FppK{v(q1!C+YLFSfySDcHyoW!}EfzuCB1B|C5+oP}dtocnwkcNy1EZ6#5JX4=ePl&cu~0tMnt&79+I4%PaK>VqFx;r!QdNmnxlEqdU-QR%Nmu{aWP -zJxwXvt5fFTCOVgB)Zq -z%H0U=9q7Y0lu&1kc4zYT3*lHA@XJfoK>3WFM&WWf2u6^+wCm8##D$x@Gkw+t^HoO( -z4pxDRqg;$5S=t^k22H5^V3V0Qfy%Ogl8I%LD$52=7)J>Ki9Ej1HyEi_ujELlz8$-+?cdD1Zxi02kW0 -zaY=caFq4~s^R?zxcc3Z0X|az}Aww<{P$>6rk+5Di5J7$kWor0{Q&>+DWSBH^Gf`SP -zT{4}IOFh-hB7xwBdewq%de)q6QvxorV(()2>@j8i!kj)=^hN -zl_N{$9xTHHA;V&Zx#tX&1pOO;v^NiOP#_UK@J;;lp+OOhOOO2mlMdxM;Qv-mWG+^vzox|8t`w| -z=gPlM3)y6G*hfV1WwuMe>bO-vP9g`h5BqgO9x{ROBD;aPl>XDmvt(3PUxt|4RFRpK -z5OEtRz{(Oa_W_!Z4XHf#h;Z-~71XM7wlF*L!-#h_Uy2tGuy-rAZ)4{qE~feNkp}qf -zgvBtLkFPI~I7%C=OHZfPZz$j>L9)rb;l -z@J^dxncy52;wmHg=wC3|Xn6jPYCR7xc}~D0wNjoYxmoRh_zh=6@8coM1UQIa_z*1)cZPw4v40qoZQp-uy#DLv=oP -zX9b3vzFA2r8}|_AO8W1(OMG__0{1AUD&Z%&7-(>s+Z-X6Sv}G5QguIbZ3mYa--?09 -z;wNw?n=yAag4%m#w$$-YZ{(ZJUcwHfzu&!gykNjG)e}!=q8xy2_KS=ULsQwv45NK! -zVqqD8#S{vRjg4(Q6HM_F&tihNIQns<%DVjE$cv33ET>Dvc^#{z&#u&&9RgXO?ZLuebczKv#;! -zCS|2lIa37Bp#3RWj0$V3=I2>o40{(J^LD|EUH?!2;Z&HS*>7*V%{v1)wHaUP85mcX -z%q!K}Ntr*IzJD%++btJ;VQO*OjJL1t{GvR3cy@OC-~pe^bV?N`z0QKCr?Tom)4u%A -z3mi2k&eIgh0^rGI#Di+&3lrsy-r+}zwBkDQtswtPbkj!Y^l`{f!# -zLseC0M;DiifDa!({-G4{W$Wxsgv*(NX%HMyXhArVwY105dUHg?+=@6Sy8n@slS76x -zU7%PI8ToKm#qahfR;7kn#|t@9y(0EkooWBDqA1(mpO)>BBz))giBi8xVHlj#dR9U8 -zRo%`iBdlj8%_tRn^qa%T>{nsLLwTNld&WHLyfbPzv2W62m6q=Nsdxnk -z#{P==5!Lidx3bcr_qlUl%BX!xjywA?jv>FU^mJDa0zQT9Kw8RRHq>7B -zb~DXw0(oqBrOQunsm2ghWV2i1VmN{F?)U;0%*j{FEUxazAJ3)KSWomuhklkDi?5h*MTLDS5ma_Nk1sNZYzZ#$maGRyiXBzjG@(G__fuyBl(^A>s&{jF+J%5| -zv#7nD1XK806#_U_4#N2ANAxznk%;U$Y$z#{K*O07mADqx6LjACqwP<`HFV#C6Q*wx -z8JVP_qGF}V7B?^8)f*2F5AON7v$L~Kr?2}oPai_kG!_6MI(U`LS~+Mo*CSyrw>pPE -zllqxy -z^&rnDn4XA@AUY7~`1lwTCrm8KlVRqX&!kZFH&;i9@=R}UDxNSh*)Iq2U+#9}@ag1t -z%KUOEw0DXT)>hQoLTprY^z=BC=8NAyi3pZWT7A`?;rI<3%65Nqb93%pJ=!+dNtB>W -z7f3O-e-S7ZBgBntcyt~wOG_p$AU2zlGH8=%TEm+z8kLYReEMTkIo#2YiA=iKWrH); -zS%uT3xAyyY=!U)0Evpgx{{38MPR2nN<3913M<0O#YCO=TSt^4IzV3^D%2zC>t_OO} -z_h~AVOk+IIi$Ov;-g93a4j@WaekCC#HFm2_Vu9s)8-GbYtr{LgrxnSIN^PW9)!jYX -z?%-yssA~&R3F)C)wj5i|@!atCx?Qy%P1QEGSZm;iUNai`-F(8a%y+_a>CMzx$XEKx -z>sW|JbN36s+Y{4SZsrspH%UH=+Q6J`c&_-JLGL&5|$XUA1vFOC+rgoc&xT{dFT&pMaEBKwyD;plX0>2nla;jTlQ{!fn2M=Ak*=K*g% -zBm0-$ly1~}CT-5gv){jex9)7&b8u!a+vYHXU>=NF2>g3+_rN{(LUMGwRWKk49sS$v -zazyX8zZ1hwZ|U*5{fK@i@hRl*U%Q2cg+!iIfb)6W%S5F{91qinEZE%~4Gl>rBw9S< -zMP5$exl1jESyt}d~jo?hf`z^32b!}UGtJH+w9(0UrI#~Ei*ii&6z(AVE?(}k_A -zE9Z@mj7HF-ch46I0ipe3gapRj{=zk_J1E^b_JwdrhKi4ytBuwP)m>e$@9v`A{1N{h -zwUN6H=_W+h(a?rGaQ%%LP5C4)XiZ*`1uUwgqWvk`LyDD!Ps#Q5oI($KDJ%8n5kBi- -zghsLx`~mf<>WT)6-cJBbp|htk1NfkZ@e#B4@l?UH7!MDMpO?1NETGk_Eg{z!N3!D< -zWg8gtgS%b(0Bg7dw9u35xq)1vNdnM8iu7Eje*u?#sZ~%^q*HDaZC?5z4ZzhSA%ndS -z4&$M&7(|(9nWY%QShCnuN0 -z`n9&UeypypUgx;R+x;XM#8uDM{p`9~j<49)^dotHJVO*A@HL&g7F={FP#trj@{dzm -zeQUiqRWJ&pkKkA1O-|vOf8O1UQ$$0lIExffio|}F@ROV#MXcPH$ -z?$$kxAF@B#KT}u;R@SVyIO>1sw1!i?C(_013w9@?8$bKaLQi34zC$g*^}F&(%NEO6 -zQzD-^6}HQMnGJ{h$J*)HjSxjblWegsW&rLC8Ov_r_20jLjUS$Ptnm|p9fK%r0j+4; -z57^mjL&lISh8>DC;eB$B69$h4XxE3qU4T&zUpDeV@4g>or%D-x@qhie>6mqD959ck74(h?S0BA0}YQ18d?hr6}%}y{%ZNJ^-(?=Op~; -z#2-UNh)jH9>RXmvPJ(Y!8(uhyW|sFpyvv)AaNeljHj^Fx+RC -z!`@c->W1C^FUKHmG2w_atkdsMnzY+l!CV8havQ8-Gu)<8t{#V*2Pwp4h?ayXsi5Z> -zo!guta>TA~iv#iJpQkN>#)QF%As@2WgU&V_Y^qm#E*O}M_ijJfFWq}ts)-l4>D)kCqJJ@MG2$69ph0jzwI8ry1u8D@CyinC$oT?7S*Z}Eg -zYs}PWLqr4u@)w}#!{cMx;KxO6W2H6~3k$laJjAt+C{0mmCRnfs=OJYbh}HMh&e`#> -zj;jrpjqKCh41OK{FOS`@_sPP$iCm46G^EMNk8(l-1f>!gEV+4vMVRZ#8infUenP+k -zL^tBOHF^=)k&U-Tw{gfijqQ&^ -z-RHHII5yp}2|o8pTsf6x7$teW9Em!~iy2DN?D@|U)g%I6VG%JBO$|~;c~1Q^3|x`1 -z6HRbq1#~Ke)wWpALcc&@P;m+*sGavR0{aOx3=IwUE3YPWAwV45pzD$~02inxi7(6X -z$zk683M=_r#M*+6fQ)&FK0y|lm7JLwS)K=t&ZJk!U_-y%_o@fhr{s37MUEQOF*M)3 -zB$;4>Zx;Xk*(hwFjb>1iJ1f*D#nyWL{=>{2|9*^vCNN!%bF8Oe<`xz#s;jFz?;I}4M3lL;!fy_;J-E96Of+;sG%K=fZdR)99pJ}fM( -zq%(s8UrsEL{NrdF`!#RY+VjFyPpE_vtqPMM!MQ+QnE)+_g9Z^{4^;k&Sa^=w*yuxB_*Z!U%!3{_9Qr)Jfz4IeS#io4oj_Kqhq`HCUub|Ke!v$1-$v=kc+O#rlCej?%dhY -zxxKUTsFPG1nfoFp3%7@gh9S?vM0N27#*fpJyaX;Vy{!pt*}!9_mX9uC#J5RyjknW2Dm3dCvZYU -zSW?0kvI9!o2un}*%`AYhr^CQT1aZF=-Nt^atn@Kt%b2!hT(pK!|MclbBv3-<+6{>_ -z8toMfWc9rpOk(8|KW>Z-k>Fr(xc_+q9ocf`8!_n}XYUrW?Ax|*_|=5m*4F0V+46wJ -z1IGS^Z5t=0Zj86J2MfJc -zUq#WKCfhoB<;P2&&`*_G4^_0uqDR20m!>T8ay_rxSzA&9_v5##g6tzXTkx+KRfz32 -z9vvpp?+YxHTxDthCBu7)&Q052y4s9*$M4_2w-OdPyK?F-EBoUuSsIk@@(!gA*A_!0 -z2eu1y;-Q$Ut(M>8FCOtw?vZR-%*ly^x)<95vK@P0tJoZws@+M*NGhg_NU`!}DZnWBHQz%*@6))$BWN;EM0xAF+B4Mph#S??J?K+&viwPmes*n^HGDL9iBf -zCk|mDu46wwughN!isu&G((DO>Ws`(VLY?^#w=RONxUgFGby--Y=5NJ|(>qXOS`;lZhmXyMEyBdVM@jJh71E-})~`?t4w8^Kwy) -z<+KACjs!F^TS-;FT24_iWF+=l(nR}j7U#;Vd -z)IT3=b&}A}1PUKFa6DKfgHkJci!~7u?a%k9h7Rri^{y`|;;xNDoQbV}+oJ=LdApL}|77o@C= -z;~aed)XpbrMtt1x3gHPWxbliQH4nKBCew{9 -z*-_PTyn~`1VrwKcc4ZrhI^!MsZ{D0O0%O2!SHHi^Dfyr9*x*DGFKwc()b;q6nM*M7 -zvA$x_?$BMJJHN5HIn9Ps{_7-sn79~BZegaa5V;s(BA<5BnU?^AeJHXtd)cIj_UCjA -zW|N@MjV~vrJz{sE0Dzv}tXxUDQAXm)1(kX7C_ZVFX%!TlZ850i(P1A0BxaJu)#LcH -zoxMFRzxoxw$bM=B6gpuMD#vcsa^00?%=D+T9-dQqV*=zD|)W!3BLun2&^n)~$ -z2_^{i9~sGXOAsF_S=k&4mWJ@`mD+G%MiPTlhuomboeFNwHb(< -zVpVR!mwf;JmpO3JL|B%L-!;@7TG}+`HZA;-{VIlQGY|T=f|!9!S=!c?sq5|KeEQ*~ -zm!1xeZcJPbSsfjU9e>K|=Ni<+YgrIG!|5@|Z>4bjx+`1j^O-{QK8XARf -zUG$nLRiTEtt;)9F30rvw>nj)@vCF{$d7>o2n>}~Y2^^C79l@s`uXRZOcuy>^%2@t- -zRGv={pKlDXFUgvG_^DWGR==il1rIzn{$p4r(FVOQxZi!_*Ksfl2hR{Aj>01RbFAM= -zpr0wzMwlOwlkt4|JLK)$>VL+{4nv>^`yMa)T;(9f*B(9;{T+)_=M4dN>M&&hS-#(G -z)-sW(WxVkHR)`x#g)25Lu7qnN;~Q-bvKDZ=;^fyLy@okDpvt&ZU{!U)WVtmnp -zAN-CzM{jPFWep9NAKDDq@=kynkGi_GQ@Z2y_Wn)xc_q3-&+9`qdGy_{PF-2c^$)%x -zd0sonEJhtG*2|P*Q-f_3`Akk96HzBz2 -z!5tnJaCcA2hGQrSw*{F)epvfYX?7toP=O0dN -zizY2w`>O@4Vqff!dBhQ^><#TjMP}loM9ProiD-Og@$V=*zQ|Avg0D!+96lr^u(1fl -z3J52PHoJYDdvdiIW?q?JIC*r?88VruLx#bp0lys39v$(c6uC*j}2IFFh -zViOX|K+DH18cd9%Rgjs$*sXuoW<>p^Fv-7CV|zpgTUnj812pyyX-nhA4TZ^UyYY9; -z?}BOarTT1q;0xSTjV_DPWE11?Y2+wSA*ybzebDoy8JwhznKa6SvYxE$WswX7Z6pG$ -zsA2GgHFFL3^zA@XTYK{a+6$Q8di%@1-|q9U15y+~R-L7Kwx8*xr(FP{g*JDPa`e((jSl#~?Rx=3ne(nLfeP9k0grubJK -zU4euzZqt~$Cl%k^{-!e6YQZi|D3#+MUS}VsYZ)0S>y@)kyqRI?A_esvAu-{`1Uq@! -zC+b`wnMK&<_mitl+k@e*$*{&S>vayX*>D>Q5sw2FZ?l(8ff%(8lo<^mBMrwQXOXe+ -z*7sZdWzBTIwZO$y^F)qZL1XbOMY<@M_a56y{({Vg@YN<_y}toq41V%~w=+4ZQvg)X -zVw~l$z-sId^nKU%dlk7W(mG}eS&KV2BdYqNJnX-p=YrG&&`_m0fzA_|iKD${5?oL* -zdS$heR@%Q+(3!!T&k;tIN|v2j=UI))rgkvyC7MTTrKP3g>Fma@_R0`GE5(tL%sS$7 -zG41ag%(Y(xZ5cjlk=R~(3XC+$25r*Fo=G5OhGgR}i!nDoG?^sult?Eo*x$x6CH-3L@LtZ0dfq!Bbbw-S}RwlN%lpH8c=4l2qH -z1wRszHSPh~=esnWvXD8B{D4<}?}6cA+@Ob1760Is6`g!zl@WL(L&={LA}SxAt0>Tw -z%b7i^&yNKM;(vGcNwuxAK{g|S3Y1&pH_6U1G -z3M4zx5FU=O;=l_?VzQ-~bx~xN1axPgYI0am3d25BjYmfSTX7Q}==Vcryl6@Se0(Jv -zxKW_o%H`jdnC7QXlkFbCsACHN1Dx=0gf<~@PW-&<=`1Hd)@#ypH7%OpalDj-P=ts+3^~yWs~TV}BD20HjkW6zc1L -z0#HzMkn3JV%7N-18_@tgE82*YnmEzxirriDSx#_|<|q1vL{k}7>^mRzO(ueTSN2~H -zG}kxp)Qn!&)><3|e>62+GXSpQKcemfqU!&BHZ5Ca;DT<63bBM&uV1BDS?MM$M;x8w>gShAPMxJM^BbMZn}Unm{OC9^4x3%% -zlmX8!km-u$N4fQXQ>jRe`7)3+RFGjhz -z18zf(Fo2<>YV^7LJO^UTZ2Ivd#mpN}o?7pBV&q=f%ID>haV7M8R3jsF*@a%iwIy>| -zsZ!-y{!%&j7`B?W8TcF4NH-RHH1xZ{;7BsA<#APu!;cND)te)FhoXz$BIU}2&^7WP -zT}TX>ZO58$VNPuh6JV7~s(W$vAj`^%AtUamex3YdVl3~4+pqk?G)qUibNMrj0*M25 -zY>5Ac|Dnv6xBQmV#$3JA?&HTN(lYl~J}@$l{*TY^kORrCB)3dDO}^^v!dcLf^CHty -zanjllIQeSLmpuG+h&ae`r*v!C*0A&W^a&q>93?BAXzG7n -z2*3TGPIcN`-_hY9&oaiv#fiv~>}7`T`4=pInEqWX*3e8+yPm^9h-tr&ts55$l+388 -zW)~F}2JH!}VLbQ>?6~H@&k`MnSsTeVj0TRVP4jGbP*!!CwM6`Z11c)yI2w$+R0zxo -zT|obYS1&&`{>>Z9(jnVU&=yI*%PGe*f78ie*_9oap?sd7fx7{r^WT>=XHF -zl`f{=UJEn2?tRw`Fem?eRE6#*nOes(ebRcmaK3~a3{a3EyE1zXSF0p7I_iDJ&%;3V -zU;AS}e?*mH#Yh2P9E3QBigIqu2iXf=@t)2+I~f*_E^JtEP1@IR{CBfTj%T}E3e#n% -zUa{@vU?D$l4DEANwkkK@ruP4ta)E*e^KLGg%$PizyPmHvKNMWtuJQ6sPXY=(1m#>W -z7V?9E!Vj}>a|KfQx5ESpH+q6$@gAp-P#~lbz`aj1_?xinN>3o8b2-Z3w>UZ3QZ}W0 -zWg-!>p>AADDcU^4;0*L4UFgB0QLlXd^y1E&4>txV!T|!`RwjZGl`;-4ZgFf>luHIy -zZ8d8Rh{I3r!g-ht6mAZxMB6VxRqnA0UY`h|mJZy2 -z17BazT$jMKFL3J6Ue_HL1^)4s%$Jj~Qx~1HG#tS@kwL(KP_ZI3dWz0SH(sqj#-*TNGsIWqPj>cj?!GyWvfdEiNOu4$>MIqL=F&Cc0{g*~L5 -zA1wt)=_zMFUkCT5$l!G{1-Y9QtGQ#qm5E(3fYPms_EP*sSVI)bfXN|uNO`BqVuCvd -zv)z8IGRgtM1<_trndVhQ^xA)wn~*W~#d*X@E=W)jcQWI8+?kdzHe;DZ`%+JE%gE}m -z6H=FO8rJxM{N90S=Gi!Mel)TyanxPa;E}C?hJl@e9UWad->;S|v;axgFjrY$z3(rV{MiJ}3M)t;Q?P5wZy0e3G{dcDO7n}3slDXLMrB$;#*W@Qv)D$=?Xs$F(8eTcyGIQ~IWgD%Gn&E>F9y#o>cR-7spE;Rur<_E~Pu)e0I -z#&y1|@8D~8c55<|KMf;&x;hg!A%VOZ38_+uk`jH4#=b9M&xcpxV-7cMN{jXVRnKSe -zlKJJ%=VBV{$DNeI1QkiA;DfdVT?$;O#22z6v6bTK9)fjrfIh!Hq__l~KzuNqT{&kA -zKs@YV6^1ZLGjTgR%(=NHS-DvWnnP)NM#qbHINqmQdCE5??co$3nuikqgm=s7*#Kd*+j_weKrZjMeLeHEoiJm>zuDRU` -zh~ggr^knneWU!Nn}AQt=0Id6Hk; -z4bJqse|V$H`stT?NS0yreYvaZ9YF!fw+N}{3#yXRU!C7?exl35BDC%+!jDMGT^DN# -zN9FGd#5t#;$h}5UgQ?q-Gr15>C6=nLUszle9<+_!!oi_m@_L^-R>_Qty7_g|C%m|5 -z-7^5X5V_ARi?h9_LW%2vByD3X_IvUktqBv{%SYXO1&;e&O#Ll_cfC`Wv1u+l_#RI< -zQ5Kly0;P`%TXaQN(heOg~>V&L{d+ZDA%eq-UKo#1)$rkjSm=nzAE2r -z5--RyKhxfXoGVU3^ab{5XGlyL1+26foG)4HZvN -zG@&I3h0fnK5lIjcrg*XxPy1(gK3_TN`&VYnxP;C|j$~0rT$0f|*#=OzM^NbE-1T5D -z%Csnt)n!sx3N#b(8G&+G3W~Q_B#StA6jZZ=p#wuu`DrAMXm{T@#S;ku4Dme@{Njmk -zCtrh3z6O>o)~o{&Htx+6kn*)$NNBH-biu^aYtWUq -z(G>4rCEKr#tO>!x8A@%W@6g)Xs%2Hq!y#Mbb@9R2@GDWi&!{jhZvzQ1D9nMuPoOS+ -z+cj{9nx5X{jJOIavbFf)Kz5Jnbe5Bu#(XE-z$j&iaP%c9W59OoT0~|N#D*(N2kz={ -zs(|)nH!_+_g1)#ZH2xk>ZTG#6WN#qa3BxZM{NWxq`*#$H255k6Ky?hw*hSA6`c_fl -zT@Ua%E5Ez3;~`kQFmrC#$Nlvc_Uy3#yzhd-6UYuuIwgIBZZC-`dwOBJbfurL(FfhH -z{YkjE+9OrOveY`{t{sGw&51YO1@{iO4)Ki=!Z5#q=m_Hi)_j0`>?;t2j);vv%BUif -z;wpTZdLQLsGvZ()DCdxYudn^Pt;BZ}Rin$4F8h{R`HxT2z`uc&aMXIQOvwgA5%{&) -zFW52MiN!$!EXgx}Px~e1!EMp;#&kY65oDho95j~!qD%YJr`+aK4jCJ4UJ^;q>w@Lf -zvDfg|M`S^@DGxu+7aR3Cx#;%?advj&1~L-m -zJqCP9&TW3migV*`Z$#)Qa>3>Jf)g9D6Ki28P@iX(uso)hic8Dp1F< -zeF;(n8Po8A*~^T{De(J)Z2nqLl@Vv3yoSlGwq0aeOg4ymI(KIkTeur-=J-yp9z?qe)it6gq-wl@I -z0D-_I{|T<5kwD9uH3yf1GWXp5*8eOgJf*q0IRoK|+r{}Fug&0WpNDKMTC@(Xc)9K8 -zy`lByMn!1fnY)1KYP(0Je1)c~WilUuh<&Q8^OE?L9Q^xK*Y@M$`6D6TDCZ^@l8{|} -zxmmNw)mng$hYBii+&ZqedxWT0dnV#LG4zC%+kzcK+-??vEHT>Q-T8zu|s_1IbA#OV)^+1pg1OmmZn` - diff --git a/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java b/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java index b2d510459bcf90a3611f3d91dae4ccc3d29b4079..7a052f6deaa30f8a177a2aaf172f9da6c308a22b 100644 --- a/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java diff --git a/patches/server/0003-Rebrand.patch b/patches/server/0003-Rebrand.patch index 1f03e4a..650c62c 100644 --- a/patches/server/0003-Rebrand.patch +++ b/patches/server/0003-Rebrand.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand diff --git a/build.gradle.kts b/build.gradle.kts -index 0435c1eb5c1fa6f9180ee8dc36a61afbac0f952e..0041d19a476ce01cc7c5a718c9ea7982258207b7 100644 +index 6c5b3f6a2c4f7b20e3388b63c36b7c4bc4cf179f..e4de94641d33b3deadc44bbb5f23f666d79737ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { @@ -13,29 +13,29 @@ index 0435c1eb5c1fa6f9180ee8dc36a61afbac0f952e..0041d19a476ce01cc7c5a718c9ea7982 dependencies { - implementation(project(":purpur-api")) // Purpur -+ implementation(project(":plazma-api")) // Pufferfish // Purpur // Plazma - // Pufferfish start - implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") { - exclude("io.papermc.paper", "paper-api") -@@ -85,7 +85,7 @@ tasks.jar { ++ implementation(project(":plazma-api")) // Purpur + implementation("io.papermc.paper:paper-mojangapi:1.19.4-R0.1-SNAPSHOT") // Purpur + // Paper start + implementation("org.jline:jline-terminal-jansi:3.21.0") +@@ -82,7 +82,7 @@ tasks.jar { attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", -- "Implementation-Version" to "git-Purpur-$implementationVersion", // Purpur +- "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur + "Implementation-Version" to "git-Plazma-$implementationVersion", // Pufferfish // Purpur // Plazma "Implementation-Vendor" to date, // Paper "Specification-Title" to "Bukkit", "Specification-Version" to project.version, diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 9713263c3bd34ab8a3bfc0a8797ba0b1b88ed733..f66b7a84ee3bb433dd286175c2e74a6ccaceeaa9 100644 +index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..7d80d2cf5d607d6051e99e4b08bc1b76098a79da 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -593,7 +593,7 @@ public class Metrics { boolean logFailedRequests = config.getBoolean("logFailedRequests", false); // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { -- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Purpur -+ Metrics metrics = new Metrics("Plazma", serverUUID, logFailedRequests, Bukkit.getLogger()); // Purpur // Plazma +- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur ++ Metrics metrics = new Metrics("Plazma", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); @@ -49,7 +49,7 @@ index 9713263c3bd34ab8a3bfc0a8797ba0b1b88ed733..f66b7a84ee3bb433dd286175c2e74a6c metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index fba5dbdb7bcbb55400ef18342c9b54612972a718..95c4bc1a58aa7e447f62d5553111d9967cbd3cba 100644 +index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..fec95437c1ad602f64c4d4d02c276199f27babbd 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java @@ -20,7 +20,7 @@ import java.util.stream.StreamSupport; @@ -85,33 +85,35 @@ index fba5dbdb7bcbb55400ef18342c9b54612972a718..95c4bc1a58aa7e447f62d5553111d996 } private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) { -+ /* // Plazma - Disalbe CI Checking ++ /* // Plazma - Disable CI Checking //int distance; // Purpur - use field try { int jenkinsBuild = Integer.parseInt(versionInfo); -@@ -65,6 +66,9 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -65,6 +66,11 @@ public class PaperVersionFetcher implements VersionFetcher { versionInfo = versionInfo.replace("\"", ""); distance = fetchDistanceFromGitHub(repo, branch, versionInfo); } -+ */ // Plazma - Disable CI Checking ++ // Plazma start - Disable CI Checking ++ */ + versionInfo = versionInfo.replace("\"", ""); // Plazma + distance = fetchDistanceFromGitHub(repo, branch, versionInfo); // Plazma ++ // Plazma end switch (distance) { case -1: -@@ -83,6 +87,7 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -83,6 +89,7 @@ public class PaperVersionFetcher implements VersionFetcher { } } -+ /* // Plazma - Disalbe CI Checking ++ /* // Plazma - Disable CI Checking private static int fetchDistanceFromSiteApi(int jenkinsBuild, @Nullable String siteApiVersion) { if (siteApiVersion == null) { return -1; } try { -@@ -102,6 +107,7 @@ public class PaperVersionFetcher implements VersionFetcher { +@@ -102,6 +109,7 @@ public class PaperVersionFetcher implements VersionFetcher { return -1; } } -+ */ // Plazma - Disalbe CI Checking ++ */ // Plazma - Disable CI Checking // Contributed by Techcable in GH-65 private static int fetchDistanceFromGitHub(@Nonnull String repo, @Nonnull String branch, @Nonnull String hash) { @@ -129,7 +131,7 @@ index 3cb56595822799926a8141e60a42f5d1edfc6de5..19d1d136fc28d6c114f6bc44c6450d2d .completer(new ConsoleCommandCompleter(this.server)) .option(LineReader.Option.COMPLETE_IN_WORD, true); diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java -index b5b6657e52e4f7a630229bd3ba433438af293e22..b370d01794c9e47970e70b06c0f5781c3f57fa4b 100644 +index b5b6657e52e4f7a630229bd3ba433438af293e22..c468733f44ccb3ff4ba3c20921a4ec52658f0689 100644 --- a/src/main/java/net/minecraft/CrashReport.java +++ b/src/main/java/net/minecraft/CrashReport.java @@ -35,7 +35,7 @@ public class CrashReport { @@ -146,15 +148,15 @@ index b5b6657e52e4f7a630229bd3ba433438af293e22..b370d01794c9e47970e70b06c0f5781c // Purpur start stringbuilder.append("// "); - stringbuilder.append("// DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!"); -+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER! REPORT TO PLAZMA INSTEAD!"); // Plazma ++ stringbuilder.append("// DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO PLAZMA INSTEAD!"); // Plazma // Purpur end stringbuilder.append("// "); stringbuilder.append(CrashReport.getErrorComment()); diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 781b72fd88149642c9fceaecfbfe7546273fb749..a3c79863717d7eef1261f475d797ae9dda251bcb 100644 +index c6fa6bcd66d61359124a8426b919493c6ec43f06..e0eaa847526431ac58d00f18f0fca6b1ef9a79cd 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -76,6 +76,17 @@ public class Main { +@@ -81,6 +81,17 @@ public class Main { @DontObfuscate public static void main(final OptionSet optionset) { // CraftBukkit - replaces main(String[] astring) @@ -173,10 +175,10 @@ index 781b72fd88149642c9fceaecfbfe7546273fb749..a3c79863717d7eef1261f475d797ae9d /* CraftBukkit start - Replace everything OptionParser optionparser = new OptionParser(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1772800c123353207e3563a7e2c2b70431aec097..ba6d5d63d6de5db581c8bc94155d8a3acf8f67c3 100644 +index 5416b64c3000c9b17a78991218e068bf5ef33db7..180ea5edb002856f975c074e319998b68b67a7af 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -927,7 +927,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop{>7YoHkOb)o5Fqp}ErNg)l_mnxqzWP+O`3v& @@ -151,183 +151,280 @@ zbcevWFRs$cw3KnHyYQIwJ2<`E`}Gx@SB_da=gU@t>?d{(J_f%I*#JJGPMl?+vDILd z8G0l3%pGRk0tFo1dWx7B8dOOGk^W0AUP -zC6t~Ie$33hbMG7HJ?G9mbDv4n)lnlSVI~2AK;# -z4OMQt9~6LaN1#s_Fh>FQQNXigV2~Fm&;xWcfNA!dm*#+B)G7nz8bF6QFw6s>Er4EOK&%?bF$4;AfiW&% -zoCBC(2Ns!cigf^wAiz2NZqBnLz$Fx@R=#VuNdgNjK)EK+fB@F$fJ{?BsqoI$ED5Mo -z1rqE4Uti#zCSVl@%tLSX$$)HQ;Jq4~ho`CY^a7vP8(5UvMwUftX}AK<&Iwsa{VUUgUh -z2@c>vB_LZ0XlDV+Z-B?IZf;?2Q{C)P0>ZVx9Q3a7hXhz;0*3DaKX~ub_6P=EnF2ok -zcR7!90-gbPNmi@e3BV~F2=oSCMBV|pg>WmCTgLr-01Q8169d>q-)SS&0%(`GBd$p2 -zE<~Lo5bOy|!S8arrBXcyc!~mEJ_FLt@08Ob4a7eO9#jGH#Xy)lfU>@0405w;9)s13%z-g3FI09k4gZC@SEGh21MSdMw@%zE`WMpeH{Z3F$F%s4K+W4gOWCo -zM2#hp$Mq4nbl;~?VJ4luX8W7#1E`a&x!wY&zb88l -zN1p;u{w(({h5e>J1%Y6K8p;U6z`4mh7wrra#_v{h<9beb_Uu_ssLuklU5mIC>bM*t -zcnDp3!57GGcIWN~=GwhPk`|qj+4X29PCWJ%!mm8dv^)i!1KFLpM5tu4Zu)l4x1`+4 -zuool8`RpVod-L>kH&(y$T!#xcuSSC206r^ApC6SB-*ez^5f|E=>CVr`YArBlJ*aH= -zv9&F3YdaKfe*MZ~i5LpP{mi>QT}i><&#tzbf_0y?pPchedeE97X-j8))~zv`+-R^c -zXW+`~MJv5ye2+%Kvb|-$zve#6Fq3j>e(Z$inlS;)z#xljVJ?019I=wkGZKCb>mY`{ -zC8KIq#mXl@3vR}_b~1^fB_&=iJ$$n&3S*05tirE<8!l{ZZCzis{#|hXxvFTM`o}iR -zq}ASGAx!t@bKd6MjeH3iBEIB}%Yan>#e?6>$^PrcHJlA)z3Hwi9`j3t3g5m_#CTR2 -zJWL`g(S4CEDe2|vYOlPr-diIV^oy)GsZk29-%}jHck!wdB5f==uk13XY9^5>Drj(Jal(oLc`8 -z7D=J9cm#rVYK(uzdmUKaOiVbY*(WAOkmLNmxVRVy4%oluYjcE3ejCZtD>w+KsRMI; -z87X<1i$@!2V<|7#NM2W6ZEQ5}eehW7L)rSeirL`4wOgYhpON3G_`a-$K8jR7b1;WL -z!~?6_@enfHT1uN@893H{iZNi1|9834^3*)D`mGffWf%2a)wvAK&u>(jHANwD#zmPX -zb+%6usxsHvd2-@g4UX8e(%gfc=yCIMYT;LE&!w^Hm;hjMmbIls&Ko=!h)JjeBiK7j -zJg8+Wwf=llHxatzP37JYP2MYV!uiXB_G}g(g)9DJKdnb9^WJMK(TfEmW8+Fb{$ocI -zd_IJNIpT-3}l*&5tlx{G{r8LcDpgZGm&_LCN*L6GgC7m* -z9Ckq~9^@3|Q4>gQQNDOZ2HyVd9pW<)EoE)RyU2C+kH**{1?C-Xq|NDRXjCBSZu!dW -zkWoaF%%=W+tXxD?vrJiW1>QdCcU?IwSAAVKXSF08Ri&so^yCRhU8OJJ-7;U}%kOXh -z;uh`2naxh}@bu)!tqCu)Xf)+K3I8Q5)ZcBvHOp43NX8R{ud%yohLd|fFsJPE=-WnM -zy9)c2e5+K_=dT7ym;4dn(y2MkPN*C+c_fH{ZfAWh`@@h_TYs$2*8y!HC~F*!SDduQi((Yakpx9^)x -zJx6lr@C*IFi6C32_c%iv6B`G$;M6Q37L;6Uui3x9r{WSzT7DwjzcfM?D1LbD#A$qd -zu4>LOEHC&2!$+8)#A2;xEg(p|Jdy(=RRcM>kUoYG*Qz;+&oyU511wbY(v-jRqxsns -z%#|?EAim6T>_zCj2<-iPVp$G)<1~m`qSX7m3`(@)$3!@_Il;X3RXlkq+00DbtS7gY -z>#I3K0|TFc5y9cN<3t=oP_kgwm69oEvtnYz&nRnvO7Njr5W~StAj9NIY?n)l*H$Iz -z2YURl{gS{bBrJXar($8yfT4n#w=5%{AEV-@Grkiy0_J -z=#2;?ULHsk`lZB!Pq?X9XYS_xO{hASO}zKeLGkV?N1%z -z>{sH;{En>vxtZU%K&AU5%Gwj}B-+Pkl=AbytOz{;6ed;B5v9!jh)%X6>$P18-6BW0 -z9}ExHska~pvMsOcE?mMPyWj`s*pbbrIhx_ij%6Esl?wROHn#vuvN1k)+M*(8X8`A{ -zS4o(sjn)kE#;i6MtveA?5(&g98!Mcr!J5=}Qa@!L1e14aJEQmcLzXKl5nn2bAJ$tZtP$P8Z1 -zZ>}d+7jWYR^n<^KOqhO^N==PYrD)O9EEFNs=im5ICPNsHVP!Zx`PfqbpT-5=sn650 -zHSeafmr~){Zr!JcC1%$s2t+!}=}Ip+y3BYtETmoWiR}1P><_9ZZ0FT%gEZStrgdbp -zI0aw6jiD;PvU!g!GH_nZQDTX%5h%9pk4-fdm}0u~yzd;=Cni~sWY3r;O}XL;q&8-M -z47pHP%S*mY4oBx}PU^}#j%4iThs7lM7N=#@Fdn{XdiIW0L(=C2~Fu=G5&Vq%Yr -zY&qWfrH35E^L#BnOgMwRc8B)xMX+GlbUbtr`nPrR=jS(Tb=kQ6o7eVqUZd`0fo9D@ -z`vyo59#*A!saE#!$G7Cxfh7n>ZWX!0gkro``0W{b9=XxNGqu#u6^e-7Kk1lUvA@1| -zbiNNGZAv0UHvN5m{KO8QNS~$+u-B>s_5L`L`jBdrke`Xe{0N -zj*umKyN|_A>O3@@8y|M457h5tzNEqIDV$3|c%QOiW7;H(RNLM9W0najA-;HEwdD>u -zkW^fo^J0f?_u(^NWw(nT>JS~~smIbnC8QxFcuQkHNQUJyj;eYMTmvVN^O|RPDvczq -z>kslY@C$0YBmZR=Y@IEsCWJ9}K@HOu`c4n=$kr9!;n+9We=f8unlK5@c*o|I7(=zG -zS}lWvH_fp;i}4qt9>h_?QzN~ap@7nLh*7DJwfvLZAS*_S4BW3*FwwCv)lD1Vg1t7>@!DLp5Su@bc$d;D_VX! -z57eDlJm5IkuTyc>aw+Wt#V5hkX-B+t+|!Fa@@x7=`8`3dZm3$aHF*y2VcD$(D>J3y -z%YwpO#gY%mqyin8q9uH?7OBC}Uv-@)Hl0)Z2+y3x`{XluljPt{<4TU-m$XDvYU9HDGKSg&cT(@MVe23D -z<wCdy-3tTl}j4kzaCmrni9Diizn#a{@0 -zu;<>ZBofe$`#ML)Z*Aj8mbPS3-(VgSdF3LA8LJgBPj{3IaB~uLBuylKO*>ev*i|tuS(Wff3`Ogj^{GsE -zb-&NcY_)d|4#vv+AW}skSWrN{p$KOp?oug)BPoM*O}*h=wrr-PGYCt{qwP-&I!~hn -z&+*{EI5^09slk8i%kFcTjCcO6Oc}M9iiS}cuLLw0fyMPfjZ_M`;HWDHP^ke=f*5^! -z(0!2p!N9nZ8J+AP5sfunmbw64l@2)3@53_`Q@g&4FYKeDLbz2F-Pl@Er#INAtM()n -z<;MFT;osC}L2=Y4P1?cm)V{7nauSgh -zx4)k@#lLT}(uM?{Z&NvzT8pnJk@-MDvv4wOKsY+l9S8OdOw}cex#$t*B6ppAEloQy -z8u`9L`Ky$*$*G}A=)h6BjVn=_YuPie5epXe0vLKZP=Pxps%a&uGrdg4y#R{YobnDn -zWlMl5J;9|5ev`f`BO3Uh(yuK%@i^`+fAimq+_>*)z(;wrFdXn2nVJw1y_>PcV%p-) -zt#ZCU`}~DIE5y1BiI$qSd5XIebq(uRB-FnL#^x=bDHO-ls3({4R}-PgePOPH8ggGN -z^EAdT|N11qATWCZQ}ZY#=hum&;_xeyp*|O{VN?%jM$?&+DK=8LzLP4?U!YQ_JT0`M -z`m!W@TCB5mlr9&jJ{^cX4Ye=uf(7g!BDG1LQfZM#P5u-^$L1K~rOMk7oWI24W>ZJVoZ8!*NX>jC%2pgw@7$v*amGL8JnA`*TjN)y=JPix$ -zHom^xjfr~ZFvhO?xbJHg&jfEZgboIqN@pk*%G-#&cX5DM>_>dMo{P<(#6bOBlgEyG -zzi7pMrVsz<*TT+n%Xo*+rUVN -ztJqe<9EEg`YU)i$PQ+gn%oA5sG>b*6QUjZVf+Ju4QKWr32^B^>#t1pQ*dNT#SxuC8 -zGNJ9mH6R-92O+m#!DECXMrB|3+|cZ$?^qoag;w8-vr)Z5hx@2MVoazOwqdLo2-lu( -ziwF(a3SNH{+U_=d6KFp}-N^eInrfTZ{p%Yc;K{NXO^Sl0qy(%)%sUXL -zA6Ic}&$4}O+ulD-?|#%otX@aO$zD_RW;|WXeL`u5;iz`2Ja937zabkT*wwyB&2HIU -z%>tpNcvDWCsG=IjRr(V|Z7N`9^tphbhiC}fIrVcS>=>)uMStm;g&z-HK{fFz2ud&X -zKo;y87PhB3IZGZ&D%bJ2dZ<-Z7I$fCrPWl6O0ir})>f~+rM8k@!Q(EpWCD9f!k>me -zRhs@Q3_eZ!{s3QHUMaN0uShhn$y!N+)a -z6F#K#O21}#Wz2NGar1LUq3S|3=0~&VTjxVeqcysO1QIGwgglMcjXc3^9R9i556MW! -zA%G1+Y)mPX16RcVB#B?R~Xl -zIeR6G9EBEoU+Sk|=Q=4gQdT~j9ecG~G45m|E+IkhfuBxT`M%^wZkNkXpL0AjS!$%u -zg-={lr6QW@$p<#-f}T{y|0rAEpY~$9`Ffd=BP+`1#;?ge=@mLGkdmI~u?Dai2i+}> -zr-d}7M&xTHsK7@<3$tPd^Yg3fLzxDa!oOJ_N!hGt&$}5!9&TOIuzhIP>)^&CM1CIF -zY>A-293)fzq2lbB(1wKk=>#3=G1eTT&8(iBSJab=V@AGnDSwOhxKg{m8sa~TR||^x -zH?*-f-l|Zq;GkYEt~~O`56i(Z6gi`*^TxMZuc-f=NMlvry~%u2a>kz*@R^tJ@{7%-A@wfa)Z -z0~dL|Z*tTjEX7ED(M%2gZ|Zi_L4TWr%=BR=y4%;?-COo)8t(xaW)#f?Uhc9^d-1?K -z=UDW-cu8J#%~t1$>T7o{K5NXC7Z^ -z;*V>fuSp>3%L~xxUi%mG*w7fJS9FTtSX8!B_=C>_+{-q^3-7Yf_esz?&oN2)zkaPH -z=7a>>$VgQh6LDY?h_Px)L~(27=d%@0UX!M7G~G|aMRJuU!|xkIYM`l6jEi407=MtW -z4YA)qqP8SmCj;2g*%y+BObhJICRimEtC(yhX|B>fl9#O|OsP0h{YfJM(l{DjCSf;_ -zp3jZ#S5YfJ*b;u0&zd}UOl+UMYMCH3kOBnUGziK -zo__#J<(BObj|aew5%LI%9K>!}5UVhW*2b`jvkYQXN*iuj#{{Oatl}s!dyhU&jWEAS -zdKj4YrSTiJ_b6i{@5nk1r@W#B=YNdtri~y>StL>N%B6Gj6O_fwN*T-2>1Q1KuQAXE -zF|^na>CtL$iCMfa_^Bio0%XY3)>F9Uqzf-cky+Lb_H)#4=L+?00yMptx;^o9v}fkd -zWN%~1Sj%)#ggvPi=IpG67#q)qrgFi21qV^a=2vb1s|%}692RR2)zei^W-5JD7Y!4^ -zKfyt1dP(!slOA11Of$_QuYE4W{Uu+DO027{)!7+#Y;Ih{M{`=>H7?QlKD!&7BO7X`Q1_b071zS3lNp -z@&Iv~QHe@3e;q{$b7pE51fo%ee_qC4)CR?kSh?lvkF}D2UuE>>^dhlmktVcN14leO -zB6JLU^U}S?*F=`1q~sTqli@HC^RzgoXWg7-*R1R~2xL-K^`XjV%3c-JMf~;^ILFoK -z%NIwJAU)}8T@nI{XRp;rWaD7cuvC1dj!R2oZ(K-<6)PFEe1C`3{NVSlqPF<~-&+*O -z8>_z7E5JY^sY(1!jgGp<)OE9!*nx9!RX3U}7tvu5m2XXS(V8#x+t;nz?=xkI(DDsz -z;3foX=tMqziX%?kztoj_MYP1$@9}OUi0@Z>26`$9-KBzz0d+H_Z`PU9?gSA=7?H}0 -z{c+|*bet;11)bfWS<)JER^z_5PKJN$@9unBRX+W*oX^32ly -zKo%s>e!Q4Gb1DeiV*R&fzDz|t8*WBSo1ove3somHjybczT^qp^D^Tpx97n^9WuuqI -zTCFUlzMc<9(@Ng!L9ebpnk>0!&~jV#PR~Lz8p-9KECK6 -z;70`vR#D6@#_MoD+$Wl*AAbY|FVo2J6vOlP={WYAqT#$Q!S^VW9|! -zl45qcN$prx36zxggrb_z0Ri=i%$I(SJ6jHx(uR<;b(=zb>GDa-cZTt=EWQ$^+AKKp -z!qtgInkt}{k=PN-erHn(dHX?T{g44@;}a%oYTE7q*K<=mU`H~sCkX#6pyH?M+0W>N -zUr<(Whv)VbXit9iJY4V&;_6xGNVK9d_P*yRzW_7PgbR$4WPdDP8K}{V;@u;E04A#lw1fxY9qPYX%78 -z?2?m&UC)5IREFbfd%r<*8}KZbL-)2J(s!Ni>DER#ah4jLH0*2GPn -zFP?pTI`d2+=5;~B0pYU=P03Hk<$aGh?7&|CDV>N4L&S*{xjJ6{dn!jPj@;!U64ZH$ -zxcv;Jen{NFvhysj-qs<-RN>Q}{r7$Q(|cMV#FVvG1ygSsC^0)`=DwB(4Z7$pIxu3h -zGr}-!!|aUp$DUaVeC9=coIL@I)g|Fm7a7u6JRy|q_3SIEsEkSTn?R2}SIm-}g0D#x -zbFUgC%_08XTvJ@!3#F5}f?b~Rz6CpeASaHdWnNs?a*HD&&M#AO;^>?RDV?gRN(Q&_ -zi^f)H(H|$Fg#yiJBfM*7wTkz_6un^+@bW^qdO0rV -z#80Zot!buo$fS$UtrjI&1`2u(g>;~*Z@I;ZrS@=@)pCyAT-4)ZtWEg^;2QgIBuYCv -zCOT@SpdJ=?l}vNgolDevUl8e7VBri&69qGAFHzdn>vz;Z2PIH&X0IdJxq5&G|lD{8;FN) -zyoId^NoH`da-U0H$$EV_2u9QwI2NQ6xr#xsr4!7>PZTS-+^Ser28(?H>pkyr(t|p)Hl*Rcc?7hPzry4)mHP -zWLX9>Jcr0gs2&(aNg9b2@BIl*r~2X;kn=eI%P577nIX=auf8fXGcC+->CfU?wHoJM -z@{%ht0!KC%-tamvUWKvNx!08PvLF(w-EK-u?Lgd+WfX$LOYI=5t00MKD|Q)#@9mL5 -zWZQ?eQkgCCqwANoAm&K4|fw*k7ipV -zB1v2pR!seE-oV-2@pAb2ne;%k;&0+LB7z16@)VH1MO9)MHU9kSp)dCNVB91j?4mmO -zv3NP2%#IeX=+W7Ni#8IjoTpc(!3T*dt7!EX8VlAzQq6uvFcs%W{$71OuAvW8Wpseg+*PVYLv?WMN=C|H@$;E_S5fVp$L;GyupU7jZ$kfvC58X?uLqEZijH!v -HqBZh=dic2S +literal 14310 +zcmXY21yoy2uugDycPmm{N^yd_Q`}vP7YOd|PH`>8wLo!q*HRn`6f5rV?*HD)IX5{c +zxpy-=`|Zxo_svGBD$Agwkf4A-AaprdNp;|J21vifLD%hMrT$lZeEex|7Xe0mqFAZArC{!qp)zJmbab@utqA`6 +z61Z~|e!k$IbXNT?PvGuuzT7G514$8e!}lsR>%nURMm+~pde``@(!O=ISt0%B93;Ez +za-qRi4n0Q>zQ2#2^_y08QOl3jT*!Ir5@<8VrFx(6f9sP|H8ttjftN;wrX>jP4BcG1;MfU5x^L`zc09u!bDBt#+ll=7@ +zB;}A$BKgu}V?#qfHvm`~pt%wG2y{MOc%B!8I`p|pc +zO#?sq!Zd&j8UPmvY4RQnfo>!6{a}GFV!}g@qu<3Wu$07X(O`vikNW$~q!ngF23Ls2 +z53p8js<-B_Qd?xX6rtq43Mdz(jOg2QXx#Wng_9^1^^~KqFNq{Kvb@Ap9}bf&xFA-C +z5+#cQ`#v$A=kd0O=agATcleBaxXf_(dnqbQz|cL9R&&Ni1omTs+6~YApmk)MCghxj +z1}mq&IU>1nEiF=q=PI`%jQbyRd=hVI83Sm{E-4uTc#w;NNwEW)C(C`xvWzY_%`_MmO +zD&g-sEaE)}6(&g)y-N&rNy;5@+{M`}!{60Y8wMgF5;HmO#B~hG`W$;7xLG*yF((rq +zxP6I#r#o`B3FppK{v(q1!C+YLFSfySDcHyoW!}EfzuCB1B|C5+oP}dtocnwkcNy1EZ6#5JX4=ePl&cu~0tMnt&79+I4%PaK>VqFx;r!QdNmnxlEqdU-QR%Nmu{aWP +zJxwXvt5fFTCOVgB)Zq +z%H0U=9q7Y0lu&1kc4zYT3*lHA@XJfoK>3WFM&WWf2u6^+wCm8##D$x@Gkw+t^HoO( +z4pxDRqg;$5S=t^k22H5^V3V0Qfy%Ogl8I%LD$52=7)J>Ki9Ej1HyEi_ujELlz8$-+?cdD1Zxi02kW0 +zaY=caFq4~s^R?zxcc3Z0X|az}Aww<{P$>6rk+5Di5J7$kWor0{Q&>+DWSBH^Gf`SP +zT{4}IOFh-hB7xwBdewq%de)q6QvxorV(()2>@j8i!kj)=^hN +zl_N{$9xTHHA;V&Zx#tX&1pOO;v^NiOP#_UK@J;;lp+OOhOOO2mlMdxM;Qv-mWG+^vzox|8t`w| +z=gPlM3)y6G*hfV1WwuMe>bO-vP9g`h5BqgO9x{ROBD;aPl>XDmvt(3PUxt|4RFRpK +z5OEtRz{(Oa_W_!Z4XHf#h;Z-~71XM7wlF*L!-#h_Uy2tGuy-rAZ)4{qE~feNkp}qf +zgvBtLkFPI~I7%C=OHZfPZz$j>L9)rb;l +z@J^dxncy52;wmHg=wC3|Xn6jPYCR7xc}~D0wNjoYxmoRh_zh=6@8coM1UQIa_z*1)cZPw4v40qoZQp-uy#DLv=oP +zX9b3vzFA2r8}|_AO8W1(OMG__0{1AUD&Z%&7-(>s+Z-X6Sv}G5QguIbZ3mYa--?09 +z;wNw?n=yAag4%m#w$$-YZ{(ZJUcwHfzu&!gykNjG)e}!=q8xy2_KS=ULsQwv45NK! +zVqqD8#S{vRjg4(Q6HM_F&tihNIQns<%DVjE$cv33ET>Dvc^#{z&#u&&9RgXO?ZLuebczKv#;! +zCS|2lIa37Bp#3RWj0$V3=I2>o40{(J^LD|EUH?!2;Z&HS*>7*V%{v1)wHaUP85mcX +z%q!K}Ntr*IzJD%++btJ;VQO*OjJL1t{GvR3cy@OC-~pe^bV?N`z0QKCr?Tom)4u%A +z3mi2k&eIgh0^rGI#Di+&3lrsy-r+}zwBkDQtswtPbkj!Y^l`{f!# +zLseC0M;DiifDa!({-G4{W$Wxsgv*(NX%HMyXhArVwY105dUHg?+=@6Sy8n@slS76x +zU7%PI8ToKm#qahfR;7kn#|t@9y(0EkooWBDqA1(mpO)>BBz))giBi8xVHlj#dR9U8 +zRo%`iBdlj8%_tRn^qa%T>{nsLLwTNld&WHLyfbPzv2W62m6q=Nsdxnk +z#{P==5!Lidx3bcr_qlUl%BX!xjywA?jv>FU^mJDa0zQT9Kw8RRHq>7B +zb~DXw0(oqBrOQunsm2ghWV2i1VmN{F?)U;0%*j{FEUxazAJ3)KSWomuhklkDi?5h*MTLDS5ma_Nk1sNZYzZ#$maGRyiXBzjG@(G__fuyBl(^A>s&{jF+J%5| +zv#7nD1XK806#_U_4#N2ANAxznk%;U$Y$z#{K*O07mADqx6LjACqwP<`HFV#C6Q*wx +z8JVP_qGF}V7B?^8)f*2F5AON7v$L~Kr?2}oPai_kG!_6MI(U`LS~+Mo*CSyrw>pPE +zllqxy +z^&rnDn4XA@AUY7~`1lwTCrm8KlVRqX&!kZFH&;i9@=R}UDxNSh*)Iq2U+#9}@ag1t +z%KUOEw0DXT)>hQoLTprY^z=BC=8NAyi3pZWT7A`?;rI<3%65Nqb93%pJ=!+dNtB>W +z7f3O-e-S7ZBgBntcyt~wOG_p$AU2zlGH8=%TEm+z8kLYReEMTkIo#2YiA=iKWrH); +zS%uT3xAyyY=!U)0Evpgx{{38MPR2nN<3913M<0O#YCO=TSt^4IzV3^D%2zC>t_OO} +z_h~AVOk+IIi$Ov;-g93a4j@WaekCC#HFm2_Vu9s)8-GbYtr{LgrxnSIN^PW9)!jYX +z?%-yssA~&R3F)C)wj5i|@!atCx?Qy%P1QEGSZm;iUNai`-F(8a%y+_a>CMzx$XEKx +z>sW|JbN36s+Y{4SZsrspH%UH=+Q6J`c&_-JLGL&5|$XUA1vFOC+rgoc&xT{dFT&pMaEBKwyD;plX0>2nla;jTlQ{!fn2M=Ak*=K*g% +zBm0-$ly1~}CT-5gv){jex9)7&b8u!a+vYHXU>=NF2>g3+_rN{(LUMGwRWKk49sS$v +zazyX8zZ1hwZ|U*5{fK@i@hRl*U%Q2cg+!iIfb)6W%S5F{91qinEZE%~4Gl>rBw9S< +zMP5$exl1jESyt}d~jo?hf`z^32b!}UGtJH+w9(0UrI#~Ei*ii&6z(AVE?(}k_A +zE9Z@mj7HF-ch46I0ipe3gapRj{=zk_J1E^b_JwdrhKi4ytBuwP)m>e$@9v`A{1N{h +zwUN6H=_W+h(a?rGaQ%%LP5C4)XiZ*`1uUwgqWvk`LyDD!Ps#Q5oI($KDJ%8n5kBi- +zghsLx`~mf<>WT)6-cJBbp|htk1NfkZ@e#B4@l?UH7!MDMpO?1NETGk_Eg{z!N3!D< +zWg8gtgS%b(0Bg7dw9u35xq)1vNdnM8iu7Eje*u?#sZ~%^q*HDaZC?5z4ZzhSA%ndS +z4&$M&7(|(9nWY%QShCnuN0 +z`n9&UeypypUgx;R+x;XM#8uDM{p`9~j<49)^dotHJVO*A@HL&g7F={FP#trj@{dzm +zeQUiqRWJ&pkKkA1O-|vOf8O1UQ$$0lIExffio|}F@ROV#MXcPH$ +z?$$kxAF@B#KT}u;R@SVyIO>1sw1!i?C(_013w9@?8$bKaLQi34zC$g*^}F&(%NEO6 +zQzD-^6}HQMnGJ{h$J*)HjSxjblWegsW&rLC8Ov_r_20jLjUS$Ptnm|p9fK%r0j+4; +z57^mjL&lISh8>DC;eB$B69$h4XxE3qU4T&zUpDeV@4g>or%D-x@qhie>6mqD959ck74(h?S0BA0}YQ18d?hr6}%}y{%ZNJ^-(?=Op~; +z#2-UNh)jH9>RXmvPJ(Y!8(uhyW|sFpyvv)AaNeljHj^Fx+RC +z!`@c->W1C^FUKHmG2w_atkdsMnzY+l!CV8havQ8-Gu)<8t{#V*2Pwp4h?ayXsi5Z> +zo!guta>TA~iv#iJpQkN>#)QF%As@2WgU&V_Y^qm#E*O}M_ijJfFWq}ts)-l4>D)kCqJJ@MG2$69ph0jzwI8ry1u8D@CyinC$oT?7S*Z}Eg +zYs}PWLqr4u@)w}#!{cMx;KxO6W2H6~3k$laJjAt+C{0mmCRnfs=OJYbh}HMh&e`#> +zj;jrpjqKCh41OK{FOS`@_sPP$iCm46G^EMNk8(l-1f>!gEV+4vMVRZ#8infUenP+k +zL^tBOHF^=)k&U-Tw{gfijqQ&^ +z-RHHII5yp}2|o8pTsf6x7$teW9Em!~iy2DN?D@|U)g%I6VG%JBO$|~;c~1Q^3|x`1 +z6HRbq1#~Ke)wWpALcc&@P;m+*sGavR0{aOx3=IwUE3YPWAwV45pzD$~02inxi7(6X +z$zk683M=_r#M*+6fQ)&FK0y|lm7JLwS)K=t&ZJk!U_-y%_o@fhr{s37MUEQOF*M)3 +zB$;4>Zx;Xk*(hwFjb>1iJ1f*D#nyWL{=>{2|9*^vCNN!%bF8Oe<`xz#s;jFz?;I}4M3lL;!fy_;J-E96Of+;sG%K=fZdR)99pJ}fM( +zq%(s8UrsEL{NrdF`!#RY+VjFyPpE_vtqPMM!MQ+QnE)+_g9Z^{4^;k&Sa^=w*yuxB_*Z!U%!3{_9Qr)Jfz4IeS#io4oj_Kqhq`HCUub|Ke!v$1-$v=kc+O#rlCej?%dhY +zxxKUTsFPG1nfoFp3%7@gh9S?vM0N27#*fpJyaX;Vy{!pt*}!9_mX9uC#J5RyjknW2Dm3dCvZYU +zSW?0kvI9!o2un}*%`AYhr^CQT1aZF=-Nt^atn@Kt%b2!hT(pK!|MclbBv3-<+6{>_ +z8toMfWc9rpOk(8|KW>Z-k>Fr(xc_+q9ocf`8!_n}XYUrW?Ax|*_|=5m*4F0V+46wJ +z1IGS^Z5t=0Zj86J2MfJc +zUq#WKCfhoB<;P2&&`*_G4^_0uqDR20m!>T8ay_rxSzA&9_v5##g6tzXTkx+KRfz32 +z9vvpp?+YxHTxDthCBu7)&Q052y4s9*$M4_2w-OdPyK?F-EBoUuSsIk@@(!gA*A_!0 +z2eu1y;-Q$Ut(M>8FCOtw?vZR-%*ly^x)<95vK@P0tJoZws@+M*NGhg_NU`!}DZnWBHQz%*@6))$BWN;EM0xAF+B4Mph#S??J?K+&viwPmes*n^HGDL9iBf +zCk|mDu46wwughN!isu&G((DO>Ws`(VLY?^#w=RONxUgFGby--Y=5NJ|(>qXOS`;lZhmXyMEyBdVM@jJh71E-})~`?t4w8^Kwy) +z<+KACjs!F^TS-;FT24_iWF+=l(nR}j7U#;Vd +z)IT3=b&}A}1PUKFa6DKfgHkJci!~7u?a%k9h7Rri^{y`|;;xNDoQbV}+oJ=LdApL}|77o@C= +z;~aed)XpbrMtt1x3gHPWxbliQH4nKBCew{9 +z*-_PTyn~`1VrwKcc4ZrhI^!MsZ{D0O0%O2!SHHi^Dfyr9*x*DGFKwc()b;q6nM*M7 +zvA$x_?$BMJJHN5HIn9Ps{_7-sn79~BZegaa5V;s(BA<5BnU?^AeJHXtd)cIj_UCjA +zW|N@MjV~vrJz{sE0Dzv}tXxUDQAXm)1(kX7C_ZVFX%!TlZ850i(P1A0BxaJu)#LcH +zoxMFRzxoxw$bM=B6gpuMD#vcsa^00?%=D+T9-dQqV*=zD|)W!3BLun2&^n)~$ +z2_^{i9~sGXOAsF_S=k&4mWJ@`mD+G%MiPTlhuomboeFNwHb(< +zVpVR!mwf;JmpO3JL|B%L-!;@7TG}+`HZA;-{VIlQGY|T=f|!9!S=!c?sq5|KeEQ*~ +zm!1xeZcJPbSsfjU9e>K|=Ni<+YgrIG!|5@|Z>4bjx+`1j^O-{QK8XARf +zUG$nLRiTEtt;)9F30rvw>nj)@vCF{$d7>o2n>}~Y2^^C79l@s`uXRZOcuy>^%2@t- +zRGv={pKlDXFUgvG_^DWGR==il1rIzn{$p4r(FVOQxZi!_*Ksfl2hR{Aj>01RbFAM= +zpr0wzMwlOwlkt4|JLK)$>VL+{4nv>^`yMa)T;(9f*B(9;{T+)_=M4dN>M&&hS-#(G +z)-sW(WxVkHR)`x#g)25Lu7qnN;~Q-bvKDZ=;^fyLy@okDpvt&ZU{!U)WVtmnp +zAN-CzM{jPFWep9NAKDDq@=kynkGi_GQ@Z2y_Wn)xc_q3-&+9`qdGy_{PF-2c^$)%x +zd0sonEJhtG*2|P*Q-f_3`Akk96HzBz2 +z!5tnJaCcA2hGQrSw*{F)epvfYX?7toP=O0dN +zizY2w`>O@4Vqff!dBhQ^><#TjMP}loM9ProiD-Og@$V=*zQ|Avg0D!+96lr^u(1fl +z3J52PHoJYDdvdiIW?q?JIC*r?88VruLx#bp0lys39v$(c6uC*j}2IFFh +zViOX|K+DH18cd9%Rgjs$*sXuoW<>p^Fv-7CV|zpgTUnj812pyyX-nhA4TZ^UyYY9; +z?}BOarTT1q;0xSTjV_DPWE11?Y2+wSA*ybzebDoy8JwhznKa6SvYxE$WswX7Z6pG$ +zsA2GgHFFL3^zA@XTYK{a+6$Q8di%@1-|q9U15y+~R-L7Kwx8*xr(FP{g*JDPa`e((jSl#~?Rx=3ne(nLfeP9k0grubJK +zU4euzZqt~$Cl%k^{-!e6YQZi|D3#+MUS}VsYZ)0S>y@)kyqRI?A_esvAu-{`1Uq@! +zC+b`wnMK&<_mitl+k@e*$*{&S>vayX*>D>Q5sw2FZ?l(8ff%(8lo<^mBMrwQXOXe+ +z*7sZdWzBTIwZO$y^F)qZL1XbOMY<@M_a56y{({Vg@YN<_y}toq41V%~w=+4ZQvg)X +zVw~l$z-sId^nKU%dlk7W(mG}eS&KV2BdYqNJnX-p=YrG&&`_m0fzA_|iKD${5?oL* +zdS$heR@%Q+(3!!T&k;tIN|v2j=UI))rgkvyC7MTTrKP3g>Fma@_R0`GE5(tL%sS$7 +zG41ag%(Y(xZ5cjlk=R~(3XC+$25r*Fo=G5OhGgR}i!nDoG?^sult?Eo*x$x6CH-3L@LtZ0dfq!Bbbw-S}RwlN%lpH8c=4l2qH +z1wRszHSPh~=esnWvXD8B{D4<}?}6cA+@Ob1760Is6`g!zl@WL(L&={LA}SxAt0>Tw +z%b7i^&yNKM;(vGcNwuxAK{g|S3Y1&pH_6U1G +z3M4zx5FU=O;=l_?VzQ-~bx~xN1axPgYI0am3d25BjYmfSTX7Q}==Vcryl6@Se0(Jv +zxKW_o%H`jdnC7QXlkFbCsACHN1Dx=0gf<~@PW-&<=`1Hd)@#ypH7%OpalDj-P=ts+3^~yWs~TV}BD20HjkW6zc1L +z0#HzMkn3JV%7N-18_@tgE82*YnmEzxirriDSx#_|<|q1vL{k}7>^mRzO(ueTSN2~H +zG}kxp)Qn!&)><3|e>62+GXSpQKcemfqU!&BHZ5Ca;DT<63bBM&uV1BDS?MM$M;x8w>gShAPMxJM^BbMZn}Unm{OC9^4x3%% +zlmX8!km-u$N4fQXQ>jRe`7)3+RFGjhz +z18zf(Fo2<>YV^7LJO^UTZ2Ivd#mpN}o?7pBV&q=f%ID>haV7M8R3jsF*@a%iwIy>| +zsZ!-y{!%&j7`B?W8TcF4NH-RHH1xZ{;7BsA<#APu!;cND)te)FhoXz$BIU}2&^7WP +zT}TX>ZO58$VNPuh6JV7~s(W$vAj`^%AtUamex3YdVl3~4+pqk?G)qUibNMrj0*M25 +zY>5Ac|Dnv6xBQmV#$3JA?&HTN(lYl~J}@$l{*TY^kORrCB)3dDO}^^v!dcLf^CHty +zanjllIQeSLmpuG+h&ae`r*v!C*0A&W^a&q>93?BAXzG7n +z2*3TGPIcN`-_hY9&oaiv#fiv~>}7`T`4=pInEqWX*3e8+yPm^9h-tr&ts55$l+388 +zW)~F}2JH!}VLbQ>?6~H@&k`MnSsTeVj0TRVP4jGbP*!!CwM6`Z11c)yI2w$+R0zxo +zT|obYS1&&`{>>Z9(jnVU&=yI*%PGe*f78ie*_9oap?sd7fx7{r^WT>=XHF +zl`f{=UJEn2?tRw`Fem?eRE6#*nOes(ebRcmaK3~a3{a3EyE1zXSF0p7I_iDJ&%;3V +zU;AS}e?*mH#Yh2P9E3QBigIqu2iXf=@t)2+I~f*_E^JtEP1@IR{CBfTj%T}E3e#n% +zUa{@vU?D$l4DEANwkkK@ruP4ta)E*e^KLGg%$PizyPmHvKNMWtuJQ6sPXY=(1m#>W +z7V?9E!Vj}>a|KfQx5ESpH+q6$@gAp-P#~lbz`aj1_?xinN>3o8b2-Z3w>UZ3QZ}W0 +zWg-!>p>AADDcU^4;0*L4UFgB0QLlXd^y1E&4>txV!T|!`RwjZGl`;-4ZgFf>luHIy +zZ8d8Rh{I3r!g-ht6mAZxMB6VxRqnA0UY`h|mJZy2 +z17BazT$jMKFL3J6Ue_HL1^)4s%$Jj~Qx~1HG#tS@kwL(KP_ZI3dWz0SH(sqj#-*TNGsIWqPj>cj?!GyWvfdEiNOu4$>MIqL=F&Cc0{g*~L5 +zA1wt)=_zMFUkCT5$l!G{1-Y9QtGQ#qm5E(3fYPms_EP*sSVI)bfXN|uNO`BqVuCvd +zv)z8IGRgtM1<_trndVhQ^xA)wn~*W~#d*X@E=W)jcQWI8+?kdzHe;DZ`%+JE%gE}m +z6H=FO8rJxM{N90S=Gi!Mel)TyanxPa;E}C?hJl@e9UWad->;S|v;axgFjrY$z3(rV{MiJ}3M)t;Q?P5wZy0e3G{dcDO7n}3slDXLMrB$;#*W@Qv)D$=?Xs$F(8eTcyGIQ~IWgD%Gn&E>F9y#o>cR-7spE;Rur<_E~Pu)e0I +z#&y1|@8D~8c55<|KMf;&x;hg!A%VOZ38_+uk`jH4#=b9M&xcpxV-7cMN{jXVRnKSe +zlKJJ%=VBV{$DNeI1QkiA;DfdVT?$;O#22z6v6bTK9)fjrfIh!Hq__l~KzuNqT{&kA +zKs@YV6^1ZLGjTgR%(=NHS-DvWnnP)NM#qbHINqmQdCE5??co$3nuikqgm=s7*#Kd*+j_weKrZjMeLeHEoiJm>zuDRU` +zh~ggr^knneWU!Nn}AQt=0Id6Hk; +z4bJqse|V$H`stT?NS0yreYvaZ9YF!fw+N}{3#yXRU!C7?exl35BDC%+!jDMGT^DN# +zN9FGd#5t#;$h}5UgQ?q-Gr15>C6=nLUszle9<+_!!oi_m@_L^-R>_Qty7_g|C%m|5 +z-7^5X5V_ARi?h9_LW%2vByD3X_IvUktqBv{%SYXO1&;e&O#Ll_cfC`Wv1u+l_#RI< +zQ5Kly0;P`%TXaQN(heOg~>V&L{d+ZDA%eq-UKo#1)$rkjSm=nzAE2r +z5--RyKhxfXoGVU3^ab{5XGlyL1+26foG)4HZvN +zG@&I3h0fnK5lIjcrg*XxPy1(gK3_TN`&VYnxP;C|j$~0rT$0f|*#=OzM^NbE-1T5D +z%Csnt)n!sx3N#b(8G&+G3W~Q_B#StA6jZZ=p#wuu`DrAMXm{T@#S;ku4Dme@{Njmk +zCtrh3z6O>o)~o{&Htx+6kn*)$NNBH-biu^aYtWUq +z(G>4rCEKr#tO>!x8A@%W@6g)Xs%2Hq!y#Mbb@9R2@GDWi&!{jhZvzQ1D9nMuPoOS+ +z+cj{9nx5X{jJOIavbFf)Kz5Jnbe5Bu#(XE-z$j&iaP%c9W59OoT0~|N#D*(N2kz={ +zs(|)nH!_+_g1)#ZH2xk>ZTG#6WN#qa3BxZM{NWxq`*#$H255k6Ky?hw*hSA6`c_fl +zT@Ua%E5Ez3;~`kQFmrC#$Nlvc_Uy3#yzhd-6UYuuIwgIBZZC-`dwOBJbfurL(FfhH +z{YkjE+9OrOveY`{t{sGw&51YO1@{iO4)Ki=!Z5#q=m_Hi)_j0`>?;t2j);vv%BUif +z;wpTZdLQLsGvZ()DCdxYudn^Pt;BZ}Rin$4F8h{R`HxT2z`uc&aMXIQOvwgA5%{&) +zFW52MiN!$!EXgx}Px~e1!EMp;#&kY65oDho95j~!qD%YJr`+aK4jCJ4UJ^;q>w@Lf +zvDfg|M`S^@DGxu+7aR3Cx#;%?advj&1~L-m +zJqCP9&TW3migV*`Z$#)Qa>3>Jf)g9D6Ki28P@iX(uso)hic8Dp1F< +zeF;(n8Po8A*~^T{De(J)Z2nqLl@Vv3yoSlGwq0aeOg4ymI(KIkTeur-=J-yp9z?qe)it6gq-wl@I +z0D-_I{|T<5kwD9uH3yf1GWXp5*8eOgJf*q0IRoK|+r{}Fug&0WpNDKMTC@(Xc)9K8 +zy`lByMn!1fnY)1KYP(0Je1)c~WilUuh<&Q8^OE?L9Q^xK*Y@M$`6D6TDCZ^@l8{|} +zxmmNw)mng$hYBii+&ZqedxWT0dnV#LG4zC%+kzcK+-??vEHT>Q-T8zu|s_1IbA#OV)^+1pg1OmmZn` diff --git a/patches/server/0005-Plazma-Configurations.patch b/patches/server/0005-Plazma-Configurations.patch index 46c4702..f73502b 100644 --- a/patches/server/0005-Plazma-Configurations.patch +++ b/patches/server/0005-Plazma-Configurations.patch @@ -17,7 +17,7 @@ index 7a4a7a654fe2516ed894a68f2657344df9d70f4c..ae51ab3c895b1b98d768e52b7c446bd6 public static abstract class Post extends ConfigurationPart { diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java -index c2dca89291361d60cbf160cab77749cb0130035a..02262c6b4a49951f4c9fc33c6bd78b9714b78a24 100644 +index 9ef6712c70fcd8912a79f3f61e351aac09572cf3..b7f44c74089058f261163430762f027aa9a5623a 100644 --- a/src/main/java/io/papermc/paper/configuration/Configurations.java +++ b/src/main/java/io/papermc/paper/configuration/Configurations.java @@ -88,7 +88,7 @@ public abstract class Configurations { @@ -47,11 +47,10 @@ index c2dca89291361d60cbf160cab77749cb0130035a..02262c6b4a49951f4c9fc33c6bd78b97 } this.applyWorldConfigTransformations(contextMap, worldNode); this.applyDefaultsAwareWorldConfigTransformations(contextMap, worldNode, defaultsNode); -@@ -308,4 +308,19 @@ public abstract class Configurations { - return "ContextKey{" + this.name + "}"; - } +@@ -232,6 +232,21 @@ public abstract class Configurations { + return level.convertable.levelDirectory.path().resolve(this.worldConfigFileName); } -+ + + // Plazma start + @Deprecated + public org.bukkit.configuration.file.YamlConfiguration createLegacyObject(final net.minecraft.server.MinecraftServer server) { @@ -66,7 +65,10 @@ index c2dca89291361d60cbf160cab77749cb0130035a..02262c6b4a49951f4c9fc33c6bd78b97 + + protected abstract int getWorldConfigurationCurrentVersion(); + // Plazma end - } ++ + public static class ContextMap { + private static final Object VOID = new Object(); + diff --git a/src/main/java/io/papermc/paper/configuration/InnerClassFieldDiscoverer.java b/src/main/java/io/papermc/paper/configuration/InnerClassFieldDiscoverer.java index a0aa1f1a7adf986d500a2135aa42e138aa3c4f08..28a1d21900dbff4b9d1887b9aa4e68f4703b778f 100644 --- a/src/main/java/io/papermc/paper/configuration/InnerClassFieldDiscoverer.java @@ -102,7 +104,7 @@ index a0aa1f1a7adf986d500a2135aa42e138aa3c4f08..28a1d21900dbff4b9d1887b9aa4e68f4 + // Plazma end } diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -index 9fde9ccb5d069ddce8dd837ef1bc68b93ce66434..9068ff25a77a2a2a4f9ba5eb097ae3b1180a38a0 100644 +index f6b9d216c24d8858802f85209fe1a869e5a9be31..746fdd880862e7dd8b53dec99b07ae627764dcf8 100644 --- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java @@ -127,13 +127,13 @@ public class PaperConfigurations extends Configurations resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { // Holder holder = worlddimension.type(); // CraftBukkit - decompile error + // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error -- super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor -+ super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma +- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor ++ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma this.pvpMode = minecraftserver.isPvpAllowed(); this.convertable = convertable_conversionsession; this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 8b37fa386a43fac8144a2094681ed49a38546efb..4ab4ec1e325059e570c73216b5aaa267bdfa4f19 100644 +index 92b440b24c6b083f81837611d08fbd6773a2a6e6..058449f24eb3260dc230dad2a0b4c552d0b7f40e 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -171,7 +171,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -175,7 +175,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return this.paperConfig; } // Paper end @@ -285,13 +287,13 @@ index 8b37fa386a43fac8144a2094681ed49a38546efb..4ab4ec1e325059e570c73216b5aaa267 + // Plazma end public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - -@@ -326,9 +331,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + public final co.aikar.timings.WorldTimingsHandler timings; // Paper +@@ -329,9 +334,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @Override public final int getHeight() { return this.height; } // Pufferfish end -- protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor -+ protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.function.Function plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor +- protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor ++ protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.function.Function plazmaLevelConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper + this.plazmaLevelConfiguration = plazmaLevelConfigurationCreator.apply(this.spigotConfig); // Plazma @@ -299,10 +301,10 @@ index 8b37fa386a43fac8144a2094681ed49a38546efb..4ab4ec1e325059e570c73216b5aaa267 this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur this.generator = gen; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 416c43e9a18cac4be52553020ba0af7a9a653d3b..7ac4cc8d5a33aee63e17ecd403f8021a9ba153ca 100644 +index 4b359f91cda9b5d58c96e04d56551a640fb58ea4..07d080dd892d3c9489be89916a35b88fe71f71e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -975,6 +975,7 @@ public final class CraftServer implements Server { +@@ -970,6 +970,7 @@ public final class CraftServer implements Server { org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot this.console.paperConfigurations.reloadConfigs(this.console); @@ -310,7 +312,7 @@ index 416c43e9a18cac4be52553020ba0af7a9a653d3b..7ac4cc8d5a33aee63e17ecd403f8021a org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur for (ServerLevel world : this.console.getAllLevels()) { // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty -@@ -2818,6 +2819,13 @@ public final class CraftServer implements Server { +@@ -2816,6 +2817,13 @@ public final class CraftServer implements Server { return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); } @@ -325,10 +327,10 @@ index 416c43e9a18cac4be52553020ba0af7a9a653d3b..7ac4cc8d5a33aee63e17ecd403f8021a @Override public YamlConfiguration getPurpurConfig() { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 576cd8e20982bb20d10213b6c7a229428eec1c2f..d92ec08aaf240759fb8d7f3febb9c25799646d60 100644 +index ab05f4151e6ec7404a85ddb3a141ed39d9ed86d7..9fa9b58bc18f02d0999bd937f36ba2173948ffd7 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -166,6 +166,19 @@ public class Main { +@@ -173,6 +173,19 @@ public class Main { .describedAs("Jar file"); // Paper end @@ -1004,7 +1006,7 @@ index 0000000000000000000000000000000000000000..469100cd86e6742eeebad22923097782 + +} diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java -index 1fa801c93597f6939b88442ad72812cc5080c37e..b3a436f861b1678053991a6276261032eeb19f21 100644 +index a616624a7beb35239be0fc2bb7fe60db1c673c2d..602ac1b30937a89312be7ba068a595d398e53394 100644 --- a/src/test/java/org/bukkit/support/AbstractTestingBase.java +++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java @@ -63,6 +63,7 @@ public abstract class AbstractTestingBase { diff --git a/patches/server/0006-Plazma-Optimize-Default-Configurations.patch b/patches/server/0006-Plazma-Optimize-Default-Configurations.patch deleted file mode 100644 index a383fc8..0000000 --- a/patches/server/0006-Plazma-Optimize-Default-Configurations.patch +++ /dev/null @@ -1,424 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: IPECTER -Date: Tue, 7 Mar 2023 12:28:34 +0900 -Subject: [PATCH] Plazma Optimize Default Configurations - -Original: YouHaveTrouble/minecraft-optimization, AkiraDevelopment/SimplyMC -Copyright (C) 2023 YouHaveTrouble, AkiraDevelopment - -diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -index 47e77541e558e18758ae0fcc2aa4e47261e928b6..526a0e767567098d61eea6d9928206cdbd30c7c4 100644 ---- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java -@@ -212,7 +212,7 @@ public class PufferfishConfig { - public static int maxProjectileLoadsPerProjectile; - private static void projectileLoading() { - maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); -- maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); -+ maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 10 : 8, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); // Plazma - Optimize Default Configurations - - setComment("projectile", "Optimizes projectile settings"); - } -@@ -225,7 +225,7 @@ public class PufferfishConfig { - public static int activationDistanceMod; - - private static void dynamicActivationOfBrains() throws IOException { -- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur -+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? false : true); // Purpur // Plazma - Optimize Default Configurations - startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12, - "This value determines how far away an entity has to be", - "from the player to start being effected by DEAR."); -@@ -233,7 +233,7 @@ public class PufferfishConfig { - maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20, - "This value defines how often in ticks, the furthest entity", - "will get their pathfinders and behaviors ticked. 20 = 1s"); -- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8, -+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 8 : 7, // Plazma - Optimize Default Configurations - "This value defines how much distance modifies an entity's", - "tick frequency. freq = (distanceToPlayer^2) / (2^value)", - "If you want further away entities to tick less often, use 7.", -@@ -269,7 +269,7 @@ public class PufferfishConfig { - - public static boolean throttleInactiveGoalSelectorTick; - private static void inactiveGoalSelectorThrottle() { -- getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", false, // Purpur -+ getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? false : true, // Purpur // Plazma - Optimize Default Configurations - "Throttles the AI goal selector in entity inactive ticks.", - "This can improve performance by a few percent, but has minor gameplay implications."); - } -diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index 6bf14183a3fcd2b3d166752ce33240d2ff1ffa7c..fbe91caed88dabacb746c1512c61871a8fae523a 100644 ---- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -@@ -114,7 +114,7 @@ public class GlobalConfiguration extends ConfigurationPart { - - public class Watchdog extends ConfigurationPart { - public int earlyWarningEvery = 5000; -- public int earlyWarningDelay = 10000; -+ public int earlyWarningDelay = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 10000 : 180000; // Plazma - Optimize Default Configurations - } - - public SpamLimiter spamLimiter; -diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java -index 4532f3a0d74feae0a1249b53e1bfbc18a8808b32..1727fdad3f92d570e159bf169e3ac4b2b9f8ac5f 100644 ---- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java -+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java -@@ -84,15 +84,15 @@ public class WorldConfiguration extends ConfigurationPart { - - public class AntiXray extends ConfigurationPart { - public boolean enabled = false; -- public EngineMode engineMode = EngineMode.HIDE; -+ public EngineMode engineMode = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? EngineMode.HIDE : EngineMode.OBFUSCATE; // Plazma - Optimize Default Configurations - public int maxBlockHeight = 64; - public int updateRadius = 2; - public boolean lavaObscures = false; - public boolean usePermission = false; -- public List hiddenBlocks = List.of("copper_ore", "deepslate_copper_ore", "gold_ore", "deepslate_gold_ore", "iron_ore", "deepslate_iron_ore", -- "coal_ore", "deepslate_coal_ore", "lapis_ore", "deepslate_lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "deepslate_diamond_ore", -- "redstone_ore", "deepslate_redstone_ore", "clay", "emerald_ore", "deepslate_emerald_ore", "ender_chest"); // TODO update type to List -- public List replacementBlocks = List.of("stone", "oak_planks", "deepslate"); // TODO update type to List -+ // Plazma start - Optimize Default Configurations -+ public List hiddenBlocks = List.of("air", "copper_ore", "deepslate_copper_ore", "raw_copper_block", "diamond_ore", "deepslate_diamond_ore", "gold_ore", "deepslate_gold_ore", "iron_ore", "deepslate_iron_ore", "raw_iron_block", "lapis_ore", "deepslate_lapis_ore", "redstone_ore", "deepslate_redstone_ore"); // TODO update type to List -+ public List replacementBlocks = List.of("chest", "amethyst_block", "andesite", "budding_amethyst", "calcite", "coal_ore", "deepslate_coal_ore", "deepslate", "diorite", "dirt", "emerald_ore", "deepslate_emerald_ore", "granite", "gravel", "oak_planks", "smooth_basalt", "stone", "tuff"); // TODO update type to List -+ // Plazma end - } - } - -@@ -133,7 +133,7 @@ public class WorldConfiguration extends ConfigurationPart { - @MergeMap - public Reference2IntMap spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1))); - @MergeMap -- public Map despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance()))); -+ public Map despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? category.getDespawnDistance() : (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8))); // Plazma - Optimize Default Configurations - - @ConfigSerializable - public record DespawnRange(@Required int soft, @Required int hard) { -@@ -317,7 +317,7 @@ public class WorldConfiguration extends ConfigurationPart { - public class Environment extends ConfigurationPart { - public boolean disableThunder = false; - public boolean disableIceAndSnow = false; -- public boolean optimizeExplosions = false; -+ public boolean optimizeExplosions = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? false : true; // Plazma - Optimize Default Configurations - public boolean disableExplosionKnockback = false; - public boolean generateFlatBedrock = false; - public FrostedIce frostedIce; -@@ -397,9 +397,9 @@ public class WorldConfiguration extends ConfigurationPart { - public class Collisions extends ConfigurationPart { - public boolean onlyPlayersCollide = false; - public boolean allowVehicleCollisions = true; -- public boolean fixClimbingBypassingCrammingRule = false; -+ public boolean fixClimbingBypassingCrammingRule = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? false : true; // Plazma - Optimize Default Configurations - @RequiresSpigotInitialization(MaxEntityCollisionsInitializer.class) -- public int maxEntityCollisions = 8; -+ public int maxEntityCollisions = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 8 : 2; // Plazma - Optimize Default Configurations - public boolean allowPlayerCrammingDamage = false; - } - -@@ -407,18 +407,34 @@ public class WorldConfiguration extends ConfigurationPart { - - public class Chunks extends ConfigurationPart { - public AutosavePeriod autoSaveInterval = AutosavePeriod.def(); -- public int maxAutoSaveChunksPerTick = 24; -+ public int maxAutoSaveChunksPerTick = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 24 : 8; // Plazma - Optimize Default Configurations - public int fixedChunkInhabitedTime = -1; -- public boolean preventMovingIntoUnloadedChunks = false; -+ public boolean preventMovingIntoUnloadedChunks = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? false : true; // Plazma - Optimize Default Configurations - public Duration delayChunkUnloadsBy = Duration.of("10s"); - public Reference2IntMap> entityPerChunkSaveLimit = Util.make(new Reference2IntOpenHashMap<>(BuiltInRegistries.ENTITY_TYPE.size()), map -> { - map.defaultReturnValue(-1); -- map.put(EntityType.EXPERIENCE_ORB, -1); -- map.put(EntityType.SNOWBALL, -1); -- map.put(EntityType.ENDER_PEARL, -1); -- map.put(EntityType.ARROW, -1); -- map.put(EntityType.FIREBALL, -1); -- map.put(EntityType.SMALL_FIREBALL, -1); -+ // Plazma start - Optimize Default Configurations -+ if (!Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations")) { -+ map.put(EntityType.AREA_EFFECT_CLOUD, 8); -+ map.put(EntityType.ARROW, 16); -+ map.put(EntityType.DRAGON_FIREBALL, 3); -+ map.put(EntityType.EGG, 8); -+ map.put(EntityType.ENDER_PEARL, 8); -+ map.put(EntityType.EXPERIENCE_BOTTLE, 3); -+ map.put(EntityType.EXPERIENCE_ORB, 16); -+ map.put(EntityType.EYE_OF_ENDER, 8); -+ map.put(EntityType.FIREBALL, 8); -+ map.put(EntityType.FIREWORK_ROCKET, 8); -+ map.put(EntityType.LLAMA_SPIT, 3); -+ map.put(EntityType.POTION, 8); -+ map.put(EntityType.SHULKER_BULLET, 8); -+ map.put(EntityType.SMALL_FIREBALL, 8); -+ map.put(EntityType.SNOWBALL, 8); -+ map.put(EntityType.SPECTRAL_ARROW, 16); -+ map.put(EntityType.TRIDENT, 16); -+ map.put(EntityType.WITHER_SKULL, 4); -+ } -+ // Plazma end - }); - } - -@@ -432,11 +448,24 @@ public class WorldConfiguration extends ConfigurationPart { - public TickRates tickRates; - - public class TickRates extends ConfigurationPart { -- public int grassSpread = 1; -+ public int grassSpread = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 1 : 4; // Plazma - Optimize Default Configurations - public int containerUpdate = 1; -- public int mobSpawner = 1; -- public Table, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40)); -- public Table, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "validatenearbypoi", -1)); -+ public int mobSpawner = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 1 : 2; // Plazma - Optimize Default Configurations -+ // Plazma start - Optimize Default Configurations -+ public Table, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> { -+ table.put(EntityType.VILLAGER, "secondarypoisensor", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 40 : 80); -+ if (!Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations")) { -+ table.put(EntityType.VILLAGER, "nearestbedsensor", 80); -+ table.put(EntityType.VILLAGER, "villagerbabiessensor", 40); -+ table.put(EntityType.VILLAGER, "playersensor", 40); -+ table.put(EntityType.VILLAGER, "nearestlivingentitysensor", 40); -+ } -+ }); -+ public Table, String, Integer> behavior = Util.make(HashBasedTable.create(), table -> { -+ table.put(EntityType.VILLAGER, "validatenearbypoi", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? -1 : 60); -+ if (!Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations")) table.put(EntityType.VILLAGER, "acquirepoi", 120); -+ }); -+ // Plazma end - } - - @Setting(FeatureSeedsGeneration.FEATURE_SEEDS_KEY) -@@ -458,9 +487,9 @@ public class WorldConfiguration extends ConfigurationPart { - - public class Misc extends ConfigurationPart { - public int lightQueueSize = 20; -- public boolean updatePathfindingOnBlockUpdate = true; -+ public boolean updatePathfindingOnBlockUpdate = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? true : false; // Plazma - Optimize Default Configurations - public boolean showSignClickCommandFailureMsgsToPlayer = false; -- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA; -+ public RedstoneImplementation redstoneImplementation = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? RedstoneImplementation.VANILLA : RedstoneImplementation.ALTERNATE_CURRENT; // Plazma - Optimize Default Configurations - public boolean disableEndCredits = false; - public float maxLeashDistance = 10f; - public boolean disableSprintInterruptionOnAttack = false; -diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index a3c79863717d7eef1261f475d797ae9dda251bcb..908d25612c680e3102a0de9e0187a5bb79de6a3b 100644 ---- a/src/main/java/net/minecraft/server/Main.java -+++ b/src/main/java/net/minecraft/server/Main.java -@@ -143,7 +143,7 @@ public class Main { - File configFile = (File) optionset.valueOf("bukkit-settings"); - YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile); - configuration.options().copyDefaults(true); -- configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8))); -+ configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(Main.class.getClassLoader().getResourceAsStream(Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations - configuration.save(configFile); - - File commandFile = (File) optionset.valueOf("commands-settings"); -diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java -index 5134fed0cd0eedbe0c2177bce91b978b20061517..f6ea381ab5043e18360efb3c178f6a2c84d591d5 100644 ---- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java -+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java -@@ -136,8 +136,8 @@ public class DedicatedServerProperties extends Settings { - return Mth.clamp(integer, (int) 1, 29999984); - }, 29999984); -- this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag -+ this.syncChunkWrites = Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag // Plazma - Optimize Default Configurations - this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false); - this.enableStatus = this.get("enable-status", true); - this.hideOnlinePlayers = this.get("hide-online-players", false); -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7ac4cc8d5a33aee63e17ecd403f8021a9ba153ca..97af3b01e1c30f7a286122794d9ecbd26988f471 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -351,7 +351,7 @@ public final class CraftServer implements Server { - - this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile()); - this.configuration.options().copyDefaults(true); -- this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), Charsets.UTF_8))); -+ this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? "configurations/bukkit.yml" : "configurations/bukkit_optimized.yml"), Charsets.UTF_8))); // Plazma - Optimize Default Configurations - ConfigurationSection legacyAlias = null; - if (!this.configuration.isString("aliases")) { - legacyAlias = this.configuration.getConfigurationSection("aliases"); -diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index f509c9b9d72710360046679fa26eb594eeffca92..b3e2ee83b3d3891899b4395ec9f97ca1a2db78b0 100644 ---- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java -+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -@@ -237,7 +237,7 @@ public class PurpurConfig { - laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold); - } - -- public static boolean useAlternateKeepAlive = false; -+ public static boolean useAlternateKeepAlive = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? false : true; // Plazma - Optimize Default Configurations - private static void useAlternateKeepAlive() { - useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive); - } -diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 4c6853f2f8171e2b9fd78ba5e6bb5fe63cdeb41d..18a7ae3c30b83e971c968691c7054dad7f97b6f0 100644 ---- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -422,7 +422,7 @@ public class PurpurWorldConfig { - public boolean playerInvulnerableWhileAcceptingResourcePack = false; - public String playerDeathExpDropEquation = "expLevel * 7"; - public int playerDeathExpDropMax = 100; -- public boolean teleportIfOutsideBorder = false; -+ public boolean teleportIfOutsideBorder = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? false : true; // Plazma - Optimize Default Configurations - public boolean teleportOnNetherCeilingDamage = false; - public boolean totemOfUndyingWorksInInventory = false; - public boolean playerFixStuckPortal = false; -@@ -3022,7 +3022,7 @@ public class PurpurWorldConfig { - public boolean zombieJockeyOnlyBaby = true; - public double zombieJockeyChance = 0.05D; - public boolean zombieJockeyTryExistingChickens = true; -- public boolean zombieAggressiveTowardsVillagerWhenLagging = true; -+ public boolean zombieAggressiveTowardsVillagerWhenLagging = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? true : false; // Plazma - Optimize Default Configurations - public boolean zombieBypassMobGriefing = false; - public boolean zombieTakeDamageFromWater = false; - public boolean zombieAlwaysDropExp = false; -diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java -index 5503ad6a93d331771a0e92c0da6adedf2ac81aff..bc51b53eb28d29ecee99ac36f84b8299b3fda217 100644 ---- a/src/main/java/org/spigotmc/SpigotWorldConfig.java -+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java -@@ -146,14 +146,14 @@ public class SpigotWorldConfig - public double itemMerge; - private void itemMerge() - { -- this.itemMerge = this.getDouble("merge-radius.item", 2.5 ); -+ this.itemMerge = this.getDouble("merge-radius.item", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 2.5 : 3.5 ); // Plazma - Optimize Default Configurations - this.log( "Item Merge Radius: " + this.itemMerge ); - } - - public double expMerge; - private void expMerge() - { -- this.expMerge = this.getDouble("merge-radius.exp", 3.0 ); -+ this.expMerge = this.getDouble("merge-radius.exp", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 3.0 : 4.0 ); // Plazma - Optimize Default Configurations - this.log( "Experience Merge Radius: " + this.expMerge ); - } - -@@ -192,7 +192,7 @@ public class SpigotWorldConfig - public byte mobSpawnRange; - private void mobSpawnRange() - { -- this.mobSpawnRange = (byte) getInt( "mob-spawn-range", 8 ); // Paper - Vanilla -+ this.mobSpawnRange = (byte) getInt( "mob-spawn-range", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 8 : 3 ); // Paper - Vanilla // Plazma - Optimize Default Configurations - this.log( "Mob Spawn Range: " + this.mobSpawnRange ); - } - -@@ -203,26 +203,26 @@ public class SpigotWorldConfig - this.log( "Item Despawn Rate: " + this.itemDespawnRate ); - } - -- public int animalActivationRange = 32; -- public int monsterActivationRange = 32; -+ public int animalActivationRange = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 32 : 16; // Plazma - Optimize Default Configurations -+ public int monsterActivationRange = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 32 : 24; // Plazma - Optimize Default Configurations - public int raiderActivationRange = 48; -- public int miscActivationRange = 16; -+ public int miscActivationRange = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 16 : 8; // Plazma - Optimize Default Configurations - // Paper start -- public int flyingMonsterActivationRange = 32; -- public int waterActivationRange = 16; -- public int villagerActivationRange = 32; -+ public int flyingMonsterActivationRange = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 32 : 48; // Plazma - Optimize Default Configurations -+ public int waterActivationRange = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 16 : 8; // Plazma - Optimize Default Configurations -+ public int villagerActivationRange = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 32 : 16; // Plazma - Optimize Default Configurations - public int wakeUpInactiveAnimals = 4; - public int wakeUpInactiveAnimalsEvery = 60*20; -- public int wakeUpInactiveAnimalsFor = 5*20; -- public int wakeUpInactiveMonsters = 8; -+ public int wakeUpInactiveAnimalsFor = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 5*20 : 40; // Plazma - Optimize Default Configurations -+ public int wakeUpInactiveMonsters = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 8 : 4; // Plazma - Optimize Default Configurations - public int wakeUpInactiveMonstersEvery = 20*20; -- public int wakeUpInactiveMonstersFor = 5*20; -- public int wakeUpInactiveVillagers = 4; -+ public int wakeUpInactiveMonstersFor = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 5*20 : 60; // Plazma - Optimize Default Configurations -+ public int wakeUpInactiveVillagers = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 4 : 1; // Plazma - Optimize Default Configurations - public int wakeUpInactiveVillagersEvery = 30*20; -- public int wakeUpInactiveVillagersFor = 5*20; -- public int wakeUpInactiveFlying = 8; -+ public int wakeUpInactiveVillagersFor = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 5*20 : 20; // Plazma - Optimize Default Configurations -+ public int wakeUpInactiveFlying = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 8 : 1; // Plazma - Optimize Default Configurations - public int wakeUpInactiveFlyingEvery = 10*20; -- public int wakeUpInactiveFlyingFor = 5*20; -+ public int wakeUpInactiveFlyingFor = Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 5*20 : 60; // Plazma - Optimize Default Configurations - public int villagersWorkImmunityAfter = 5*20; - public int villagersWorkImmunityFor = 20; - public boolean villagersActiveForPanic = true; -@@ -293,7 +293,7 @@ public class SpigotWorldConfig - { - this.set( "ticks-per.hopper-check", 1 ); - } -- this.hopperCheck = this.getInt( "ticks-per.hopper-check", 1 ); -+ this.hopperCheck = this.getInt( "ticks-per.hopper-check", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 1 : 8 ); // Plazma - Optimize Default Configurations - this.hopperAmount = this.getInt( "hopper-amount", 1 ); - this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false ); - this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks ); -@@ -303,7 +303,7 @@ public class SpigotWorldConfig - public int tridentDespawnRate; - private void arrowDespawnRate() - { -- this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", 1200 ); -+ this.arrowDespawnRate = this.getInt( "arrow-despawn-rate", Boolean.getBoolean("plazma.disableAutoOptimizeConfigurations") ? 1200 : 300 ); // Plazma - Optimize Default Configurations - this.tridentDespawnRate = this.getInt( "trident-despawn-rate", this.arrowDespawnRate ); - this.log( "Arrow Despawn Rate: " + this.arrowDespawnRate + " Trident Respawn Rate:" + this.tridentDespawnRate ); - } -diff --git a/src/main/resources/configurations/bukkit_optimized.yml b/src/main/resources/configurations/bukkit_optimized.yml -new file mode 100644 -index 0000000000000000000000000000000000000000..eb33b0a19d6060f78d7ead7a2ad63b1b2581293d ---- /dev/null -+++ b/src/main/resources/configurations/bukkit_optimized.yml -@@ -0,0 +1,45 @@ -+# This is the main configuration file for Bukkit. -+# As you can see, there's actually not that much to configure without any plugins. -+# For a reference for any variable inside this file, check out the Bukkit Wiki at -+# https://www.spigotmc.org/go/bukkit-yml -+# -+# If you need help on this file, feel free to join us on Discord or leave a message -+# on the forums asking for advice. -+# -+# Discord: https://www.spigotmc.org/go/discord -+# Forums: https://www.spigotmc.org/ -+# Bug tracker: https://www.spigotmc.org/go/bugs -+ -+ -+settings: -+ allow-end: true -+ warn-on-overload: true -+ permissions-file: permissions.yml -+ update-folder: update -+ plugin-profiling: false -+ connection-throttle: 4000 -+ query-plugins: true -+ deprecated-verbose: default -+ shutdown-message: Server closed -+ minimum-api: none -+ use-map-color-cache: true -+spawn-limits: -+ monsters: 20 -+ animals: 5 -+ water-animals: 2 -+ water-ambient: 2 -+ water-underground-creature: 3 -+ axolotls: 3 -+ ambient: 1 -+chunk-gc: -+ period-in-ticks: 400 -+ticks-per: -+ animal-spawns: 400 -+ monster-spawns: 10 -+ water-spawns: 400 -+ water-ambient-spawns: 400 -+ water-underground-creature-spawns: 400 -+ axolotl-spawns: 400 -+ ambient-spawns: 400 -+ autosave: 6000 -+aliases: now-in-commands.yml