diff --git a/gradle.properties b/gradle.properties index 49f259081..8d566aa13 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,13 +17,13 @@ version = 1.21.4-R0.1-SNAPSHOT mcVersion = 1.21.4 jdkVersion = 21 -paperRepo = https://github.com/PaperMC/Paper -paperBranch = master -purpurRepo = https://github.com/PurpurMC/Purpur +paperRepo = https://github.com/PaperMC/Paper-archive +paperBranch = ver/1.21.4 +purpurRepo = https://github.com/PlazmaMC/Purpur purpurBranch = ver/1.21.4 pufferfishRepo = https://github.com/pufferfish-gg/Pufferfish pufferfishBranch = ver/1.21 usePufferfish = false paperCommit = b746d9df0b6b7765478b2a72c2d963b6e668fa35 -purpurCommit = 4a204f1bd7cde4bd1a99673bf46f2373d3bcb7e5 +purpurCommit = f06fd5bb3880e660ecfb43beaadf8ddac175fa8f diff --git a/patches/api/0001-Purpur-API-Changes.patch b/patches/api/0001-Purpur-API-Changes.patch index 4887dd10e..55c0d81be 100644 --- a/patches/api/0001-Purpur-API-Changes.patch +++ b/patches/api/0001-Purpur-API-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: granny -Date: Sat, 14 Dec 2024 20:26:32 +0900 +Date: Wed, 25 Dec 2024 15:15:22 +0900 Subject: [PATCH] Purpur API Changes PurpurMC diff --git a/patches/server/0001-Purpur-Server-Changes.patch b/patches/server/0001-Purpur-Server-Changes.patch index ad02f90e5..d30020086 100644 --- a/patches/server/0001-Purpur-Server-Changes.patch +++ b/patches/server/0001-Purpur-Server-Changes.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: granny -Date: Sat, 14 Dec 2024 20:26:40 +0900 +Date: Wed, 25 Dec 2024 15:15:32 +0900 Subject: [PATCH] Purpur Server Changes PurpurMC @@ -25,7 +25,7 @@ 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 2da91ed6363c0851e4c459188f5e8ef5475e0c97..74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea 100644 +index 2da91ed6363c0851e4c459188f5e8ef5475e0c97..624588207afdc52adae14e5de3d18fe1c330d832 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,7 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { @@ -33,7 +33,7 @@ index 2da91ed6363c0851e4c459188f5e8ef5475e0c97..74d7aaae57e0e9ea9e31c4b2189ba50a dependencies { - implementation(project(":paper-api")) -+ implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur ++ implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur - Rebrand implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency // Paper start implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ @@ -43,14 +43,14 @@ index 2da91ed6363c0851e4c459188f5e8ef5475e0c97..74d7aaae57e0e9ea9e31c4b2189ba50a + // Pufferfish start + implementation("org.yaml:snakeyaml:1.32") -+ implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") { // Purpur ++ implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") { // Purpur - Fix pufferfish issues + exclude(group="org.yaml", module="snakeyaml") + } + // Pufferfish end + -+ implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur -+ implementation("org.mozilla:rhino-engine:1.7.14") // Purpur -+ implementation("dev.omega24:upnp4j:1.0") // Purpur ++ implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur - Rebrand ++ implementation("org.mozilla:rhino-engine:1.7.14") // Purpur - Rebrand ++ implementation("dev.omega24:upnp4j:1.0") // Purpur - Rebrand + testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") @@ -75,18 +75,18 @@ index 2da91ed6363c0851e4c459188f5e8ef5475e0c97..74d7aaae57e0e9ea9e31c4b2189ba50a attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", - "Implementation-Title" to "Paper", -+ "Implementation-Title" to "Purpur", // Pufferfish // Purpur ++ "Implementation-Title" to "Purpur", // Pufferfish // Purpur - Rebrand "Implementation-Version" to implementationVersion, "Implementation-Vendor" to date, // Paper - "Specification-Title" to "Paper", -+ "Specification-Title" to "Purpur", // Pufferfish // Purpur ++ "Specification-Title" to "Purpur", // Pufferfish // Purpur - Rebrand "Specification-Version" to project.version, - "Specification-Vendor" to "Paper Team", - "Brand-Id" to "papermc:paper", - "Brand-Name" to "Paper", -+ "Specification-Vendor" to "Purpur Team", // Pufferfish // Purpur -+ "Brand-Id" to "purpurmc:purpur", // Pufferfish // Purpur -+ "Brand-Name" to "Purpur", // Pufferfish // Purpur ++ "Specification-Vendor" to "Purpur Team", // Pufferfish // Purpur - Rebrand ++ "Brand-Id" to "purpurmc:purpur", // Pufferfish // Purpur - Rebrand ++ "Brand-Name" to "Purpur", // Pufferfish // Purpur - Rebrand "Build-Number" to (build ?: ""), "Build-Time" to Instant.now().toString(), "Git-Branch" to gitBranch, // Paper @@ -95,7 +95,7 @@ index 2da91ed6363c0851e4c459188f5e8ef5475e0c97..74d7aaae57e0e9ea9e31c4b2189ba50a block: JavaExec.() -> Unit ): TaskProvider = register(name) { - group = "paper" -+ group = "paperweight" // Purpur ++ group = "paperweight" // Purpur - Rebrand mainClass.set("org.bukkit.craftbukkit.Main") standardInput = System.`in` workingDir = rootProject.layout.projectDirectory @@ -240,7 +240,7 @@ index c21e00812f1aaa1279834a0562d360d6b89e146c..877d2095a066854939f260ca4b0b8c7b } diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 8f62879582195d8ae4f64bd23f752fa133b1c973..4a8f95670e25c81952cccbaf4c6e49514cacd529 100644 +index 8f62879582195d8ae4f64bd23f752fa133b1c973..be1bb14dca9367b9685841985b6198376986c496 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -592,7 +592,7 @@ public class Metrics { @@ -248,7 +248,7 @@ index 8f62879582195d8ae4f64bd23f752fa133b1c973..4a8f95670e25c81952cccbaf4c6e4951 // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { - Metrics metrics = new Metrics("Paper", serverUUID, logFailedRequests, Bukkit.getLogger()); -+ Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur ++ Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur - Purpur config files metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); @@ -266,13 +266,13 @@ index 8f62879582195d8ae4f64bd23f752fa133b1c973..4a8f95670e25c81952cccbaf4c6e4951 - paperVersion = "unknown"; - } - metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> paperVersion)); -+ metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur -+ metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur ++ metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur - Purpur config files ++ metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur - Purpur config files 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 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6d36fc6d8e22d9b68dea3830f6ecc8763184c343 100644 +index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..fe66e43c27e0798770e102d1385bacbaa90bda07 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java @@ -35,7 +35,10 @@ public class PaperVersionFetcher implements VersionFetcher { @@ -280,10 +280,10 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6d36fc6d8e22d9b68dea3830f6ecc876 private static final int DISTANCE_ERROR = -1; private static final int DISTANCE_UNKNOWN = -2; - private static final String DOWNLOAD_PAGE = "https://papermc.io/downloads/paper"; -+ // Purpur start ++ // Purpur start - Rebrand + private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads"; + private static int distance = DISTANCE_UNKNOWN; public int distance() { return distance; } -+ // Purpur end ++ // Purpur end - Rebrand @Override public long getCacheTime() { @@ -292,7 +292,7 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6d36fc6d8e22d9b68dea3830f6ecc876 updateMessage = text("You are running a development version without access to version information", color(0xFF5300)); } else { - updateMessage = getUpdateStatusMessage("PaperMC/Paper", build); -+ updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", build); // Purpur ++ updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", build); // Purpur - Rebrand } final @Nullable Component history = this.getHistory(); @@ -301,7 +301,7 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6d36fc6d8e22d9b68dea3830f6ecc876 private static Component getUpdateStatusMessage(final String repo, final ServerBuildInfo build) { - int distance = DISTANCE_ERROR; -+ //int distance = DISTANCE_ERROR; // Purpur - use field ++ //int distance = DISTANCE_ERROR; // Purpur - use field - Rebrand final OptionalInt buildNumber = build.buildNumber(); if (buildNumber.isPresent()) { @@ -313,10 +313,10 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6d36fc6d8e22d9b68dea3830f6ecc876 - case 0 -> text("You are running the latest version", NamedTextColor.GREEN); - case DISTANCE_UNKNOWN -> text("Unknown version", NamedTextColor.YELLOW); - default -> text("You are " + distance + " version(s) behind", NamedTextColor.YELLOW) -+ case DISTANCE_ERROR -> text("* Error obtaining version information", NamedTextColor.RED); // Purpur -+ case 0 -> text("* You are running the latest version", NamedTextColor.GREEN); // Purpur -+ case DISTANCE_UNKNOWN -> text("* Unknown version", NamedTextColor.YELLOW); // Purpur -+ default -> text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur ++ case DISTANCE_ERROR -> text("* Error obtaining version information", NamedTextColor.RED); // Purpur - Rebrand ++ case 0 -> text("* You are running the latest version", NamedTextColor.GREEN); // Purpur - Rebrand ++ case DISTANCE_UNKNOWN -> text("* Unknown version", NamedTextColor.YELLOW); // Purpur - Rebrand ++ default -> text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur - Rebrand .append(Component.newline()) .append(text("Download the new version at: ") .append(text(DOWNLOAD_PAGE, NamedTextColor.GOLD) @@ -325,7 +325,7 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6d36fc6d8e22d9b68dea3830f6ecc876 try { try (final BufferedReader reader = Resources.asCharSource( - URI.create("https://api.papermc.io/v2/projects/paper/versions/" + build.minecraftVersionId()).toURL(), -+ URI.create("https://api.purpurmc.org/v2/purpur/" + build.minecraftVersionId()).toURL(), // Purpur ++ URI.create("https://api.purpurmc.org/v2/purpur/" + build.minecraftVersionId()).toURL(), // Purpur - Rebrand Charsets.UTF_8 ).openBufferedStream()) { final JsonObject json = new Gson().fromJson(reader, JsonObject.class); @@ -334,12 +334,12 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6d36fc6d8e22d9b68dea3830f6ecc876 - .mapToInt(JsonElement::getAsInt) - .max() - .orElseThrow(); -+ //final JsonArray builds = json.getAsJsonArray("builds"); // Purpur -+ final int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur ++ //final JsonArray builds = json.getAsJsonArray("builds"); // Purpur - Rebrand ++ final int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur - Rebrand return latest - jenkinsBuild; } catch (final JsonSyntaxException ex) { - LOGGER.error("Error parsing json from Paper's downloads API", ex); -+ LOGGER.error("Error parsing json from Purpur's downloads API", ex); // Purpur ++ LOGGER.error("Error parsing json from Purpur's downloads API", ex); // Purpur - Rebrand return DISTANCE_ERROR; } } catch (final IOException e) { @@ -348,11 +348,11 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..6d36fc6d8e22d9b68dea3830f6ecc876 } - return text("Previous version: " + oldVersion, NamedTextColor.GRAY, TextDecoration.ITALIC); -+ return text("Previous: " + oldVersion, NamedTextColor.GRAY); // Purpur ++ return text("Previous: " + oldVersion, NamedTextColor.GRAY); // Purpur - Rebrand } } diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index 6ee39b534b8d992655bc0cef3c299d12cbae0034..90b3526479320064378f2cde6c2f2b8e48a59ba6 100644 +index 6ee39b534b8d992655bc0cef3c299d12cbae0034..bc7e4e5560708fea89c584b1d8b471f4966f311a 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -20,7 +20,7 @@ public final class PaperConsole extends SimpleTerminalConsole { @@ -360,7 +360,7 @@ index 6ee39b534b8d992655bc0cef3c299d12cbae0034..90b3526479320064378f2cde6c2f2b8e protected LineReader buildReader(LineReaderBuilder builder) { builder - .appName("Paper") -+ .appName("Purpur") // Purpur ++ .appName("Purpur") // Purpur - Rebrand .variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history")) .completer(new ConsoleCommandCompleter(this.server)) .option(LineReader.Option.COMPLETE_IN_WORD, true); @@ -380,14 +380,14 @@ index 6bdc683b5ade408ee27f1d6636b4d60c8c89cb7c..11d91f58208c1e816620f5b97c5fdfc6 ignored.add("goal_selector_1"); ignored.add("goal_selector_2"); diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java -index 12b327eea95e0de9e9c39b7d039badee8ec46508..849ecc5af70901f1e40cb6c419f33f1cf6f3b6be 100644 +index 12b327eea95e0de9e9c39b7d039badee8ec46508..46696cfe1d99e705d383a1fe4e66f5c5646053d2 100644 --- a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java +++ b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java @@ -61,6 +61,7 @@ public class RAMDetails extends JList { // Follows CraftServer#getTPS double[] tps = new double[] { -+ server.tps5s.getAverage(), // Purpur ++ server.tps5s.getAverage(), // Purpur - Add 5 second tps average in /tps server.tps1.getAverage(), server.tps5.getAverage(), server.tps15.getAverage() @@ -396,7 +396,7 @@ index 12b327eea95e0de9e9c39b7d039badee8ec46508..849ecc5af70901f1e40cb6c419f33f1c vector.add("Heap: " + (data.getTotal() / 1024L / 1024L) + " / " + (data.getMax() / 1024L / 1024L) + " mb"); vector.add("Avg tick: " + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / (double) TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms"); - vector.add("TPS from last 1m, 5m, 15m: " + String.join(", ", tpsAvg)); -+ vector.add("TPS from last 5s, 1m, 5m, 15m: " + String.join(", ", tpsAvg)); // Purpur ++ vector.add("TPS from last 5s, 1m, 5m, 15m: " + String.join(", ", tpsAvg)); // Purpur - Add 5 second tps average in /tps setListData(vector); } @@ -476,7 +476,7 @@ 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..411c81a88b8a008b2aaf0ca62fb7ffa1dd9e32a4 +index 0000000000000000000000000000000000000000..3ff4f092a59242a8cb930c084915a774db881652 --- /dev/null +++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java @@ -0,0 +1,281 @@ @@ -507,7 +507,7 @@ index 0000000000000000000000000000000000000000..411c81a88b8a008b2aaf0ca62fb7ffa1 + + private static final YamlFile config = new YamlFile(); + private static int updates = 0; -+ public static File pufferfishFile; // Purpur ++ public static File pufferfishFile; // Purpur - Fix pufferfish issues + + private static ConfigurationSection convertToBukkit(org.simpleyaml.configuration.ConfigurationSection section) { + ConfigurationSection newSection = new MemoryConfiguration(); @@ -530,7 +530,7 @@ index 0000000000000000000000000000000000000000..411c81a88b8a008b2aaf0ca62fb7ffa1 + } + + public static void load() throws IOException { -+ File configFile = pufferfishFile; // Purpur ++ File configFile = pufferfishFile; // Purpur - Fix pufferfish issues + + if (configFile.exists()) { + try { @@ -712,7 +712,7 @@ index 0000000000000000000000000000000000000000..411c81a88b8a008b2aaf0ca62fb7ffa1 + 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", false); // Purpur - Fix pufferfish issues + 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."); @@ -739,7 +739,7 @@ index 0000000000000000000000000000000000000000..411c81a88b8a008b2aaf0ca62fb7ffa1 + + public static boolean throttleInactiveGoalSelectorTick; + private static void inactiveGoalSelectorThrottle() { -+ throttleInactiveGoalSelectorTick = getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", false, // Purpur ++ throttleInactiveGoalSelectorTick = getBoolean("inactive-goal-selector-throttle", "inactive-goal-selector-disable", false, // Purpur - Fix pufferfish issues + "Throttles the AI goal selector in entity inactive ticks.", + "This can improve performance by a few percent, but has minor gameplay implications."); + } @@ -1261,15 +1261,15 @@ index 0000000000000000000000000000000000000000..facd55463d44cb7e3d2ca6892982f549 + } +} diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java -index 790bad0494454ca12ee152e3de6da3da634d9b20..3099c21ee589acf6edff5903a23673adf489024f 100644 +index 790bad0494454ca12ee152e3de6da3da634d9b20..0843e7c5c335a58d955a0841f2e02a9e4ac824d9 100644 --- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java +++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java @@ -31,6 +31,8 @@ public record ServerBuildInfoImpl( private static final String ATTRIBUTE_GIT_COMMIT = "Git-Commit"; private static final String BRAND_PAPER_NAME = "Paper"; -+ private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur -+ private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur ++ private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur - Fix pufferfish issues ++ private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur - Rebrand private static final String BUILD_DEV = "DEV"; @@ -1278,10 +1278,10 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..3099c21ee589acf6edff5903a23673ad getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID) .map(Key::key) - .orElse(BRAND_PAPER_ID), -+ .orElse(BRAND_PURPUR_ID), // Purpur ++ .orElse(BRAND_PURPUR_ID), // Purpur - Fix pufferfish issues // Purpur - Rebrand getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME) - .orElse(BRAND_PAPER_NAME), -+ .orElse(BRAND_PURPUR_NAME), // Purpur ++ .orElse(BRAND_PURPUR_NAME), // Purpur - Fix pufferfish issues // Purpur - Rebrand SharedConstants.getCurrentVersion().getId(), SharedConstants.getCurrentVersion().getName(), getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER) @@ -1290,7 +1290,7 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..3099c21ee589acf6edff5903a23673ad @Override public boolean isBrandCompatible(final @NotNull Key brandId) { - return brandId.equals(this.brandId); -+ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_PUFFERFISH_ID); // Purpur ++ return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_PUFFERFISH_ID); // Purpur - Fix pufferfish issues // Purpur - Rebrand } @Override @@ -1503,7 +1503,7 @@ index b24265573fdef5d9a964bcd76146f34542c420cf..710477ae27ebc5afdf0012ef0867d05e public SystemReport getSystemReport() { diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index 13bd145b1e8006a53c22f5dc0c78f29b540c7663..0d133cd7993eb40b19e2aabe8e2bfcdcf5352398 100644 +index 13bd145b1e8006a53c22f5dc0c78f29b540c7663..8ed5e9293e80f53d741c145fa415fab6311036d7 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java @@ -211,6 +211,19 @@ public class CommandSourceStack implements ExecutionCommandSource io.papermc.paper.adventure.PaperAdventure.asVanilla(message), broadcastToOps); + } -+ // Purpur end ++ // Purpur end - Purpur config files + public void sendSuccess(Supplier feedbackSupplier, boolean broadcastToOps) { boolean flag1 = this.source.acceptsSuccess() && !this.silent; boolean flag2 = broadcastToOps && this.source.shouldInformAdmins() && !this.silent; diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 517cb238ec280aadd1fc54bcb675ed386e798eaf..a5e8f2d8e5963c730a9509eddfadb9ca322c7183 100644 +index 517cb238ec280aadd1fc54bcb675ed386e798eaf..fe9a01e19ef182fb8e9c653fc1232ec7f13037e4 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java @@ -226,8 +226,8 @@ public class Commands { @@ -1582,8 +1582,8 @@ index 517cb238ec280aadd1fc54bcb675ed386e798eaf..a5e8f2d8e5963c730a9509eddfadb9ca + org.purpurmc.purpur.command.UptimeCommand.register(this.dispatcher); // Purpur + org.purpurmc.purpur.command.TPSBarCommand.register(this.dispatcher); // Purpur + org.purpurmc.purpur.command.CompassCommand.register(this.dispatcher); // Purpur -+ org.purpurmc.purpur.command.RamBarCommand.register(this.dispatcher); // Purpur -+ org.purpurmc.purpur.command.RamCommand.register(this.dispatcher); // Purpur ++ org.purpurmc.purpur.command.RamBarCommand.register(this.dispatcher); // Purpur - Implement ram and rambar commands ++ org.purpurmc.purpur.command.RamCommand.register(this.dispatcher); // Purpur - Implement ram and rambar commands } if (environment.includeIntegrated) { @@ -1604,7 +1604,7 @@ index 517cb238ec280aadd1fc54bcb675ed386e798eaf..a5e8f2d8e5963c730a9509eddfadb9ca } diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java -index c8d39e6e1c570c9219f6066da273dc0130920519..b455c7e9d18bac3654daa8510f85cc21202e254b 100644 +index c8d39e6e1c570c9219f6066da273dc0130920519..d881caf99c2bad66b76bdc6ddb11a6cac1e94db6 100644 --- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java +++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java @@ -198,10 +198,10 @@ public class EntitySelector { @@ -1612,11 +1612,11 @@ index c8d39e6e1c570c9219f6066da273dc0130920519..b455c7e9d18bac3654daa8510f85cc21 if (this.playerName != null) { entityplayer = source.getServer().getPlayerList().getPlayerByName(this.playerName); - return entityplayer == null ? List.of() : List.of(entityplayer); -+ return entityplayer == null || !canSee(source, entityplayer) ? List.of() : List.of(entityplayer); // Purpur ++ return entityplayer == null || !canSee(source, entityplayer) ? List.of() : List.of(entityplayer); // Purpur - Hide hidden players from entity selector } else if (this.entityUUID != null) { entityplayer = source.getServer().getPlayerList().getPlayer(this.entityUUID); - return entityplayer == null ? List.of() : List.of(entityplayer); -+ return entityplayer == null || !canSee(source, entityplayer) ? List.of() : List.of(entityplayer); // Purpur ++ return entityplayer == null || !canSee(source, entityplayer) ? List.of() : List.of(entityplayer); // Purpur - Hide hidden players from entity selector } else { Vec3 vec3d = (Vec3) this.position.apply(source.getPosition()); AABB axisalignedbb = this.getAbsoluteAabb(vec3d); @@ -1625,7 +1625,7 @@ index c8d39e6e1c570c9219f6066da273dc0130920519..b455c7e9d18bac3654daa8510f85cc21 if (predicate.test(entityplayer1)) { - return List.of(entityplayer1); -+ return !canSee(source, entityplayer1) ? List.of() : List.of(entityplayer1); // Purpur ++ return !canSee(source, entityplayer1) ? List.of() : List.of(entityplayer1); // Purpur - Hide hidden players from entity selector } } @@ -1633,7 +1633,7 @@ index c8d39e6e1c570c9219f6066da273dc0130920519..b455c7e9d18bac3654daa8510f85cc21 if (this.isWorldLimited()) { object = source.getLevel().getPlayers(predicate, i); -+ ((List) object).removeIf(entityplayer3 -> !canSee(source, (ServerPlayer) entityplayer3)); // Purpur ++ ((List) object).removeIf(entityplayer3 -> !canSee(source, (ServerPlayer) entityplayer3)); // Purpur - Hide hidden players from entity selector } else { object = new ObjectArrayList(); Iterator iterator = source.getServer().getPlayerList().getPlayers().iterator(); @@ -1642,7 +1642,7 @@ index c8d39e6e1c570c9219f6066da273dc0130920519..b455c7e9d18bac3654daa8510f85cc21 ServerPlayer entityplayer2 = (ServerPlayer) iterator.next(); - if (predicate.test(entityplayer2)) { -+ if (predicate.test(entityplayer2) && canSee(source, entityplayer2)) { // Purpur ++ if (predicate.test(entityplayer2) && canSee(source, entityplayer2)) { // Purpur - Hide hidden players from entity selector ((List) object).add(entityplayer2); if (((List) object).size() >= i) { return (List) object; @@ -1651,11 +1651,11 @@ index c8d39e6e1c570c9219f6066da273dc0130920519..b455c7e9d18bac3654daa8510f85cc21 return ComponentUtils.formatList(entities, Entity::getDisplayName); } + -+ // Purpur start ++ // Purpur start - Hide hidden players from entity selector + private boolean canSee(CommandSourceStack sender, ServerPlayer target) { + return !org.purpurmc.purpur.PurpurConfig.hideHiddenPlayersFromEntitySelector || !(sender.getEntity() instanceof ServerPlayer player) || player.getBukkitEntity().canSee(target.getBukkitEntity()); + } -+ // Purpur end ++ // Purpur end - Hide hidden players from entity selector } diff --git a/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java b/src/main/java/net/minecraft/commands/execution/tasks/BuildContexts.java index b0d26b0eadb2a43924629424a6c13198aace8f69..9f5c3ec2eae9b30bdb8dbcb328d7f701cb7aeb9d 100644 @@ -1704,18 +1704,18 @@ index 7b118a92a6eb779f800ae8f5d8f6e3c861fc4f6a..057a038e8dcacd7496a0b2373de2c202 register(registry, "template_rotation", TemplateRotationArgument.class, SingletonArgumentInfo.contextFree(TemplateRotationArgument::templateRotation)); register(registry, "heightmap", HeightmapTypeArgument.class, SingletonArgumentInfo.contextFree(HeightmapTypeArgument::heightmap)); diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index faffd87c357511ef00646971a16acf1009362c59..c98e0d9d8bc9e6ef12a9b9d6082e98bc5bb7a5f6 100644 +index faffd87c357511ef00646971a16acf1009362c59..6714b4a39180affd101f1cab0d587cf2d3e6886a 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java @@ -63,6 +63,12 @@ public class BlockPos extends Vec3i { public static final int MAX_HORIZONTAL_COORDINATE = 33554431; // Paper end - Optimize Bit Operations by inlining -+ // Purpur start ++ // Purpur start - Ridables + public BlockPos(net.minecraft.world.entity.Entity entity) { + super(entity.getBlockX(), entity.getBlockY(), entity.getBlockZ()); + } -+ // Purpur end ++ // Purpur end - Ridables + public BlockPos(int x, int y, int z) { super(x, y, z); @@ -1816,7 +1816,7 @@ index 300a044bb0f0e377133f24469cea1a9669de6e58..a880f4e5cf712654649ad043e58e073e Bootstrap.bootStrap(); Bootstrap.validate(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5aa2cfcb5 100644 +index ae4ebf509837e8d44255781c61d02873f8b74be8..fa5f7bc53f3dfa5581f7c747c732ebc7737a7820 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -314,6 +314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping -+ public boolean lagging = false; // Purpur -+ protected boolean upnp = false; // Purpur ++ public boolean lagging = false; // Purpur - Lagging threshold ++ protected boolean upnp = false; // Purpur - UPnP Port Forwarding public volatile Thread shutdownThread; // Paper public volatile boolean abnormalExit = false; // Paper @@ -1851,7 +1851,7 @@ index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5 MinecraftServer.LOGGER.info("Stopping server"); Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing -+ // Purpur start ++ // Purpur start - UPnP Port Forwarding + if (upnp) { + if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) { + LOGGER.info("[UPnP] Port {} closed", this.getPort()); @@ -1859,7 +1859,7 @@ index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5 + LOGGER.error("[UPnP] Failed to close port {}", this.getPort()); + } + } -+ // Purpur end ++ // Purpur end - UPnP Port Forwarding // CraftBukkit start if (this.server != null) { this.server.spark.disable(); // Paper - spark @@ -1876,7 +1876,7 @@ index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5 private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L; private long lastTick = 0; private long catchupTime = 0; -+ public final RollingAverage tps5s = new RollingAverage(5); // Purpur ++ public final RollingAverage tps5s = new RollingAverage(5); // Purpur - Add 5 second tps average in /tps public final RollingAverage tps1 = new RollingAverage(60); public final RollingAverage tps5 = new RollingAverage(60 * 5); public final RollingAverage tps15 = new RollingAverage(60 * 15); @@ -1910,7 +1910,7 @@ index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5 if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) { final long diff = currentTime - tickSection; final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP); -+ tps5s.add(currentTps, diff); // Purpur ++ tps5s.add(currentTps, diff); // Purpur - Add 5 second tps average in /tps tps1.add(currentTps, diff); tps5.add(currentTps, diff); tps15.add(currentTps, diff); @@ -1919,13 +1919,13 @@ index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5 - this.recentTps[0] = tps1.getAverage(); - this.recentTps[1] = tps5.getAverage(); - this.recentTps[2] = tps15.getAverage(); -+ // Purpur start ++ // Purpur start - Add 5 second tps average in /tps + this.recentTps[0] = tps5s.getAverage(); + this.recentTps[1] = tps1.getAverage(); + this.recentTps[2] = tps5.getAverage(); + this.recentTps[3] = tps15.getAverage(); -+ // Purpur end -+ lagging = recentTps[0] < org.purpurmc.purpur.PurpurConfig.laggingThreshold; // Purpur ++ // Purpur end - Add 5 second tps average in /tps ++ lagging = recentTps[0] < org.purpurmc.purpur.PurpurConfig.laggingThreshold; // Purpur - Lagging threshold tickSection = currentTime; } // Paper end - further improve server tick loop @@ -1934,7 +1934,7 @@ index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5 this.mayHaveDelayedTasks = true; this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos); + // Pufferfish start - tps catchup -+ if (!gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup || !gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup) { // Purpur ++ if (!org.purpurmc.purpur.PurpurConfig.tpsCatchup || !gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup) { // Purpur + this.nextTickTimeNanos = currentTime + i; + this.delayedTasksMaxNextTickTimeNanos = nextTickTimeNanos; + } @@ -1947,7 +1947,7 @@ index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5 final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight); for (Player entityhuman : level.players()) { - if (!(entityhuman instanceof ServerPlayer) || (tickCount + entityhuman.getId()) % 20 != 0) { -+ if (!(entityhuman instanceof ServerPlayer) || (!level.isForceTime() && (tickCount + entityhuman.getId()) % 20 != 0)) { // Purpur ++ if (!(entityhuman instanceof ServerPlayer) || (!level.isForceTime() && (tickCount + entityhuman.getId()) % 20 != 0)) { // Purpur - Configurable daylight cycle continue; } ServerPlayer entityplayer = (ServerPlayer) entityhuman; @@ -1955,7 +1955,7 @@ index ae4ebf509837e8d44255781c61d02873f8b74be8..95f1e0ae174400f2cf7bfed2897259d5 worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers worldserver.updateLagCompensationTick(); // Paper - lag compensation -+ worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur ++ worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur - Ridables gameprofilerfiller.push(() -> { String s = String.valueOf(worldserver); @@ -2054,7 +2054,7 @@ index 0d9de4c61c7b26a6ff37c12fde629161fd0c3d5a..2f7897744f4aea718170698881773e90 entityitem = entityplayer.drop(itemstack, false, false, false); // CraftBukkit - SPIGOT-2942: Add boolean to call event if (entityitem != null) { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..7a442fb4cf78bcb1268359ee41a6de138edb76b6 100644 +index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..0a579af1f1ecd6e73a8440e6821c41338dd28829 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -111,6 +111,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -2081,21 +2081,31 @@ index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..7a442fb4cf78bcb1268359ee41a6de13 // Paper start - initialize global and world-defaults configuration this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess()); this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); -@@ -236,6 +246,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -235,7 +245,19 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface + io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics ++ // Purpur start - Purpur config files ++ try { ++ org.purpurmc.purpur.PurpurConfig.init((java.io.File) options.valueOf("purpur-settings")); ++ } catch (Exception e) { ++ DedicatedServer.LOGGER.error("Unable to load server configuration", e); ++ return false; ++ } ++ org.purpurmc.purpur.PurpurConfig.registerCommands(); ++ // Purpur end - Purpur config files com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now -+ gg.pufferfish.pufferfish.PufferfishConfig.pufferfishFile = (java.io.File) options.valueOf("pufferfish-settings"); // Purpur ++ gg.pufferfish.pufferfish.PufferfishConfig.pufferfishFile = (java.io.File) options.valueOf("pufferfish-settings"); // Purpur - Fix pufferfish issues + gg.pufferfish.pufferfish.PufferfishConfig.load(); // Pufferfish + gg.pufferfish.pufferfish.PufferfishCommand.init(); // Pufferfish this.setPvpAllowed(dedicatedserverproperties.pvp); this.setFlightAllowed(dedicatedserverproperties.allowFlight); -@@ -283,6 +296,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -283,6 +305,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface if (true) throw new IllegalStateException("Failed to bind to port", ioexception); // Paper - Propagate failed to bind to port error return false; } -+ // Purpur start ++ // Purpur start - UPnP Port Forwarding + if (org.purpurmc.purpur.PurpurConfig.useUPnP) { + LOGGER.info("[UPnP] Attempting to start UPnP port forwarding service..."); + if (dev.omega24.upnp4j.UPnP4J.isUPnPAvailable()) { @@ -2118,11 +2128,11 @@ index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..7a442fb4cf78bcb1268359ee41a6de13 + LOGGER.error("[UPnP] Service is unavailable"); + } + } -+ // Purpur end ++ // Purpur end - UPnP Port Forwarding // CraftBukkit start // this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up -@@ -356,6 +393,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -356,6 +402,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface DedicatedServer.LOGGER.info("JMX monitoring enabled"); } @@ -2282,7 +2292,7 @@ index 759062d219ff490a3cb19e710c4d18e3e08288e0..8f74c2ec5252b6265549589310d74233 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/gui/StatsComponent.java b/src/main/java/net/minecraft/server/gui/StatsComponent.java -index 096c89bd01cec2abd151bf6fffc4847d1bcd548f..cd0a8a6a1be75cab8bbb8ee3ac17bb732b9e7108 100644 +index 096c89bd01cec2abd151bf6fffc4847d1bcd548f..735c2b3434715edf8fe40cbb5ce46ae10b73026c 100644 --- a/src/main/java/net/minecraft/server/gui/StatsComponent.java +++ b/src/main/java/net/minecraft/server/gui/StatsComponent.java @@ -45,7 +45,7 @@ public class StatsComponent extends JComponent { @@ -2290,7 +2300,7 @@ index 096c89bd01cec2abd151bf6fffc4847d1bcd548f..cd0a8a6a1be75cab8bbb8ee3ac17bb73 + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / (double)TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms"; - this.msgs[2] = "TPS from last 1m, 5m, 15m: " + String.join(", ", tpsAvg); -+ this.msgs[2] = "TPS from last 5s, 1m, 5m, 15m: " + String.join(", ", tpsAvg); // Purpur ++ this.msgs[2] = "TPS from last 5s, 1m, 5m, 15m: " + String.join(", ", tpsAvg); // Purpur - Add 5 second tps average in /tps // Paper end - Improve ServerGUI this.values[this.vp++ & 0xFF] = (int)(l * 100L / Runtime.getRuntime().maxMemory()); this.repaint(); @@ -2402,7 +2412,7 @@ index 1c87904bb99cc40bafc9357fb2fc1703b759c3df..aea9a45c0916501f71018d3250b56da4 if (true) { // Paper - rewrite chunk system diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 103e2c414780be66324bcb9cd4ea539bbdfe12ad..b0675953a75ff01f714cf5f35ad3907281648724 100644 +index 103e2c414780be66324bcb9cd4ea539bbdfe12ad..2bec5ed591e658765602379f9065b8089f5df6ea 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java @@ -81,7 +81,7 @@ public class ServerEntity { @@ -2410,7 +2420,7 @@ index 103e2c414780be66324bcb9cd4ea539bbdfe12ad..b0675953a75ff01f714cf5f35ad39072 private List> trackedDataValues; // CraftBukkit start - private final Set trackedPlayers; -+ public final Set trackedPlayers; // Purpur - private -> public ++ public final Set trackedPlayers; // Purpur - private -> public - Item entity immunities public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer> consumer, Set trackedPlayers) { this.trackedPlayers = trackedPlayers; @@ -2431,15 +2441,15 @@ index 103e2c414780be66324bcb9cd4ea539bbdfe12ad..b0675953a75ff01f714cf5f35ad39072 this.wasOnGround = this.entity.onGround(); 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 1f898500d0e9b18a880645ceb0a8ff0fe75f4e48..d0653880e8f8852a27e16c5c964fb7b86c40d542 100644 +index 1f898500d0e9b18a880645ceb0a8ff0fe75f4e48..fe8a1a073920b7cbbe3791ac1fcac3fccec6b9f7 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -224,6 +224,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe private final StructureManager structureManager; private final StructureCheck structureCheck; private final boolean tickTime; -+ private double preciseTime; // Purpur -+ private boolean forceTime; // Purpur ++ private double preciseTime; // Purpur - Configurable daylight cycle ++ private boolean forceTime; // Purpur - Configurable daylight cycle private final RandomSequences randomSequences; // CraftBukkit start @@ -2447,7 +2457,7 @@ index 1f898500d0e9b18a880645ceb0a8ff0fe75f4e48..d0653880e8f8852a27e16c5c964fb7b8 public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current) -+ public boolean hasRidableMoveEvent = false; // Purpur ++ public boolean hasRidableMoveEvent = false; // Purpur - Ridables public LevelChunk getChunkIfLoaded(int x, int z) { return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately @@ -2481,7 +2491,7 @@ index 1f898500d0e9b18a880645ceb0a8ff0fe75f4e48..d0653880e8f8852a27e16c5c964fb7b8 this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler); // Paper end - rewrite chunk system this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit -+ this.preciseTime = this.serverLevelData.getDayTime(); // Purpur ++ this.preciseTime = this.serverLevelData.getDayTime(); // Purpur - Configurable daylight cycle } // Paper start @@ -2528,13 +2538,13 @@ index 1f898500d0e9b18a880645ceb0a8ff0fe75f4e48..d0653880e8f8852a27e16c5c964fb7b8 this.serverLevelData.getScheduledEvents().tick(this.server, i); Profiler.get().pop(); if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { -+ // Purpur start ++ // Purpur start - Configurable daylight cycle + int incrementTicks = isDay() ? this.purpurConfig.daytimeTicks : this.purpurConfig.nighttimeTicks; + if (incrementTicks != 12000) { + this.preciseTime += 12000 / (double) incrementTicks; + this.setDayTime(this.preciseTime); + } else -+ // Purpur end ++ // Purpur end - Configurable daylight cycle this.setDayTime(this.levelData.getDayTime() + 1L); } @@ -2542,21 +2552,21 @@ index 1f898500d0e9b18a880645ceb0a8ff0fe75f4e48..d0653880e8f8852a27e16c5c964fb7b8 public void setDayTime(long timeOfDay) { this.serverLevelData.setDayTime(timeOfDay); -+ // Purpur start ++ // Purpur start - Configurable daylight cycle + this.preciseTime = timeOfDay; + this.forceTime = false; + } + public void setDayTime(double i) { + this.serverLevelData.setDayTime((long) i); + this.forceTime = true; -+ // Purpur end ++ // Purpur end - Configurable daylight cycle } -+ // Purpur start ++ // Purpur start - Configurable daylight cycle + public boolean isForceTime() { + return this.forceTime; + } -+ // Purpur end ++ // Purpur end - Configurable daylight cycle + public void tickCustomSpawners(boolean spawnMonsters, boolean spawnAnimals) { Iterator iterator = this.customSpawners.iterator(); @@ -2650,22 +2660,22 @@ index 1f898500d0e9b18a880645ceb0a8ff0fe75f4e48..d0653880e8f8852a27e16c5c964fb7b8 if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message // Paper start - Fix merchant inventory not closing on entity removal - if (entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) { -+ if (!entity.level().purpurConfig.playerVoidTrading && entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) { // Purpur ++ if (!entity.level().purpurConfig.playerVoidTrading && entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) { // Purpur - Allow void trading merchant.getTrader().closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); } // Paper end - Fix merchant inventory not closing on entity removal diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d561478a27ece9 100644 +index fc7f7a34babd095a51b5321f600aef65a2a9d123..6f39fd99ffb28d6c0267f4251c54af0c519289db 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -327,6 +327,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent public @Nullable String clientBrandName = null; // Paper - Brand support public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event -+ public boolean purpurClient = false; // Purpur ++ public boolean purpurClient = false; // Purpur - Purpur client support + private boolean tpsBar = false; // Purpur + private boolean compassBar = false; // Purpur -+ private boolean ramBar = false; // Purpur ++ private boolean ramBar = false; // Purpur - Implement ram and rambar commands // Paper start - rewrite chunk system private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader; @@ -2675,7 +2685,7 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 + if (nbt.contains("Purpur.TPSBar")) { this.tpsBar = nbt.getBoolean("Purpur.TPSBar"); } // Purpur + if (nbt.contains("Purpur.CompassBar")) { this.compassBar = nbt.getBoolean("Purpur.CompassBar"); } // Purpur -+ if (nbt.contains("Purpur.RamBar")) { this.ramBar = nbt.getBoolean("Purpur.RamBar"); } // Purpur ++ if (nbt.contains("Purpur.RamBar")) { this.ramBar = nbt.getBoolean("Purpur.RamBar"); } // Purpur - Implement ram and rambar commands } @Override @@ -2683,7 +2693,7 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 } this.saveEnderPearls(nbt); -+ nbt.putBoolean("Purpur.RamBar", this.ramBar); // Purpur ++ nbt.putBoolean("Purpur.RamBar", this.ramBar); // Purpur - Implement ram and rambar commands + nbt.putBoolean("Purpur.TPSBar", this.tpsBar); // Purpur + nbt.putBoolean("Purpur.CompassBar", this.compassBar); // Purpur } @@ -2694,14 +2704,14 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 this.updatePlayerAttributes(); this.advancements.flushDirty(this); + -+ // Purpur start ++ // Purpur start - Ridables + if (this.level().purpurConfig.useNightVisionWhenRiding && this.getVehicle() != null && this.getVehicle().getRider() == this && this.level().getGameTime() % 100 == 0) { // 5 seconds + MobEffectInstance nightVision = this.getEffect(MobEffects.NIGHT_VISION); + if (nightVision == null || nightVision.getDuration() <= 300) { // 15 seconds + this.addEffect(new MobEffectInstance(MobEffects.NIGHT_VISION, 400, 0)); // 20 seconds + } + } -+ // Purpur end ++ // Purpur end - Ridables } private void updatePlayerAttributes() { @@ -2717,8 +2727,8 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 if (this.isInvulnerableTo(world, source)) { return false; } else { -+ // Purpur start -+ if (source.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) { // Purpur ++ // Purpur start - Add boat fall damage config ++ if (source.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) { + if (getRootVehicle() instanceof net.minecraft.world.entity.vehicle.AbstractMinecart && level().purpurConfig.minecartControllable && !level().purpurConfig.minecartControllableFallDamage) { + return false; + } @@ -2726,7 +2736,7 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 + return false; + } + } -+ // Purpur end ++ // Purpur end - Add boat fall damage config Entity entity = source.getEntity(); if (entity instanceof net.minecraft.world.entity.player.Player) { @@ -2780,7 +2790,7 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 this.lastSentExp = -1; // CraftBukkit - Added to reset } -+ // Purpur start ++ // Purpur start - Component related conveniences + public void sendActionBarMessage(@Nullable String message) { + if (message != null && !message.isEmpty()) { + sendActionBarMessage(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message)); @@ -2798,7 +2808,7 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 + displayClientMessage(message, true); + } + } -+ // Purpur end ++ // Purpur end - Component related conveniences + @Override public void displayClientMessage(Component message, boolean overlay) { @@ -2807,7 +2817,7 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 return new CommandSourceStack(this.commandSource(), this.position(), this.getRotationVector(), this.serverLevel(), this.getPermissionLevel(), this.getName().getString(), this.getDisplayName(), this.server, this); } -+ // Purpur Start ++ // Purpur start - Component related conveniences + public void sendMiniMessage(@Nullable String message) { + if (message != null && !message.isEmpty()) { + this.sendMessage(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message)); @@ -2819,7 +2829,7 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 + this.sendSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message)); + } + } -+ // Purpur end ++ // Purpur end - Component related conveniences + public void sendSystemMessage(Component message) { this.sendSystemMessage(message, false); @@ -2831,7 +2841,7 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 + this.setAfk(false); // Purpur } -+ // Purpur Start ++ // Purpur start - AFK API + private boolean isAfk = false; + + @Override @@ -2888,7 +2898,7 @@ index fc7f7a34babd095a51b5321f600aef65a2a9d123..3f6ffe3da816eb53bfe065b4b7d56147 + public boolean canBeCollidedWith() { + return !this.isAfk() && super.canBeCollidedWith(); + } -+ // Purpur End ++ // Purpur end - AFK API + public ServerStatsCounter getStats() { return this.stats; @@ -3005,7 +3015,7 @@ index e4b0dc3121101d54394a0c3a413dabf8103b2ea6..a8484b9659f175cc20985bf66082616c Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStep.targetStatus()) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); hasSetFarWarned = true; diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index b0bc66dc7248aae691dcab68b925b52a1695e63f..7d276c191b391bca24948ddb36b8b7d0f1f03b03 100644 +index b0bc66dc7248aae691dcab68b925b52a1695e63f..df48c2754dc1ebd52addd8ae768cba5916ce3969 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -80,11 +80,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -3018,7 +3028,7 @@ index b0bc66dc7248aae691dcab68b925b52a1695e63f..7d276c191b391bca24948ddb36b8b7d0 public final java.util.Map packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit protected static final ResourceLocation MINECRAFT_BRAND = ResourceLocation.withDefaultNamespace("brand"); // Paper - Brand support -+ protected static final ResourceLocation PURPUR_CLIENT = ResourceLocation.fromNamespaceAndPath("purpur", "client"); // Purpur ++ protected static final ResourceLocation PURPUR_CLIENT = ResourceLocation.fromNamespaceAndPath("purpur", "client"); // Purpur - Purpur client support public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit this.server = minecraftserver; @@ -3043,13 +3053,13 @@ index b0bc66dc7248aae691dcab68b925b52a1695e63f..7d276c191b391bca24948ddb36b8b7d0 ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex); this.disconnect(Component.literal("Invalid payload REGISTER!"), PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause } -+ // Purpur start ++ // Purpur start - Purpur client support + } else if (identifier.equals(PURPUR_CLIENT)) { + try { + player.purpurClient = true; + } catch (Exception ignore) { + } -+ // Purpur end ++ // Purpur end - Purpur client support } else if (identifier.equals(ServerCommonPacketListenerImpl.CUSTOM_UNREGISTER)) { try { String channels = payload.toString(com.google.common.base.Charsets.UTF_8); @@ -3076,14 +3086,14 @@ index b0bc66dc7248aae691dcab68b925b52a1695e63f..7d276c191b391bca24948ddb36b8b7d0 if (this.keepAlivePending && !this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6411babfc 100644 +index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..c783c17d45beda8297171d0834350197808a7335 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -344,6 +344,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private boolean justTeleported = false; // CraftBukkit end -+ // Purpur start ++ // Purpur start - AFK API + private final com.google.common.cache.LoadingCache kickPermissionCache = com.google.common.cache.CacheBuilder.newBuilder() + .maximumSize(1000) + .expireAfterWrite(1, java.util.concurrent.TimeUnit.MINUTES) @@ -3095,7 +3105,7 @@ index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6 + } + } + ); -+ // Purpur end ++ // Purpur end - AFK API + @Override public void tick() { @@ -3104,12 +3114,12 @@ index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6 this.recipeSpamPackets.tick(); // Paper - auto recipe limit this.dropSpamThrottler.tick(); if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits -+ // Purpur start ++ // Purpur start - AFK API + this.player.setAfk(true); + if (!this.player.level().purpurConfig.idleTimeoutKick || (!Boolean.parseBoolean(System.getenv("PURPUR_FORCE_IDLE_KICK")) && kickPermissionCache.getUnchecked(this.player.getBukkitEntity()))) { + return; + } -+ // Purpur end ++ // Purpur end - AFK API this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause } @@ -3117,7 +3127,7 @@ index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6 this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); -+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur ++ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur - AFK API + Location oldTo = to.clone(); PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); @@ -3260,7 +3270,7 @@ index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6 if (event.getLogWarning()) // Paper end - ServerGamePacketListenerImpl.LOGGER.warn("{} moved wrongly!", this.player.getName().getString()); -+ ServerGamePacketListenerImpl.LOGGER.warn("{} moved wrongly!, ({})", this.player.getName().getString(), d11); // Purpur ++ ServerGamePacketListenerImpl.LOGGER.warn("{} moved wrongly!, ({})", this.player.getName().getString(), d11); // Purpur - AFK API } // Paper } @@ -3268,7 +3278,7 @@ index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6 this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); -+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur ++ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur - AFK API + Location oldTo = to.clone(); PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); @@ -3277,12 +3287,12 @@ index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6 this.player.tryResetCurrentImpulseContext(); } -+ // Purpur Start ++ // Purpur start - Dont run with scissors! + if (this.player.serverLevel().purpurConfig.dontRunWithScissors && this.player.isSprinting() && !(this.player.serverLevel().purpurConfig.ignoreScissorsInWater && this.player.isInWater()) && !(this.player.serverLevel().purpurConfig.ignoreScissorsInLava && this.player.isInLava()) && (isScissors(this.player.getItemInHand(InteractionHand.MAIN_HAND)) || isScissors(this.player.getItemInHand(InteractionHand.OFF_HAND))) && (int) (Math.random() * 10) == 0) { + this.player.hurtServer(this.player.serverLevel(), this.player.damageSources().scissors(), (float) this.player.serverLevel().purpurConfig.scissorsRunningDamage); + if (!org.purpurmc.purpur.PurpurConfig.dontRunWithScissors.isBlank()) this.player.sendActionBarMessage(org.purpurmc.purpur.PurpurConfig.dontRunWithScissors); + } -+ // Purpur End ++ // Purpur end - Dont run with scissors! + this.player.checkMovementStatistics(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5); this.lastGoodX = this.player.getX(); @@ -3291,7 +3301,7 @@ index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6 } } -+ // Purpur start ++ // Purpur start - Dont run with scissors! + public boolean isScissors(ItemStack stack) { + if (!stack.is(Items.SHEARS)) return false; + @@ -3300,7 +3310,7 @@ index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6 + + return stack.getOrDefault(DataComponents.CUSTOM_MODEL_DATA, net.minecraft.world.item.component.CustomModelData.EMPTY).equals(net.minecraft.world.item.component.CustomModelData.EMPTY); + } -+ // Purpur end ++ // Purpur end - Dont run with scissors! + // Paper start - optimise out extra getCubes private boolean hasNewCollision(final ServerLevel world, final Entity entity, final AABB oldBox, final AABB newBox) { @@ -3325,7 +3335,7 @@ index 84fa24880d02dc7ba1ec8bda3575be38447fd4b2..8a468f0c09daf23cfbddb3c607a758c6 ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event); -+ player.processClick(enumhand); // Purpur ++ player.processClick(enumhand); // Purpur - Ridables + // 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)) { @@ -3356,7 +3366,7 @@ index 532f09089b8d6798999cf3f83e852df7479e450e..43c63d203859eaa0999937e2f9254c22 // Paper end } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9b71655a425356132afb786eff623f558e1e3498..e1d195ab8b005edd7fcded810ddf903b47c000a1 100644 +index 9b71655a425356132afb786eff623f558e1e3498..5b1705794a8c3914cb11fdd35f75c8e0c128ecd0 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -419,6 +419,7 @@ public abstract class PlayerList { @@ -3388,7 +3398,7 @@ index 9b71655a425356132afb786eff623f558e1e3498..e1d195ab8b005edd7fcded810ddf903b } // CraftBukkit end -+ // Purpur Start ++ // Purpur start - Component related conveniences + public void broadcastMiniMessage(@Nullable String message, boolean overlay) { + if (message != null && !message.isEmpty()) { + this.broadcastMessage(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message), overlay); @@ -3400,7 +3410,7 @@ index 9b71655a425356132afb786eff623f558e1e3498..e1d195ab8b005edd7fcded810ddf903b + this.broadcastSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(message), overlay); + } + } -+ // Purpur end ++ // Purpur end - Component related conveniences + public void broadcastAll(Packet packet, ResourceKey dimension) { Iterator iterator = this.players.iterator(); @@ -3442,7 +3452,7 @@ index 9b71655a425356132afb786eff623f558e1e3498..e1d195ab8b005edd7fcded810ddf903b public boolean isWhiteListed(GameProfile profile) { diff --git a/src/main/java/net/minecraft/server/players/SleepStatus.java b/src/main/java/net/minecraft/server/players/SleepStatus.java -index 823efad652d8ff9e96b99375b102fef6f017716e..caa8a69bde0c212c36dd990a67836ac2f95548c0 100644 +index 823efad652d8ff9e96b99375b102fef6f017716e..bdf0240840d92bf95f94c6fb1125eeaa105e303b 100644 --- a/src/main/java/net/minecraft/server/players/SleepStatus.java +++ b/src/main/java/net/minecraft/server/players/SleepStatus.java @@ -19,7 +19,7 @@ public class SleepStatus { @@ -3450,7 +3460,7 @@ index 823efad652d8ff9e96b99375b102fef6f017716e..caa8a69bde0c212c36dd990a67836ac2 public boolean areEnoughDeepSleeping(int percentage, List players) { // CraftBukkit start - int j = (int) players.stream().filter((eh) -> { return eh.isSleepingLongEnough() || eh.fauxSleeping; }).count(); -+ int j = (int) players.stream().filter((eh) -> { return eh.isSleepingLongEnough() || eh.fauxSleeping || (eh.level().purpurConfig.idleTimeoutCountAsSleeping && eh.isAfk()); }).count(); // Purpur ++ int j = (int) players.stream().filter((eh) -> { return eh.isSleepingLongEnough() || eh.fauxSleeping || (eh.level().purpurConfig.idleTimeoutCountAsSleeping && eh.isAfk()); }).count(); // Purpur - AFK API boolean anyDeepSleep = players.stream().anyMatch(Player::isSleepingLongEnough); return anyDeepSleep && j >= this.sleepersNeeded(percentage); @@ -3459,7 +3469,7 @@ index 823efad652d8ff9e96b99375b102fef6f017716e..caa8a69bde0c212c36dd990a67836ac2 if (!entityplayer.isSpectator()) { ++this.activePlayers; - if (entityplayer.isSleeping() || entityplayer.fauxSleeping) { // CraftBukkit -+ if ((entityplayer.isSleeping() || entityplayer.fauxSleeping) || (entityplayer.level().purpurConfig.idleTimeoutCountAsSleeping && entityplayer.isAfk())) { // CraftBukkit // Purpur ++ if ((entityplayer.isSleeping() || entityplayer.fauxSleeping) || (entityplayer.level().purpurConfig.idleTimeoutCountAsSleeping && entityplayer.isAfk())) { // CraftBukkit // Purpur - AFK API ++this.sleepingPlayers; } // CraftBukkit start @@ -3510,7 +3520,7 @@ index 064c1e33f3feee77837bb57887877ae1ca39548d..ffd009bca3fdbfd0b14df78072ef8d47 } } diff --git a/src/main/java/net/minecraft/world/damagesource/CombatTracker.java b/src/main/java/net/minecraft/world/damagesource/CombatTracker.java -index 99a7e9eb75231c15bd8bb24fbb4e296bc9fdedff..4fb025a63628eb60509d90b680922a0220104bcb 100644 +index 99a7e9eb75231c15bd8bb24fbb4e296bc9fdedff..6853b91e047b92ae4042a26d6aad84874be11709 100644 --- a/src/main/java/net/minecraft/world/damagesource/CombatTracker.java +++ b/src/main/java/net/minecraft/world/damagesource/CombatTracker.java @@ -54,7 +54,7 @@ public class CombatTracker { @@ -3522,38 +3532,40 @@ index 99a7e9eb75231c15bd8bb24fbb4e296bc9fdedff..4fb025a63628eb60509d90b680922a02 ? Component.translatable(itemDeathTranslationKey, this.mob.getDisplayName(), attackerDisplayName, itemStack.getDisplayName()) : Component.translatable(deathTranslationKey, this.mob.getDisplayName(), attackerDisplayName); } -@@ -98,6 +98,13 @@ public class CombatTracker { +@@ -98,6 +98,15 @@ public class CombatTracker { Component component = ComponentUtils.wrapInSquareBrackets(Component.translatable(string + ".link")).withStyle(INTENTIONAL_GAME_DESIGN_STYLE); return Component.translatable(string + ".message", this.mob.getDisplayName(), component); } else { -+ // Purpur start ++ // Purpur start - Dont run with scissors! + if (damageSource.isScissors()) { + return damageSource.getLocalizedDeathMessage(org.purpurmc.purpur.PurpurConfig.deathMsgRunWithScissors, this.mob); ++ // Purpur start - Stonecutter damage + } else if (damageSource.isStonecutter()) { + return damageSource.getLocalizedDeathMessage(org.purpurmc.purpur.PurpurConfig.deathMsgStonecutter, this.mob); ++ // Purpur end - Stonecutter damage + } -+ // Purpur end ++ // Purpur end - Dont run with scissors! return damageSource.getLocalizedDeathMessage(this.mob); } } diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -index bb1a60180e58c1333e7bb33e8acf1b0225eda8a8..4a96d914f8aa6f0c5f13fc85369a311f25835ac2 100644 +index bb1a60180e58c1333e7bb33e8acf1b0225eda8a8..3781bca61379516d537650c79c614933454fdcd8 100644 --- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java +++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java @@ -29,6 +29,8 @@ public class DamageSource { private boolean sweep = false; private boolean melting = false; private boolean poison = false; -+ private boolean scissors = false; // Purpur -+ private boolean stonecutter = false; // Purpur ++ private boolean scissors = false; // Purpur - Dont run with scissors! ++ private boolean stonecutter = false; // Purpur - Stonecutter damage @Nullable private Entity customEventDamager = null; // This field is a helper for when causing entity damage is not set by vanilla // Paper - fix DamageSource API -@@ -59,6 +61,26 @@ public class DamageSource { +@@ -59,6 +61,27 @@ public class DamageSource { return this.poison; } -+ // Purpur start ++ // Purpur start - Dont run with scissors! + public DamageSource scissors() { + this.scissors = true; + return this; @@ -3562,7 +3574,8 @@ index bb1a60180e58c1333e7bb33e8acf1b0225eda8a8..4a96d914f8aa6f0c5f13fc85369a311f + public boolean isScissors() { + return this.scissors; + } -+ ++ // Purpur end - Dont run with scissors! ++ // Purpur start - - Stonecutter damage + public DamageSource stonecutter() { + this.stonecutter = true; + return this; @@ -3571,21 +3584,21 @@ index bb1a60180e58c1333e7bb33e8acf1b0225eda8a8..4a96d914f8aa6f0c5f13fc85369a311f + public boolean isStonecutter() { + return this.stonecutter; + } -+ // Purpur end ++ // Purpur end - Stonecutter damage + // Paper start - fix DamageSource API @Nullable public Entity getCustomEventDamager() { -@@ -117,6 +139,8 @@ public class DamageSource { +@@ -117,6 +140,8 @@ public class DamageSource { damageSource.sweep = this.isSweep(); damageSource.poison = this.isPoison(); damageSource.melting = this.isMelting(); -+ damageSource.scissors = this.isScissors(); // Purpur -+ damageSource.stonecutter = this.isStonecutter(); // Purpur ++ damageSource.scissors = this.isScissors(); // Purpur - Dont run with scissors! ++ damageSource.stonecutter = this.isStonecutter(); // Purpur - Stonecutter damage return damageSource; } // CraftBukkit end -@@ -194,10 +218,19 @@ public class DamageSource { +@@ -194,10 +219,19 @@ public class DamageSource { ItemStack itemstack1 = itemstack; @@ -3594,51 +3607,53 @@ index bb1a60180e58c1333e7bb33e8acf1b0225eda8a8..4a96d914f8aa6f0c5f13fc85369a311f } } -+ // Purpur start ++ // Purpur start - Component related conveniences + public Component getLocalizedDeathMessage(String str, LivingEntity entity) { + net.kyori.adventure.text.Component name = io.papermc.paper.adventure.PaperAdventure.asAdventure(entity.getDisplayName()); + net.kyori.adventure.text.minimessage.tag.resolver.TagResolver template = net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.component("player", name); + net.kyori.adventure.text.Component component = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(str, template); + return io.papermc.paper.adventure.PaperAdventure.asVanilla(component); + } -+ // Purpur end ++ // Purpur end - Component related conveniences + public String getMsgId() { return this.type().msgId(); } diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java -index be87cb3cfa15a7d889118cdc4b87232e30749023..d343fd5c9f31073f1b3a0f91b8ea61a67077cc12 100644 +index be87cb3cfa15a7d889118cdc4b87232e30749023..820533b6a13b1f8abbfe378de6b5d66ce2b79835 100644 --- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java +++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java @@ -46,11 +46,15 @@ public class DamageSources { // CraftBukkit start private final DamageSource melting; private final DamageSource poison; -+ private final DamageSource scissors; // Purpur -+ private final DamageSource stonecutter; // Purpur ++ private final DamageSource scissors; // Purpur - Dont run with scissors! ++ private final DamageSource stonecutter; // Purpur - Stonecutter damage public DamageSources(RegistryAccess registryManager) { this.damageTypes = registryManager.lookupOrThrow(Registries.DAMAGE_TYPE); this.melting = this.source(DamageTypes.ON_FIRE).melting(); this.poison = this.source(DamageTypes.MAGIC).poison(); -+ this.scissors = this.source(DamageTypes.MAGIC).scissors(); // Purpur -+ this.stonecutter = this.source(DamageTypes.MAGIC).stonecutter(); // Purpur ++ this.scissors = this.source(DamageTypes.MAGIC).scissors(); // Purpur - Dont run with scissors! ++ this.stonecutter = this.source(DamageTypes.MAGIC).stonecutter(); // Purpur - Stonecutter damage // CraftBukkit end this.inFire = this.source(DamageTypes.IN_FIRE); this.campfire = this.source(DamageTypes.CAMPFIRE); -@@ -101,6 +105,15 @@ public class DamageSources { +@@ -101,6 +105,17 @@ public class DamageSources { } // CraftBukkit end -+ // Purpur start ++ // Purpur start - Dont run with scissors! + public DamageSource scissors() { + return this.scissors; + } ++ // Purpur end - Dont run with scissors! ++ ++ // Purpur start - Stonecutter damage + public DamageSource stonecutter() { + return this.stonecutter; + } -+ // Purpur end -+ ++ // Purpur end - Stonecutter damage public DamageSource inFire() { return this.inFire; } @@ -3711,7 +3726,7 @@ index 55132e6e064ddd15b26286eca335305ed57b2f9e..1e04947995009689315352b79989e7ce } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e8b701dd2 100644 +index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..305a569f8cd83f3c67a4d4377f2881d36961dacd 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -177,7 +177,7 @@ import org.bukkit.plugin.PluginManager; @@ -3719,7 +3734,7 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker - -+ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur ++ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur - Configurable entity base attributes // CraftBukkit start private static final int CURRENT_LEVEL = 2; public boolean preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported; keep initial motion on first setPositionRotation @@ -3736,7 +3751,7 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e private final double[] pistonDeltas; private long pistonDeltasGameTime; - private EntityDimensions dimensions; -+ protected EntityDimensions dimensions; // Purpur - private -> protected ++ protected EntityDimensions dimensions; // Purpur - private -> protected - Ridables private float eyeHeight; public boolean isInPowderSnow; public boolean wasInPowderSnow; @@ -3755,11 +3770,11 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e } } // Paper end - optimise entity tracker -+ // Purpur start ++ // Purpur start - Add canSaveToDisk to Entity + public boolean canSaveToDisk() { + return true; + } -+ // Purpur end ++ // Purpur end - Add canSaveToDisk to Entity + + // Purpur start - copied from Mob - API for any mob to burn daylight + public boolean isSunBurnTick() { @@ -3792,7 +3807,7 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v) && (!(this instanceof Player player) || !player.getAbilities().invulnerable))) { // Paper end - Configurable nether ceiling damage -+ if (this.level().purpurConfig.teleportOnNetherCeilingDamage && this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this instanceof ServerPlayer player) player.teleport(io.papermc.paper.util.MCUtil.toLocation(this.level, this.level.getSharedSpawnPos())); else // Purpur ++ if (this.level().purpurConfig.teleportOnNetherCeilingDamage && this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this instanceof ServerPlayer player) player.teleport(io.papermc.paper.util.MCUtil.toLocation(this.level, this.level.getSharedSpawnPos())); else // Purpur - Add option to teleport to spawn on nether ceiling damage this.onBelowWorld(); } @@ -3810,7 +3825,7 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e } - void updateInWaterStateAndDoWaterCurrentPushing() { -+ public void updateInWaterStateAndDoWaterCurrentPushing() { // Purpur - package-private -> public ++ public void updateInWaterStateAndDoWaterCurrentPushing() { // Purpur - package-private -> public - Movement options for armor stands Entity entity = this.getVehicle(); if (entity instanceof AbstractBoat abstractboat) { @@ -3842,7 +3857,7 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e if (this.isAlive() && this instanceof Leashable leashable) { if (leashable.getLeashHolder() == player) { if (!this.level().isClientSide()) { -+ if (hand == InteractionHand.OFF_HAND && (level().purpurConfig.villagerCanBeLeashed || level().purpurConfig.wanderingTraderCanBeLeashed) && this instanceof net.minecraft.world.entity.npc.AbstractVillager) return InteractionResult.CONSUME; // Purpur ++ if (hand == InteractionHand.OFF_HAND && (level().purpurConfig.villagerCanBeLeashed || level().purpurConfig.wanderingTraderCanBeLeashed) && this instanceof net.minecraft.world.entity.npc.AbstractVillager) return InteractionResult.CONSUME; // Purpur - Allow leashing villagers // CraftBukkit start - fire PlayerUnleashEntityEvent // Paper start - Expand EntityUnleashEvent org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.hasInfiniteMaterials()); @@ -3850,12 +3865,12 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e this.passengers = ImmutableList.copyOf(list); } -+ // Purpur start ++ // Purpur start - Ridables + if (isRidable() && this.passengers.get(0) == passenger && passenger instanceof Player player) { + onMount(player); + this.rider = player; + } -+ // Purpur end ++ // Purpur end - Ridables + this.gameEvent(GameEvent.ENTITY_MOUNT, passenger); } @@ -3865,12 +3880,12 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e } // CraftBukkit end + -+ // Purpur start ++ // Purpur start - Ridables + if (this.rider != null && this.passengers.get(0) == this.rider) { + onDismount(this.rider); + this.rider = null; + } -+ // Purpur end ++ // Purpur end - Ridables + if (this.passengers.size() == 1 && this.passengers.get(0) == entity) { this.passengers = ImmutableList.of(); @@ -3938,7 +3953,7 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e return ((net.minecraft.server.level.ServerLevel) this.level).isPositionEntityTicking(this.blockPosition()); } // Paper end - Expose entity id counter -+ // Purpur start ++ // Purpur start - Ridables + @Nullable + private Player rider = null; + @@ -3977,22 +3992,22 @@ index 7ac7d0729705cb02f22277be3c467aed4f69ec0e..c59963369bf4add28a966ec24b67cb6e + public boolean processClick(InteractionHand hand) { + return false; + } -+ // Purpur end ++ // Purpur end - Ridables } diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java -index 6bf691fcc6486bde73bae30eff09142802c29eda..59c4d3753c7084e92402608b7fb3c4adbc6c2f65 100644 +index 6bf691fcc6486bde73bae30eff09142802c29eda..d99b223be90f0c04bb9274228ad323a7c7f218b2 100644 --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java @@ -39,6 +39,7 @@ public final class EntitySelector { return net.minecraft.util.Mth.clamp(serverPlayer.getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= playerInsomniaTicks; }; // Paper end - Ability to control player's insomnia and phantoms -+ public static Predicate notAfk = (player) -> !player.isAfk(); // Purpur ++ public static Predicate notAfk = (player) -> !player.isAfk(); // Purpur - AFK API private EntitySelector() {} // Paper start - Affects Spawning API diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index d23914a3ab3723d532ae867db6b954c843030f75..a3ae5e663a0334eaa8ca6ce89c3088620a849bb9 100644 +index d23914a3ab3723d532ae867db6b954c843030f75..d09664949f924b4bd240abcc4a9f96f142310aa9 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -385,10 +385,12 @@ public class EntityType implements FeatureElement, EntityTypeT @@ -4004,8 +4019,8 @@ index d23914a3ab3723d532ae867db6b954c843030f75..a3ae5e663a0334eaa8ca6ce89c308862 private Component description; private final Optional> lootTable; - private final EntityDimensions dimensions; -+ private EntityDimensions dimensions; // Purpur - remove final -+ public void setDimensions(EntityDimensions dimensions) { this.dimensions = dimensions; } // Purpur ++ private EntityDimensions dimensions; // Purpur - remove final - Short enderman height ++ public void setDimensions(EntityDimensions dimensions) { this.dimensions = dimensions; } // Purpur - Short enderman height private final float spawnDimensionsScale; private final FeatureFlagSet requiredFeatures; @@ -4079,14 +4094,14 @@ index 23b47d90fd35659d9eaa661e808a7f89b29614cf..ba4fe614e2a3378f17b544c78c92a271 if (optional.isPresent()) { ItemStack itemstack = ((EnchantedItemInUse) optional.get()).itemStack(); diff --git a/src/main/java/net/minecraft/world/entity/GlowSquid.java b/src/main/java/net/minecraft/world/entity/GlowSquid.java -index 397765b1547ae47b64963b3807b206c50a6650e1..7f75b5485ca047829415cc1ffb0ec28614633707 100644 +index 397765b1547ae47b64963b3807b206c50a6650e1..97a062c48b22c34edb2a5ad8b8c2f5443e6f7556 100644 --- a/src/main/java/net/minecraft/world/entity/GlowSquid.java +++ b/src/main/java/net/minecraft/world/entity/GlowSquid.java -@@ -25,6 +25,39 @@ public class GlowSquid extends Squid { +@@ -25,6 +25,42 @@ public class GlowSquid extends Squid { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.glowSquidRidable; @@ -4097,33 +4112,36 @@ index 397765b1547ae47b64963b3807b206c50a6650e1..7f75b5485ca047829415cc1ffb0ec286 + public boolean isControllable() { + return level().purpurConfig.glowSquidControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.glowSquidMaxHealth); + } -+ -+ @Override -+ public boolean canFly() { -+ return this.level().purpurConfig.glowSquidsCanFly; -+ } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.glowSquidTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.glowSquidAlwaysDropExp; + } ++ // Purpur end - Mobs always drop experience ++ @Override ++ public boolean canFly() { ++ return this.level().purpurConfig.glowSquidsCanFly; ++ } + @Override protected ParticleOptions getInkParticle() { return ParticleTypes.GLOW_SQUID_INK; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b2803c6744b 100644 +index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..e64ff857bf95436033baf38db1e6895f75856f9c 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -246,9 +246,9 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -4152,8 +4170,8 @@ index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b28 this.activeLocationDependentEnchantments = new EnumMap(EquipmentSlot.class); this.appliedScale = 1.0F; - this.attributes = new AttributeMap(DefaultAttributes.getSupplier(type)); -+ this.attributes = new AttributeMap(DefaultAttributes.getSupplier(type), this); // Purpur -+ this.initAttributes(); // Purpur ++ this.attributes = new AttributeMap(DefaultAttributes.getSupplier(type), this); // Purpur - Ridables ++ this.initAttributes(); // Purpur - Configurable entity base attributes 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()); @@ -4161,7 +4179,7 @@ index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b28 this.brain = this.makeBrain(new Dynamic(dynamicopsnbt, (Tag) dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), (Tag) dynamicopsnbt.emptyMap())))); } -+ protected void initAttributes() {}// Purpur ++ protected void initAttributes() {}// Purpur - Configurable entity base attributes + public Brain getBrain() { return this.brain; @@ -4170,7 +4188,7 @@ index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b28 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).add(Attributes.MAX_ABSORPTION).add(Attributes.STEP_HEIGHT).add(Attributes.SCALE).add(Attributes.GRAVITY).add(Attributes.SAFE_FALL_DISTANCE).add(Attributes.FALL_DAMAGE_MULTIPLIER).add(Attributes.JUMP_STRENGTH).add(Attributes.OXYGEN_BONUS).add(Attributes.BURNING_TIME).add(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE).add(Attributes.WATER_MOVEMENT_EFFICIENCY).add(Attributes.MOVEMENT_EFFICIENCY).add(Attributes.ATTACK_KNOCKBACK); } -+ public boolean shouldSendAttribute(Attribute attribute) { return true; } // Purpur ++ public boolean shouldSendAttribute(Attribute attribute) { return true; } // Purpur - Ridables @Override protected void checkFallDamage(double heightDifference, boolean onGround, BlockState state, BlockPos landedPosition) { @@ -4356,7 +4374,7 @@ index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b28 if (this.dead && adversary instanceof WitherBoss) { // Paper - if (worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (worldserver.purpurConfig.witherBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur ++ if (worldserver.purpurConfig.witherBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur - Add mobGriefing bypass to everything affected BlockPos blockposition = this.blockPosition(); BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState(); @@ -4411,10 +4429,10 @@ index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b28 // Paper start - Add EntityMoveEvent - if (((ServerLevel) this.level()).hasEntityMoveEvent && !(this instanceof net.minecraft.world.entity.player.Player)) { - if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { -+ // Purpur start ++ // Purpur start - Ridables + if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { + if (((ServerLevel) this.level()).hasEntityMoveEvent && !(this instanceof net.minecraft.world.entity.player.Player)) { -+ // Purpur end ++ // Purpur end - Ridables 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()); @@ -4422,7 +4440,7 @@ index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b28 this.absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch()); } } -+ // Purpur start ++ // Purpur start - Ridables + if (getRider() != null) { + getRider().resetLastActionTime(); + if (((ServerLevel) level()).hasRidableMoveEvent && this instanceof Mob) { @@ -4436,7 +4454,7 @@ index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b28 + } + } + } -+ // Purpur end ++ // Purpur end - Ridables } // Paper end - Add EntityMoveEvent world = this.level(); @@ -4526,7 +4544,7 @@ index 96b4fbe4a4655777ff10b32e3257e2fac2aba12a..33fbe0f7a356dd847e546feffb468b28 return slot != EquipmentSlot.HEAD && slot != EquipmentSlot.MAINHAND && slot != EquipmentSlot.OFFHAND ? SlotAccess.forEquipmentSlot(entity, slot, (itemstack) -> { return itemstack.isEmpty() || entity.getEquipmentSlotForItem(itemstack) == slot; diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 5a0b51342f4a646101f4588697bcae7d1ca8a010..0d68cd513cfed80fcbe011648cc8779beb782aaa 100644 +index 5a0b51342f4a646101f4588697bcae7d1ca8a010..0be6582e50ccc94036bb6782a5f811c0f9c42f01 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -144,6 +144,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @@ -4543,8 +4561,8 @@ index 5a0b51342f4a646101f4588697bcae7d1ca8a010..0d68cd513cfed80fcbe011648cc8779b this.targetSelector = new GoalSelector(); - this.lookControl = new LookControl(this); - this.moveControl = new MoveControl(this); -+ this.lookControl = new org.purpurmc.purpur.controller.LookControllerWASD(this); // Purpur -+ this.moveControl = new org.purpurmc.purpur.controller.MoveControllerWASD(this); // Purpur ++ this.lookControl = new org.purpurmc.purpur.controller.LookControllerWASD(this); // Purpur - Ridables ++ this.moveControl = new org.purpurmc.purpur.controller.MoveControllerWASD(this); // Purpur - Ridables this.jumpControl = new JumpControl(this); this.bodyRotationControl = this.createBodyControl(); this.navigation = this.createNavigation(world); @@ -4629,7 +4647,7 @@ index 5a0b51342f4a646101f4588697bcae7d1ca8a010..0d68cd513cfed80fcbe011648cc8779b if (world instanceof ServerLevel worldserver) { - if (this.canPickUpLoot() && this.isAlive() && !this.dead && worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (this.canPickUpLoot() && this.isAlive() && !this.dead && (worldserver.purpurConfig.entitiesPickUpLootBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // Purpur ++ if (this.canPickUpLoot() && this.isAlive() && !this.dead && (worldserver.purpurConfig.entitiesPickUpLootBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // Purpur - Add mobGriefing bypass to everything affected 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(); @@ -4668,7 +4686,7 @@ index 5a0b51342f4a646101f4588697bcae7d1ca8a010..0d68cd513cfed80fcbe011648cc8779b protected InteractionResult mobInteract(Player player, InteractionHand hand) { - return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur ++ return tryRide(player, hand); // Purpur - Ridables } public boolean isWithinRestriction() { @@ -4704,7 +4722,7 @@ index 5a0b51342f4a646101f4588697bcae7d1ca8a010..0d68cd513cfed80fcbe011648cc8779b return this.armorDropChances; } + -+ // Purpur start ++ // Purpur start - Ridables + public double getMaxY() { + return level().getHeight(); + } @@ -4756,10 +4774,10 @@ index 5a0b51342f4a646101f4588697bcae7d1ca8a010..0d68cd513cfed80fcbe011648cc8779b + return InteractionResult.PASS; + } + } -+ // Purpur end ++ // Purpur end - Ridables } diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java -index fb967ac7b3e7828301f08a7fe9b039441cf7da30..236485c0c9706d5561f8bc950b20411ae628ca96 100644 +index fb967ac7b3e7828301f08a7fe9b039441cf7da30..98fa43c8a34650795a0ae1ebc28ce17ec1ba5271 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java @@ -23,14 +23,23 @@ public class AttributeMap { @@ -4767,15 +4785,15 @@ index fb967ac7b3e7828301f08a7fe9b039441cf7da30..236485c0c9706d5561f8bc950b20411a private final Set attributesToUpdate = new ObjectOpenHashSet<>(); private final AttributeSupplier supplier; + private final java.util.function.Function, AttributeInstance> createInstance; // Pufferfish -+ private final net.minecraft.world.entity.LivingEntity entity; // Purpur ++ private final net.minecraft.world.entity.LivingEntity entity; // Purpur - Ridables public AttributeMap(AttributeSupplier defaultAttributes) { -+ // Purpur start ++ // Purpur start - Ridables + this(defaultAttributes, null); + } + public AttributeMap(AttributeSupplier defaultAttributes, net.minecraft.world.entity.LivingEntity entity) { + this.entity = entity; -+ // Purpur end ++ // Purpur end - Ridables this.supplier = defaultAttributes; + this.createInstance = attributex -> this.supplier.createInstance(this::onAttributeModified, attributex); // Pufferfish } @@ -4783,7 +4801,7 @@ index fb967ac7b3e7828301f08a7fe9b039441cf7da30..236485c0c9706d5561f8bc950b20411a private void onAttributeModified(AttributeInstance instance) { this.attributesToUpdate.add(instance); - if (instance.getAttribute().value().isClientSyncable()) { -+ if (instance.getAttribute().value().isClientSyncable() && (entity == null || entity.shouldSendAttribute(instance.getAttribute().value()))) { // Purpur ++ if (instance.getAttribute().value().isClientSyncable() && (entity == null || entity.shouldSendAttribute(instance.getAttribute().value()))) { // Purpur - Ridables this.attributesToSync.add(instance); } } @@ -4792,7 +4810,7 @@ index fb967ac7b3e7828301f08a7fe9b039441cf7da30..236485c0c9706d5561f8bc950b20411a public Collection getSyncableAttributes() { - return this.attributes.values().stream().filter(attribute -> attribute.getAttribute().value().isClientSyncable()).collect(Collectors.toList()); -+ return this.attributes.values().stream().filter(attribute -> attribute.getAttribute().value().isClientSyncable() && (entity == null || entity.shouldSendAttribute(attribute.getAttribute().value()))).collect(Collectors.toList()); // Purpur ++ return this.attributes.values().stream().filter(attribute -> attribute.getAttribute().value().isClientSyncable() && (entity == null || entity.shouldSendAttribute(attribute.getAttribute().value()))).collect(Collectors.toList()); // Purpur - Ridables } + @@ -4804,7 +4822,7 @@ index fb967ac7b3e7828301f08a7fe9b039441cf7da30..236485c0c9706d5561f8bc950b20411a public boolean hasAttribute(Holder attribute) { 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 c76438d5ce2330eca16dc0b381f97e9506f84aef..074d2d4e85d3e3ad546fcb15dfd00b757bf549a8 100644 +index c76438d5ce2330eca16dc0b381f97e9506f84aef..8c1ff0b273e25373c6b581613f692265d9569952 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 @@ -131,7 +131,7 @@ public class DefaultAttributes { @@ -4812,7 +4830,7 @@ index c76438d5ce2330eca16dc0b381f97e9506f84aef..074d2d4e85d3e3ad546fcb15dfd00b75 .put(EntityType.PANDA, Panda.createAttributes().build()) .put(EntityType.PARROT, Parrot.createAttributes().build()) - .put(EntityType.PHANTOM, Monster.createMonsterAttributes().build()) -+ .put(EntityType.PHANTOM, net.minecraft.world.entity.monster.Phantom.createAttributes().build()) // Purpur ++ .put(EntityType.PHANTOM, net.minecraft.world.entity.monster.Phantom.createAttributes().build()) // Purpur - Ridables .put(EntityType.PIG, Pig.createAttributes().build()) .put(EntityType.PIGLIN, Piglin.createAttributes().build()) .put(EntityType.PIGLIN_BRUTE, PiglinBrute.createAttributes().build()) @@ -4821,7 +4839,7 @@ index c76438d5ce2330eca16dc0b381f97e9506f84aef..074d2d4e85d3e3ad546fcb15dfd00b75 .put(EntityType.VINDICATOR, Vindicator.createAttributes().build()) .put(EntityType.WARDEN, Warden.createAttributes().build()) - .put(EntityType.WANDERING_TRADER, Mob.createMobAttributes().build()) -+ .put(EntityType.WANDERING_TRADER, net.minecraft.world.entity.npc.WanderingTrader.createAttributes().build()) // Purpur ++ .put(EntityType.WANDERING_TRADER, net.minecraft.world.entity.npc.WanderingTrader.createAttributes().build()) // Purpur - Villagers follow emerald blocks .put(EntityType.WITCH, Witch.createAttributes().build()) .put(EntityType.WITHER, WitherBoss.createAttributes().build()) .put(EntityType.WITHER_SKELETON, AbstractSkeleton.createAttributes().build()) @@ -4851,7 +4869,7 @@ index 0d177e828c2b338ce93c58aaef04df326e1eb0b2..273ba657926ce72a7c82861e880a82bf for (final Pair, BlockPos> poiPose : poiposes) { if (worldPosBiPredicate.test(world, poiPose.getSecond())) { diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java -index 2ade08d1466660ee1787fa97908002ef56389712..018cc6ff39641157668fca09e64bcddf7d4d3a5c 100644 +index 2ade08d1466660ee1787fa97908002ef56389712..88b7de6c0ab5bf6ba2af7b4cee0393879c2a4fdc 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java @@ -41,17 +41,19 @@ public class HarvestFarmland extends Behavior { @@ -4866,7 +4884,7 @@ index 2ade08d1466660ee1787fa97908002ef56389712..018cc6ff39641157668fca09e64bcddf protected boolean checkExtraStartConditions(ServerLevel world, Villager entity) { - if (!world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (!world.purpurConfig.villagerBypassMobGriefing == !world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur ++ if (!world.purpurConfig.villagerBypassMobGriefing == !world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur - Add mobGriefing bypass to everything affected return false; - } else if (entity.getVillagerData().getProfession() != VillagerProfession.FARMER) { + } else if (entity.getVillagerData().getProfession() != VillagerProfession.FARMER && !(world.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().getProfession() == VillagerProfession.CLERIC)) { // Purpur @@ -4918,7 +4936,7 @@ index 2ade08d1466660ee1787fa97908002ef56389712..018cc6ff39641157668fca09e64bcddf if (itemstack.isEmpty()) { inventorysubcontainer.setItem(j, ItemStack.EMPTY); diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java b/src/main/java/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java -index 3513b15f6622bfc134ecfcd9129f81a8acc2c601..6e70579a58a1bf906b176b81713e55318199cef6 100644 +index 3513b15f6622bfc134ecfcd9129f81a8acc2c601..2768e2a61ab7fbd82c2b8787e715163a7b0450b9 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java @@ -57,7 +57,7 @@ public class InteractWithDoor { @@ -4926,7 +4944,7 @@ index 3513b15f6622bfc134ecfcd9129f81a8acc2c601..6e70579a58a1bf906b176b81713e5531 if (iblockdata.is(BlockTags.MOB_INTERACTABLE_DOORS, (blockbase_blockdata) -> { return blockbase_blockdata.getBlock() instanceof DoorBlock; - })) { -+ }) && !DoorBlock.requiresRedstone(entityliving.level(), iblockdata, blockposition)) { // Purpur ++ }) && !DoorBlock.requiresRedstone(entityliving.level(), iblockdata, blockposition)) { // Purpur - Option to make doors require redstone DoorBlock blockdoor = (DoorBlock) iblockdata.getBlock(); if (!blockdoor.isOpen(iblockdata)) { @@ -4935,7 +4953,7 @@ index 3513b15f6622bfc134ecfcd9129f81a8acc2c601..6e70579a58a1bf906b176b81713e5531 if (iblockdata1.is(BlockTags.MOB_INTERACTABLE_DOORS, (blockbase_blockdata) -> { return blockbase_blockdata.getBlock() instanceof DoorBlock; - })) { -+ }) && !DoorBlock.requiresRedstone(entityliving.level(), iblockdata, blockposition1)) { // Purpur ++ }) && !DoorBlock.requiresRedstone(entityliving.level(), iblockdata, blockposition1)) { // Purpur - Option to make doors require redstone DoorBlock blockdoor1 = (DoorBlock) iblockdata1.getBlock(); if (!blockdoor1.isOpen(iblockdata1)) { @@ -4944,7 +4962,7 @@ index 3513b15f6622bfc134ecfcd9129f81a8acc2c601..6e70579a58a1bf906b176b81713e5531 if (!iblockdata.is(BlockTags.MOB_INTERACTABLE_DOORS, (blockbase_blockdata) -> { return blockbase_blockdata.getBlock() instanceof DoorBlock; - })) { -+ }) || DoorBlock.requiresRedstone(entity.level(), iblockdata, blockposition)) { // Purpur ++ }) || DoorBlock.requiresRedstone(entity.level(), iblockdata, blockposition)) { // Purpur - Option to make doors require redstone iterator.remove(); } else { DoorBlock blockdoor = (DoorBlock) iblockdata.getBlock(); @@ -5031,14 +5049,14 @@ index 758f62416ca9c02351348ac0d41deeb4624abc0e..69130969c9a434ec2361e573c9a1ec9f } } 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 c8fd5696de7c3623cdb4f498190a5c2708cf843e..e403d9dfeeaa3dcf53be790d761e7e922419efb0 100644 +index c8fd5696de7c3623cdb4f498190a5c2708cf843e..2a6e5a9b35102ef540b561ec7ef5a5f119c564fe 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 { this.mob = entity; } -+ // Purpur start ++ // Purpur start - Ridables + public void setSpeedModifier(double speed) { + this.speedModifier = speed; + } @@ -5050,13 +5068,13 @@ index c8fd5696de7c3623cdb4f498190a5c2708cf843e..e403d9dfeeaa3dcf53be790d761e7e92 + public void setStrafe(float strafe) { + this.strafeRight = strafe; + } -+ // Purpur end ++ // Purpur end - Ridables + public boolean hasWanted() { return this.operation == MoveControl.Operation.MOVE_TO; } diff --git a/src/main/java/net/minecraft/world/entity/ai/control/SmoothSwimmingLookControl.java b/src/main/java/net/minecraft/world/entity/ai/control/SmoothSwimmingLookControl.java -index fbfc2f2515ad709b2c1212aef9521e795547d66b..e77bd11af62682d5eca41f6c9e1aed30eb6879ce 100644 +index fbfc2f2515ad709b2c1212aef9521e795547d66b..ebe941aeb959fc34372bfc59bc3a13421167b4cf 100644 --- a/src/main/java/net/minecraft/world/entity/ai/control/SmoothSwimmingLookControl.java +++ b/src/main/java/net/minecraft/world/entity/ai/control/SmoothSwimmingLookControl.java @@ -3,7 +3,7 @@ package net.minecraft.world.entity.ai.control; @@ -5064,7 +5082,7 @@ index fbfc2f2515ad709b2c1212aef9521e795547d66b..e77bd11af62682d5eca41f6c9e1aed30 import net.minecraft.world.entity.Mob; -public class SmoothSwimmingLookControl extends LookControl { -+public class SmoothSwimmingLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur ++public class SmoothSwimmingLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables private final int maxYRotFromCenter; private static final int HEAD_TILT_X = 10; private static final int HEAD_TILT_Y = 20; @@ -5073,12 +5091,12 @@ index fbfc2f2515ad709b2c1212aef9521e795547d66b..e77bd11af62682d5eca41f6c9e1aed30 @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (this.lookAtCooldown > 0) { this.lookAtCooldown--; this.getYRotD().ifPresent(yaw -> this.mob.yHeadRot = this.rotateTowards(this.mob.yHeadRot, yaw + 20.0F, this.yMaxRotSpeed)); diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java -index 7324da6b7dd2623ce394e3827ff77ef684a3b98b..d0ba8f74cd0d676640776c46df1913852f4a4a2e 100644 +index 7324da6b7dd2623ce394e3827ff77ef684a3b98b..a96f49641898aa16bdc99eed8a86497ddcd5a492 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java @@ -33,7 +33,7 @@ public class BreakDoorGoal extends DoorInteractGoal { @@ -5086,12 +5104,12 @@ index 7324da6b7dd2623ce394e3827ff77ef684a3b98b..d0ba8f74cd0d676640776c46df191385 @Override public boolean canUse() { - return !super.canUse() ? false : (!getServerLevel((Entity) this.mob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.isValidDifficulty(this.mob.level().getDifficulty()) && !this.isOpen()); -+ return !super.canUse() ? false : (!this.mob.level().purpurConfig.zombieBypassMobGriefing == !getServerLevel((Entity) this.mob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.isValidDifficulty(this.mob.level().getDifficulty()) && !this.isOpen()); // Purpur ++ return !super.canUse() ? false : (!this.mob.level().purpurConfig.zombieBypassMobGriefing == !getServerLevel((Entity) this.mob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.isValidDifficulty(this.mob.level().getDifficulty()) && !this.isOpen()); // Purpur - Add mobGriefing bypass to everything affected } @Override diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java -index 32bb591371fe78ba10a2bc52389ef33978cbc0eb..13f5e5c199688954c263b9e3397e02c9f77bbb92 100644 +index 32bb591371fe78ba10a2bc52389ef33978cbc0eb..6032eb2209d013b34c28eedd180583af3680fc69 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java @@ -74,7 +74,7 @@ public class EatBlockGoal extends Goal { @@ -5099,7 +5117,7 @@ index 32bb591371fe78ba10a2bc52389ef33978cbc0eb..13f5e5c199688954c263b9e3397e02c9 final BlockState blockState = this.level.getBlockState(blockposition); // Paper - fix wrong block state if (EatBlockGoal.IS_TALL_GRASS.test(blockState)) { // Paper - fix wrong block state - if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, blockState.getFluidState().createLegacyBlock(), !getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit // Paper - fix wrong block state -+ if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, blockState.getFluidState().createLegacyBlock(), !getServerLevel(this.level).purpurConfig.sheepBypassMobGriefing == !getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit // Paper - fix wrong block state // Purpur ++ if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition, blockState.getFluidState().createLegacyBlock(), !getServerLevel(this.level).purpurConfig.sheepBypassMobGriefing == !getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit // Paper - fix wrong block state // Purpur - Add mobGriefing bypass to everything affected this.level.destroyBlock(blockposition, false); } @@ -5108,7 +5126,7 @@ index 32bb591371fe78ba10a2bc52389ef33978cbc0eb..13f5e5c199688954c263b9e3397e02c9 if (this.level.getBlockState(blockposition1).is(Blocks.GRASS_BLOCK)) { - if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition1, Blocks.DIRT.defaultBlockState(), !getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit // Paper - Fix wrong block state -+ if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition1, Blocks.DIRT.defaultBlockState(), !getServerLevel(this.level).purpurConfig.sheepBypassMobGriefing == !getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit // Paper - Fix wrong block state // Purpur ++ if (CraftEventFactory.callEntityChangeBlockEvent(this.mob, blockposition1, Blocks.DIRT.defaultBlockState(), !getServerLevel(this.level).purpurConfig.sheepBypassMobGriefing == !getServerLevel(this.level).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit // Paper - Fix wrong block state // Purpur - Add mobGriefing bypass to everything affected this.level.levelEvent(2001, blockposition1, Block.getId(Blocks.GRASS_BLOCK.defaultBlockState())); this.level.setBlock(blockposition1, Blocks.DIRT.defaultBlockState(), 2); } @@ -5180,7 +5198,7 @@ index 515c1f671cb2c3a7cc23053aedf404bbbe77af3e..42a1e5b9c08a9245dd0ce6d4025e3bb5 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 9d245d08be61d7edee9138196ae3bf52023e3993..771bb96032149a8573d1de14fa2ab19012c82000 100644 +index 9d245d08be61d7edee9138196ae3bf52023e3993..07e3e727e339765284095aa8fd6b5edd41dc4158 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 @@ -41,7 +41,7 @@ public class RemoveBlockGoal extends MoveToBlockGoal { @@ -5188,7 +5206,7 @@ index 9d245d08be61d7edee9138196ae3bf52023e3993..771bb96032149a8573d1de14fa2ab190 @Override public boolean canUse() { - if (!getServerLevel((Entity) this.removerMob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (!getServerLevel(this.removerMob).purpurConfig.zombieBypassMobGriefing == !getServerLevel((Entity) this.removerMob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur ++ if (!getServerLevel(this.removerMob).purpurConfig.zombieBypassMobGriefing == !getServerLevel((Entity) this.removerMob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur - Add mobGriefing bypass to everything affected return false; } else if (this.nextStartTick > 0) { --this.nextStartTick; @@ -5225,7 +5243,7 @@ index 137ec75ee803789deb7b1ca93dd9369c9af362b9..ca95d25af3e9a0536868b0c7fd8e7d2f } } diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java -index 84ab90dd1fe693da71732533ccff940c1007e1b6..179fdf7b7f68db610925a9d7b88879289b1b98b8 100644 +index 84ab90dd1fe693da71732533ccff940c1007e1b6..798d1a169ebebfbdc5e0cf71e7a1256cefcbd32b 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java @@ -67,7 +67,7 @@ public class TemptGoal extends Goal { @@ -5233,7 +5251,7 @@ index 84ab90dd1fe693da71732533ccff940c1007e1b6..179fdf7b7f68db610925a9d7b8887928 private boolean shouldFollow(LivingEntity entity) { - return this.items.test(entity.getMainHandItem()) || this.items.test(entity.getOffhandItem()); -+ return (this.items.test(entity.getMainHandItem()) || this.items.test(entity.getOffhandItem())) && (!(this.mob instanceof net.minecraft.world.entity.npc.Villager villager) || !villager.isSleeping()); // Purpur Fix #512 ++ return (this.items.test(entity.getMainHandItem()) || this.items.test(entity.getOffhandItem())) && (!(this.mob instanceof net.minecraft.world.entity.npc.Villager villager) || !villager.isSleeping()); // Purpur - Villagers follow emerald blocks } @Override @@ -5278,36 +5296,36 @@ index a0e0692d17760f440fe81d52887284c787e562db..ab9bebc07b5228dbc0d3ba4b0f7d1bbe brain.setMemory(MemoryModuleType.SECONDARY_JOB_SITE, list); } else { diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java -index 52982c1e6a4da36392569c791853279f5f9ac31a..b3d4c61b1769b6fcc98b7af854f774d24bf39d98 100644 +index 52982c1e6a4da36392569c791853279f5f9ac31a..ebb827e213a3ba5eeb2fe5b78f5dee99403097b6 100644 --- a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java +++ b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java @@ -64,6 +64,10 @@ public class TargetingConditions { return false; } else if (this.selector != null && !this.selector.test(target, world)) { return false; -+ // Purpur start ++ // Purpur start - AFK API + } else if (!world.purpurConfig.idleTimeoutTargetPlayer && target instanceof net.minecraft.server.level.ServerPlayer player && player.isAfk()) { + return false; -+ // Purpur end ++ // Purpur end - AFK API } else { if (tester == null) { if (this.isCombat && (!target.canBeSeenAsEnemy() || world.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 60c2868f255d372226e0c1389caaa5477bbef41e..c8ffbbccbf20ce911a3d75fa860d5a1452c5e590 100644 +index 60c2868f255d372226e0c1389caaa5477bbef41e..d1eb633416ff5090253e77583ec97aff3171c484 100644 --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -@@ -47,12 +47,59 @@ public class Bat extends AmbientCreature { +@@ -47,12 +47,85 @@ public class Bat extends AmbientCreature { public Bat(EntityType type, Level world) { super(type, world); -+ this.moveControl = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.075F); // Purpur ++ this.moveControl = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.075F); // Purpur - Ridables if (!world.isClientSide) { this.setResting(true); } } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean shouldSendAttribute(net.minecraft.world.entity.ai.attributes.Attribute attribute) { return attribute != Attributes.FLYING_SPEED.value(); } // Fixes log spam on clients + @@ -5351,66 +5369,62 @@ index 60c2868f255d372226e0c1389caaa5477bbef41e..c8ffbbccbf20ce911a3d75fa860d5a14 + setDeltaMovement(mot.scale(0.9D)); + } + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes ++ @Override ++ public void initAttributes() { ++ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.batMaxHealth); ++ this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.batScale); ++ this.getAttribute(Attributes.FOLLOW_RANGE).setBaseValue(this.level().purpurConfig.batFollowRange); ++ this.getAttribute(Attributes.KNOCKBACK_RESISTANCE).setBaseValue(this.level().purpurConfig.batKnockbackResistance); ++ this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.level().purpurConfig.batMovementSpeed); ++ this.getAttribute(Attributes.FLYING_SPEED).setBaseValue(this.level().purpurConfig.batFlyingSpeed); ++ this.getAttribute(Attributes.ARMOR).setBaseValue(this.level().purpurConfig.batArmor); ++ this.getAttribute(Attributes.ARMOR_TOUGHNESS).setBaseValue(this.level().purpurConfig.batArmorToughness); ++ this.getAttribute(Attributes.ATTACK_KNOCKBACK).setBaseValue(this.level().purpurConfig.batAttackKnockback); ++ } ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage ++ @Override ++ public boolean isSensitiveToWater() { ++ return this.level().purpurConfig.batTakeDamageFromWater; ++ } ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience ++ @Override ++ protected boolean isAlwaysExperienceDropper() { ++ return this.level().purpurConfig.batAlwaysDropExp; ++ } ++ // Purpur end - Mobs always drop experience @Override public boolean isFlapping() { return !this.isResting() && (float) this.tickCount % 10.0F == 0.0F; -@@ -102,7 +149,7 @@ public class Bat extends AmbientCreature { +@@ -102,7 +175,7 @@ public class Bat extends AmbientCreature { protected void pushEntities() {} public static AttributeSupplier.Builder createAttributes() { - return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 6.0D); -+ return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 6.0D).add(Attributes.FLYING_SPEED, 0.6D); // Purpur ++ return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 6.0D).add(Attributes.FLYING_SPEED, 0.6D); // Purpur - Ridables } public boolean isResting() { -@@ -135,6 +182,14 @@ public class Bat extends AmbientCreature { +@@ -135,6 +208,14 @@ public class Bat extends AmbientCreature { @Override protected void customServerAiStep(ServerLevel world) { -+ // Purpur start ++ // Purpur start - Ridables + if (getRider() != null && this.isControllable()) { + Vec3 mot = getDeltaMovement(); + setDeltaMovement(mot.x(), mot.y() + (getVerticalMot() > 0 ? 0.07D : 0.0D), mot.z()); + return; + } -+ // Purpur end ++ // Purpur end - Ridables + super.customServerAiStep(world); BlockPos blockposition = this.blockPosition(); BlockPos blockposition1 = blockposition.above(); -@@ -213,6 +268,29 @@ public class Bat extends AmbientCreature { - } - } - -+ @Override -+ public void initAttributes() { -+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.batMaxHealth); -+ this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.batScale); -+ this.getAttribute(Attributes.FOLLOW_RANGE).setBaseValue(this.level().purpurConfig.batFollowRange); -+ this.getAttribute(Attributes.KNOCKBACK_RESISTANCE).setBaseValue(this.level().purpurConfig.batKnockbackResistance); -+ this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.level().purpurConfig.batMovementSpeed); -+ this.getAttribute(Attributes.FLYING_SPEED).setBaseValue(this.level().purpurConfig.batFlyingSpeed); -+ this.getAttribute(Attributes.ARMOR).setBaseValue(this.level().purpurConfig.batArmor); -+ this.getAttribute(Attributes.ARMOR_TOUGHNESS).setBaseValue(this.level().purpurConfig.batArmorToughness); -+ this.getAttribute(Attributes.ATTACK_KNOCKBACK).setBaseValue(this.level().purpurConfig.batAttackKnockback); -+ } -+ -+ @Override -+ public boolean isSensitiveToWater() { -+ return this.level().purpurConfig.batTakeDamageFromWater; -+ } -+ -+ @Override -+ protected boolean isAlwaysExperienceDropper() { -+ return this.level().purpurConfig.batAlwaysDropExp; -+ } -+ - @Override - public void readAdditionalSaveData(CompoundTag nbt) { - super.readAdditionalSaveData(nbt); -@@ -232,7 +310,7 @@ public class Bat extends AmbientCreature { +@@ -232,7 +313,7 @@ public class Bat extends AmbientCreature { int i = world.getMaxLocalRawBrightness(pos); byte b0 = 4; @@ -5419,7 +5433,7 @@ index 60c2868f255d372226e0c1389caaa5477bbef41e..c8ffbbccbf20ce911a3d75fa860d5a14 b0 = 7; } else if (random.nextBoolean()) { return false; -@@ -242,13 +320,23 @@ public class Bat extends AmbientCreature { +@@ -242,13 +323,23 @@ public class Bat extends AmbientCreature { } } @@ -5445,14 +5459,14 @@ index 60c2868f255d372226e0c1389caaa5477bbef41e..c8ffbbccbf20ce911a3d75fa860d5a14 private void setupAnimationStates() { if (this.isResting()) { diff --git a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java -index 9aedc62b1766f6a7db4da7eba55167d21d698791..9708ed3e00059fdf5d1d60e0c607d0ab153d1d3f 100644 +index 9aedc62b1766f6a7db4da7eba55167d21d698791..d1fa6b6a18bd7a44e398eed17f2ff127b09f222a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java +++ b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java @@ -87,6 +87,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable { @Override protected void registerGoals() { super.registerGoals(); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(0, new PanicGoal(this, 1.25)); this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, Player.class, 8.0F, 1.6, 1.4, EntitySelector.NO_SPECTATORS::test)); this.goalSelector.addGoal(4, new AbstractFish.FishSwimGoal(this)); @@ -5461,7 +5475,7 @@ index 9aedc62b1766f6a7db4da7eba55167d21d698791..9708ed3e00059fdf5d1d60e0c607d0ab public void travel(Vec3 movementInput) { if (this.isControlledByLocalInstance() && this.isInWater()) { - this.moveRelative(0.01F, movementInput); -+ this.moveRelative(getRider() != null ? getSpeed() : 0.01F, movementInput); // Purpur ++ this.moveRelative(getRider() != null ? getSpeed() : 0.01F, movementInput); // Purpur - Ridables this.move(MoverType.SELF, this.getDeltaMovement()); this.setDeltaMovement(this.getDeltaMovement().scale(0.9)); if (this.getTarget() == null) { @@ -5470,7 +5484,7 @@ index 9aedc62b1766f6a7db4da7eba55167d21d698791..9708ed3e00059fdf5d1d60e0c607d0ab } - static class FishMoveControl extends MoveControl { -+ static class FishMoveControl extends org.purpurmc.purpur.controller.WaterMoveControllerWASD { // Purpur ++ static class FishMoveControl extends org.purpurmc.purpur.controller.WaterMoveControllerWASD { // Purpur - Ridables private final AbstractFish fish; FishMoveControl(AbstractFish owner) { @@ -5478,36 +5492,36 @@ index 9aedc62b1766f6a7db4da7eba55167d21d698791..9708ed3e00059fdf5d1d60e0c607d0ab this.fish = owner; } -+ // Purpur start ++ // Purpur start - Ridables @Override - public void tick() { + public void purpurTick(Player rider) { + super.purpurTick(rider); + fish.setDeltaMovement(fish.getDeltaMovement().add(0.0D, 0.005D, 0.0D)); + } -+ // Purpur end ++ // Purpur end - Ridables + + @Override -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (this.fish.isEyeInFluid(FluidTags.WATER)) { this.fish.setDeltaMovement(this.fish.getDeltaMovement().add(0.0, 0.005, 0.0)); } if (this.operation == MoveControl.Operation.MOVE_TO && !this.fish.getNavigation().isDone()) { - float f = (float)(this.speedModifier * this.fish.getAttributeValue(Attributes.MOVEMENT_SPEED)); -+ float f = (float)(this.getSpeedModifier() * this.fish.getAttributeValue(Attributes.MOVEMENT_SPEED)); // Purpur ++ float f = (float)(this.getSpeedModifier() * this.fish.getAttributeValue(Attributes.MOVEMENT_SPEED)); // Purpur - Ridables this.fish.setSpeed(Mth.lerp(0.125F, this.fish.getSpeed(), f)); double d = this.wantedX - this.fish.getX(); double e = this.wantedY - this.fish.getY(); diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java -index 5677dc97ed83652f261100cf391883cfac7d16fe..9987d28ea145f6d0126cb4ea22001e0922fb51bd 100644 +index 5677dc97ed83652f261100cf391883cfac7d16fe..8df1682dca61b0f771a1c08f5bcd797506badf19 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Animal.java +++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java @@ -49,6 +49,7 @@ public abstract class Animal extends AgeableMob { @Nullable public UUID loveCause; public ItemStack breedItem; // CraftBukkit - Add breedItem variable -+ public abstract int getPurpurBreedTime(); // Purpur ++ public abstract int getPurpurBreedTime(); // Purpur - Make entity breeding times configurable protected Animal(EntityType type, Level world) { super(type, world); @@ -5550,22 +5564,22 @@ index 5677dc97ed83652f261100cf391883cfac7d16fe..9987d28ea145f6d0126cb4ea22001e09 } // Paper - this.setAge(6000); - entityanimal.setAge(6000); -+ // Purpur start ++ // Purpur start - Make entity breeding times configurable + this.setAge(this.getPurpurBreedTime()); + entityanimal.setAge(entityanimal.getPurpurBreedTime()); -+ // Purpur end ++ // Purpur end - Make entity breeding times configurable this.resetLove(); entityanimal.resetLove(); worldserver.broadcastEntityEvent(this, (byte) 18); 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 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b0386a44a 100644 +index 0bafe14342c1acce131ad34717c18aed3718deed..d2ac2c3a2481ee216a491333b173625da3881737 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java @@ -154,6 +154,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { public Bee(EntityType type, Level world) { super(type, world); this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(this.random, 20, 60); -+ final org.purpurmc.purpur.controller.FlyingMoveControllerWASD flyingController = new org.purpurmc.purpur.controller.FlyingMoveControllerWASD(this, 0.25F, 1.0F, false); // Purpur ++ final org.purpurmc.purpur.controller.FlyingMoveControllerWASD flyingController = new org.purpurmc.purpur.controller.FlyingMoveControllerWASD(this, 0.25F, 1.0F, false); // Purpur - Ridables // Paper start - Fix MC-167279 class BeeFlyingMoveControl extends FlyingMoveControl { public BeeFlyingMoveControl(final Mob entity, final int maxPitchChange, final boolean noGravity) { @@ -5573,37 +5587,37 @@ index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b @Override public void tick() { -+ // Purpur start ++ // Purpur start - Ridables + if (mob.getRider() != null && mob.isControllable()) { + flyingController.purpurTick(mob.getRider()); + return; + } -+ // Purpur end ++ // Purpur end - Ridables if (this.mob.getY() <= Bee.this.level().getMinY()) { this.mob.setNoGravity(false); } super.tick(); } + -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean hasWanted() { + return mob.getRider() != null || !mob.isControllable() || super.hasWanted(); + } -+ // Purpur end ++ // Purpur end - Ridables } this.moveControl = new BeeFlyingMoveControl(this, 20, true); // Paper end - Fix MC-167279 this.lookControl = new Bee.BeeLookControl(this); this.setPathfindingMalus(PathType.DANGER_FIRE, -1.0F); - this.setPathfindingMalus(PathType.WATER, -1.0F); -+ if (isSensitiveToWater()) this.setPathfindingMalus(PathType.WATER, -1.0F); // Purpur ++ if (isSensitiveToWater()) this.setPathfindingMalus(PathType.WATER, -1.0F); // Purpur - Toggle for water sensitive mob damage this.setPathfindingMalus(PathType.WATER_BORDER, 16.0F); this.setPathfindingMalus(PathType.COCOA, -1.0F); this.setPathfindingMalus(PathType.FENCE, -1.0F); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.beeRidable; @@ -5635,7 +5649,7 @@ index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b + setDeltaMovement(mot.scale(0.9D)); + } + } -+ // Purpur end ++ // Purpur end - Ridables + @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { @@ -5644,7 +5658,7 @@ index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b @Override protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(0, new Bee.BeeAttackGoal(this, 1.399999976158142D, true)); this.goalSelector.addGoal(1, new Bee.BeeEnterHiveGoal()); this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D)); @@ -5652,7 +5666,7 @@ index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b this.goalSelector.addGoal(7, new Bee.BeeGrowCropGoal()); this.goalSelector.addGoal(8, new Bee.BeeWanderGoal()); this.goalSelector.addGoal(9, new FloatGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, (new Bee.BeeHurtByOtherGoal(this)).setAlertOthers(new Class[0])); this.targetSelector.addGoal(2, new Bee.BeeBecomeAngryTargetGoal(this)); this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true)); @@ -5673,40 +5687,43 @@ index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b if (flag) { ++this.timeSinceSting; if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) { -@@ -439,6 +490,27 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -439,6 +490,30 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { return tileentitybeehive != null && tileentitybeehive.isFireNearby(); } ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.beeMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.beeScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.beeBreedingTicks; + } -+ -+ @Override -+ public boolean isSensitiveToWater() { -+ return this.level().purpurConfig.beeTakeDamageFromWater; -+ } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.beeAlwaysDropExp; + } ++ // Purpur end - Mobs always drop experience ++ @Override ++ public boolean isSensitiveToWater() { ++ return this.level().purpurConfig.beeTakeDamageFromWater; ++ } + @Override public int getRemainingPersistentAngerTime() { return (Integer) this.entityData.get(Bee.DATA_REMAINING_ANGER_TIME); -@@ -738,16 +810,16 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -738,16 +813,16 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { return state.is(BlockTags.BEE_ATTRACTIVE) ? ((Boolean) state.getValueOrElse(BlockStateProperties.WATERLOGGED, false) ? false : (state.is(Blocks.SUNFLOWER) ? state.getValue(DoublePlantBlock.HALF) == DoubleBlockHalf.UPPER : true)) : false; } - private class BeeLookControl extends LookControl { -+ private class BeeLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur ++ private class BeeLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables BeeLookControl(final Mob entity) { super(entity); @@ -5714,14 +5731,14 @@ index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (!Bee.this.isAngry()) { - super.tick(); -+ super.vanillaTick(); // Purpur ++ super.vanillaTick(); // Purpur - Ridables } } -@@ -916,6 +988,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -916,6 +991,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); @@ -5729,7 +5746,7 @@ index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b return true; } else { Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60); -@@ -959,6 +1032,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -959,6 +1035,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.pollinating = false; Bee.this.navigation.stop(); Bee.this.remainingCooldownBeforeLocatingNewFlower = 200; @@ -5737,7 +5754,7 @@ index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b } @Override -@@ -1008,6 +1082,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -1008,6 +1085,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.setWantedPos(); } @@ -5746,14 +5763,14 @@ index 0bafe14342c1acce131ad34717c18aed3718deed..bfe3c1d587f129013de108b8fb31293b if (Bee.this.random.nextFloat() < 0.05F && this.successfulPollinatingTicks > this.lastSoundPlayedTick + 60) { this.lastSoundPlayedTick = this.successfulPollinatingTicks; 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 989b7be74eaeba7f40eac87c7ee7f252cb0c05c9..a418ded306908ee9cb9e375104354a6e031305c9 100644 +index 989b7be74eaeba7f40eac87c7ee7f252cb0c05c9..5a3348ca39b86cfea941fdfb98ca90a7a0ef908d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -100,12 +100,59 @@ public class Cat extends TamableAnimal implements VariantHolder { return itemstack.is(ItemTags.CAT_FOOD); }, 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 org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new TamableAnimal.TamableAnimalPanicGoal(1.5D)); this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this)); this.goalSelector.addGoal(3, new Cat.CatRelaxOnOwnerGoal(this)); -@@ -118,6 +165,7 @@ public class Cat extends TamableAnimal implements VariantHolder(this, Rabbit.class, false, (TargetingConditions.Selector) null)); this.targetSelector.addGoal(1, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR)); } -@@ -317,6 +365,14 @@ public class Cat extends TamableAnimal implements VariantHolder { return itemstack.is(ItemTags.CHICKEN_FOOD); -@@ -65,6 +107,14 @@ public class Chicken extends Animal { +@@ -65,6 +113,14 @@ public class Chicken extends Animal { this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F)); this.goalSelector.addGoal(7, new RandomLookAroundGoal(this)); -+ // Purpur start ++ // Purpur start - Chickens can retaliate + if (level().purpurConfig.chickenRetaliate) { + this.goalSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.MeleeAttackGoal(this, 1.0D, false)); + this.targetSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal(this)); + } else { + this.goalSelector.addGoal(1, new PanicGoal(this, 1.4D)); + } -+ // Purpur end ++ // Purpur end - Chickens can retaliate } @Override -@@ -73,7 +123,7 @@ public class Chicken extends Animal { +@@ -73,7 +129,7 @@ public class Chicken extends Animal { } public static AttributeSupplier.Builder createAttributes() { - return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 4.0D).add(Attributes.MOVEMENT_SPEED, 0.25D); -+ return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 4.0D).add(Attributes.MOVEMENT_SPEED, 0.25D).add(Attributes.ATTACK_DAMAGE, 0.0D); // Purpur ++ return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 4.0D).add(Attributes.MOVEMENT_SPEED, 0.25D).add(Attributes.ATTACK_DAMAGE, 0.0D); // Purpur - Chickens can retaliate } @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..f0b6118a9995bb41836685bbf94d2e7fb15761eb 100644 +index 824e5e4fe7619ae46061c3c978c9a044db8c84ab..a2d946aa9784e49e628fe6ebbdcbf9ce4423520f 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,33 @@ public class Cod extends AbstractSchoolingFish { +@@ -13,6 +13,36 @@ public class Cod extends AbstractSchoolingFish { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.codRidable; @@ -5949,28 +5976,31 @@ index 824e5e4fe7619ae46061c3c978c9a044db8c84ab..f0b6118a9995bb41836685bbf94d2e7f + public boolean isControllable() { + return level().purpurConfig.codControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.codMaxHealth); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.codTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.codAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override 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 3e00bbff266fc71b07014e7e047d77b7f809239f..51b4314cdba44146871aa8646ab6fa41051b5265 100644 +index 3e00bbff266fc71b07014e7e047d77b7f809239f..845206570193682f5aca5abbb6915a64fa7f5044 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cow.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cow.java @@ -37,6 +37,7 @@ import org.bukkit.event.player.PlayerBucketFillEvent; @@ -5981,11 +6011,11 @@ index 3e00bbff266fc71b07014e7e047d77b7f809239f..51b4314cdba44146871aa8646ab6fa41 private static final EntityDimensions BABY_DIMENSIONS = EntityType.COW.getDimensions().scale(0.5F).withEyeHeight(0.665F); -@@ -44,18 +45,66 @@ public class Cow extends Animal { +@@ -44,18 +45,70 @@ public class Cow extends Animal { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.cowRidable; @@ -6000,46 +6030,50 @@ index 3e00bbff266fc71b07014e7e047d77b7f809239f..51b4314cdba44146871aa8646ab6fa41 + public boolean isControllable() { + return level().purpurConfig.cowControllable; + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.cowMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.cowScale); + this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(this.level().purpurConfig.cowNaturallyAggressiveToPlayersDamage); // Purpur + } -+ // Purpur end -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.cowBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.cowTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience ++ @Override ++ protected boolean isAlwaysExperienceDropper() { ++ return this.level().purpurConfig.cowAlwaysDropExp; ++ } ++ // Purpur end - Mobs always drop experience + @Override + public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.EntitySpawnReason spawnReason, net.minecraft.world.entity.SpawnGroupData entityData) { + this.isNaturallyAggressiveToPlayers = world.getLevel().purpurConfig.cowNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.cowNaturallyAggressiveToPlayersChance; + return super.finalizeSpawn(world, difficulty, spawnReason, entityData); + } -+ -+ @Override -+ protected boolean isAlwaysExperienceDropper() { -+ return this.level().purpurConfig.cowAlwaysDropExp; -+ } + @Override protected void registerGoals() { this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new PanicGoal(this, 2.0D)); + this.goalSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D)); this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, (itemstack) -> { - return itemstack.is(ItemTags.COW_FOOD); -+ return level().purpurConfig.cowFeedMushrooms > 0 && (itemstack.is(net.minecraft.world.level.block.Blocks.RED_MUSHROOM.asItem()) || itemstack.is(net.minecraft.world.level.block.Blocks.BROWN_MUSHROOM.asItem())) || itemstack.is(ItemTags.COW_FOOD); // Purpur ++ return level().purpurConfig.cowFeedMushrooms > 0 && (itemstack.is(net.minecraft.world.level.block.Blocks.RED_MUSHROOM.asItem()) || itemstack.is(net.minecraft.world.level.block.Blocks.BROWN_MUSHROOM.asItem())) || itemstack.is(ItemTags.COW_FOOD); // Purpur - Cows eat mushrooms }, false)); this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25D)); this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D)); @@ -6049,7 +6083,7 @@ index 3e00bbff266fc71b07014e7e047d77b7f809239f..51b4314cdba44146871aa8646ab6fa41 } @Override -@@ -64,7 +113,7 @@ public class Cow extends Animal { +@@ -64,7 +117,7 @@ public class Cow extends Animal { } public static AttributeSupplier.Builder createAttributes() { @@ -6058,40 +6092,40 @@ index 3e00bbff266fc71b07014e7e047d77b7f809239f..51b4314cdba44146871aa8646ab6fa41 } @Override -@@ -94,6 +143,7 @@ public class Cow extends Animal { +@@ -94,6 +147,7 @@ public class Cow extends Animal { @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { -+ if (getRider() != null) return InteractionResult.PASS; // Purpur ++ if (getRider() != null) return InteractionResult.PASS; // Purpur - Ridables ItemStack itemstack = player.getItemInHand(hand); if (itemstack.is(Items.BUCKET) && !this.isBaby()) { -@@ -102,7 +152,7 @@ public class Cow extends Animal { +@@ -102,7 +156,7 @@ public class Cow extends Animal { if (event.isCancelled()) { player.containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync - return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur ++ return tryRide(player, hand); // Purpur - Ridables } // CraftBukkit end -@@ -111,6 +161,10 @@ public class Cow extends Animal { +@@ -111,6 +165,10 @@ public class Cow extends Animal { player.setItemInHand(hand, itemstack1); return InteractionResult.SUCCESS; -+ // Purpur start - feed mushroom to change to mooshroom ++ // Purpur start - feed mushroom to change to mooshroom - Cows eat mushrooms + } else if (level().purpurConfig.cowFeedMushrooms > 0 && this.getType() != EntityType.MOOSHROOM && isMushroom(itemstack)) { + return this.feedMushroom(player, itemstack); -+ // Purpur end ++ // Purpur end - Cows eat mushrooms } else { return super.mobInteract(player, hand); } -@@ -126,4 +180,67 @@ public class Cow extends Animal { +@@ -126,4 +184,67 @@ public class Cow extends Animal { public EntityDimensions getDefaultDimensions(Pose pose) { return this.isBaby() ? Cow.BABY_DIMENSIONS : super.getDefaultDimensions(pose); } + -+ // Purpur start - feed mushroom to change to mooshroom ++ // Purpur start - feed mushroom to change to mooshroom - Cows eat mushrooms + private int redMushroomsFed = 0; + private int brownMushroomsFed = 0; + @@ -6152,23 +6186,23 @@ index 3e00bbff266fc71b07014e7e047d77b7f809239f..51b4314cdba44146871aa8646ab6fa41 + } + return InteractionResult.SUCCESS; + } -+ // Purpur end ++ // Purpur end - Cows eat mushrooms } 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 5af4d590a9b0f17ba53c6959d9c18bd1269878a4..c1842894f96a567707992d8ff938dbf689dd0df6 100644 +index 5af4d590a9b0f17ba53c6959d9c18bd1269878a4..abbf13d79b4c1ed46bd486ebbd4ff5001bb096b5 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java +++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java -@@ -85,14 +85,99 @@ public class Dolphin extends AgeableWaterCreature { +@@ -85,14 +85,102 @@ public class Dolphin extends AgeableWaterCreature { return !entityitem.hasPickUpDelay() && entityitem.isAlive() && entityitem.isInWater(); }; public static final float BABY_SCALE = 0.65F; -+ private boolean isNaturallyAggressiveToPlayers; // Purpur -+ private int spitCooldown; // Purpur ++ private int spitCooldown; // Purpur - Ridables ++ private boolean isNaturallyAggressiveToPlayers; // Purpur - Dolphins naturally aggressive to players chance public Dolphin(EntityType type, Level world) { super(type, world); - this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02F, 0.1F, true); -+ // Purpur start ++ // Purpur start - Ridables + class DolphinMoveControl extends SmoothSwimmingMoveControl { + private final org.purpurmc.purpur.controller.WaterMoveControllerWASD waterMoveControllerWASD; + private final Dolphin dolphin; @@ -6199,12 +6233,12 @@ index 5af4d590a9b0f17ba53c6959d9c18bd1269878a4..c1842894f96a567707992d8ff938dbf6 + } + }; + this.moveControl = new DolphinMoveControl(this, 85, 10, 0.02F, 0.1F, true); -+ // Purpur end ++ // Purpur end - Ridables this.lookControl = new SmoothSwimmingLookControl(this, 10); this.setCanPickUpLoot(true); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.dolphinRidable; @@ -6238,41 +6272,44 @@ index 5af4d590a9b0f17ba53c6959d9c18bd1269878a4..c1842894f96a567707992d8ff938dbf6 + } + return false; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.dolphinMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.dolphinScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.dolphinTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.dolphinAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Nullable @Override public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData entityData) { -@@ -101,6 +186,7 @@ public class Dolphin extends AgeableWaterCreature { +@@ -101,6 +189,7 @@ public class Dolphin extends AgeableWaterCreature { SpawnGroupData groupdataentity1 = (SpawnGroupData) Objects.requireNonNullElseGet(entityData, () -> { return new AgeableMob.AgeableMobGroupData(0.1F); }); -+ this.isNaturallyAggressiveToPlayers = world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance; // Purpur ++ this.isNaturallyAggressiveToPlayers = world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance; // Purpur - Dolphins naturally aggressive to players chance return super.finalizeSpawn(world, difficulty, spawnReason, groupdataentity1); } -@@ -177,17 +263,21 @@ public class Dolphin extends AgeableWaterCreature { +@@ -177,17 +266,21 @@ public class Dolphin extends AgeableWaterCreature { protected void registerGoals() { this.goalSelector.addGoal(0, new BreathAirGoal(this)); this.goalSelector.addGoal(0, new TryFindWaterGoal(this)); -+ this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables ++ this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur - Dolphins naturally aggressive to players chance this.goalSelector.addGoal(1, new Dolphin.DolphinSwimToTreasureGoal(this)); this.goalSelector.addGoal(2, new Dolphin.DolphinSwimWithPlayerGoal(this, 4.0D)); this.goalSelector.addGoal(4, new RandomSwimmingGoal(this, 1.0D, 10)); @@ -6280,17 +6317,17 @@ index 5af4d590a9b0f17ba53c6959d9c18bd1269878a4..c1842894f96a567707992d8ff938dbf6 this.goalSelector.addGoal(5, new LookAtPlayerGoal(this, Player.class, 6.0F)); this.goalSelector.addGoal(5, new DolphinJumpGoal(this, 10)); - this.goalSelector.addGoal(6, new MeleeAttackGoal(this, 1.2000000476837158D, true)); -+ //this.goalSelector.addGoal(6, new MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur - moved up ++ //this.goalSelector.addGoal(6, new MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur - moved up - Dolphins naturally aggressive to players chance this.goalSelector.addGoal(8, new Dolphin.PlayWithItemsGoal()); this.goalSelector.addGoal(8, new FollowBoatGoal(this)); this.goalSelector.addGoal(9, new AvoidEntityGoal<>(this, Guardian.class, 8.0F, 1.0D, 1.0D)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Guardian.class})).setAlertOthers()); -+ this.targetSelector.addGoal(2, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (ignored, ignored2) -> isNaturallyAggressiveToPlayers)); // Purpur ++ this.targetSelector.addGoal(2, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (ignored, ignored2) -> isNaturallyAggressiveToPlayers)); // Purpur - Dolphins naturally aggressive to players chance } public static AttributeSupplier.Builder createAttributes() { -@@ -231,7 +321,7 @@ public class Dolphin extends AgeableWaterCreature { +@@ -231,7 +324,7 @@ public class Dolphin extends AgeableWaterCreature { @Override protected boolean canRide(Entity entity) { @@ -6299,19 +6336,19 @@ index 5af4d590a9b0f17ba53c6959d9c18bd1269878a4..c1842894f96a567707992d8ff938dbf6 } @Override -@@ -264,6 +354,11 @@ public class Dolphin extends AgeableWaterCreature { +@@ -264,6 +357,11 @@ public class Dolphin extends AgeableWaterCreature { @Override public void tick() { super.tick(); -+ // Purpur start ++ // Purpur start - Ridables + if (spitCooldown > 0) { + spitCooldown--; + } -+ // Purpur end ++ // Purpur end - Ridables if (this.isNoAi()) { this.setAirSupply(this.getMaxAirSupply()); } else { -@@ -412,6 +507,7 @@ public class Dolphin extends AgeableWaterCreature { +@@ -412,6 +510,7 @@ public class Dolphin extends AgeableWaterCreature { @Override public boolean canUse() { @@ -6320,14 +6357,14 @@ index 5af4d590a9b0f17ba53c6959d9c18bd1269878a4..c1842894f96a567707992d8ff938dbf6 } 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 d48c2bdb004c86e9e08680138fe51dc3b2975a64..80b93d50650886a874a8b0b8a27e15b4d4e727f0 100644 +index d48c2bdb004c86e9e08680138fe51dc3b2975a64..fb75b983f7c522708964a9352546ae29611bf4e9 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java -@@ -144,6 +144,65 @@ public class Fox extends Animal implements VariantHolder { +@@ -144,6 +144,69 @@ public class Fox extends Animal implements VariantHolder { this.getNavigation().setRequiredPathLength(32.0F); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.foxRidable; @@ -6363,49 +6400,53 @@ index d48c2bdb004c86e9e08680138fe51dc3b2975a64..80b93d50650886a874a8b0b8a27e15b4 + super.onDismount(rider); + setCanPickUpLoot(true); + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.foxMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.foxScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.foxBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.foxTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.foxAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { super.defineSynchedData(builder); -@@ -163,6 +222,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -163,6 +226,7 @@ public class Fox extends Animal implements VariantHolder { return entityliving instanceof AbstractSchoolingFish; }); this.goalSelector.addGoal(0, new Fox.FoxFloatGoal()); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables 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)); -@@ -189,6 +249,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -189,6 +253,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()); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(3, new Fox.DefendTrustedTargetGoal(LivingEntity.class, false, false, (entityliving, worldserver) -> { return Fox.TRUSTED_TARGET_SELECTOR.test(entityliving) && !this.trusts(entityliving.getUUID()); })); -@@ -338,6 +399,11 @@ public class Fox extends Animal implements VariantHolder { +@@ -338,6 +403,11 @@ public class Fox extends Animal implements VariantHolder { } private void setTargetGoals() { @@ -6417,7 +6458,7 @@ index d48c2bdb004c86e9e08680138fe51dc3b2975a64..80b93d50650886a874a8b0b8a27e15b4 if (this.getVariant() == Fox.Variant.RED) { this.targetSelector.addGoal(4, this.landTargetGoal); this.targetSelector.addGoal(4, this.turtleEggTargetGoal); -@@ -367,6 +433,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -367,6 +437,7 @@ public class Fox extends Animal implements VariantHolder { public void setVariant(Fox.Variant variant) { this.entityData.set(Fox.DATA_TYPE_ID, variant.getId()); @@ -6425,7 +6466,7 @@ index d48c2bdb004c86e9e08680138fe51dc3b2975a64..80b93d50650886a874a8b0b8a27e15b4 } List getTrustedUUIDs() { -@@ -702,6 +769,29 @@ public class Fox extends Animal implements VariantHolder { +@@ -702,6 +773,29 @@ public class Fox extends Animal implements VariantHolder { } // Paper end @@ -6455,12 +6496,12 @@ index d48c2bdb004c86e9e08680138fe51dc3b2975a64..80b93d50650886a874a8b0b8a27e15b4 @Override // Paper start - Cancellable death event protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(ServerLevel world, DamageSource damageSource) { -@@ -754,16 +844,16 @@ public class Fox extends Animal implements VariantHolder { +@@ -754,16 +848,16 @@ public class Fox extends Animal implements VariantHolder { return new Vec3(0.0D, (double) (0.55F * this.getEyeHeight()), (double) (this.getBbWidth() * 0.4F)); } - public class FoxLookControl extends LookControl { -+ public class FoxLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur ++ public class FoxLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables public FoxLookControl() { super(Fox.this); @@ -6468,19 +6509,19 @@ index d48c2bdb004c86e9e08680138fe51dc3b2975a64..80b93d50650886a874a8b0b8a27e15b4 @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (!Fox.this.isSleeping()) { - super.tick(); -+ super.vanillaTick(); // Purpur ++ super.vanillaTick(); // Purpur - Ridables } } -@@ -774,16 +864,16 @@ public class Fox extends Animal implements VariantHolder { +@@ -774,16 +868,16 @@ public class Fox extends Animal implements VariantHolder { } } - private class FoxMoveControl extends MoveControl { -+ private class FoxMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur ++ private class FoxMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur - Ridables public FoxMoveControl() { super(Fox.this); @@ -6488,40 +6529,40 @@ index d48c2bdb004c86e9e08680138fe51dc3b2975a64..80b93d50650886a874a8b0b8a27e15b4 @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (Fox.this.canMove()) { - super.tick(); -+ super.vanillaTick(); // Purpur ++ super.vanillaTick(); // Purpur - Ridables } } -@@ -901,8 +991,10 @@ public class Fox extends Animal implements VariantHolder { +@@ -901,8 +995,10 @@ public class Fox extends Animal implements VariantHolder { CriteriaTriggers.BRED_ANIMALS.trigger(entityplayer2, this.animal, this.partner, entityfox); } - this.animal.setAge(6000); - this.partner.setAge(6000); -+ // Purpur start ++ // Purpur start - Make entity breeding times configurable + this.animal.setAge(this.animal.getPurpurBreedTime()); + this.partner.setAge(this.partner.getPurpurBreedTime()); -+ // Purpur end ++ // Purpur end - Make entity breeding times configurable this.animal.resetLove(); this.partner.resetLove(); worldserver.addFreshEntityWithPassengers(entityfox, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason -@@ -1288,7 +1380,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -1288,7 +1384,7 @@ public class Fox extends Animal implements VariantHolder { } protected void onReachedTarget() { - if (getServerLevel(Fox.this.level()).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (getServerLevel(Fox.this.level()).purpurConfig.foxBypassMobGriefing ^ getServerLevel(Fox.this.level()).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur ++ if (getServerLevel(Fox.this.level()).purpurConfig.foxBypassMobGriefing ^ getServerLevel(Fox.this.level()).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur - Add mobGriefing bypass to everything affected BlockState iblockdata = Fox.this.level().getBlockState(this.blockPos); 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 e07b79ef172095c1800c88342b3ac8dc7703aea2..9a6471d2f1eb1c8af006b70b6bba0b668220fb00 100644 +index e07b79ef172095c1800c88342b3ac8dc7703aea2..caa29df16214c60c4e0a471ad6320ea5d62ba7d0 100644 --- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java -@@ -57,13 +57,59 @@ public class IronGolem extends AbstractGolem implements NeutralMob { +@@ -57,13 +57,63 @@ public class IronGolem extends AbstractGolem implements NeutralMob { private int remainingPersistentAngerTime; @Nullable private UUID persistentAngerTarget; @@ -6531,7 +6572,7 @@ index e07b79ef172095c1800c88342b3ac8dc7703aea2..9a6471d2f1eb1c8af006b70b6bba0b66 super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.ironGolemRidable; @@ -6546,19 +6587,22 @@ index e07b79ef172095c1800c88342b3ac8dc7703aea2..9a6471d2f1eb1c8af006b70b6bba0b66 + public boolean isControllable() { + return level().purpurConfig.ironGolemControllable; + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.ironGolemMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.ironGolemScale); + } -+ // Purpur end -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.ironGolemTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Summoner API + @Nullable + public UUID getSummoner() { + return summoner; @@ -6567,75 +6611,76 @@ index e07b79ef172095c1800c88342b3ac8dc7703aea2..9a6471d2f1eb1c8af006b70b6bba0b66 + public void setSummoner(@Nullable UUID summoner) { + this.summoner = summoner; + } -+ ++ // Purpur end - Summoner API ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.ironGolemAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { -+ if (level().purpurConfig.ironGolemCanSwim) this.goalSelector.addGoal(0, new net.minecraft.world.entity.ai.goal.FloatGoal(this)); // Purpur -+ if (this.level().purpurConfig.ironGolemPoppyCalm) this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.ReceiveFlower(this)); // Purpur -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ if (level().purpurConfig.ironGolemCanSwim) this.goalSelector.addGoal(0, new net.minecraft.world.entity.ai.goal.FloatGoal(this)); // Purpur - Ridables ++ if (this.level().purpurConfig.ironGolemPoppyCalm) this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.ReceiveFlower(this)); // Purpur - Iron golem calm anger options ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0D, true)); this.goalSelector.addGoal(2, new MoveTowardsTargetGoal(this, 0.9D, 32.0F)); this.goalSelector.addGoal(2, new MoveBackToVillageGoal(this, 0.6D, false)); -@@ -71,6 +117,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob { +@@ -71,6 +121,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob { this.goalSelector.addGoal(5, new OfferFlowerGoal(this)); this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 6.0F)); this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new DefendVillageTargetGoal(this)); this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0])); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt)); -@@ -135,6 +182,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob { +@@ -135,6 +186,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob { public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); nbt.putBoolean("PlayerCreated", this.isPlayerCreated()); -+ if (getSummoner() != null) nbt.putUUID("Purpur.Summoner", getSummoner()); // Purpur ++ if (getSummoner() != null) nbt.putUUID("Purpur.Summoner", getSummoner()); // Purpur - Summoner API this.addPersistentAngerSaveData(nbt); } -@@ -142,6 +190,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob { +@@ -142,6 +194,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob { public void readAdditionalSaveData(CompoundTag nbt) { super.readAdditionalSaveData(nbt); this.setPlayerCreated(nbt.getBoolean("PlayerCreated")); -+ if (nbt.contains("Purpur.Summoner")) setSummoner(nbt.getUUID("Purpur.Summoner")); // Purpur ++ if (nbt.contains("Purpur.Summoner")) setSummoner(nbt.getUUID("Purpur.Summoner")); // Purpur - Summoner API this.readPersistentAngerSaveData(this.level(), nbt); } -@@ -267,18 +316,19 @@ public class IronGolem extends AbstractGolem implements NeutralMob { +@@ -267,18 +320,19 @@ public class IronGolem extends AbstractGolem implements NeutralMob { ItemStack itemstack = player.getItemInHand(hand); if (!itemstack.is(Items.IRON_INGOT)) { - return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur ++ return tryRide(player, hand); // Purpur - Ridables } else { float f = this.getHealth(); this.heal(25.0F); if (this.getHealth() == f) { - return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur ++ return tryRide(player, hand); // Purpur - Ridables } else { float f1 = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F; this.playSound(SoundEvents.IRON_GOLEM_REPAIR, 1.0F, f1); itemstack.consume(1, player); -+ if (this.level().purpurConfig.ironGolemHealCalm && isAngry() && getHealth() == getMaxHealth()) stopBeingAngry(); // Purpur ++ if (this.level().purpurConfig.ironGolemHealCalm && isAngry() && getHealth() == getMaxHealth()) stopBeingAngry(); // Purpur - Iron golem calm anger options return InteractionResult.SUCCESS; } } 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 b04532aa04aec6ebbff74d64abb73189c2e12016..4d05c34dcebc7582fd400066809b4997b2e8a86a 100644 +index b04532aa04aec6ebbff74d64abb73189c2e12016..481d373d3906f35d0e8e7aeaef3b70b4d443894f 100644 --- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java +++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java -@@ -64,6 +64,43 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder { world.sendParticles(ParticleTypes.EXPLOSION, this.getX(), this.getY(0.5D), this.getZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D); @@ -6699,14 +6748,14 @@ index b04532aa04aec6ebbff74d64abb73189c2e12016..4d05c34dcebc7582fd400066809b4997 drops.forEach(drop -> { ItemEntity entityitem = new ItemEntity(this.level(), this.getX(), this.getY(1.0D), this.getZ(), drop); diff --git a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java -index 0554ee499c452db6c1e6852f5022b1f197adb024..dee59cb4b87845c940ee089aa932aa69dd2539d6 100644 +index 0554ee499c452db6c1e6852f5022b1f197adb024..79db05362cddbef624e5f5e19e11faa951b6f81c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java -@@ -65,6 +65,44 @@ public class Ocelot extends Animal { +@@ -65,6 +65,48 @@ public class Ocelot extends Animal { this.reassessTrustingGoals(); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.ocelotRidable; @@ -6721,48 +6770,52 @@ index 0554ee499c452db6c1e6852f5022b1f197adb024..dee59cb4b87845c940ee089aa932aa69 + public boolean isControllable() { + return level().purpurConfig.ocelotControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.ocelotMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.ocelotScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.ocelotBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.ocelotTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.ocelotAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience public boolean isTrusting() { return (Boolean) this.entityData.get(Ocelot.DATA_TRUSTING); } -@@ -98,12 +136,14 @@ public class Ocelot extends Animal { +@@ -98,12 +140,14 @@ public class Ocelot extends Animal { return itemstack.is(ItemTags.OCELOT_FOOD); }, 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 org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(3, this.temptGoal); this.goalSelector.addGoal(7, new LeapAtTargetGoal(this, 0.3F)); this.goalSelector.addGoal(8, new OcelotAttackGoal(this)); this.goalSelector.addGoal(9, new BreedGoal(this, 0.8D)); this.goalSelector.addGoal(10, new WaterAvoidingRandomStrollGoal(this, 0.8D, 1.0000001E-5F)); this.goalSelector.addGoal(11, new LookAtPlayerGoal(this, Player.class, 10.0F)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Chicken.class, false)); this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, false, false, Turtle.BABY_ON_LAND_SELECTOR)); } -@@ -244,7 +284,7 @@ public class Ocelot extends Animal { +@@ -244,7 +288,7 @@ public class Ocelot extends Animal { if (world.isUnobstructed(this) && !world.containsAnyLiquid(this.getBoundingBox())) { BlockPos blockposition = this.blockPosition(); @@ -6772,14 +6825,14 @@ index 0554ee499c452db6c1e6852f5022b1f197adb024..dee59cb4b87845c940ee089aa932aa69 } 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 be753557d7ebd6f1e82b1bdb6d60ecc450f72eec..83372c86bd54eedd9b136ddfcbfc67d303058c0a 100644 +index be753557d7ebd6f1e82b1bdb6d60ecc450f72eec..18bda7f4d0e0dfb2074b70e1369915c3a486e5cd 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Panda.java +++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java -@@ -112,6 +112,54 @@ public class Panda extends Animal { +@@ -112,6 +112,58 @@ public class Panda extends Animal { } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.pandaRidable; @@ -6803,116 +6856,120 @@ index be753557d7ebd6f1e82b1bdb6d60ecc450f72eec..83372c86bd54eedd9b136ddfcbfc67d3 + eat(false); + setOnBack(false); + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.pandaMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.pandaScale); + setAttributes(); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.pandaBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.pandaTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.pandaAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected boolean canDispenserEquipIntoSlot(EquipmentSlot slot) { return slot == EquipmentSlot.MAINHAND && this.canPickUpLoot(); -@@ -271,6 +319,7 @@ public class Panda extends Animal { +@@ -271,6 +323,7 @@ public class Panda extends Animal { @Override protected void registerGoals() { this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(2, new Panda.PandaPanicGoal(this, 2.0D)); this.goalSelector.addGoal(2, new Panda.PandaBreedGoal(this, 1.0D)); this.goalSelector.addGoal(3, new Panda.PandaAttackGoal(this, 1.2000000476837158D, true)); -@@ -288,6 +337,7 @@ public class Panda extends Animal { +@@ -288,6 +341,7 @@ public class Panda extends Animal { this.goalSelector.addGoal(12, new Panda.PandaRollGoal(this)); this.goalSelector.addGoal(13, new FollowParentGoal(this, 1.25D)); this.goalSelector.addGoal(14, new WaterAvoidingRandomStrollGoal(this, 1.0D)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, (new Panda.PandaHurtByTargetGoal(this, new Class[0])).setAlertOthers(new Class[0])); } -@@ -617,7 +667,10 @@ public class Panda extends Animal { +@@ -617,7 +671,10 @@ public class Panda extends Animal { public void setAttributes() { if (this.isWeak()) { - this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(10.0D); -+ // Purpur start ++ // Purpur start - Configurable entity base attributes + net.minecraft.world.entity.ai.attributes.AttributeInstance maxHealth = this.getAttribute(Attributes.MAX_HEALTH); + maxHealth.setBaseValue(maxHealth.getValue() / 2); -+ // Purpur end ++ // Purpur end - Configurable entity base attributes } if (this.isLazy()) { -@@ -640,7 +693,7 @@ public class Panda extends Animal { +@@ -640,7 +697,7 @@ public class Panda extends Animal { ItemStack itemstack = player.getItemInHand(hand); if (this.isScared()) { - return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur ++ return tryRide(player, hand); // Purpur - Ridables } else if (this.isOnBack()) { this.setOnBack(false); return InteractionResult.SUCCESS; -@@ -679,12 +732,12 @@ public class Panda extends Animal { +@@ -679,12 +736,12 @@ public class Panda extends Animal { } } - return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur ++ return tryRide(player, hand); // Purpur - Ridables } return InteractionResult.SUCCESS_SERVER; } else { - return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur ++ return tryRide(player, hand); // Purpur - Ridables } } -@@ -729,7 +782,7 @@ public class Panda extends Animal { +@@ -729,7 +786,7 @@ public class Panda extends Animal { return itemEntity.getItem().is(ItemTags.PANDA_EATS_FROM_GROUND) && itemEntity.isAlive() && !itemEntity.hasPickUpDelay(); } - private static class PandaMoveControl extends MoveControl { -+ private static class PandaMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur ++ private static class PandaMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur - Ridables private final Panda panda; -@@ -739,9 +792,9 @@ public class Panda extends Animal { +@@ -739,9 +796,9 @@ public class Panda extends Animal { } @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (this.panda.canPerformAction()) { - super.tick(); -+ super.vanillaTick(); // Purpur ++ super.vanillaTick(); // Purpur - Ridables } } } 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 a2f0b79599799ad2aa85aff821d8ac76a8e650bd..f14fe1c299e6ef5cf55bde617ff9fe6aca08702f 100644 +index a2f0b79599799ad2aa85aff821d8ac76a8e650bd..724e7e77b1c781c3c91689eb7dfc3aed21133fd0 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -@@ -125,12 +125,89 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder type, Level world) { super(type, world); - this.moveControl = new FlyingMoveControl(this, 10, false); -+ // Purpur start ++ // Purpur start - Ridables + final org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD flyingController = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.3F); + class ParrotMoveControl extends FlyingMoveControl { + public ParrotMoveControl(Mob entity, int maxPitchChange, boolean noGravity) { @@ -6934,13 +6991,13 @@ index a2f0b79599799ad2aa85aff821d8ac76a8e650bd..f14fe1c299e6ef5cf55bde617ff9fe6a + } + } + this.moveControl = new ParrotMoveControl(this, 10, false); -+ // Purpur end ++ // Purpur end - Ridables this.setPathfindingMalus(PathType.DANGER_FIRE, -1.0F); this.setPathfindingMalus(PathType.DAMAGE_FIRE, -1.0F); this.setPathfindingMalus(PathType.COCOA, -1.0F); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.parrotRidable; @@ -6972,46 +7029,50 @@ index a2f0b79599799ad2aa85aff821d8ac76a8e650bd..f14fe1c299e6ef5cf55bde617ff9fe6a + setDeltaMovement(mot.scale(0.9D)); + } + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.parrotMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.parrotScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return 6000; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.parrotTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.parrotAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Nullable @Override public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData entityData) { -@@ -149,8 +226,11 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder type, LevelAccessor world, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random) { -@@ -292,13 +373,13 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder { -@@ -156,6 +195,17 @@ public class Pig extends Animal implements ItemSteerable, Saddleable { +@@ -156,6 +199,17 @@ public class Pig extends Animal implements ItemSteerable, Saddleable { public InteractionResult mobInteract(Player player, InteractionHand hand) { boolean flag = this.isFood(player.getItemInHand(hand)); @@ -7125,20 +7190,20 @@ index c39b2580a67c9b0bf8631f108e0628fa9732ada1..7895fca01c20da24a10ac6a642ebba87 if (!this.level().isClientSide) { player.startRiding(this); diff --git a/src/main/java/net/minecraft/world/entity/animal/PolarBear.java b/src/main/java/net/minecraft/world/entity/animal/PolarBear.java -index cd72d8f766069796ce1fe4a83b8646692005ff8c..86c44912a363401bdd716c22d24dfd7e92cfd0be 100644 +index cd72d8f766069796ce1fe4a83b8646692005ff8c..986fad77b0340c344ba3a3e3a3e5bc0105625439 100644 --- a/src/main/java/net/minecraft/world/entity/animal/PolarBear.java +++ b/src/main/java/net/minecraft/world/entity/animal/PolarBear.java -@@ -59,11 +59,82 @@ public class PolarBear extends Animal implements NeutralMob { +@@ -59,11 +59,87 @@ public class PolarBear extends Animal implements NeutralMob { private int remainingPersistentAngerTime; @Nullable private UUID persistentAngerTarget; -+ private int standTimer = 0; // Purpur ++ private int standTimer = 0; // Purpur - Ridables public PolarBear(EntityType type, Level world) { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.polarBearRidable; @@ -7164,14 +7229,16 @@ index cd72d8f766069796ce1fe4a83b8646692005ff8c..86c44912a363401bdd716c22d24dfd7e + } + return false; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.polarBearMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.polarBearScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Breedable Polar Bears + public boolean canMate(Animal other) { + if (other == this) { + return false; @@ -7192,85 +7259,88 @@ index cd72d8f766069796ce1fe4a83b8646692005ff8c..86c44912a363401bdd716c22d24dfd7e + return this.isInLove() && bear.isInLove(); + } + } -+ ++ // Purpur end - Breedable Polar Bears ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.polarBearBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.polarBearTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.polarBearAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Nullable @Override public AgeableMob getBreedOffspring(ServerLevel world, AgeableMob entity) { -@@ -72,20 +143,28 @@ public class PolarBear extends Animal implements NeutralMob { +@@ -72,20 +148,28 @@ public class PolarBear extends Animal implements NeutralMob { @Override public boolean isFood(ItemStack stack) { - return false; -+ return level().purpurConfig.polarBearBreedableItem != null && stack.getItem() == level().purpurConfig.polarBearBreedableItem; // Purpur ++ return level().purpurConfig.polarBearBreedableItem != null && stack.getItem() == level().purpurConfig.polarBearBreedableItem; // Purpur - Breedable Polar Bears } @Override protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new PolarBear.PolarBearMeleeAttackGoal()); this.goalSelector .addGoal(1, new PanicGoal(this, 2.0, polarBear -> polarBear.isBaby() ? DamageTypeTags.PANIC_CAUSES : DamageTypeTags.PANIC_ENVIRONMENTAL_CAUSES)); -+ // Purpur start ++ // Purpur start - Breedable Polar Bears + if (level().purpurConfig.polarBearBreedableItem != null) { + this.goalSelector.addGoal(2, new net.minecraft.world.entity.ai.goal.BreedGoal(this, 1.0D)); + this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.TemptGoal(this, 1.0D, net.minecraft.world.item.crafting.Ingredient.of(level().purpurConfig.polarBearBreedableItem), false)); + } -+ // Purpur end ++ // Purpur end - Breedable Polar Bears this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25)); this.goalSelector.addGoal(5, new RandomStrollGoal(this, 1.0)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F)); this.goalSelector.addGoal(7, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new PolarBear.PolarBearHurtByTargetGoal()); this.targetSelector.addGoal(2, new PolarBear.PolarBearAttackPlayersGoal()); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt)); -@@ -204,6 +283,12 @@ public class PolarBear extends Animal implements NeutralMob { +@@ -204,6 +288,12 @@ public class PolarBear extends Animal implements NeutralMob { if (!this.level().isClientSide) { this.updatePersistentAnger((ServerLevel)this.level(), true); } + -+ // Purpur start ++ // Purpur start - Ridables + if (isStanding() && --standTimer <= 0) { + setStanding(false); + } -+ // Purpur end ++ // Purpur end - Ridables } @Override -@@ -223,6 +308,7 @@ public class PolarBear extends Animal implements NeutralMob { +@@ -223,6 +313,7 @@ public class PolarBear extends Animal implements NeutralMob { public void setStanding(boolean warning) { this.entityData.set(DATA_STANDING_ID, warning); -+ standTimer = warning ? 20 : -1; // Purpur ++ standTimer = warning ? 20 : -1; // Purpur - Ridables } public float getStandingAnimationScale(float tickDelta) { diff --git a/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java b/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java -index cdb74f86ee92ee143af29962a85d45ca585cee44..c5a39ea2ad0e5e5ac434d79c1a57e0068b8bc809 100644 +index cdb74f86ee92ee143af29962a85d45ca585cee44..a612f3e8034dd20566370c846f093b50ddef904c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java +++ b/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java -@@ -52,6 +52,33 @@ public class Pufferfish extends AbstractFish { +@@ -52,6 +52,36 @@ public class Pufferfish extends AbstractFish { this.refreshDimensions(); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.pufferfishRidable; @@ -7280,43 +7350,46 @@ index cdb74f86ee92ee143af29962a85d45ca585cee44..c5a39ea2ad0e5e5ac434d79c1a57e006 + public boolean isControllable() { + return level().purpurConfig.pufferfishControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.pufferfishMaxHealth); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.pufferfishTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.pufferfishAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { super.defineSynchedData(builder); diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java -index 53d60d62686f9b6bc98b6b25e4315b848600a99d..a1e3331d73cc971b58efe9e0cb565ac9711e2ef1 100644 +index 53d60d62686f9b6bc98b6b25e4315b848600a99d..080551d9b55d12ef15fa2efbde1d195bc82d065c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java +++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java @@ -88,6 +88,7 @@ public class Rabbit extends Animal implements VariantHolder { private boolean wasOnGround; private int jumpDelayTicks; public int moreCarrotTicks; -+ private boolean actualJump; // Purpur ++ private boolean actualJump; // Purpur - Ridables public Rabbit(EntityType type, Level world) { super(type, world); -@@ -95,9 +96,76 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -95,9 +96,80 @@ public class Rabbit extends Animal implements VariantHolder { this.moveControl = new Rabbit.RabbitMoveControl(this); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.rabbitRidable; @@ -7359,65 +7432,69 @@ index 53d60d62686f9b6bc98b6b25e4315b848600a99d..a1e3331d73cc971b58efe9e0cb565ac9 + } + wasOnGround = onGround; + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.rabbitMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.rabbitScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.rabbitBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.rabbitTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.rabbitAlwaysDropExp; + } -+ // Purpur end -+ ++ // Purpur end - Mobs always drop experience @Override public void registerGoals() { 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 org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new ClimbOnTopOfPowderSnowGoal(this, this.level())); this.goalSelector.addGoal(1, new Rabbit.RabbitPanicGoal(this, 2.2D)); this.goalSelector.addGoal(2, new BreedGoal(this, 0.8D)); -@@ -114,6 +182,14 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -114,6 +186,14 @@ public class Rabbit extends Animal implements VariantHolder { @Override protected float getJumpPower() { -+ // Purpur start ++ // Purpur start - Ridables + if (getRider() != null && this.isControllable()) { + if (getForwardMot() < 0) { + setSpeed(getForwardMot() * 2F); + } + return actualJump ? 0.5F : 0.3F; + } -+ // Purpur end ++ // Purpur end - Ridables float f = 0.3F; if (this.moveControl.getSpeedModifier() <= 0.6D) { -@@ -188,6 +264,12 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -188,6 +268,12 @@ public class Rabbit extends Animal implements VariantHolder { @Override public void customServerAiStep(ServerLevel world) { -+ // Purpur start ++ // Purpur start - Ridables + if (getRider() != null && this.isControllable()) { + handleJumping(); + return; + } -+ // Purpur end ++ // Purpur end - Ridables if (this.jumpDelayTicks > 0) { --this.jumpDelayTicks; } -@@ -402,10 +484,23 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -402,10 +488,23 @@ public class Rabbit extends Animal implements VariantHolder { } this.setVariant(entityrabbit_variant); @@ -7441,21 +7518,21 @@ index 53d60d62686f9b6bc98b6b25e4315b848600a99d..a1e3331d73cc971b58efe9e0cb565ac9 Holder holder = world.getBiome(pos); int i = world.getRandom().nextInt(100); -@@ -469,7 +564,7 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -469,7 +568,7 @@ public class Rabbit extends Animal implements VariantHolder { } } - private static class RabbitMoveControl extends MoveControl { -+ private static class RabbitMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur ++ private static class RabbitMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur - Ridables private final Rabbit rabbit; private double nextJumpSpeed; -@@ -480,14 +575,14 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -480,14 +579,14 @@ public class Rabbit extends Animal implements VariantHolder { } @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (this.rabbit.onGround() && !this.rabbit.jumping && !((Rabbit.RabbitJumpControl) this.rabbit.jumpControl).wantJump()) { this.rabbit.setSpeedModifier(0.0D); } else if (this.hasWanted() || this.operation == MoveControl.Operation.JUMPING) { @@ -7463,28 +7540,28 @@ index 53d60d62686f9b6bc98b6b25e4315b848600a99d..a1e3331d73cc971b58efe9e0cb565ac9 } - super.tick(); -+ super.vanillaTick(); // Purpur ++ super.vanillaTick(); // Purpur - Ridables } @Override -@@ -549,7 +644,7 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -549,7 +648,7 @@ public class Rabbit extends Animal implements VariantHolder { @Override public boolean canUse() { if (this.nextStartTick <= 0) { - if (!getServerLevel((Entity) this.rabbit).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (!getServerLevel((Entity) this.rabbit).purpurConfig.rabbitBypassMobGriefing == !getServerLevel((Entity) this.rabbit).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur ++ if (!getServerLevel((Entity) this.rabbit).purpurConfig.rabbitBypassMobGriefing == !getServerLevel((Entity) this.rabbit).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur - Add mobGriefing bypass to everything affected return false; } 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 500259e6f297276fb3d6943c2bf88c844d4ec7e4..3716201b0889dfb0bacd0e223a29e80ee1f84e8e 100644 +index 500259e6f297276fb3d6943c2bf88c844d4ec7e4..b0ac0fb823cb2860e301c63c4cd2d35cdf108275 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Salmon.java +++ b/src/main/java/net/minecraft/world/entity/animal/Salmon.java -@@ -35,6 +35,33 @@ public class Salmon extends AbstractSchoolingFish implements VariantHolder { 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 fd9f6c17448a4d87f940eb8f544ecb9669068582..13eecc676e33623e776d32495969f111bf6c0e44 100644 +index fd9f6c17448a4d87f940eb8f544ecb9669068582..e338e92835d665840375049ecb475345e1631f06 100644 --- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java -@@ -50,17 +50,57 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -50,17 +50,60 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM private static final EntityDataAccessor DATA_PUMPKIN_ID = SynchedEntityData.defineId(SnowGolem.class, EntityDataSerializers.BYTE); private static final byte PUMPKIN_FLAG = 16; -+ @Nullable private java.util.UUID summoner; // Purpur ++ @Nullable private java.util.UUID summoner; // Purpur - Summoner API public SnowGolem(EntityType type, Level world) { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.snowGolemRidable; @@ -7597,14 +7681,16 @@ index fd9f6c17448a4d87f940eb8f544ecb9669068582..13eecc676e33623e776d32495969f111 + public boolean isControllable() { + return level().purpurConfig.snowGolemControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.snowGolemMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.snowGolemScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Summoner API + @Nullable + public java.util.UUID getSummoner() { + return summoner; @@ -7613,53 +7699,54 @@ index fd9f6c17448a4d87f940eb8f544ecb9669068582..13eecc676e33623e776d32495969f111 + public void setSummoner(@Nullable java.util.UUID summoner) { + this.summoner = summoner; + } -+ ++ // Purpur end - Summoner API ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.snowGolemAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { - this.goalSelector.addGoal(1, new RangedAttackGoal(this, 1.25D, 20, 10.0F)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur -+ this.goalSelector.addGoal(1, new RangedAttackGoal(this, level().purpurConfig.snowGolemAttackDistance, level().purpurConfig.snowGolemSnowBallMin, level().purpurConfig.snowGolemSnowBallMax, level().purpurConfig.snowGolemSnowBallModifier)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables ++ this.goalSelector.addGoal(1, new RangedAttackGoal(this, level().purpurConfig.snowGolemAttackDistance, level().purpurConfig.snowGolemSnowBallMin, level().purpurConfig.snowGolemSnowBallMax, level().purpurConfig.snowGolemSnowBallModifier)); // Purpur - Snow Golem rate of fire config this.goalSelector.addGoal(2, new WaterAvoidingRandomStrollGoal(this, 1.0D, 1.0000001E-5F)); this.goalSelector.addGoal(3, new LookAtPlayerGoal(this, Player.class, 6.0F)); this.goalSelector.addGoal(4, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Mob.class, 10, true, false, (entityliving, worldserver) -> { return entityliving instanceof Enemy; })); -@@ -80,6 +120,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -80,6 +123,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); nbt.putBoolean("Pumpkin", this.hasPumpkin()); -+ if (getSummoner() != null) nbt.putUUID("Purpur.Summoner", getSummoner()); // Purpur ++ if (getSummoner() != null) nbt.putUUID("Purpur.Summoner", getSummoner()); // Purpur - Summoner API } @Override -@@ -88,12 +129,13 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -88,12 +132,13 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM if (nbt.contains("Pumpkin")) { this.setPumpkin(nbt.getBoolean("Pumpkin")); } -+ if (nbt.contains("Purpur.Summoner")) setSummoner(nbt.getUUID("Purpur.Summoner")); // Purpur ++ if (nbt.contains("Purpur.Summoner")) setSummoner(nbt.getUUID("Purpur.Summoner")); // Purpur - Summoner API } @Override public boolean isSensitiveToWater() { - return true; -+ return this.level().purpurConfig.snowGolemTakeDamageFromWater; // Purpur ++ return this.level().purpurConfig.snowGolemTakeDamageFromWater; // Purpur - Toggle for water sensitive mob damage } @Override -@@ -106,10 +148,11 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -106,10 +151,11 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM this.hurtServer(worldserver, this.damageSources().melting(), 1.0F); // CraftBukkit - DamageSources.ON_FIRE -> CraftEventFactory.MELTING } - if (!worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (!worldserver.purpurConfig.snowGolemBypassMobGriefing == !worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur ++ if (!worldserver.purpurConfig.snowGolemBypassMobGriefing == !worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur - Add mobGriefing bypass to everything affected return; } @@ -7667,16 +7754,16 @@ index fd9f6c17448a4d87f940eb8f544ecb9669068582..13eecc676e33623e776d32495969f111 BlockState iblockdata = Blocks.SNOW.defaultBlockState(); for (int i = 0; i < 4; ++i) { -@@ -166,7 +209,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -166,7 +212,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops); if (event != null) { if (event.isCancelled()) { - return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur ++ return tryRide(player, hand); // Purpur - Ridables } drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops()); // Paper end - custom shear drops -@@ -178,8 +221,16 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -178,8 +224,16 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM } return InteractionResult.SUCCESS; @@ -7690,15 +7777,15 @@ index fd9f6c17448a4d87f940eb8f544ecb9669068582..13eecc676e33623e776d32495969f111 + // Purpur end } else { - return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur ++ return tryRide(player, hand); // Purpur - Ridables } } 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 97a3f0ab3dfca24991051395229dd4c601a66fa0..3ba2e4954e6c2809804f7b8ceb04dae56bb7c2ba 100644 +index 97a3f0ab3dfca24991051395229dd4c601a66fa0..c7a7d1df79beb527ff94f876ca36a861c37c4947 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,67 @@ public class Squid extends AgeableWaterCreature { +@@ -46,13 +46,70 @@ public class Squid extends AgeableWaterCreature { public Squid(EntityType type, Level world) { super(type, world); @@ -7707,7 +7794,7 @@ index 97a3f0ab3dfca24991051395229dd4c601a66fa0..3ba2e4954e6c2809804f7b8ceb04dae5 this.tentacleSpeed = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.squidRidable; @@ -7727,14 +7814,27 @@ index 97a3f0ab3dfca24991051395229dd4c601a66fa0..3ba2e4954e6c2809804f7b8ceb04dae5 + vector.setX(cos * x - sine * z); + vector.setZ(sine * x + cos * z); + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.squidMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.squidScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage ++ @Override ++ public boolean isSensitiveToWater() { ++ return this.level().purpurConfig.squidTakeDamageFromWater; ++ } ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience ++ @Override ++ protected boolean isAlwaysExperienceDropper() { ++ return this.level().purpurConfig.squidAlwaysDropExp; ++ } ++ // Purpur end - Mobs always drop experience + @Override + public net.minecraft.world.phys.AABB getAxisForFluidCheck() { + // Stops squids from floating just over the water @@ -7749,25 +7849,15 @@ index 97a3f0ab3dfca24991051395229dd4c601a66fa0..3ba2e4954e6c2809804f7b8ceb04dae5 + public boolean isInWater() { + return this.wasTouchingWater || canFly(); + } -+ -+ @Override -+ public boolean isSensitiveToWater() { -+ return this.level().purpurConfig.squidTakeDamageFromWater; -+ } -+ -+ @Override -+ protected boolean isAlwaysExperienceDropper() { -+ return this.level().purpurConfig.squidAlwaysDropExp; -+ } + @Override protected void registerGoals() { this.goalSelector.addGoal(0, new Squid.SquidRandomMovementGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new Squid.SquidFleeGoal()); } -@@ -127,6 +181,7 @@ public class Squid extends AgeableWaterCreature { +@@ -127,6 +184,7 @@ public class Squid extends AgeableWaterCreature { } if (this.isInWaterOrBubble()) { @@ -7775,11 +7865,11 @@ index 97a3f0ab3dfca24991051395229dd4c601a66fa0..3ba2e4954e6c2809804f7b8ceb04dae5 if (this.tentacleMovement < (float) Math.PI) { float f = this.tentacleMovement / (float) Math.PI; this.tentacleAngle = Mth.sin(f * f * (float) Math.PI) * (float) Math.PI * 0.25F; -@@ -305,10 +360,41 @@ public class Squid extends AgeableWaterCreature { +@@ -305,10 +363,41 @@ public class Squid extends AgeableWaterCreature { @Override public void tick() { -+ // Purpur start ++ // Purpur start - Ridables + net.minecraft.world.entity.player.Player rider = squid.getRider(); + if (rider != null && squid.isControllable()) { + if (rider.jumping) { @@ -7809,7 +7899,7 @@ index 97a3f0ab3dfca24991051395229dd4c601a66fa0..3ba2e4954e6c2809804f7b8ceb04dae5 + } + return; + } -+ // Purpur end ++ // Purpur end - Ridables int i = this.squid.getNoActionTime(); if (i > 100) { this.squid.movementVector = Vec3.ZERO; @@ -7819,14 +7909,14 @@ index 97a3f0ab3dfca24991051395229dd4c601a66fa0..3ba2e4954e6c2809804f7b8ceb04dae5 this.squid.movementVector = new Vec3( (double)(Mth.cos(f) * 0.2F), (double)(-0.1F + this.squid.getRandom().nextFloat() * 0.2F), (double)(Mth.sin(f) * 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 8d59d606bdaaea7c64389572b2810b65414a1533..7f9d3177285f6496c4313da63f0fd0cc78266586 100644 +index 8d59d606bdaaea7c64389572b2810b65414a1533..26790832db3267dbfced4ce77e1a70ac2f2b6c3d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java +++ b/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java -@@ -67,6 +67,33 @@ public class TropicalFish extends AbstractSchoolingFish implements VariantHolder +@@ -67,6 +67,36 @@ public class TropicalFish extends AbstractSchoolingFish implements VariantHolder super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.tropicalFishRidable; @@ -7836,35 +7926,38 @@ index 8d59d606bdaaea7c64389572b2810b65414a1533..7f9d3177285f6496c4313da63f0fd0cc + public boolean isControllable() { + return level().purpurConfig.tropicalFishControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.tropicalFishMaxHealth); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.tropicalFishTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.tropicalFishAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience public static String getPredefinedName(int variant) { 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 d6605c15111dbdb6ee61a24822bc0a9aed7198d6..c9e307452a097329c26893673055cfb72a43e4c7 100644 +index d6605c15111dbdb6ee61a24822bc0a9aed7198d6..2f9cceaf189b7fe9271aeb8160abe2f284acaad8 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -@@ -86,6 +86,44 @@ public class Turtle extends Animal { +@@ -86,6 +86,48 @@ public class Turtle extends Animal { this.moveControl = new Turtle.TurtleMoveControl(this); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.turtleRidable; @@ -7879,67 +7972,71 @@ index d6605c15111dbdb6ee61a24822bc0a9aed7198d6..c9e307452a097329c26893673055cfb7 + public boolean isControllable() { + return level().purpurConfig.turtleControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.turtleMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.turtleScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.turtleBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.turtleTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.turtleAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience public void setHomePos(BlockPos pos) { this.entityData.set(Turtle.HOME_POS, pos); } -@@ -188,6 +226,7 @@ public class Turtle extends Animal { +@@ -188,6 +230,7 @@ public class Turtle extends Animal { @Override protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables 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)); -@@ -349,13 +388,15 @@ public class Turtle extends Animal { +@@ -349,13 +392,15 @@ public class Turtle extends Animal { return this.isBaby() ? Turtle.BABY_DIMENSIONS : super.getDefaultDimensions(pose); } - private static class TurtleMoveControl extends MoveControl { -+ private static class TurtleMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur ++ private static class TurtleMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur - Ridables private final Turtle turtle; -+ private final org.purpurmc.purpur.controller.WaterMoveControllerWASD waterController; // Purpur ++ private final org.purpurmc.purpur.controller.WaterMoveControllerWASD waterController; // Purpur - Ridables TurtleMoveControl(Turtle turtle) { super(turtle); this.turtle = turtle; -+ waterController = new org.purpurmc.purpur.controller.WaterMoveControllerWASD(turtle, 0.25D); // Purpur ++ waterController = new org.purpurmc.purpur.controller.WaterMoveControllerWASD(turtle, 0.25D); // Purpur - Ridables } private void updateSpeed() { -@@ -375,7 +416,7 @@ public class Turtle extends Animal { +@@ -375,7 +420,7 @@ public class Turtle extends Animal { } @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables this.updateSpeed(); if (this.operation == MoveControl.Operation.MOVE_TO && !this.turtle.getNavigation().isDone()) { double d0 = this.wantedX - this.turtle.getX(); -@@ -391,7 +432,7 @@ public class Turtle extends Animal { +@@ -391,7 +436,7 @@ public class Turtle extends Animal { this.turtle.setYRot(this.rotlerp(this.turtle.getYRot(), f, 90.0F)); this.turtle.yBodyRot = this.turtle.getYRot(); @@ -7961,14 +8058,14 @@ index 8c4532a250f8679d729a35c17e9b5bd339264450..2b8336bd88641cfb29e94c8f01abfbdb } } 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 c57fac6b5a17f39699298a58d9d25c12da929e64..15b655fa1d483e8e4154b7cdbb5338f134ab1741 100644 +index c57fac6b5a17f39699298a58d9d25c12da929e64..30b4c09c6046c1d0843ccb8e4ff326e189b6cb95 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java +++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java @@ -103,6 +103,37 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder entity instanceof net.minecraft.server.level.ServerPlayer || entity instanceof net.minecraft.world.entity.Mob; + private final net.minecraft.world.entity.ai.goal.Goal PATHFINDER_VANILLA = new NonTameRandomTargetGoal<>(this, Animal.class, false, PREY_SELECTOR); @@ -7998,15 +8095,15 @@ index c57fac6b5a17f39699298a58d9d25c12da929e64..15b655fa1d483e8e4154b7cdbb5338f1 + super.tick(); + } + } -+ // Purpur end ++ // Purpur end - Configurable chance for wolves to spawn rabid private static final float START_HEALTH = 8.0F; private static final float TAME_HEALTH = 40.0F; private static final float ARMOR_REPAIR_UNIT = 0.125F; -@@ -124,12 +155,87 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder(this, Llama.class, 24.0F, 1.5D, 1.5D)); -+ this.goalSelector.addGoal(3, new AvoidRabidWolfGoal(this, 24.0F, 1.5D, 1.5D)); // Purpur ++ this.goalSelector.addGoal(3, new AvoidRabidWolfGoal(this, 24.0F, 1.5D, 1.5D)); // Purpur - Configurable chance for wolves to spawn rabid this.goalSelector.addGoal(4, new LeapAtTargetGoal(this, 0.4F)); this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0D, true)); this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0D, 10.0F, 2.0F)); -@@ -138,11 +244,12 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR)); this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeleton.class, false)); this.targetSelector.addGoal(8, new ResetUniversalAngerTargetGoal<>(this, true)); -@@ -191,6 +298,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder { nbt.putString("variant", resourcekey.location().toString()); }); -@@ -208,6 +316,10 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.wolfNaturalRabid; + this.updatePathfinders(false); -+ // Purpur end -+ ++ // Purpur end - Configurable chance for wolves to spawn rabid return super.finalizeSpawn(world, difficulty, spawnReason, (SpawnGroupData) entityData); } -@@ -269,6 +387,11 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder type, Level world) { super(type, world); - this.moveControl = new FlyingMoveControl(this, 20, true); -+ // Purpur start ++ // Purpur start - Ridables + this.purpurController = new org.purpurmc.purpur.controller.FlyingMoveControllerWASD(this, 0.1F, 0.5F); + this.moveControl = new FlyingMoveControl(this, 20, true) { + @Override @@ -8203,15 +8303,15 @@ index b86f638390d386c838318a4d9b6571ac5514df8f..235596af3a4e210efe966782b29e2b1d + } + } + }; -+ // Purpur end ++ // Purpur end - Ridables this.setCanPickUpLoot(this.canPickUpLoot()); this.vibrationUser = new Allay.VibrationUser(); this.vibrationData = new VibrationSystem.Data(); -@@ -121,6 +134,34 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS +@@ -121,6 +134,35 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS } // CraftBukkit end -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.allayRidable; @@ -8229,20 +8329,21 @@ index b86f638390d386c838318a4d9b6571ac5514df8f..235596af3a4e210efe966782b29e2b1d + + @Override + protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.allayMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.allayScale); + } -+ // Purpur end -+ ++ // Purpur end - Configurable entity base attributes @Override protected Brain.Provider brainProvider() { return Brain.provider(Allay.MEMORY_TYPES, Allay.SENSOR_TYPES); -@@ -223,11 +264,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS +@@ -223,11 +265,13 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS return 0.4F; } @@ -8257,14 +8358,14 @@ index b86f638390d386c838318a4d9b6571ac5514df8f..235596af3a4e210efe966782b29e2b1d gameprofilerfiller.pop(); gameprofilerfiller.push("allayActivityUpdate"); diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java -index c1ef714096159608752d744b98f615cd45fe459a..9ef53608f1608e88de7a7b3e96b43d8d2b4230ae 100644 +index c1ef714096159608752d744b98f615cd45fe459a..30779f8a00d438972ad59372ce92e23193f99820 100644 --- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java +++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java -@@ -82,6 +82,34 @@ public class Armadillo extends Animal { +@@ -82,6 +82,36 @@ public class Armadillo extends Animal { return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 12.0D).add(Attributes.MOVEMENT_SPEED, 0.14D); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.armadilloRidable; @@ -8279,31 +8380,33 @@ index c1ef714096159608752d744b98f615cd45fe459a..9ef53608f1608e88de7a7b3e96b43d8d + public boolean isControllable() { + return level().purpurConfig.armadilloControllable; + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.armadilloMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.armadilloScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.armadilloBreedingTicks; + } -+ // Purpur end -+ ++ // Purpur end - Make entity breeding times configurable @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { super.defineSynchedData(builder); 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 31b10cd404b672d7ce21c2107d8f83e32de26ef4..155f03818d91dbd4ef9f5549784472f2bffca5d8 100644 +index 31b10cd404b672d7ce21c2107d8f83e32de26ef4..4bff73b108ba9d76409baeed7c26682868e5cc1a 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 -@@ -100,6 +100,44 @@ public class Axolotl extends Animal implements VariantHolder, B +@@ -100,6 +100,48 @@ public class Axolotl extends Animal implements VariantHolder, B this.lookControl = new Axolotl.AxolotlLookControl(this, 20); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.axolotlRidable; @@ -8316,35 +8419,39 @@ index 31b10cd404b672d7ce21c2107d8f83e32de26ef4..155f03818d91dbd4ef9f5549784472f2 + + @Override + protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.axolotlMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.axolotlScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.axolotlBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.axolotlTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.axolotlAlwaysDropExp; + } -+ // Purpur end -+ ++ // Purpur end - Mobs always drop experience @Override public float getWalkTargetValue(BlockPos pos, LevelReader world) { return 0.0F; -@@ -292,11 +330,13 @@ public class Axolotl extends Animal implements VariantHolder, B +@@ -292,11 +334,13 @@ public class Axolotl extends Animal implements VariantHolder, B return true; } @@ -8358,68 +8465,70 @@ index 31b10cd404b672d7ce21c2107d8f83e32de26ef4..155f03818d91dbd4ef9f5549784472f2 this.getBrain().tick(world, this); gameprofilerfiller.pop(); gameprofilerfiller.push("axolotlActivityUpdate"); -@@ -520,14 +560,22 @@ public class Axolotl extends Animal implements VariantHolder, B +@@ -520,14 +564,22 @@ public class Axolotl extends Animal implements VariantHolder, B private static class AxolotlMoveControl extends SmoothSwimmingMoveControl { private final Axolotl axolotl; -+ private final org.purpurmc.purpur.controller.WaterMoveControllerWASD waterController; // Purpur ++ private final org.purpurmc.purpur.controller.WaterMoveControllerWASD waterController; // Purpur - Ridables public AxolotlMoveControl(Axolotl axolotl) { super(axolotl, 85, 10, 0.1F, 0.5F, false); this.axolotl = axolotl; -+ waterController = new org.purpurmc.purpur.controller.WaterMoveControllerWASD(axolotl, 0.5D); // Purpur ++ waterController = new org.purpurmc.purpur.controller.WaterMoveControllerWASD(axolotl, 0.5D); // Purpur - Ridables } @Override public void tick() { -+ // Purpur start ++ // Purpur start - Ridables + if (axolotl.getRider() != null && axolotl.isControllable()) { + waterController.purpurTick(axolotl.getRider()); + return; + } -+ // Purpur end ++ // Purpur end - Ridables if (!this.axolotl.isPlayingDead()) { super.tick(); } -@@ -542,9 +590,9 @@ public class Axolotl extends Animal implements VariantHolder, B +@@ -542,9 +594,9 @@ public class Axolotl extends Animal implements VariantHolder, B } @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (!Axolotl.this.isPlayingDead()) { - super.tick(); -+ super.vanillaTick(); // Purpur ++ super.vanillaTick(); // Purpur - Ridables } } diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index f3c884ab9c09f04dd01cabf2ee9de3b5b620563d..dbce71f45c008da883b6d244a06343d83ae25e7e 100644 +index f3c884ab9c09f04dd01cabf2ee9de3b5b620563d..d0023e3734bb3c625fa53077f47039dcb82d9606 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -87,6 +87,17 @@ public class Camel extends AbstractHorse { +@@ -87,6 +87,19 @@ public class Camel extends AbstractHorse { navigation.setCanWalkOverFences(true); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean dismountsUnderwater() { + return level().purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level().purpurConfig.camelRidableInWater; + } ++ // Purpur end - Ridables + ++ // Purpur start - Make entity breeding times configurable ++ @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.camelBreedingTicks; + } -+ // Purpur end -+ ++ // Purpur end - Make entity breeding times configurable @Override public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); -@@ -314,6 +325,23 @@ public class Camel extends AbstractHorse { +@@ -314,6 +327,22 @@ public class Camel extends AbstractHorse { return this.dashCooldown; } -+ // Purpur start ++ // Purpur start - Configurable entity base attributes + @Override + public float generateMaxHealth(net.minecraft.util.RandomSource random) { + return (float) generateMaxHealth(this.level().purpurConfig.camelMaxHealthMin, this.level().purpurConfig.camelMaxHealthMax); @@ -8434,29 +8543,28 @@ index f3c884ab9c09f04dd01cabf2ee9de3b5b620563d..dbce71f45c008da883b6d244a06343d8 + public double generateSpeed(net.minecraft.util.RandomSource random) { + return generateSpeed(this.level().purpurConfig.camelMovementSpeedMin, this.level().purpurConfig.camelMovementSpeedMax); + } -+ // Purpur end -+ ++ // Purpur end - Configurable entity base attributes @Override protected SoundEvent getAmbientSound() { return SoundEvents.CAMEL_AMBIENT; diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index ca04e5d829331551a2c2f44e223ff05c6ce04e76..267f49bf00f5bbd5541e25c938f727a5bafd8eb2 100644 +index ca04e5d829331551a2c2f44e223ff05c6ce04e76..d09aa48e20c9a6e0d465b93e3759556638041394 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java @@ -106,6 +106,8 @@ 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 ++ private org.purpurmc.purpur.controller.MoveControllerWASD purpurLandController; // Purpur - Ridables ++ private org.purpurmc.purpur.controller.WaterMoveControllerWASD purpurWaterController; // Purpur - Ridables public Frog(EntityType type, Level world) { super(type, world); -@@ -113,6 +115,58 @@ public class Frog extends Animal implements VariantHolder> { +@@ -113,8 +115,62 @@ public class Frog extends Animal implements VariantHolder> { this.setPathfindingMalus(PathType.WATER, 4.0F); this.setPathfindingMalus(PathType.TRAPDOOR, -1.0F); this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02F, 0.1F, true); -+ // Purpur start ++ // Purpur start - Ridables + this.purpurLandController = new org.purpurmc.purpur.controller.MoveControllerWASD(this, 0.2F); + this.purpurWaterController = new org.purpurmc.purpur.controller.WaterMoveControllerWASD(this, 0.5F); + this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02F, 0.1F, true) { @@ -8475,10 +8583,10 @@ index ca04e5d829331551a2c2f44e223ff05c6ce04e76..267f49bf00f5bbd5541e25c938f727a5 + } + } + }; -+ // Purpur end ++ // Purpur end - Ridables + } + -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.frogRidable; @@ -8492,26 +8600,30 @@ index ca04e5d829331551a2c2f44e223ff05c6ce04e76..267f49bf00f5bbd5541e25c938f727a5 + @Override + public boolean isControllable() { + return level().purpurConfig.frogControllable; -+ } -+ + } + + @Override + protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables + } + + @Override + public float getJumpPower() { + return (getRider() != null && isControllable()) ? level().purpurConfig.frogRidableJumpHeight * this.getBlockJumpFactor() : super.getJumpPower(); + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Make entity breeding times configurable ++ @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.frogBreedingTicks; - } - ++ } ++ // Purpur end - Make entity breeding times configurable @Override -@@ -184,10 +238,12 @@ public class Frog extends Animal implements VariantHolder> { + protected Brain.Provider brainProvider() { + return Brain.provider(MEMORY_TYPES, SENSOR_TYPES); +@@ -184,10 +240,12 @@ public class Frog extends Animal implements VariantHolder> { .ifPresent(this::setVariant); } @@ -8524,29 +8636,29 @@ index ca04e5d829331551a2c2f44e223ff05c6ce04e76..267f49bf00f5bbd5541e25c938f727a5 this.getBrain().tick(world, this); profilerFiller.pop(); profilerFiller.push("frogActivityUpdate"); -@@ -384,7 +440,7 @@ public class Frog extends Animal implements VariantHolder> { +@@ -384,7 +442,7 @@ public class Frog extends Animal implements VariantHolder> { return world.getBlockState(pos.below()).is(BlockTags.FROGS_SPAWNABLE_ON) && isBrightEnoughToSpawn(world, pos); } - class FrogLookControl extends LookControl { -+ class FrogLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur ++ class FrogLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables FrogLookControl(final Mob entity) { 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 48ac8c3f6e00c3c2dc67b6c994be7c0ac6dfcf81..7e92e8c4fec36c8838604f17cf366cc80e82b19b 100644 +index 48ac8c3f6e00c3c2dc67b6c994be7c0ac6dfcf81..33429a9afeefce9238969b2894d0a9c033baca51 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 @@ -51,13 +51,50 @@ public class Tadpole extends AbstractFish { protected static final ImmutableList>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_PLAYERS, SensorType.HURT_BY, SensorType.FROG_TEMPTATIONS); protected static final ImmutableList> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.LOOK_TARGET, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.NEAREST_VISIBLE_ADULT, MemoryModuleType.TEMPTATION_COOLDOWN_TICKS, MemoryModuleType.IS_TEMPTED, MemoryModuleType.TEMPTING_PLAYER, MemoryModuleType.BREED_TARGET, MemoryModuleType.IS_PANICKING); public boolean ageLocked; // Paper -+ private org.purpurmc.purpur.controller.WaterMoveControllerWASD purpurController; // Purpur ++ private org.purpurmc.purpur.controller.WaterMoveControllerWASD purpurController; // Purpur - Ridables public Tadpole(EntityType type, Level world) { super(type, world); - this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02F, 0.1F, true); -+ // Purpur start ++ // Purpur start - Ridables + this.purpurController = new org.purpurmc.purpur.controller.WaterMoveControllerWASD(this, 0.5F); + this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02F, 0.1F, true) { + @Override @@ -8560,11 +8672,11 @@ index 48ac8c3f6e00c3c2dc67b6c994be7c0ac6dfcf81..7e92e8c4fec36c8838604f17cf366cc8 + } + } + }; -+ // Purpur end ++ // Purpur end - Ridables this.lookControl = new SmoothSwimmingLookControl(this, 10); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.tadpoleRidable; @@ -8582,9 +8694,9 @@ index 48ac8c3f6e00c3c2dc67b6c994be7c0ac6dfcf81..7e92e8c4fec36c8838604f17cf366cc8 + + @Override + protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables + } -+ // Purpur end ++ // Purpur end - Ridables + @Override protected PathNavigation createNavigation(Level world) { @@ -8604,14 +8716,14 @@ index 48ac8c3f6e00c3c2dc67b6c994be7c0ac6dfcf81..7e92e8c4fec36c8838604f17cf366cc8 gameprofilerfiller.pop(); gameprofilerfiller.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 76aca47d8638d5c37c57d3a59fa7f8ceaa5a53b4..d508cb2a61866c8fd7f381f8deb558ed86f7c845 100644 +index 76aca47d8638d5c37c57d3a59fa7f8ceaa5a53b4..9cd08bb4e9069bb2f701ef3825ba4c5af6f56790 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 -@@ -93,6 +93,38 @@ public class Goat extends Animal { +@@ -93,6 +93,41 @@ public class Goat extends Animal { }); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.goatRidable; @@ -8626,27 +8738,30 @@ index 76aca47d8638d5c37c57d3a59fa7f8ceaa5a53b4..d508cb2a61866c8fd7f381f8deb558ed + public boolean isControllable() { + return level().purpurConfig.goatControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.goatBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.goatTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.goatAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected Brain.Provider brainProvider() { return Brain.provider(Goat.MEMORY_TYPES, Goat.SENSOR_TYPES); -@@ -192,11 +224,13 @@ public class Goat extends Animal { +@@ -192,11 +227,13 @@ public class Goat extends Animal { return (Brain) super.getBrain(); // CraftBukkit - decompile error } @@ -8660,7 +8775,7 @@ index 76aca47d8638d5c37c57d3a59fa7f8ceaa5a53b4..d508cb2a61866c8fd7f381f8deb558ed this.getBrain().tick(world, this); gameprofilerfiller.pop(); gameprofilerfiller.push("goatActivityUpdate"); -@@ -399,6 +433,7 @@ public class Goat extends Animal { +@@ -399,6 +436,7 @@ public class Goat extends Animal { // Paper start - Goat ram API public void ram(net.minecraft.world.entity.LivingEntity entity) { @@ -8669,10 +8784,10 @@ index 76aca47d8638d5c37c57d3a59fa7f8ceaa5a53b4..d508cb2a61866c8fd7f381f8deb558ed 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 8aed30cdbbfdd42c20dcd4c8773c8a0ee21a980d..b258be16f32ffd58ac8406deac9423cb01ca9a5c 100644 +index 8aed30cdbbfdd42c20dcd4c8773c8a0ee21a980d..f58a0f50d04004587d342c1bb5f681cd485cf302 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 -@@ -228,11 +228,59 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -228,11 +228,60 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, protected AbstractHorse(EntityType type, Level world) { super(type, world); @@ -8681,13 +8796,14 @@ index 8aed30cdbbfdd42c20dcd4c8773c8a0ee21a980d..b258be16f32ffd58ac8406deac9423cb this.createInventory(); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return false; // vanilla handles + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.generateMaxHealth(random)); @@ -8725,45 +8841,46 @@ index 8aed30cdbbfdd42c20dcd4c8773c8a0ee21a980d..b258be16f32ffd58ac8406deac9423cb + protected double generateSpeed(RandomSource random) { + return (0.44999998807907104D + random.nextDouble() * 0.3D + random.nextDouble() * 0.3D + random.nextDouble() * 0.3D) * 0.25D; + } -+ ++ // Purpur end - Configurable entity base attributes @Override protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HorseHasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HorseHasRider(this)); // Purpur - Ridables 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)); -@@ -243,6 +291,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -243,6 +292,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, if (this.canPerformRearing()) { this.goalSelector.addGoal(9, new RandomStandGoal(this)); } -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HorseHasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HorseHasRider(this)); // Purpur - Ridables this.addBehaviourGoals(); } -@@ -1269,7 +1318,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -1269,7 +1319,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, entityData = new AgeableMob.AgeableMobGroupData(0.2F); } - this.randomizeAttributes(world.getRandom()); -+ // this.randomizeAttributes(world.getRandom()); // Purpur - replaced by initAttributes() ++ //this.randomizeAttributes(world.getRandom()); // Purpur - replaced by initAttributes() return super.finalizeSpawn(world, difficulty, spawnReason, (SpawnGroupData) entityData); } 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 5cafdde956d7a5b00cd5aec5c44849639307363d..dbf9fa551023cc9bf634fd5f5d504c4d689264cd 100644 +index 5cafdde956d7a5b00cd5aec5c44849639307363d..dc1ed34349a6d0d2f233d35a81f2c28e32b10210 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 -@@ -16,6 +16,43 @@ public class Donkey extends AbstractChestedHorse { +@@ -16,6 +16,47 @@ public class Donkey extends AbstractChestedHorse { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean dismountsUnderwater() { + return level().purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level().purpurConfig.donkeyRidableInWater; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public float generateMaxHealth(net.minecraft.util.RandomSource random) { + return (float) generateMaxHealth(this.level().purpurConfig.donkeyMaxHealthMin, this.level().purpurConfig.donkeyMaxHealthMax); @@ -8778,40 +8895,44 @@ index 5cafdde956d7a5b00cd5aec5c44849639307363d..dbf9fa551023cc9bf634fd5f5d504c4d + public double generateSpeed(net.minecraft.util.RandomSource random) { + return generateSpeed(this.level().purpurConfig.donkeyMovementSpeedMin, this.level().purpurConfig.donkeyMovementSpeedMax); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.donkeyBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.donkeyTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.donkeyAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override 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 b5ec7c8ad0e482930d1a54b590b26093f4e477ea..780cad91fff78bda6264cfd78ff7a408a79e8a2f 100644 +index b5ec7c8ad0e482930d1a54b590b26093f4e477ea..b39cbc42acacdedecfc996dbe25b3773a9fae8b2 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 -@@ -43,6 +43,43 @@ public class Horse extends AbstractHorse implements VariantHolder { +@@ -43,6 +43,47 @@ public class Horse extends AbstractHorse implements VariantHolder { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean dismountsUnderwater() { + return level().purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level().purpurConfig.horseRidableInWater; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public float generateMaxHealth(RandomSource random) { + return (float) generateMaxHealth(this.level().purpurConfig.horseMaxHealthMin, this.level().purpurConfig.horseMaxHealthMax); @@ -8826,30 +8947,33 @@ index b5ec7c8ad0e482930d1a54b590b26093f4e477ea..780cad91fff78bda6264cfd78ff7a408 + public double generateSpeed(RandomSource random) { + return generateSpeed(this.level().purpurConfig.horseMovementSpeedMin, this.level().purpurConfig.horseMovementSpeedMax); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.horseBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.horseTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.horseAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void randomizeAttributes(RandomSource 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 18bd483fe46de3d9dc129bffbccfba9d4cab9550..8401c7ae749f6300281cbd6b2bfc77f03d5eb9ea 100644 +index 18bd483fe46de3d9dc129bffbccfba9d4cab9550..3c265a80f55eee38406066cd02460b18fbac896d 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 -@@ -72,11 +72,86 @@ public class Llama extends AbstractChestedHorse implements VariantHolder DATA_SHOW_BOTTOM = SynchedEntityData.defineId(EndCrystal.class, EntityDataSerializers.BOOLEAN); public int time; public boolean generatedByDragonFight = false; // Paper - Fix invulnerable end crystals -+ // Purpur start ++ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms + private net.minecraft.world.entity.monster.Phantom targetPhantom; + private int phantomBeamTicks = 0; + private int phantomDamageCooldown = 0; + private int idleCooldown = 0; -+ // Purpur end ++ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms public EndCrystal(EntityType type, Level world) { super(type, world); @@ -9317,7 +9465,7 @@ index 7cb3d69a69e0e3ef4b7f9f9c8b1eb67edb5d116d..b1db1e92de3a88a0f0e0fdb42b0bf973 + 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 ++ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms + if (level().purpurConfig.phantomAttackedByCrystalRadius <= 0 || --idleCooldown > 0) { + return; // on cooldown + } @@ -9359,7 +9507,7 @@ index 7cb3d69a69e0e3ef4b7f9f9c8b1eb67edb5d116d..b1db1e92de3a88a0f0e0fdb42b0bf973 + phantomBeamTicks = 0; + phantomDamageCooldown = 0; + idleCooldown = 60; -+ // Purpur end ++ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms } @Override @@ -9385,14 +9533,14 @@ index 7cb3d69a69e0e3ef4b7f9f9c8b1eb67edb5d116d..b1db1e92de3a88a0f0e0fdb42b0bf973 this.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause } 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 d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..eff4424fa9cbea4358c8d8cd4d20c53182f5179e 100644 +index d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..d3721fcd9a537ad1e3c5712cd78bd436ac3e1a8b 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 @@ -108,6 +108,7 @@ public class EnderDragon extends Mob implements Enemy { @Nullable private BlockPos podium; // Paper end - Allow changing the EnderDragon podium -+ private boolean hadRider; // Purpur ++ private boolean hadRider; // Purpur - Ridables public EnderDragon(EntityType entitytypes, Level world) { super(EntityType.ENDER_DRAGON, world); @@ -9401,7 +9549,7 @@ index d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..eff4424fa9cbea4358c8d8cd4d20c531 this.phaseManager = new EnderDragonPhaseManager(this); this.explosionSource = new ServerExplosion(world.getMinecraftWorld(), this, null, null, new Vec3(Double.NaN, Double.NaN, Double.NaN), Float.NaN, true, Explosion.BlockInteraction.DESTROY); // CraftBukkit + -+ // Purpur start ++ // Purpur start - Ridables + this.moveControl = new org.purpurmc.purpur.controller.FlyingMoveControllerWASD(this) { + @Override + public void vanillaTick() { @@ -9419,10 +9567,10 @@ index d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..eff4424fa9cbea4358c8d8cd4d20c531 + setYawPitch(rider.getYRot() - 180F, rider.xRotO * 0.5F); + } + }; -+ // Purpur end ++ // Purpur end - Ridables + } + -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.enderDragonRidable; @@ -9434,7 +9582,7 @@ index d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..eff4424fa9cbea4358c8d8cd4d20c531 } public void setDragonFight(EndDragonFight fight) { -@@ -143,6 +175,27 @@ public class EnderDragon extends Mob implements Enemy { +@@ -143,6 +175,29 @@ public class EnderDragon extends Mob implements Enemy { return this.fightOrigin; } @@ -9447,26 +9595,28 @@ index d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..eff4424fa9cbea4358c8d8cd4d20c531 + public double getMaxY() { + return level().purpurConfig.enderDragonMaxY; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.enderDragonMaxHealth); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.enderDragonTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage public static AttributeSupplier.Builder createAttributes() { return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 200.0D); } -@@ -184,6 +237,37 @@ public class EnderDragon extends Mob implements Enemy { +@@ -184,6 +239,37 @@ public class EnderDragon extends Mob implements Enemy { @Override public void aiStep() { -+ // Purpur start ++ // Purpur start - Ridables + boolean hasRider = getRider() != null && this.isControllable(); + if (hasRider) { + if (!hadRider) { @@ -9495,69 +9645,69 @@ index d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..eff4424fa9cbea4358c8d8cd4d20c531 + this.dimensions = net.minecraft.world.entity.EntityDimensions.scalable(16.0F, 8.0F); + phaseManager.setPhase(EnderDragonPhase.HOLDING_PATTERN); // HoldingPattern + } -+ // Purpur end ++ // Purpur end - Ridables + this.processFlappingMovement(); if (this.level().isClientSide) { this.setHealth(this.getHealth()); -@@ -210,6 +294,8 @@ public class EnderDragon extends Mob implements Enemy { +@@ -210,6 +296,8 @@ public class EnderDragon extends Mob implements Enemy { float f; if (this.isDeadOrDying()) { -+ if (hasRider) ejectPassengers(); // Purpur ++ if (hasRider) ejectPassengers(); // Purpur - Ridables + float f1 = (this.random.nextFloat() - 0.5F) * 8.0F; f = (this.random.nextFloat() - 0.5F) * 4.0F; -@@ -222,9 +308,9 @@ public class EnderDragon extends Mob implements Enemy { +@@ -222,9 +310,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); - if (this.phaseManager.getCurrentPhase().isSitting()) { -+ if (!hasRider && this.phaseManager.getCurrentPhase().isSitting()) { // Purpur ++ if (!hasRider && this.phaseManager.getCurrentPhase().isSitting()) { // Purpur - Ridables this.flapTime += 0.1F; - } else if (this.inWall) { -+ } else if (!hasRider && this.inWall) { // Purpur ++ } else if (!hasRider && this.inWall) { // Purpur - Ridables this.flapTime += f * 0.5F; } else { this.flapTime += f; -@@ -240,7 +326,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -240,7 +328,7 @@ public class EnderDragon extends Mob implements Enemy { float f4; float f5; - if (world1 instanceof ServerLevel) { -+ if (world1 instanceof ServerLevel && !hasRider) { // Purpur ++ if (world1 instanceof ServerLevel && !hasRider) { // Purpur - Ridables ServerLevel worldserver1 = (ServerLevel) world1; DragonPhaseInstance idragoncontroller = this.phaseManager.getCurrentPhase(); -@@ -326,7 +412,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -326,7 +414,7 @@ public class EnderDragon extends Mob implements Enemy { if (world2 instanceof ServerLevel) { ServerLevel worldserver2 = (ServerLevel) world2; - if (this.hurtTime == 0) { -+ if (!hasRider && this.hurtTime == 0) { // Purpur ++ if (!hasRider && this.hurtTime == 0) { // Purpur - Ridables this.knockBack(worldserver2, worldserver2.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(worldserver2, worldserver2.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(worldserver2, worldserver2.getEntities((Entity) this, this.head.getBoundingBox().inflate(1.0D), EntitySelector.NO_CREATIVE_OR_SPECTATOR)); -@@ -374,7 +460,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -374,7 +462,7 @@ public class EnderDragon extends Mob implements Enemy { if (world3 instanceof ServerLevel) { ServerLevel worldserver3 = (ServerLevel) world3; - this.inWall = this.checkWalls(worldserver3, this.head.getBoundingBox()) | this.checkWalls(worldserver3, this.neck.getBoundingBox()) | this.checkWalls(worldserver3, this.body.getBoundingBox()); -+ this.inWall = !hasRider && this.checkWalls(worldserver3, this.head.getBoundingBox()) | this.checkWalls(worldserver3, this.neck.getBoundingBox()) | this.checkWalls(worldserver3, this.body.getBoundingBox()); // Purpur ++ this.inWall = !hasRider && this.checkWalls(worldserver3, this.head.getBoundingBox()) | this.checkWalls(worldserver3, this.neck.getBoundingBox()) | this.checkWalls(worldserver3, this.body.getBoundingBox()); // Purpur - Ridables if (this.dragonFight != null) { this.dragonFight.updateDragon(this); } -@@ -510,7 +596,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -510,7 +598,7 @@ public class EnderDragon extends Mob implements Enemy { BlockState iblockdata = world.getBlockState(blockposition); if (!iblockdata.isAir() && !iblockdata.is(BlockTags.DRAGON_TRANSPARENT)) { - if (world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && !iblockdata.is(BlockTags.DRAGON_IMMUNE)) { -+ if ((world.purpurConfig.enderDragonBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && !iblockdata.is(BlockTags.DRAGON_IMMUNE)) { // Purpur ++ if ((world.purpurConfig.enderDragonBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && !iblockdata.is(BlockTags.DRAGON_IMMUNE)) { // Purpur - Add mobGriefing bypass to everything affected // CraftBukkit start - Add blocks to list rather than destroying them // flag1 = worldserver.removeBlock(blockposition, false) || flag1; flag1 = true; -@@ -651,7 +737,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -651,7 +739,7 @@ public class EnderDragon extends Mob implements Enemy { boolean flag = worldserver.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT); short short0 = 500; @@ -9566,7 +9716,7 @@ index d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..eff4424fa9cbea4358c8d8cd4d20c531 short0 = 12000; } -@@ -1083,6 +1169,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1083,6 +1171,7 @@ public class EnderDragon extends Mob implements Enemy { @Override protected boolean canRide(Entity entity) { @@ -9574,36 +9724,36 @@ index d5fc74dbc2c5f6b65fee46e7797b151144c8fd41..eff4424fa9cbea4358c8d8cd4d20c531 return false; } -@@ -1109,6 +1196,6 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1109,6 +1198,6 @@ public class EnderDragon extends Mob implements Enemy { @Override protected float sanitizeScale(float scale) { - return 1.0F; -+ return 1.0F; // Purpur - diff on change ++ return 1.0F; // Purpur - Configurable entity base attributes } } 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 bd9e10f79eaf0d23908229b3ebc2227946a14843..a671d18a354421f197e5248a16bfe9a12c5befe4 100644 +index bd9e10f79eaf0d23908229b3ebc2227946a14843..505c84731b4731588b4568d82a852a17121e5ec8 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 -@@ -86,20 +86,60 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -86,20 +86,63 @@ public class WitherBoss extends Monster implements RangedAttackMob { return !entityliving.getType().is(EntityTypeTags.WITHER_FRIENDS) && entityliving.attackable(); }; private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0D).selector(WitherBoss.LIVING_ENTITY_SELECTOR); -+ @Nullable private java.util.UUID summoner; // Purpur -+ private int shootCooldown = 0; // Purpur ++ private int shootCooldown = 0; // Purpur - Ridables ++ @Nullable private java.util.UUID summoner; // Purpur - Summoner API // Paper start private boolean canPortal = false; public void setCanTravelThroughPortals(boolean canPortal) { this.canPortal = canPortal; } // Paper end -+ private org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD purpurController; // Purpur ++ private org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD purpurController; // Purpur - Ridables public WitherBoss(EntityType type, Level world) { super(type, world); this.bossEvent = (ServerBossEvent) (new ServerBossEvent(this.getDisplayName(), BossEvent.BossBarColor.PURPLE, BossEvent.BossBarOverlay.PROGRESS)).setDarkenScreen(true); - this.moveControl = new FlyingMoveControl(this, 10, false); -+ // Purpur start ++ // Purpur start - Ridables + this.purpurController = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.1F); + this.moveControl = new FlyingMoveControl(this, 10, false) { + @Override @@ -9615,44 +9765,47 @@ index bd9e10f79eaf0d23908229b3ebc2227946a14843..a671d18a354421f197e5248a16bfe9a1 + } + } + }; -+ // Purpur end ++ // Purpur end - Ridables this.setHealth(this.getMaxHealth()); this.xpReward = 50; } - ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.witherMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.witherScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.witherTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Summoner API + @Nullable + public java.util.UUID getSummoner() { + return summoner; + } -+ + + public void setSummoner(@Nullable java.util.UUID summoner) { + this.summoner = summoner; + } -+ ++ // Purpur end - Summoner API ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.witherAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected PathNavigation createNavigation(Level world) { FlyingPathNavigation navigationflying = new FlyingPathNavigation(this, world); -@@ -109,13 +149,114 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -109,13 +152,114 @@ public class WitherBoss extends Monster implements RangedAttackMob { return navigationflying; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.witherRidable; @@ -9749,37 +9902,37 @@ index bd9e10f79eaf0d23908229b3ebc2227946a14843..a671d18a354421f197e5248a16bfe9a1 + skull.setPosRaw(headX, headY, headZ); + level().addFreshEntity(skull); + } -+ // Purpur end ++ // Purpur end - Ridables + @Override protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(0, new WitherBoss.WitherDoNothingGoal()); this.goalSelector.addGoal(2, new RangedAttackGoal(this, 1.0D, 40, 20.0F)); this.goalSelector.addGoal(5, new WaterAvoidingRandomFlyingGoal(this, 1.0D)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(7, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables 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)); } -@@ -133,6 +274,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -133,6 +277,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); nbt.putInt("Invul", this.getInvulnerableTicks()); -+ if (getSummoner() != null) nbt.putUUID("Purpur.Summoner", getSummoner()); // Purpur ++ if (getSummoner() != null) nbt.putUUID("Purpur.Summoner", getSummoner()); // Purpur - Summoner API } @Override -@@ -142,6 +284,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -142,6 +287,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { if (this.hasCustomName()) { this.bossEvent.setName(this.getDisplayName()); } -+ if (nbt.contains("Purpur.Summoner")) setSummoner(nbt.getUUID("Purpur.Summoner")); // Purpur ++ if (nbt.contains("Purpur.Summoner")) setSummoner(nbt.getUUID("Purpur.Summoner")); // Purpur - Summoner API } -@@ -151,6 +294,13 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -151,6 +297,13 @@ public class WitherBoss extends Monster implements RangedAttackMob { this.bossEvent.setName(this.getDisplayName()); } @@ -9793,11 +9946,11 @@ index bd9e10f79eaf0d23908229b3ebc2227946a14843..a671d18a354421f197e5248a16bfe9a1 @Override protected SoundEvent getAmbientSound() { return SoundEvents.WITHER_AMBIENT; -@@ -260,6 +410,15 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -260,6 +413,15 @@ public class WitherBoss extends Monster implements RangedAttackMob { @Override protected void customServerAiStep(ServerLevel world) { -+ // Purpur start ++ // Purpur start - Ridables + if (getRider() != null && this.isControllable()) { + Vec3 mot = getDeltaMovement(); + setDeltaMovement(mot.x(), mot.y() + (getVerticalMot() > 0 ? 0.07D : 0.0D), mot.z()); @@ -9805,11 +9958,11 @@ index bd9e10f79eaf0d23908229b3ebc2227946a14843..a671d18a354421f197e5248a16bfe9a1 + if (shootCooldown > 0) { + shootCooldown--; + } -+ // Purpur end ++ // Purpur end - Ridables int i; if (this.getInvulnerableTicks() > 0) { -@@ -276,7 +435,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -276,7 +438,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { } // CraftBukkit end @@ -9818,25 +9971,25 @@ index bd9e10f79eaf0d23908229b3ebc2227946a14843..a671d18a354421f197e5248a16bfe9a1 // CraftBukkit start - Use relative location for far away sounds // worldserver.globalLevelEvent(1023, new BlockPosition(this), 0); int viewDistance = world.getCraftServer().getViewDistance() * 16; -@@ -301,7 +460,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -301,7 +463,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { this.setInvulnerableTicks(i); if (this.tickCount % 10 == 0) { - this.heal(10.0F, EntityRegainHealthEvent.RegainReason.WITHER_SPAWN); // CraftBukkit -+ this.heal(this.getMaxHealth() / 33, EntityRegainHealthEvent.RegainReason.WITHER_SPAWN); // CraftBukkit // Purpur ++ this.heal(this.getMaxHealth() / 33, EntityRegainHealthEvent.RegainReason.WITHER_SPAWN); // CraftBukkit // Purpur - Configurable entity base attributes } } else { -@@ -361,7 +520,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -361,7 +523,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { if (this.destroyBlocksTick > 0) { --this.destroyBlocksTick; - if (this.destroyBlocksTick == 0 && world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (this.destroyBlocksTick == 0 && (world.purpurConfig.witherBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // Purpur ++ if (this.destroyBlocksTick == 0 && (world.purpurConfig.witherBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // Purpur - Add mobGriefing bypass to everything affected boolean flag = false; j = Mth.floor(this.getBbWidth() / 2.0F + 1.0F); -@@ -388,8 +547,10 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -388,8 +550,10 @@ public class WitherBoss extends Monster implements RangedAttackMob { } } @@ -9849,21 +10002,21 @@ index bd9e10f79eaf0d23908229b3ebc2227946a14843..a671d18a354421f197e5248a16bfe9a1 } this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth()); -@@ -578,11 +739,11 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -578,11 +742,11 @@ public class WitherBoss extends Monster implements RangedAttackMob { } public int getAlternativeTarget(int headIndex) { - return (Integer) this.entityData.get((EntityDataAccessor) WitherBoss.DATA_TARGETS.get(headIndex)); -+ return getRider() != null && this.isControllable() ? 0 : this.entityData.get(WitherBoss.DATA_TARGETS.get(headIndex)); // Purpur ++ return getRider() != null && this.isControllable() ? 0 : this.entityData.get(WitherBoss.DATA_TARGETS.get(headIndex)); // Purpur - Ridables } public void setAlternativeTarget(int headIndex, int id) { - this.entityData.set((EntityDataAccessor) WitherBoss.DATA_TARGETS.get(headIndex), id); -+ if (getRider() == null || !this.isControllable()) this.entityData.set(WitherBoss.DATA_TARGETS.get(headIndex), id); // Purpur ++ if (getRider() == null || !this.isControllable()) this.entityData.set(WitherBoss.DATA_TARGETS.get(headIndex), id); // Purpur - Ridables } public boolean isPowered() { -@@ -591,6 +752,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -591,6 +755,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { @Override protected boolean canRide(Entity entity) { @@ -9872,19 +10025,19 @@ index bd9e10f79eaf0d23908229b3ebc2227946a14843..a671d18a354421f197e5248a16bfe9a1 } 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 70b8023c3badc745f342d5b0ab54699e3923826a..037586c0fdb42a02660aba89dd741a647c67e52b 100644 +index 70b8023c3badc745f342d5b0ab54699e3923826a..572bb7e1f6ae75f6dfe53b0e100b3654e42bf4c2 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java @@ -114,10 +114,12 @@ public class ArmorStand extends LivingEntity { private boolean noTickPoseDirty = false; private boolean noTickEquipmentDirty = false; // Paper end - Allow ArmorStands not to tick -+ public boolean canMovementTick = true; // Purpur ++ public boolean canMovementTick = true; // Purpur - Movement options for armor stands public ArmorStand(EntityType type, Level world) { super(type, world); if (world != null) this.canTick = world.paperConfig().entities.armorStands.tick; // Paper - Allow ArmorStands not to tick -+ if (world != null) this.canMovementTick = world.purpurConfig.armorstandMovement; // Purpur ++ if (world != null) this.canMovementTick = world.purpurConfig.armorstandMovement; // Purpur - Movement options for armor stands this.handItems = NonNullList.withSize(2, ItemStack.EMPTY); this.armorItems = NonNullList.withSize(4, ItemStack.EMPTY); this.headPose = ArmorStand.DEFAULT_HEAD_POSE; @@ -9917,7 +10070,7 @@ index 70b8023c3badc745f342d5b0ab54699e3923826a..037586c0fdb42a02660aba89dd741a64 } // Paper end + -+ // Purpur start ++ // Purpur start - Movement options for armor stands + @Override + public void updateInWaterStateAndDoWaterCurrentPushing() { + if (this.level().purpurConfig.armorstandWaterMovement && @@ -9929,7 +10082,7 @@ index 70b8023c3badc745f342d5b0ab54699e3923826a..037586c0fdb42a02660aba89dd741a64 + public void aiStep() { + if (this.canMovementTick && this.canMove) super.aiStep(); + } -+ // Purpur end ++ // Purpur end - Movement options for armor stands } 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 7d83ad8a61f6aafbc063506c1858554f9b700b70..fd1bd4fb88d1bd4a0734db463dc1be640c736d34 100644 @@ -9970,19 +10123,19 @@ index fd0e78a2318e3950d011c17358245e107b38154a..0fcab828e81176323cbdf16c0ec714d9 } 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 0f086af57a5ff08c264dcbf89a8c3931ec73a609..c63cf322e0d00b5ec9929db8c22d4a392049160f 100644 +index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..09403344ad63c538a2a221c6b726ebab1aab5642 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java @@ -64,6 +64,12 @@ public class ItemEntity extends Entity implements TraceableEntity { public boolean canMobPickup = true; // Paper - Item#canEntityPickup private int despawnRate = -1; // Paper - Alternative item-despawn-rate public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API -+ // Purpur start ++ // Purpur start - Item entity immunities + public boolean immuneToCactus = false; + public boolean immuneToExplosion = false; + public boolean immuneToFire = false; + public boolean immuneToLightning = false; -+ // Purpur end ++ // Purpur end - Item entity immunities public ItemEntity(EntityType type, Level world) { super(type, world); @@ -9991,7 +10144,7 @@ index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..c63cf322e0d00b5ec9929db8c22d4a39 @Override public final boolean hurtServer(ServerLevel world, DamageSource source, float amount) { - if (this.isInvulnerableToBase(source)) { -+ // Purpur start ++ // Purpur start - Item entity immunities + if ( + (immuneToCactus && source.is(net.minecraft.world.damagesource.DamageTypes.CACTUS)) || + (immuneToFire && (source.is(net.minecraft.tags.DamageTypeTags.IS_FIRE) || source.is(net.minecraft.world.damagesource.DamageTypes.ON_FIRE) || source.is(net.minecraft.world.damagesource.DamageTypes.IN_FIRE))) || @@ -10000,7 +10153,7 @@ index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..c63cf322e0d00b5ec9929db8c22d4a39 + ) { + return false; + } else if (this.isInvulnerableToBase(source)) { -+ // Purpur end ++ // Purpur end - Item entity immunities return false; } else if (!world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && source.getEntity() instanceof Mob) { return false; @@ -10008,12 +10161,12 @@ index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..c63cf322e0d00b5ec9929db8c22d4a39 public void setItem(ItemStack stack) { this.getEntityData().set(ItemEntity.DATA_ITEM, stack); this.despawnRate = this.level().paperConfig().entities.spawning.altItemDespawnRate.enabled ? this.level().paperConfig().entities.spawning.altItemDespawnRate.items.getOrDefault(stack.getItem(), this.level().spigotConfig.itemDespawnRate) : this.level().spigotConfig.itemDespawnRate; // Paper - Alternative item-despawn-rate -+ // Purpur start ++ // Purpur start - Item entity immunities + if (level().purpurConfig.itemImmuneToCactus.contains(stack.getItem())) immuneToCactus = true; + if (level().purpurConfig.itemImmuneToExplosion.contains(stack.getItem())) immuneToExplosion = true; + if (level().purpurConfig.itemImmuneToFire.contains(stack.getItem())) immuneToFire = true; + if (level().purpurConfig.itemImmuneToLightning.contains(stack.getItem())) immuneToLightning = true; -+ // level end ++ // level end - Item entity immunities } @Override @@ -10054,7 +10207,7 @@ index 809f5e847e2f5bb594c130cebd2cb897ea768d82..6f1e21d6c104d71fe4fc3376ed2f2273 + // Purpur end - Shears can defuse TNT } 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 90b6ed81dcfd4021c7e9509da5e8725034fa07e5..0235488faee8078186fbb78038789da0846aca29 100644 +index 90b6ed81dcfd4021c7e9509da5e8725034fa07e5..26b64d83b7466863b7340c3292494091e9fb89c1 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java @@ -70,16 +70,19 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -10066,14 +10219,14 @@ index 90b6ed81dcfd4021c7e9509da5e8725034fa07e5..0235488faee8078186fbb78038789da0 @Override protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(2, new RestrictSunGoal(this)); this.goalSelector.addGoal(3, new FleeSunGoal(this, 1.0D)); this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Wolf.class, 6.0F, 1.0D, 1.2D)); this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(6, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables 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)); @@ -10158,23 +10311,23 @@ index 90b6ed81dcfd4021c7e9509da5e8725034fa07e5..0235488faee8078186fbb78038789da0 // Paper end - shouldBurnInDay API 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 e33fa82ca1332b95bb067fd621212d3026eee1b7..07db4557ab0d7a4a0f5432257bd18195d2de7255 100644 +index e33fa82ca1332b95bb067fd621212d3026eee1b7..000d18bdcc2d26b7cc175c4f72e32ac7a882f2a6 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Blaze.java +++ b/src/main/java/net/minecraft/world/entity/monster/Blaze.java -@@ -33,26 +33,74 @@ public class Blaze extends Monster { +@@ -33,26 +33,76 @@ public class Blaze extends Monster { public Blaze(EntityType type, Level world) { super(type, world); - this.setPathfindingMalus(PathType.WATER, -1.0F); -+ this.moveControl = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.3F); // Purpur -+ if (isSensitiveToWater()) this.setPathfindingMalus(PathType.WATER, -1.0F); // Purpur ++ this.moveControl = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.3F); // Purpur - Ridables ++ if (isSensitiveToWater()) this.setPathfindingMalus(PathType.WATER, -1.0F); // Purpur - Toggle for water sensitive mob damage this.setPathfindingMalus(PathType.LAVA, 8.0F); this.setPathfindingMalus(PathType.DANGER_FIRE, 0.0F); this.setPathfindingMalus(PathType.DAMAGE_FIRE, 0.0F); this.xpReward = 10; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.blazeRidable; @@ -10206,67 +10359,69 @@ index e33fa82ca1332b95bb067fd621212d3026eee1b7..07db4557ab0d7a4a0f5432257bd18195 + setDeltaMovement(mot.scale(0.9D)); + } + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.blazeMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.blazeScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.blazeAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(4, new Blaze.BlazeAttackGoal(this)); this.goalSelector.addGoal(5, new MoveTowardsRestrictionGoal(this, 1.0)); this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0, 0.0F)); this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers()); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); } public static AttributeSupplier.Builder createAttributes() { - return Monster.createMonsterAttributes().add(Attributes.ATTACK_DAMAGE, 6.0).add(Attributes.MOVEMENT_SPEED, 0.23F).add(Attributes.FOLLOW_RANGE, 48.0); -+ return Monster.createMonsterAttributes().add(Attributes.ATTACK_DAMAGE, 6.0).add(Attributes.MOVEMENT_SPEED, 0.23F).add(Attributes.FOLLOW_RANGE, 48.0).add(Attributes.FLYING_SPEED, 0.6D); // Purpur ++ return Monster.createMonsterAttributes().add(Attributes.ATTACK_DAMAGE, 6.0).add(Attributes.MOVEMENT_SPEED, 0.23F).add(Attributes.FOLLOW_RANGE, 48.0).add(Attributes.FLYING_SPEED, 0.6D); // Purpur - Ridables } @Override -@@ -112,11 +160,18 @@ public class Blaze extends Monster { +@@ -112,11 +162,18 @@ public class Blaze extends Monster { @Override public boolean isSensitiveToWater() { - return true; -+ return this.level().purpurConfig.blazeTakeDamageFromWater; // Purpur ++ return this.level().purpurConfig.blazeTakeDamageFromWater; // Purpur - Toggle for water sensitive mob damage } @Override protected void customServerAiStep(ServerLevel world) { -+ // Purpur start ++ // Purpur start - Ridables + if (getRider() != null && this.isControllable()) { + Vec3 mot = getDeltaMovement(); + setDeltaMovement(mot.x(), getVerticalMot() > 0 ? 0.07D : -0.07D, mot.z()); + return; + } -+ // Purpur end ++ // Purpur end - Ridables this.nextHeightOffsetChangeTick--; if (this.nextHeightOffsetChangeTick <= 0) { this.nextHeightOffsetChangeTick = 100; diff --git a/src/main/java/net/minecraft/world/entity/monster/Bogged.java b/src/main/java/net/minecraft/world/entity/monster/Bogged.java -index 975477663b6d76a69c006a89e440e21471b39b89..ca63ab37bc6b5b4cb5abf2848dae476b5d937f2a 100644 +index 975477663b6d76a69c006a89e440e21471b39b89..ab6e71f0e32070b67d65645981c71da675b1ae80 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Bogged.java +++ b/src/main/java/net/minecraft/world/entity/monster/Bogged.java -@@ -44,6 +44,29 @@ public class Bogged extends AbstractSkeleton implements Shearable { +@@ -44,6 +44,30 @@ public class Bogged extends AbstractSkeleton implements Shearable { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.boggedRidable; @@ -10281,26 +10436,27 @@ index 975477663b6d76a69c006a89e440e21471b39b89..ca63ab37bc6b5b4cb5abf2848dae476b + public boolean isControllable() { + return level().purpurConfig.boggedControllable; + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.boggedMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.boggedScale); + } -+ // Purpur end -+ ++ // Purpur end - Configurable entity base attributes @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { super.defineSynchedData(builder); 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 4e621a7f36b3d718695434a2a4e3060283667bb2..9a274b83a3a7726cac421856dbc7be01de45d29b 100644 +index 4e621a7f36b3d718695434a2a4e3060283667bb2..f34880530a5220b2ef73a2e4fad39445bbad73dd 100644 --- a/src/main/java/net/minecraft/world/entity/monster/CaveSpider.java +++ b/src/main/java/net/minecraft/world/entity/monster/CaveSpider.java -@@ -27,6 +27,39 @@ public class CaveSpider extends Spider { +@@ -27,6 +27,42 @@ public class CaveSpider extends Spider { return Spider.createAttributes().add(Attributes.MAX_HEALTH, 12.0D); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.caveSpiderRidable; @@ -10315,47 +10471,50 @@ index 4e621a7f36b3d718695434a2a4e3060283667bb2..9a274b83a3a7726cac421856dbc7be01 + public boolean isControllable() { + return level().purpurConfig.caveSpiderControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.caveSpiderMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.caveSpiderScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.caveSpiderTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.caveSpiderAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override public boolean doHurtTarget(ServerLevel world, Entity target) { if (super.doHurtTarget(world, 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 1906dfc22af208d6e801ad4a8f2f9e9702432691..38cbe2fce9c36195aa9bea2af26d14364b216825 100644 +index 1906dfc22af208d6e801ad4a8f2f9e9702432691..b87a961c1f69f0cf51d8e1e462915234ee74d0a9 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java +++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java -@@ -60,21 +60,99 @@ public class Creeper extends Monster { +@@ -60,21 +60,106 @@ public class Creeper extends Monster { public int explosionRadius = 3; private int droppedSkulls; public Entity entityIgniter; // CraftBukkit -+ // Purpur start ++ // Purpur start - Ridables + private int spacebarCharge = 0; + private int prevSpacebarCharge = 0; + private int powerToggleDelay = 0; -+ // Purpur end ++ // Purpur end - Ridables + private boolean exploding = false; // Purpur - Config to make Creepers explode on death public Creeper(EntityType type, Level world) { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.creeperRidable; @@ -10423,33 +10582,35 @@ index 1906dfc22af208d6e801ad4a8f2f9e9702432691..38cbe2fce9c36195aa9bea2af26d1436 + } + return getForwardMot() == 0 && getStrafeMot() == 0; // do not jump if standing still + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes ++ @Override ++ public void initAttributes() { ++ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.creeperMaxHealth); ++ this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.creeperScale); ++ } ++ // Purpur end - Configurable entity base attributes @Override protected void registerGoals() { this.goalSelector.addGoal(1, new FloatGoal(this)); this.goalSelector.addGoal(2, new SwellGoal(this)); -+ this.goalSelector.addGoal(3, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(3, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Ocelot.class, 6.0F, 1.0D, 1.2D)); this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Cat.class, 6.0F, 1.0D, 1.2D)); this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0D, false)); this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.8D)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(6, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0])); } -@@ -174,6 +252,40 @@ public class Creeper extends Monster { +@@ -174,6 +259,38 @@ public class Creeper extends Monster { } } -+ @Override -+ public void initAttributes() { -+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.creeperMaxHealth); -+ this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.creeperScale); -+ } -+ ++ // Purpur start - Charged creeper naturally spawn + public net.minecraft.world.entity.SpawnGroupData finalizeSpawn(net.minecraft.world.level.ServerLevelAccessor world, net.minecraft.world.DifficultyInstance difficulty, net.minecraft.world.entity.EntitySpawnReason spawnReason, @Nullable net.minecraft.world.entity.SpawnGroupData entityData) { + double chance = world.getLevel().purpurConfig.creeperChargedChance; + if (chance > 0D && random.nextDouble() <= chance) { @@ -10457,11 +10618,13 @@ index 1906dfc22af208d6e801ad4a8f2f9e9702432691..38cbe2fce9c36195aa9bea2af26d1436 + } + return super.finalizeSpawn(world, difficulty, spawnReason, entityData); + } -+ ++ // Purpur end - Charged creeper naturally spawn ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.creeperTakeDamageFromWater; + } ++ // Purpur end - Toggle for water sensitive mob damage + + // Purpur start - Config to make Creepers explode on death + @Override @@ -10473,15 +10636,16 @@ index 1906dfc22af208d6e801ad4a8f2f9e9702432691..38cbe2fce9c36195aa9bea2af26d1436 + } + // Purpur end - Config to make Creepers explode on death + ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.creeperAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected SoundEvent getHurtSound(DamageSource source) { return SoundEvents.CREEPER_HURT; -@@ -262,16 +374,18 @@ public class Creeper extends Monster { +@@ -262,16 +379,18 @@ public class Creeper extends Monster { public void explodeCreeper() { Level world = this.level(); @@ -10498,11 +10662,11 @@ index 1906dfc22af208d6e801ad4a8f2f9e9702432691..38cbe2fce9c36195aa9bea2af26d1436 // CraftBukkit end this.dead = true; - worldserver.explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB); // CraftBukkit // Paper - fix DamageSource API (revert to vanilla, no, just no, don't change this) -+ worldserver.explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), worldserver.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) && level().purpurConfig.creeperAllowGriefing ? Level.ExplosionInteraction.MOB : Level.ExplosionInteraction.NONE); // CraftBukkit // Paper - fix DamageSource API (revert to vanilla, no, just no, don't change this) // Purpur ++ worldserver.explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), worldserver.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) && level().purpurConfig.creeperAllowGriefing ? Level.ExplosionInteraction.MOB : Level.ExplosionInteraction.NONE); // CraftBukkit // Paper - fix DamageSource API (revert to vanilla, no, just no, don't change this) // Purpur - Add enderman and creeper griefing controls this.spawnLingeringCloud(); this.triggerOnDeathMobEffects(worldserver, Entity.RemovalReason.KILLED); this.discard(EntityRemoveEvent.Cause.EXPLODE); // CraftBukkit - add Bukkit remove cause -@@ -283,6 +397,7 @@ public class Creeper extends Monster { +@@ -283,6 +402,7 @@ public class Creeper extends Monster { // CraftBukkit end } @@ -10510,23 +10674,23 @@ index 1906dfc22af208d6e801ad4a8f2f9e9702432691..38cbe2fce9c36195aa9bea2af26d1436 } private void spawnLingeringCloud() { -@@ -324,6 +439,7 @@ public class Creeper extends Monster { +@@ -324,6 +444,7 @@ public class Creeper extends Monster { 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()); -+ if (!event.isIgnited()) setSwellDir(-1); // Purpur ++ if (!event.isIgnited()) setSwellDir(-1); // Purpur - Ridables } } // Paper end - CreeperIgniteEvent 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 c6c86913c0a48501a9109a3838a3e56685d16d79..a28a4cd9544ffa58bd03ac901a761c797044629a 100644 +index c6c86913c0a48501a9109a3838a3e56685d16d79..76db5a2d27ab435fdfd1e0ec0c77ef5012e128d4 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java +++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -@@ -75,6 +75,59 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -75,6 +75,63 @@ public class Drowned extends Zombie implements RangedAttackMob { return Zombie.createAttributes().add(Attributes.STEP_HEIGHT, 1.0); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.drownedRidable; @@ -10541,8 +10705,9 @@ index c6c86913c0a48501a9109a3838a3e56685d16d79..a28a4cd9544ffa58bd03ac901a761c79 + public boolean isControllable() { + return level().purpurConfig.drownedControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.drownedMaxHealth); @@ -10553,12 +10718,8 @@ index c6c86913c0a48501a9109a3838a3e56685d16d79..a28a4cd9544ffa58bd03ac901a761c79 + protected void randomizeReinforcementsChance() { + this.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level().purpurConfig.drownedSpawnReinforcements); + } -+ -+ @Override -+ public boolean isSensitiveToWater() { -+ return this.level().purpurConfig.drownedTakeDamageFromWater; -+ } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Configurable jockey options + @Override + public boolean jockeyOnlyBaby() { + return level().purpurConfig.drownedJockeyOnlyBaby; @@ -10573,16 +10734,23 @@ index c6c86913c0a48501a9109a3838a3e56685d16d79..a28a4cd9544ffa58bd03ac901a761c79 + public boolean jockeyTryExistingChickens() { + return level().purpurConfig.drownedJockeyTryExistingChickens; + } -+ ++ // Purpur end - Configurable jockey options ++ // Purpur start - Toggle for water sensitive mob damage ++ @Override ++ public boolean isSensitiveToWater() { ++ return this.level().purpurConfig.drownedTakeDamageFromWater; ++ } ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.drownedAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void addBehaviourGoals() { this.goalSelector.addGoal(1, new Drowned.DrownedGoToWaterGoal(this, 1.0)); -@@ -82,10 +135,23 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -82,10 +139,23 @@ public class Drowned extends Zombie implements RangedAttackMob { this.goalSelector.addGoal(2, new Drowned.DrownedAttackGoal(this, 1.0, false)); this.goalSelector.addGoal(5, new Drowned.DrownedGoToBeachGoal(this, 1.0)); this.goalSelector.addGoal(6, new Drowned.DrownedSwimUpGoal(this, 1.0, this.level().getSeaLevel())); @@ -10607,51 +10775,51 @@ index c6c86913c0a48501a9109a3838a3e56685d16d79..a28a4cd9544ffa58bd03ac901a761c79 this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Axolotl.class, true, false)); this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR)); -@@ -398,7 +464,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -398,7 +468,7 @@ public class Drowned extends Zombie implements RangedAttackMob { } } - static class DrownedMoveControl extends MoveControl { -+ static class DrownedMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur ++ static class DrownedMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur - Ridables private final Drowned drowned; public DrownedMoveControl(Drowned drowned) { -@@ -407,7 +473,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -407,7 +477,7 @@ public class Drowned extends Zombie implements RangedAttackMob { } @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables LivingEntity livingEntity = this.drowned.getTarget(); if (this.drowned.wantsToSwim() && this.drowned.isInWater()) { if (livingEntity != null && livingEntity.getY() > this.drowned.getY() || this.drowned.searchingForLand) { -@@ -427,7 +493,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -427,7 +497,7 @@ public class Drowned extends Zombie implements RangedAttackMob { float h = (float)(Mth.atan2(f, d) * 180.0F / (float)Math.PI) - 90.0F; this.drowned.setYRot(this.rotlerp(this.drowned.getYRot(), h, 90.0F)); this.drowned.yBodyRot = this.drowned.getYRot(); - float i = (float)(this.speedModifier * this.drowned.getAttributeValue(Attributes.MOVEMENT_SPEED)); -+ float i = (float)(this.getSpeedModifier() * this.drowned.getAttributeValue(Attributes.MOVEMENT_SPEED)); // Purpur ++ float i = (float)(this.getSpeedModifier() * this.drowned.getAttributeValue(Attributes.MOVEMENT_SPEED)); // Purpur - Ridables float j = Mth.lerp(0.125F, this.drowned.getSpeed(), i); this.drowned.setSpeed(j); this.drowned.setDeltaMovement(this.drowned.getDeltaMovement().add((double)j * d * 0.005, (double)j * e * 0.1, (double)j * f * 0.005)); -@@ -436,7 +502,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -436,7 +506,7 @@ public class Drowned extends Zombie implements RangedAttackMob { this.drowned.setDeltaMovement(this.drowned.getDeltaMovement().add(0.0, -0.008, 0.0)); } - super.tick(); -+ super.vanillaTick(); // Purpur ++ super.vanillaTick(); // Purpur - Ridables } } } 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 378694a38115c012978e1fea59d049d1ebd04110..a000304e3ac4c34b020f7457aa2589c87f140d8c 100644 +index 378694a38115c012978e1fea59d049d1ebd04110..16edee73b099b66f12c45062df3108127d154921 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,34 @@ public class ElderGuardian extends Guardian { +@@ -33,6 +33,37 @@ public class ElderGuardian extends Guardian { } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.elderGuardianRidable; @@ -10661,40 +10829,43 @@ index 378694a38115c012978e1fea59d049d1ebd04110..a000304e3ac4c34b020f7457aa2589c8 + public boolean isControllable() { + return level().purpurConfig.elderGuardianControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.elderGuardianMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.elderGuardianScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.elderGuardianTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.elderGuardianAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience public static AttributeSupplier.Builder createAttributes() { 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 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822be5c2a517 100644 +index 2a394381a4ad46359359ba402b65c62b331480b4..6ab8abd52836a2a06496652a134dafc21a456a9e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -91,12 +91,41 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -91,12 +91,43 @@ public class EnderMan extends Monster implements NeutralMob { public EnderMan(EntityType type, Level world) { super(type, world); - this.setPathfindingMalus(PathType.WATER, -1.0F); -+ if (isSensitiveToWater()) this.setPathfindingMalus(PathType.WATER, -1.0F); // Purpur -+ } -+ -+ // Purpur start ++ if (isSensitiveToWater()) this.setPathfindingMalus(PathType.WATER, -1.0F); // Purpur - Toggle for water sensitive mob damage + } + ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.endermanRidable; @@ -10709,31 +10880,33 @@ index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822b + public boolean isControllable() { + return level().purpurConfig.endermanControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.endermanMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.endermanScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.endermanAlwaysDropExp; - } - ++ } ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new EnderMan.EndermanFreezeWhenLookedAt(this)); this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.0D, false)); this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D, 0.0F)); -@@ -104,9 +133,10 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -104,9 +135,10 @@ public class EnderMan extends Monster implements NeutralMob { this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); this.goalSelector.addGoal(10, new EnderMan.EndermanLeaveBlockGoal(this)); this.goalSelector.addGoal(11, new EnderMan.EndermanTakeBlockGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new EnderMan.EndermanLookForPlayerGoal(this, this::isAngryAt)); this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0])); - this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Endermite.class, true, false)); @@ -10741,7 +10914,7 @@ index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822b this.targetSelector.addGoal(4, new ResetUniversalAngerTargetGoal<>(this, false)); } -@@ -234,7 +264,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -234,7 +266,7 @@ public class EnderMan extends Monster implements NeutralMob { boolean isBeingStaredBy(Player player) { // Paper start - EndermanAttackPlayerEvent @@ -10750,12 +10923,12 @@ index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822b final com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent event = new com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent((org.bukkit.entity.Enderman) getBukkitEntity(), (org.bukkit.entity.Player) player.getBukkitEntity()); event.setCancelled(!shouldAttack); return event.callEvent(); -@@ -262,12 +292,12 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -262,12 +294,12 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean isSensitiveToWater() { - return true; -+ return this.level().purpurConfig.endermanTakeDamageFromWater; // Purpur ++ return this.level().purpurConfig.endermanTakeDamageFromWater; // Purpur - Toggle for water sensitive mob damage } @Override @@ -10765,7 +10938,7 @@ index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822b float f = this.getLightLevelDependentMagicValue(); if (f > 0.5F && world.canSeeSky(this.blockPosition()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper - EndermanEscapeEvent -@@ -306,11 +336,17 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -306,11 +338,17 @@ public class EnderMan extends Monster implements NeutralMob { private boolean teleport(double x, double y, double z) { BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(x, y, z); @@ -10785,16 +10958,16 @@ index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822b boolean flag = iblockdata.blocksMotion(); boolean flag1 = iblockdata.getFluidState().is(FluidTags.WATER); -@@ -382,6 +418,8 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -382,6 +420,8 @@ public class EnderMan extends Monster implements NeutralMob { public boolean hurtServer(ServerLevel world, DamageSource source, float amount) { if (this.isInvulnerableTo(world, source)) { return false; + } else if (getRider() != null && this.isControllable()) { return super.hurtServer(world, source, amount); // Purpur - no teleporting on damage -+ } 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 if (org.purpurmc.purpur.PurpurConfig.endermanShortHeight && source.is(net.minecraft.world.damagesource.DamageTypes.IN_WALL)) { return false; // Purpur - no suffocation damage if short height - Short enderman height } else { boolean flag = source.getDirectEntity() instanceof ThrownPotion; boolean flag1; -@@ -396,6 +434,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -396,6 +436,7 @@ public class EnderMan extends Monster implements NeutralMob { } else { flag1 = flag && this.hurtWithCleanWater(world, source, (ThrownPotion) source.getDirectEntity(), amount); @@ -10802,7 +10975,7 @@ index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822b if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - EndermanEscapeEvent for (int i = 0; i < 64; ++i) { if (this.teleport()) { -@@ -440,7 +479,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -440,7 +481,7 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean requiresCustomPersistence() { @@ -10811,13 +10984,13 @@ index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822b } private static class EndermanFreezeWhenLookedAt extends Goal { -@@ -487,7 +526,16 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -487,7 +528,16 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean canUse() { - return this.enderman.getCarriedBlock() == null ? false : (!getServerLevel((Entity) this.enderman).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.enderman.getRandom().nextInt(reducedTickDelay(2000)) == 0); -+ if (!enderman.level().purpurConfig.endermanAllowGriefing) return false; // Purpur -+ // Purpur start ++ if (!enderman.level().purpurConfig.endermanAllowGriefing) return false; // Purpur - Add enderman and creeper griefing controls ++ // Purpur start - Add mobGriefing bypass to everything affected + if (this.enderman.getCarriedBlock() == null) { + return false; + } @@ -10825,17 +10998,17 @@ index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822b + return false; + } + return this.enderman.getRandom().nextInt(reducedTickDelay(2000)) == 0; -+ // Purpur end ++ // Purpur end - Add mobGriefing bypass to everything affected } @Override -@@ -532,7 +580,16 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -532,7 +582,16 @@ public class EnderMan extends Monster implements NeutralMob { @Override public boolean canUse() { - return this.enderman.getCarriedBlock() != null ? false : (!getServerLevel((Entity) this.enderman).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? false : this.enderman.getRandom().nextInt(reducedTickDelay(20)) == 0); -+ if (!enderman.level().purpurConfig.endermanAllowGriefing) return false; // Purpur -+ // Purpur start ++ if (!enderman.level().purpurConfig.endermanAllowGriefing) return false; // Purpur - Add enderman and creeper griefing controls ++ // Purpur start - Add mobGriefing bypass to everything affected + if (this.enderman.getCarriedBlock() != null) { + return false; + } @@ -10843,26 +11016,26 @@ index 2a394381a4ad46359359ba402b65c62b331480b4..881b85506cbff22febe0c1cd0d30822b + return false; + } + return this.enderman.getRandom().nextInt(reducedTickDelay(20)) == 0; -+ // Purpur end ++ // Purpur end - Add mobGriefing bypass to everything affected } @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 534e98dd7291e09dee1d0f77cbf221b15708590f..f8373fc9839fccb31e3dd090de70e2cd7c9e6cfc 100644 +index 534e98dd7291e09dee1d0f77cbf221b15708590f..b5e957f101a1bd14501a043fb1b528de25cf2f75 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Endermite.java +++ b/src/main/java/net/minecraft/world/entity/monster/Endermite.java -@@ -32,20 +32,64 @@ public class Endermite extends Monster { +@@ -32,20 +32,68 @@ public class Endermite extends Monster { private static final int MAX_LIFE = 2400; public int life; -+ private boolean isPlayerSpawned; // Purpur ++ private boolean isPlayerSpawned; // Purpur - Add back player spawned endermite API public Endermite(EntityType type, Level world) { super(type, world); this.xpReward = 3; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.endermiteRidable; @@ -10877,19 +11050,22 @@ index 534e98dd7291e09dee1d0f77cbf221b15708590f..f8373fc9839fccb31e3dd090de70e2cd + public boolean isControllable() { + return level().purpurConfig.endermiteControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.endermiteMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.endermiteScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.endermiteTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Add back player spawned endermite API + public boolean isPlayerSpawned() { + return this.isPlayerSpawned; + } @@ -10897,49 +11073,50 @@ index 534e98dd7291e09dee1d0f77cbf221b15708590f..f8373fc9839fccb31e3dd090de70e2cd + public void setPlayerSpawned(boolean playerSpawned) { + this.isPlayerSpawned = playerSpawned; + } -+ ++ // Purpur end - Add back player spawned endermite API ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.endermiteAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { 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 org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new ClimbOnTopOfPowderSnowGoal(this, this.level())); this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.0D, false)); this.goalSelector.addGoal(3, new WaterAvoidingRandomStrollGoal(this, 1.0D)); this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers()); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); } -@@ -83,12 +127,14 @@ public class Endermite extends Monster { +@@ -83,12 +131,14 @@ public class Endermite extends Monster { public void readAdditionalSaveData(CompoundTag nbt) { super.readAdditionalSaveData(nbt); this.life = nbt.getInt("Lifetime"); -+ this.isPlayerSpawned = nbt.getBoolean("PlayerSpawned"); // Purpur ++ this.isPlayerSpawned = nbt.getBoolean("PlayerSpawned"); // Purpur - Add back player spawned endermite API } @Override public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); nbt.putInt("Lifetime", this.life); -+ nbt.putBoolean("PlayerSpawned", this.isPlayerSpawned); // Purpur ++ nbt.putBoolean("PlayerSpawned", this.isPlayerSpawned); // Purpur - Add back player spawned endermite API } @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 14f23c9a248760a57b3d6fe4f2824a4a456a6d37..9454a2eccc1f405f2013a18d56e65a1e6a4bb8f7 100644 +index 14f23c9a248760a57b3d6fe4f2824a4a456a6d37..5e46324e9509a67debfc07614f15d282d293f717 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Evoker.java +++ b/src/main/java/net/minecraft/world/entity/monster/Evoker.java -@@ -53,10 +53,44 @@ public class Evoker extends SpellcasterIllager { +@@ -53,10 +53,47 @@ public class Evoker extends SpellcasterIllager { this.xpReward = 10; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.evokerRidable; @@ -10954,58 +11131,61 @@ index 14f23c9a248760a57b3d6fe4f2824a4a456a6d37..9454a2eccc1f405f2013a18d56e65a1e + public boolean isControllable() { + return level().purpurConfig.evokerControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.evokerMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.evokerScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.evokerTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.evokerAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new Evoker.EvokerCastingSpellGoal()); this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, Player.class, 8.0F, 0.6D, 1.0D)); this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 0.6D, 1.0D)); -@@ -66,6 +100,7 @@ public class Evoker extends SpellcasterIllager { +@@ -66,6 +103,7 @@ public class Evoker extends SpellcasterIllager { this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6D)); this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F)); this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Raider.class})).setAlertOthers()); this.targetSelector.addGoal(2, (new NearestAttackableTargetGoal<>(this, Player.class, true)).setUnseenMemoryTicks(300)); this.targetSelector.addGoal(3, (new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)).setUnseenMemoryTicks(300)); -@@ -342,7 +377,7 @@ public class Evoker extends SpellcasterIllager { +@@ -342,7 +380,7 @@ public class Evoker extends SpellcasterIllager { } else { ServerLevel worldserver = getServerLevel(Evoker.this.level()); - if (!worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (!worldserver.purpurConfig.evokerBypassMobGriefing == !worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur ++ if (!worldserver.purpurConfig.evokerBypassMobGriefing == !worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur - Add mobGriefing bypass to everything affected return false; } else { List list = worldserver.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 a8c8c03e972aa6352843cf4c3e4aebfb8f493125..173b10fa553db30c321bfd9eabe13915b63cf920 100644 +index a8c8c03e972aa6352843cf4c3e4aebfb8f493125..d410824d481a83d11919c045e572eaffab3d9a9f 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,47 @@ public class Ghast extends FlyingMob implements Enemy { +@@ -44,11 +44,66 @@ public class Ghast extends FlyingMob implements Enemy { this.moveControl = new Ghast.GhastMoveControl(this); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.ghastRidable; @@ -11037,77 +11217,73 @@ index a8c8c03e972aa6352843cf4c3e4aebfb8f493125..173b10fa553db30c321bfd9eabe13915 + setDeltaMovement(mot.scale(0.9D)); + } + } -+ // Purpur end ++ // Purpur end - Ridables + - @Override - protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - this.goalSelector.addGoal(5, new Ghast.RandomFloatAroundGoal(this)); - this.goalSelector.addGoal(7, new Ghast.GhastLookGoal(this)); - this.goalSelector.addGoal(7, new Ghast.GhastShootFireballGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (entityliving, worldserver) -> { - return Math.abs(entityliving.getY() - this.getY()) <= 4.0D; - })); -@@ -96,6 +132,22 @@ public class Ghast extends FlyingMob implements Enemy { - } - } - ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.ghastMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.ghastScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.ghastTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.ghastAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override - protected void defineSynchedData(SynchedEntityData.Builder builder) { - super.defineSynchedData(builder); -@@ -103,7 +155,7 @@ public class Ghast extends FlyingMob implements Enemy { + protected void registerGoals() { ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables + this.goalSelector.addGoal(5, new Ghast.RandomFloatAroundGoal(this)); + this.goalSelector.addGoal(7, new Ghast.GhastLookGoal(this)); + this.goalSelector.addGoal(7, new Ghast.GhastShootFireballGoal(this)); ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables + this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (entityliving, worldserver) -> { + return Math.abs(entityliving.getY() - this.getY()) <= 4.0D; + })); +@@ -103,7 +158,7 @@ public class Ghast extends FlyingMob implements Enemy { } public static AttributeSupplier.Builder createAttributes() { - return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 10.0D).add(Attributes.FOLLOW_RANGE, 100.0D); -+ return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 10.0D).add(Attributes.FOLLOW_RANGE, 100.0D).add(Attributes.FLYING_SPEED, 0.6D); // Purpur ++ return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 10.0D).add(Attributes.FOLLOW_RANGE, 100.0D).add(Attributes.FLYING_SPEED, 0.6D); // Purpur - Ridables } @Override -@@ -155,7 +207,7 @@ public class Ghast extends FlyingMob implements Enemy { +@@ -155,7 +210,7 @@ public class Ghast extends FlyingMob implements Enemy { } - private static class GhastMoveControl extends MoveControl { -+ private static class GhastMoveControl extends org.purpurmc.purpur.controller.FlyingMoveControllerWASD { // Purpur ++ private static class GhastMoveControl extends org.purpurmc.purpur.controller.FlyingMoveControllerWASD { // Purpur - Ridables private final Ghast ghast; private int floatDuration; -@@ -166,7 +218,7 @@ public class Ghast extends FlyingMob implements Enemy { +@@ -166,7 +221,7 @@ public class Ghast extends FlyingMob implements Enemy { } @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (this.operation == MoveControl.Operation.MOVE_TO) { 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 118521ae54254b0a73bb7cba7b2871c9c26f89fc..859d316825658c11f58dd92912edbee75eaeabb9 100644 +index 118521ae54254b0a73bb7cba7b2871c9c26f89fc..a7996b600a94f87629a26349c317b379aef4b5a7 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Giant.java +++ b/src/main/java/net/minecraft/world/entity/monster/Giant.java -@@ -12,12 +12,95 @@ public class Giant extends Monster { +@@ -12,12 +12,97 @@ public class Giant extends Monster { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.giantRidable; @@ -11143,27 +11319,29 @@ index 118521ae54254b0a73bb7cba7b2871c9c26f89fc..859d316825658c11f58dd92912edbee7 + } + } + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes ++ @Override ++ protected void initAttributes() { ++ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.giantMaxHealth); ++ this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.giantScale); ++ this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.level().purpurConfig.giantMovementSpeed); ++ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(this.level().purpurConfig.giantAttackDamage); ++ } ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.giantTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.giantAlwaysDropExp; + } -+ -+ @Override -+ protected void initAttributes() { -+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.giantMaxHealth); -+ this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.giantScale); -+ this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.level().purpurConfig.giantMovementSpeed); -+ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(this.level().purpurConfig.giantAttackDamage); -+ } -+ -+ // Purpur end -+ ++ // Purpur end - Mobs always drop experience public static AttributeSupplier.Builder createAttributes() { return Monster.createMonsterAttributes().add(Attributes.MAX_HEALTH, 100.0).add(Attributes.MOVEMENT_SPEED, 0.5).add(Attributes.ATTACK_DAMAGE, 50.0); } @@ -11201,26 +11379,26 @@ index 118521ae54254b0a73bb7cba7b2871c9c26f89fc..859d316825658c11f58dd92912edbee7 } } 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 951f46684623582980901c1ebc1870aa5bcf25a1..da833bf35342f771ecccd5dcac4fe87f72d047b0 100644 +index 951f46684623582980901c1ebc1870aa5bcf25a1..929864ee4e5e6e9c87d10bb1bb06118cd94bd5d7 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Guardian.java +++ b/src/main/java/net/minecraft/world/entity/monster/Guardian.java -@@ -67,15 +67,52 @@ public class Guardian extends Monster { +@@ -67,15 +67,55 @@ public class Guardian extends Monster { this.xpReward = 10; this.setPathfindingMalus(PathType.WATER, 0.0F); this.moveControl = new Guardian.GuardianMoveControl(this); -+ // Purpur start ++ // Purpur start - Ridables + this.lookControl = new org.purpurmc.purpur.controller.LookControllerWASD(this) { + @Override + public void setYawPitch(float yaw, float pitch) { + super.setYawPitch(yaw, pitch * 0.35F); + } + }; -+ // Purpur end ++ // Purpur end - Ridables this.clientSideTailAnimation = this.random.nextFloat(); this.clientSideTailAnimationO = this.clientSideTailAnimation; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.guardianRidable; @@ -11230,64 +11408,67 @@ index 951f46684623582980901c1ebc1870aa5bcf25a1..da833bf35342f771ecccd5dcac4fe87f + public boolean isControllable() { + return level().purpurConfig.guardianControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.guardianMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.guardianScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.guardianTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.guardianAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { MoveTowardsRestrictionGoal pathfindergoalmovetowardsrestriction = new MoveTowardsRestrictionGoal(this, 1.0D); this.randomStrollGoal = new RandomStrollGoal(this, 1.0D, 80); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(4, this.guardianAttackGoal = new Guardian.GuardianAttackGoal(this)); // CraftBukkit - assign field this.goalSelector.addGoal(5, pathfindergoalmovetowardsrestriction); this.goalSelector.addGoal(7, this.randomStrollGoal); -@@ -84,6 +121,7 @@ public class Guardian extends Monster { +@@ -84,6 +124,7 @@ public class Guardian extends Monster { this.goalSelector.addGoal(9, new RandomLookAroundGoal(this)); this.randomStrollGoal.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK)); pathfindergoalmovetowardsrestriction.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.LOOK)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 10, true, false, new Guardian.GuardianAttackSelector(this))); } -@@ -330,7 +368,7 @@ public class Guardian extends Monster { +@@ -330,7 +371,7 @@ public class Guardian extends Monster { @Override public void travel(Vec3 movementInput) { if (this.isControlledByLocalInstance() && this.isInWater()) { - this.moveRelative(0.1F, movementInput); -+ this.moveRelative(getRider() != null && this.isControllable() ? getSpeed() : 0.1F, movementInput); // Purpur ++ this.moveRelative(getRider() != null && this.isControllable() ? getSpeed() : 0.1F, movementInput); // Purpur - Ridables this.move(MoverType.SELF, this.getDeltaMovement()); this.setDeltaMovement(this.getDeltaMovement().scale(0.9D)); if (!this.isMoving() && this.getTarget() == null) { -@@ -342,7 +380,7 @@ public class Guardian extends Monster { +@@ -342,7 +383,7 @@ public class Guardian extends Monster { } - private static class GuardianMoveControl extends MoveControl { -+ private static class GuardianMoveControl extends org.purpurmc.purpur.controller.WaterMoveControllerWASD { // Purpur ++ private static class GuardianMoveControl extends org.purpurmc.purpur.controller.WaterMoveControllerWASD { // Purpur - Ridables private final Guardian guardian; -@@ -351,8 +389,17 @@ public class Guardian extends Monster { +@@ -351,8 +392,17 @@ public class Guardian extends Monster { this.guardian = guardian; } -+ // Purpur start ++ // Purpur start - Ridables @Override - public void tick() { + public void purpurTick(Player rider) { @@ -11295,34 +11476,34 @@ index 951f46684623582980901c1ebc1870aa5bcf25a1..da833bf35342f771ecccd5dcac4fe87f + guardian.setDeltaMovement(guardian.getDeltaMovement().add(0.0D, 0.005D, 0.0D)); + guardian.setMoving(guardian.getForwardMot() > 0.0F); // control tail speed + } -+ // Purpur end ++ // Purpur end - Ridables + + @Override -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (this.operation == MoveControl.Operation.MOVE_TO && !this.guardian.getNavigation().isDone()) { Vec3 vec3d = new Vec3(this.wantedX - this.guardian.getX(), this.wantedY - this.guardian.getY(), this.wantedZ - this.guardian.getZ()); double d0 = vec3d.length(); -@@ -363,7 +410,7 @@ public class Guardian extends Monster { +@@ -363,7 +413,7 @@ public class Guardian extends Monster { this.guardian.setYRot(this.rotlerp(this.guardian.getYRot(), f, 90.0F)); this.guardian.yBodyRot = this.guardian.getYRot(); - float f1 = (float) (this.speedModifier * this.guardian.getAttributeValue(Attributes.MOVEMENT_SPEED)); -+ float f1 = (float) (this.getSpeedModifier() * this.guardian.getAttributeValue(Attributes.MOVEMENT_SPEED)); // Purpur ++ float f1 = (float) (this.getSpeedModifier() * this.guardian.getAttributeValue(Attributes.MOVEMENT_SPEED)); // Purpur - Ridables float f2 = Mth.lerp(0.125F, this.guardian.getSpeed(), f1); this.guardian.setSpeed(f2); 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 184fa759db065fb345f3623752229430816d8ad3..7c8ec5cd88fb2083f458a945e716b6f118555db8 100644 +index 184fa759db065fb345f3623752229430816d8ad3..c41a9b4bb24cc801b8460ce7e63695fdec146c5d 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Husk.java +++ b/src/main/java/net/minecraft/world/entity/monster/Husk.java -@@ -21,6 +21,59 @@ public class Husk extends Zombie { +@@ -21,15 +21,72 @@ public class Husk extends Zombie { public Husk(EntityType type, Level world) { super(type, world); + this.setShouldBurnInDay(false); // Purpur - API for any mob to burn daylight -+ } -+ -+ // Purpur start + } + ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.huskRidable; @@ -11337,8 +11518,9 @@ index 184fa759db065fb345f3623752229430816d8ad3..7c8ec5cd88fb2083f458a945e716b6f1 + public boolean isControllable() { + return level().purpurConfig.huskControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.huskMaxHealth); @@ -11348,7 +11530,8 @@ index 184fa759db065fb345f3623752229430816d8ad3..7c8ec5cd88fb2083f458a945e716b6f1 + protected void randomizeReinforcementsChance() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level().purpurConfig.huskSpawnReinforcements); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Configurable jockey options + @Override + public boolean jockeyOnlyBaby() { + return level().purpurConfig.huskJockeyOnlyBaby; @@ -11363,19 +11546,22 @@ index 184fa759db065fb345f3623752229430816d8ad3..7c8ec5cd88fb2083f458a945e716b6f1 + public boolean jockeyTryExistingChickens() { + return level().purpurConfig.huskJockeyTryExistingChickens; + } -+ ++ // Purpur end - Configurable jockey options ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.huskTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.huskAlwaysDropExp; - } - ++ } ++ // Purpur end - Mobs always drop experience public static boolean checkHuskSpawnRules(EntityType type, ServerLevelAccessor world, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random) { -@@ -29,7 +82,7 @@ public class Husk extends Zombie { + return checkMonsterSpawnRules(type, world, spawnReason, pos, random) && (EntitySpawnReason.isSpawner(spawnReason) || world.canSeeSky(pos)); + } @Override public boolean isSunSensitive() { @@ -11385,14 +11571,14 @@ index 184fa759db065fb345f3623752229430816d8ad3..7c8ec5cd88fb2083f458a945e716b6f1 @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 db3aac9ba711dcd18ffc35c4a745ecaec89d0166..2ca241344efc6320d2018bdc772f74470080eeed 100644 +index db3aac9ba711dcd18ffc35c4a745ecaec89d0166..83b64a8091a85b9eb940af33e4d44bd4a906b248 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,46 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { +@@ -59,10 +59,49 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.illusionerRidable; @@ -11407,8 +11593,9 @@ index db3aac9ba711dcd18ffc35c4a745ecaec89d0166..2ca241344efc6320d2018bdc772f7447 + public boolean isControllable() { + return level().purpurConfig.illusionerControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + protected void initAttributes() { + this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.level().purpurConfig.illusionerMovementSpeed); @@ -11416,42 +11603,44 @@ index db3aac9ba711dcd18ffc35c4a745ecaec89d0166..2ca241344efc6320d2018bdc772f7447 + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.illusionerMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.illusionerScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.illusionerTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.illusionerAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new SpellcasterIllager.SpellcasterCastingSpellGoal()); this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0D, 1.2D)); this.goalSelector.addGoal(4, new Illusioner.IllusionerMirrorSpellGoal()); -@@ -71,6 +107,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { +@@ -71,6 +110,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6D)); this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F)); this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Raider.class})).setAlertOthers()); 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 ae710c3fffc7840a9ff2cbc5cdacef8a2e248253..63caf20256a3deae98b9cd9f54650def172f0e57 100644 +index ae710c3fffc7840a9ff2cbc5cdacef8a2e248253..2449a960493cbd99a22ce9b8d2fe852d1ec4b20d 100644 --- a/src/main/java/net/minecraft/world/entity/monster/MagmaCube.java +++ b/src/main/java/net/minecraft/world/entity/monster/MagmaCube.java -@@ -24,6 +24,58 @@ public class MagmaCube extends Slime { +@@ -24,6 +24,61 @@ public class MagmaCube extends Slime { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.magmaCubeRidable; @@ -11471,8 +11660,9 @@ index ae710c3fffc7840a9ff2cbc5cdacef8a2e248253..63caf20256a3deae98b9cd9f54650def + public float getJumpPower() { + return 0.42F * this.getBlockJumpFactor(); // from EntityLiving + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + protected String getMaxHealthEquation() { + return level().purpurConfig.magmaCubeMaxHealth; @@ -11492,25 +11682,27 @@ index ae710c3fffc7840a9ff2cbc5cdacef8a2e248253..63caf20256a3deae98b9cd9f54650def + protected java.util.Map getAttackDamageCache() { + return level().purpurConfig.magmaCubeAttackDamageCache; + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.magmaCubeTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.magmaCubeAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience public static AttributeSupplier.Builder createAttributes() { return Monster.createMonsterAttributes().add(Attributes.MOVEMENT_SPEED, 0.2F); } -@@ -71,6 +123,7 @@ public class MagmaCube extends Slime { +@@ -71,6 +126,7 @@ public class MagmaCube extends Slime { float f = (float)this.getSize() * 0.1F; this.setDeltaMovement(vec3.x, (double)(this.getJumpPower() + f), vec3.z); this.hasImpulse = true; -+ this.actualJump = false; // Purpur ++ this.actualJump = false; // Purpur - Ridables } @Override @@ -11534,26 +11726,26 @@ index e2de074bbe7bab0e5a7aecc1fae4c5914a203dd4..c2061f575c731ecc6071384b007517c0 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 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117da23c2290 100644 +index 4ff75412452649ebf106ef591cb97dc7ac8175e7..860162797972263283737e8f30d8b784955206be 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 { Vec3 moveTargetPoint; public BlockPos anchorPoint; Phantom.AttackPhase attackPhase; -+ private static final net.minecraft.world.item.crafting.Ingredient TORCH = net.minecraft.world.item.crafting.Ingredient.of(net.minecraft.world.item.Items.TORCH, net.minecraft.world.item.Items.SOUL_TORCH); // Purpur -+ Vec3 crystalPosition; // Purpur ++ Vec3 crystalPosition; // Purpur - Phantoms attracted to crystals and crystals shoot phantoms ++ private static final net.minecraft.world.item.crafting.Ingredient TORCH = net.minecraft.world.item.crafting.Ingredient.of(net.minecraft.world.item.Items.TORCH, net.minecraft.world.item.Items.SOUL_TORCH); // Purpur - Phantoms burn in light public Phantom(EntityType type, Level world) { super(type, world); -@@ -58,6 +60,92 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -58,8 +60,97 @@ public class Phantom extends FlyingMob implements Enemy { this.xpReward = 5; this.moveControl = new Phantom.PhantomMoveControl(this); this.lookControl = new Phantom.PhantomLookControl(this); + this.setShouldBurnInDay(true); // Purpur - API for any mob to burn daylight -+ } -+ -+ // Purpur start + } + ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.phantomRidable; @@ -11609,7 +11801,15 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d + level().addFreshEntity(flames); + return true; + } ++ // Purpur end - Ridables + ++ // Purpur start ++ @Override ++ public boolean isSensitiveToWater() { ++ return this.level().purpurConfig.phantomTakeDamageFromWater; ++ } ++ // Purpur end ++ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms + @Override + protected void dropFromLootTable(ServerLevel world, DamageSource damageSource, boolean causedByPlayer) { + boolean dropped = false; @@ -11626,28 +11826,25 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d + public boolean isCirclingCrystal() { + return crystalPosition != null; + } -+ // Purpur end -+ -+ @Override -+ public boolean isSensitiveToWater() { -+ return this.level().purpurConfig.phantomTakeDamageFromWater; -+ } -+ ++ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.phantomAlwaysDropExp; - } - ++ } ++ // Purpur end - Mobs always drop experience @Override -@@ -72,9 +160,17 @@ public class Phantom extends FlyingMob implements Enemy { + public boolean isFlapping() { + return (this.getUniqueFlapTickOffset() + this.tickCount) % Phantom.TICKS_PER_FLAP == 0; +@@ -72,9 +163,17 @@ public class Phantom extends FlyingMob implements Enemy { @Override protected void registerGoals() { - this.goalSelector.addGoal(1, new Phantom.PhantomAttackStrategyGoal()); - this.goalSelector.addGoal(2, new Phantom.PhantomSweepAttackGoal()); - this.goalSelector.addGoal(3, new Phantom.PhantomCircleAroundAnchorGoal()); -+ // Purpur start -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables ++ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms + if (level().purpurConfig.phantomOrbitCrystalRadius > 0) { + this.goalSelector.addGoal(1, new FindCrystalGoal(this)); + this.goalSelector.addGoal(2, new OrbitCrystalGoal(this)); @@ -11655,27 +11852,28 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d + this.goalSelector.addGoal(3, new Phantom.PhantomAttackStrategyGoal()); + this.goalSelector.addGoal(4, new Phantom.PhantomSweepAttackGoal()); + this.goalSelector.addGoal(5, new Phantom.PhantomCircleAroundAnchorGoal()); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); -+ // Purpur end ++ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new Phantom.PhantomAttackPlayerTargetGoal()); } -@@ -90,7 +186,10 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -90,7 +189,10 @@ public class Phantom extends FlyingMob implements Enemy { private void updatePhantomSizeInfo() { this.refreshDimensions(); - this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue((double) (6 + this.getPhantomSize())); -+ // Purpur start ++ // Purpur start - Configurable entity base attributes + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(getFromCache(() -> this.level().purpurConfig.phantomMaxHealth, () -> this.level().purpurConfig.phantomMaxHealthCache, () -> 20.0D)); + this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(getFromCache(() -> this.level().purpurConfig.phantomAttackDamage, () -> this.level().purpurConfig.phantomAttackDamageCache, () -> (double) 6 + this.getPhantomSize())); -+ // Purpur end ++ // Purpur end - Configurable entity base attributes } public int getPhantomSize() { -@@ -115,6 +214,21 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -115,6 +217,22 @@ public class Phantom extends FlyingMob implements Enemy { return true; } ++ // Purpur start - Configurable entity base attributes + private double getFromCache(java.util.function.Supplier equation, java.util.function.Supplier> cache, java.util.function.Supplier defaultValue) { + int size = getPhantomSize(); + Double value = cache.get().get(size); @@ -11690,11 +11888,11 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d + } + return value; + } -+ ++ // Purpur end - Configurable entity base attributes @Override public void tick() { super.tick(); -@@ -135,21 +249,23 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -135,11 +253,18 @@ public class Phantom extends FlyingMob implements Enemy { this.level().addParticle(ParticleTypes.MYCELIUM, this.getX() - (double) f3, this.getY() + (double) f5, this.getZ() - (double) f4, 0.0D, 0.0D, 0.0D); } @@ -11704,13 +11902,17 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d @Override public void aiStep() { - if (this.isAlive() && this.shouldBurnInDay && this.isSunBurnTick()) { // Paper - shouldBurnInDay API -- this.igniteForSeconds(8.0F); -- } -- + // Purpur - implemented in LivingEntity; moved down to shouldBurnInDay() - API for any mob to burn daylight - super.aiStep(); - } ++ // Purpur start - Phantoms burn in light ++ boolean burnFromDaylight = this.shouldBurnInDay && this.isSunBurnTick() && this.level().purpurConfig.phantomBurnInDaylight; ++ boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight; ++ if (this.isAlive() && (burnFromDaylight || burnFromLightSource)) { // Paper - shouldBurnInDay API ++ // Purpur end - Phantoms burn in light ++ if (getRider() == null || !this.isControllable()) // Purpur - Ridables + this.igniteForSeconds(8.0F); + } +@@ -149,7 +274,11 @@ public class Phantom extends FlyingMob implements Enemy { @Override public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData entityData) { this.anchorPoint = this.blockPosition().above(5); @@ -11723,7 +11925,7 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d return super.finalizeSpawn(world, difficulty, spawnReason, entityData); } -@@ -165,7 +281,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -165,7 +294,7 @@ public class Phantom extends FlyingMob implements Enemy { if (nbt.hasUUID("Paper.SpawningEntity")) { this.spawningEntity = nbt.getUUID("Paper.SpawningEntity"); } @@ -11732,7 +11934,7 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); } // Paper end -@@ -182,7 +298,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -182,7 +311,7 @@ public class Phantom extends FlyingMob implements Enemy { if (this.spawningEntity != null) { nbt.putUUID("Paper.SpawningEntity", this.spawningEntity); } @@ -11741,7 +11943,7 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d // Paper end } -@@ -242,8 +358,14 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -242,8 +371,14 @@ public class Phantom extends FlyingMob implements Enemy { return this.spawningEntity; } public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } @@ -11758,12 +11960,12 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; } // Paper end -@@ -254,7 +376,125 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -254,7 +389,124 @@ public class Phantom extends FlyingMob implements Enemy { private AttackPhase() {} } - private class PhantomMoveControl extends MoveControl { -+ // Purpur start ++ // Purpur start - Phantoms attracted to crystals and crystals shoot phantoms + class FindCrystalGoal extends Goal { + private final Phantom phantom; + private net.minecraft.world.entity.boss.enderdragon.EndCrystal crystal; @@ -11879,17 +12081,16 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d + this.radius * Mth.sin(this.offset)); + } + } -+ // Purpur end -+ -+ private class PhantomMoveControl extends org.purpurmc.purpur.controller.FlyingMoveControllerWASD { // Purpur ++ // Purpur end - Phantoms attracted to crystals and crystals shoot phantoms ++ private class PhantomMoveControl extends org.purpurmc.purpur.controller.FlyingMoveControllerWASD { // Purpur - Ridables private float speed = 0.1F; -@@ -262,8 +502,19 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -262,8 +514,19 @@ public class Phantom extends FlyingMob implements Enemy { super(entity); } -+ // Purpur start ++ // Purpur start - Ridables + public void purpurTick(Player rider) { + if (!Phantom.this.onGround) { + // phantom is always in motion when flying @@ -11898,67 +12099,67 @@ index 4ff75412452649ebf106ef591cb97dc7ac8175e7..23ca324c5379f9735232a9f74071117d + } + super.purpurTick(rider); + } -+ // Purpur end ++ // Purpur end - Ridables + @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (Phantom.this.horizontalCollision) { Phantom.this.setYRot(Phantom.this.getYRot() + 180.0F); this.speed = 0.1F; -@@ -309,14 +560,20 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -309,14 +572,20 @@ public class Phantom extends FlyingMob implements Enemy { } } - private static class PhantomLookControl extends LookControl { -+ private static class PhantomLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur ++ private static class PhantomLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables public PhantomLookControl(Mob entity) { super(entity); } -+ // Purpur start ++ // Purpur start - Ridables + public void purpurTick(Player rider) { + setYawPitch(rider.getYRot(), -rider.xRotO * 0.75F); + } -+ // Purpur end ++ // Purpur end - Ridables + @Override - public void tick() {} -+ public void vanillaTick() {} // Purpur ++ public void vanillaTick() {} // Purpur - Ridables } private class PhantomBodyRotationControl extends BodyRotationControl { -@@ -403,6 +660,12 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -403,6 +672,12 @@ public class Phantom extends FlyingMob implements Enemy { return false; } else if (!entityliving.isAlive()) { return false; -+ // Purpur start ++ // Purpur start - Phantoms burn in light + } else if (level().purpurConfig.phantomBurnInLight > 0 && level().getLightEmission(new BlockPos(Phantom.this)) >= level().purpurConfig.phantomBurnInLight) { + return false; + } else if (level().purpurConfig.phantomIgnorePlayersWithTorch && (TORCH.test(entityliving.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(entityliving.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND)))) { + return false; -+ // Purpur end ++ // Purpur end - Phantoms burn in light } else { if (entityliving instanceof Player) { Player entityhuman = (Player) entityliving; -@@ -549,6 +812,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -549,6 +824,7 @@ public class Phantom extends FlyingMob implements Enemy { ServerLevel worldserver = getServerLevel(Phantom.this.level()); List list = worldserver.getNearbyPlayers(this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0D, 64.0D, 16.0D)); -+ if (level().purpurConfig.phantomIgnorePlayersWithTorch) list.removeIf(human -> TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND)));// Purpur ++ if (level().purpurConfig.phantomIgnorePlayersWithTorch) list.removeIf(human -> TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND)));// Purpur - Phantoms burn in light if (!list.isEmpty()) { 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 91edf8767541982b8cd1be83c33a7b287ffb62fe..588da64f4137a9f13f41875b3f5c47b485398782 100644 +index 91edf8767541982b8cd1be83c33a7b287ffb62fe..5b98144992c366009a2b2c48e13884ceaf72acfb 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Pillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Pillager.java -@@ -67,16 +67,51 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve +@@ -67,16 +67,54 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.pillagerRidable; @@ -11973,48 +12174,51 @@ index 91edf8767541982b8cd1be83c33a7b287ffb62fe..588da64f4137a9f13f41875b3f5c47b4 + public boolean isControllable() { + return level().purpurConfig.pillagerControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.pillagerMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.pillagerScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.pillagerTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.pillagerAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0D, 1.2D)); this.goalSelector.addGoal(2, new Raider.HoldGroundAttackGoal(this, 10.0F)); this.goalSelector.addGoal(3, new RangedCrossbowAttackGoal<>(this, 1.0D, 8.0F)); this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6D)); this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 15.0F, 1.0F)); this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 15.0F)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Raider.class})).setAlertOthers()); 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 cfc28828a5b81563a826ae6045553e7350f67986..17aaa3f376ce6183911739536206f9f701e452b5 100644 +index cfc28828a5b81563a826ae6045553e7350f67986..a5134a80a707bc69ae5826eae89e79be5ec3fa41 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -@@ -75,14 +75,56 @@ public class Ravager extends Raider { +@@ -75,14 +75,59 @@ public class Ravager extends Raider { this.setPathfindingMalus(PathType.LEAVES, 0.0F); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.ravagerRidable; @@ -12035,67 +12239,70 @@ index cfc28828a5b81563a826ae6045553e7350f67986..17aaa3f376ce6183911739536206f9f7 + super.onMount(rider); + getNavigation().stop(); + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.ravagerMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.ravagerScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.ravagerTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.ravagerAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur -+ if (level().purpurConfig.ravagerAvoidRabbits) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.AvoidEntityGoal<>(this, net.minecraft.world.entity.animal.Rabbit.class, 6.0F, 1.0D, 1.2D)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables ++ if (level().purpurConfig.ravagerAvoidRabbits) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.AvoidEntityGoal<>(this, net.minecraft.world.entity.animal.Rabbit.class, 6.0F, 1.0D, 1.2D)); // Purpur - option to make ravagers afraid of rabbits this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0D, true)); this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.4D)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F)); this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables 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, worldserver) -> { -@@ -135,7 +177,7 @@ public class Ravager extends Raider { +@@ -135,7 +180,7 @@ public class Ravager extends Raider { @Override public void aiStep() { super.aiStep(); - if (this.isAlive()) { -+ if (this.isAlive() && (getRider() == null || !this.isControllable())) { // Purpur ++ if (this.isAlive() && (getRider() == null || !this.isControllable())) { // Purpur - Ridables if (this.isImmobile()) { this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.0D); } else { -@@ -150,7 +192,7 @@ public class Ravager extends Raider { +@@ -150,7 +195,7 @@ public class Ravager extends Raider { if (world instanceof ServerLevel) { ServerLevel worldserver = (ServerLevel) world; - if (this.horizontalCollision && worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (this.horizontalCollision && (worldserver.purpurConfig.ravagerBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // Purpur ++ if (this.horizontalCollision && (worldserver.purpurConfig.ravagerBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // Purpur - Add mobGriefing bypass to everything affected 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(); -@@ -160,7 +202,7 @@ public class Ravager extends Raider { +@@ -160,7 +205,7 @@ public class Ravager extends Raider { BlockState iblockdata = worldserver.getBlockState(blockposition); Block block = iblockdata.getBlock(); - if (block instanceof LeavesBlock) { -+ if (this.level().purpurConfig.ravagerGriefableBlocks.contains(block)) { // Purpur ++ if (this.level().purpurConfig.ravagerGriefableBlocks.contains(block)) { // Purpur - Configurable ravager griefable blocks list // CraftBukkit start if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state continue; 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 64d99b8b576212f754bd316343562b1ba7f604fa..b940cb26de3852e2127ccdd1f6c067123a909c25 100644 +index 64d99b8b576212f754bd316343562b1ba7f604fa..78ac42c89cb768e0dfb17197a850a029937c145c 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Shulker.java +++ b/src/main/java/net/minecraft/world/entity/monster/Shulker.java @@ -84,7 +84,7 @@ public class Shulker extends AbstractGolem implements VariantHolder public - Configurable entity base attributes private float currentPeekAmountO; private float currentPeekAmount; @Nullable -@@ -98,12 +98,60 @@ public class Shulker extends AbstractGolem implements VariantHolder variant) { -@@ -601,7 +658,7 @@ public class Shulker extends AbstractGolem implements VariantHolder getVariant() { @@ -12213,24 +12421,24 @@ index 64d99b8b576212f754bd316343562b1ba7f604fa..b940cb26de3852e2127ccdd1f6c06712 } @Nullable -@@ -611,7 +668,7 @@ public class Shulker extends AbstractGolem implements VariantHolder(this, Player.class, true)); } -@@ -165,12 +202,12 @@ public class Silverfish extends Monster { +@@ -165,12 +205,12 @@ public class Silverfish extends Monster { if (block instanceof InfestedBlock) { // CraftBukkit start - BlockState afterState = getServerLevel(world).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) ? iblockdata.getFluidState().createLegacyBlock() : ((InfestedBlock) block).hostStateByInfested(world.getBlockState(blockposition1)); // Paper - fix wrong block state -+ BlockState afterState = (getServerLevel(world).purpurConfig.silverfishBypassMobGriefing ^ getServerLevel(world).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) ? iblockdata.getFluidState().createLegacyBlock() : ((InfestedBlock) block).hostStateByInfested(world.getBlockState(blockposition1)); // Paper - fix wrong block state ++ BlockState afterState = (getServerLevel(world).purpurConfig.silverfishBypassMobGriefing ^ getServerLevel(world).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) ? iblockdata.getFluidState().createLegacyBlock() : ((InfestedBlock) block).hostStateByInfested(world.getBlockState(blockposition1)); // Paper - fix wrong block state // Purpur - Add mobGriefing bypass to everything affected if (!CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, afterState)) { // Paper - fix wrong block state continue; } // CraftBukkit end - if (getServerLevel(world).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { -+ if (getServerLevel(world).purpurConfig.silverfishBypassMobGriefing ^ getServerLevel(world).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur ++ if (getServerLevel(world).purpurConfig.silverfishBypassMobGriefing ^ getServerLevel(world).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur - Add mobGriefing bypass to everything affected world.destroyBlock(blockposition1, true, this.silverfish); } else { world.setBlock(blockposition1, ((InfestedBlock) block).hostStateByInfested(world.getBlockState(blockposition1)), 3); -@@ -208,7 +245,7 @@ public class Silverfish extends Monster { +@@ -208,7 +248,7 @@ public class Silverfish extends Monster { } else { RandomSource randomsource = this.mob.getRandom(); - if (getServerLevel((Entity) this.mob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && randomsource.nextInt(reducedTickDelay(10)) == 0) { -+ if (getServerLevel((Entity) this.mob).purpurConfig.silverfishBypassMobGriefing ^ getServerLevel((Entity) this.mob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && randomsource.nextInt(reducedTickDelay(10)) == 0) { // Purpur ++ if (getServerLevel((Entity) this.mob).purpurConfig.silverfishBypassMobGriefing ^ getServerLevel((Entity) this.mob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && randomsource.nextInt(reducedTickDelay(10)) == 0) { // Purpur - Add mobGriefing bypass to everything affected this.selectedDirection = Direction.getRandom(randomsource); BlockPos blockposition = BlockPos.containing(this.mob.getX(), this.mob.getY() + 0.5D, this.mob.getZ()).relative(this.selectedDirection); BlockState iblockdata = this.mob.level().getBlockState(blockposition); diff --git a/src/main/java/net/minecraft/world/entity/monster/Skeleton.java b/src/main/java/net/minecraft/world/entity/monster/Skeleton.java -index 3972e2ed0554e2550519e994888e068df0a151e5..84bd180ce29d4560675b029a1fa01b03ac698249 100644 +index 3972e2ed0554e2550519e994888e068df0a151e5..f1a9546aaa8499b198228f6a684850f7b20e67c9 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Skeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/Skeleton.java @@ -17,6 +17,16 @@ import net.minecraft.world.item.Items; @@ -12323,11 +12534,11 @@ index 3972e2ed0554e2550519e994888e068df0a151e5..84bd180ce29d4560675b029a1fa01b03 public class Skeleton extends AbstractSkeleton { private static final int TOTAL_CONVERSION_TIME = 300; -@@ -29,6 +39,40 @@ public class Skeleton extends AbstractSkeleton { +@@ -29,6 +39,41 @@ public class Skeleton extends AbstractSkeleton { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.skeletonRidable; @@ -12342,29 +12553,30 @@ index 3972e2ed0554e2550519e994888e068df0a151e5..84bd180ce29d4560675b029a1fa01b03 + public boolean isControllable() { + return level().purpurConfig.skeletonControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.skeletonMaxHealth); + } -+ -+ // Purpur start ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.skeletonTakeDamageFromWater; + } -+ // Purpur end -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.skeletonAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { super.defineSynchedData(builder); -@@ -147,4 +191,64 @@ public class Skeleton extends AbstractSkeleton { +@@ -147,4 +192,64 @@ public class Skeleton extends AbstractSkeleton { } } @@ -12430,38 +12642,28 @@ index 3972e2ed0554e2550519e994888e068df0a151e5..84bd180ce29d4560675b029a1fa01b03 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java -index 72346a7e5269c91e3143933ac37e65ad9639b791..dad4ef9c672eb4247142de5d045678795951164c 100644 +index 72346a7e5269c91e3143933ac37e65ad9639b791..d58f7b251d0c322d63e7e5e8ed30b41427a11227 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java @@ -65,6 +65,7 @@ public class Slime extends Mob implements Enemy { public float squish; public float oSquish; private boolean wasOnGround; -+ protected boolean actualJump; // Purpur ++ protected boolean actualJump; // Purpur - Ridables public Slime(EntityType type, Level world) { super(type, world); -@@ -72,12 +73,89 @@ public class Slime extends Mob implements Enemy { +@@ -72,12 +73,92 @@ public class Slime extends Mob implements Enemy { this.moveControl = new Slime.SlimeMoveControl(this); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.slimeRidable; + } + + @Override -+ public boolean isSensitiveToWater() { -+ return this.level().purpurConfig.slimeTakeDamageFromWater; -+ } -+ -+ @Override -+ protected boolean isAlwaysExperienceDropper() { -+ return this.level().purpurConfig.slimeAlwaysDropExp; -+ } -+ -+ @Override + public boolean dismountsUnderwater() { + return level().purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level().purpurConfig.slimeRidableInWater; + } @@ -12487,7 +12689,9 @@ index 72346a7e5269c91e3143933ac37e65ad9639b791..dad4ef9c672eb4247142de5d04567879 + } + return true; // do not jump() in wasd controller, let vanilla controller handle + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + protected String getMaxHealthEquation() { + return level().purpurConfig.slimeMaxHealth; + } @@ -12518,60 +12722,71 @@ index 72346a7e5269c91e3143933ac37e65ad9639b791..dad4ef9c672eb4247142de5d04567879 + } + return value; + } -+ // Purpur end -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage ++ @Override ++ public boolean isSensitiveToWater() { ++ return this.level().purpurConfig.slimeTakeDamageFromWater; ++ } ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience ++ @Override ++ protected boolean isAlwaysExperienceDropper() { ++ return this.level().purpurConfig.slimeAlwaysDropExp; ++ } ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new Slime.SlimeFloatGoal(this)); this.goalSelector.addGoal(2, new Slime.SlimeAttackGoal(this)); this.goalSelector.addGoal(3, new Slime.SlimeRandomDirectionGoal(this)); this.goalSelector.addGoal(5, new Slime.SlimeKeepOnJumpingGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (entityliving, worldserver) -> { return Math.abs(entityliving.getY() - this.getY()) <= 4.0D; })); -@@ -102,9 +180,9 @@ public class Slime extends Mob implements Enemy { +@@ -102,9 +183,9 @@ public class Slime extends Mob implements Enemy { this.entityData.set(Slime.ID_SIZE, j); this.reapplyPosition(); this.refreshDimensions(); - this.getAttribute(Attributes.MAX_HEALTH).setBaseValue((double) (j * j)); -+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(getFromCache(this::getMaxHealthEquation, this::getMaxHealthCache, () -> (double) size * size)); // Purpur ++ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(getFromCache(this::getMaxHealthEquation, this::getMaxHealthCache, () -> (double) size * size)); // Purpur - Configurable entity base attributes this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue((double) (0.2F + 0.1F * (float) j)); - this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue((double) j); -+ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(getFromCache(this::getAttackDamageEquation, this::getAttackDamageCache, () -> (double) j)); // Purpur ++ this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(getFromCache(this::getAttackDamageEquation, this::getAttackDamageCache, () -> (double) j)); // Purpur - Configurable entity base attributes if (heal) { this.setHealth(this.getMaxHealth()); } -@@ -386,6 +464,7 @@ public class Slime extends Mob implements Enemy { +@@ -386,6 +467,7 @@ public class Slime extends Mob implements Enemy { this.setDeltaMovement(vec3d.x, (double) this.getJumpPower(), vec3d.z); this.hasImpulse = true; -+ this.actualJump = false; // Purpur ++ this.actualJump = false; // Purpur - Ridables } @Nullable -@@ -419,7 +498,7 @@ public class Slime extends Mob implements Enemy { +@@ -419,7 +501,7 @@ public class Slime extends Mob implements Enemy { return super.getDefaultDimensions(pose).scale((float) this.getSize()); } - private static class SlimeMoveControl extends MoveControl { -+ private static class SlimeMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur ++ private static class SlimeMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur - Ridables private float yRot; private int jumpDelay; -@@ -438,21 +517,33 @@ public class Slime extends Mob implements Enemy { +@@ -438,21 +520,33 @@ public class Slime extends Mob implements Enemy { } public void setWantedMovement(double speed) { - this.speedModifier = speed; -+ this.setSpeedModifier(speed); // Purpur ++ this.setSpeedModifier(speed); // Purpur - Ridables this.operation = MoveControl.Operation.MOVE_TO; } @Override public void tick() { -+ // Purpur start ++ // Purpur start - Ridables + if (slime.getRider() != null && slime.isControllable()) { + purpurTick(slime.getRider()); + if (slime.getForwardMot() != 0 || slime.getStrafeMot() != 0) { @@ -12582,39 +12797,39 @@ index 72346a7e5269c91e3143933ac37e65ad9639b791..dad4ef9c672eb4247142de5d04567879 + jumpDelay = 20; + } + } else { -+ // Purpur end ++ // Purpur end - Ridables this.mob.setYRot(this.rotlerp(this.mob.getYRot(), this.yRot, 90.0F)); this.mob.yHeadRot = this.mob.getYRot(); this.mob.yBodyRot = this.mob.getYRot(); - if (this.operation != MoveControl.Operation.MOVE_TO) { -+ } if ((slime.getRider() == null || !slime.isControllable()) && this.operation != MoveControl.Operation.MOVE_TO) { // Purpur ++ } if ((slime.getRider() == null || !slime.isControllable()) && this.operation != MoveControl.Operation.MOVE_TO) { // Purpur - Ridables this.mob.setZza(0.0F); } else { this.operation = MoveControl.Operation.WAIT; if (this.mob.onGround()) { - this.mob.setSpeed((float) (this.speedModifier * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED))); -+ this.mob.setSpeed((float) (this.getSpeedModifier() * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED) * (slime.getRider() != null && slime.isControllable() && (slime.getRider().getForwardMot() != 0 || slime.getRider().getStrafeMot() != 0) ? 2.0D : 1.0D))); // Purpur ++ this.mob.setSpeed((float) (this.getSpeedModifier() * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED) * (slime.getRider() != null && slime.isControllable() && (slime.getRider().getForwardMot() != 0 || slime.getRider().getStrafeMot() != 0) ? 2.0D : 1.0D))); // Purpur - Ridables if (this.jumpDelay-- <= 0) { this.jumpDelay = this.slime.getJumpDelay(); if (this.isAggressive) { -@@ -469,7 +560,7 @@ public class Slime extends Mob implements Enemy { +@@ -469,7 +563,7 @@ public class Slime extends Mob implements Enemy { this.mob.setSpeed(0.0F); } } else { - this.mob.setSpeed((float) (this.speedModifier * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED))); -+ this.mob.setSpeed((float) (this.getSpeedModifier() * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED) * (slime.getRider() != null && slime.isControllable() && (slime.getRider().getForwardMot() != 0 || slime.getRider().getStrafeMot() != 0) ? 2.0D : 1.0D))); // Purpur ++ this.mob.setSpeed((float) (this.getSpeedModifier() * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED) * (slime.getRider() != null && slime.isControllable() && (slime.getRider().getForwardMot() != 0 || slime.getRider().getStrafeMot() != 0) ? 2.0D : 1.0D))); // Purpur - Ridables } } diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java -index 91e521414c3ea5722aac7506b7589fbb399e9636..1669acbcf97bee0fa6b0ee91cf53217c53cf55d8 100644 +index 91e521414c3ea5722aac7506b7589fbb399e9636..12bae0aa2f1cf3059b9c70f5377649cd9f8257aa 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Spider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java -@@ -51,9 +51,43 @@ public class Spider extends Monster { +@@ -51,9 +51,46 @@ public class Spider extends Monster { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.spiderRidable; @@ -12629,48 +12844,51 @@ index 91e521414c3ea5722aac7506b7589fbb399e9636..1669acbcf97bee0fa6b0ee91cf53217c + public boolean isControllable() { + return level().purpurConfig.spiderControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.spiderMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.spiderScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.spiderTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.spiderAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { 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 org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, Armadillo.class, 6.0F, 1.0D, 1.2D, (entityliving) -> { return !((Armadillo) entityliving).isScared(); })); -@@ -62,6 +96,7 @@ public class Spider extends Monster { +@@ -62,6 +99,7 @@ public class Spider extends Monster { this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.8D)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(6, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0])); this.targetSelector.addGoal(2, new Spider.SpiderTargetGoal<>(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 baaf17107584b253d7e268749849bf5b0d0c88ab..bb6984d82e6c0a83f456e725b20e0f21e0cac602 100644 +index baaf17107584b253d7e268749849bf5b0d0c88ab..b8b9b4316bebae4564fac4c56b303735b86563fb 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Stray.java +++ b/src/main/java/net/minecraft/world/entity/monster/Stray.java -@@ -22,6 +22,38 @@ public class Stray extends AbstractSkeleton { +@@ -22,6 +22,41 @@ public class Stray extends AbstractSkeleton { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.strayRidable; @@ -12685,42 +12903,45 @@ index baaf17107584b253d7e268749849bf5b0d0c88ab..bb6984d82e6c0a83f456e725b20e0f21 + public boolean isControllable() { + return level().purpurConfig.strayControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.strayMaxHealth); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.strayTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.strayAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience public static boolean checkStraySpawnRules( EntityType type, ServerLevelAccessor world, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random ) { 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 0a9246241985d2d97beb865b7163f1d2198f03b8..779ae2e63202c1f189b1f5647218a07c21a84ccd 100644 +index 0a9246241985d2d97beb865b7163f1d2198f03b8..df44d9fbb71ff252cd261fc8da6de14383e054de 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Strider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Strider.java -@@ -91,12 +91,45 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -91,12 +91,48 @@ 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; - this.setPathfindingMalus(PathType.WATER, -1.0F); -+ if (isSensitiveToWater()) this.setPathfindingMalus(PathType.WATER, -1.0F); // Purpur ++ if (isSensitiveToWater()) this.setPathfindingMalus(PathType.WATER, -1.0F); // Purpur - Toggle for water sensitive mob damage this.setPathfindingMalus(PathType.LAVA, 0.0F); this.setPathfindingMalus(PathType.DANGER_FIRE, 0.0F); this.setPathfindingMalus(PathType.DAMAGE_FIRE, 0.0F); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.striderRidable; @@ -12735,45 +12956,48 @@ index 0a9246241985d2d97beb865b7163f1d2198f03b8..779ae2e63202c1f189b1f5647218a07c + public boolean isControllable() { + return level().purpurConfig.striderControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.striderMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.striderScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.striderBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.striderAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience public static boolean checkStriderSpawnRules(EntityType type, LevelAccessor world, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random) { BlockPos.MutableBlockPos blockposition_mutableblockposition = pos.mutable(); -@@ -158,6 +191,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -158,6 +194,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { @Override protected void registerGoals() { this.goalSelector.addGoal(1, new PanicGoal(this, 1.65D)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D)); this.temptGoal = new TemptGoal(this, 1.4D, (itemstack) -> { return itemstack.is(ItemTags.STRIDER_TEMPT_ITEMS); -@@ -412,7 +446,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -412,7 +449,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { @Override public boolean isSensitiveToWater() { - return true; -+ return this.level().purpurConfig.striderTakeDamageFromWater; // Purpur ++ return this.level().purpurConfig.striderTakeDamageFromWater; // Purpur - Toggle for water sensitive mob damage } @Override -@@ -454,6 +488,19 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -454,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)); @@ -12793,24 +13017,24 @@ index 0a9246241985d2d97beb865b7163f1d2198f03b8..779ae2e63202c1f189b1f5647218a07c if (!flag && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) { if (!this.level().isClientSide) { player.startRiding(this); -@@ -466,7 +513,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -466,7 +516,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { if (!enuminteractionresult.consumesAction()) { ItemStack itemstack = player.getItemInHand(hand); - return (InteractionResult) (itemstack.is(Items.SADDLE) ? itemstack.interactLivingEntity(player, this, hand) : InteractionResult.PASS); -+ return (InteractionResult) (itemstack.is(Items.SADDLE) ? itemstack.interactLivingEntity(player, this, hand) : tryRide(player, hand)); // Purpur ++ return (InteractionResult) (itemstack.is(Items.SADDLE) ? itemstack.interactLivingEntity(player, this, hand) : tryRide(player, hand)); // Purpur - Ridables } else { 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 183a33b7d666d652b455baa7e8339e9c4a870a58..fe19c0cf6a2c81b547158179518bf26be388cc7a 100644 +index 183a33b7d666d652b455baa7e8339e9c4a870a58..ec61bc0d9b934ceed15b721e86200abfea21a923 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Vex.java +++ b/src/main/java/net/minecraft/world/entity/monster/Vex.java -@@ -59,6 +59,66 @@ public class Vex extends Monster implements TraceableEntity { +@@ -59,6 +59,69 @@ public class Vex extends Monster implements TraceableEntity { this.xpReward = 3; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.vexRidable; @@ -12852,46 +13076,49 @@ index 183a33b7d666d652b455baa7e8339e9c4a870a58..fe19c0cf6a2c81b547158179518bf26b + public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { + return false; // no fall damage please + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.vexMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.vexScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.vexTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.vexAlwaysDropExp; + } -+ // Purpur end -+ ++ // Purpur end - Mobs always drop experience @Override public boolean isFlapping() { return this.tickCount % Vex.TICKS_PER_FLAP == 0; -@@ -71,7 +131,7 @@ public class Vex extends Monster implements TraceableEntity { +@@ -71,7 +134,7 @@ public class Vex extends Monster implements TraceableEntity { @Override public void tick() { - this.noPhysics = true; -+ this.noPhysics = getRider() == null || !this.isControllable(); // Purpur ++ this.noPhysics = getRider() == null || !this.isControllable(); // Purpur - Ridables super.tick(); this.noPhysics = false; this.setNoGravity(true); -@@ -86,17 +146,19 @@ public class Vex extends Monster implements TraceableEntity { +@@ -86,17 +149,19 @@ public class Vex extends Monster implements TraceableEntity { protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(4, new Vex.VexChargeAttackGoal()); this.goalSelector.addGoal(8, new Vex.VexRandomMoveGoal()); this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F)); this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Raider.class})).setAlertOthers()); this.targetSelector.addGoal(2, new Vex.VexCopyOwnerTargetGoal(this)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, true)); @@ -12903,12 +13130,12 @@ index 183a33b7d666d652b455baa7e8339e9c4a870a58..fe19c0cf6a2c81b547158179518bf26b } @Override -@@ -228,14 +290,14 @@ public class Vex extends Monster implements TraceableEntity { +@@ -228,14 +293,14 @@ public class Vex extends Monster implements TraceableEntity { this.setDropChance(EquipmentSlot.MAINHAND, 0.0F); } - private class VexMoveControl extends MoveControl { -+ private class VexMoveControl extends org.purpurmc.purpur.controller.FlyingMoveControllerWASD { // Purpur ++ private class VexMoveControl extends org.purpurmc.purpur.controller.FlyingMoveControllerWASD { // Purpur - Ridables public VexMoveControl(final Vex entityvex) { super(entityvex); @@ -12916,28 +13143,28 @@ index 183a33b7d666d652b455baa7e8339e9c4a870a58..fe19c0cf6a2c81b547158179518bf26b @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables 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(); -@@ -244,7 +306,7 @@ public class Vex extends Monster implements TraceableEntity { +@@ -244,7 +309,7 @@ public class Vex extends Monster implements TraceableEntity { this.operation = MoveControl.Operation.WAIT; Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().scale(0.5D)); } else { - Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().add(vec3d.scale(this.speedModifier * 0.05D / d0))); -+ Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().add(vec3d.scale(this.getSpeedModifier() * 0.05D / d0))); // Purpur ++ Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().add(vec3d.scale(this.getSpeedModifier() * 0.05D / d0))); // Purpur - Ridables if (Vex.this.getTarget() == null) { 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 96b105697c91314148fd1b783501389214b1a3f0..a2c81d2a1077b2977f1595fd592044baf3e81bab 100644 +index 96b105697c91314148fd1b783501389214b1a3f0..3d1cb875edfe6bf5c9e3f4b7dade7868b7dbfa93 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java +++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -@@ -55,15 +55,50 @@ public class Vindicator extends AbstractIllager { +@@ -55,15 +55,53 @@ public class Vindicator extends AbstractIllager { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.vindicatorRidable; @@ -12952,39 +13179,42 @@ index 96b105697c91314148fd1b783501389214b1a3f0..a2c81d2a1077b2977f1595fd592044ba + public boolean isControllable() { + return level().purpurConfig.vindicatorControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.vindicatorMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.vindicatorScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.vindicatorTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.vindicatorAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(1, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 1.0, 1.2)); this.goalSelector.addGoal(2, new Vindicator.VindicatorBreakDoorGoal(this)); this.goalSelector.addGoal(3, new AbstractIllager.RaiderOpenDoorGoal(this)); this.goalSelector.addGoal(4, new Raider.HoldGroundAttackGoal(this, 10.0F)); this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0, false)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new HurtByTargetGoal(this, Raider.class).setAlertOthers()); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, true)); -@@ -132,6 +167,11 @@ public class Vindicator extends AbstractIllager { +@@ -132,6 +170,11 @@ public class Vindicator extends AbstractIllager { RandomSource randomSource = world.getRandom(); this.populateDefaultEquipmentSlots(randomSource, difficulty); this.populateDefaultEquipmentEnchantments(world, randomSource, difficulty); @@ -12997,14 +13227,14 @@ index 96b105697c91314148fd1b783501389214b1a3f0..a2c81d2a1077b2977f1595fd592044ba } 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 a03fa8a3e648532a7ffaaf523ca87c13e8af4c0a..313228811d1eff478887511f99b49706efc49774 100644 +index a03fa8a3e648532a7ffaaf523ca87c13e8af4c0a..8e7f4cb8ede8721f05c6c35e9b4d08884254853e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Witch.java +++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java -@@ -57,6 +57,39 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -57,6 +57,42 @@ public class Witch extends Raider implements RangedAttackMob { super(type, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.witchRidable; @@ -13019,49 +13249,52 @@ index a03fa8a3e648532a7ffaaf523ca87c13e8af4c0a..313228811d1eff478887511f99b49706 + public boolean isControllable() { + return level().purpurConfig.witchControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.witchMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.witchScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.witchTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.witchAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { super.registerGoals(); -@@ -65,10 +98,12 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -65,10 +101,12 @@ public class Witch extends Raider implements RangedAttackMob { }); this.attackPlayersGoal = new NearestAttackableWitchTargetGoal<>(this, Player.class, 10, true, false, (TargetingConditions.Selector) null); 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 org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.goalSelector.addGoal(2, new RangedAttackGoal(this, 1.0D, 60, 10.0F)); this.goalSelector.addGoal(2, new WaterAvoidingRandomStrollGoal(this, 1.0D)); this.goalSelector.addGoal(3, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(3, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[]{Raider.class})); 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 557b4e225688416132281e9b1759d46a9b775ff9..80968050fa7680a8d9b379ef7a8db5e91a4b3a8f 100644 +index 557b4e225688416132281e9b1759d46a9b775ff9..351a35bdcb820c9c65aeddfbe0f00486d8057f7c 100644 --- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java -@@ -36,6 +36,39 @@ public class WitherSkeleton extends AbstractSkeleton { +@@ -36,6 +36,42 @@ public class WitherSkeleton extends AbstractSkeleton { this.setPathfindingMalus(PathType.LAVA, 8.0F); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.witherSkeletonRidable; @@ -13076,36 +13309,39 @@ index 557b4e225688416132281e9b1759d46a9b775ff9..80968050fa7680a8d9b379ef7a8db5e9 + public boolean isControllable() { + return level().purpurConfig.witherSkeletonControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.witherSkeletonMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.witherSkeletonScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.witherSkeletonTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.witherSkeletonAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override 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 35b0c5c322864e2f5ae5a412296072f268adcd05..cb20c018c11a0e707c2083cf964bd5303d216edd 100644 +index 35b0c5c322864e2f5ae5a412296072f268adcd05..8aec50e7330d16bd3d0bc027c191fa1a4ce4552b 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java -@@ -85,6 +85,39 @@ public class Zoglin extends Monster implements HoglinBase { +@@ -85,6 +85,42 @@ public class Zoglin extends Monster implements HoglinBase { this.xpReward = 5; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.zoglinRidable; @@ -13120,28 +13356,31 @@ index 35b0c5c322864e2f5ae5a412296072f268adcd05..cb20c018c11a0e707c2083cf964bd530 + public boolean isControllable() { + return level().purpurConfig.zoglinControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.zoglinMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.zoglinScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.zoglinTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.zoglinAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected Brain.Provider brainProvider() { return Brain.provider(MEMORY_TYPES, SENSOR_TYPES); -@@ -250,6 +283,7 @@ public class Zoglin extends Monster implements HoglinBase { +@@ -250,6 +286,7 @@ public class Zoglin extends Monster implements HoglinBase { protected void customServerAiStep(ServerLevel world) { ProfilerFiller profilerFiller = Profiler.get(); profilerFiller.push("zoglinBrain"); @@ -13150,10 +13389,10 @@ index 35b0c5c322864e2f5ae5a412296072f268adcd05..cb20c018c11a0e707c2083cf964bd530 profilerFiller.pop(); this.updateActivity(); 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 a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac6a17a151 100644 +index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..867d9ddce630482a7d3fadfe5aab213a0f912ca4 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -99,22 +99,70 @@ public class Zombie extends Monster { +@@ -99,22 +99,74 @@ public class Zombie extends Monster { private int inWaterTime; public int conversionTime; // private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field // Paper - remove anti tick skipping measures / wall time @@ -13170,7 +13409,7 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac this(EntityType.ZOMBIE, world); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.zombieRidable; @@ -13185,14 +13424,16 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac + public boolean isControllable() { + return level().purpurConfig.zombieControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.zombieMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.zombieScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Configurable jockey options + public boolean jockeyOnlyBaby() { + return level().purpurConfig.zombieJockeyOnlyBaby; + } @@ -13204,28 +13445,30 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac + public boolean jockeyTryExistingChickens() { + return level().purpurConfig.zombieJockeyTryExistingChickens; + } -+ ++ // Purpur end - Configurable jockey options ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.zombieTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.zombieAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables if (this.level().paperConfig().entities.behavior.zombiesTargetTurtleEggs) this.goalSelector.addGoal(4, new Zombie.ZombieAttackTurtleEggGoal(this, 1.0D, 3)); // Paper - Add zombie targets turtle egg config this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.addBehaviourGoals(); } -@@ -124,7 +172,19 @@ public class Zombie extends Monster { +@@ -124,7 +176,19 @@ public class Zombie extends Monster { this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D)); this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers(ZombifiedPiglin.class)); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); @@ -13246,7 +13489,7 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true)); this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR)); } -@@ -239,32 +299,7 @@ public class Zombie extends Monster { +@@ -239,32 +303,7 @@ public class Zombie extends Monster { @Override public void aiStep() { @@ -13280,7 +13523,7 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac super.aiStep(); } -@@ -324,6 +359,7 @@ public class Zombie extends Monster { +@@ -324,6 +363,7 @@ public class Zombie extends Monster { // CraftBukkit end } @@ -13288,7 +13531,7 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac public boolean isSunSensitive() { return this.shouldBurnInDay; // Paper - Add more Zombie API } -@@ -462,7 +498,7 @@ public class Zombie extends Monster { +@@ -462,7 +502,7 @@ public class Zombie extends Monster { nbt.putBoolean("CanBreakDoors", this.canBreakDoors()); nbt.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1); nbt.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1); @@ -13297,7 +13540,7 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac } @Override -@@ -475,7 +511,7 @@ public class Zombie extends Monster { +@@ -475,7 +515,7 @@ public class Zombie extends Monster { this.startUnderWaterConversion(nbt.getInt("DrownedConversionTime")); } // Paper start - Add more Zombie API @@ -13306,7 +13549,7 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); } // Paper end - Add more Zombie API -@@ -528,19 +564,20 @@ public class Zombie extends Monster { +@@ -528,19 +568,20 @@ public class Zombie extends Monster { } if (object instanceof Zombie.ZombieGroupData entityzombie_groupdatazombie) { @@ -13333,7 +13576,7 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac Chicken entitychicken1 = (Chicken) EntityType.CHICKEN.create(this.level(), EntitySpawnReason.JOCKEY); if (entitychicken1 != null) { -@@ -550,6 +587,7 @@ public class Zombie extends Monster { +@@ -550,6 +591,7 @@ public class Zombie extends Monster { this.startRiding(entitychicken1); world.addFreshEntity(entitychicken1, CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit } @@ -13341,7 +13584,7 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac } } } -@@ -562,11 +600,7 @@ public class Zombie extends Monster { +@@ -562,11 +604,7 @@ public class Zombie extends Monster { } if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) { @@ -13354,24 +13597,24 @@ index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..85b03e0bf7436cb846df13c575ad78ac this.setItemSlot(EquipmentSlot.HEAD, new ItemStack(randomsource.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN)); this.armorDropChances[EquipmentSlot.HEAD.getIndex()] = 0.0F; } -@@ -608,7 +642,7 @@ public class Zombie extends Monster { +@@ -608,7 +646,7 @@ public class Zombie extends Monster { } protected void randomizeReinforcementsChance() { - this.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * 0.10000000149011612D); -+ this.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level().purpurConfig.zombieSpawnReinforcements); // Purpur ++ this.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level().purpurConfig.zombieSpawnReinforcements); // Purpur - Configurable entity base attributes } @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 30bce56a70f923b0ec77c8e3f29e435a71c71510..cd66ef1d99f3ce4533c2423fd12b2fcadf481a66 100644 +index 30bce56a70f923b0ec77c8e3f29e435a71c71510..bba3562bf316878e7b8ba6a138889d9583a1b0f6 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java -@@ -85,6 +85,58 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { +@@ -85,6 +85,62 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { }); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.zombieVillagerRidable; @@ -13386,8 +13629,9 @@ index 30bce56a70f923b0ec77c8e3f29e435a71c71510..cd66ef1d99f3ce4533c2423fd12b2fca + public boolean isControllable() { + return level().purpurConfig.zombieVillagerControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.zombieVillagerMaxHealth); @@ -13397,12 +13641,8 @@ index 30bce56a70f923b0ec77c8e3f29e435a71c71510..cd66ef1d99f3ce4533c2423fd12b2fca + protected void randomizeReinforcementsChance() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level().purpurConfig.zombieVillagerSpawnReinforcements); + } -+ -+ @Override -+ public boolean isSensitiveToWater() { -+ return this.level().purpurConfig.zombieVillagerTakeDamageFromWater; -+ } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Configurable jockey options + @Override + public boolean jockeyOnlyBaby() { + return level().purpurConfig.zombieVillagerJockeyOnlyBaby; @@ -13417,16 +13657,23 @@ index 30bce56a70f923b0ec77c8e3f29e435a71c71510..cd66ef1d99f3ce4533c2423fd12b2fca + public boolean jockeyTryExistingChickens() { + return level().purpurConfig.zombieVillagerJockeyTryExistingChickens; + } -+ ++ // Purpur end - Configurable jockey options ++ // Purpur start - Toggle for water sensitive mob damage ++ @Override ++ public boolean isSensitiveToWater() { ++ return this.level().purpurConfig.zombieVillagerTakeDamageFromWater; ++ } ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.zombieVillagerAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { super.defineSynchedData(builder); -@@ -177,10 +229,10 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { +@@ -177,10 +233,10 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.is(Items.GOLDEN_APPLE)) { @@ -13435,19 +13682,19 @@ index 30bce56a70f923b0ec77c8e3f29e435a71c71510..cd66ef1d99f3ce4533c2423fd12b2fca itemstack.consume(1, player); if (!this.level().isClientSide) { - this.startConverting(player.getUUID(), this.random.nextInt(2401) + 3600); -+ this.startConverting(player.getUUID(), this.random.nextInt(level().purpurConfig.zombieVillagerCuringTimeMax - level().purpurConfig.zombieVillagerCuringTimeMin + 1) + level().purpurConfig.zombieVillagerCuringTimeMin); // Purpur ++ this.startConverting(player.getUUID(), this.random.nextInt(level().purpurConfig.zombieVillagerCuringTimeMax - level().purpurConfig.zombieVillagerCuringTimeMin + 1) + level().purpurConfig.zombieVillagerCuringTimeMin); // Purpur - Customizeable Zombie Villager curing times } return InteractionResult.SUCCESS_SERVER; 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 03e3cbe73119ca76417d4dd192e1560bdfc373ec..8c3271dcc8c9aa58e2e007eba282c11e42b4e0c9 100644 +index 03e3cbe73119ca76417d4dd192e1560bdfc373ec..c0e611f3222ffacfbd0683c8c65b778f9012a2ad 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,54 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -63,6 +63,58 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { this.setPathfindingMalus(PathType.LAVA, 8.0F); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.zombifiedPiglinRidable; @@ -13462,19 +13709,16 @@ index 03e3cbe73119ca76417d4dd192e1560bdfc373ec..8c3271dcc8c9aa58e2e007eba282c11e + public boolean isControllable() { + return level().purpurConfig.zombifiedPiglinControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.zombifiedPiglinMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.zombifiedPiglinScale); + } -+ -+ @Override -+ public boolean isSensitiveToWater() { -+ return this.level().purpurConfig.zombifiedPiglinTakeDamageFromWater; -+ } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Configurable jockey options + @Override + public boolean jockeyOnlyBaby() { + return level().purpurConfig.zombifiedPiglinJockeyOnlyBaby; @@ -13489,16 +13733,23 @@ index 03e3cbe73119ca76417d4dd192e1560bdfc373ec..8c3271dcc8c9aa58e2e007eba282c11e + public boolean jockeyTryExistingChickens() { + return level().purpurConfig.zombifiedPiglinJockeyTryExistingChickens; + } -+ ++ // Purpur end - Configurable jockey options ++ // Purpur start - Toggle for water sensitive mob damage ++ @Override ++ public boolean isSensitiveToWater() { ++ return this.level().purpurConfig.zombifiedPiglinTakeDamageFromWater; ++ } ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.zombifiedPiglinAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override public void setPersistentAngerTarget(@Nullable UUID angryAt) { this.persistentAngerTarget = angryAt; -@@ -110,7 +158,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -110,7 +162,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { this.maybeAlertOthers(); } @@ -13507,7 +13758,7 @@ index 03e3cbe73119ca76417d4dd192e1560bdfc373ec..8c3271dcc8c9aa58e2e007eba282c11e this.lastHurtByPlayerTime = this.tickCount; } -@@ -165,7 +213,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -165,7 +217,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { this.ticksUntilNextAlert = ZombifiedPiglin.ALERT_INTERVAL.sample(this.random); } @@ -13516,24 +13767,24 @@ index 03e3cbe73119ca76417d4dd192e1560bdfc373ec..8c3271dcc8c9aa58e2e007eba282c11e this.setLastHurtByPlayer((Player) entityliving); } -@@ -245,7 +293,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -245,7 +297,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { @Override protected void randomizeReinforcementsChance() { - this.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(0.0D); -+ this.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level().purpurConfig.zombifiedPiglinSpawnReinforcements); // Purpur ++ this.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(this.random.nextDouble() * this.level().purpurConfig.zombifiedPiglinSpawnReinforcements); // Purpur - Configurable entity base attributes } @Nullable diff --git a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java -index 6a7e725edece3043c8523d387e2929d5ba8932cb..57f07799e74ecd48b8e4af68569b46be42c721ea 100644 +index 6a7e725edece3043c8523d387e2929d5ba8932cb..1f37384368c26b4bdd69533887a8e9b8456f7096 100644 --- a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java +++ b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java -@@ -106,6 +106,29 @@ public class Creaking extends Monster { +@@ -106,6 +106,36 @@ public class Creaking extends Monster { return this.getHomePos() != null; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.creakingRidable; @@ -13551,35 +13802,27 @@ index 6a7e725edece3043c8523d387e2929d5ba8932cb..57f07799e74ecd48b8e4af68569b46be + + @Override + protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables + } -+ // Purpur end ++ // Purpur end - Ridables + - @Override - protected BodyRotationControl createBodyControl() { - return new Creaking.CreakingBodyRotationControl(this); -@@ -474,6 +497,14 @@ public class Creaking extends Monster { - return this.isActive() ? null : SoundEvents.CREAKING_AMBIENT; - } - -+ // Purpur start ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.creakingMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.creakingScale); + } -+ // Purpur end -+ ++ // Purpur end - Configurable entity base attributes @Override - protected SoundEvent getHurtSound(DamageSource source) { - return SoundEvents.CREAKING_SWAY; -@@ -575,31 +606,31 @@ public class Creaking extends Monster { + protected BodyRotationControl createBodyControl() { + return new Creaking.CreakingBodyRotationControl(this); +@@ -575,31 +605,31 @@ public class Creaking extends Monster { return 0.0F; } - private class CreakingLookControl extends LookControl { -+ private class CreakingLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur ++ private class CreakingLookControl extends org.purpurmc.purpur.controller.LookControllerWASD { // Purpur - Ridables public CreakingLookControl(final Creaking creaking) { super(creaking); @@ -13587,17 +13830,17 @@ index 6a7e725edece3043c8523d387e2929d5ba8932cb..57f07799e74ecd48b8e4af68569b46be @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (Creaking.this.canMove()) { - super.tick(); -+ super.vanillaTick(); // Purpur ++ super.vanillaTick(); // Purpur - Ridables } } } - private class CreakingMoveControl extends MoveControl { -+ private class CreakingMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur ++ private class CreakingMoveControl extends org.purpurmc.purpur.controller.MoveControllerWASD { // Purpur - Ridables public CreakingMoveControl(final Creaking creaking) { super(creaking); @@ -13605,22 +13848,22 @@ index 6a7e725edece3043c8523d387e2929d5ba8932cb..57f07799e74ecd48b8e4af68569b46be @Override - public void tick() { -+ public void vanillaTick() { // Purpur ++ public void vanillaTick() { // Purpur - Ridables if (Creaking.this.canMove()) { - super.tick(); -+ super.vanillaTick(); // Purpur ++ super.vanillaTick(); // Purpur - Ridables } } 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 92270912ef26924f611a1df7cb3d5b485b0a262d..6144613e834236ec0ebb12872ef9e47255b76b5b 100644 +index 92270912ef26924f611a1df7cb3d5b485b0a262d..e140d068b08d94c55945b30eab11adbface6fa09 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 -@@ -71,11 +71,49 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { +@@ -71,11 +71,53 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { this.xpReward = 5; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.hoglinRidable; @@ -13635,38 +13878,42 @@ index 92270912ef26924f611a1df7cb3d5b485b0a262d..6144613e834236ec0ebb12872ef9e472 + public boolean isControllable() { + return level().purpurConfig.hoglinControllable; + } ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.hoglinMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.hoglinScale); + } -+ // Purpur end -+ ++ // Purpur end - Configurable entity base attributes @VisibleForTesting public void setTimeInOverworld(int timeInOverworld) { this.timeInOverworld = timeInOverworld; } ++ // Purpur start - Make entity breeding times configurable + @Override + public int getPurpurBreedTime() { + return this.level().purpurConfig.hoglinBreedingTicks; + } -+ ++ // Purpur end - Make entity breeding times configurable ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.hoglinTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.hoglinAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override public boolean canBeLeashed() { return true; -@@ -138,11 +176,13 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { +@@ -138,11 +180,13 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { return (Brain) super.getBrain(); // CraftBukkit - decompile error } @@ -13681,14 +13928,14 @@ index 92270912ef26924f611a1df7cb3d5b485b0a262d..6144613e834236ec0ebb12872ef9e472 gameprofilerfiller.pop(); HoglinAi.updateActivity(this); 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 2121d2a2e1aa1d0f0390cc515317096431f6dcb0..a2d29cf854be6f0bc5b5bb99e7002e07ccc4cae9 100644 +index 2121d2a2e1aa1d0f0390cc515317096431f6dcb0..e6cb1f067f9920252e0bba9a493365c23b12cea7 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 -@@ -99,6 +99,39 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -99,6 +99,42 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento this.xpReward = 5; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.piglinRidable; @@ -13703,28 +13950,31 @@ index 2121d2a2e1aa1d0f0390cc515317096431f6dcb0..a2d29cf854be6f0bc5b5bb99e7002e07 + public boolean isControllable() { + return level().purpurConfig.piglinControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.piglinMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.piglinScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.piglinTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.piglinAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); -@@ -307,11 +340,13 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -307,11 +343,13 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento return !this.cannotHunt; } @@ -13738,12 +13988,12 @@ index 2121d2a2e1aa1d0f0390cc515317096431f6dcb0..a2d29cf854be6f0bc5b5bb99e7002e07 this.getBrain().tick(world, this); gameprofilerfiller.pop(); PiglinAi.updateActivity(this); -@@ -413,7 +448,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -413,7 +451,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @Override public boolean wantsToPickUp(ServerLevel world, ItemStack stack) { - return world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && this.canPickUpLoot() && PiglinAi.wantsToPickup(this, stack); -+ return (world.purpurConfig.piglinBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && this.canPickUpLoot() && PiglinAi.wantsToPickup(this, stack); // Purpur ++ return (world.purpurConfig.piglinBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && this.canPickUpLoot() && PiglinAi.wantsToPickup(this, stack); // Purpur - Add mobGriefing bypass to everything affected } protected boolean canReplaceCurrentItem(ItemStack stack) { @@ -13772,14 +14022,14 @@ index e283b1296c1e831376bfe9491cbf02ed4b3fffe4..27a6de70530c2a1cbe2f77a7fb493038 piglin.getBrain().eraseMemory(MemoryModuleType.WALK_TARGET); piglin.getNavigation().stop(); 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 24eaeb93284fe1a573026b85818a93a34fd9e1ec..bc3b0eb21200eae7e419b2571871b36fc1e07c0f 100644 +index 24eaeb93284fe1a573026b85818a93a34fd9e1ec..24e198440d4841daac664dc6c5a8a3dc6825b469 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 -@@ -65,6 +65,39 @@ public class PiglinBrute extends AbstractPiglin { +@@ -65,6 +65,42 @@ public class PiglinBrute extends AbstractPiglin { this.xpReward = 20; } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.piglinBruteRidable; @@ -13794,28 +14044,31 @@ index 24eaeb93284fe1a573026b85818a93a34fd9e1ec..bc3b0eb21200eae7e419b2571871b36f + public boolean isControllable() { + return level().purpurConfig.piglinBruteControllable; + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.piglinBruteMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.piglinBruteScale); + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.piglinBruteTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.piglinBruteAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience public static AttributeSupplier.Builder createAttributes() { return Monster.createMonsterAttributes() .add(Attributes.MAX_HEALTH, 50.0) -@@ -117,6 +150,7 @@ public class PiglinBrute extends AbstractPiglin { +@@ -117,6 +153,7 @@ public class PiglinBrute extends AbstractPiglin { protected void customServerAiStep(ServerLevel world) { ProfilerFiller profilerFiller = Profiler.get(); profilerFiller.push("piglinBruteBrain"); @@ -13824,17 +14077,17 @@ index 24eaeb93284fe1a573026b85818a93a34fd9e1ec..bc3b0eb21200eae7e419b2571871b36f profilerFiller.pop(); PiglinBruteAi.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 c47ed605f0822effd58df4f875297ed015e1e57e..cf231928bae5493b0684109c769d7da4dc36f872 100644 +index c47ed605f0822effd58df4f875297ed015e1e57e..74011f1ab7e48490109ad93d658bba216eef9e80 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 @@ -127,8 +127,32 @@ public class Warden extends Monster implements VibrationSystem { this.setPathfindingMalus(PathType.LAVA, 8.0F); this.setPathfindingMalus(PathType.DAMAGE_FIRE, 0.0F); this.setPathfindingMalus(PathType.DANGER_FIRE, 0.0F); -+ this.moveControl = new org.purpurmc.purpur.controller.MoveControllerWASD(this, 0.5F); // Purpur ++ this.moveControl = new org.purpurmc.purpur.controller.MoveControllerWASD(this, 0.5F); // Purpur - Ridables } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.wardenRidable; @@ -13852,10 +14105,10 @@ index c47ed605f0822effd58df4f875297ed015e1e57e..cf231928bae5493b0684109c769d7da4 + + @Override + protected void registerGoals() { -+ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur -+ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur ++ this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables ++ this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables + } -+ // Purpur end ++ // Purpur end - Ridables + @Override public Packet getAddEntityPacket(ServerEntity entityTrackerEntry) { @@ -13880,7 +14133,7 @@ index c47ed605f0822effd58df4f875297ed015e1e57e..cf231928bae5493b0684109c769d7da4 public boolean canTargetEntity(@Nullable Entity entity) { - boolean flag; - -+ if (getRider() != null && isControllable()) return false; // Purpur ++ if (getRider() != null && isControllable()) return false; // Purpur - Ridables if (entity instanceof LivingEntity entityliving) { if (this.level() == entity.level() && EntitySelector.NO_CREATIVE_OR_SPECTATOR.test(entity) && !this.isAlliedTo(entity) && entityliving.getType() != EntityType.ARMOR_STAND && entityliving.getType() != EntityType.WARDEN && !entityliving.isInvulnerable() && !entityliving.isDeadOrDying() && this.level().getWorldBorder().isWithinBounds(entityliving.getBoundingBox())) { - flag = true; @@ -13896,19 +14149,19 @@ index c47ed605f0822effd58df4f875297ed015e1e57e..cf231928bae5493b0684109c769d7da4 public static void applyDarknessAround(ServerLevel world, Vec3 pos, @Nullable Entity entity, int range) { diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index 3c037cabd8331eb96a6523b37abab4e73ab79a02..e2b00681e427bc99c3b3660d8f4830379b98c7a0 100644 +index 3c037cabd8331eb96a6523b37abab4e73ab79a02..94ba68e063e63f77f7951d482af7a3586ba4ffdf 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java @@ -48,6 +48,7 @@ import org.bukkit.event.entity.VillagerAcquireTradeEvent; // CraftBukkit end public abstract class AbstractVillager extends AgeableMob implements InventoryCarrier, Npc, Merchant { -+ static final net.minecraft.world.item.crafting.Ingredient TEMPT_ITEMS = net.minecraft.world.item.crafting.Ingredient.of(net.minecraft.world.level.block.Blocks.EMERALD_BLOCK.asItem()); // Purpur ++ static final net.minecraft.world.item.crafting.Ingredient TEMPT_ITEMS = net.minecraft.world.item.crafting.Ingredient.of(net.minecraft.world.level.block.Blocks.EMERALD_BLOCK.asItem()); // Purpur - Villagers follow emerald blocks // CraftBukkit start @Override diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java -index b0236c7bf9441aa84d3795ffed05dd6099f29636..796dcc0dcf9022b455b8847e045266b8802da0cf 100644 +index b0236c7bf9441aa84d3795ffed05dd6099f29636..e9cbbcdcefe9acc24cf7972ae356fd590e128f56 100644 --- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java @@ -27,7 +27,7 @@ public class CatSpawner implements CustomSpawner { @@ -13916,7 +14169,7 @@ index b0236c7bf9441aa84d3795ffed05dd6099f29636..796dcc0dcf9022b455b8847e045266b8 return 0; } else { - this.nextTick = 1200; -+ this.nextTick = world.purpurConfig.catSpawnDelay; // Purpur ++ this.nextTick = world.purpurConfig.catSpawnDelay; // Purpur - Cat spawning options Player player = world.getRandomPlayer(); if (player == null) { return 0; @@ -13926,12 +14179,12 @@ index b0236c7bf9441aa84d3795ffed05dd6099f29636..796dcc0dcf9022b455b8847e045266b8 int i = 48; - if (world.getPoiManager().getCountInRange(entry -> entry.is(PoiTypes.HOME), pos, 48, PoiManager.Occupancy.IS_OCCUPIED) > 4L) { - List list = world.getEntitiesOfClass(Cat.class, new AABB(pos).inflate(48.0, 8.0, 48.0)); -+ // Purpur start ++ // Purpur start - Cat spawning options + int range = world.purpurConfig.catSpawnVillageScanRange; + if (range <= 0) return 0; + if (world.getPoiManager().getCountInRange(entry -> entry.is(PoiTypes.HOME), pos, range, PoiManager.Occupancy.IS_OCCUPIED) > 4L) { + List list = world.getEntitiesOfClass(Cat.class, new AABB(pos).inflate(range, 8.0, range)); -+ // Purpur end ++ // Purpur end - Cat spawning options if (list.size() < 5) { return this.spawnCat(pos, world); } @@ -13940,34 +14193,34 @@ index b0236c7bf9441aa84d3795ffed05dd6099f29636..796dcc0dcf9022b455b8847e045266b8 private int spawnInHut(ServerLevel world, BlockPos pos) { int i = 16; - List list = world.getEntitiesOfClass(Cat.class, new AABB(pos).inflate(16.0, 8.0, 16.0)); -+ // Purpur start ++ // Purpur start - Cat spawning options + int range = world.purpurConfig.catSpawnSwampHutScanRange; + if (range <= 0) return 0; + List list = world.getEntitiesOfClass(Cat.class, new AABB(pos).inflate(range, 8.0, range)); -+ // Purpur end ++ // Purpur end - Cat spawning options return list.size() < 1 ? this.spawnCat(pos, world) : 0; } 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 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f1379832b501 100644 +index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..6f691a7b7e7e335cc564577854ea404f9f5e81d7 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -141,6 +141,10 @@ public class Villager extends AbstractVillager implements ReputationEventHandler }, MemoryModuleType.MEETING_POINT, (entityvillager, holder) -> { return holder.is(PoiTypes.MEETING); }); -+ private boolean isLobotomized = false; public boolean isLobotomized() { return this.isLobotomized; } // Purpur -+ private int notLobotomizedCount = 0; // Purpur ++ private boolean isLobotomized = false; public boolean isLobotomized() { return this.isLobotomized; } // Purpur - Lobotomize stuck villagers ++ private int notLobotomizedCount = 0; // Purpur - Lobotomize stuck villagers + + public long nextGolemPanic = -1; // Pufferfish public Villager(EntityType entityType, Level world) { this(entityType, world, VillagerType.PLAINS); -@@ -156,6 +160,93 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -156,6 +160,98 @@ public class Villager extends AbstractVillager implements ReputationEventHandler this.setVillagerData(this.getVillagerData().setType(type).setProfession(VillagerProfession.NONE)); } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean isRidable() { + return level().purpurConfig.villagerRidable; @@ -13986,32 +14239,37 @@ index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f137 + @Override + protected void registerGoals() { + this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); -+ if (level().purpurConfig.villagerFollowEmeraldBlock) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.TemptGoal(this, 1.0D, TEMPT_ITEMS, false)); -+ } -+ -+ @Override -+ public boolean canBeLeashed() { -+ return level().purpurConfig.villagerCanBeLeashed; ++ if (level().purpurConfig.villagerFollowEmeraldBlock) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.TemptGoal(this, 1.0D, TEMPT_ITEMS, false)); // Purpur - Villagers follow emerald blocks + } -+ // Purpur end ++ // Purpur end - Ridables + ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.villagerMaxHealth); + this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.villagerScale); -+ this.getAttribute(Attributes.TEMPT_RANGE).setBaseValue(this.level().purpurConfig.villagerTemptRange); // Purpur ++ this.getAttribute(Attributes.TEMPT_RANGE).setBaseValue(this.level().purpurConfig.villagerTemptRange); // Purpur - Villagers follow emerald blocks + } -+ ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Allow leashing villagers ++ @Override ++ public boolean canBeLeashed() { ++ return level().purpurConfig.villagerCanBeLeashed; ++ } ++ // Purpur end - Allow leashing villagers ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.villagerTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.villagerAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience ++ // Purpur start - Lobotomize stuck villagers + private boolean checkLobotomized() { + int interval = this.level().purpurConfig.villagerLobotomizeCheckInterval; + boolean shouldCheckForTradeLocked = this.level().purpurConfig.villagerLobotomizeWaitUntilTradeLocked; @@ -14053,11 +14311,11 @@ index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f137 + // only if both blocks have no collision + return !bottom.hasCollision && !top.hasCollision; + } -+ ++ // Purpur end - Lobotomize stuck villagers @Override public Brain getBrain() { return (Brain) super.getBrain(); // CraftBukkit - decompile error -@@ -190,7 +281,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -190,7 +286,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler brain.addActivity(Activity.PLAY, VillagerGoalPackages.getPlayPackage(0.5F)); } else { brain.setSchedule(Schedule.VILLAGER_DEFAULT); @@ -14066,16 +14324,16 @@ index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f137 } brain.addActivity(Activity.CORE, VillagerGoalPackages.getCorePackage(villagerprofession, 0.5F)); -@@ -217,7 +308,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -217,7 +313,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } public static AttributeSupplier.Builder createAttributes() { - return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.5D); -+ return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.5D).add(Attributes.TEMPT_RANGE, 10.0D); // Purpur - add TEMPT_RANGE ++ return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.5D).add(Attributes.TEMPT_RANGE, 10.0D); // Purpur - Villagers follow emerald blocks } public boolean assignProfessionWhenSpawned() { -@@ -245,17 +336,30 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -245,17 +341,30 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } // Spigot End @@ -14102,35 +14360,35 @@ index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f137 + // Purpur end + // Pufferfish start + if (!inactive && (getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) { -+ this.getBrain().tick(world, this); // Paper // Purpur ++ this.getBrain().tick(world, this); // Paper // Purpur - Ridables + } + // Pufferfish end gameprofilerfiller.pop(); if (this.assignProfessionWhenSpawned) { this.assignProfessionWhenSpawned = false; -@@ -312,7 +416,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -312,7 +421,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler if (!itemstack.is(Items.VILLAGER_SPAWN_EGG) && this.isAlive() && !this.isTrading() && !this.isSleeping()) { if (this.isBaby()) { this.setUnhappy(); - return InteractionResult.SUCCESS; -+ return tryRide(player, hand, InteractionResult.SUCCESS); // Purpur ++ return tryRide(player, hand, InteractionResult.SUCCESS); // Purpur - Ridables } else { if (!this.level().isClientSide) { boolean flag = this.getOffers().isEmpty(); -@@ -326,9 +430,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -326,9 +435,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } if (flag) { - return InteractionResult.CONSUME; -+ return tryRide(player, hand, InteractionResult.CONSUME); // Purpur ++ return tryRide(player, hand, InteractionResult.CONSUME); // Purpur - Ridables } -+ if (level().purpurConfig.villagerRidable && itemstack.isEmpty()) return tryRide(player, hand); // Purpur -+ if (this.level().purpurConfig.villagerAllowTrading) // Purpur ++ if (level().purpurConfig.villagerRidable && itemstack.isEmpty()) return tryRide(player, hand); // Purpur - Ridables ++ if (this.level().purpurConfig.villagerAllowTrading) // Purpur - Add config for villager trading this.startTrading(player); } -@@ -493,7 +599,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -493,7 +604,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler while (iterator.hasNext()) { MerchantOffer merchantrecipe = (MerchantOffer) iterator.next(); @@ -14139,7 +14397,7 @@ index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f137 } } -@@ -726,7 +832,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -726,7 +837,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public boolean canBreed() { @@ -14148,7 +14406,7 @@ index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f137 } private boolean hungry() { -@@ -905,6 +1011,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -905,6 +1016,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler public boolean hasFarmSeeds() { return this.getInventory().hasAnyMatching((itemstack) -> { @@ -14160,7 +14418,7 @@ index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f137 return itemstack.is(ItemTags.VILLAGER_PLANTABLE_SEEDS); }); } -@@ -962,6 +1073,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -962,6 +1078,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } public void spawnGolemIfNeeded(ServerLevel world, long time, int requiredCount) { @@ -14168,7 +14426,7 @@ index 2d8ba55906c8da16fde850e3412f4a6bda3d56e7..15ddc44bb266b4cdb1036c92dd60f137 if (this.wantsToSpawnGolem(time)) { AABB axisalignedbb = this.getBoundingBox().inflate(10.0D, 10.0D, 10.0D); List list = world.getEntitiesOfClass(Villager.class, axisalignedbb); -@@ -1026,6 +1138,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -1026,6 +1143,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public void startSleeping(BlockPos pos) { @@ -14195,10 +14453,10 @@ index 8734ab1bd8299bbf43906d81a349c2a13e0981a7..3ca83269311cbc18c9ef3ce62cff6a2d "farmer", PoiTypes.FARMER, 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 1e77cce428d9e53142aaa2cf780b7f862d536eca..42c91e52060fad4a7a598f9e9ef88fd0e0ff8475 100644 +index 1e77cce428d9e53142aaa2cf780b7f862d536eca..2dc7afa79126b52be42fc986926d6a63f9994d12 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -@@ -72,6 +72,50 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -72,6 +72,53 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill //this.setDespawnDelay(48000); // CraftBukkit - set default from MobSpawnerTrader // Paper - move back to MobSpawnerTrader - Vanilla behavior is that only traders spawned by it have this value set. } @@ -14217,39 +14475,42 @@ index 1e77cce428d9e53142aaa2cf780b7f862d536eca..42c91e52060fad4a7a598f9e9ef88fd0 + public boolean isControllable() { + return level().purpurConfig.wanderingTraderControllable; + } ++ // Purpur end - Ridables + -+ @Override -+ public boolean canBeLeashed() { -+ return level().purpurConfig.wanderingTraderCanBeLeashed; -+ } -+ // Purpur end -+ ++ // Purpur start - Configurable entity base attributes + @Override + public void initAttributes() { + this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.wanderingTraderMaxHealth); -+ this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.TEMPT_RANGE).setBaseValue(this.level().purpurConfig.wanderingTraderTemptRange); // Purpur ++ this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.TEMPT_RANGE).setBaseValue(this.level().purpurConfig.wanderingTraderTemptRange); // Purpur - Villagers follow emerald blocks + } -+ -+ // Purpur start ++ // Purpur end - Configurable entity base attributes ++ // Purpur start - Villagers follow emerald blocks + public static net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder createAttributes() { + return Mob.createMobAttributes().add(net.minecraft.world.entity.ai.attributes.Attributes.TEMPT_RANGE, 10.0D); + } -+ // Purpur end -+ ++ // Purpur end - Villagers follow emerald blocks ++ // Purpur start - Allow leashing villagers ++ @Override ++ public boolean canBeLeashed() { ++ return level().purpurConfig.wanderingTraderCanBeLeashed; ++ } ++ // Purpur end - Allow leashing villagers ++ // Purpur start - Toggle for water sensitive mob damage + @Override + public boolean isSensitiveToWater() { + return this.level().purpurConfig.wanderingTraderTakeDamageFromWater; + } -+ ++ // Purpur end - Toggle for water sensitive mob damage ++ // Purpur start - Mobs always drop experience + @Override + protected boolean isAlwaysExperienceDropper() { + return this.level().purpurConfig.wanderingTraderAlwaysDropExp; + } -+ ++ // Purpur end - Mobs always drop experience @Override protected void registerGoals() { this.goalSelector.addGoal(0, new FloatGoal(this)); -@@ -79,7 +123,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -79,7 +126,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) -> { @@ -14258,29 +14519,27 @@ index 1e77cce428d9e53142aaa2cf780b7f862d536eca..42c91e52060fad4a7a598f9e9ef88fd0 })); this.goalSelector.addGoal(1, new TradeWithPlayerGoal(this)); this.goalSelector.addGoal(1, new AvoidEntityGoal<>(this, Zombie.class, 8.0F, 0.5D, 0.5D)); -@@ -92,6 +136,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -92,6 +139,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)); -+ if (level().purpurConfig.wanderingTraderFollowEmeraldBlock) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.TemptGoal(this, 1.0D, TEMPT_ITEMS, false)); // Purpur ++ if (level().purpurConfig.wanderingTraderFollowEmeraldBlock) this.goalSelector.addGoal(3, new net.minecraft.world.entity.ai.goal.TemptGoal(this, 1.0D, TEMPT_ITEMS, false)); // Purpur - Villagers follow emerald blocks 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)); -@@ -120,11 +165,13 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -120,11 +168,13 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill if (!this.level().isClientSide) { if (this.getOffers().isEmpty()) { - return InteractionResult.CONSUME; -+ return tryRide(player, hand, InteractionResult.CONSUME); // Purpur ++ return tryRide(player, hand, InteractionResult.CONSUME); // Purpur - Ridables } - -- this.setTradingPlayer(player); -- this.openTradingScreen(player, this.getDisplayName(), 1); -+ if (level().purpurConfig.wanderingTraderRidable && itemstack.isEmpty()) return tryRide(player, hand); // Purpur -+ if (this.level().purpurConfig.wanderingTraderAllowTrading) { // Purpur -+ this.setTradingPlayer(player); -+ this.openTradingScreen(player, this.getDisplayName(), 1); -+ } // Purpur ++ if (level().purpurConfig.wanderingTraderRidable && itemstack.isEmpty()) return tryRide(player, hand); // Purpur - Ridables ++ if (this.level().purpurConfig.wanderingTraderAllowTrading) { // Purpur - Add config for villager trading + this.setTradingPlayer(player); + this.openTradingScreen(player, this.getDisplayName(), 1); ++ } // Purpur - Add config for villager trading } return InteractionResult.SUCCESS; @@ -14340,7 +14599,7 @@ index 110456deaa662bc1c0f6ba7878bb3074869a4350..58c8e8f06f5cf028b158350327bf4298 return false; } 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 5b8b85a295a08ae495f729c595b3a78778965342..d19b1e127a1018a798eed181d8060a781b589f90 100644 +index 5b8b85a295a08ae495f729c595b3a78778965342..7893d257deef3c1bb0187c6a0b04659716b520f9 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -200,17 +200,40 @@ public abstract class Player extends LivingEntity { @@ -14355,20 +14614,20 @@ index 5b8b85a295a08ae495f729c595b3a78778965342..d19b1e127a1018a798eed181d8060a78 public boolean fauxSleeping; public int oldLevel = -1; -+ public void setAfk(boolean afk) { -+ } ++ // Purpur start - AFK API ++ public abstract void setAfk(boolean afk); + + public boolean isAfk() { + return false; + } -+ ++ // Purpur end - AFK API @Override public CraftHumanEntity getBukkitEntity() { return (CraftHumanEntity) super.getBukkitEntity(); } // CraftBukkit end -+ // Purpur start ++ // Purpur start - Ridables + public abstract void resetLastActionTime(); + + @Override @@ -14379,7 +14638,7 @@ index 5b8b85a295a08ae495f729c595b3a78778965342..d19b1e127a1018a798eed181d8060a78 + } + return false; + } -+ // Purpur end ++ // Purpur end - Ridables + public Player(Level world, BlockPos pos, float yaw, GameProfile gameProfile) { super(EntityType.PLAYER, world); @@ -14516,7 +14775,7 @@ index f4513b1887f823b088dabe425be042b8fb2bde66..e136738ed53a488ad0aa67a04237ac62 return SoundEvents.ARROW_HIT; } 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 2f00676f62478897ae4931ea06e047567c407535..55ea7f82fac9a3de6d7e0725a9b6ea08088bc85c 100644 +index 2f00676f62478897ae4931ea06e047567c407535..59c71183e2c4edae72623f6aa662b807ba2093f2 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/LargeFireball.java @@ -23,13 +23,13 @@ public class LargeFireball extends Fireball { @@ -14524,14 +14783,14 @@ index 2f00676f62478897ae4931ea06e047567c407535..55ea7f82fac9a3de6d7e0725a9b6ea08 public LargeFireball(EntityType type, Level world) { super(type, world); - this.isIncendiary = (world instanceof ServerLevel worldserver) && worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit -+ this.isIncendiary = (world instanceof ServerLevel worldserver) && (worldserver.purpurConfig.fireballsBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)); // CraftBukkit // Purpur ++ this.isIncendiary = (world instanceof ServerLevel worldserver) && (worldserver.purpurConfig.fireballsBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)); // CraftBukkit // Purpur - Add mobGriefing bypass to everything affected } public LargeFireball(Level world, LivingEntity owner, Vec3 velocity, int explosionPower) { super(EntityType.FIREBALL, owner, velocity, world); this.explosionPower = explosionPower; - this.isIncendiary = (world instanceof ServerLevel worldserver) && worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit -+ this.isIncendiary = (world instanceof ServerLevel worldserver) && (worldserver.purpurConfig.fireballsBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)); // CraftBukkit // Purpur ++ this.isIncendiary = (world instanceof ServerLevel worldserver) && (worldserver.purpurConfig.fireballsBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)); // CraftBukkit // Purpur - Add mobGriefing bypass to everything affected } @Override @@ -14540,29 +14799,29 @@ index 2f00676f62478897ae4931ea06e047567c407535..55ea7f82fac9a3de6d7e0725a9b6ea08 if (world instanceof ServerLevel worldserver) { - boolean flag = worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); -+ boolean flag = worldserver.purpurConfig.fireballsBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // Purpur ++ boolean flag = worldserver.purpurConfig.fireballsBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // Purpur - Add mobGriefing bypass to everything affected // 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 958ea103cc80da7366cc33dc385b76d4f5c809f2..0b7f27a6cc6be58fa5b60002059c9fbb3b1b7b67 100644 +index 958ea103cc80da7366cc33dc385b76d4f5c809f2..f8ff53488d886bfd67ca3bfe4431b42010052d87 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java +++ b/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java @@ -33,6 +33,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)); } -+ // Purpur start ++ // Purpur start - Ridables + public void super_tick() { + super.tick(); + } -+ // Purpur end ++ // Purpur end - Ridables + @Override protected double getDefaultGravity() { return 0.06D; 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 9a7b56b653848974e1194eb4f6d40cb99a96ff57..40a1514637a6a26666ba877e6dcf5bc42bd54a51 100644 +index 9a7b56b653848974e1194eb4f6d40cb99a96ff57..51160e98090c031f2d6394c824a5b1d6c0fbb7f6 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java @@ -58,6 +58,36 @@ public abstract class Projectile extends Entity implements TraceableEntity { @@ -14588,7 +14847,7 @@ index 9a7b56b653848974e1194eb4f6d40cb99a96ff57..40a1514637a6a26666ba877e6dcf5bc4 + if (!isLoaded) { + if (Projectile.loadedThisTick > gg.pufferfish.pufferfish.PufferfishConfig.maxProjectileLoadsPerTick) { + if (++this.loadedLifetime > gg.pufferfish.pufferfish.PufferfishConfig.maxProjectileLoadsPerProjectile) { -+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD); // Purpur ++ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD); // Purpur - Fix pufferfish issues + } + return; + } @@ -14607,12 +14866,12 @@ index 9a7b56b653848974e1194eb4f6d40cb99a96ff57..40a1514637a6a26666ba877e6dcf5bc4 Entity entity = this.getOwner(); - return entity instanceof Player ? entity.mayInteract(world, pos) : entity == null || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); -+ return entity instanceof Player ? entity.mayInteract(world, pos) : entity == null || world.purpurConfig.projectilesBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); ++ return entity instanceof Player ? entity.mayInteract(world, pos) : entity == null || world.purpurConfig.projectilesBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // Purpur - Add mobGriefing bypass to everything affected } public boolean mayBreak(ServerLevel world) { 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 bb159ea4baf208aab6d6fcfbbddacd5b089b55c8..588b07ec4501924a49264183b414a7fd64bb6550 100644 +index bb159ea4baf208aab6d6fcfbbddacd5b089b55c8..f1786d17ce8ffd221674c887be01c7907f36f129 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java @@ -30,7 +30,7 @@ public class SmallFireball extends Fireball { @@ -14620,7 +14879,7 @@ index bb159ea4baf208aab6d6fcfbbddacd5b089b55c8..588b07ec4501924a49264183b414a7fd // CraftBukkit start if (this.getOwner() != null && this.getOwner() instanceof Mob) { - this.isIncendiary = (world instanceof ServerLevel worldserver) && worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); -+ this.isIncendiary = (world instanceof ServerLevel worldserver) && (worldserver.purpurConfig.fireballsBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)); // Purpur ++ this.isIncendiary = (world instanceof ServerLevel worldserver) && (worldserver.purpurConfig.fireballsBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)); // Purpur - Add mobGriefing bypass to everything affected } // CraftBukkit end } @@ -14711,7 +14970,7 @@ index 1e045397763e8233c2e8f9955468788374b80068..3573a6cf0632dfb6859f5a5e7ceffb94 Level world = this.level(); 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 4c47b30867e30d84908abf93dbefc252bc8c3453..e63b408594b5d2673148e39c1deafc8510537bee 100644 +index 4c47b30867e30d84908abf93dbefc252bc8c3453..eeb91f7e744d20c1a05212308a23102a347b9c19 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java +++ b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java @@ -103,7 +103,7 @@ public class WitherSkull extends AbstractHurtingProjectile { @@ -14723,28 +14982,29 @@ index 4c47b30867e30d84908abf93dbefc252bc8c3453..e63b408594b5d2673148e39c1deafc85 this.level().getCraftServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { -@@ -115,6 +115,19 @@ public class WitherSkull extends AbstractHurtingProjectile { +@@ -115,6 +115,20 @@ public class WitherSkull extends AbstractHurtingProjectile { } -+ // Purpur start ++ // Purpur start - Ridables + @Override + public boolean canHitEntity(Entity target) { + // do not hit rider + return target != this.getRider() && super.canHitEntity(target); + } -+ ++ // Purpur end - Ridables ++ // Purpur start - Add canSaveToDisk to Entity + @Override + public boolean canSaveToDisk() { + return false; + } -+ // Purpur end ++ // Purpur end - Add canSaveToDisk to Entity + @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { builder.define(WitherSkull.DATA_DANGEROUS, false); 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 cee1e4db2312efb4843c4b6dc18f4af10b91d304..68525419f18c18931d771d66fb15c9301d611416 100644 +index cee1e4db2312efb4843c4b6dc18f4af10b91d304..65206bc0c3276fda449936cae88cc819a346e299 100644 --- a/src/main/java/net/minecraft/world/entity/raid/Raider.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java @@ -345,7 +345,7 @@ public abstract class Raider extends PatrollingMonster { @@ -14752,7 +15012,7 @@ index cee1e4db2312efb4843c4b6dc18f4af10b91d304..68525419f18c18931d771d66fb15c930 private boolean cannotPickUpBanner() { - if (!getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items -+ if ((!this.mob.level().purpurConfig.pillagerBypassMobGriefing == !getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items // Purpur ++ if ((!this.mob.level().purpurConfig.pillagerBypassMobGriefing == !getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items // Purpur - Add mobGriefing bypass to everything affected if (!this.mob.hasActiveRaid()) { return true; } else if (this.mob.getCurrentRaid().isOver()) { @@ -14828,17 +15088,17 @@ index b87fd952020d88a6612429df73121422bf9ae422..1a4fb057025689a22b3dd05f531f0d86 public static enum Status { 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 cdc8606ffe5c75ee19d92e9f86f26b2a502d765e..b31940441596079aae1cd2a38b9d22be18358448 100644 +index cdc8606ffe5c75ee19d92e9f86f26b2a502d765e..d0c93f87795d7162bbfb3fdadadb6ae1c5fdaeeb 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java @@ -92,6 +92,10 @@ public abstract class AbstractMinecart extends VehicleEntity { private double flyingY = 0.95; private double flyingZ = 0.95; public Double maxSpeed; -+ // Purpur start ++ // Purpur start - Minecart settings and WASD controls + public double storedMaxSpeed; + public boolean isNewBehavior; -+ // Purpur end ++ // Purpur end - Minecart settings and WASD controls // CraftBukkit end public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API @@ -14846,13 +15106,13 @@ index cdc8606ffe5c75ee19d92e9f86f26b2a502d765e..b31940441596079aae1cd2a38b9d22be this.blocksBuilding = true; if (AbstractMinecart.useExperimentalMovement(world)) { this.behavior = new NewMinecartBehavior(this); -+ this.isNewBehavior = true; // Purpur ++ this.isNewBehavior = true; // Purpur - Minecart settings and WASD controls } else { this.behavior = new OldMinecartBehavior(this); -+ // Purpur start ++ // Purpur start - Minecart settings and WASD controls + this.isNewBehavior = false; + maxSpeed = storedMaxSpeed = world.purpurConfig.minecartMaxSpeed; -+ // Purpur end ++ // Purpur end - Minecart settings and WASD controls } } @@ -14860,22 +15120,22 @@ index cdc8606ffe5c75ee19d92e9f86f26b2a502d765e..b31940441596079aae1cd2a38b9d22be @Override public void tick() { -+ // Purpur start ++ // Purpur start - Minecart settings and WASD controls + if (!this.isNewBehavior) { + if (storedMaxSpeed != level().purpurConfig.minecartMaxSpeed) { + maxSpeed = storedMaxSpeed = level().purpurConfig.minecartMaxSpeed; + } + } -+ // Purpur end ++ // Purpur end - Minecart settings and WASD controls + // CraftBukkit start double prevX = this.getX(); double prevY = this.getY(); -@@ -426,16 +443,62 @@ public abstract class AbstractMinecart extends VehicleEntity { +@@ -426,16 +443,63 @@ public abstract class AbstractMinecart extends VehicleEntity { this.behavior.moveAlongTrack(world); } -+ // Purpur start ++ // Purpur start - Minecart settings and WASD controls + private Double lastSpeed; + + public double getControllableSpeed() { @@ -14892,7 +15152,7 @@ index cdc8606ffe5c75ee19d92e9f86f26b2a502d765e..b31940441596079aae1cd2a38b9d22be + } + return lastSpeed = speed; + } -+ // Purpur end ++ // Purpur end - Minecart settings and WASD controls + protected void comeOffTrack(ServerLevel world) { double d0 = this.getMaxSpeed(world); @@ -14900,17 +15160,18 @@ index cdc8606ffe5c75ee19d92e9f86f26b2a502d765e..b31940441596079aae1cd2a38b9d22be this.setDeltaMovement(Mth.clamp(vec3d.x, -d0, d0), vec3d.y, Mth.clamp(vec3d.z, -d0, d0)); + -+ // Purpur start ++ // Purpur start - Minecart settings and WASD controls + if (level().purpurConfig.minecartControllable && !isInWater() && !isInLava() && !passengers.isEmpty()) { + Entity passenger = passengers.get(0); -+ if (passenger instanceof Player) { -+ Player player = (Player) passenger; -+ if (player.jumping && this.onGround) { ++ if (passenger instanceof net.minecraft.server.level.ServerPlayer player) { ++ net.minecraft.world.entity.player.Input lastClientInput = player.getLastClientInput(); ++ float forward = (lastClientInput.forward() == lastClientInput.backward() ? 0.0F : lastClientInput.forward() ? 1.0F : -1.0F); ++ if (lastClientInput.jump() && this.onGround) { + setDeltaMovement(new Vec3(getDeltaMovement().x, level().purpurConfig.minecartControllableHopBoost, getDeltaMovement().z)); + } -+ if (player.zza != 0.0F) { ++ if (forward != 0.0F) { + Vector velocity = player.getBukkitEntity().getEyeLocation().getDirection().normalize().multiply(getControllableSpeed()); -+ if (player.zza < 0.0) { ++ if (forward < 0.0) { + velocity.multiply(-0.5); + } + setDeltaMovement(new Vec3(velocity.getX(), getDeltaMovement().y, velocity.getZ())); @@ -14923,14 +15184,14 @@ index cdc8606ffe5c75ee19d92e9f86f26b2a502d765e..b31940441596079aae1cd2a38b9d22be + } else { + maxUpStep = 0.0F; + } -+ // Purpur end ++ // Purpur end - Minecart settings and WASD controls + if (this.onGround()) { // CraftBukkit start - replace magic numbers with our variables this.setDeltaMovement(new Vec3(this.getDeltaMovement().x * this.derailedX, this.getDeltaMovement().y * this.derailedY, this.getDeltaMovement().z * this.derailedZ)); // CraftBukkit end } -+ else if (level().purpurConfig.minecartControllable) setDeltaMovement(new Vec3(getDeltaMovement().x * derailedX, getDeltaMovement().y, getDeltaMovement().z * derailedZ)); // Purpur ++ else if (level().purpurConfig.minecartControllable) setDeltaMovement(new Vec3(getDeltaMovement().x * derailedX, getDeltaMovement().y, getDeltaMovement().z * derailedZ)); // Purpur - Minecart settings and WASD controls this.move(MoverType.SELF, this.getDeltaMovement()); if (!this.onGround()) { @@ -14964,7 +15225,7 @@ index 04a622f52353ebcc21f41c233f5a0fd67690cf4a..f10ce069ef427df16fd0ce0e60b85c80 Vec3 vec3d6 = this.getDeltaMovement(); double d20 = vec3d6.x; diff --git a/src/main/java/net/minecraft/world/food/FoodData.java b/src/main/java/net/minecraft/world/food/FoodData.java -index 6a686be6a69ae890d519a54ca099d4ba14e5b9e1..b8b0b89b7f0a21ecff4ab6286f8a114e2d6b6b39 100644 +index 6a686be6a69ae890d519a54ca099d4ba14e5b9e1..26309851107fb80712b2dc7c5e6112cedf929003 100644 --- a/src/main/java/net/minecraft/world/food/FoodData.java +++ b/src/main/java/net/minecraft/world/food/FoodData.java @@ -44,6 +44,7 @@ public class FoodData { @@ -14980,7 +15241,7 @@ index 6a686be6a69ae890d519a54ca099d4ba14e5b9e1..b8b0b89b7f0a21ecff4ab6286f8a114e 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.hurtServer(worldserver, player.damageSources().starve(), 1.0F); -+ player.hurtServer(worldserver, player.damageSources().starve(), player.level().purpurConfig.hungerStarvationDamage); // Purpur ++ player.hurtServer(worldserver, player.damageSources().starve(), player.level().purpurConfig.hungerStarvationDamage); // Purpur - Configurable hunger starvation damage } this.tickTimer = 0; @@ -15010,7 +15271,7 @@ index 4680f77a275d8d2b226018db89a571ac25998dd8..bfc90524bd739ed1d91fe9912e38093b // 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 1240df9368855f836412b06cf564926a18bfe90d..e559eabed82d2f402908e5b80d1505076ccc53a2 100644 +index 1240df9368855f836412b06cf564926a18bfe90d..248e2fb41df3cb1efc64921074a51a02419d8fbb 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java @@ -114,7 +114,13 @@ public abstract class AbstractFurnaceMenu extends RecipeBookMenu { @@ -15018,13 +15279,13 @@ index 1240df9368855f836412b06cf564926a18bfe90d..e559eabed82d2f402908e5b80d150507 if (this.canSmelt(itemstack1)) { if (!this.moveItemStackTo(itemstack1, 0, 1, false)) { - return ItemStack.EMPTY; -+ // Purpur start - fix #625 ++ // Purpur start - Added the ability to add combustible items + if (this.isFuel(itemstack1)) { + if (!this.moveItemStackTo(itemstack1, 1, 2, false)) { + return ItemStack.EMPTY; + } + } -+ // Purpur end ++ // Purpur end - Added the ability to add combustible items } } else if (this.isFuel(itemstack1)) { if (!this.moveItemStackTo(itemstack1, 1, 2, false)) { @@ -15702,7 +15963,7 @@ index bb593209c95c9cf1f9c5d52d52fab4a33ddbabcf..58fa528e4b2589d362eb976afd6221cd } else { user.startUsingItem(hand); diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java -index 3bddfb6f7412ab86e0c090d0cbc6cf254b3f891c..38f287d97544b8a5b080837e38710dc4e94ae9bf 100644 +index 3bddfb6f7412ab86e0c090d0cbc6cf254b3f891c..b9190acbcb256a3072f0a5f1c4c731f1222b459f 100644 --- a/src/main/java/net/minecraft/world/item/BucketItem.java +++ b/src/main/java/net/minecraft/world/item/BucketItem.java @@ -196,7 +196,7 @@ public class BucketItem extends Item implements DispensibleContainerItem { @@ -15710,7 +15971,7 @@ index 3bddfb6f7412ab86e0c090d0cbc6cf254b3f891c..38f287d97544b8a5b080837e38710dc4 if (!flag2) { return movingobjectpositionblock != null && this.emptyContents(entityhuman, world, movingobjectpositionblock.getBlockPos().relative(movingobjectpositionblock.getDirection()), (BlockHitResult) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit - } else if (world.dimensionType().ultraWarm() && this.content.is(FluidTags.WATER)) { -+ } else if ((world.dimensionType().ultraWarm() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.content.is(FluidTags.WATER)) { // Purpur ++ } else if ((world.dimensionType().ultraWarm() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.content.is(FluidTags.WATER)) { // Purpur - Add allow water in end world option int i = blockposition.getX(); int j = blockposition.getY(); int k = blockposition.getZ(); @@ -15719,7 +15980,7 @@ index 3bddfb6f7412ab86e0c090d0cbc6cf254b3f891c..38f287d97544b8a5b080837e38710dc4 for (int l = 0; l < 8; ++l) { - world.addParticle(ParticleTypes.LARGE_SMOKE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D); -+ ((ServerLevel) world).sendParticlesSource(null, ParticleTypes.LARGE_SMOKE, false, true, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 1, 0.0D, 0.0D, 0.0D, 0.0D); // Purpur ++ ((ServerLevel) world).sendParticlesSource(null, ParticleTypes.LARGE_SMOKE, false, true, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 1, 0.0D, 0.0D, 0.0D, 0.0D); // Purpur - Add allow water in end world option } return true; @@ -15882,14 +16143,14 @@ index d2871bb4fd670ae4133d13f290b3256c9177d8e6..0936bdc945f73c7750c20a34276aead2 consumer.accept(context); if (player != null) { diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index f29415b8dff7d17328e159b56ae4ad46452f018e..5964c2e77e9f21c72d9e0655e5f48d2798317779 100644 +index f29415b8dff7d17328e159b56ae4ad46452f018e..b43a7bf5d8f555f97cc851c2c4c01b8a729396f6 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -508,6 +508,7 @@ public final class ItemStack implements DataComponentHolder { world.isBlockPlaceCancelled = true; // Paper - prevent calling cleanup logic when undoing a block place upon a cancelled BlockPlaceEvent for (BlockState blockstate : blocks) { blockstate.update(true, false); -+ ((CraftBlock) blockstate.getBlock()).getNMS().getBlock().forgetPlacer(); // Purpur ++ ((CraftBlock) blockstate.getBlock()).getNMS().getBlock().forgetPlacer(); // Purpur - Store placer on Block when placed } world.isBlockPlaceCancelled = false; // Paper - prevent calling cleanup logic when undoing a block place upon a cancelled BlockPlaceEvent world.preventPoiUpdated = false; @@ -15897,7 +16158,7 @@ index f29415b8dff7d17328e159b56ae4ad46452f018e..5964c2e77e9f21c72d9e0655e5f48d27 if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically block.onPlace(world, newblockposition, oldBlock, true, context); } -+ block.getBlock().forgetPlacer(); // Purpur ++ block.getBlock().forgetPlacer(); // Purpur - Store placer on Block when placed world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point } @@ -15955,7 +16216,7 @@ index f29415b8dff7d17328e159b56ae4ad46452f018e..5964c2e77e9f21c72d9e0655e5f48d27 return (ItemEnchantments) this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); } diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java -index 6d16b4433e79eca0ff8008941f0b9b807b1db9db..317e69eb4e3a4c312d5e856a0bff31a9e3eb5326 100644 +index 6d16b4433e79eca0ff8008941f0b9b807b1db9db..e2f1d3f349e3f82e7a565363c42818e5cf6c4d61 100644 --- a/src/main/java/net/minecraft/world/item/Items.java +++ b/src/main/java/net/minecraft/world/item/Items.java @@ -367,7 +367,7 @@ public class Items { @@ -15972,7 +16233,7 @@ index 6d16b4433e79eca0ff8008941f0b9b807b1db9db..317e69eb4e3a4c312d5e856a0bff31a9 ); public static final Item GLOW_BERRIES = registerItem( - "glow_berries", createBlockItemWithCustomItemName(Blocks.CAVE_VINES), new Item.Properties().food(Foods.GLOW_BERRIES) -+ "glow_berries", settings -> new org.purpurmc.purpur.item.GlowBerryItem(Blocks.CAVE_VINES, settings.useItemDescriptionPrefix()), new Item.Properties().food(Foods.GLOW_BERRIES) // Purpur ++ "glow_berries", settings -> new org.purpurmc.purpur.item.GlowBerryItem(Blocks.CAVE_VINES, settings.useItemDescriptionPrefix()), new Item.Properties().food(Foods.GLOW_BERRIES) // Purpur - Eating glow berries adds glow effect ); public static final Item CAMPFIRE = registerBlock(Blocks.CAMPFIRE, settings -> settings.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)); public static final Item SOUL_CAMPFIRE = registerBlock( @@ -15989,7 +16250,7 @@ index 8ff50a4c7461bbd9f469d503f6b5ee482d2463d7..5c0a46c11003b6e154195a8ef299416c int i = 1 << mapItemSavedData.scale; int j = mapItemSavedData.centerX; diff --git a/src/main/java/net/minecraft/world/item/MinecartItem.java b/src/main/java/net/minecraft/world/item/MinecartItem.java -index 7153d9ed12276a0f2d8b8a17c79734aa25ed1fa5..dc49ea6454e04ae8ec68af12c4bf2ff022540671 100644 +index 7153d9ed12276a0f2d8b8a17c79734aa25ed1fa5..a82faf7f07cd71c8748979a726b1e7857d88e195 100644 --- a/src/main/java/net/minecraft/world/item/MinecartItem.java +++ b/src/main/java/net/minecraft/world/item/MinecartItem.java @@ -35,8 +35,9 @@ public class MinecartItem extends Item { @@ -15998,9 +16259,9 @@ index 7153d9ed12276a0f2d8b8a17c79734aa25ed1fa5..dc49ea6454e04ae8ec68af12c4bf2ff0 if (!iblockdata.is(BlockTags.RAILS)) { - return InteractionResult.FAIL; - } else { -+ if (!world.purpurConfig.minecartPlaceAnywhere) return InteractionResult.FAIL; // Purpur ++ if (!world.purpurConfig.minecartPlaceAnywhere) return InteractionResult.FAIL; // Purpur - Minecart settings and WASD controls + if (iblockdata.isSolid()) blockposition = blockposition.relative(context.getClickedFace()); -+ } // else { // Purpur - place minecarts anywhere ++ } // else { // Purpur - Minecart settings and WASD controls ItemStack itemstack = context.getItemInHand(); RailShape blockpropertytrackposition = iblockdata.getBlock() instanceof BaseRailBlock ? (RailShape) iblockdata.getValue(((BaseRailBlock) iblockdata.getBlock()).getShapeProperty()) : RailShape.NORTH_SOUTH; double d0 = 0.0D; @@ -16009,7 +16270,7 @@ index 7153d9ed12276a0f2d8b8a17c79734aa25ed1fa5..dc49ea6454e04ae8ec68af12c4bf2ff0 return InteractionResult.SUCCESS; } - } -+ // } // Purpur - place minecarts anywhere ++ // } // Purpur - Minecart settings and WASD controls } } diff --git a/src/main/java/net/minecraft/world/item/NameTagItem.java b/src/main/java/net/minecraft/world/item/NameTagItem.java @@ -16368,19 +16629,19 @@ index 0efc8d997b34302c3e0a5d7ec73a11a940dbeefe..af157881d440b34cfe79fbc9b03cc9ef 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 7de66aa435dd36899b80f4ecc64480680e474d94..bb4411cfdf1bc7adc12c2f918d2eec830299f38b 100644 +index 7de66aa435dd36899b80f4ecc64480680e474d94..79a8e5dd1d189c4eaf93999925ea0790eb6ce368 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -59,6 +59,7 @@ public abstract class BaseSpawner { } public boolean isNearPlayer(Level world, BlockPos pos) { -+ if (world.purpurConfig.spawnerDeactivateByRedstone && world.hasNeighborSignal(pos)) return false; // Purpur ++ if (world.purpurConfig.spawnerDeactivateByRedstone && world.hasNeighborSignal(pos)) return false; // Purpur - Redstone deactivates spawners return world.hasNearbyAlivePlayerThatAffectsSpawning((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, (double) this.requiredPlayerRange); // Paper - Affects Spawning API } diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java -index 5d7a6e4b73f032db356e7ec369b150013e940ee6..6b2cda6d578a0983b2401ea20629275431018433 100644 +index 5d7a6e4b73f032db356e7ec369b150013e940ee6..e164833de0c29eed9025dd4af3f2bb74c92d2250 100644 --- a/src/main/java/net/minecraft/world/level/EntityGetter.java +++ b/src/main/java/net/minecraft/world/level/EntityGetter.java @@ -184,7 +184,7 @@ public interface EntityGetter extends ca.spottedleaf.moonrise.patches.chunk_syst @@ -16388,19 +16649,19 @@ index 5d7a6e4b73f032db356e7ec369b150013e940ee6..6b2cda6d578a0983b2401ea206292754 default boolean hasNearbyAlivePlayer(double x, double y, double z, double range) { for (Player player : this.players()) { - if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { -+ if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player) && EntitySelector.notAfk.test(player)) { // Purpur ++ if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player) && EntitySelector.notAfk.test(player)) { // Purpur - AFK API double d = player.distanceToSqr(x, y, z); if (range < 0.0 || d < range * range) { return true; diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 27f9d167b5ae9ce5117798ea44324107df59425f..1a808fc381c0c3ea1fc49bbffebddf2c550e817a 100644 +index 27f9d167b5ae9ce5117798ea44324107df59425f..72c9b9d8f520aa29106dd28a48dcdaf9bf8ea9e6 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -175,6 +175,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl // Paper end - add paper world config public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray -+ public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur ++ public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files public static BlockPos lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; @@ -16458,7 +16719,7 @@ index 27f9d167b5ae9ce5117798ea44324107df59425f..1a808fc381c0c3ea1fc49bbffebddf2c // Paper end - getblock optimisations - cache world height/sections this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config -+ this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur ++ this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur - Purpur config files + this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur this.generator = gen; this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); @@ -16488,7 +16749,7 @@ index 27f9d167b5ae9ce5117798ea44324107df59425f..1a808fc381c0c3ea1fc49bbffebddf2c } } + -+ // Purpur start ++ // Purpur start - Add allow water in end world option + public boolean isNether() { + return getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER; + } @@ -16496,7 +16757,7 @@ index 27f9d167b5ae9ce5117798ea44324107df59425f..1a808fc381c0c3ea1fc49bbffebddf2c + public boolean isTheEnd() { + return getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END; + } -+ // Purpur end ++ // Purpur end - Add allow water in end world option } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java index c1b76a1ebc1eea7ab70cf61d8175a31794dd122a..dc15c15951e4ca30b8341d24f813259a77f41c77 100644 @@ -16512,7 +16773,7 @@ index c1b76a1ebc1eea7ab70cf61d8175a31794dd122a..dc15c15951e4ca30b8341d24f813259a if (entityhuman != null) { double d2 = entityhuman.distanceToSqr(d0, (double) i, d1); diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java -index 685ccfb73bf7125585ef90b6a0f51b2f81daa428..e2763ee67530074d8ec78fbff694eb84f5373de0 100644 +index 685ccfb73bf7125585ef90b6a0f51b2f81daa428..4c7e4683c53afb0800b7f17c5964ba8ff31848d1 100644 --- a/src/main/java/net/minecraft/world/level/ServerExplosion.java +++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java @@ -311,7 +311,7 @@ public class ServerExplosion implements Explosion { @@ -16520,7 +16781,7 @@ index 685ccfb73bf7125585ef90b6a0f51b2f81daa428..e2763ee67530074d8ec78fbff694eb84 this.level = world; this.source = entity; - this.radius = (float) Math.max(power, 0.0); // CraftBukkit - clamp bad values -+ this.radius = (float) (world == null || world.purpurConfig.explosionClampRadius ? Math.max(power, 0.0) : power); // CraftBukkit - clamp bad values // Purpur ++ this.radius = (float) (world == null || world.purpurConfig.explosionClampRadius ? Math.max(power, 0.0) : power); // CraftBukkit - clamp bad values // Purpur - Config to remove explosion radius clamp this.center = pos; this.fire = createFire; this.blockInteraction = destructionType; @@ -16529,7 +16790,7 @@ index 685ccfb73bf7125585ef90b6a0f51b2f81daa428..e2763ee67530074d8ec78fbff694eb84 public void explode() { // CraftBukkit start - if (this.radius < 0.1F) { -+ if ((this.level == null || this.level.purpurConfig.explosionClampRadius) && this.radius < 0.1F) { // Purpur ++ if ((this.level == null || this.level.purpurConfig.explosionClampRadius) && this.radius < 0.1F) { // Purpur - Config to remove explosion radius clamp return; } // CraftBukkit end @@ -16612,14 +16873,14 @@ index 50c907c962f936d2035bb7550750cdbd220b29c2..f9a2d2d4f798efa0d691996ec5ff7fe0 protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { if (!world.isClientSide) { diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java -index affbbf6abc6bc09ecb652c1dee92aa297458bc39..febc05dc39741807127cba4a2a55aaad62b0800c 100644 +index affbbf6abc6bc09ecb652c1dee92aa297458bc39..c58e07f2a99e3cbb5bd5d3693c006919e0710b7a 100644 --- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java +++ b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java @@ -50,6 +50,20 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock { @Override public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) { -+ // Purpur start ++ // Purpur start - Chance for azalea blocks to grow into trees naturally + growTree(world, random, pos, state); + } + @@ -16632,19 +16893,19 @@ index affbbf6abc6bc09ecb652c1dee92aa297458bc39..febc05dc39741807127cba4a2a55aaad + } + + private void growTree(ServerLevel world, RandomSource random, BlockPos pos, net.minecraft.world.level.block.state.BlockState state) { -+ // Purpur end ++ // Purpur end - Chance for azalea blocks to grow into trees naturally TreeGrower.AZALEA.growTree(world, world.getChunkSource().getGenerator(), pos, state, random); } diff --git a/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java b/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java -index d7ca7a43d2d5f8cad416156fd40588cdd6634f52..231338adda19f57bf1a95379cc2e14341d4068d0 100644 +index d7ca7a43d2d5f8cad416156fd40588cdd6634f52..920ad0a4ecc83da82c8382a48883cefb7a4b9d11 100644 --- a/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java @@ -39,6 +39,7 @@ public abstract class BaseCoralPlantTypeBlock extends Block implements SimpleWat } protected static boolean scanForWater(BlockState state, BlockGetter world, BlockPos pos) { -+ if (!((net.minecraft.world.level.LevelAccessor) world).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur ++ if (!((net.minecraft.world.level.LevelAccessor) world).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die if (state.getValue(WATERLOGGED)) { return true; } else { @@ -16693,7 +16954,7 @@ index 9e3f1441d62128535112621bf259c24f1a90595b..2535e6d71b690f8dfde41a7d9cb76b6f 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 c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..91e68335d7007e3c1fe13eec0060db01c5f659ac 100644 +index c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..f00526753a83f95689fad2a132bef79f4479eec6 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -88,6 +88,10 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -16764,7 +17025,7 @@ index c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..91e68335d7007e3c1fe13eec0060db01 } - public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {} -+ // Purpur start ++ // Purpur start - Store placer on Block when placed + @Nullable protected LivingEntity placer = null; + + public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) { @@ -16774,7 +17035,7 @@ index c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..91e68335d7007e3c1fe13eec0060db01 + public void forgetPlacer() { + this.placer = null; + } -+ // Purpur end ++ // Purpur end - Store placer on Block when placed public boolean isPossibleToRespawnInThis(BlockState state) { return !state.isSolid() && !state.liquid(); @@ -16788,14 +17049,14 @@ index c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..91e68335d7007e3c1fe13eec0060db01 public void updateEntityMovementAfterFallOn(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 9bafac9b2c7b487f745fb64354f4bbc6a7ded468..1c34691da51d7f7ba3d54e095a3b58b74a5f2263 100644 +index 9bafac9b2c7b487f745fb64354f4bbc6a7ded468..c5f8227cd9631d98cc8404e3f6d6109a55c617aa 100644 --- a/src/main/java/net/minecraft/world/level/block/Blocks.java +++ b/src/main/java/net/minecraft/world/level/block/Blocks.java @@ -6454,6 +6454,7 @@ public class Blocks { BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() -+ .randomTicks() // Purpur ++ .randomTicks() // Purpur - Chance for azalea blocks to grow into trees naturally .instabreak() .sound(SoundType.AZALEA) .noOcclusion() @@ -16803,7 +17064,7 @@ index 9bafac9b2c7b487f745fb64354f4bbc6a7ded468..1c34691da51d7f7ba3d54e095a3b58b7 BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() -+ .randomTicks() // Purpur ++ .randomTicks() // Purpur - Chance for azalea blocks to grow into trees naturally .instabreak() .sound(SoundType.FLOWERING_AZALEA) .noOcclusion() @@ -16923,7 +17184,7 @@ index 648c2510beb162e73aed236a3169d0bbb8fc5050..3563a241c0b697dc0167cf7b1aa73fef } 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 1b94f26e78db062f80d806b82f714a815b4710ff..299d782c4e84d8548f2faddfb03712bab388de09 100644 +index 1b94f26e78db062f80d806b82f714a815b4710ff..b6ba6ebe6ac15cbcb5d3a6221b47762e37c4a56f 100644 --- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java @@ -140,7 +140,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB @@ -16931,12 +17192,12 @@ index 1b94f26e78db062f80d806b82f714a815b4710ff..299d782c4e84d8548f2faddfb03712ba boolean flag = world.getFluidState(blockposition).getType() == Fluids.WATER; - return (BlockState) ((BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(CampfireBlock.WATERLOGGED, flag)).setValue(CampfireBlock.SIGNAL_FIRE, this.isSmokeSource(world.getBlockState(blockposition.below())))).setValue(CampfireBlock.LIT, !flag)).setValue(CampfireBlock.FACING, ctx.getHorizontalDirection()); -+ return (BlockState) ((BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(CampfireBlock.WATERLOGGED, flag)).setValue(CampfireBlock.SIGNAL_FIRE, this.isSmokeSource(world.getBlockState(blockposition.below())))).setValue(CampfireBlock.LIT, world.purpurConfig.campFireLitWhenPlaced ? !flag : world.purpurConfig.campFireLitWhenPlaced)).setValue(CampfireBlock.FACING, ctx.getHorizontalDirection()); // Purpur ++ return (BlockState) ((BlockState) ((BlockState) ((BlockState) this.defaultBlockState().setValue(CampfireBlock.WATERLOGGED, flag)).setValue(CampfireBlock.SIGNAL_FIRE, this.isSmokeSource(world.getBlockState(blockposition.below())))).setValue(CampfireBlock.LIT, world.purpurConfig.campFireLitWhenPlaced ? !flag : world.purpurConfig.campFireLitWhenPlaced)).setValue(CampfireBlock.FACING, ctx.getHorizontalDirection()); // Purpur - Campfire option for lit when placed } @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 22242d11e009acab4c9738a1c6ada8b9ba678a0c..828fa78a89f13ef81c53b4d6ea6ef86c7b53024e 100644 +index 22242d11e009acab4c9738a1c6ada8b9ba678a0c..49b7565c26ce8bf217ae60d233d5963331ce6696 100644 --- a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java @@ -72,7 +72,7 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock { @@ -16944,7 +17205,7 @@ index 22242d11e009acab4c9738a1c6ada8b9ba678a0c..828fa78a89f13ef81c53b4d6ea6ef86c if (entitysnowman != null) { - CarvedPumpkinBlock.spawnGolemInWorld(world, shapedetector_shapedetectorcollection, entitysnowman, shapedetector_shapedetectorcollection.getBlock(0, 2, 0).getPos()); -+ CarvedPumpkinBlock.spawnGolemInWorld(world, shapedetector_shapedetectorcollection, entitysnowman, shapedetector_shapedetectorcollection.getBlock(0, 2, 0).getPos(), this.placer); // Purpur ++ CarvedPumpkinBlock.spawnGolemInWorld(world, shapedetector_shapedetectorcollection, entitysnowman, shapedetector_shapedetectorcollection.getBlock(0, 2, 0).getPos(), this.placer); // Purpur - Summoner API } } else { BlockPattern.BlockPatternMatch shapedetector_shapedetectorcollection1 = this.getOrCreateIronGolemFull().find(world, pos); @@ -16953,7 +17214,7 @@ index 22242d11e009acab4c9738a1c6ada8b9ba678a0c..828fa78a89f13ef81c53b4d6ea6ef86c if (entityirongolem != null) { entityirongolem.setPlayerCreated(true); - CarvedPumpkinBlock.spawnGolemInWorld(world, shapedetector_shapedetectorcollection1, entityirongolem, shapedetector_shapedetectorcollection1.getBlock(1, 2, 0).getPos()); -+ CarvedPumpkinBlock.spawnGolemInWorld(world, shapedetector_shapedetectorcollection1, entityirongolem, shapedetector_shapedetectorcollection1.getBlock(1, 2, 0).getPos(), this.placer); // Purpur ++ CarvedPumpkinBlock.spawnGolemInWorld(world, shapedetector_shapedetectorcollection1, entityirongolem, shapedetector_shapedetectorcollection1.getBlock(1, 2, 0).getPos(), this.placer); // Purpur - Summoner API } } } @@ -16961,7 +17222,7 @@ index 22242d11e009acab4c9738a1c6ada8b9ba678a0c..828fa78a89f13ef81c53b4d6ea6ef86c } private static void spawnGolemInWorld(Level world, BlockPattern.BlockPatternMatch patternResult, Entity entity, BlockPos pos) { -+ // Purpur start ++ // Purpur start - Summoner API + spawnGolemInWorld(world, patternResult, entity, pos, null); + } + private static void spawnGolemInWorld(Level world, BlockPattern.BlockPatternMatch patternResult, Entity entity, BlockPos pos, net.minecraft.world.entity.LivingEntity placer) { @@ -16970,7 +17231,7 @@ index 22242d11e009acab4c9738a1c6ada8b9ba678a0c..828fa78a89f13ef81c53b4d6ea6ef86c + } else if (entity instanceof IronGolem ironGolem) { + ironGolem.setSummoner(placer == null ? null : placer.getUUID()); + } -+ // Purpur end ++ // Purpur end - Summoner API // clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - moved down entity.moveTo((double) pos.getX() + 0.5D, (double) pos.getY() + 0.05D, (double) pos.getZ() + 0.5D, 0.0F, 0.0F); // CraftBukkit start @@ -17098,19 +17359,19 @@ index 9264ba58188a7a682eeb8eb449b89ff8e60f91d6..809a820dd8eec3e48dd3263335c62fbe protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { 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 a59b23f4062fa896836dec72cbd5097411774ad1..c526ea13a726624adaa654f09ff84c899c13ab98 100644 +index a59b23f4062fa896836dec72cbd5097411774ad1..c87b90041825172afd079202241b7f9a206816c6 100644 --- a/src/main/java/net/minecraft/world/level/block/CoralBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CoralBlock.java @@ -60,6 +60,7 @@ public class CoralBlock extends Block { } protected boolean scanForWater(BlockGetter world, BlockPos pos) { -+ if (!((net.minecraft.world.level.LevelAccessor) world).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur ++ if (!((net.minecraft.world.level.LevelAccessor) world).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die Direction[] aenumdirection = Direction.values(); int i = aenumdirection.length; diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java -index 1967ff3fcb94988be85985c4754904f0077de066..7f6f7a114e9930e7655c9695a5737739503999de 100644 +index 1967ff3fcb94988be85985c4754904f0077de066..34f338a246824dbabc7bc386b74cb62c78a8f1b6 100644 --- a/src/main/java/net/minecraft/world/level/block/CropBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java @@ -180,7 +180,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock { @@ -17118,7 +17379,7 @@ index 1967ff3fcb94988be85985c4754904f0077de066..7f6f7a114e9930e7655c9695a5737739 if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent if (world instanceof ServerLevel worldserver) { - if (entity instanceof Ravager && CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit -+ if (entity instanceof Ravager && world.purpurConfig.ravagerGriefableBlocks.contains(world.getBlockState(pos).getBlock()) && CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !world.purpurConfig.ravagerBypassMobGriefing == !worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit // Purpur ++ if (entity instanceof Ravager && world.purpurConfig.ravagerGriefableBlocks.contains(world.getBlockState(pos).getBlock()) && CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !world.purpurConfig.ravagerBypassMobGriefing == !worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit // Purpur - Add mobGriefing bypass to everything affected // Purpur - Configurable ravager griefable blocks list worldserver.destroyBlock(pos, true, entity); } } @@ -17139,14 +17400,14 @@ index 1967ff3fcb94988be85985c4754904f0077de066..7f6f7a114e9930e7655c9695a5737739 + // 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 077b99caf0ec0ee098786d23194d88e1dc4481ce..daf865c20cc193a12db0d98e3c0472eefdf635c2 100644 +index 077b99caf0ec0ee098786d23194d88e1dc4481ce..f8356e468841137dcc92b2fe5db1cafa24619eaf 100644 --- a/src/main/java/net/minecraft/world/level/block/DoorBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DoorBlock.java @@ -200,6 +200,7 @@ public class DoorBlock extends Block { protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { if (!this.type.canOpenByHand()) { return InteractionResult.PASS; -+ } else if (requiresRedstone(world, state, pos)) { return InteractionResult.CONSUME; // Purpur ++ } else if (requiresRedstone(world, state, pos)) { return InteractionResult.CONSUME; // Purpur - Option to make doors require redstone } else { state = (BlockState) state.cycle(DoorBlock.OPEN); world.setBlock(pos, state, 10); @@ -17155,7 +17416,7 @@ index 077b99caf0ec0ee098786d23194d88e1dc4481ce..daf865c20cc193a12db0d98e3c0472ee return flag; } + -+ // Purpur start ++ // Purpur start - Option to make doors require redstone + public static boolean requiresRedstone(Level level, BlockState state, BlockPos pos) { + if (level.purpurConfig.doorRequiresRedstone.contains(state.getBlock())) { + // force update client @@ -17167,7 +17428,7 @@ index 077b99caf0ec0ee098786d23194d88e1dc4481ce..daf865c20cc193a12db0d98e3c0472ee + } + return false; + } -+ // Purpur end ++ // Purpur end - Option to make doors require redstone } diff --git a/src/main/java/net/minecraft/world/level/block/DragonEggBlock.java b/src/main/java/net/minecraft/world/level/block/DragonEggBlock.java index 30d15686b1a81de7ac28feb0c6188eb007c6f2fd..b6799db00e157892dd4339a01d2ca36092c8e491 100644 @@ -17292,7 +17553,7 @@ index 9b6ab617ab7f503cf0b2d4e29333c706ffe95f46..bfe79431dc5707677671df5c0787817c public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { return new EnderChestBlockEntity(pos, state); 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 c3dba0c2c94f3804338f86621dc42405e380a6b3..eaac00e2534aca4eab92c7b9f9248e04b35b47df 100644 +index c3dba0c2c94f3804338f86621dc42405e380a6b3..f1ef2eda3282b3bcd99e388dc56d5542cd93bedb 100644 --- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java @@ -112,7 +112,7 @@ public class FarmBlock extends Block { @@ -17300,7 +17561,7 @@ index c3dba0c2c94f3804338f86621dc42405e380a6b3..eaac00e2534aca4eab92c7b9f9248e04 super.fallOn(world, state, pos, entity, fallDistance); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage. if (world instanceof ServerLevel worldserver) { - if (world.random.nextFloat() < fallDistance - 0.5F && entity instanceof LivingEntity && (entity instanceof Player || worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && entity.getBbWidth() * entity.getBbWidth() * entity.getBbHeight() > 0.512F) { -+ if ((worldserver.purpurConfig.farmlandTrampleHeight >= 0D ? fallDistance >= worldserver.purpurConfig.farmlandTrampleHeight : world.random.nextFloat() < fallDistance - 0.5F) && entity instanceof LivingEntity && (entity instanceof Player || worldserver.purpurConfig.farmlandBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && entity.getBbWidth() * entity.getBbWidth() * entity.getBbHeight() > 0.512F) { // Purpur ++ if ((worldserver.purpurConfig.farmlandTrampleHeight >= 0D ? fallDistance >= worldserver.purpurConfig.farmlandTrampleHeight : world.random.nextFloat() < fallDistance - 0.5F) && entity instanceof LivingEntity && (entity instanceof Player || worldserver.purpurConfig.farmlandBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) && entity.getBbWidth() * entity.getBbWidth() * entity.getBbHeight() > 0.512F) { // Purpur - Add mobGriefing bypass to everything affected // Purpur - Configurable farmland trample height // CraftBukkit start - Interact soil org.bukkit.event.Cancellable cancellable; if (entity instanceof Player) { @@ -17414,7 +17675,7 @@ index ef364aa171a48482a45bc18cfe730ec20c3f7be6..74971d90506aa253d5ee821b5390fb25 } } 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 a94762e65853ccad38cf90b0049ca256106c0c9f..38633e168a9b36e37feea00964d53e657926639e 100644 +index a94762e65853ccad38cf90b0049ca256106c0c9f..aa93b5041b65dbcdc5bbea65567eaf5d8c433a0d 100644 --- a/src/main/java/net/minecraft/world/level/block/IceBlock.java +++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java @@ -42,7 +42,7 @@ public class IceBlock extends HalfTransparentBlock { @@ -17422,7 +17683,7 @@ index a94762e65853ccad38cf90b0049ca256106c0c9f..38633e168a9b36e37feea00964d53e65 // Paper end - Improve Block#breakNaturally API if (!EnchantmentHelper.hasTag(tool, EnchantmentTags.PREVENTS_ICE_MELTING)) { - if (world.dimensionType().ultraWarm()) { -+ if (world.isNether() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur ++ if (world.isNether() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur - Add allow water in end world option world.removeBlock(pos, false); return; } @@ -17431,7 +17692,7 @@ index a94762e65853ccad38cf90b0049ca256106c0c9f..38633e168a9b36e37feea00964d53e65 } // CraftBukkit end - if (world.dimensionType().ultraWarm()) { -+ if (world.isNether() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur ++ if (world.isNether() || (world.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur - Add allow water in end world option world.removeBlock(pos, false); } else { world.setBlockAndUpdate(pos, IceBlock.meltsInto()); @@ -17452,7 +17713,7 @@ index 784b19bc78c8ad9476b6dac37b6778a409a7c675..d49dd8b20d3785cc9482ed2a34fbd7ae + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java -index a2d023ff011f71f80032f02430a53d6a08a23623..399441dd8388dcdec08768665d3cfa189aca0a95 100644 +index a2d023ff011f71f80032f02430a53d6a08a23623..8c1c24e98f79888faee204129145746279d5d159 100644 --- a/src/main/java/net/minecraft/world/level/block/LiquidBlock.java +++ b/src/main/java/net/minecraft/world/level/block/LiquidBlock.java @@ -140,7 +140,7 @@ public class LiquidBlock extends Block implements BucketPickup { @@ -17460,7 +17721,7 @@ index a2d023ff011f71f80032f02430a53d6a08a23623..399441dd8388dcdec08768665d3cfa18 @Override protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { - if (this.shouldSpreadLiquid(world, pos, state)) { -+ if (world.purpurConfig.tickFluids && this.shouldSpreadLiquid(world, pos, state)) { // Purpur ++ if (world.purpurConfig.tickFluids && this.shouldSpreadLiquid(world, pos, state)) { // Purpur - Tick fluids config world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava } @@ -17469,7 +17730,7 @@ index a2d023ff011f71f80032f02430a53d6a08a23623..399441dd8388dcdec08768665d3cfa18 @Override protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) { - if (state.getFluidState().isSource() || neighborState.getFluidState().isSource()) { -+ if (world.getWorldBorder().world.purpurConfig.tickFluids && state.getFluidState().isSource() || neighborState.getFluidState().isSource()) { // Purpur ++ if (world.getWorldBorder().world.purpurConfig.tickFluids && state.getFluidState().isSource() || neighborState.getFluidState().isSource()) { // Purpur - Tick fluids config tickView.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(world)); } @@ -17478,12 +17739,12 @@ index a2d023ff011f71f80032f02430a53d6a08a23623..399441dd8388dcdec08768665d3cfa18 @Override protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, @Nullable Orientation wireOrientation, boolean notify) { - if (this.shouldSpreadLiquid(world, pos, state)) { -+ if (world.purpurConfig.tickFluids && this.shouldSpreadLiquid(world, pos, state)) { // Purpur ++ if (world.purpurConfig.tickFluids && this.shouldSpreadLiquid(world, pos, state)) { // Purpur - Tick fluids config world.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(world, pos)); // Paper - Configurable speed for water flowing over lava } 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 7ffdcf18bf4bd8b5325c76945b2d80ca3fe52958..dfa931316fde0b2e80068a0edd1427ffd096b15b 100644 +index 7ffdcf18bf4bd8b5325c76945b2d80ca3fe52958..4adbbd27c5b2e4cef630c6c8aae38d3f2b94c11e 100644 --- a/src/main/java/net/minecraft/world/level/block/MagmaBlock.java +++ b/src/main/java/net/minecraft/world/level/block/MagmaBlock.java @@ -29,7 +29,7 @@ public class MagmaBlock extends Block { @@ -17491,7 +17752,7 @@ index 7ffdcf18bf4bd8b5325c76945b2d80ca3fe52958..dfa931316fde0b2e80068a0edd1427ff @Override public void stepOn(Level world, BlockPos pos, BlockState state, Entity entity) { - if (!entity.isSteppingCarefully() && entity instanceof LivingEntity) { -+ if ((!entity.isSteppingCarefully() || world.purpurConfig.magmaBlockDamageWhenSneaking) && entity instanceof LivingEntity) { // Purpur ++ if ((!entity.isSteppingCarefully() || world.purpurConfig.magmaBlockDamageWhenSneaking) && entity instanceof LivingEntity) { // Purpur - Configurable damage settings for magma blocks entity.hurt(world.damageSources().hotFloor().directBlock(world, pos), 1.0F); // CraftBukkit } @@ -17632,7 +17893,7 @@ index 53cea36ec931de89e0060613acf87beb51dc16ec..fd5489993dca0f940da69e9163f78e5c if (dripChance < f1) { diff --git a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java -index 53f1a7ed6b4bd6e2d8460531226aabf249994c02..3760c3c9ab45d7152661edd5a48893e1b583fb95 100644 +index 53f1a7ed6b4bd6e2d8460531226aabf249994c02..f91c845061fa632e53efb31c63cf0c67c9c2e86a 100644 --- a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java @@ -76,7 +76,7 @@ public class PowderSnowBlock extends Block implements BucketPickup { @@ -17640,7 +17901,7 @@ index 53f1a7ed6b4bd6e2d8460531226aabf249994c02..3760c3c9ab45d7152661edd5a48893e1 // CraftBukkit start if (entity.isOnFire() && entity.mayInteract(worldserver, pos)) { - if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !(worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || entity instanceof Player))) { -+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !((worldserver.purpurConfig.powderSnowBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) || entity instanceof Player))) { // Purpur ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !((worldserver.purpurConfig.powderSnowBypassMobGriefing ^ worldserver.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) || entity instanceof Player))) { // Purpur - Add mobGriefing bypass to everything affected return; } // CraftBukkit end @@ -17801,7 +18062,7 @@ index d751b280a8bf2066d458f8eb548d7aa123fa69c9..fb88b5c1d9e764bf1211d601527133ea int i = 15 + worldserver.random.nextInt(15) + worldserver.random.nextInt(15); diff --git a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java -index e9a77c1ae09af42d2d444ad6b5f6c8ac395044e1..4540d3a31ed89ea3684feeffb85a391655e9cbbc 100644 +index e9a77c1ae09af42d2d444ad6b5f6c8ac395044e1..295c1439645c8da7f84f0a72abb3235ee879e89c 100644 --- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java @@ -61,7 +61,7 @@ public class SpongeBlock extends Block { @@ -17809,7 +18070,7 @@ index e9a77c1ae09af42d2d444ad6b5f6c8ac395044e1..4540d3a31ed89ea3684feeffb85a3916 private boolean removeWaterBreadthFirstSearch(Level world, BlockPos pos) { BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator - BlockPos.breadthFirstTraversal(pos, 6, 65, (blockposition1, consumer) -> { -+ BlockPos.breadthFirstTraversal(pos, world.purpurConfig.spongeAbsorptionRadius, world.purpurConfig.spongeAbsorptionArea, (blockposition1, consumer) -> { // Purpur ++ BlockPos.breadthFirstTraversal(pos, world.purpurConfig.spongeAbsorptionRadius, world.purpurConfig.spongeAbsorptionArea, (blockposition1, consumer) -> { // Purpur - Configurable sponge absorption Direction[] aenumdirection = SpongeBlock.ALL_DIRECTIONS; int i = aenumdirection.length; @@ -17834,7 +18095,7 @@ index e9a77c1ae09af42d2d444ad6b5f6c8ac395044e1..4540d3a31ed89ea3684feeffb85a3916 if (!iblockdata.is(Blocks.KELP) && !iblockdata.is(Blocks.KELP_PLANT) && !iblockdata.is(Blocks.SEAGRASS) && !iblockdata.is(Blocks.TALL_SEAGRASS)) { return BlockPos.TraversalNodeStatus.SKIP; 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 f1366aea49206afcd64bf058ee673d6a562315c5..ff655401c7aecba5acd8d241e844d77364f09f35 100644 +index f1366aea49206afcd64bf058ee673d6a562315c5..e93d1eba4fcd02e15287a1a66da94e695806a470 100644 --- a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java @@ -93,4 +93,14 @@ public class StonecutterBlock extends Block { @@ -17842,15 +18103,15 @@ index f1366aea49206afcd64bf058ee673d6a562315c5..ff655401c7aecba5acd8d241e844d773 return false; } + -+ // Purpur start ++ // Purpur start - Stonecutter damage + @Override + 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) { -+ entity.hurt(entity.damageSources().stonecutter().directBlock(level, pos), level.purpurConfig.stonecutterDamage); ++ entity.hurtServer((net.minecraft.server.level.ServerLevel) level, entity.damageSources().stonecutter().directBlock(level, pos), level.purpurConfig.stonecutterDamage); + } + super.stepOn(level, pos, state, entity); + } -+ // Purpur end ++ // Purpur end - Stonecutter damage } diff --git a/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java b/src/main/java/net/minecraft/world/level/block/SugarCaneBlock.java index 547ea09ed84595286c97c128b3b96f6d387ae25f..d0f8a13f27132257ece6dadf736c2dc6b1e5720e 100644 @@ -17901,7 +18162,7 @@ index 547ea09ed84595286c97c128b3b96f6d387ae25f..d0f8a13f27132257ece6dadf736c2dc6 + // 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 953ddb2ea6fd48e57712e30a6addf23e188e5312..f1dfb23160ff70e0da4dd2af2d83e879527c6651 100644 +index 953ddb2ea6fd48e57712e30a6addf23e188e5312..cf86448e2067712863d30c9aecc48daedefd227f 100644 --- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java @@ -171,7 +171,7 @@ public class TurtleEggBlock extends Block { @@ -17918,7 +18179,7 @@ index 953ddb2ea6fd48e57712e30a6addf23e188e5312..f1dfb23160ff70e0da4dd2af2d83e879 private boolean canDestroyEgg(ServerLevel world, Entity entity) { - return !(entity instanceof Turtle) && !(entity instanceof Bat) ? (!(entity instanceof LivingEntity) ? false : entity instanceof Player || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) : false; -+ // Purpur start ++ // Purpur start - Add turtle egg block options + if (entity instanceof Turtle || entity instanceof Bat) { + return false; + } @@ -17934,16 +18195,16 @@ index 953ddb2ea6fd48e57712e30a6addf23e188e5312..f1dfb23160ff70e0da4dd2af2d83e879 + if (!(entity instanceof LivingEntity)) { + return false; + } ++ // Purpur start - Option to disable turtle egg trampling with feather falling + if (world.purpurConfig.turtleEggsTramplingFeatherFalling) { + java.util.Iterator armor = ((LivingEntity) entity).getArmorSlots().iterator(); + return !armor.hasNext() || net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.FEATHER_FALLING, armor.next()) < (int) entity.fallDistance; + } -+ if (entity instanceof Player) { -+ return true; -+ } ++ // Purpur end - Option to disable turtle egg trampling with feather falling ++ if (entity instanceof Player) return true; + -+ return world.purpurConfig.turtleEggsBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); -+ // Purpur end ++ return world.purpurConfig.turtleEggsBypassMobGriefing ^ world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // Purpur - Add mobGriefing bypass to everything affected ++ // Purpur end - Add turtle egg block options } } diff --git a/src/main/java/net/minecraft/world/level/block/TwistingVinesBlock.java b/src/main/java/net/minecraft/world/level/block/TwistingVinesBlock.java @@ -17979,14 +18240,14 @@ index 3dec5a082606ee35a8c8d7f746480262d6a189c5..b2f6ccae9576c176263e51a232e17a08 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/WitherSkullBlock.java b/src/main/java/net/minecraft/world/level/block/WitherSkullBlock.java -index 0fbe66cc02bd3d95c0a5dcd55380a1b4a2f17ca6..3a7126883f11ac5a647947eaf060df15536a6cb2 100644 +index 0fbe66cc02bd3d95c0a5dcd55380a1b4a2f17ca6..11d6427682d8778d1cf668ee4c1d5760af2c185e 100644 --- a/src/main/java/net/minecraft/world/level/block/WitherSkullBlock.java +++ b/src/main/java/net/minecraft/world/level/block/WitherSkullBlock.java @@ -80,6 +80,7 @@ public class WitherSkullBlock extends SkullBlock { entitywither.moveTo((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.55D, (double) blockposition1.getZ() + 0.5D, shapedetector_shapedetectorcollection.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F, 0.0F); entitywither.yBodyRot = shapedetector_shapedetectorcollection.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F; entitywither.makeInvulnerable(); -+ entitywither.setSummoner(iblockdata.getBlock().placer == null ? null : iblockdata.getBlock().placer.getUUID()); // Purpur ++ entitywither.setSummoner(iblockdata.getBlock().placer == null ? null : iblockdata.getBlock().placer.getUUID()); // Purpur - Summoner API // CraftBukkit start if (!world.addFreshEntity(entitywither, SpawnReason.BUILD_WITHER)) { return; @@ -18083,14 +18344,14 @@ index 618552afbdacc919c33b30a6bf4834fb71ab3d5b..7a059d20abdcc0073a314311d78f63ae @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 0e0d178f2793ab014358f534c8dc53218b89f083..2d190b3a6378b8cbadfa65510df1ccfbd5882ef8 100644 +index 0e0d178f2793ab014358f534c8dc53218b89f083..98e3d0a6f1be8cef8678b4048a3a484012092f08 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 @@ -92,6 +92,16 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name public double getEffectRange() { if (this.effectRange < 0) { -+ // Purpur Start ++ // Purpur start - Beacon Activation Range Configurable + if (this.level != null) { + switch (this.levels) { + case 1: return this.level.purpurConfig.beaconLevelOne; @@ -18099,7 +18360,7 @@ index 0e0d178f2793ab014358f534c8dc53218b89f083..2d190b3a6378b8cbadfa65510df1ccfb + case 4: return this.level.purpurConfig.beaconLevelFour; + } + } -+ // Purpur End ++ // Purpur end - Beacon Activation Range Configurable return this.levels * 10 + 10; } else { return effectRange; @@ -18131,7 +18392,7 @@ index 0e0d178f2793ab014358f534c8dc53218b89f083..2d190b3a6378b8cbadfa65510df1ccfb BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT); } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -index 65a85b4a4e159cfe55e435ed342a87bcc07b21d5..6fa25cac9d88808a590281bf90f619fa2f167d4a 100644 +index 65a85b4a4e159cfe55e435ed342a87bcc07b21d5..fdebf45a27b903f4abb0bf55e1d79d78b7cc3d32 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java @@ -60,7 +60,7 @@ public class BeehiveBlockEntity extends BlockEntity { @@ -18147,7 +18408,7 @@ index 65a85b4a4e159cfe55e435ed342a87bcc07b21d5..6fa25cac9d88808a590281bf90f619fa return list; } -+ // Purpur start ++ // Purpur start - Stored Bee API + public List releaseBee(BlockState iblockdata, BeehiveBlockEntity.BeeData data, BeehiveBlockEntity.BeeReleaseStatus tileentitybeehive_releasestatus, boolean force) { + List list = Lists.newArrayList(); + @@ -18161,18 +18422,18 @@ index 65a85b4a4e159cfe55e435ed342a87bcc07b21d5..6fa25cac9d88808a590281bf90f619fa + + return list; + } -+ // Purpur end ++ // Purpur end - Stored Bee API + @VisibleForDebug public int getOccupantCount() { return this.stored.size(); } -+ // Purpur start ++ // Purpur start - Stored Bee API + public List getStored() { + return stored; + } -+ // Purpur end ++ // Purpur end - Stored Bee API + // Paper start - Add EntityBlockStorage clearEntities public void clearBees() { @@ -18182,10 +18443,10 @@ index 65a85b4a4e159cfe55e435ed342a87bcc07b21d5..6fa25cac9d88808a590281bf90f619fa } - private static class BeeData { -+ public static class BeeData { // Purpur - change from private to public ++ public static class BeeData { // Purpur - change from private to public - Stored Bee API - private final BeehiveBlockEntity.Occupant occupant; -+ public final BeehiveBlockEntity.Occupant occupant; // Purpur - make public ++ public final BeehiveBlockEntity.Occupant occupant; // Purpur - make public - Stored Bee API private int exitTickCounter; // Paper - Fix bees aging inside hives; separate counter for checking if bee should exit to reduce exit attempts private int ticksInHive; @@ -18362,7 +18623,7 @@ index 39aac959775afeaeea211f21d498cb0ddf0a3fcb..6349a342c023f378af431a73a62fb017 + // Purpur } diff --git a/src/main/java/net/minecraft/world/level/block/entity/FuelValues.java b/src/main/java/net/minecraft/world/level/block/entity/FuelValues.java -index 61ef08ac941b1e8988d001241780d3a1582f7a2d..2eab5b43ab654966d26424597c1f3baa919e8434 100644 +index 61ef08ac941b1e8988d001241780d3a1582f7a2d..6ceb938d6f6a4f2bc5b786c7af7bd291f7486340 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/FuelValues.java +++ b/src/main/java/net/minecraft/world/level/block/entity/FuelValues.java @@ -17,7 +17,7 @@ import net.minecraft.world.level.ItemLike; @@ -18370,7 +18631,7 @@ index 61ef08ac941b1e8988d001241780d3a1582f7a2d..2eab5b43ab654966d26424597c1f3baa public class FuelValues { - private final Object2IntSortedMap values; -+ public final Object2IntSortedMap values; // Purpur - private -> public ++ public final Object2IntSortedMap values; // Purpur - private -> public - Added the ability to add combustible items FuelValues(Object2IntSortedMap fuelValues) { this.values = fuelValues; @@ -18495,7 +18756,7 @@ index 8c0f332a1a0918f60226d969918ae7fe4fe74166..c8ae6e4cd74549f753ec04def5d882de protected final String descriptionId; 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 97937e3bd211997f0a0a3e9e671a1c59712d0003..090e196cf391dced8adcb8106026d67b2aeac6b0 100644 +index 97937e3bd211997f0a0a3e9e671a1c59712d0003..00ea1c2037c7c7780764bfcc3e07b6554e910db2 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -89,6 +89,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p @@ -18522,24 +18783,24 @@ index 97937e3bd211997f0a0a3e9e671a1c59712d0003..090e196cf391dced8adcb8106026d67b this.defaultBlockState = empty ? VOID_AIR_BLOCKSTATE : AIR_BLOCKSTATE; // Paper end - get block chunk optimisation + -+ this.lightningTick = java.util.concurrent.ThreadLocalRandom.current().nextInt(100000) << 1; // Pufferfish - initialize lightning tick // Purpur - any random will do ++ this.lightningTick = java.util.concurrent.ThreadLocalRandom.current().nextInt(100000) << 1; // Pufferfish - initialize lightning tick // Purpur - any random will do - Fix pufferfish issues } // CraftBukkit start 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 356d010506fd21f3c752e4aa86c46c1106fdde3b..86e16dd6b905af31795fda8002f2e1f857ddcb9f 100644 +index 356d010506fd21f3c752e4aa86c46c1106fdde3b..8573d4dbb45db6510d1a4deccb3e5a257504f7d5 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 @@ -106,6 +106,7 @@ public class EntityStorage implements EntityPersistentStorage { } // Paper end - Entity load/save limit per chunk CompoundTag compoundTagx = new CompoundTag(); -+ if (!entity.canSaveToDisk()) return; // Purpur ++ if (!entity.canSaveToDisk()) return; // Purpur - Add canSaveToDisk to Entity if (entity.save(compoundTagx)) { listTag.add(compoundTagx); } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index e40665cead218502b44dd49051a53326ed94f061..cf0f3a14584b9280211f88808cb1ddfb10105ec5 100644 +index e40665cead218502b44dd49051a53326ed94f061..a68f27288604b6f6755efe3c8ea612e295cb1656 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java @@ -289,7 +289,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise @@ -18547,7 +18808,7 @@ index e40665cead218502b44dd49051a53326ed94f061..cf0f3a14584b9280211f88808cb1ddfb // Paper start private static void printOversizedLog(String msg, Path file, int x, int z) { - org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); -+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PURPUR - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Purpur ++ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PURPUR - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Purpur - Rebrand } private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException { @@ -18671,7 +18932,7 @@ index 552925ba47c7475e2e1ec2ded0966f28ed3e50a5..1e741f36b79585f33abe413beafe00cf @Override protected void beforeDestroyingBlock(LevelAccessor world, BlockPos pos, BlockState state, BlockPos source) { 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 c84fd369d92932903c76bb2012602617d3e2d213..224896124706764412033c8726c822e116f2c0f1 100644 +index c84fd369d92932903c76bb2012602617d3e2d213..b65512f65e06865cc4d2964bd4ca2806784be738 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java @@ -240,7 +240,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { @@ -18679,7 +18940,7 @@ index c84fd369d92932903c76bb2012602617d3e2d213..224896124706764412033c8726c822e1 && maxYStep > 0 && (pathType != PathType.FENCE || this.canWalkOverFences()) - && pathType != PathType.UNPASSABLE_RAIL -+ && (this.mob.level().purpurConfig.mobsIgnoreRails || pathType != PathType.UNPASSABLE_RAIL) // Purpur ++ && (this.mob.level().purpurConfig.mobsIgnoreRails || pathType != PathType.UNPASSABLE_RAIL) // Purpur - Config to allow mobs to pathfind over rails && pathType != PathType.TRAPDOOR && pathType != PathType.POWDER_SNOW) { node = this.tryJumpOn(x, y, z, maxYStep, prevFeetY, direction, nodeType, mutableBlockPos); @@ -18688,7 +18949,7 @@ index c84fd369d92932903c76bb2012602617d3e2d213..224896124706764412033c8726c822e1 } else if (blockState.is(Blocks.POWDER_SNOW)) { return PathType.POWDER_SNOW; - } 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 ++ } else if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH) || blockState.is(Blocks.STONECUTTER)) { // Purpur - Stonecutter damage return PathType.DAMAGE_OTHER; } else if (blockState.is(Blocks.HONEY_BLOCK)) { return PathType.STICKY_HONEY; @@ -18987,7 +19248,7 @@ index 94ca0407303c4493ab4928b12ec6ecc75aaca549..a138e1b6b66d99f2035de054137a607a + // 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 97b5d6ba2b19a7c730730c74175a29157aed1840..d74591cd30b19f0d5cbfdb81e0607ccd4bdd91d4 100644 +index 97b5d6ba2b19a7c730730c74175a29157aed1840..badf280a6b01b06e8148c552330872d64e6256b7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -426,6 +426,20 @@ public final class CraftServer implements Server { @@ -19015,7 +19276,7 @@ index 97b5d6ba2b19a7c730730c74175a29157aed1840..d74591cd30b19f0d5cbfdb81e0607ccd org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot this.console.paperConfigurations.reloadConfigs(this.console); -+ org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur ++ org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur - Purpur config files for (ServerLevel world : this.console.getAllLevels()) { // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) @@ -19023,7 +19284,7 @@ index 97b5d6ba2b19a7c730730c74175a29157aed1840..d74591cd30b19f0d5cbfdb81e0607ccd } } world.spigotConfig.init(); // Spigot -+ world.purpurConfig.init(); // Purpur ++ world.purpurConfig.init(); // Purpur - Purpur config files } Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper @@ -19031,15 +19292,15 @@ index 97b5d6ba2b19a7c730730c74175a29157aed1840..d74591cd30b19f0d5cbfdb81e0607ccd org.spigotmc.SpigotConfig.registerCommands(); // Spigot io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper this.spark.registerCommandBeforePlugins(this); // Paper - spark -+ org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur ++ org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur - Purpur config files this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -1626,6 +1643,58 @@ public final class CraftServer implements Server { +@@ -1626,6 +1643,59 @@ public final class CraftServer implements Server { return true; } -+ // Purpur Start ++ // Purpur start - Added the ability to add combustible items + @Override + public void addFuel(org.bukkit.Material material, int burnTime) { + Preconditions.checkArgument(burnTime > 0, "BurnTime must be greater than 0"); @@ -19053,7 +19314,8 @@ index 97b5d6ba2b19a7c730730c74175a29157aed1840..d74591cd30b19f0d5cbfdb81e0607ccd + net.minecraft.world.item.ItemStack itemStack = net.minecraft.world.item.ItemStack.fromBukkitCopy(new ItemStack(material)); + MinecraftServer.getServer().fuelValues().values.keySet().removeIf(itemStack::is); + } -+ ++ // Purpur end - Added the ability to add combustible items ++ // Purpur start - Debug Marker API + @Override + public void sendBlockHighlight(Location location, int duration) { + sendBlockHighlight(location, duration, "", 0x6400FF00); @@ -19089,16 +19351,16 @@ index 97b5d6ba2b19a7c730730c74175a29157aed1840..d74591cd30b19f0d5cbfdb81e0607ccd + public void clearBlockHighlights() { + this.worlds.forEach((name, world) -> clearBlockHighlights()); + } -+ // Purpur End ++ // Purpur end - Debug Marker API + @Override public List getRecipesFor(ItemStack result) { Preconditions.checkArgument(result != null, "ItemStack cannot be null"); -@@ -3031,6 +3100,18 @@ public final class CraftServer implements Server { +@@ -3031,6 +3101,18 @@ public final class CraftServer implements Server { return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); } -+ // Purpur start ++ // Purpur start - Purpur config files + @Override + public YamlConfiguration getPurpurConfig() { + return org.purpurmc.purpur.PurpurConfig.config; @@ -19108,20 +19370,20 @@ index 97b5d6ba2b19a7c730730c74175a29157aed1840..d74591cd30b19f0d5cbfdb81e0607ccd + public java.util.Properties getServerProperties() { + return getProperties().properties; + } -+ // Purpur end ++ // Purpur end - Purpur config files + @Override public void restart() { org.spigotmc.RestartCommand.restart(); -@@ -3060,6 +3141,7 @@ public final class CraftServer implements Server { +@@ -3060,6 +3142,7 @@ public final class CraftServer implements Server { @Override public double[] getTPS() { return new double[] { -+ net.minecraft.server.MinecraftServer.getServer().tps5s.getAverage(), // Purpur ++ net.minecraft.server.MinecraftServer.getServer().tps5s.getAverage(), // Purpur - Add 5 second tps average in /tps net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(), net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(), net.minecraft.server.MinecraftServer.getServer().tps15.getAverage() -@@ -3270,4 +3352,16 @@ public final class CraftServer implements Server { +@@ -3270,4 +3353,17 @@ public final class CraftServer implements Server { this.console.addPluginAllowingSleep(plugin.getName(), value); } // Paper end - API to check if the server is sleeping @@ -19131,26 +19393,28 @@ index 97b5d6ba2b19a7c730730c74175a29157aed1840..d74591cd30b19f0d5cbfdb81e0607ccd + public String getServerName() { + return this.getProperties().serverName; + } -+ ++ // Purpur end ++ // Purpur start - Lagging threshold + @Override + public boolean isLagging() { + return getServer().lagging; + } -+ // Purpur end ++ // Purpur end - Lagging threshold } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 92d9f0ea8f7810ae20d3996f49aefa539b4bcb69..eb9bb689a52a7e9c95d6f2e07bb16799286e9057 100644 +index 92d9f0ea8f7810ae20d3996f49aefa539b4bcb69..5d7af6c1ec557d2a2813b87a64b8c8a99d2f87e0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2374,6 +2374,48 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2374,6 +2374,49 @@ public class CraftWorld extends CraftRegionAccessor implements World { return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight()); } -+ // Purpur start ++ // Purpur start - Add local difficulty api + public float getLocalDifficultyAt(Location location) { + return getHandle().getCurrentDifficultyAt(io.papermc.paper.util.MCUtil.toBlockPosition(location)).getEffectiveDifficulty(); + } -+ ++ // Purpur end - Add local difficulty api ++ // Purpur start - Debug Marker API + @Override + public void sendBlockHighlight(Location location, int duration) { + sendBlockHighlight(location, duration, "", 0x6400FF00); @@ -19186,33 +19450,33 @@ index 92d9f0ea8f7810ae20d3996f49aefa539b4bcb69..eb9bb689a52a7e9c95d6f2e07bb16799 + public void clearBlockHighlights() { + net.minecraft.network.protocol.game.DebugPackets.sendGameTestClearPacket(getHandle()); + } -+ // Purpur end ++ // Purpur end - Debug Marker API + @Override public Collection getStructures(int x, int z) { return this.getStructures(x, z, struct -> true); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 1c2439ffc1e407ff69286817d22f127470ce07ba..c471a8c81ba067abcb22956ad1a30b5a9b64fc87 100644 +index 1c2439ffc1e407ff69286817d22f127470ce07ba..10aa600fab7146b330d46b5fd2fe596da222a70a 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -176,6 +176,20 @@ public class Main { .describedAs("Jar file"); // Paper end -+ // Purpur Start ++ // Purpur start - Fix pufferfish issues ++ acceptsAll(asList("pufferfish", "pufferfish-settings"), "File for pufferfish settings") ++ .withRequiredArg() ++ .ofType(File.class) ++ .defaultsTo(new File("pufferfish.yml")) ++ .describedAs("Yml file"); ++ // Purpur end - Fix pufferfish issues ++ // Purpur start - Purpur config files + acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings") + .withRequiredArg() + .ofType(File.class) + .defaultsTo(new File("purpur.yml")) + .describedAs("Yml file"); -+ -+ acceptsAll(asList("pufferfish", "pufferfish-settings"), "File for pufferfish settings") -+ .withRequiredArg() -+ .ofType(File.class) -+ .defaultsTo(new File("pufferfish.yml")) -+ .describedAs("Yml file"); -+ // Purpur end -+ ++ // Purpur end - Purpur config files // Paper start acceptsAll(asList("server-name"), "Name of the server") .withRequiredArg() @@ -19226,35 +19490,34 @@ index 1c2439ffc1e407ff69286817d22f127470ce07ba..c471a8c81ba067abcb22956ad1a30b5a Calendar deadline = Calendar.getInstance(); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java -index 1a2a05160ba51d9c75f1ae6ae61d944d81428722..3beb26ad2ef0fded49a8da8c5dec64f9508c1995 100644 +index 1a2a05160ba51d9c75f1ae6ae61d944d81428722..a86b026f2f420637d125cf697bcd07bf314c98aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java @@ -16,8 +16,15 @@ import org.bukkit.entity.Bee; public class CraftBeehive extends CraftBlockEntityState implements Beehive { -+ private final List> storage = new ArrayList<>(); // Purpur ++ private final List> storage = new ArrayList<>(); // Purpur - Stored Bee API + public CraftBeehive(World world, BeehiveBlockEntity tileEntity) { super(world, tileEntity); -+ // Purpur start - load bees to be able to modify them individually ++ // Purpur start - load bees to be able to modify them individually - Stored Bee API + for(BeehiveBlockEntity.BeeData data : tileEntity.getStored()) { + storage.add(new org.purpurmc.purpur.entity.PurpurStoredBee(data, this)); + } -+ // Purpur end ++ // Purpur end - Stored Bee API } protected CraftBeehive(CraftBeehive state, Location location) { -@@ -75,15 +82,54 @@ public class CraftBeehive extends CraftBlockEntityState impl - bees.add((Bee) bee.getBukkitEntity()); +@@ -76,14 +83,54 @@ public class CraftBeehive extends CraftBlockEntityState impl } } -- -+ storage.clear(); // Purpur + ++ storage.clear(); // Purpur - Stored Bee API return bees; } -+ // Purpur start ++ // Purpur start - Stored Bee API + @Override + public Bee releaseEntity(org.purpurmc.purpur.entity.StoredEntity entity) { + ensureNoWorldGeneration(); @@ -19283,30 +19546,29 @@ index 1a2a05160ba51d9c75f1ae6ae61d944d81428722..3beb26ad2ef0fded49a8da8c5dec64f9 + public List> getEntities() { + return new ArrayList<>(storage); + } -+ // Purpur end ++ // Purpur end - Stored Bee API + @Override public void addEntity(Bee entity) { Preconditions.checkArgument(entity != null, "Entity must not be null"); -- this.getSnapshot().addOccupant(((CraftBee) entity).getHandle()); -+ int length = this.getSnapshot().getStored().size(); // Purpur -+ getSnapshot().addOccupant(((CraftBee) entity).getHandle()); ++ int length = this.getSnapshot().getStored().size(); // Purpur - Stored Bee API + this.getSnapshot().addOccupant(((CraftBee) entity).getHandle()); + -+ // Purpur start - check if new bee was added, and if yes, add to stored bees ++ // Purpur start - check if new bee was added, and if yes, add to stored bees - Stored Bee API + List storedBeeData = this.getSnapshot().getStored(); + if(length < storedBeeData.size()) { + storage.add(new org.purpurmc.purpur.entity.PurpurStoredBee(storedBeeData.getLast(), this)); + } -+ // Purpur end ++ // Purpur end - Stored Bee API } @Override -@@ -100,6 +146,7 @@ public class CraftBeehive extends CraftBlockEntityState impl +@@ -100,6 +147,7 @@ public class CraftBeehive extends CraftBlockEntityState impl @Override public void clearEntities() { getSnapshot().clearBees(); -+ storage.clear(); // Purpur ++ storage.clear(); // Purpur - Stored Bee API } // Paper end } @@ -19324,7 +19586,7 @@ index c1759aeb3e6ad0e4eb66cba3da1b120dd1dce812..1a91bc2e422db0eba65694ac046f1b36 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java -index 4e56018b64d11f76c8da43fd8f85c6de72204e36..9607675e6c5bff2183c4420d11fc63eeb5747fb6 100644 +index 4e56018b64d11f76c8da43fd8f85c6de72204e36..36cec3ed39807e85013e4e3b98c979d7af37ce58 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 @@ -19332,12 +19594,12 @@ index 4e56018b64d11f76c8da43fd8f85c6de72204e36..9607675e6c5bff2183c4420d11fc63ee @Override public void sendMessage(String message) { - this.sendRawMessage(message); -+ // Purpur start ++ // Purpur start - Rebrand + String[] parts = message.split("\n"); + for (String part : parts) { + this.sendRawMessage(part); + } -+ // Purpur end ++ // Purpur end - Rebrand } @Override @@ -19346,12 +19608,12 @@ index 4e56018b64d11f76c8da43fd8f85c6de72204e36..9607675e6c5bff2183c4420d11fc63ee @Override public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) { - this.sendRawMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message)); -+ this.sendMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message)); // Purpur ++ this.sendMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message)); // Purpur - Rebrand } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java -index d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8..985e9ec21c60a1f47973bd5fc53b96a6f9b7d04a 100644 +index d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8..3604d92c122b5c8be823098ce7b91e57e976589c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEndermite.java @@ -21,12 +21,12 @@ public class CraftEndermite extends CraftMonster implements Endermite { @@ -19359,18 +19621,18 @@ index d657fd2c507a5b215aeab0a5f3e9c2ee892a27c8..985e9ec21c60a1f47973bd5fc53b96a6 @Override public boolean isPlayerSpawned() { - return false; -+ return getHandle().isPlayerSpawned(); // Purpur ++ return getHandle().isPlayerSpawned(); // Purpur - Add back player spawned endermite API } @Override public void setPlayerSpawned(boolean playerSpawned) { - // Nop -+ getHandle().setPlayerSpawned(playerSpawned); // Purpur ++ getHandle().setPlayerSpawned(playerSpawned); // Purpur - Add back player spawned endermite API } // 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 b25b10c24a379097233e61bcc10add841b6a7115..1290c1587fe9e39d9350c1079ab27f3be0c6084f 100644 +index b25b10c24a379097233e61bcc10add841b6a7115..0e1b3f64d1a828b9c69efe45c511582880bdcb92 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -87,6 +87,23 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -19410,7 +19672,7 @@ index b25b10c24a379097233e61bcc10add841b6a7115..1290c1587fe9e39d9350c1079ab27f3b } // Paper end - broadcast hurt animation + -+ // Purpur start ++ // Purpur start - Ridables + @Override + public org.bukkit.entity.Player getRider() { + net.minecraft.world.entity.player.Player rider = getHandle().getRider(); @@ -19431,7 +19693,7 @@ index b25b10c24a379097233e61bcc10add841b6a7115..1290c1587fe9e39d9350c1079ab27f3b + public boolean isRidableInWater() { + return !getHandle().dismountsUnderwater(); + } -+ // Purpur end ++ // Purpur end - Ridables } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index e345cdbfab44a0f5da80d738798dbb4424b7ab5c..856f12eb276c214f2f57a58a89a4da9eea34db2d 100644 @@ -19446,7 +19708,7 @@ index e345cdbfab44a0f5da80d738798dbb4424b7ab5c..856f12eb276c214f2f57a58a89a4da9e @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftIronGolem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftIronGolem.java -index 63cae1a2e95d8da17c45c4404a8dd0ca6a413c39..966587c2788b5c93be83259ddc962a89cde7cbaa 100644 +index 63cae1a2e95d8da17c45c4404a8dd0ca6a413c39..464a3713845548473a357ea66c6147b10ff2cb16 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftIronGolem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftIronGolem.java @@ -27,4 +27,17 @@ public class CraftIronGolem extends CraftGolem implements IronGolem { @@ -19454,7 +19716,7 @@ index 63cae1a2e95d8da17c45c4404a8dd0ca6a413c39..966587c2788b5c93be83259ddc962a89 this.getHandle().setPlayerCreated(playerCreated); } + -+ // Purpur start ++ // Purpur start - Summoner API + @Override + @org.jetbrains.annotations.Nullable + public java.util.UUID getSummoner() { @@ -19465,10 +19727,10 @@ index 63cae1a2e95d8da17c45c4404a8dd0ca6a413c39..966587c2788b5c93be83259ddc962a89 + public void setSummoner(@org.jetbrains.annotations.Nullable java.util.UUID summoner) { + getHandle().setSummoner(summoner); + } -+ // Purpur end ++ // Purpur end - Summoner API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index 30d62ee4d5cd2ddacb8783b5bbbf475d592b3e02..5c1cda88080850314dac196dbe71ff12e48a8aca 100644 +index 30d62ee4d5cd2ddacb8783b5bbbf475d592b3e02..762be3721419bfe33ea6577d3c6961204fdb0037 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java @@ -151,4 +151,51 @@ public class CraftItem extends CraftEntity implements Item { @@ -19476,7 +19738,7 @@ index 30d62ee4d5cd2ddacb8783b5bbbf475d592b3e02..5c1cda88080850314dac196dbe71ff12 return "CraftItem"; } + -+ // Purpur start ++ // Purpur start - Item entity immunities + @Override + public void setImmuneToCactus(boolean immuneToCactus) { + this.getHandle().immuneToCactus = immuneToCactus; @@ -19521,7 +19783,7 @@ index 30d62ee4d5cd2ddacb8783b5bbbf475d592b3e02..5c1cda88080850314dac196dbe71ff12 + public boolean isImmuneToLightning() { + return this.getHandle().immuneToLightning; + } -+ // Purpur end ++ // Purpur end - Item entity immunities } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 4f98d138a275a6c34528b7a5148ef265bc38d6b5..72498e233ece886941cca268e729336d66042402 100644 @@ -19575,23 +19837,23 @@ index 351f42842b780d053cd2e5bad9ae299449141b10..4860574e7fad7a9527dda599703c573c + // 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 6a647cab8b2e476987931486e290703b8726f2c7..029d6daa003f90999afa4e5070eabf6e0ada473a 100644 +index 6a647cab8b2e476987931486e290703b8726f2c7..c2df3c38f58d8dcb5e3d62077655af56a3bffd65 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -584,10 +584,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setPlayerListName(String name) { -+ // Purpur start ++ // Purpur start - AFK API + setPlayerListName(name, false); + } + public void setPlayerListName(String name, boolean useMM) { -+ // Purpur end ++ // Purpur end - AFK API if (name == null) { name = this.getName(); } - this.getHandle().listName = name.equals(this.getName()) ? null : CraftChatMessage.fromStringOrNull(name); -+ this.getHandle().listName = name.equals(this.getName()) ? null : useMM ? io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(name)) : CraftChatMessage.fromStringOrNull(name); // Purpur ++ this.getHandle().listName = name.equals(this.getName()) ? null : useMM ? io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(name)) : CraftChatMessage.fromStringOrNull(name); // Purpur - AFK API if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined for (ServerPlayer player : (List) this.server.getHandle().players) { if (player.getBukkitEntity().canSee(this)) { @@ -19640,17 +19902,18 @@ index 6a647cab8b2e476987931486e290703b8726f2c7..029d6daa003f90999afa4e5070eabf6e private void validateSpeed(float value) { Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value); } -@@ -3565,4 +3594,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3565,4 +3594,73 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundEntityEventPacket(((CraftEntity) target).getHandle(), effect.getData())); } // Paper end - entity effect API + -+ // Purpur start ++ // Purpur start - Purpur client support + @Override + public boolean usesPurpurClient() { + return getHandle().purpurClient; + } -+ ++ // Purpur end - Purpur client support ++ // Purpur start - AFK API + @Override + public boolean isAfk() { + return getHandle().isAfk(); @@ -19665,7 +19928,8 @@ index 6a647cab8b2e476987931486e290703b8726f2c7..029d6daa003f90999afa4e5070eabf6e + public void resetIdleTimer() { + getHandle().resetLastActionTime(); + } -+ ++ // Purpur end - AFK API ++ // Purpur start - Debug Marker API + @Override + public void sendBlockHighlight(Location location, int duration) { + sendBlockHighlight(location, duration, "", 0x6400FF00); @@ -19703,16 +19967,17 @@ index 6a647cab8b2e476987931486e290703b8726f2c7..029d6daa003f90999afa4e5070eabf6e + if (this.getHandle().connection == null) return; + this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket(new net.minecraft.network.protocol.common.custom.GameTestClearMarkersDebugPayload())); + } -+ ++ // Purpur end - Debug Marker API ++ // Purpur start - Add death screen API + @Override + public void sendDeathScreen(net.kyori.adventure.text.Component message) { + if (this.getHandle().connection == null) return; + this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerCombatKillPacket(getEntityId(), io.papermc.paper.adventure.PaperAdventure.asVanilla(message))); + } -+ // Purpur end ++ // Purpur end - Add death screen API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -index 4ce2373ff71c3c1b8951646e057587a3ab09e145..4f7f6cf6ca24406570d2d29dc63dc89401119961 100644 +index 4ce2373ff71c3c1b8951646e057587a3ab09e145..997b8e5059569de4ee8e70127c5d6019ce53afe3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java @@ -28,4 +28,17 @@ public class CraftSnowman extends CraftGolem implements Snowman, com.destroystok @@ -19720,7 +19985,7 @@ index 4ce2373ff71c3c1b8951646e057587a3ab09e145..4f7f6cf6ca24406570d2d29dc63dc894 return "CraftSnowman"; } + -+ // Purpur start ++ // Purpur start - Summoner API + @Override + @org.jetbrains.annotations.Nullable + public java.util.UUID getSummoner() { @@ -19731,10 +19996,10 @@ index 4ce2373ff71c3c1b8951646e057587a3ab09e145..4f7f6cf6ca24406570d2d29dc63dc894 + public void setSummoner(@org.jetbrains.annotations.Nullable java.util.UUID summoner) { + getHandle().setSummoner(summoner); + } -+ // Purpur end ++ // Purpur end - Summoner API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -index 8e895d6f84f7d84b219f2424909dd42e5f08dec4..53dcce0701d713c5dd097340a91b8be4806de4b8 100644 +index 8e895d6f84f7d84b219f2424909dd42e5f08dec4..e5597563a6ed620ab9c9e81be4bad56fd5308305 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java @@ -375,4 +375,11 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { @@ -19742,15 +20007,15 @@ index 8e895d6f84f7d84b219f2424909dd42e5f08dec4..53dcce0701d713c5dd097340a91b8be4 } // Paper end + -+ // Purpur start ++ // Purpur start - Lobotomize stuck villagers + @Override + public boolean isLobotomized() { + return getHandle().isLobotomized(); + } -+ // Purpur end ++ // Purpur end - Lobotomize stuck villagers } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java -index 7881c6253c1d652c0c0d54a9a8accdf0a1ff0f3e..da6ccb2a38df76770821a1a2203e54e722f541ca 100644 +index 7881c6253c1d652c0c0d54a9a8accdf0a1ff0f3e..fe8be71121324f64346174922c7bc7f5d3a9de69 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java @@ -99,4 +99,17 @@ public class CraftWither extends CraftMonster implements Wither, com.destroystok @@ -19758,7 +20023,7 @@ index 7881c6253c1d652c0c0d54a9a8accdf0a1ff0f3e..da6ccb2a38df76770821a1a2203e54e7 } // Paper end + -+ // Purpur start ++ // Purpur start - Summoner API + @Override + @org.jetbrains.annotations.Nullable + public java.util.UUID getSummoner() { @@ -19769,18 +20034,17 @@ index 7881c6253c1d652c0c0d54a9a8accdf0a1ff0f3e..da6ccb2a38df76770821a1a2203e54e7 + public void setSummoner(@org.jetbrains.annotations.Nullable java.util.UUID summoner) { + getHandle().setSummoner(summoner); + } -+ // Purpur end ++ // Purpur end - Summoner API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java -index ecd33b4add46acbe4e4f8879c0601220423d66ca..1506a8c0fa490726eb4a4ae14f3aa194dc81d9ab 100644 +index ecd33b4add46acbe4e4f8879c0601220423d66ca..001f131117c277e46f4a94f73da36d1b219fe3cd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java -@@ -146,4 +146,16 @@ public class CraftWolf extends CraftTameableAnimal implements Wolf { +@@ -146,4 +146,15 @@ public class CraftWolf extends CraftTameableAnimal implements Wolf { return this.getKey().hashCode(); } } -+ -+ // Purpur start ++ // Purpur start - Configurable chance for wolves to spawn rabid + @Override + public boolean isRabid() { + return getHandle().isRabid(); @@ -19790,24 +20054,24 @@ index ecd33b4add46acbe4e4f8879c0601220423d66ca..1506a8c0fa490726eb4a4ae14f3aa194 + public void setRabid(boolean isRabid) { + getHandle().setRabid(isRabid); + } -+ // Purpur end ++ // Purpur end - Configurable chance for wolves to spawn rabid } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e37aaf77f94b97b736cc20ef070cefdff0400188..763d06265c7d0000e4c641c3aaba785bb0efb23e 100644 +index e37aaf77f94b97b736cc20ef070cefdff0400188..d52d41d8c56e017f95914da19b05c3d79f8f1640 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -602,6 +602,15 @@ public class CraftEventFactory { // Paper end craftServer.getPluginManager().callEvent(event); -+ // Purpur start ++ // Purpur start - Ridables + if (who != null) { + switch (action) { + case LEFT_CLICK_BLOCK, LEFT_CLICK_AIR -> who.processClick(InteractionHand.MAIN_HAND); + case RIGHT_CLICK_BLOCK, RIGHT_CLICK_AIR -> who.processClick(InteractionHand.OFF_HAND); + } + } -+ // Purpur end ++ // Purpur end - Ridables + return event; } @@ -19817,7 +20081,7 @@ index e37aaf77f94b97b736cc20ef070cefdff0400188..763d06265c7d0000e4c641c3aaba785b } else if (source.getDirectBlock() != null) { DamageCause cause; - if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.STALAGMITE) || source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_ANVIL)) { -+ if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.STALAGMITE) || source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_ANVIL) || source.isStonecutter()) { // Purpur ++ if (source.is(DamageTypes.CACTUS) || source.is(DamageTypes.SWEET_BERRY_BUSH) || source.is(DamageTypes.STALAGMITE) || source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_ANVIL) || source.isStonecutter()) { // Purpur - Stonecutter damage cause = DamageCause.CONTACT; } else if (source.is(DamageTypes.HOT_FLOOR)) { cause = DamageCause.HOT_FLOOR; @@ -19825,7 +20089,7 @@ index e37aaf77f94b97b736cc20ef070cefdff0400188..763d06265c7d0000e4c641c3aaba785b EntityDamageEvent event; if (damager != null) { event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, critical); -+ damager.processClick(InteractionHand.MAIN_HAND); // Purpur ++ damager.processClick(InteractionHand.MAIN_HAND); // Purpur - Ridables } else { event = new EntityDamageEvent(damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions); } @@ -20334,7 +20598,7 @@ index cf0920e5f84b35647882fb963e9972af4e8427e0..e30c851acf49a425cd4fd409a6d5bbb2 + // Purpur - end } diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 1354ccfbf525e5e64483ac5f443cc2325ba63850..5e7b833fc9f37bc370c76e5c43e6c9919d6d20af 100644 +index 1354ccfbf525e5e64483ac5f443cc2325ba63850..2e7c3d4befeb6256ce81ecaa9ed4e8fbcb21651e 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -491,7 +491,7 @@ public class CraftScheduler implements BukkitScheduler { @@ -20342,12 +20606,12 @@ index 1354ccfbf525e5e64483ac5f443cc2325ba63850..5e7b833fc9f37bc370c76e5c43e6c991 } else { // this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(this.currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper - task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Paper"); // Paper -+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur ++ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur - Rebrand // We don't need to parse pending // (async tasks must live with race-conditions if they attempt to cancel between these few lines of code) } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 15892c7769caa15f3d52a1ee2147cf9615aa0e25..8979956334ad5802d221e45eba91248e7f048d13 100644 +index 15892c7769caa15f3d52a1ee2147cf9615aa0e25..d60e190ce5bfb0f57d282b8471faf61de5977076 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -505,7 +505,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -20355,12 +20619,12 @@ index 15892c7769caa15f3d52a1ee2147cf9615aa0e25..8979956334ad5802d221e45eba91248e @Override public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { - return new com.destroystokyo.paper.PaperVersionFetcher(); -+ return new com.destroystokyo.paper.PaperVersionFetcher(); // Pufferfish // Purpur ++ return new com.destroystokyo.paper.PaperVersionFetcher(); // Pufferfish // Purpur - Rebrand } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 774556a62eb240da42e84db4502e2ed43495be17..99597258e8e88cd9e2c901c4ac3ff7faeeabee2b 100644 +index 774556a62eb240da42e84db4502e2ed43495be17..99eb04643fce44c37fd96c99756837ccafe7b559 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 { @@ -20368,7 +20632,7 @@ index 774556a62eb240da42e84db4502e2ed43495be17..99597258e8e88cd9e2c901c4ac3ff7fa String result = "Unknown-Version"; - InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/io.papermc.paper/paper-api/pom.properties"); -+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur ++ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur - Rebrand Properties properties = new Properties(); if (stream != null) { @@ -25350,7 +25614,7 @@ index 0000000000000000000000000000000000000000..922e48799c43ca322a8f550c98a26e1e +} 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..1c7e38067b79869669a674dc949e9547b93bd49f +index 0000000000000000000000000000000000000000..477ae2cd8ded25023976e3b7525e0c3b0e8259d9 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/entity/DolphinSpit.java @@ -0,0 +1,108 @@ @@ -25392,12 +25656,12 @@ index 0000000000000000000000000000000000000000..1c7e38067b79869669a674dc949e9547 + dolphin.getZ() + (double) (dolphin.getBbWidth() + 1.0F) * 0.5D * (double) Mth.cos(dolphin.yBodyRot * 0.017453292F)); + } + -+ // Purpur start ++ // Purpur start - Add canSaveToDisk to Entity + @Override + public boolean canSaveToDisk() { + return false; + } -+ // Purpur end ++ // Purpur end - Add canSaveToDisk to Entity + + public void tick() { + super_tick(); @@ -25464,7 +25728,7 @@ index 0000000000000000000000000000000000000000..1c7e38067b79869669a674dc949e9547 +} 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..19c2d5240eb47d8b4e819c75dc378f2fa2697b0d +index 0000000000000000000000000000000000000000..f57d77c0cab0174e67c1fdda6ac56f408ad6a902 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/entity/PhantomFlames.java @@ -0,0 +1,130 @@ @@ -25508,12 +25772,12 @@ index 0000000000000000000000000000000000000000..19c2d5240eb47d8b4e819c75dc378f2f + phantom.getZ() + (double) (phantom.getBbWidth() + 1.0F) * 0.5D * (double) Mth.cos(phantom.yBodyRot * 0.017453292F)); + } + -+ // Purpur start ++ // Purpur start - Add canSaveToDisk to Entity + @Override + public boolean canSaveToDisk() { + return false; + } -+ // Purpur end ++ // Purpur end - Add canSaveToDisk to Entity + + public void tick() { + super_tick(); @@ -27119,7 +27383,7 @@ index 1d438ef44cbe4d1eedfba36d8fe5d2ad53464921..9b1a16747aa23b18e4cff986efaac6ce if (entity instanceof FireworkRocketEntity || (entity instanceof ItemEntity && (entity.tickCount + entity.getId()) % 4 == 0)) { // Paper - Needed for item gravity, see ItemEntity tick return true; diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java -index 9eb2823cc8f83bad2626fc77578b0162d9ed5782..f144a08e88f8268b84eb188a36bf470457f59958 100644 +index 9eb2823cc8f83bad2626fc77578b0162d9ed5782..d24d094d33c840052ace18e0385e0ffd3544fd82 100644 --- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java +++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java @@ -39,7 +39,7 @@ public class TicksPerSecondCommand extends Command @@ -27127,12 +27391,12 @@ index 9eb2823cc8f83bad2626fc77578b0162d9ed5782..f144a08e88f8268b84eb188a36bf4704 net.kyori.adventure.text.TextComponent.Builder builder = net.kyori.adventure.text.Component.text(); - builder.append(net.kyori.adventure.text.Component.text("TPS from last 1m, 5m, 15m: ", net.kyori.adventure.text.format.NamedTextColor.GOLD)); -+ builder.append(net.kyori.adventure.text.Component.text("TPS from last 5s, 1m, 5m, 15m: ", net.kyori.adventure.text.format.NamedTextColor.GOLD)); // Purpur ++ builder.append(net.kyori.adventure.text.Component.text("TPS from last 5s, 1m, 5m, 15m: ", net.kyori.adventure.text.format.NamedTextColor.GOLD)); // Purpur - Add 5 second tps average in /tps builder.append(net.kyori.adventure.text.Component.join(net.kyori.adventure.text.JoinConfiguration.commas(true), tpsAvg)); sender.sendMessage(builder.asComponent()); if (args.length > 0 && args[0].equals("mem") && sender.hasPermission("bukkit.command.tpsmemory")) { diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167..f51cc3de3ca935ef90f7f0e9dd0506b856fc55f3 100644 +index f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167..47f168b2d62c9a0eebdd8ab678afd857e7622571 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -96,7 +96,7 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre @@ -27140,7 +27404,7 @@ index f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167..f51cc3de3ca935ef90f7f0e9dd0506b8 private WatchdogThread(long timeoutTime, boolean restart) { - super( "Paper Watchdog Thread" ); -+ super( "Watchdog Thread" ); // Purpur - use a generic name ++ super( "Watchdog Thread" ); // Purpur - use a generic name - Rebrand this.timeoutTime = timeoutTime; this.restart = restart; earlyWarningEvery = Math.min(io.papermc.paper.configuration.GlobalConfiguration.get().watchdog.earlyWarningEvery, timeoutTime); // Paper @@ -27149,16 +27413,16 @@ index f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167..f51cc3de3ca935ef90f7f0e9dd0506b8 // Paper end log.log( Level.SEVERE, "------------------------------" ); - log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Paper bug." ); // Paper -+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Purpur bug." ); // Paper // Purpur ++ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Purpur bug." ); // Paper // Purpur - Rebrand log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" ); log.log( Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring" ); log.log( Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once" ); log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" ); - log.log( Level.SEVERE, "If you are unsure or still think this is a Paper bug, please report this to https://github.com/PaperMC/Paper/issues" ); -+ log.log( Level.SEVERE, "If you are unsure or still think this is a Purpur bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur ++ log.log( Level.SEVERE, "If you are unsure or still think this is a Purpur bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur - Rebrand log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" ); - log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() ); -+ log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur ++ log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur - Rebrand // if ( net.minecraft.world.level.Level.lastPhysicsProblem != null ) { @@ -27167,13 +27431,13 @@ index f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167..f51cc3de3ca935ef90f7f0e9dd0506b8 } else { - log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); -+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur ++ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur - Rebrand log.log(Level.SEVERE, "The server has not responded for " + (currentTime - lastTick) / 1000 + " seconds! Creating thread dump"); } // Paper end - Different message for short timeout log.log( Level.SEVERE, "------------------------------" ); - log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper -+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Purpur!):" ); // Paper // Purpur ++ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Purpur!):" ); // Paper // Purpur - Rebrand ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(MinecraftServer.getServer(), isLongTimeout); // Paper - rewrite chunk system this.dumpTickingInfo(); // Paper - log detailed tick information WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log ); @@ -27182,7 +27446,7 @@ index f7a4fee9bb25ff256dc2e5ea26bfbceca6a49167..f51cc3de3ca935ef90f7f0e9dd0506b8 } } else { - log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH ---"); -+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur ++ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur - Rebrand } log.log( Level.SEVERE, "------------------------------" ); diff --git a/patches/server/0004-Build-System-Changes.patch b/patches/server/0004-Build-System-Changes.patch index f30ddcbb0..f63d90ba2 100644 --- a/patches/server/0004-Build-System-Changes.patch +++ b/patches/server/0004-Build-System-Changes.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Build System Changes diff --git a/build.gradle.kts b/build.gradle.kts -index 74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea..20abf704decfad4dc1744b6515f540d0f871fcb7 100644 +index 624588207afdc52adae14e5de3d18fe1c330d832..a40dc8b2560b8cd124d961f3dfd5865efd2a3b9e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,73 +25,35 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { // Paper end - configure mockito agent that is needed in newer java versions dependencies { -- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur +- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur - Rebrand - implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency - // Paper start - implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ @@ -43,22 +43,41 @@ index 74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea..20abf704decfad4dc1744b6515f540d0 - isTransitive = false - } - // Paper end - Use Velocity cipher -- ++ implementation(project(":${rootProject.providers.gradleProperty("brandName").get().lowercase()}-api")) // Pufferfish // Paper // Purpur // Plazma - Fork-friendly Rebranding ++ // Plazma start - Use Gradle Version Catalogs ++ implementation(server.bundles.implementation) ++ implementation(common.adventure.serializer.ansi) ++ implementation(common.log4j.stream) + - runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6") - runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") - runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") -- ++ implementation(common.log4j) ++ log4jPlugins.annotationProcessorConfigurationName(common.log4j) ++ runtimeOnly(log4jPlugins.output) // diff on change ++ alsoShade(log4jPlugins.output) // diff on change + - // Pufferfish start - implementation("org.yaml:snakeyaml:1.32") -- implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") { // Purpur +- implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") { // Purpur - Fix pufferfish issues - exclude(group="org.yaml", module="snakeyaml") - } - // Pufferfish end -- -- implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur -- implementation("org.mozilla:rhino-engine:1.7.14") // Purpur -- implementation("dev.omega24:upnp4j:1.0") // Purpur -- ++ runtimeOnly(server.bundles.runtime) ++ ++ implementation(common.bundles.asm) ++ implementation(common.commons.lang2) ++ implementation(server.velocity.native) { isTransitive = false } ++ ++ runtimeOnly(common.mvn) ++ runtimeOnly(common.bundles.mvn) + +- implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur - Rebrand +- implementation("org.mozilla:rhino-engine:1.7.14") // Purpur - Rebrand +- implementation("dev.omega24:upnp4j:1.0") // Purpur - Rebrand ++ implementation(common.snakeyaml) ++ implementation(server.simpleyaml) { exclude(group="org.yaml", module="snakeyaml") } + - testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test - testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") - testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0") @@ -79,29 +98,6 @@ index 74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea..20abf704decfad4dc1744b6515f540d0 - implementation("me.lucko:spark-api:0.1-20240720.200737-2") - implementation("me.lucko:spark-paper:1.10.119-SNAPSHOT") - // Paper end - spark -+ implementation(project(":${rootProject.providers.gradleProperty("brandName").get().lowercase()}-api")) // Pufferfish // Paper // Purpur // Plazma - Fork-friendly Rebranding -+ // Plazma start - Use Gradle Version Catalogs -+ implementation(server.bundles.implementation) -+ implementation(common.adventure.serializer.ansi) -+ implementation(common.log4j.stream) -+ -+ implementation(common.log4j) -+ log4jPlugins.annotationProcessorConfigurationName(common.log4j) -+ runtimeOnly(log4jPlugins.output) // diff on change -+ alsoShade(log4jPlugins.output) // diff on change -+ -+ runtimeOnly(server.bundles.runtime) -+ -+ implementation(common.bundles.asm) -+ implementation(common.commons.lang2) -+ implementation(server.velocity.native) { isTransitive = false } -+ -+ runtimeOnly(common.mvn) -+ runtimeOnly(common.bundles.mvn) -+ -+ implementation(common.snakeyaml) -+ implementation(server.simpleyaml) { exclude(group="org.yaml", module="snakeyaml") } -+ + testImplementation(server.classgraph) + testImplementation(common.bundles.test) + testImplementation(common.junit) @@ -115,19 +111,19 @@ index 74d7aaae57e0e9ea9e31c4b2189ba50a0ac83bea..20abf704decfad4dc1744b6515f540d0 val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", -- "Implementation-Title" to "Purpur", // Pufferfish // Purpur -+ "Implementation-Title" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur // Plazma - Fork-friendly Rebranding +- "Implementation-Title" to "Purpur", // Pufferfish // Purpur - Rebrand ++ "Implementation-Title" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur - Rebrand // Plazma - Fork-friendly Rebranding "Implementation-Version" to implementationVersion, "Implementation-Vendor" to date, // Paper -- "Specification-Title" to "Purpur", // Pufferfish // Purpur -+ "Specification-Title" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur // Plazma - Fork-friendly Rebranding +- "Specification-Title" to "Purpur", // Pufferfish // Purpur - Rebrand ++ "Specification-Title" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur - Rebrand // Plazma - Fork-friendly Rebranding "Specification-Version" to project.version, -- "Specification-Vendor" to "Purpur Team", // Pufferfish // Purpur -- "Brand-Id" to "purpurmc:purpur", // Pufferfish // Purpur -- "Brand-Name" to "Purpur", // Pufferfish // Purpur -+ "Specification-Vendor" to rootProject.providers.gradleProperty("providerName").get(), // Purpur // Plazma - Fork-friendly Rebranding -+ "Brand-Id" to rootProject.providers.gradleProperty("brandKey").get(), // Purpur // Plazma - Fork-friendly Rebranding -+ "Brand-Name" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur // Plazma - Fork-friendly Rebranding +- "Specification-Vendor" to "Purpur Team", // Pufferfish // Purpur - Rebrand +- "Brand-Id" to "purpurmc:purpur", // Pufferfish // Purpur - Rebrand +- "Brand-Name" to "Purpur", // Pufferfish // Purpur - Rebrand ++ "Specification-Vendor" to rootProject.providers.gradleProperty("providerName").get(), // Purpur - Rebrand // Plazma - Fork-friendly Rebranding ++ "Brand-Id" to rootProject.providers.gradleProperty("brandKey").get(), // Purpur - Rebrand // Plazma - Fork-friendly Rebranding ++ "Brand-Name" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur - Rebrand // Plazma - Fork-friendly Rebranding "Build-Number" to (build ?: ""), "Build-Time" to Instant.now().toString(), "Git-Branch" to gitBranch, // Paper diff --git a/patches/server/0005-Fork-friendly-Rebranding.patch b/patches/server/0005-Fork-friendly-Rebranding.patch index 5c33d65ab..bbcde1da3 100644 --- a/patches/server/0005-Fork-friendly-Rebranding.patch +++ b/patches/server/0005-Fork-friendly-Rebranding.patch @@ -5,42 +5,42 @@ Subject: [PATCH] Fork-friendly Rebranding diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 4a8f95670e25c81952cccbaf4c6e49514cacd529..63c9f3b6ea3e3deae1e7a5d6b317b3aa179e1dc5 100644 +index be1bb14dca9367b9685841985b6198376986c496..b58f4eb26ce6bd6696b3289b5f199ab8f0ff28b6 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -592,7 +592,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()); // Pufferfish // Purpur -+ Metrics metrics = new Metrics(io.papermc.paper.ServerBrandConstants.BRAND_NAME, serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma - Fork-friendly Rebranding +- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur - Purpur config files ++ Metrics metrics = new Metrics(io.papermc.paper.ServerBrandConstants.BRAND_NAME, serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur - Purpur config files // Plazma - Fork-friendly Rebranding metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { String minecraftVersion = Bukkit.getVersion(); diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..6995627310de4911d87a2f93a723d6b93dc0612f 100644 +index fe66e43c27e0798770e102d1385bacbaa90bda07..1ad562a95809cf7d503f5446f8645ba8c2680914 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java @@ -36,7 +36,7 @@ public class PaperVersionFetcher implements VersionFetcher { private static final int DISTANCE_ERROR = -1; private static final int DISTANCE_UNKNOWN = -2; - // Purpur start + // Purpur start - Rebrand - private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads"; + // private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads"; // Plazma - Fork-friendly Rebranding private static int distance = DISTANCE_UNKNOWN; public int distance() { return distance; } - // Purpur end + // Purpur end - Rebrand @@ -52,7 +52,7 @@ public class PaperVersionFetcher implements VersionFetcher { if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) { updateMessage = text("You are running a development version without access to version information", color(0xFF5300)); } else { -- updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", build); // Purpur -+ updateMessage = getUpdateStatusMessage("PlazmaMC/Plazma", build); // Purpur // Plazma - Fork-friendly Rebranding +- updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", build); // Purpur - Rebrand ++ updateMessage = getUpdateStatusMessage("PlazmaMC/Plazma", build); // Purpur - Rebrand // Plazma - Fork-friendly Rebranding } final @Nullable Component history = this.getHistory(); @@ -63,8 +63,12 @@ public class PaperVersionFetcher implements VersionFetcher { - //int distance = DISTANCE_ERROR; // Purpur - use field + //int distance = DISTANCE_ERROR; // Purpur - use field - Rebrand final OptionalInt buildNumber = build.buildNumber(); - if (buildNumber.isPresent()) { @@ -55,7 +55,7 @@ index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..6995627310de4911d87a2f93a723d6b9 final Optional gitBranch = build.gitBranch(); final Optional gitCommit = build.gitCommit(); @@ -80,12 +84,13 @@ public class PaperVersionFetcher implements VersionFetcher { - default -> text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur + default -> text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur - Rebrand .append(Component.newline()) .append(text("Download the new version at: ") - .append(text(DOWNLOAD_PAGE, NamedTextColor.GOLD) @@ -79,15 +79,15 @@ index 6d36fc6d8e22d9b68dea3830f6ecc8763184c343..6995627310de4911d87a2f93a723d6b9 // Contributed by Techcable in GH-65 private static int fetchDistanceFromGitHub(final String repo, final String branch, final String hash) { diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index 90b3526479320064378f2cde6c2f2b8e48a59ba6..21658c61ad091647d5421d1dbf892d03ca175c74 100644 +index bc7e4e5560708fea89c584b1d8b471f4966f311a..986be14b664e55111a590f5c1fded5a799578da0 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -20,7 +20,7 @@ public final class PaperConsole extends SimpleTerminalConsole { @Override protected LineReader buildReader(LineReaderBuilder builder) { builder -- .appName("Purpur") // Purpur -+ .appName(io.papermc.paper.ServerBrandConstants.BRAND_NAME) // Purpur // Plazma - Fork-friendly Rebranding +- .appName("Purpur") // Purpur - Rebrand ++ .appName(io.papermc.paper.ServerBrandConstants.BRAND_NAME) // Purpur - Rebrand // Plazma - Fork-friendly Rebranding .variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history")) .completer(new ConsoleCommandCompleter(this.server)) .option(LineReader.Option.COMPLETE_IN_WORD, true); @@ -127,7 +127,7 @@ index 0000000000000000000000000000000000000000..3af005ce2bbd30601917987d8c831db2 + +} diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java -index 3099c21ee589acf6edff5903a23673adf489024f..a337e2c9576fb70a8ee9082e9b69719c804b286e 100644 +index 0843e7c5c335a58d955a0841f2e02a9e4ac824d9..f7c15d0a63f948c4f52f6e6bbcbc4dc096b3281f 100644 --- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java +++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java @@ -30,10 +30,6 @@ public record ServerBuildInfoImpl( @@ -135,8 +135,8 @@ index 3099c21ee589acf6edff5903a23673adf489024f..a337e2c9576fb70a8ee9082e9b69719c private static final String ATTRIBUTE_GIT_COMMIT = "Git-Commit"; - private static final String BRAND_PAPER_NAME = "Paper"; -- private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur -- private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur +- private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur - Fix pufferfish issues +- private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur - Rebrand - private static final String BUILD_DEV = "DEV"; @@ -145,11 +145,11 @@ index 3099c21ee589acf6edff5903a23673adf489024f..a337e2c9576fb70a8ee9082e9b69719c this( getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID) .map(Key::key) -- .orElse(BRAND_PURPUR_ID), // Purpur -+ .orElse(BRAND_ID), // Purpur // Plazma - Fork-friendly Rebranding +- .orElse(BRAND_PURPUR_ID), // Purpur - Fix pufferfish issues // Purpur - Rebrand ++ .orElse(BRAND_ID), // Purpur - Fix pufferfish issues // Purpur - Rebrand // Plazma - Fork-friendly Rebranding getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME) -- .orElse(BRAND_PURPUR_NAME), // Purpur -+ .orElse(ServerBrandConstants.BRAND_NAME), // Purpur // Plazma - Fork-friendly Rebranding +- .orElse(BRAND_PURPUR_NAME), // Purpur - Fix pufferfish issues // Purpur - Rebrand ++ .orElse(ServerBrandConstants.BRAND_NAME), // Purpur - Fix pufferfish issues // Purpur - Rebrand // Plazma - Fork-friendly Rebranding SharedConstants.getCurrentVersion().getId(), SharedConstants.getCurrentVersion().getName(), getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER) @@ -157,8 +157,8 @@ index 3099c21ee589acf6edff5903a23673adf489024f..a337e2c9576fb70a8ee9082e9b69719c @Override public boolean isBrandCompatible(final @NotNull Key brandId) { -- return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_PUFFERFISH_ID); // Purpur -+ return brandId.equals(this.brandId) || SUPPORTED_BRANDS.contains(brandId); // Purpur // Plazma - Fork-friendly Rebranding +- return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_PUFFERFISH_ID); // Purpur - Fix pufferfish issues // Purpur - Rebrand ++ return brandId.equals(this.brandId) || SUPPORTED_BRANDS.contains(brandId); // Purpur - Fix pufferfish issues // Purpur - Rebrand // Plazma - Fork-friendly Rebranding } @Override @@ -212,7 +212,7 @@ index a880f4e5cf712654649ad043e58e073e9a87c0fe..c3bce9206aee05b18ddd8b2788f892a9 Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 95f1e0ae174400f2cf7bfed2897259d5aa2cfcb5..b0bc896f004e915b291091937a2a566477df1e43 100644 +index fa5f7bc53f3dfa5581f7c747c732ebc7737a7820..17afd1c5b9984b19b4d31711bfd7f8cc120d89fd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1281,7 +1281,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop +Date: Wed, 25 Dec 2024 18:16:50 +0900 +Subject: [PATCH] Enable CI version tracking + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +index 1ad562a95809cf7d503f5446f8645ba8c2680914..21a3761f075ace896c981936b2810fccb0b5d610 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java ++++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +@@ -90,19 +90,18 @@ public class PaperVersionFetcher implements VersionFetcher { + }; + } + +- /* // Plazma - TODO: CI Checking + private static int fetchDistanceFromSiteApi(final ServerBuildInfo build, final int jenkinsBuild) { + try { + try (final BufferedReader reader = Resources.asCharSource( +- URI.create("https://api.purpurmc.org/v2/purpur/" + build.minecraftVersionId()).toURL(), // Purpur - Rebrand ++ URI.create("https://ci.codemc.io/job/PlazmaMC/job/Plazma/job/" + build.gitBranch().orElseThrow().replace("/", "%2F") + "/api/json").toURL(), // Purpur - Rebrand // Plazma - Rebrand + Charsets.UTF_8 + ).openBufferedStream()) { + final JsonObject json = new Gson().fromJson(reader, JsonObject.class); + //final JsonArray builds = json.getAsJsonArray("builds"); // Purpur - Rebrand +- final int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur - Rebrand ++ final int latest = json.getAsJsonObject("lastSuccessfulBuild").getAsJsonPrimitive("number").getAsInt(); // Purpur - Rebrand // Plazma - Rebrand + return latest - jenkinsBuild; + } catch (final JsonSyntaxException ex) { +- LOGGER.error("Error parsing json from Purpur's downloads API", ex); // Purpur - Rebrand ++ LOGGER.error("Error parsing json from CI", ex); // Purpur - Rebrand // Plazma - Rebrand + return DISTANCE_ERROR; + } + } catch (final IOException e) { +@@ -110,7 +109,6 @@ public class PaperVersionFetcher implements VersionFetcher { + return DISTANCE_ERROR; + } + } +- */ // Plazma - TODO: CI Checking + + // Contributed by Techcable in GH-65 + private static int fetchDistanceFromGitHub(final String repo, final String branch, final String hash) { diff --git a/patches/server/0006-Rebrand-Logo.patch b/patches/server/0007-Rebrand-Logo.patch similarity index 100% rename from patches/server/0006-Rebrand-Logo.patch rename to patches/server/0007-Rebrand-Logo.patch diff --git a/patches/server/0007-Plazma-Configurations.patch b/patches/server/0008-Plazma-Configurations.patch similarity index 98% rename from patches/server/0007-Plazma-Configurations.patch rename to patches/server/0008-Plazma-Configurations.patch index dd60102b2..cc6d738bf 100644 --- a/patches/server/0007-Plazma-Configurations.patch +++ b/patches/server/0008-Plazma-Configurations.patch @@ -526,17 +526,17 @@ index 47a2cba0db36b11548d06ec21f7c7d7c9a962d6e..3f99ca451099d2c7baf12b7b603d8b30 + } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b0bc896f004e915b291091937a2a566477df1e43..63353cd8c896b58b356ff1d44359be63db1e0186 100644 +index 17afd1c5b9984b19b4d31711bfd7f8cc120d89fd..82bded015da16ed2feae1161a31f916804c6fbbb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -328,6 +328,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping - public boolean lagging = false; // Purpur + public boolean lagging = false; // Purpur - Lagging threshold @@ -516,6 +517,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop behaviorcontroller = (Brain) this.getBrain(); // CraftBukkit - decompile error @@ -43,10 +43,10 @@ index dbce71f45c008da883b6d244a06343d83ae25e7e..d2f0b14a0014802605b601e62d0eebdd gameprofilerfiller.pop(); gameprofilerfiller.push("camelActivityUpdate"); diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index 464a16df15d8759d66f94ad080d1ea28b3f6474c..6061cd4fc38fef0895571ab767e495d5755f9fc8 100644 +index 489854333e71ad4e7635870eedbdd07a84297a13..3fa391b638062196675d102b8731a96a51df8e15 100644 --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -@@ -493,11 +493,13 @@ public class Sniffer extends Animal { +@@ -495,11 +495,13 @@ public class Sniffer extends Animal { return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES); } diff --git a/patches/server/0016-Add-missing-Purpur-configuration-options.patch b/patches/server/0017-Add-missing-Purpur-configuration-options.patch similarity index 91% rename from patches/server/0016-Add-missing-Purpur-configuration-options.patch rename to patches/server/0017-Add-missing-Purpur-configuration-options.patch index e5d2d0e39..96eb2b1b2 100644 --- a/patches/server/0016-Add-missing-Purpur-configuration-options.patch +++ b/patches/server/0017-Add-missing-Purpur-configuration-options.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add missing Purpur configuration options 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 235596af3a4e210efe966782b29e2b1d4d41e36d..e52178abc7684dd3ca7cbbe23906f9f4b5f80376 100644 +index 67ff60909dee395d42619c310bafc381b9bfce5d..42fc51827240f9f0091e006fa84a17c2fb51dddd 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 -@@ -160,6 +160,18 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS +@@ -162,6 +162,18 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.allayMaxHealth); this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.allayScale); } @@ -24,14 +24,14 @@ index 235596af3a4e210efe966782b29e2b1d4d41e36d..e52178abc7684dd3ca7cbbe23906f9f4 + return level().purpurConfig.allayAlwaysDropExp; + } + // Plazma end - Add missing purpur configuration options - // Purpur end - + // Purpur end - Configurable entity base attributes @Override + protected Brain.Provider brainProvider() { diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index d2f0b14a0014802605b601e62d0eebddf06d3737..459a45f82c42b346a66bb1954e155a0970dcc30f 100644 +index 36f8bb5cf25566784e11988c91e1c7409f1ac5c8..d364866de67341e4a781b4f2bf3e7c187ee2bc8c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -96,6 +96,18 @@ public class Camel extends AbstractHorse { +@@ -99,6 +99,18 @@ public class Camel extends AbstractHorse { public int getPurpurBreedTime() { return this.level().purpurConfig.camelBreedingTicks; } @@ -47,11 +47,11 @@ index d2f0b14a0014802605b601e62d0eebddf06d3737..459a45f82c42b346a66bb1954e155a09 + return level().purpurConfig.camelAlwaysDropExp; + } + // Plazma end - Add missing purpur configuration options - // Purpur end - + // Purpur end - Make entity breeding times configurable @Override + public void addAdditionalSaveData(CompoundTag nbt) { diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index 267f49bf00f5bbd5541e25c938f727a5bafd8eb2..c4fd2adb2c32f355f23e7a9f002b275bee0bedd7 100644 +index d09aa48e20c9a6e0d465b93e3759556638041394..70772863011ce270bceaf679ea3776fb36d4f0b9 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java @@ -163,6 +163,23 @@ public class Frog extends Animal implements VariantHolder> { @@ -75,16 +75,16 @@ index 267f49bf00f5bbd5541e25c938f727a5bafd8eb2..c4fd2adb2c32f355f23e7a9f002b275b + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.frogMaxHealth); + } + // Plazma end - Add missing purpur configuration options - // Purpur end + // Purpur end - Ridables - public int getPurpurBreedTime() { + // Purpur start - Make entity breeding times configurable 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 7e92e8c4fec36c8838604f17cf366cc80e82b19b..1b0e80ae62b5c5d4e1fcac71b90f83f12fe4878a 100644 +index 33429a9afeefce9238969b2894d0a9c033baca51..fee263bd88c19188f6ec8017893dfc12bdd15737 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 @@ -93,6 +93,23 @@ public class Tadpole extends AbstractFish { protected void registerGoals() { - this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables } + + // Plazma start - Add missing purpur configuration options @@ -103,14 +103,14 @@ index 7e92e8c4fec36c8838604f17cf366cc80e82b19b..1b0e80ae62b5c5d4e1fcac71b90f83f1 + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.tadpoleMaxHealth); + } + // Plazma end - Add missing purpur configuration options - // Purpur end + // Purpur end - Ridables @Override diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index 6061cd4fc38fef0895571ab767e495d5755f9fc8..0bc7856065fdc599890f18f5a4e2f6c2b3d94ba7 100644 +index 3fa391b638062196675d102b8731a96a51df8e15..86988932dc79e9ca33998044995187709ad5373b 100644 --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -@@ -116,6 +116,18 @@ public class Sniffer extends Animal { +@@ -119,6 +119,18 @@ public class Sniffer extends Animal { public int getPurpurBreedTime() { return this.level().purpurConfig.snifferBreedingTicks; } @@ -126,16 +126,16 @@ index 6061cd4fc38fef0895571ab767e495d5755f9fc8..0bc7856065fdc599890f18f5a4e2f6c2 + return level().purpurConfig.snifferAlwaysDropExp; + } + // Plazma end - Add missing purpur configuration options - // Purpur end - + // Purpur end - Make entity breeding times configurable @Override + protected void defineSynchedData(SynchedEntityData.Builder builder) { 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 cf231928bae5493b0684109c769d7da4dc36f872..065c7c5ad2f077ab8acd0f008867d42174ba20b4 100644 +index 74011f1ab7e48490109ad93d658bba216eef9e80..5313f4c1ca76b120c0eb6beddc993b562f79344e 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 @@ -151,6 +151,23 @@ public class Warden extends Monster implements VibrationSystem { - this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables } + + // Plazma start - Add missing purpur configuration options @@ -154,7 +154,7 @@ index cf231928bae5493b0684109c769d7da4dc36f872..065c7c5ad2f077ab8acd0f008867d421 + this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.wardenMaxHealth); + } + // Plazma end - Add missing purpur configuration options - // Purpur end + // Purpur end - Ridables @Override @@ -305,7 +322,7 @@ public class Warden extends Monster implements VibrationSystem { diff --git a/patches/server/0017-Add-option-to-change-nether-portal-size.patch b/patches/server/0018-Add-option-to-change-nether-portal-size.patch similarity index 100% rename from patches/server/0017-Add-option-to-change-nether-portal-size.patch rename to patches/server/0018-Add-option-to-change-nether-portal-size.patch diff --git a/patches/server/0018-Apply-various-optimizations.patch b/patches/server/0019-Apply-various-optimizations.patch similarity index 94% rename from patches/server/0018-Apply-various-optimizations.patch rename to patches/server/0019-Apply-various-optimizations.patch index d0d5b5fd4..9934d7aba 100644 --- a/patches/server/0018-Apply-various-optimizations.patch +++ b/patches/server/0019-Apply-various-optimizations.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Apply various optimizations Akarin - Swaps the predicate order of collision diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index c59963369bf4add28a966ec24b67cb6e8b701dd2..1717c14e77ab9a26298c6990d45be16d32f3f3e6 100644 +index 305a569f8cd83f3c67a4d4377f2881d36961dacd..8001ae563ac06d8ba9fd1de0b4111a3c8241de8c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2332,8 +2332,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0019-Do-not-load-chunks-to-spawn-phantom.patch b/patches/server/0020-Do-not-load-chunks-to-spawn-phantom.patch similarity index 100% rename from patches/server/0019-Do-not-load-chunks-to-spawn-phantom.patch rename to patches/server/0020-Do-not-load-chunks-to-spawn-phantom.patch diff --git a/patches/server/0020-Add-option-to-disable-moved-to-quickly-check-for-spe.patch b/patches/server/0021-Add-option-to-disable-moved-to-quickly-check-for-spe.patch similarity index 95% rename from patches/server/0020-Add-option-to-disable-moved-to-quickly-check-for-spe.patch rename to patches/server/0021-Add-option-to-disable-moved-to-quickly-check-for-spe.patch index 87f2a0b8f..6a253d2ce 100644 --- a/patches/server/0020-Add-option-to-disable-moved-to-quickly-check-for-spe.patch +++ b/patches/server/0021-Add-option-to-disable-moved-to-quickly-check-for-spe.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add option to disable moved to quickly check for specific diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8a468f0c09daf23cfbddb3c607a758c6411babfc..910a346f43dbd0ca8dfec5cb78ffa25caeeb1fa1 100644 +index c783c17d45beda8297171d0834350197808a7335..611de28d27d75b73e33a552c8a23d6c0f53582da 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1749,7 +1749,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0021-Configurable-cave-lava-sea-level.patch b/patches/server/0022-Configurable-cave-lava-sea-level.patch similarity index 100% rename from patches/server/0021-Configurable-cave-lava-sea-level.patch rename to patches/server/0022-Configurable-cave-lava-sea-level.patch diff --git a/patches/server/0022-Configurable-entity-sensor-tick.patch b/patches/server/0023-Configurable-entity-sensor-tick.patch similarity index 95% rename from patches/server/0022-Configurable-entity-sensor-tick.patch rename to patches/server/0023-Configurable-entity-sensor-tick.patch index 3b6318fc6..0d6d2a355 100644 --- a/patches/server/0022-Configurable-entity-sensor-tick.patch +++ b/patches/server/0023-Configurable-entity-sensor-tick.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable entity sensor tick diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 7ca12a1128661ea36e2e33cda204c7d2df55a21c..331a75fee26e3fe2532e8661db282a0c207ddf9b 100644 +index 0be6582e50ccc94036bb6782a5f811c0f9c42f01..98b08a2e83cf1c4e1e45a42ddcad2198f42a05e2 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -951,10 +951,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab diff --git a/patches/server/0023-Variable-entity-wakeup-duration.patch b/patches/server/0024-Variable-entity-wakeup-duration.patch similarity index 100% rename from patches/server/0023-Variable-entity-wakeup-duration.patch rename to patches/server/0024-Variable-entity-wakeup-duration.patch diff --git a/patches/server/0024-Skip-event-if-no-listeners.patch b/patches/server/0025-Skip-event-if-no-listeners.patch similarity index 100% rename from patches/server/0024-Skip-event-if-no-listeners.patch rename to patches/server/0025-Skip-event-if-no-listeners.patch diff --git a/patches/server/0025-Add-entity-spawn-deadlock-timer.patch b/patches/server/0026-Add-entity-spawn-deadlock-timer.patch similarity index 97% rename from patches/server/0025-Add-entity-spawn-deadlock-timer.patch rename to patches/server/0026-Add-entity-spawn-deadlock-timer.patch index 15168eac5..c2d8166ee 100644 --- a/patches/server/0025-Add-entity-spawn-deadlock-timer.patch +++ b/patches/server/0026-Add-entity-spawn-deadlock-timer.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add entity spawn deadlock timer - AbsolemJackdaw/FixMySpawnR diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index bb4411cfdf1bc7adc12c2f918d2eec830299f38b..357d484029fe338bea4f5770d13ccfc0dce4432e 100644 +index 79a8e5dd1d189c4eaf93999925ea0790eb6ce368..ac3b0f95926aba8e99375f74dfca9d83ca1fbd57 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -50,6 +50,8 @@ public abstract class BaseSpawner { diff --git a/patches/server/0026-Lithium-HashedList.patch b/patches/server/0027-Lithium-HashedList.patch similarity index 100% rename from patches/server/0026-Lithium-HashedList.patch rename to patches/server/0027-Lithium-HashedList.patch diff --git a/patches/server/0027-Improve-SwingTime-ticking.patch b/patches/server/0028-Improve-SwingTime-ticking.patch similarity index 88% rename from patches/server/0027-Improve-SwingTime-ticking.patch rename to patches/server/0028-Improve-SwingTime-ticking.patch index d44ee97b2..35ca6170d 100644 --- a/patches/server/0027-Improve-SwingTime-ticking.patch +++ b/patches/server/0028-Improve-SwingTime-ticking.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Improve SwingTime ticking diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 33fbe0f7a356dd847e546feffb468b2803c6744b..765435fa2bc9aa901453c0939a7b3acd27e15008 100644 +index e64ff857bf95436033baf38db1e6895f75856f9c..f029cdfe3d1e1b13a0cc3bf04e7285907c02a9a8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -2832,6 +2832,7 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/0028-Save-Json-list-asynchronously.patch b/patches/server/0029-Save-Json-list-asynchronously.patch similarity index 100% rename from patches/server/0028-Save-Json-list-asynchronously.patch rename to patches/server/0029-Save-Json-list-asynchronously.patch diff --git a/patches/server/0029-Use-Akair-s-flag-when-running-the-test-server-with-g.patch b/patches/server/0030-Use-Akair-s-flag-when-running-the-test-server-with-g.patch similarity index 94% rename from patches/server/0029-Use-Akair-s-flag-when-running-the-test-server-with-g.patch rename to patches/server/0030-Use-Akair-s-flag-when-running-the-test-server-with-g.patch index 5c1ea1b25..ef51eff3d 100644 --- a/patches/server/0029-Use-Akair-s-flag-when-running-the-test-server-with-g.patch +++ b/patches/server/0030-Use-Akair-s-flag-when-running-the-test-server-with-g.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use Akair's flag when running the test server with gradle diff --git a/build.gradle.kts b/build.gradle.kts -index 746ad8087192931400256c8a1ef71e966eaf6b1a..14695f421c3751a1e75567aecf3685d901790011 100644 +index b732a760e6a091d24afce1305a367700db55b71f..57eed05e07d0ff36b5a2902554baff49edcbb6a9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -164,7 +164,7 @@ fun TaskContainer.registerRunTask( diff --git a/patches/server/0030-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch b/patches/server/0031-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch similarity index 97% rename from patches/server/0030-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch rename to patches/server/0031-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch index eb1f48188..ba41af0a2 100644 --- a/patches/server/0030-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch +++ b/patches/server/0031-Use-Plazma-logo-instead-if-server-favicon-doesn-t-ex.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use Plazma logo instead if server favicon doesn't exist diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 63353cd8c896b58b356ff1d44359be63db1e0186..b2b2677c8919cb8e0bc4df2e290c1f246833673e 100644 +index 82bded015da16ed2feae1161a31f916804c6fbbb..657f118713b2188cb2e7fe5ec3be455189b50623 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1628,29 +1628,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop. diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 38752c9ba1726e3c38dd758287a920bc476ef88a..45fa867a22481bbba86e587767cfdb96d9691c49 100644 +index 32ebee3620b5ec1ff57b92a581fb2d7f5dfe17cf..214bd8084182ebd0d36cf9ddfac4411a5dce78be 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -688,6 +688,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -697,6 +697,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface // Paper start - Add setting for proxy online mode status return dedicatedserverproperties.enforceSecureProfile && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() @@ -32,7 +32,7 @@ index 38752c9ba1726e3c38dd758287a920bc476ef88a..45fa867a22481bbba86e587767cfdb96 // Paper end - Add setting for proxy online mode status } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 8d7d050f12df83931bbb32f1832d7fcbc06317da..be4a5407fe9b692b72eb2b85e2dea160a0555bca 100644 +index 459eea7dae68afdf7e1443f29f6f8d0c68668b74..aead28160c7a5067340ec80a833eafcab1817d67 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -135,6 +135,7 @@ public abstract class PlayerList { diff --git a/patches/server/0032-Reset-dirty-flag-when-loading-maps-from-the-disk.patch b/patches/server/0033-Reset-dirty-flag-when-loading-maps-from-the-disk.patch similarity index 100% rename from patches/server/0032-Reset-dirty-flag-when-loading-maps-from-the-disk.patch rename to patches/server/0033-Reset-dirty-flag-when-loading-maps-from-the-disk.patch diff --git a/patches/server/0033-Allow-throttling-hopper-checks-if-the-target-contain.patch b/patches/server/0034-Allow-throttling-hopper-checks-if-the-target-contain.patch similarity index 100% rename from patches/server/0033-Allow-throttling-hopper-checks-if-the-target-contain.patch rename to patches/server/0034-Allow-throttling-hopper-checks-if-the-target-contain.patch diff --git a/patches/server/0034-Suppress-errors-from-dirty-attributes.patch b/patches/server/0035-Suppress-errors-from-dirty-attributes.patch similarity index 95% rename from patches/server/0034-Suppress-errors-from-dirty-attributes.patch rename to patches/server/0035-Suppress-errors-from-dirty-attributes.patch index 6bf487dbb..8a75de408 100644 --- a/patches/server/0034-Suppress-errors-from-dirty-attributes.patch +++ b/patches/server/0035-Suppress-errors-from-dirty-attributes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Suppress errors from dirty attributes diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index f2753cf51634479e501c1a3e7931d6d9882bc801..02288d8f3521756770351c02f623f9db02efd40c 100644 +index f029cdfe3d1e1b13a0cc3bf04e7285907c02a9a8..684e747255472b85a573e004f85e0319e2145d8e 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -1390,7 +1390,8 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/0035-Implement-Rail-Optimazition.patch b/patches/server/0036-Implement-Rail-Optimazition.patch similarity index 100% rename from patches/server/0035-Implement-Rail-Optimazition.patch rename to patches/server/0036-Implement-Rail-Optimazition.patch diff --git a/patches/server/0036-Load-player-data-asynchronously.patch b/patches/server/0037-Load-player-data-asynchronously.patch similarity index 98% rename from patches/server/0036-Load-player-data-asynchronously.patch rename to patches/server/0037-Load-player-data-asynchronously.patch index a4773866f..f1f83242e 100644 --- a/patches/server/0036-Load-player-data-asynchronously.patch +++ b/patches/server/0037-Load-player-data-asynchronously.patch @@ -18,7 +18,7 @@ index 16069b9cbf6c7679c28a2e9a54e77d23cd10e541..bb10892f33ba0d7fc3959debef104507 private final byte[] challenge; final MinecraftServer server; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index be4a5407fe9b692b72eb2b85e2dea160a0555bca..579f81ed04eeb6373b25e6794d3bf0c403891011 100644 +index aead28160c7a5067340ec80a833eafcab1817d67..c18868796957c0756aca3b5a15fd0d0c8a5221f4 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -183,6 +183,16 @@ public abstract class PlayerList { diff --git a/patches/server/0037-Configurable-RandomSource-factory-provider.patch b/patches/server/0038-Configurable-RandomSource-factory-provider.patch similarity index 99% rename from patches/server/0037-Configurable-RandomSource-factory-provider.patch rename to patches/server/0038-Configurable-RandomSource-factory-provider.patch index f89d6cd15..9eaaefd2e 100644 --- a/patches/server/0037-Configurable-RandomSource-factory-provider.patch +++ b/patches/server/0038-Configurable-RandomSource-factory-provider.patch @@ -240,7 +240,7 @@ index f1e0d3d7b1f458fcce83cf67762a16309123cdcb..6a8d5948f127ea87a0b4554ece4ad2c4 public boolean isIgnoreEntities() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index eb9bb689a52a7e9c95d6f2e07bb16799286e9057..a7853ce8028c2fc0c8fe71f767700fc624a8007c 100644 +index 5d7af6c1ec557d2a2813b87a64b8c8a99d2f87e0..deddf588826dda9b15beff3acf20be56837d240b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -289,7 +289,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0038-Optimize-advancement-criteria-triggering.patch b/patches/server/0039-Optimize-advancement-criteria-triggering.patch similarity index 100% rename from patches/server/0038-Optimize-advancement-criteria-triggering.patch rename to patches/server/0039-Optimize-advancement-criteria-triggering.patch diff --git a/patches/server/0039-Configurable-water-flowing-speed.patch b/patches/server/0040-Configurable-water-flowing-speed.patch similarity index 100% rename from patches/server/0039-Configurable-water-flowing-speed.patch rename to patches/server/0040-Configurable-water-flowing-speed.patch diff --git a/patches/server/0040-cleanup-logs.patch b/patches/server/0041-Cleanup-logs.patch similarity index 98% rename from patches/server/0040-cleanup-logs.patch rename to patches/server/0041-Cleanup-logs.patch index 7d48277ff..0a44f85b9 100644 --- a/patches/server/0040-cleanup-logs.patch +++ b/patches/server/0041-Cleanup-logs.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Thu, 31 Oct 2024 22:53:16 +0900 -Subject: [PATCH] cleanup logs +Subject: [PATCH] Cleanup logs diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml diff --git a/patches/server/0041-Completely-remove-timings-implementation.patch b/patches/server/0042-Completely-remove-timings-implementation.patch similarity index 97% rename from patches/server/0041-Completely-remove-timings-implementation.patch rename to patches/server/0042-Completely-remove-timings-implementation.patch index be548d62d..f72a449ea 100644 --- a/patches/server/0041-Completely-remove-timings-implementation.patch +++ b/patches/server/0042-Completely-remove-timings-implementation.patch @@ -48,7 +48,7 @@ index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..e0d634d4b0dd6f7c09f61865ed299de7 @Override diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b2b2677c8919cb8e0bc4df2e290c1f246833673e..baf7324bb9a686a322de3e0db30fd64efdeb1dbf 100644 +index 657f118713b2188cb2e7fe5ec3be455189b50623..854f19306100289dabce523c973edcf6fbcdb6cc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -3,7 +3,7 @@ package net.minecraft.server; diff --git a/patches/server/0042-Remove-persist-isClientSide-flag.patch b/patches/server/0043-Remove-persist-isClientSide-flag.patch similarity index 93% rename from patches/server/0042-Remove-persist-isClientSide-flag.patch rename to patches/server/0043-Remove-persist-isClientSide-flag.patch index 80e1ecb05..10f46173a 100644 --- a/patches/server/0042-Remove-persist-isClientSide-flag.patch +++ b/patches/server/0043-Remove-persist-isClientSide-flag.patch @@ -406,7 +406,7 @@ index 65ed3d77a51b8299517e0c165403b0c5ac413475..5c7dbb218b6a9a7ccb2c9dbab93a7d8b return stack; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index baf7324bb9a686a322de3e0db30fd64efdeb1dbf..e1409a61891e4f30c39ba5b75691776e92417ed2 100644 +index 854f19306100289dabce523c973edcf6fbcdb6cc..3e0d878c3b3dcefb8f223bc93a5fc6d594998565 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -270,8 +270,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop list = Lists.newArrayList(this.passengers); @@ -1216,7 +1200,7 @@ index 1717c14e77ab9a26298c6990d45be16d32f3f3e6..78f4ddfefcad7dd9332f1738c76f01b6 list.add(0, passenger); } else { list.add(passenger); -@@ -3558,17 +3558,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3558,17 +3560,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public void handleDamageEvent(DamageSource damageSource) {} public void handleEntityEvent(byte status) { @@ -1237,7 +1221,7 @@ index 1717c14e77ab9a26298c6990d45be16d32f3f3e6..78f4ddfefcad7dd9332f1738c76f01b6 return !this.fireImmune() && (this.remainingFireTicks > 0 || flag && this.getSharedFlag(0)); } -@@ -3658,7 +3660,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3658,7 +3662,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public boolean isCurrentlyGlowing() { @@ -1246,7 +1230,7 @@ index 1717c14e77ab9a26298c6990d45be16d32f3f3e6..78f4ddfefcad7dd9332f1738c76f01b6 } public boolean isInvisible() { -@@ -4429,7 +4431,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4429,7 +4433,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.reapplyPosition(); boolean flag = entitysize1.width() <= 4.0F && entitysize1.height() <= 4.0F; @@ -1255,7 +1239,7 @@ index 1717c14e77ab9a26298c6990d45be16d32f3f3e6..78f4ddfefcad7dd9332f1738c76f01b6 this.fudgePositionAfterSizeChange(entitysize); } -@@ -4695,6 +4697,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4695,6 +4699,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } @@ -1263,7 +1247,28 @@ index 1717c14e77ab9a26298c6990d45be16d32f3f3e6..78f4ddfefcad7dd9332f1738c76f01b6 public boolean isControlledByOrIsLocalPlayer() { if (this instanceof Player entityhuman) { return entityhuman.isLocalPlayer(); -@@ -4722,6 +4725,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4702,17 +4707,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + return this.isControlledByLocalInstance(); + } + } ++ */ // Plazma - Remove persist 'isClientSide' flag + + public boolean isControlledByLocalInstance() { +- net.minecraft.world.entity.LivingEntity entityliving = this.getControllingPassenger(); +- +- if (entityliving instanceof Player entityhuman) { +- return entityhuman.isLocalPlayer(); +- } else { +- return this.isEffectiveAi(); +- } ++ return !(this.getControllingPassenger() instanceof Player); // Plazma - Remove persist 'isClientSide' flag + } + ++ /* // Plazma - Remove persist 'isClientSide' flag + public boolean isControlledByClient() { + net.minecraft.world.entity.LivingEntity entityliving = this.getControllingPassenger(); + +@@ -4722,6 +4723,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public boolean isEffectiveAi() { return !this.level().isClientSide; } @@ -1272,7 +1277,7 @@ index 1717c14e77ab9a26298c6990d45be16d32f3f3e6..78f4ddfefcad7dd9332f1738c76f01b6 protected static Vec3 getCollisionHorizontalEscapeVector(double vehicleWidth, double passengerWidth, float passengerYaw) { double d2 = (vehicleWidth + passengerWidth + 9.999999747378752E-6D) / 2.0D; diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index a3ae5e663a0334eaa8ca6ce89c3088620a849bb9..6f61ea24b9e812a92cc5547ee4c4e881ca3d612d 100644 +index d09664949f924b4bd240abcc4a9f96f142310aa9..88e5315934ba5c45f1e84be275d5c1dce4a7009e 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -590,7 +590,7 @@ public class EntityType implements FeatureElement, EntityTypeT @@ -1284,28 +1289,6 @@ index a3ae5e663a0334eaa8ca6ce89c3088620a849bb9..6f61ea24b9e812a92cc5547ee4c4e881 // Paper start - filter out protected tags if (player == null || !player.getBukkitEntity().hasPermission("minecraft.nbt.place")) { nbt = nbt.update((compound) -> { -diff --git a/src/main/java/net/minecraft/world/entity/FlyingMob.java b/src/main/java/net/minecraft/world/entity/FlyingMob.java -index 255f0c078cf931ee0612358900fa73e6c43a9a66..dc0d2c31b0d6624cb8fe8fbc3b0ed0fb45f335b1 100644 ---- a/src/main/java/net/minecraft/world/entity/FlyingMob.java -+++ b/src/main/java/net/minecraft/world/entity/FlyingMob.java -@@ -16,7 +16,7 @@ public abstract class FlyingMob extends Mob { - - @Override - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance()) { -+ //if (this.isControlledByLocalInstance()) { // Plazma - Remove persist 'isClientSide' flag - if (this.isInWater()) { - this.moveRelative(0.02F, movementInput); - this.move(MoverType.SELF, this.getDeltaMovement()); -@@ -41,7 +41,7 @@ public abstract class FlyingMob extends Mob { - this.move(MoverType.SELF, this.getDeltaMovement()); - this.setDeltaMovement(this.getDeltaMovement().scale((double)f)); - } -- } -+ //} // Plazma - Remove persist 'isClientSide' flag - } - - @Override diff --git a/src/main/java/net/minecraft/world/entity/Interaction.java b/src/main/java/net/minecraft/world/entity/Interaction.java index c838dc018fad67ae0a9b602a3b477aaea137bca2..764b576e5fd546a23ab498b9593404fb32c1b963 100644 --- a/src/main/java/net/minecraft/world/entity/Interaction.java @@ -1373,7 +1356,7 @@ index 12127b14babf646711d3a118416453c4f1ac1460..447bcaf2a13d0f6f2752de9862ae1276 --this.life; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df5a8f3924 100644 +index 684e747255472b85a573e004f85e0319e2145d8e..9940c74dac4ebcfacdaf88d0b1e95e78e964e1ba 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -458,7 +458,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1535,24 +1518,6 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df case 55: this.swapHandItems(); break; -@@ -3103,7 +3106,7 @@ public abstract class LivingEntity extends Entity implements Attackable { - } - - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance()) { -+ //if (this.isControlledByLocalInstance()) { // Plazma - Remove persist 'isClientSide' flag - FluidState fluid = this.level().getFluidState(this.blockPosition()); - - if ((this.isInWater() || this.isInLava()) && this.isAffectedByFluids() && !this.canStandOnFluid(fluid)) { -@@ -3114,7 +3117,7 @@ public abstract class LivingEntity extends Entity implements Attackable { - this.travelInAir(movementInput); - } - -- } -+ //} // Plazma - Remove persist 'isClientSide' flag - } - - private void travelInAir(Vec3 movementInput) { @@ -3127,12 +3130,14 @@ public abstract class LivingEntity extends Entity implements Attackable { if (mobeffect != null) { @@ -1582,23 +1547,16 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df } -@@ -3264,12 +3269,14 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3264,7 +3269,7 @@ public abstract class LivingEntity extends Entity implements Attackable { Vec3 vec3d1 = this.getRiddenInput(controllingPlayer, movementInput); this.tickRidden(controllingPlayer, vec3d1); - if (this.isControlledByLocalInstance()) { -+ //if (this.isControlledByLocalInstance()) { // Plazma - Remove persist 'isClientSide' flag ++ if (this.isControlledByLocalInstance()) { // Plazma - Remove persist 'isClientSide' flag this.setSpeed(this.getRiddenSpeed(controllingPlayer)); this.travel(vec3d1); -+ /* // Plazma - Remove persist 'isClientSide' flag } else { - this.setDeltaMovement(Vec3.ZERO); - } -+ */ // Plazma - Remove persist 'isClientSide' flag - - } - -@@ -3373,7 +3380,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3373,7 +3378,7 @@ public abstract class LivingEntity extends Entity implements Attackable { super.tick(); this.updatingUsingItem(); this.updateSwimAmount(); @@ -1607,7 +1565,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df int i = this.getArrowCount(); if (i > 0) { -@@ -3408,7 +3415,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3408,7 +3413,7 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.isSleeping() && !this.checkBedExists()) { this.stopSleeping(); } @@ -1616,7 +1574,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df if (!this.isRemoved()) { this.aiStep(); -@@ -3666,8 +3673,10 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3666,8 +3671,10 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.lerpSteps > 0) { this.lerpPositionAndRotationStep(this.lerpSteps, this.lerpX, this.lerpY, this.lerpZ, this.lerpYRot, this.lerpXRot); --this.lerpSteps; @@ -1627,7 +1585,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df } if (this.lerpHeadSteps > 0) { -@@ -3700,7 +3709,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3700,7 +3707,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.jumping = false; this.xxa = 0.0F; this.zza = 0.0F; @@ -1636,7 +1594,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df gameprofilerfiller.push("newAi"); this.serverAiStep(); gameprofilerfiller.pop(); -@@ -3763,14 +3772,14 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3763,14 +3770,14 @@ public abstract class LivingEntity extends Entity implements Attackable { this.travel(vec3d1); } @@ -1654,7 +1612,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df int i = this.getTicksFrozen(); if (this.isInPowderSnow && this.canFreeze()) { -@@ -3873,7 +3882,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3873,7 +3880,7 @@ public abstract class LivingEntity extends Entity implements Attackable { protected void updateFallFlying() { this.checkSlowFallDistance(); @@ -1663,7 +1621,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df if (!this.canGlide()) { if (this.getSharedFlag(7) != false && !CraftEventFactory.callToggleGlideEvent(this, false).isCancelled()) // CraftBukkit this.setSharedFlag(7, false); -@@ -3906,7 +3915,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3906,7 +3913,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.gameEvent(GameEvent.ELYTRA_GLIDE); } @@ -1672,7 +1630,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df } -@@ -4009,7 +4018,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4009,7 +4016,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.autoSpinAttackTicks = 0; } @@ -1681,7 +1639,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df this.setLivingEntityFlag(4, false); this.autoSpinAttackDmg = 0.0F; this.autoSpinAttackItemStack = null; -@@ -4038,7 +4047,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4038,7 +4045,7 @@ public abstract class LivingEntity extends Entity implements Attackable { Entity entity = this.getVehicle(); super.stopRiding(suppressCancellation); // Paper - Force entity dismount during teleportation @@ -1690,7 +1648,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df this.dismountVehicle(entity); } -@@ -4112,7 +4121,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4112,7 +4119,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } public void take(Entity item, int count) { @@ -1699,7 +1657,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df ((ServerLevel) this.level()).getChunkSource().broadcastAndSend(this, new ClientboundTakeItemEntityPacket(item.getId(), this.getId(), count)); // Paper - broadcast with collector as source } -@@ -4253,7 +4262,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4253,7 +4260,7 @@ public abstract class LivingEntity extends Entity implements Attackable { // Paper start - lag compensate eating // we add 1 to the expected time to avoid lag compensating when we should not final boolean shouldLagCompensate = this.useItem.has(DataComponents.FOOD) && this.eatStartTime != -1 && (System.nanoTime() - this.eatStartTime) > ((1L + this.totalEatTimeTicks) * 50L * (1000L * 1000L)); @@ -1708,7 +1666,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df this.useItemRemaining = 0; // Paper end - lag compensate eating this.completeUsingItem(); -@@ -4297,15 +4306,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4297,15 +4304,16 @@ public abstract class LivingEntity extends Entity implements Attackable { this.useItemRemaining = this.totalEatTimeTicks = itemstack.getUseDuration(this); this.eatStartTime = System.nanoTime(); // Paper end - lag compensate eating @@ -1727,7 +1685,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df @Override public void onSyncedDataUpdated(EntityDataAccessor data) { super.onSyncedDataUpdated(data); -@@ -4329,6 +4339,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4329,6 +4337,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } } @@ -1735,7 +1693,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df @Override public void lookAt(EntityAnchorArgument.Anchor anchorPoint, Vec3 target) { -@@ -4361,7 +4372,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4361,7 +4370,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } public void completeUsingItem() { @@ -1744,7 +1702,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df InteractionHand enumhand = this.getUsedItemHand(); if (!this.useItem.equals(this.getItemInHand(enumhand))) { -@@ -4415,7 +4426,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4415,7 +4424,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } } @@ -1753,7 +1711,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df } public void handleExtraItemsCreatedOnUse(ItemStack stack) {} -@@ -4445,14 +4456,14 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4445,14 +4454,14 @@ public abstract class LivingEntity extends Entity implements Attackable { } public void stopUsingItem() { @@ -1770,7 +1728,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df this.useItem = ItemStack.EMPTY; // Paper start - lag compensate eating -@@ -4890,7 +4901,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -4890,7 +4899,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override public boolean isCurrentlyGlowing() { @@ -1780,7 +1738,7 @@ index 93d4f35841a6d728acb90a49f1a0d35084b4c605..acfd61118d7769c069127d793733b4df @Override diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index f7e360df2e26c34d8cc17b35c116df425202a054..dd82dbb3eca667d54eabe1f284bd3d0318a7fe0d 100644 +index 98b08a2e83cf1c4e1e45a42ddcad2198f42a05e2..ae1dcf013b03c6d04ccf34be4e54048581479183 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -440,11 +440,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @@ -1850,7 +1808,7 @@ index 1f610b598d4985dda2b71a407f0090c57875554d..46f53c0546485d6a312b853df4d3ffa8 private void rotateBodyIfNecessary() { this.mob.yBodyRot = Mth.rotateIfNecessary(this.mob.yBodyRot, this.mob.yHeadRot, (float)this.mob.getMaxHeadYRot()); 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 771bb96032149a8573d1de14fa2ab19012c82000..f268c787d6ecef639633fbc7a36676fd184ae7cd 100644 +index 07e3e727e339765284095aa8fd6b5edd41dc4158..895e69364778ddfa95f686e8f907d555b6d19295 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 @@ -86,10 +86,10 @@ public class RemoveBlockGoal extends MoveToBlockGoal { @@ -1885,13 +1843,13 @@ index 771bb96032149a8573d1de14fa2ab19012c82000..f268c787d6ecef639633fbc7a36676fd ++this.ticksSinceReachedGoal; 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 c8ffbbccbf20ce911a3d75fa860d5a1452c5e590..0d3f4702c8bf3d66b01b42c5da1761e93e1d6ed2 100644 +index d1eb633416ff5090253e77583ec97aff3171c484..737e9d8b75df05ca0e032916564599d5abad45ff 100644 --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java @@ -48,9 +48,9 @@ public class Bat extends AmbientCreature { public Bat(EntityType type, Level world) { super(type, world); - this.moveControl = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.075F); // Purpur + this.moveControl = new org.purpurmc.purpur.controller.FlyingWithSpacebarMoveControllerWASD(this, 0.075F); // Purpur - Ridables - if (!world.isClientSide) { + //if (!world.isClientSide) { // Plazma - Remove persist 'isClientSide' flag this.setResting(true); @@ -1900,21 +1858,8 @@ index c8ffbbccbf20ce911a3d75fa860d5a1452c5e590..0d3f4702c8bf3d66b01b42c5da1761e9 } -diff --git a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java -index 9708ed3e00059fdf5d1d60e0c607d0ab153d1d3f..b9410b8c039d182d8764029a27b9c98de0c17bb8 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java -+++ b/src/main/java/net/minecraft/world/entity/animal/AbstractFish.java -@@ -100,7 +100,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable { - - @Override - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance() && this.isInWater()) { -+ if (/*this.isControlledByLocalInstance() &&*/ this.isInWater()) { // Plazma - Remove persist 'isClientSide' flag - this.moveRelative(getRider() != null ? getSpeed() : 0.01F, movementInput); // Purpur - this.move(MoverType.SELF, this.getDeltaMovement()); - this.setDeltaMovement(this.getDeltaMovement().scale(0.9)); diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java -index 9987d28ea145f6d0126cb4ea22001e0922fb51bd..45663e0d5ee361972b6c3ed9d3c8c294f5f2af43 100644 +index 8df1682dca61b0f771a1c08f5bcd797506badf19..23bb616f0bb97b63f7f1ba0ef095163c1945914b 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Animal.java +++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java @@ -158,7 +158,7 @@ public abstract class Animal extends AgeableMob { @@ -1939,10 +1884,10 @@ index 9987d28ea145f6d0126cb4ea22001e0922fb51bd..45663e0d5ee361972b6c3ed9d3c8c294 return super.mobInteract(player, hand); 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 bfe3c1d587f129013de108b8fb31293b0386a44a..dc4231375730357f6b6d7f902a71b0a593a34a8e 100644 +index d2ac2c3a2481ee216a491333b173625da3881737..ba0b72e648fad219d7b42f5d489b53ec41046826 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -580,7 +580,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -583,7 +583,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @Override public void aiStep() { super.aiStep(); @@ -1951,7 +1896,7 @@ index bfe3c1d587f129013de108b8fb31293b0386a44a..dc4231375730357f6b6d7f902a71b0a5 if (this.stayOutOfHiveCountdown > 0) { --this.stayOutOfHiveCountdown; } -@@ -599,7 +599,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -602,7 +602,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { if (this.tickCount % 20 == 0 && !this.isHiveValid()) { this.hivePos = null; } @@ -1960,7 +1905,7 @@ index bfe3c1d587f129013de108b8fb31293b0386a44a..dc4231375730357f6b6d7f902a71b0a5 } -@@ -707,9 +707,9 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -710,9 +710,9 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { if (mobeffect != null) { this.usePlayerItem(player, hand, itemstack); @@ -1989,10 +1934,10 @@ index 4eca5996a867086be22d22d99db81ab001467516..dff6c0615defa87e7b4e01c0df2d0a5f entity.discard(EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause return Optional.of(InteractionResult.SUCCESS); 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 a418ded306908ee9cb9e375104354a6e031305c9..a81470adae2e0eaf6b647370a34c1b554be8c546 100644 +index 5a3348ca39b86cfea941fdfb98ca90a7a0ef908d..6596add7dc43d1e292dfeacc3e426186a4f8410d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -450,22 +450,22 @@ public class Cat extends TamableAnimal implements VariantHolder 0.03D) { Vec3 vec3d = this.getViewVector(0.0F); float f = Mth.cos(this.getYRot() * 0.017453292F) * 0.3F; -@@ -389,6 +390,7 @@ public class Dolphin extends AgeableWaterCreature { +@@ -392,6 +393,7 @@ public class Dolphin extends AgeableWaterCreature { this.level().addParticle(ParticleTypes.DOLPHIN, this.getX() - vec3d.x * (double) f2 - (double) f, this.getY() - vec3d.y, this.getZ() - vec3d.z * (double) f2 - (double) f1, 0.0D, 0.0D, 0.0D); } } @@ -2054,7 +1999,7 @@ index c1842894f96a567707992d8ff938dbf689dd0df6..aeb98f9b1234081620e4ccb2d6882fcd } } -@@ -419,9 +421,9 @@ public class Dolphin extends AgeableWaterCreature { +@@ -422,9 +424,9 @@ public class Dolphin extends AgeableWaterCreature { ItemStack itemstack = player.getItemInHand(hand); if (!itemstack.isEmpty() && itemstack.is(ItemTags.FISHES)) { @@ -2066,20 +2011,11 @@ index c1842894f96a567707992d8ff938dbf689dd0df6..aeb98f9b1234081620e4ccb2d6882fcd if (this.isBaby()) { itemstack.consume(1, player); -@@ -472,7 +474,7 @@ public class Dolphin extends AgeableWaterCreature { - - @Override - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance() && this.isInWater()) { -+ if (/*this.isControlledByLocalInstance() &&*/ this.isInWater()) { // Plazma - Remove persist 'isClientSide' flag - this.moveRelative(this.getSpeed(), movementInput); - this.move(MoverType.SELF, this.getDeltaMovement()); - this.setDeltaMovement(this.getDeltaMovement().scale(0.9D)); 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 80b93d50650886a874a8b0b8a27e15b4d4e727f0..a0677484cbd5047d6c2bbaded1d0e5adcecb255d 100644 +index fb75b983f7c522708964a9352546ae29611bf4e9..071792e842c064d01fd68b5deeb523019f3fd826 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java -@@ -257,7 +257,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -261,7 +261,7 @@ public class Fox extends Animal implements VariantHolder { @Override public void aiStep() { @@ -2088,7 +2024,7 @@ index 80b93d50650886a874a8b0b8a27e15b4d4e727f0..a0677484cbd5047d6c2bbaded1d0e5ad ++this.ticksSinceEaten; ItemStack itemstack = this.getItemBySlot(EquipmentSlot.MAINHAND); -@@ -559,7 +559,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -563,7 +563,7 @@ public class Fox extends Animal implements VariantHolder { } private void spitOutItem(ItemStack stack) { @@ -2097,7 +2033,7 @@ index 80b93d50650886a874a8b0b8a27e15b4d4e727f0..a0677484cbd5047d6c2bbaded1d0e5ad ItemEntity entityitem = new ItemEntity(this.level(), this.getX() + this.getLookAngle().x, this.getY() + 1.0D, this.getZ() + this.getLookAngle().z, stack); entityitem.setPickUpDelay(40); -@@ -601,7 +601,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -605,7 +605,7 @@ public class Fox extends Animal implements VariantHolder { @Override public void tick() { super.tick(); @@ -2106,7 +2042,7 @@ index 80b93d50650886a874a8b0b8a27e15b4d4e727f0..a0677484cbd5047d6c2bbaded1d0e5ad boolean flag = this.isInWater(); if (flag || this.getTarget() != null || this.level().isThundering()) { -@@ -618,7 +618,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -622,7 +622,7 @@ public class Fox extends Animal implements VariantHolder { this.level().levelEvent(2001, blockposition, Block.getId(iblockdata)); } @@ -2116,10 +2052,10 @@ index 80b93d50650886a874a8b0b8a27e15b4d4e727f0..a0677484cbd5047d6c2bbaded1d0e5ad this.interestedAngleO = this.interestedAngle; if (this.isInterested()) { 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 9a6471d2f1eb1c8af006b70b6bba0b668220fb00..cf071f48fb9b3acb7fabe4295de979dfca1079b4 100644 +index caa29df16214c60c4e0a471ad6320ea5d62ba7d0..1c918dfcb8b3c05394fea6dcc50c5bfc48cb3634 100644 --- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java -@@ -162,9 +162,9 @@ public class IronGolem extends AbstractGolem implements NeutralMob { +@@ -166,9 +166,9 @@ public class IronGolem extends AbstractGolem implements NeutralMob { --this.offerFlowerTick; } @@ -2132,10 +2068,10 @@ index 9a6471d2f1eb1c8af006b70b6bba0b668220fb00..cf071f48fb9b3acb7fabe4295de979df } diff --git a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java -index dee59cb4b87845c940ee089aa932aa69dd2539d6..89527365aefb6077cf6b4f771ca47c054d0efb78 100644 +index 79db05362cddbef624e5f5e19e11faa951b6f81c..f8d16ae7f8bd7c17fa5b91322ef98e37e40d80f7 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java -@@ -206,7 +206,7 @@ public class Ocelot extends Animal { +@@ -210,7 +210,7 @@ public class Ocelot extends Animal { if ((this.temptGoal == null || this.temptGoal.isRunning()) && !this.isTrusting() && this.isFood(itemstack) && player.distanceToSqr((Entity) this) < 9.0D) { this.usePlayerItem(player, hand, itemstack); @@ -2144,7 +2080,7 @@ index dee59cb4b87845c940ee089aa932aa69dd2539d6..89527365aefb6077cf6b4f771ca47c05 if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit - added event call and isCancelled check this.setTrusting(true); this.spawnTrustingParticles(true); -@@ -215,7 +215,7 @@ public class Ocelot extends Animal { +@@ -219,7 +219,7 @@ public class Ocelot extends Animal { this.spawnTrustingParticles(false); this.level().broadcastEntityEvent(this, (byte) 40); } @@ -2154,10 +2090,10 @@ index dee59cb4b87845c940ee089aa932aa69dd2539d6..89527365aefb6077cf6b4f771ca47c05 return InteractionResult.SUCCESS; } else { 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 83372c86bd54eedd9b136ddfcbfc67d303058c0a..2df413fce51db6360c2a55fde72061135e0bd3a9 100644 +index 18bda7f4d0e0dfb2074b70e1369915c3a486e5cd..adeb06f913b53d802f03d3def1303e298fe589e4 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Panda.java +++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java -@@ -463,12 +463,12 @@ public class Panda extends Animal { +@@ -467,12 +467,12 @@ public class Panda extends Animal { if (this.isEating()) { this.addEatingParticles(); @@ -2173,7 +2109,7 @@ index 83372c86bd54eedd9b136ddfcbfc67d303058c0a..2df413fce51db6360c2a55fde7206113 this.sit(false); } -@@ -549,7 +549,7 @@ public class Panda extends Animal { +@@ -553,7 +553,7 @@ public class Panda extends Animal { if (this.rollCounter > 32) { this.roll(false); } else { @@ -2182,7 +2118,7 @@ index 83372c86bd54eedd9b136ddfcbfc67d303058c0a..2df413fce51db6360c2a55fde7206113 Vec3 vec3d = this.getDeltaMovement(); if (this.rollCounter == 1) { -@@ -563,7 +563,7 @@ public class Panda extends Animal { +@@ -567,7 +567,7 @@ public class Panda extends Animal { } else { this.setDeltaMovement(0.0D, this.onGround() ? 0.27D : vec3d.y, 0.0D); } @@ -2191,7 +2127,7 @@ index 83372c86bd54eedd9b136ddfcbfc67d303058c0a..2df413fce51db6360c2a55fde7206113 } } -@@ -705,7 +705,7 @@ public class Panda extends Animal { +@@ -709,7 +709,7 @@ public class Panda extends Animal { if (this.isBaby()) { this.usePlayerItem(player, hand, itemstack); this.ageUp((int) ((float) (-this.getAge() / 20) * 0.1F), true); @@ -2200,7 +2136,7 @@ index 83372c86bd54eedd9b136ddfcbfc67d303058c0a..2df413fce51db6360c2a55fde7206113 final ItemStack breedCopy = itemstack.copy(); // Paper - Fix EntityBreedEvent copying this.usePlayerItem(player, hand, itemstack); this.setInLove(player, breedCopy); // Paper - Fix EntityBreedEvent copying -@@ -880,25 +880,19 @@ public class Panda extends Animal { +@@ -884,25 +884,19 @@ public class Panda extends Animal { @Override public boolean canUse() { @@ -2239,10 +2175,10 @@ index 83372c86bd54eedd9b136ddfcbfc67d303058c0a..2df413fce51db6360c2a55fde7206113 private boolean canFindBamboo() { 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 f14fe1c299e6ef5cf55bde617ff9fe6aca08702f..963c2158fb5fd8396bcfbb8ac3a4f761719d5d62 100644 +index 724e7e77b1c781c3c91689eb7dfc3aed21133fd0..6a5210dd9256dedf30f2d66b94b806a739f3ba73 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java -@@ -327,22 +327,22 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder data) { @@ -2285,7 +2221,7 @@ index 7895fca01c20da24a10ac6a642ebba87f73f2799..f2484c50d221c0c5a24b73b5e641f9d6 super.onSyncedDataUpdated(data); } -@@ -207,9 +209,9 @@ public class Pig extends Animal implements ItemSteerable, Saddleable { +@@ -211,9 +213,9 @@ public class Pig extends Animal implements ItemSteerable, Saddleable { } if (!flag && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) { @@ -2298,10 +2234,10 @@ index 7895fca01c20da24a10ac6a642ebba87f73f2799..f2484c50d221c0c5a24b73b5e641f9d6 return InteractionResult.SUCCESS; } else { diff --git a/src/main/java/net/minecraft/world/entity/animal/PolarBear.java b/src/main/java/net/minecraft/world/entity/animal/PolarBear.java -index 86c44912a363401bdd716c22d24dfd7e92cfd0be..19726aff2672cbf59a474ffefd34d9b836d92db9 100644 +index 986fad77b0340c344ba3a3e3a3e5bc0105625439..1932e396a36a4c5e17402c06a547672437dbbf73 100644 --- a/src/main/java/net/minecraft/world/entity/animal/PolarBear.java +++ b/src/main/java/net/minecraft/world/entity/animal/PolarBear.java -@@ -263,6 +263,7 @@ public class PolarBear extends Animal implements NeutralMob { +@@ -268,6 +268,7 @@ public class PolarBear extends Animal implements NeutralMob { @Override public void tick() { super.tick(); @@ -2309,7 +2245,7 @@ index 86c44912a363401bdd716c22d24dfd7e92cfd0be..19726aff2672cbf59a474ffefd34d9b8 if (this.level().isClientSide) { if (this.clientSideStandAnimation != this.clientSideStandAnimationO) { this.refreshDimensions(); -@@ -275,14 +276,15 @@ public class PolarBear extends Animal implements NeutralMob { +@@ -280,14 +281,15 @@ public class PolarBear extends Animal implements NeutralMob { this.clientSideStandAnimation = Mth.clamp(this.clientSideStandAnimation - 1.0F, 0.0F, 6.0F); } } @@ -2325,13 +2261,13 @@ index 86c44912a363401bdd716c22d24dfd7e92cfd0be..19726aff2672cbf59a474ffefd34d9b8 - } + //} // Plazma - Remove persist 'isClientSide' flag - // Purpur start + // Purpur start - Ridables if (isStanding() && --standTimer <= 0) { diff --git a/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java b/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java -index c5a39ea2ad0e5e5ac434d79c1a57e0068b8bc809..992f1a4e870c245823baaf34a7bb5e177fa68633 100644 +index a612f3e8034dd20566370c846f093b50ddef904c..cc5208e7907d58492c8096438772ca63693c3a7a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java +++ b/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java -@@ -127,7 +127,7 @@ public class Pufferfish extends AbstractFish { +@@ -130,7 +130,7 @@ public class Pufferfish extends AbstractFish { @Override public void tick() { @@ -2341,10 +2277,10 @@ index c5a39ea2ad0e5e5ac434d79c1a57e0068b8bc809..992f1a4e870c245823baaf34a7bb5e17 boolean increase = true; // Paper - Add PufferFishStateChangeEvent if (this.getPuffState() == 0) { diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java -index a1e3331d73cc971b58efe9e0cb565ac9711e2ef1..8875d212216f72114e94635a319663b195e957fd 100644 +index 080551d9b55d12ef15fa2efbde1d195bc82d065c..761745f759614c43426b1bdf7bc8ca7b5aff100a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java +++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java -@@ -226,9 +226,9 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -230,9 +230,9 @@ public class Rabbit extends Animal implements VariantHolder { } } @@ -2357,10 +2293,10 @@ index a1e3331d73cc971b58efe9e0cb565ac9711e2ef1..8875d212216f72114e94635a319663b1 } 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 8ce4edbd7df3199133d9843780d028e8a8f020e2..f3c7422cbc63695c54f1038e155dedc268995c06 100644 +index 8c8c587646a1db8dc35fcbd85868e84a2f2697b2..b24d781dd4331a227fac5611458bdfa597e56c30 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java +++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java -@@ -150,6 +150,7 @@ public class Sheep extends Animal implements Shearable { +@@ -154,6 +154,7 @@ public class Sheep extends Animal implements Shearable { super.customServerAiStep(world); } @@ -2368,7 +2304,7 @@ index 8ce4edbd7df3199133d9843780d028e8a8f020e2..f3c7422cbc63695c54f1038e155dedc2 @Override public void aiStep() { if (this.level().isClientSide) { -@@ -158,6 +159,7 @@ public class Sheep extends Animal implements Shearable { +@@ -162,6 +163,7 @@ public class Sheep extends Animal implements Shearable { super.aiStep(); } @@ -2377,10 +2313,10 @@ index 8ce4edbd7df3199133d9843780d028e8a8f020e2..f3c7422cbc63695c54f1038e155dedc2 public static AttributeSupplier.Builder createAttributes() { return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 8.0D).add(Attributes.MOVEMENT_SPEED, 0.23000000417232513D); 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 3ba2e4954e6c2809804f7b8ceb04dae56bb7c2ba..950b1f011ac330ffd8b56aa92eaad35f65818bc0 100644 +index c7a7d1df79beb527ff94f876ca36a861c37c4947..39dfed25678307555a6c30a068be14cdf5437f22 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java +++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java -@@ -168,16 +168,18 @@ public class Squid extends AgeableWaterCreature { +@@ -171,16 +171,18 @@ public class Squid extends AgeableWaterCreature { this.oldTentacleAngle = this.tentacleAngle; this.tentacleMovement = this.tentacleMovement + this.tentacleSpeed; if ((double)this.tentacleMovement > Math.PI * 2) { @@ -2400,31 +2336,7 @@ index 3ba2e4954e6c2809804f7b8ceb04dae56bb7c2ba..950b1f011ac330ffd8b56aa92eaad35f } if (this.isInWaterOrBubble()) { -@@ -186,9 +188,9 @@ public class Squid extends AgeableWaterCreature { - float f = this.tentacleMovement / (float) Math.PI; - this.tentacleAngle = Mth.sin(f * f * (float) Math.PI) * (float) Math.PI * 0.25F; - if ((double)f > 0.75) { -- if (this.isControlledByLocalInstance()) { -+ //if (this.isControlledByLocalInstance()) { // Plazma - Remove persist 'isClientSide' flag - this.setDeltaMovement(this.movementVector); -- } -+ //} // Plazma - Remove persist 'isClientSide' flag - - this.rotateSpeed = 1.0F; - } else { -@@ -196,9 +198,9 @@ public class Squid extends AgeableWaterCreature { - } - } else { - this.tentacleAngle = 0.0F; -- if (this.isControlledByLocalInstance()) { -+ //if (this.isControlledByLocalInstance()) { // Plazma - Remove persist 'isClientSide' flag - this.setDeltaMovement(this.getDeltaMovement().scale(0.9)); -- } -+ //} // Plazma - Remove persist 'isClientSide' flag - - this.rotateSpeed *= 0.99F; - } -@@ -211,7 +213,7 @@ public class Squid extends AgeableWaterCreature { +@@ -214,7 +216,7 @@ public class Squid extends AgeableWaterCreature { this.xBodyRot = this.xBodyRot + (-((float)Mth.atan2(d, vec3.y)) * (180.0F / (float)Math.PI) - this.xBodyRot) * 0.1F; } else { this.tentacleAngle = Mth.abs(Mth.sin(this.tentacleMovement)) * (float) Math.PI * 0.25F; @@ -2433,7 +2345,7 @@ index 3ba2e4954e6c2809804f7b8ceb04dae56bb7c2ba..950b1f011ac330ffd8b56aa92eaad35f double e = this.getDeltaMovement().y; if (this.hasEffect(MobEffects.LEVITATION)) { e = 0.05 * (double)(this.getEffect(MobEffects.LEVITATION).getAmplifier() + 1); -@@ -220,7 +222,7 @@ public class Squid extends AgeableWaterCreature { +@@ -223,7 +225,7 @@ public class Squid extends AgeableWaterCreature { } this.setDeltaMovement(0.0, e * 0.98F, 0.0); @@ -2442,36 +2354,11 @@ index 3ba2e4954e6c2809804f7b8ceb04dae56bb7c2ba..950b1f011ac330ffd8b56aa92eaad35f this.xBodyRot = this.xBodyRot + (-90.0F - this.xBodyRot) * 0.02F; } -@@ -259,9 +261,9 @@ public class Squid extends AgeableWaterCreature { - - @Override - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance()) { -+ //if (this.isControlledByLocalInstance()) { // Plazma - Remove persist 'isClientSide' flag - this.move(MoverType.SELF, this.getDeltaMovement()); -- } -+ //} // Plazma - Remove persist 'isClientSide' flag - } - - @Override -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 c9e307452a097329c26893673055cfb72a43e4c7..388c0068905e2ad138d5125ba17734b1be3a58fb 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java -+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -@@ -360,7 +360,7 @@ public class Turtle extends Animal { - - @Override - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance() && this.isInWater()) { -+ if (/*this.isControlledByLocalInstance() &&*/ this.isInWater()) { // Plazma - Remove persist 'isClientSide' flag - this.moveRelative(0.1F, movementInput); - this.move(MoverType.SELF, this.getDeltaMovement()); - this.setDeltaMovement(this.getDeltaMovement().scale(0.9D)); 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 15b655fa1d483e8e4154b7cdbb5338f134ab1741..1be6773df34eeb8bbc9cb0dc5349a53f3369e089 100644 +index 30b4c09c6046c1d0843ccb8e4ff326e189b6cb95..9f4681cb70f0e42e07968024cee010990644ba53 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java +++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -@@ -370,16 +370,16 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder, B +@@ -211,9 +211,11 @@ public class Axolotl extends Animal implements VariantHolder, B this.handleAirSupply(i); } @@ -2659,20 +2546,11 @@ index 155f03818d91dbd4ef9f5549784472f2bffca5d8..ee9be9de7d64c9354b579dc229540588 } -@@ -522,7 +524,7 @@ public class Axolotl extends Animal implements VariantHolder, B - - @Override - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance() && this.isInWater()) { -+ if (/*this.isControlledByLocalInstance() &&*/ this.isInWater()) { // Plazma - Remove persist 'isClientSide' flag - this.moveRelative(this.getSpeed(), movementInput); - this.move(MoverType.SELF, this.getDeltaMovement()); - this.setDeltaMovement(this.getDeltaMovement().scale(0.9D)); diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index 459a45f82c42b346a66bb1954e155a0970dcc30f..538020c17702585db1d3ebdd14c0136863a00a17 100644 +index d364866de67341e4a781b4f2bf3e7c187ee2bc8c..70c3bb5d0c35fa79f74f76f452e9b34ebfe8041e 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -195,9 +195,11 @@ public class Camel extends AbstractHorse { +@@ -197,9 +197,11 @@ public class Camel extends AbstractHorse { } } @@ -2684,7 +2562,7 @@ index 459a45f82c42b346a66bb1954e155a0970dcc30f..538020c17702585db1d3ebdd14c01368 if (this.refuseToMove()) { this.clampHeadRotationToBody(); -@@ -444,9 +446,9 @@ public class Camel extends AbstractHorse { +@@ -445,9 +447,9 @@ public class Camel extends AbstractHorse { if (flag2) { this.level().addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 0.0D, 0.0D, 0.0D); @@ -2696,7 +2574,7 @@ index 459a45f82c42b346a66bb1954e155a0970dcc30f..538020c17702585db1d3ebdd14c01368 } if (!flag && !flag1 && !flag2) { -@@ -672,9 +674,9 @@ public class Camel extends AbstractHorse { +@@ -673,9 +675,9 @@ public class Camel extends AbstractHorse { @Override public void openCustomInventoryScreen(Player player) { @@ -2708,7 +2586,7 @@ index 459a45f82c42b346a66bb1954e155a0970dcc30f..538020c17702585db1d3ebdd14c01368 } -@@ -720,6 +722,7 @@ public class Camel extends AbstractHorse { +@@ -721,6 +723,7 @@ public class Camel extends AbstractHorse { super(camel); } @@ -2716,7 +2594,7 @@ index 459a45f82c42b346a66bb1954e155a0970dcc30f..538020c17702585db1d3ebdd14c01368 @Override public void clientTick() { if (!Camel.this.refuseToMove()) { -@@ -727,5 +730,6 @@ public class Camel extends AbstractHorse { +@@ -728,5 +731,6 @@ public class Camel extends AbstractHorse { } } @@ -2724,10 +2602,10 @@ index 459a45f82c42b346a66bb1954e155a0970dcc30f..538020c17702585db1d3ebdd14c01368 } } diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index c4fd2adb2c32f355f23e7a9f002b275bee0bedd7..59b955c946caf35bee22c32f5d0e30b79523e4ef 100644 +index 70772863011ce270bceaf679ea3776fb36d4f0b9..05e5bb907edb77f2479b29d6e4a15ae446ab0620 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -@@ -269,6 +269,7 @@ public class Frog extends Animal implements VariantHolder> { +@@ -271,6 +271,7 @@ public class Frog extends Animal implements VariantHolder> { super.customServerAiStep(world); } @@ -2735,7 +2613,7 @@ index c4fd2adb2c32f355f23e7a9f002b275bee0bedd7..59b955c946caf35bee22c32f5d0e30b7 @Override public void tick() { if (this.level().isClientSide()) { -@@ -277,6 +278,7 @@ public class Frog extends Animal implements VariantHolder> { +@@ -279,6 +280,7 @@ public class Frog extends Animal implements VariantHolder> { super.tick(); } @@ -2743,17 +2621,8 @@ index c4fd2adb2c32f355f23e7a9f002b275bee0bedd7..59b955c946caf35bee22c32f5d0e30b7 @Override public void onSyncedDataUpdated(EntityDataAccessor data) { -@@ -418,7 +420,7 @@ public class Frog extends Animal implements VariantHolder> { - - @Override - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance() && this.isInWater()) { -+ if (/*this.isControlledByLocalInstance() &&*/ this.isInWater()) { // Plazma - Remove persist 'isClientSide' flag - this.moveRelative(this.getSpeed(), movementInput); - this.move(MoverType.SELF, this.getDeltaMovement()); - this.setDeltaMovement(this.getDeltaMovement().scale(0.9)); 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 1b0e80ae62b5c5d4e1fcac71b90f83f12fe4878a..4b9e57c271b5b4bdaa92f8da7e0770e2c1adba96 100644 +index fee263bd88c19188f6ec8017893dfc12bdd15737..e5affd87506a717f4cffa9fad4873c1efbded295 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 @@ -159,7 +159,7 @@ public class Tadpole extends AbstractFish { @@ -2766,10 +2635,10 @@ index 1b0e80ae62b5c5d4e1fcac71b90f83f12fe4878a..4b9e57c271b5b4bdaa92f8da7e0770e2 } 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 b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6fdc1ad21 100644 +index f58a0f50d04004587d342c1bb5f681cd485cf302..8ce558ddfc6dcf8fe9e6c2289fecb294a81001db 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 -@@ -491,9 +491,9 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -492,9 +492,9 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, } protected void syncSaddleToClients() { @@ -2781,7 +2650,7 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 } @Override -@@ -591,7 +591,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -592,7 +592,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @Override public void openCustomInventoryScreen(Player player) { @@ -2790,7 +2659,7 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 player.openHorseInventory(this, this.inventory); } -@@ -604,7 +604,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -605,7 +605,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, stack.consume(1, player); } @@ -2799,7 +2668,7 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 } protected boolean handleEating(Player player, ItemStack item) { -@@ -632,7 +632,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -633,7 +633,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, f = 4.0F; short0 = 60; b0 = 5; @@ -2808,7 +2677,7 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 flag = true; this.setInLove(player, item.copy()); // Paper - Fix EntityBreedEvent copying } -@@ -640,7 +640,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -641,7 +641,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, f = 10.0F; short0 = 240; b0 = 10; @@ -2817,7 +2686,7 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 flag = true; this.setInLove(player, item.copy()); // Paper - Fix EntityBreedEvent copying } -@@ -653,13 +653,13 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -654,13 +654,13 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, if (this.isBaby() && short0 > 0) { this.level().addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 0.0D, 0.0D, 0.0D); @@ -2834,7 +2703,7 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 this.modifyTemper(b0); flag = true; } -@@ -675,11 +675,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -676,11 +676,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, protected void doPlayerRide(Player player) { this.setEating(false); this.setStanding(false); @@ -2848,7 +2717,7 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 } -@@ -768,7 +768,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -769,7 +769,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, this.setFlag(64, false); } @@ -2857,7 +2726,7 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 this.standCounter = 0; this.setStanding(false); } -@@ -868,10 +868,10 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -869,10 +869,10 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, } private void openMouth() { @@ -2870,7 +2739,7 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 } -@@ -898,10 +898,12 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, +@@ -899,10 +899,12 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, } public void standIfPossible() { @@ -2887,29 +2756,11 @@ index b258be16f32ffd58ac8406deac9423cb01ca9a5c..71c3f9fdbf8f364e5112c505f53c4be6 } -@@ -931,7 +933,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, - - this.setRot(vec2f.y, vec2f.x); - this.yRotO = this.yBodyRot = this.yHeadRot = this.getYRot(); -- if (this.isControlledByLocalInstance()) { -+ //if (this.isControlledByLocalInstance()) { // Plazma - Remove persist 'isClientSide' flag - if (movementInput.z <= 0.0D) { - this.gallopSoundCounter = 0; - } -@@ -944,7 +946,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, - - this.playerJumpPendingScale = 0.0F; - } -- } -+ //} // Plazma - Remove persist 'isClientSide' flag - - } - 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 8401c7ae749f6300281cbd6b2bfc77f03d5eb9ea..818aa1e29392321533c0eb83b953a1231d430c84 100644 +index 3c265a80f55eee38406066cd02460b18fbac896d..c53e518e8455d6a54b71e538ec65629ce9720b38 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 -@@ -267,18 +267,18 @@ public class Llama extends AbstractChestedHorse implements VariantHolder 0) { this.level().addParticle(ParticleTypes.HAPPY_VILLAGER, this.getRandomX(1.0D), this.getRandomY() + 0.5D, this.getRandomZ(1.0D), 0.0D, 0.0D, 0.0D); @@ -2933,10 +2784,10 @@ index 8401c7ae749f6300281cbd6b2bfc77f03d5eb9ea..818aa1e29392321533c0eb83b953a123 if (flag && !this.isSilent()) { diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java b/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java -index cb881211f948b21ea03364373376e894cd6ed5cc..e3415556c21bdad06f69d20e99c6f7e05d975d8c 100644 +index 48c642308193243407353ea7a6849219b94b70e2..141e8cb85eb06f85143d7fb4c187e15fc88c4319 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/TraderLlama.java -@@ -138,9 +138,9 @@ public class TraderLlama extends Llama { +@@ -142,9 +142,9 @@ public class TraderLlama extends Llama { @Override public void aiStep() { super.aiStep(); @@ -2949,10 +2800,10 @@ index cb881211f948b21ea03364373376e894cd6ed5cc..e3415556c21bdad06f69d20e99c6f7e0 } diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index 0bc7856065fdc599890f18f5a4e2f6c2b3d94ba7..a108cba43a7272f53cd53b885dc03874fbf27ba4 100644 +index 86988932dc79e9ca33998044995187709ad5373b..5a101b5ff1f2e3f6f3882f84e219ba7c502ec462 100644 --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -@@ -404,9 +404,11 @@ public class Sniffer extends Animal { +@@ -406,9 +406,11 @@ public class Sniffer extends Animal { @Override public void tick() { switch (this.getState().ordinal()) { @@ -2964,7 +2815,7 @@ index 0bc7856065fdc599890f18f5a4e2f6c2b3d94ba7..a108cba43a7272f53cd53b885dc03874 case 5: this.emitDiggingParticles(this.diggingAnimationState).dropSeed(); } -@@ -432,12 +434,14 @@ public class Sniffer extends Animal { +@@ -434,12 +436,14 @@ public class Sniffer extends Animal { this.level().playSound((Player) null, (Entity) this, SoundEvents.SNIFFER_EAT, SoundSource.NEUTRAL, 1.0F, Mth.randomBetween(this.level().random, 0.8F, 1.2F)); } @@ -2980,10 +2831,10 @@ index 0bc7856065fdc599890f18f5a4e2f6c2b3d94ba7..a108cba43a7272f53cd53b885dc03874 @Override protected void playStepSound(BlockPos pos, BlockState state) { 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 eff4424fa9cbea4358c8d8cd4d20c53182f5179e..b6835fd62ee3260d853757a27aabffebcc6ca298 100644 +index d3721fcd9a537ad1e3c5712cd78bd436ac3e1a8b..0d66cc209ddcfde21686fa85bc88d738e47c6b63 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 -@@ -221,6 +221,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -223,6 +223,7 @@ public class EnderDragon extends Mob implements Enemy { return f1 <= -0.3F && f >= -0.3F; } @@ -2991,7 +2842,7 @@ index eff4424fa9cbea4358c8d8cd4d20c53182f5179e..b6835fd62ee3260d853757a27aabffeb @Override public void onFlap() { if (this.level().isClientSide && !this.isSilent()) { -@@ -228,6 +229,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -230,6 +231,7 @@ public class EnderDragon extends Mob implements Enemy { } } @@ -2999,15 +2850,15 @@ index eff4424fa9cbea4358c8d8cd4d20c53182f5179e..b6835fd62ee3260d853757a27aabffeb @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { -@@ -269,6 +271,7 @@ public class EnderDragon extends Mob implements Enemy { - // Purpur end +@@ -271,6 +273,7 @@ public class EnderDragon extends Mob implements Enemy { + // Purpur end - Ridables this.processFlappingMovement(); + /* // Plazma - Remove persist 'isClientSide' flag if (this.level().isClientSide) { this.setHealth(this.getHealth()); if (!this.isSilent() && !this.phaseManager.getCurrentPhase().isSitting() && --this.growlTime < 0) { -@@ -276,6 +279,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -278,6 +281,7 @@ public class EnderDragon extends Mob implements Enemy { this.growlTime = 200 + this.random.nextInt(200); } } @@ -3015,7 +2866,7 @@ index eff4424fa9cbea4358c8d8cd4d20c53182f5179e..b6835fd62ee3260d853757a27aabffeb if (this.dragonFight == null) { Level world = this.level(); -@@ -386,9 +390,9 @@ public class EnderDragon extends Mob implements Enemy { +@@ -388,9 +392,9 @@ public class EnderDragon extends Mob implements Enemy { this.phaseManager.getCurrentPhase().doClientTick(); } @@ -3027,7 +2878,7 @@ index eff4424fa9cbea4358c8d8cd4d20c53182f5179e..b6835fd62ee3260d853757a27aabffeb this.yBodyRot = this.getYRot(); Vec3[] avec3d = new Vec3[this.subEntities.length]; -@@ -1144,6 +1148,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1146,6 +1150,7 @@ public class EnderDragon extends Mob implements Enemy { this.phaseManager.getCurrentPhase().onCrystalDestroyed(crystal, pos, source, entityhuman); } @@ -3035,7 +2886,7 @@ index eff4424fa9cbea4358c8d8cd4d20c53182f5179e..b6835fd62ee3260d853757a27aabffeb @Override public void onSyncedDataUpdated(EntityDataAccessor data) { if (EnderDragon.DATA_PHASE.equals(data) && this.level().isClientSide) { -@@ -1152,6 +1157,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1154,6 +1159,7 @@ public class EnderDragon extends Mob implements Enemy { super.onSyncedDataUpdated(data); } @@ -3063,10 +2914,10 @@ index 5ed84f4199698dfe41abd7b9fc804bc3419078ef..e17304fd16632d2f478cf89f90ca2da3 } } 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 a671d18a354421f197e5248a16bfe9a12c5befe4..6f756f6f36b4aba5379df1780e8c6bab8873624c 100644 +index 505c84731b4731588b4568d82a852a17121e5ec8..08bff1102179551eeeeed7f65aaa1ab501ca8683 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 -@@ -320,7 +320,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -323,7 +323,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { public void aiStep() { Vec3 vec3d = this.getDeltaMovement().multiply(1.0D, 0.6D, 1.0D); @@ -3076,7 +2927,7 @@ index a671d18a354421f197e5248a16bfe9a12c5befe4..6f756f6f36b4aba5379df1780e8c6bab if (entity != null) { 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 037586c0fdb42a02660aba89dd741a647c67e52b..6230b5acc495b998e508a937d1e4c3889a3746c2 100644 +index 572bb7e1f6ae75f6dfe53b0e100b3654e42bf4c2..cbb2b28190cd05ced325359dbb466a50091213f6 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java @@ -161,10 +161,12 @@ public class ArmorStand extends LivingEntity { @@ -3171,7 +3022,7 @@ index d06ec03ad16630f2dfd81cf9f32542bd1c2592de..637d307c6bdd8e21cb479981d3941656 @Override 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 c63cf322e0d00b5ec9929db8c22d4a392049160f..8c5dff4e24c1366d583ba9c7c2c15ea166a24933 100644 +index 09403344ad63c538a2a221c6b726ebab1aab5642..4aaaadce69e62fa371d5b441e5e69c1384e5d63e 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java @@ -178,14 +178,16 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -3414,7 +3265,7 @@ index 6f1e21d6c104d71fe4fc3376ed2f2273a5f3d3cc..55d84e4c1277a3446e917b3e3e39a55c // Paper start - Option to prevent TNT from moving in water 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 0235488faee8078186fbb78038789da0846aca29..89c1dd7dd76aa89f74bbf680a2bdb94d6528cf08 100644 +index 26b64d83b7466863b7340c3292494091e9fb89c1..2ff72241928a1d07be936cd764e7408d202f39e0 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java @@ -150,7 +150,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -3439,10 +3290,10 @@ index 0235488faee8078186fbb78038789da0846aca29..89c1dd7dd76aa89f74bbf680a2bdb94d } 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 07db4557ab0d7a4a0f5432257bd18195d2de7255..b6278a2914a96ef4db03d3f6d0620d376268af82 100644 +index 000d18bdcc2d26b7cc175c4f72e32ac7a882f2a6..8ff77974b39cdbc49b73bc0ae02120d2ab59051f 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Blaze.java +++ b/src/main/java/net/minecraft/world/entity/monster/Blaze.java -@@ -135,6 +135,7 @@ public class Blaze extends Monster { +@@ -137,6 +137,7 @@ public class Blaze extends Monster { this.setDeltaMovement(this.getDeltaMovement().multiply(1.0, 0.6, 1.0)); } @@ -3450,7 +3301,7 @@ index 07db4557ab0d7a4a0f5432257bd18195d2de7255..b6278a2914a96ef4db03d3f6d0620d37 if (this.level().isClientSide) { if (this.random.nextInt(24) == 0 && !this.isSilent()) { this.level() -@@ -154,6 +155,7 @@ public class Blaze extends Monster { +@@ -156,6 +157,7 @@ public class Blaze extends Monster { this.level().addParticle(ParticleTypes.LARGE_SMOKE, this.getRandomX(0.5), this.getRandomY(), this.getRandomZ(0.5), 0.0, 0.0, 0.0); } } @@ -3459,10 +3310,10 @@ index 07db4557ab0d7a4a0f5432257bd18195d2de7255..b6278a2914a96ef4db03d3f6d0620d37 super.aiStep(); } 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 38cbe2fce9c36195aa9bea2af26d14364b216825..3b2560ee1bb8c415eada619fc057d35ccb0e2ab0 100644 +index b87a961c1f69f0cf51d8e1e462915234ee74d0a9..7a6c3eb850e463a64bfc23c7d3c46ddabeeb251d 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java +++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java -@@ -356,7 +356,7 @@ public class Creeper extends Monster { +@@ -361,7 +361,7 @@ public class Creeper extends Monster { SoundEvent soundeffect = itemstack.is(Items.FIRE_CHARGE) ? SoundEvents.FIRECHARGE_USE : SoundEvents.FLINTANDSTEEL_USE; this.level().playSound(player, this.getX(), this.getY(), this.getZ(), soundeffect, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F); @@ -3471,7 +3322,7 @@ index 38cbe2fce9c36195aa9bea2af26d14364b216825..3b2560ee1bb8c415eada619fc057d35c this.entityIgniter = player; // CraftBukkit this.ignite(); if (itemstack.getMaxDamage() == 0) { // CraftBukkit - fix MC-264285: unbreakable flint and steels are completely consumed when igniting a creeper -@@ -364,7 +364,7 @@ public class Creeper extends Monster { +@@ -369,7 +369,7 @@ public class Creeper extends Monster { } else { itemstack.hurtAndBreak(1, player, getSlotForHand(hand)); } @@ -3481,19 +3332,10 @@ index 38cbe2fce9c36195aa9bea2af26d14364b216825..3b2560ee1bb8c415eada619fc057d35c return InteractionResult.SUCCESS; } else { 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 a28a4cd9544ffa58bd03ac901a761c797044629a..38cf26247c80430401b814b57a8eed6805caa614 100644 +index 76db5a2d27ab435fdfd1e0ec0c77ef5012e128d4..902b4aff751a0f2a4fb8569eb2d88b7ceec7c40f 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java +++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -@@ -276,7 +276,7 @@ public class Drowned extends Zombie implements RangedAttackMob { - - @Override - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance() && this.isUnderWater() && this.wantsToSwim()) { -+ if (/*this.isControlledByLocalInstance() &&*/ this.isUnderWater() && this.wantsToSwim()) { // Plazma - Remove persist 'isClientSide' flag - this.moveRelative(0.01F, movementInput); - this.move(MoverType.SELF, this.getDeltaMovement()); - this.setDeltaMovement(this.getDeltaMovement().scale(0.9)); -@@ -287,15 +287,15 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -291,15 +291,15 @@ public class Drowned extends Zombie implements RangedAttackMob { @Override public void updateSwimming() { @@ -3513,10 +3355,10 @@ index a28a4cd9544ffa58bd03ac901a761c797044629a..38cf26247c80430401b814b57a8eed68 @Override 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 881b85506cbff22febe0c1cd0d30822be5c2a517..fdc7c13e83bdaf63f1f4561921dd9146ba0ec8d8 100644 +index 6ab8abd52836a2a06496652a134dafc21a456a9e..017c86be270ae395be84f6bc30c9288af6278fb7 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -225,6 +225,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -227,6 +227,7 @@ public class EnderMan extends Monster implements NeutralMob { } @@ -3524,7 +3366,7 @@ index 881b85506cbff22febe0c1cd0d30822be5c2a517..fdc7c13e83bdaf63f1f4561921dd9146 @Override public void onSyncedDataUpdated(EntityDataAccessor data) { if (EnderMan.DATA_CREEPY.equals(data) && this.hasBeenStaredAt() && this.level().isClientSide) { -@@ -233,6 +234,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -235,6 +236,7 @@ public class EnderMan extends Monster implements NeutralMob { super.onSyncedDataUpdated(data); } @@ -3532,7 +3374,7 @@ index 881b85506cbff22febe0c1cd0d30822be5c2a517..fdc7c13e83bdaf63f1f4561921dd9146 @Override public void addAdditionalSaveData(CompoundTag nbt) { -@@ -276,16 +278,18 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -278,16 +280,18 @@ public class EnderMan extends Monster implements NeutralMob { @Override public void aiStep() { @@ -3553,7 +3395,7 @@ index 881b85506cbff22febe0c1cd0d30822be5c2a517..fdc7c13e83bdaf63f1f4561921dd9146 super.aiStep(); } -@@ -310,7 +314,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -312,7 +316,7 @@ public class EnderMan extends Monster implements NeutralMob { } public boolean teleport() { @@ -3563,10 +3405,10 @@ index 881b85506cbff22febe0c1cd0d30822be5c2a517..fdc7c13e83bdaf63f1f4561921dd9146 double d1 = this.getY() + (double) (this.random.nextInt(64) - 32); double d2 = this.getZ() + (this.random.nextDouble() - 0.5D) * 64.0D; 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 f8373fc9839fccb31e3dd090de70e2cd7c9e6cfc..063954513b5c69047298a98224d7e099e18588bf 100644 +index b5e957f101a1bd14501a043fb1b528de25cf2f75..fd292373f5f8bf6f5773d5eea1a7470e8eae4231 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Endermite.java +++ b/src/main/java/net/minecraft/world/entity/monster/Endermite.java -@@ -152,11 +152,13 @@ public class Endermite extends Monster { +@@ -156,11 +156,13 @@ public class Endermite extends Monster { @Override public void aiStep() { super.aiStep(); @@ -3580,7 +3422,7 @@ index f8373fc9839fccb31e3dd090de70e2cd7c9e6cfc..063954513b5c69047298a98224d7e099 if (!this.isPersistenceRequired()) { ++this.life; } -@@ -164,7 +166,7 @@ public class Endermite extends Monster { +@@ -168,7 +170,7 @@ public class Endermite extends Monster { if (this.life >= 2400) { this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause } @@ -3590,10 +3432,10 @@ index f8373fc9839fccb31e3dd090de70e2cd7c9e6cfc..063954513b5c69047298a98224d7e099 } 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 da833bf35342f771ecccd5dcac4fe87f72d047b0..dee45687c0630cdd98e3083eeff9670a364aa50b 100644 +index 929864ee4e5e6e9c87d10bb1bb06118cd94bd5d7..336d68dc9cb9c0658a9ec204f75dfe59c6c5fe6d 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Guardian.java +++ b/src/main/java/net/minecraft/world/entity/monster/Guardian.java -@@ -165,6 +165,7 @@ public class Guardian extends Monster { +@@ -168,6 +168,7 @@ public class Guardian extends Monster { public LivingEntity getActiveAttackTarget() { if (!this.hasActiveAttackTarget()) { return null; @@ -3601,7 +3443,7 @@ index da833bf35342f771ecccd5dcac4fe87f72d047b0..dee45687c0630cdd98e3083eeff9670a } else if (this.level().isClientSide) { if (this.clientSideCachedAttackTarget != null) { return this.clientSideCachedAttackTarget; -@@ -178,6 +179,7 @@ public class Guardian extends Monster { +@@ -181,6 +182,7 @@ public class Guardian extends Monster { return null; } } @@ -3609,7 +3451,7 @@ index da833bf35342f771ecccd5dcac4fe87f72d047b0..dee45687c0630cdd98e3083eeff9670a } else { return this.getTarget(); } -@@ -226,6 +228,7 @@ public class Guardian extends Monster { +@@ -229,6 +231,7 @@ public class Guardian extends Monster { @Override public void aiStep() { if (this.isAlive()) { @@ -3617,7 +3459,7 @@ index da833bf35342f771ecccd5dcac4fe87f72d047b0..dee45687c0630cdd98e3083eeff9670a if (this.level().isClientSide) { this.clientSideTailAnimationO = this.clientSideTailAnimation; Vec3 vec3d; -@@ -294,6 +297,7 @@ public class Guardian extends Monster { +@@ -297,6 +300,7 @@ public class Guardian extends Monster { } } } @@ -3625,20 +3467,11 @@ index da833bf35342f771ecccd5dcac4fe87f72d047b0..dee45687c0630cdd98e3083eeff9670a if (this.isInWaterOrBubble()) { this.setAirSupply(300); -@@ -367,7 +371,7 @@ public class Guardian extends Monster { - - @Override - public void travel(Vec3 movementInput) { -- if (this.isControlledByLocalInstance() && this.isInWater()) { -+ if (/*this.isControlledByLocalInstance() &&*/ this.isInWater()) { // Plazma - Remove persist 'isClientSide' flag - this.moveRelative(getRider() != null && this.isControllable() ? getSpeed() : 0.1F, movementInput); // Purpur - this.move(MoverType.SELF, this.getDeltaMovement()); - this.setDeltaMovement(this.getDeltaMovement().scale(0.9D)); 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 2ca241344efc6320d2018bdc772f74470080eeed..0397a6e7d5031aba20dd2e243f8f143078c68fed 100644 +index 83b64a8091a85b9eb940af33e4d44bd4a906b248..f6097d496e8af416635dfae88a1b8d66b0a06796 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java +++ b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java -@@ -124,6 +124,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { +@@ -127,6 +127,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { return super.finalizeSpawn(world, difficulty, spawnReason, entityData); } @@ -3646,7 +3479,7 @@ index 2ca241344efc6320d2018bdc772f74470080eeed..0397a6e7d5031aba20dd2e243f8f1430 @Override public void aiStep() { super.aiStep(); -@@ -163,6 +164,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { +@@ -166,6 +167,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob { } } @@ -3655,10 +3488,10 @@ index 2ca241344efc6320d2018bdc772f74470080eeed..0397a6e7d5031aba20dd2e243f8f1430 @Override public SoundEvent getCelebrateSound() { 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 63caf20256a3deae98b9cd9f54650def172f0e57..ccb32a521160ffaf45b947422819629da7f82ddb 100644 +index 2449a960493cbd99a22ce9b8d2fe852d1ec4b20d..3941468b65fb62fe0119dc69ecefb5c49722497c 100644 --- a/src/main/java/net/minecraft/world/entity/monster/MagmaCube.java +++ b/src/main/java/net/minecraft/world/entity/monster/MagmaCube.java -@@ -139,7 +139,7 @@ public class MagmaCube extends Slime { +@@ -142,7 +142,7 @@ public class MagmaCube extends Slime { @Override protected boolean isDealsDamage() { @@ -3668,10 +3501,10 @@ index 63caf20256a3deae98b9cd9f54650def172f0e57..ccb32a521160ffaf45b947422819629d @Override 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 23ca324c5379f9735232a9f74071117da23c2290..c043e4d0e782b92ef4e46fb0a74e213505f731b2 100644 +index 860162797972263283737e8f30d8b784955206be..4b7a54af07ed7d76c23a57659b40bcfd779346c1 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -@@ -232,6 +232,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -236,6 +236,7 @@ public class Phantom extends FlyingMob implements Enemy { @Override public void tick() { super.tick(); @@ -3679,7 +3512,7 @@ index 23ca324c5379f9735232a9f74071117da23c2290..c043e4d0e782b92ef4e46fb0a74e2135 if (this.level().isClientSide) { float f = Mth.cos((float) (this.getUniqueFlapTickOffset() + this.tickCount) * 7.448451F * 0.017453292F + 3.1415927F); float f1 = Mth.cos((float) (this.getUniqueFlapTickOffset() + this.tickCount + 1) * 7.448451F * 0.017453292F + 3.1415927F); -@@ -248,6 +249,7 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -252,6 +253,7 @@ public class Phantom extends FlyingMob implements Enemy { this.level().addParticle(ParticleTypes.MYCELIUM, this.getX() + (double) f3, this.getY() + (double) f5, this.getZ() + (double) f4, 0.0D, 0.0D, 0.0D); this.level().addParticle(ParticleTypes.MYCELIUM, this.getX() - (double) f3, this.getY() + (double) f5, this.getZ() - (double) f4, 0.0D, 0.0D, 0.0D); } @@ -3687,7 +3520,7 @@ index 23ca324c5379f9735232a9f74071117da23c2290..c043e4d0e782b92ef4e46fb0a74e2135 if (level().purpurConfig.phantomFlamesOnSwoop && attackPhase == AttackPhase.SWOOP) shoot(); // Purpur } -@@ -582,11 +584,13 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -594,11 +596,13 @@ public class Phantom extends FlyingMob implements Enemy { super(entity); } @@ -3701,24 +3534,11 @@ index 23ca324c5379f9735232a9f74071117da23c2290..c043e4d0e782b92ef4e46fb0a74e2135 } private class PhantomAttackStrategyGoal extends Goal { -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 17aaa3f376ce6183911739536206f9f701e452b5..c9da833c8e4d670b33703ce9e08248d34ecf22e7 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java -+++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -@@ -55,7 +55,7 @@ public class Ravager extends Raider { - return Ravager.ROAR_TARGET_WITH_GRIEFING.test(entity) && !entity.getType().equals(EntityType.ARMOR_STAND); - }; - private static final Predicate ROAR_TARGET_ON_CLIENT = (entityliving) -> { -- return !(entityliving instanceof Ravager) && entityliving.isAlive() && entityliving.isControlledByLocalInstance(); -+ return !(entityliving instanceof Ravager) && entityliving.isAlive(); //&& entityliving.isControlledByLocalInstance(); // Plazma - Remove persist 'isClientSide' flag - }; - private static final double BASE_MOVEMENT_SPEED = 0.3D; - private static final double ATTACK_MOVEMENT_SPEED = 0.35D; 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 b940cb26de3852e2127ccdd1f6c067123a909c25..ccd8743908b3161341b4b787107b0ec03d4a55da 100644 +index 78ac42c89cb768e0dfb17197a850a029937c145c..ecd71d8ef468f498a21d382f5f9b265cc436d977 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Shulker.java +++ b/src/main/java/net/minecraft/world/entity/monster/Shulker.java -@@ -229,7 +229,7 @@ public class Shulker extends AbstractGolem implements VariantHolder 0) { --this.clientSideTeleportInterpolation; -@@ -244,6 +245,7 @@ public class Shulker extends AbstractGolem implements VariantHolder data) { if (Strider.DATA_BOOST_TIME.equals(data) && this.level().isClientSide) { -@@ -148,6 +149,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -151,6 +152,7 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { super.onSyncedDataUpdated(data); } @@ -3921,7 +3741,7 @@ index 779ae2e63202c1f189b1f5647218a07c21a84ccd..06c64092ef9df58470448c333dab3a0f @Override protected void defineSynchedData(SynchedEntityData.Builder builder) { -@@ -502,9 +504,9 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -505,9 +507,9 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { // Purpur end if (!flag && this.isSaddled() && !this.isVehicle() && !player.isSecondaryUseActive()) { @@ -3934,10 +3754,10 @@ index 779ae2e63202c1f189b1f5647218a07c21a84ccd..06c64092ef9df58470448c333dab3a0f return InteractionResult.SUCCESS; } else { 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 313228811d1eff478887511f99b49706efc49774..0ca6762a36ed6e8a6f494ec0e9239c79ffe088b8 100644 +index 8e7f4cb8ede8721f05c6c35e9b4d08884254853e..8cbd9968b50d0afa2eb551e4f86a651a18032402 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Witch.java +++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java -@@ -144,7 +144,7 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -147,7 +147,7 @@ public class Witch extends Raider implements RangedAttackMob { @Override public void aiStep() { @@ -3947,10 +3767,10 @@ index 313228811d1eff478887511f99b49706efc49774..0ca6762a36ed6e8a6f494ec0e9239c79 if (this.healRaidersGoal.getCooldown() <= 0) { this.attackPlayersGoal.setCanAttack(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 cb20c018c11a0e707c2083cf964bd5303d216edd..3eb20ffc4a0446b2d0580de40b42eca53b53ec03 100644 +index 8aec50e7330d16bd3d0bc027c191fa1a4ce4552b..a933e33a1b30d53e90d10bea3dadf1f35ed94398 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java -@@ -292,7 +292,7 @@ public class Zoglin extends Monster implements HoglinBase { +@@ -295,7 +295,7 @@ public class Zoglin extends Monster implements HoglinBase { @Override public void setBaby(boolean baby) { this.getEntityData().set(DATA_BABY_ID, baby); @@ -3959,7 +3779,7 @@ index cb20c018c11a0e707c2083cf964bd5303d216edd..3eb20ffc4a0446b2d0580de40b42eca5 this.getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(0.5); } } -@@ -328,11 +328,13 @@ public class Zoglin extends Monster implements HoglinBase { +@@ -331,11 +331,13 @@ public class Zoglin extends Monster implements HoglinBase { @Override protected SoundEvent getAmbientSound() { @@ -3975,10 +3795,10 @@ index cb20c018c11a0e707c2083cf964bd5303d216edd..3eb20ffc4a0446b2d0580de40b42eca5 @Override 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 85b03e0bf7436cb846df13c575ad78ac6a17a151..6628efb0ec59e68810152a64309bc5f610181392 100644 +index 867d9ddce630482a7d3fadfe5aab213a0f912ca4..68a928e42df03f111cfc000945a6020e484e6e7f 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -249,7 +249,7 @@ public class Zombie extends Monster { +@@ -253,7 +253,7 @@ public class Zombie extends Monster { @Override public void setBaby(boolean baby) { this.getEntityData().set(Zombie.DATA_BABY_ID, baby); @@ -3987,7 +3807,7 @@ index 85b03e0bf7436cb846df13c575ad78ac6a17a151..6628efb0ec59e68810152a64309bc5f6 AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); attributemodifiable.removeModifier(this.babyModifier.id()); // Paper - Make baby speed configurable -@@ -275,7 +275,7 @@ public class Zombie extends Monster { +@@ -279,7 +279,7 @@ public class Zombie extends Monster { @Override public void tick() { @@ -3997,10 +3817,10 @@ index 85b03e0bf7436cb846df13c575ad78ac6a17a151..6628efb0ec59e68810152a64309bc5f6 --this.conversionTime; // Paper - remove anti tick skipping measures / wall time if (this.conversionTime < 0) { 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 cd66ef1d99f3ce4533c2423fd12b2fcadf481a66..399308324634c51cd90999aeafa756ddaf85e51a 100644 +index bba3562bf316878e7b8ba6a138889d9583a1b0f6..7e79aeb7e4a41152162977a426d53699beffc36f 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java -@@ -207,7 +207,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { +@@ -211,7 +211,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @Override public void tick() { @@ -4009,13 +3829,13 @@ index cd66ef1d99f3ce4533c2423fd12b2fcadf481a66..399308324634c51cd90999aeafa756dd int i = this.getConversionProgress(); // CraftBukkit start - Use wall time instead of ticks for villager conversion int elapsedTicks = MinecraftServer.currentTick - this.lastTick; -@@ -231,9 +231,9 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { +@@ -235,9 +235,9 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { if (itemstack.is(Items.GOLDEN_APPLE)) { if (this.hasEffect(MobEffects.WEAKNESS) && level().purpurConfig.zombieVillagerCureEnabled) { // Purpur itemstack.consume(1, player); - if (!this.level().isClientSide) { + //if (!this.level().isClientSide) { // Plazma - Remove persist 'isClientSide' flag - this.startConverting(player.getUUID(), this.random.nextInt(level().purpurConfig.zombieVillagerCuringTimeMax - level().purpurConfig.zombieVillagerCuringTimeMin + 1) + level().purpurConfig.zombieVillagerCuringTimeMin); // Purpur + this.startConverting(player.getUUID(), this.random.nextInt(level().purpurConfig.zombieVillagerCuringTimeMax - level().purpurConfig.zombieVillagerCuringTimeMin + 1) + level().purpurConfig.zombieVillagerCuringTimeMin); // Purpur - Customizeable Zombie Villager curing times - } + //} // Plazma - Remove persist 'isClientSide' flag @@ -4042,10 +3862,10 @@ index a7504c80bd52a47bb19506cdba30cd38b8de7318..0f2e655eae6c6ab00cead76e256dfad5 private void resetAnimations() { this.shoot.stop(); diff --git a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java -index 57f07799e74ecd48b8e4af68569b46be42c721ea..fdf4b44278961346282845270d3db3cffb497819 100644 +index 1f37384368c26b4bdd69533887a8e9b8456f7096..cff47b1e136c07b0fa21efa76b7fd5675d0d0b02 100644 --- a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java +++ b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java -@@ -252,7 +252,7 @@ public class Creaking extends Monster { +@@ -259,7 +259,7 @@ public class Creaking extends Monster { --this.attackAnimationRemainingTicks; } @@ -4054,7 +3874,7 @@ index 57f07799e74ecd48b8e4af68569b46be42c721ea..fdf4b44278961346282845270d3db3cf boolean flag = (Boolean) this.entityData.get(Creaking.CAN_MOVE); boolean flag1 = this.checkCanMove(); -@@ -267,14 +267,14 @@ public class Creaking extends Monster { +@@ -274,14 +274,14 @@ public class Creaking extends Monster { } this.entityData.set(Creaking.CAN_MOVE, flag1); @@ -4071,7 +3891,7 @@ index 57f07799e74ecd48b8e4af68569b46be42c721ea..fdf4b44278961346282845270d3db3cf BlockPos blockposition = this.getHomePos(); if (blockposition != null) { -@@ -301,13 +301,15 @@ public class Creaking extends Monster { +@@ -308,13 +308,15 @@ public class Creaking extends Monster { this.setHealth(0.0F); } } @@ -4088,7 +3908,7 @@ index 57f07799e74ecd48b8e4af68569b46be42c721ea..fdf4b44278961346282845270d3db3cf } -@@ -315,7 +317,7 @@ public class Creaking extends Monster { +@@ -322,7 +324,7 @@ public class Creaking extends Monster { protected void tickDeath() { if (this.isHeartBound() && this.isTearingDown()) { ++this.deathTime; @@ -4097,7 +3917,7 @@ index 57f07799e74ecd48b8e4af68569b46be42c721ea..fdf4b44278961346282845270d3db3cf this.tearDown(); } } else { -@@ -659,6 +661,7 @@ public class Creaking extends Monster { +@@ -658,6 +660,7 @@ public class Creaking extends Monster { super(creaking); } @@ -4105,7 +3925,7 @@ index 57f07799e74ecd48b8e4af68569b46be42c721ea..fdf4b44278961346282845270d3db3cf @Override public void clientTick() { if (Creaking.this.canMove()) { -@@ -666,6 +669,7 @@ public class Creaking extends Monster { +@@ -665,6 +668,7 @@ public class Creaking extends Monster { } } @@ -4114,10 +3934,10 @@ index 57f07799e74ecd48b8e4af68569b46be42c721ea..fdf4b44278961346282845270d3db3cf private class CreakingPathNavigation extends GroundPathNavigation { 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 6144613e834236ec0ebb12872ef9e47255b76b5b..28ca4b511ea37f6fd0eefc7a8d449c85075b855d 100644 +index e140d068b08d94c55945b30eab11adbface6fa09..5ff8c677d54a9538c07425ac1a6336e17be51760 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 -@@ -373,7 +373,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { +@@ -377,7 +377,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { @Override protected SoundEvent getAmbientSound() { @@ -4127,10 +3947,10 @@ index 6144613e834236ec0ebb12872ef9e47255b76b5b..28ca4b511ea37f6fd0eefc7a8d449c85 @Override 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 a2d29cf854be6f0bc5b5bb99e7002e07ccc4cae9..edcba583e41ce1cc87ecd28cccaa2387fe0736cf 100644 +index e6cb1f067f9920252e0bba9a493365c23b12cea7..60dadde71ae0d32dfe04d7aad282b9f17cf05823 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 -@@ -315,14 +315,14 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -318,14 +318,14 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @Override public void setBaby(boolean baby) { this.getEntityData().set(Piglin.DATA_BABY_ID, baby); @@ -4147,7 +3967,7 @@ index a2d29cf854be6f0bc5b5bb99e7002e07ccc4cae9..edcba583e41ce1cc87ecd28cccaa2387 } -@@ -494,7 +494,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -497,7 +497,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @Override protected SoundEvent getAmbientSound() { @@ -4157,7 +3977,7 @@ index a2d29cf854be6f0bc5b5bb99e7002e07ccc4cae9..edcba583e41ce1cc87ecd28cccaa2387 @Override 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 065c7c5ad2f077ab8acd0f008867d42174ba20b4..9bbf0eef3af5b7e26ae98649706746c67b76f069 100644 +index 5313f4c1ca76b120c0eb6beddc993b562f79344e..771e1b5ecc1803079bbb9e4233c616cb3075470e 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 @@ -287,6 +287,7 @@ public class Warden extends Monster implements VibrationSystem { @@ -4177,7 +3997,7 @@ index 065c7c5ad2f077ab8acd0f008867d42174ba20b4..9bbf0eef3af5b7e26ae98649706746c6 } diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index e2b00681e427bc99c3b3660d8f4830379b98c7a0..e7d93e7e26f9733a0e5ea6572f1a4f13a87dc66c 100644 +index 94ba68e063e63f77f7951d482af7a3586ba4ffdf..05cda0b35bcaa56ef082777d3d42eb8b9b6b1393 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java @@ -124,16 +124,18 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa @@ -4239,10 +4059,10 @@ index e2b00681e427bc99c3b3660d8f4830379b98c7a0..e7d93e7e26f9733a0e5ea6572f1a4f13 @Override public boolean stillValid(Player player) { 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 15ddc44bb266b4cdb1036c92dd60f1379832b501..c6d4a963ae5bde8a43fe84b6a9d3ed05c5be8ed1 100644 +index 6f691a7b7e7e335cc564577854ea404f9f5e81d7..e15d07f33db78872363f02cc5a631b7ab1255314 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -323,13 +323,13 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -328,13 +328,13 @@ public class Villager extends AbstractVillager implements ReputationEventHandler if (this.getUnhappyCounter() > 0) { this.setUnhappyCounter(this.getUnhappyCounter() - 1); } @@ -4258,25 +4078,25 @@ index 15ddc44bb266b4cdb1036c92dd60f1379832b501..c6d4a963ae5bde8a43fe84b6a9d3ed05 maybeDecayGossip(); // Paper end super.inactiveTick(); -@@ -418,7 +418,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -423,7 +423,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler this.setUnhappy(); - return tryRide(player, hand, InteractionResult.SUCCESS); // Purpur + return tryRide(player, hand, InteractionResult.SUCCESS); // Purpur - Ridables } else { - if (!this.level().isClientSide) { + //if (!this.level().isClientSide) { // Plazma - Remove persist 'isClientSide' flag boolean flag = this.getOffers().isEmpty(); if (hand == InteractionHand.MAIN_HAND) { -@@ -436,7 +436,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler - if (level().purpurConfig.villagerRidable && itemstack.isEmpty()) return tryRide(player, hand); // Purpur - if (this.level().purpurConfig.villagerAllowTrading) // Purpur +@@ -441,7 +441,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler + if (level().purpurConfig.villagerRidable && itemstack.isEmpty()) return tryRide(player, hand); // Purpur - Ridables + if (this.level().purpurConfig.villagerAllowTrading) // Purpur - Add config for villager trading this.startTrading(player); - } + //} // Plazma - Remove persist 'isClientSide' flag return InteractionResult.SUCCESS; } -@@ -447,9 +447,9 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -452,9 +452,9 @@ public class Villager extends AbstractVillager implements ReputationEventHandler public void setUnhappy() { this.setUnhappyCounter(40); @@ -4288,7 +4108,7 @@ index 15ddc44bb266b4cdb1036c92dd60f1379832b501..c6d4a963ae5bde8a43fe84b6a9d3ed05 } -@@ -477,7 +477,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -482,7 +482,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } private void resetSpecialPrices() { @@ -4297,7 +4117,7 @@ index 15ddc44bb266b4cdb1036c92dd60f1379832b501..c6d4a963ae5bde8a43fe84b6a9d3ed05 Iterator iterator = this.getOffers().iterator(); while (iterator.hasNext()) { -@@ -486,7 +486,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -491,7 +491,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler merchantrecipe.resetSpecialPriceDiff(); } @@ -4307,28 +4127,28 @@ index 15ddc44bb266b4cdb1036c92dd60f1379832b501..c6d4a963ae5bde8a43fe84b6a9d3ed05 @Override 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 42c91e52060fad4a7a598f9e9ef88fd0e0ff8475..c348f049c0d51fc98d3b2dfbdde679fb94037a2e 100644 +index 2dc7afa79126b52be42fc986926d6a63f9994d12..ed1c58948716750b0b7da8187c56a9a144cf707f 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -@@ -163,7 +163,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -166,7 +166,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill player.awardStat(Stats.TALKED_TO_VILLAGER); } - if (!this.level().isClientSide) { + //if (!this.level().isClientSide) { // Plazma - Remove persist 'isClientSide' flag if (this.getOffers().isEmpty()) { - return tryRide(player, hand, InteractionResult.CONSUME); // Purpur + return tryRide(player, hand, InteractionResult.CONSUME); // Purpur - Ridables } -@@ -172,7 +172,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill - this.setTradingPlayer(player); - this.openTradingScreen(player, this.getDisplayName(), 1); - } // Purpur +@@ -175,7 +175,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill + this.setTradingPlayer(player); + this.openTradingScreen(player, this.getDisplayName(), 1); + } // Purpur - Add config for villager trading - } + //} // Plazma - Remove persist 'isClientSide' flag return InteractionResult.SUCCESS; } else { -@@ -305,9 +305,9 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -308,9 +308,9 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill @Override public void aiStep() { super.aiStep(); @@ -4341,7 +4161,7 @@ index 42c91e52060fad4a7a598f9e9ef88fd0e0ff8475..c348f049c0d51fc98d3b2dfbdde679fb } 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 d19b1e127a1018a798eed181d8060a781b589f90..9ecd1b747066fa954608c3064867d06d4937dc85 100644 +index 7893d257deef3c1bb0187c6a0b04659716b520f9..5a9e85c44fbb716dc1e8616645732cb8db947ee9 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -241,7 +241,7 @@ public abstract class Player extends LivingEntity { @@ -4759,7 +4579,7 @@ index 5e6ceb3c3728c0c08a516566c70a5c0d72d59196..5af2f35d99102deb313da141f8d70b40 public void pullEntity(Entity entity) { Entity entity1 = this.getOwner(); 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 0b7f27a6cc6be58fa5b60002059c9fbb3b1b7b67..8b8977d9aadd929e2b1b4d8a1b76aa4f0b30352b 100644 +index f8ff53488d886bfd67ca3bfe4431b42010052d87..2bf13425b86dfc75fdd46050583b570a490d7251 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java +++ b/src/main/java/net/minecraft/world/entity/projectile/LlamaSpit.java @@ -91,9 +91,9 @@ public class LlamaSpit extends Projectile { @@ -4775,7 +4595,7 @@ index 0b7f27a6cc6be58fa5b60002059c9fbb3b1b7b67..8b8977d9aadd929e2b1b4d8a1b76aa4f } 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 40a1514637a6a26666ba877e6dcf5bc42bd54a51..94a1246d9cd2ca1eefb20e4d768e016aae9e4623 100644 +index 51160e98090c031f2d6394c824a5b1d6c0fbb7f6..cac4bc16aac73486d7e8a0538ddcd0c2ed097415 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java @@ -383,7 +383,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { @@ -4831,7 +4651,7 @@ index 347b1cab11529cb5399e607626c84bc985d5c513..f65bd1693d3395357da07bceaf1e2480 --this.flightSteps; if (this.flightSteps == 0) { 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 588b07ec4501924a49264183b414a7fd64bb6550..5bdd243b96042e301eed0d232b569b2a94e394e3 100644 +index f1786d17ce8ffd221674c887be01c7907f36f129..9bbfb659cf14110766956bb4ed1874b9966bbec9 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/SmallFireball.java @@ -90,9 +90,9 @@ public class SmallFireball extends Fireball { @@ -4945,7 +4765,7 @@ index 9d79b193fe2a737a20d1709548b2cd6c454ff27b..15662c7161e8fe9b4a4a88d75c159081 @Override 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 e63b408594b5d2673148e39c1deafc8510537bee..7365dcde9d134bceeaed0b0fc16ea34c163966f1 100644 +index eeb91f7e744d20c1a05212308a23102a347b9c19..2a474abb8c99e18fd80c92d8a96820d6b0d33bbd 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java +++ b/src/main/java/net/minecraft/world/entity/projectile/WitherSkull.java @@ -100,7 +100,7 @@ public class WitherSkull extends AbstractHurtingProjectile { @@ -5008,7 +4828,7 @@ index 821c1236901ca0a7d7e0d4c12a69f69e2b5c4363..e0afd713ab64a5e26cc9af670d17c8f5 this.discard(EntityRemoveEvent.Cause.OUT_OF_WORLD); // CraftBukkit - add Bukkit remove cause } else { diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java -index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..a48e5e21b2715550f8716812a0fe821cb4f117b5 100644 +index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..0c485282c3653fb9fb57ca498557675d895f0750 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractBoat.java @@ -178,13 +178,13 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { @@ -5036,14 +4856,7 @@ index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..a48e5e21b2715550f8716812a0fe821c this.ejectPassengers(); } -@@ -309,21 +309,25 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { - - super.tick(); - this.tickLerp(); -- if (this.isControlledByLocalInstance()) { -+ //if (this.isControlledByLocalInstance()) { // Plazma - Remove persist 'isClientSide' flag - if (!(this.getFirstPassenger() instanceof Player)) { - this.setPaddleState(false, false); +@@ -315,10 +315,12 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { } this.floatBoat(); @@ -5055,15 +4868,8 @@ index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..a48e5e21b2715550f8716812a0fe821c + */ // Plazma - Remove persist 'isClientSide' flag this.move(MoverType.SELF, this.getDeltaMovement()); -+ /* // Plazma - Remove persist 'isClientSide' flag } else { - this.setDeltaMovement(Vec3.ZERO); - } -+ */ // Plazma - Remove persist 'isClientSide' flag - - // CraftBukkit start - org.bukkit.Server server = this.level().getCraftServer(); -@@ -367,7 +371,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { +@@ -367,7 +369,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { List list = this.level().getEntities((Entity) this, this.getBoundingBox().inflate(0.20000000298023224D, -0.009999999776482582D, 0.20000000298023224D), EntitySelector.pushableBy(this)); if (!list.isEmpty()) { @@ -5072,7 +4878,7 @@ index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..a48e5e21b2715550f8716812a0fe821c Iterator iterator = list.iterator(); while (iterator.hasNext()) { -@@ -388,6 +392,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { +@@ -388,6 +390,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { private void tickBubbleColumn() { int i; @@ -5080,7 +4886,7 @@ index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..a48e5e21b2715550f8716812a0fe821c if (this.level().isClientSide) { i = this.getBubbleTime(); if (i > 0) { -@@ -400,6 +405,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { +@@ -400,6 +403,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { this.bubbleAngleO = this.bubbleAngle; this.bubbleAngle = 10.0F * (float) Math.sin((double) (0.5F * (float) this.level().getGameTime())) * this.bubbleMultiplier; } else { @@ -5088,7 +4894,7 @@ index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..a48e5e21b2715550f8716812a0fe821c if (!this.isAboveBubbleColumn) { this.setBubbleTime(0); } -@@ -426,7 +432,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { +@@ -426,7 +430,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { this.isAboveBubbleColumn = false; } @@ -5097,7 +4903,7 @@ index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..a48e5e21b2715550f8716812a0fe821c } -@@ -839,7 +845,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { +@@ -839,7 +843,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { public InteractionResult interact(Player player, InteractionHand hand) { InteractionResult enuminteractionresult = super.interact(player, hand); @@ -5106,7 +4912,7 @@ index 1a4fb057025689a22b3dd05f531f0d8639d7e47b..a48e5e21b2715550f8716812a0fe821c } @Override -@@ -851,7 +857,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { +@@ -851,7 +855,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable { @Override public void remove(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) { // CraftBukkit end @@ -5129,10 +4935,10 @@ index f888f1dd2e3c228b0a370fe920b63d547bbba571..6ab21ca26499e7d98da87f7dfefd3852 } 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 b31940441596079aae1cd2a38b9d22be18358448..4c16ccf8dc8b6558d113bb40241506c1565141f4 100644 +index d0c93f87795d7162bbfb3fdadadb6ae1c5fdaeeb..f24073c1f00f93c73890e26380b5cb796d442ecd 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -@@ -648,51 +648,44 @@ public abstract class AbstractMinecart extends VehicleEntity { +@@ -649,51 +649,44 @@ public abstract class AbstractMinecart extends VehicleEntity { @Override public void push(Entity entity) { @@ -5515,7 +5321,7 @@ index c7d4a09c11f933494ab047921660451c6c1c7280..69125b16efeee7554ca48fd28b97aca5 return InteractionResult.SUCCESS; } else { diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java -index 38f287d97544b8a5b080837e38710dc4e94ae9bf..d1b71df2c3760914aee98ac03c0d11fa1302a3a0 100644 +index b9190acbcb256a3072f0a5f1c4c731f1222b459f..d4306837b6e5ce215975777d7720cf57312e2108 100644 --- a/src/main/java/net/minecraft/world/item/BucketItem.java +++ b/src/main/java/net/minecraft/world/item/BucketItem.java @@ -94,9 +94,9 @@ public class BucketItem extends Item implements DispensibleContainerItem { @@ -6111,7 +5917,7 @@ index 5cb39f95bd2d45b6c18554605f01d2ebf6473428..d581534e7b1a5ab95a76f7394bf82f2f return InteractionResult.SUCCESS; } diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 357d484029fe338bea4f5770d13ccfc0dce4432e..1c92f61a5af7d39192d10f389780a501d472926d 100644 +index ac3b0f95926aba8e99375f74dfca9d83ca1fbd57..54832a4163dc6dee5393c907d084ea3c087eb56f 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -65,6 +65,7 @@ public abstract class BaseSpawner { @@ -6143,7 +5949,7 @@ index 357d484029fe338bea4f5770d13ccfc0dce4432e..1c92f61a5af7d39192d10f389780a501 return true; } else { diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index abdd3fcf266752d3bcad56cc5cd35ba8d3356a85..7005b8b6cf9e583b67362a9a7b360e62d81478ed 100644 +index 90df89b67c34540901190cac6063bc5721d95ae0..9a6152fc74ba6c71b32da7519cec537e34291fa2 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -138,7 +138,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @@ -6528,7 +6334,7 @@ index 2535e6d71b690f8dfde41a7d9cb76b6f010f5aa7..bf4c5d6f2b7c24a7f439f9026e405666 @Override 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 91e68335d7007e3c1fe13eec0060db01c5f659ac..7fb9e88961dd2344790ac467c361c68d3b08a4f1 100644 +index f00526753a83f95689fad2a132bef79f4479eec6..a21e65839dcb94f536a679129b934d25bf599872 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -191,9 +191,9 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -6643,7 +6449,7 @@ index ddd1504ed9516f8f247cd63c42d5d1db0c01ce67..38fee8cda4b95a5bb9dd02ca6eca776c @Nullable 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 299d782c4e84d8548f2faddfb03712bab388de09..2ef78865012e0f06636dc421db4dbecde5731c48 100644 +index b6ba6ebe6ac15cbcb5d3a6221b47762e37c4a56f..fc370e915c527420447c0deffb2fb94684373246 100644 --- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java @@ -178,11 +178,13 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB @@ -6979,7 +6785,7 @@ index 01584d77a8877528c3ec65971a1a6377c09e763b..08882ab963b2445843c5d8545727f157 return InteractionResult.SUCCESS; } 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 daf865c20cc193a12db0d98e3c0472eefdf635c2..c5472944127e0179a647cac2f8748e917b545ead 100644 +index f8356e468841137dcc92b2fe5db1cafa24619eaf..fffaa3867cd3072619d39506414063c2dc717163 100644 --- a/src/main/java/net/minecraft/world/level/block/DoorBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DoorBlock.java @@ -114,7 +114,7 @@ public class DoorBlock extends Block { @@ -7438,7 +7244,7 @@ index fd5489993dca0f940da69e9163f78e5c2e6ee063..cd049a28ff2d4f748b154feb99b64e45 @Override diff --git a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java -index 3760c3c9ab45d7152661edd5a48893e1b583fb95..b946858d3ccc38972d86608e020302ac05b053a8 100644 +index f91c845061fa632e53efb31c63cf0c67c9c2e86a..75da3a36ae7af4c9b0156dbec4e6560cbdfa4cb2 100644 --- a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java @@ -62,6 +62,7 @@ public class PowderSnowBlock extends Block implements BucketPickup { @@ -7839,7 +7645,7 @@ index fb88b5c1d9e764bf1211d601527133ea8e8268b3..8d5eb584d24ec8fdc7decc6569ea8a23 // Purpur start 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 ff655401c7aecba5acd8d241e844d77364f09f35..7e6aba582c81bfcc2851eab4efcc49e5d1bf2476 100644 +index e93d1eba4fcd02e15287a1a66da94e695806a470..32c240d3d7739b1a740bdec010d6f95e2cc250ae 100644 --- a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java @@ -47,11 +47,11 @@ public class StonecutterBlock extends Block { @@ -7982,7 +7788,7 @@ index 74cce7874809dcbce2718ec3840bb6bb3127e871..b7e8431198be8ed5a7f221e43d5a92a0 @Override 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 f1dfb23160ff70e0da4dd2af2d83e879527c6651..63c60e461a3db8f8b6084e074c0b201adbdec051 100644 +index cf86448e2067712863d30c9aecc48daedefd227f..a38b8104a6a27164f791d732f027af3c4eee4a21 100644 --- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java @@ -162,7 +162,7 @@ public class TurtleEggBlock extends Block { @@ -7995,7 +7801,7 @@ index f1dfb23160ff70e0da4dd2af2d83e879527c6651..63c60e461a3db8f8b6084e074c0b201a } diff --git a/src/main/java/net/minecraft/world/level/block/WitherSkullBlock.java b/src/main/java/net/minecraft/world/level/block/WitherSkullBlock.java -index 3a7126883f11ac5a647947eaf060df15536a6cb2..b26ee54d48908199e5fcd4bda415f29f3f42026c 100644 +index 11d6427682d8778d1cf668ee4c1d5760af2c185e..325582b5286dd3e81237a0d3c53de2eb2d7ea194 100644 --- a/src/main/java/net/minecraft/world/level/block/WitherSkullBlock.java +++ b/src/main/java/net/minecraft/world/level/block/WitherSkullBlock.java @@ -63,7 +63,7 @@ public class WitherSkullBlock extends SkullBlock { @@ -8022,7 +7828,7 @@ index 3a7126883f11ac5a647947eaf060df15536a6cb2..b26ee54d48908199e5fcd4bda415f29f private static BlockPattern getOrCreateWitherFull() { 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 2d190b3a6378b8cbadfa65510df1ccfbd5882ef8..69ef5c805d802575a639027fd40064d92fcfe89d 100644 +index 98e3d0a6f1be8cef8678b4048a3a484012092f08..c8ac3df678bc62985972d520f84f26a44ddd6970 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 @@ -154,7 +154,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -8351,7 +8157,7 @@ index e1c9a961064887070b29207efd7af47884f8dc29..6feb7f915dac585916ac02a7f4a83b47 float f = blockEntity.progress + 0.5F; moveCollidedEntities(world, pos, f, blockEntity); 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 090e196cf391dced8adcb8106026d67b2aeac6b0..44cd8ba60233ec86d9c9316fe7c28eee5ce88f7a 100644 +index 00ea1c2037c7c7780764bfcc3e07b6554e910db2..2144652adb3259a4d5113fe3337e13280cda3f12 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -435,7 +435,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p diff --git a/patches/server/0043-Process-pathfinding-asynchronously.patch b/patches/server/0044-Process-pathfinding-asynchronously.patch similarity index 98% rename from patches/server/0043-Process-pathfinding-asynchronously.patch rename to patches/server/0044-Process-pathfinding-asynchronously.patch index 30f03cb5d..2353b3d85 100644 --- a/patches/server/0043-Process-pathfinding-asynchronously.patch +++ b/patches/server/0044-Process-pathfinding-asynchronously.patch @@ -897,10 +897,10 @@ index 9104d7010bda6f9f73b478c11490ef9c53f76da2..a53950a6e4cb2e672b6f130461fa6306 // Paper end - optimise POI access if (path != null && path.canReach()) { 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 dc4231375730357f6b6d7f902a71b0a593a34a8e..c43c26134c3431e66c767d54fc5b8761ca109084 100644 +index ba0b72e648fad219d7b42f5d489b53ec41046826..d83f75719a3be1b5b2c544d89b63a4df420c73d2 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -1240,7 +1240,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -1243,7 +1243,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { } else { Bee.this.pathfindRandomlyTowards(Bee.this.hivePos); } @@ -909,7 +909,7 @@ index dc4231375730357f6b6d7f902a71b0a593a34a8e..c43c26134c3431e66c767d54fc5b8761 boolean flag = this.pathfindDirectlyTowards(Bee.this.hivePos); if (!flag) { -@@ -1299,7 +1299,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -1302,7 +1302,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { } else { Path pathentity = Bee.this.navigation.getPath(); @@ -919,10 +919,10 @@ index dc4231375730357f6b6d7f902a71b0a593a34a8e..c43c26134c3431e66c767d54fc5b8761 } } diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index 59b955c946caf35bee22c32f5d0e30b79523e4ef..305fe2c13ae2d81b99ff36f8ef18e24c23255eae 100644 +index 05e5bb907edb77f2479b29d6e4a15ae446ab0620..963e55584c741a3a3f903f465d897c7ecbf5cd4d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -@@ -506,9 +506,23 @@ public class Frog extends Animal implements VariantHolder> { +@@ -508,9 +508,23 @@ public class Frog extends Animal implements VariantHolder> { return nodeType != PathType.WATER_BORDER && super.canCutCorner(nodeType); } @@ -947,10 +947,10 @@ index 59b955c946caf35bee22c32f5d0e30b79523e4ef..305fe2c13ae2d81b99ff36f8ef18e24c } } 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 38cf26247c80430401b814b57a8eed6805caa614..ad08dc9965c35bc06c67ee929b2cbb3432c2d9ba 100644 +index 902b4aff751a0f2a4fb8569eb2d88b7ceec7c40f..3235ea771c58ce9c09457a812416346341375613 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java +++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java -@@ -305,7 +305,7 @@ public class Drowned extends Zombie implements RangedAttackMob { +@@ -309,7 +309,7 @@ public class Drowned extends Zombie implements RangedAttackMob { protected boolean closeToNextPos() { Path path = this.getNavigation().getPath(); @@ -960,10 +960,10 @@ index 38cf26247c80430401b814b57a8eed6805caa614..ad08dc9965c35bc06c67ee929b2cbb34 if (blockPos != null) { double d = this.distanceToSqr((double)blockPos.getX(), (double)blockPos.getY(), (double)blockPos.getZ()); 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 06c64092ef9df58470448c333dab3a0fabdeb072..e8c310e84f799217bc8bdda47fa24b872ad64e2d 100644 +index 1cee20de1b691a92bee625a877e0ee9769e30b0b..ec871c81817ee82fa7b4ff929693b5ba045d35fb 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Strider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Strider.java -@@ -610,9 +610,23 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { +@@ -613,9 +613,23 @@ public class Strider extends Animal implements ItemSteerable, Saddleable { super(entity, world); } @@ -988,7 +988,7 @@ index 06c64092ef9df58470448c333dab3a0fabdeb072..e8c310e84f799217bc8bdda47fa24b87 } 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 9bbf0eef3af5b7e26ae98649706746c67b76f069..d121fd2796382654aee39c6bebf8adb72b064d71 100644 +index 771e1b5ecc1803079bbb9e4233c616cb3075470e..839a5550a6d613abf4567b32b5f1a04700d6ccf4 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 @@ -637,6 +637,15 @@ public class Warden extends Monster implements VibrationSystem { diff --git a/patches/server/0044-Implement-alternative-noise-chunk-generator.patch b/patches/server/0045-Implement-alternative-noise-chunk-generator.patch similarity index 100% rename from patches/server/0044-Implement-alternative-noise-chunk-generator.patch rename to patches/server/0045-Implement-alternative-noise-chunk-generator.patch diff --git a/patches/server/0045-Reduce-allocations.patch b/patches/server/0046-Reduce-allocations.patch similarity index 96% rename from patches/server/0045-Reduce-allocations.patch rename to patches/server/0046-Reduce-allocations.patch index bdf7b8531..0f0dfdee8 100644 --- a/patches/server/0045-Reduce-allocations.patch +++ b/patches/server/0046-Reduce-allocations.patch @@ -609,7 +609,7 @@ index 8dd9375f2ad2c65a773a3195aeff1f977e09e7e0..89cfe5a4e1554dd722ca98ec8c896e85 private ChunkMap getChunkMap() { return (ChunkMap)this.playerProvider; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 36dec4f9d1a1ded85b13e9227e59cee0c408a316..898b24e6264b59f59416c801f2d6b01801a8a881 100644 +index 25b646c973cc1d304b8adb3cef4cf443d459b489..df0f52ee12eeab816c8920d6844a284239143054 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1366,7 +1366,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -715,25 +715,25 @@ index a371f685534bf161f476ccea431fec6a80aca9c1..d2addf2453fa35779f0197f54a102e06 } 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 c43c26134c3431e66c767d54fc5b8761ca109084..76b8e4872608bf34e6c489111c98c760d6644a5e 100644 +index d83f75719a3be1b5b2c544d89b63a4df420c73d2..f3b1671a815c953435bf49616ab7c35856bdc352 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java @@ -261,7 +261,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.goalSelector.addGoal(8, new Bee.BeeWanderGoal()); this.goalSelector.addGoal(9, new FloatGoal(this)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables - this.targetSelector.addGoal(1, (new Bee.BeeHurtByOtherGoal(this)).setAlertOthers(new Class[0])); + this.targetSelector.addGoal(1, (new Bee.BeeHurtByOtherGoal(this)).setAlertOthers()); // Plazma - Reduce allocations this.targetSelector.addGoal(2, new Bee.BeeBecomeAngryTargetGoal(this)); this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true)); } 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 cf071f48fb9b3acb7fabe4295de979dfca1079b4..fb663d60f6245f16fb4a09ce7c6fa65badfa1e36 100644 +index 1c918dfcb8b3c05394fea6dcc50c5bfc48cb3634..24a05c3b18690656ce5305c0e4d118f635cc9b6a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java -@@ -119,7 +119,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob { +@@ -123,7 +123,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob { this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new DefendVillageTargetGoal(this)); - this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0])); + this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); // Plazma - Reduce allocations @@ -741,23 +741,23 @@ index cf071f48fb9b3acb7fabe4295de979dfca1079b4..fb663d60f6245f16fb4a09ce7c6fa65b this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Mob.class, 5, false, false, (entityliving, worldserver) -> { return entityliving instanceof Enemy && !(entityliving instanceof Creeper); 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 2df413fce51db6360c2a55fde72061135e0bd3a9..ae5d66afa5573596df9c322d9bb5c270777e8b8b 100644 +index adeb06f913b53d802f03d3def1303e298fe589e4..d2b6ec6f1cbae2063240210695f73e96ed8c436a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Panda.java +++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java -@@ -338,7 +338,7 @@ public class Panda extends Animal { +@@ -342,7 +342,7 @@ public class Panda extends Animal { this.goalSelector.addGoal(13, new FollowParentGoal(this, 1.25D)); this.goalSelector.addGoal(14, new WaterAvoidingRandomStrollGoal(this, 1.0D)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables - this.targetSelector.addGoal(1, (new Panda.PandaHurtByTargetGoal(this, new Class[0])).setAlertOthers(new Class[0])); + this.targetSelector.addGoal(1, (new Panda.PandaHurtByTargetGoal(this)).setAlertOthers()); // Plazma - Reduce allocations } public static AttributeSupplier.Builder createAttributes() { diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java -index 8875d212216f72114e94635a319663b195e957fd..de3527dc956302d83e54618d6ece7c9d2b982135 100644 +index 761745f759614c43426b1bdf7bc8ca7b5aff100a..777764b74ac6e809b4b353117a0f31299bb651e3 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java +++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java -@@ -458,7 +458,7 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -462,7 +462,7 @@ public class Rabbit extends Animal implements VariantHolder { if (variant == Rabbit.Variant.EVIL) { this.getAttribute(Attributes.ARMOR).setBaseValue(8.0D); this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.4D, true)); @@ -767,11 +767,11 @@ index 8875d212216f72114e94635a319663b195e957fd..de3527dc956302d83e54618d6ece7c9d this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Wolf.class, true)); this.getAttribute(Attributes.ATTACK_DAMAGE).addOrUpdateTransientModifier(new AttributeModifier(Rabbit.EVIL_ATTACK_POWER_MODIFIER, 5.0D, AttributeModifier.Operation.ADD_VALUE)); 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 1be6773df34eeb8bbc9cb0dc5349a53f3369e089..da4a3ba3a96c49a2be99c83559f9754d72f97808 100644 +index 9f4681cb70f0e42e07968024cee010990644ba53..a736db8b5764a47511433887ff1db702179e9d59 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java +++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -@@ -247,7 +247,7 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder(this, Animal.class, false, Wolf.PREY_SELECTOR)); // Purpur - moved to updatePathfinders() this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR)); 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 b08d3980761b97fbd6d63b9794aff97b1ede7fc8..29c8489d956f41b683d94e0c098bce3efef30513 100644 +index 634e11a1c279066c7bf682776344f1c829e061a4..502277270c38cfcbd686455552d2b54701774e5f 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 @@ -88,7 +88,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS @@ -807,38 +807,38 @@ index 48826eb0a960f7af6dd2ef184a8aed744a1d8f83..495a24d4e6705902c36032227bdfa359 public static final EnderDragonPhase STRAFE_PLAYER = create(DragonStrafePlayerPhase.class, "StrafePlayer"); public static final EnderDragonPhase LANDING_APPROACH = create(DragonLandingApproachPhase.class, "LandingApproach"); 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 6f756f6f36b4aba5379df1780e8c6bab8873624c..4add01bb03e52974fc2ac9507976b317585abece 100644 +index 08bff1102179551eeeeed7f65aaa1ab501ca8683..91839fc6b8013c31d562c21670985d42747bfdce 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 -@@ -257,7 +257,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -260,7 +260,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(7, new RandomLookAroundGoal(this)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables - this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0])); + this.targetSelector.addGoal(1, new HurtByTargetGoal(this)); // Plazma - Reduce allocations this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 0, false, false, WitherBoss.LIVING_ENTITY_SELECTOR)); } 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 89c1dd7dd76aa89f74bbf680a2bdb94d6528cf08..596077289def8306dd879e3a41f0b0af8a92fb94 100644 +index 2ff72241928a1d07be936cd764e7408d202f39e0..334cc9474e0a81c34babffc22e25d52c6e2fbf17 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java @@ -83,7 +83,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(6, new RandomLookAroundGoal(this)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables - this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0])); + this.targetSelector.addGoal(1, new HurtByTargetGoal(this)); // Plazma - Reduce allocations this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true)); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR)); 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 3b2560ee1bb8c415eada619fc057d35ccb0e2ab0..82ccbcef029066a1b48c0844e974380d89059910 100644 +index 7a6c3eb850e463a64bfc23c7d3c46ddabeeb251d..a346f13be03481311a18f3778fed6e0d4343d15e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java +++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java -@@ -154,7 +154,7 @@ public class Creeper extends Monster { +@@ -161,7 +161,7 @@ public class Creeper extends Monster { this.goalSelector.addGoal(6, new RandomLookAroundGoal(this)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, true)); - this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0])); + this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); // Plazma - Reduce allocations @@ -846,12 +846,12 @@ index 3b2560ee1bb8c415eada619fc057d35ccb0e2ab0..82ccbcef029066a1b48c0844e974380d public static AttributeSupplier.Builder createAttributes() { 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 fdc7c13e83bdaf63f1f4561921dd9146ba0ec8d8..21d43105d2e283e2ff70a30ecaa7a86ddf5736ba 100644 +index 017c86be270ae395be84f6bc30c9288af6278fb7..6a6e2856e8bd361880dcc91638f74f98fa9bf3b0 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -135,7 +135,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -137,7 +137,7 @@ public class EnderMan extends Monster implements NeutralMob { this.goalSelector.addGoal(11, new EnderMan.EndermanTakeBlockGoal(this)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables this.targetSelector.addGoal(1, new EnderMan.EndermanLookForPlayerGoal(this, this::isAngryAt)); - this.targetSelector.addGoal(2, new HurtByTargetGoal(this, new Class[0])); + this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); // Plazma - Reduce allocations @@ -859,49 +859,49 @@ index fdc7c13e83bdaf63f1f4561921dd9146ba0ec8d8..21d43105d2e283e2ff70a30ecaa7a86d this.targetSelector.addGoal(4, new ResetUniversalAngerTargetGoal<>(this, false)); } 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 063954513b5c69047298a98224d7e099e18588bf..be9a5957b076268d79445d6daf7ae0deac32f6eb 100644 +index fd292373f5f8bf6f5773d5eea1a7470e8eae4231..0aa7d7ceccf77fac4d43d6c2fc814e4b1aec4dd3 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Endermite.java +++ b/src/main/java/net/minecraft/world/entity/monster/Endermite.java -@@ -90,7 +90,7 @@ public class Endermite extends Monster { +@@ -94,7 +94,7 @@ public class Endermite extends Monster { this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables - this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers()); + this.targetSelector.addGoal(1, (new HurtByTargetGoal(this)).setAlertOthers()); // Plazma - Reduce allocations this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); } diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java -index 7a6ad611faf39eb8dd87bd498169571633c33769..2a3edfeab8306efe013084de44e1c372fffe98d6 100644 +index 78aec4acc84b228537f90172f2e4c346b665bc0b..6fec80e4b8911b5cf2849904f060e05042477117 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java +++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java -@@ -89,7 +89,7 @@ public class Silverfish extends Monster { +@@ -92,7 +92,7 @@ public class Silverfish extends Monster { this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0D, false)); this.goalSelector.addGoal(5, new Silverfish.SilverfishMergeWithStoneGoal(this)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables - this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[0])).setAlertOthers()); + this.targetSelector.addGoal(1, (new HurtByTargetGoal(this)).setAlertOthers()); // Plazma - Reduce allocations this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); } diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java -index 74f8903541d5288f2a50769ffc5ef88e0c9aad1b..b58cef316e85edde6200fe870144334a19ef193d 100644 +index 49fa54b2d46c916d8f43c78080ea04eb37e60717..e4144c76d541158b2fc5699158608123802dd453 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Spider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java -@@ -97,7 +97,7 @@ public class Spider extends Monster { +@@ -100,7 +100,7 @@ public class Spider extends Monster { this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(6, new RandomLookAroundGoal(this)); - this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur + this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables - this.targetSelector.addGoal(1, new HurtByTargetGoal(this, new Class[0])); + this.targetSelector.addGoal(1, new HurtByTargetGoal(this)); // Plazma - Reduce allocations this.targetSelector.addGoal(2, new Spider.SpiderTargetGoal<>(this, Player.class)); this.targetSelector.addGoal(3, new Spider.SpiderTargetGoal<>(this, IronGolem.class)); } 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 6628efb0ec59e68810152a64309bc5f610181392..badde720a15f3a9a0c0c8b6b66b387b3b1aabd64 100644 +index 68a928e42df03f111cfc000945a6020e484e6e7f..e5a8343542339036475e3d23958121e9d388fd44 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -170,7 +170,7 @@ public class Zombie extends Monster { +@@ -174,7 +174,7 @@ public class Zombie extends Monster { this.goalSelector.addGoal(2, new ZombieAttackGoal(this, 1.0D, false)); this.goalSelector.addGoal(6, new MoveThroughVillageGoal(this, 1.0D, true, 4, this::canBreakDoors)); this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D)); @@ -911,10 +911,10 @@ index 6628efb0ec59e68810152a64309bc5f610181392..badde720a15f3a9a0c0c8b6b66b387b3 // Purpur start if ( this.level().spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false) { // Spigot 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 8c3271dcc8c9aa58e2e007eba282c11e42b4e0c9..dd69e6efade81c6421f9cf0365d42092529cee63 100644 +index c0e611f3222ffacfbd0683c8c65b778f9012a2ad..15a18f3cc7f37860d8137d8f5f8d91834610e7a6 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java -@@ -120,7 +120,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -124,7 +124,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { protected void addBehaviourGoals() { this.goalSelector.addGoal(2, new ZombieAttackGoal(this, 1.0D, false)); this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D)); @@ -1148,7 +1148,7 @@ index 8a4f95049c63afb28bef6719c77b7a7092e75aae..f295205e3093f8c3c4ed4c1cf6ac3aaf System.out.println("Starting server"); Thread runThread = new Thread(() -> { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 029d6daa003f90999afa4e5070eabf6e0ada473a..c307063dd311988443e415f3ce3709671ecd68f8 100644 +index c2df3c38f58d8dcb5e3d62077655af56a3bffd65..20ffe2ac1a7ad4549f46855abdfa0579bcaf82ff 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -521,7 +521,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0046-Hashed-rcon-password.patch b/patches/server/0047-Hashed-rcon-password.patch similarity index 100% rename from patches/server/0046-Hashed-rcon-password.patch rename to patches/server/0047-Hashed-rcon-password.patch diff --git a/patches/server/0047-Add-option-to-allow-shoot-fireball.patch b/patches/server/0048-Add-option-to-allow-shoot-fireball.patch similarity index 100% rename from patches/server/0047-Add-option-to-allow-shoot-fireball.patch rename to patches/server/0048-Add-option-to-allow-shoot-fireball.patch diff --git a/patches/server/0048-Remove-Mojang-Profiler-codes.patch b/patches/server/0049-Remove-Mojang-Profiler-codes.patch similarity index 100% rename from patches/server/0048-Remove-Mojang-Profiler-codes.patch rename to patches/server/0049-Remove-Mojang-Profiler-codes.patch diff --git a/patches/server/0049-Completely-remove-Mojang-profiler.patch b/patches/server/0050-Completely-remove-Mojang-profiler.patch similarity index 97% rename from patches/server/0049-Completely-remove-Mojang-profiler.patch rename to patches/server/0050-Completely-remove-Mojang-profiler.patch index b1849bc1e..a3849cb90 100644 --- a/patches/server/0049-Completely-remove-Mojang-profiler.patch +++ b/patches/server/0050-Completely-remove-Mojang-profiler.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Completely remove Mojang profiler diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index a5e8f2d8e5963c730a9509eddfadb9ca322c7183..eff19915b68537bda8e6e3352964a2910e4cc602 100644 +index fe9a01e19ef182fb8e9c653fc1232ec7f13037e4..2ef4dc9169a9bec304b4922a2e91c31b966c711d 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java @@ -132,7 +132,7 @@ import net.minecraft.server.commands.WorldBorderCommand; @@ -213,7 +213,7 @@ index e9775b4506909bee65a74964f0d5391a0513de1d..a72bf8986d7f93dc0b3d8830c17745cf } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e1409a61891e4f30c39ba5b75691776e92417ed2..e66ba297c6f92fe855d992ceb5d4468be5670377 100644 +index 3e0d878c3b3dcefb8f223bc93a5fc6d594998565..f8377d6165f77bc19b904ca81a0c4aa139e728b0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -111,19 +111,19 @@ import net.minecraft.util.datafix.DataFixers; @@ -335,7 +335,7 @@ index e1409a61891e4f30c39ba5b75691776e92417ed2..e66ba297c6f92fe855d992ceb5d4468b - this.mayHaveDelayedTasks = true; - this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos); - // Pufferfish start - tps catchup -- if (!gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup || !gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup) { // Purpur +- if (!org.purpurmc.purpur.PurpurConfig.tpsCatchup || !gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup) { // Purpur - this.nextTickTimeNanos = currentTime + i; - this.delayedTasksMaxNextTickTimeNanos = nextTickTimeNanos; - } @@ -381,7 +381,7 @@ index e1409a61891e4f30c39ba5b75691776e92417ed2..e66ba297c6f92fe855d992ceb5d4468b + this.mayHaveDelayedTasks = true; + this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos); + // Pufferfish start - tps catchup -+ if (!gg.pufferfish.pufferfish.PufferfishConfig.tpsCatchup) { // Purpur // Plazma - nice code purpur ++ if (!org.purpurmc.purpur.PurpurConfig.tpsCatchup) { // Purpur // Plazma - nice code purpur + this.nextTickTimeNanos = currentTime + i; + this.delayedTasksMaxNextTickTimeNanos = nextTickTimeNanos; } @@ -487,7 +487,7 @@ index e1409a61891e4f30c39ba5b75691776e92417ed2..e66ba297c6f92fe855d992ceb5d4468b // CraftBukkit start @@ -1910,11 +1888,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Purpur + worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur - Ridables + /* // Plazma - Completely remove Mojang profiler gameprofilerfiller.push(() -> { @@ -1027,7 +1027,7 @@ index aea9a45c0916501f71018d3250b56da435f5664e..a84faa2e82a8d33b7bfe71f174f2913b } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 898b24e6264b59f59416c801f2d6b01801a8a881..3afb36148d4ee8a856521cfa16cfc10d2cc68961 100644 +index df0f52ee12eeab816c8920d6844a284239143054..518b9feb5e2494e52fe9719ddc22dce7da4db0fb 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -80,8 +80,8 @@ import net.minecraft.util.ProgressListener; @@ -1172,7 +1172,7 @@ index 898b24e6264b59f59416c801f2d6b01801a8a881..3afb36148d4ee8a856521cfa16cfc10d - Profiler.get().pop(); + //Profiler.get().pop(); // Plazma - Completely remove Mojang profiler if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { - // Purpur start + // Purpur start - Configurable daylight cycle int incrementTicks = isDay() ? this.purpurConfig.daytimeTicks : this.purpurConfig.nighttimeTicks; @@ -1001,9 +1001,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe boolean flag = this.isRaining(); @@ -1262,7 +1262,7 @@ index 898b24e6264b59f59416c801f2d6b01801a8a881..3afb36148d4ee8a856521cfa16cfc10d while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 3f6ffe3da816eb53bfe065b4b7d561478a27ece9..3fdac9a6b2cbc9c9b460d83e53c309323d30a213 100644 +index 6f39fd99ffb28d6c0267f4251c54af0c519289db..98f3f1d5319821c24920aabc27029c7f5fd58fd1 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -101,8 +101,8 @@ import net.minecraft.tags.FluidTags; @@ -1306,7 +1306,7 @@ index 3f6ffe3da816eb53bfe065b4b7d561478a27ece9..3fdac9a6b2cbc9c9b460d83e53c30932 this.stopUsingItem(); this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities())); diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index a71c220ea1c464c193029adb1a0d3e5c237442af..f034a030e9402a4ea03028dfbba931b08e5687ae 100644 +index 10120b2ac4c4aea480ee4bb23b3203bad74dc9ae..24cd8ae3018d93e0f25834407a98804dddfe2cd7 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -30,7 +30,7 @@ import net.minecraft.server.MinecraftServer; @@ -1559,7 +1559,7 @@ index c67846e4d5583d79c6e9760c10d2581f0d54f45c..fdace9b3dedcd2c0879ea4ef30657d9d @Override diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 78f4ddfefcad7dd9332f1738c76f01b60a704a90..98d96daaba653980bbfb64c0a63d8906ae9faf0d 100644 +index 9b5379edf00ab7256e7e90702e319de9b20ac0b4..af0b090a831205ba681012d465842b07a1b7fda9 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -84,8 +84,8 @@ import net.minecraft.tags.FluidTags; @@ -1626,8 +1626,8 @@ index 78f4ddfefcad7dd9332f1738c76f01b60a704a90..98d96daaba653980bbfb64c0a63d8906 boolean flag = !Mth.equal(movement.x, vec3d1.x); boolean flag1 = !Mth.equal(movement.z, vec3d1.z); -@@ -1279,7 +1279,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - //} // Plazma - Remove persist 'isClientSide' flag +@@ -1281,7 +1281,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + */ // Plazma - Remove persist 'isClientSide' flag if (this.isRemoved()) { - gameprofilerfiller.pop(); @@ -1635,7 +1635,7 @@ index 78f4ddfefcad7dd9332f1738c76f01b60a704a90..98d96daaba653980bbfb64c0a63d8906 } else { if (this.horizontalCollision) { Vec3 vec3d2 = this.getDeltaMovement(); -@@ -1328,7 +1328,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1330,7 +1330,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess float f = this.getBlockSpeedFactor(); this.setDeltaMovement(this.getDeltaMovement().multiply((double) f, 1.0D, (double) f)); @@ -1644,7 +1644,7 @@ index 78f4ddfefcad7dd9332f1738c76f01b60a704a90..98d96daaba653980bbfb64c0a63d8906 } } // Paper start - detailed watchdog information -@@ -3522,9 +3522,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3524,9 +3524,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.processPortalCooldown(); if (this.portalProcess != null) { if (this.portalProcess.processPortalTeleportation(worldserver, this, this.canUsePortal(false))) { @@ -1656,7 +1656,7 @@ index 78f4ddfefcad7dd9332f1738c76f01b60a704a90..98d96daaba653980bbfb64c0a63d8906 this.setPortalCooldown(); TeleportTransition teleporttransition = this.portalProcess.getPortalDestination(worldserver, this); -@@ -3536,7 +3536,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3538,7 +3538,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } @@ -1665,7 +1665,7 @@ index 78f4ddfefcad7dd9332f1738c76f01b60a704a90..98d96daaba653980bbfb64c0a63d8906 } else if (this.portalProcess.hasExpired()) { this.portalProcess = null; } -@@ -4060,16 +4060,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4062,16 +4062,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess entity.teleport(this.calculatePassengerTransition(teleportTarget, entity)); } @@ -1685,7 +1685,7 @@ index 78f4ddfefcad7dd9332f1738c76f01b60a704a90..98d96daaba653980bbfb64c0a63d8906 return this; } -@@ -4091,12 +4091,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4093,12 +4093,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } @@ -1701,7 +1701,7 @@ index 78f4ddfefcad7dd9332f1738c76f01b60a704a90..98d96daaba653980bbfb64c0a63d8906 return null; } else { // Paper start - Fix item duplication and teleport issues -@@ -4122,7 +4122,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4124,7 +4124,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess world.resetEmptyTime(); teleportTarget.postTeleportTransition().onTransition(entity); @@ -1711,7 +1711,7 @@ index 78f4ddfefcad7dd9332f1738c76f01b60a704a90..98d96daaba653980bbfb64c0a63d8906 } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index acfd61118d7769c069127d793733b4df5a8f3924..b982f884aadc04d302d54405b50f11567174a4f2 100644 +index 9940c74dac4ebcfacdaf88d0b1e95e78e964e1ba..d6d43ad1677d035c26619b73e5a2dd6e72ab278b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -72,8 +72,8 @@ import net.minecraft.tags.FluidTags; @@ -1746,7 +1746,7 @@ index acfd61118d7769c069127d793733b4df5a8f3924..b982f884aadc04d302d54405b50f1156 } // Pufferfish start - optimize suffocation -@@ -3453,12 +3453,12 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3451,12 +3451,12 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.run += (f3 - this.run) * 0.3F; @@ -1763,7 +1763,7 @@ index acfd61118d7769c069127d793733b4df5a8f3924..b982f884aadc04d302d54405b50f1156 // Paper start - stop large pitch and yaw changes from crashing the server this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F; -@@ -3470,7 +3470,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3468,7 +3468,7 @@ public abstract class LivingEntity extends Entity implements Attackable { this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F; // Paper end @@ -1772,7 +1772,7 @@ index acfd61118d7769c069127d793733b4df5a8f3924..b982f884aadc04d302d54405b50f1156 this.animStep += f2; if (this.isFallFlying()) { ++this.fallFlyTicks; -@@ -3702,21 +3702,21 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3700,21 +3700,21 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.setDeltaMovement(d0, d1, d2); @@ -1800,7 +1800,7 @@ index acfd61118d7769c069127d793733b4df5a8f3924..b982f884aadc04d302d54405b50f1156 if (this.jumping && this.isAffectedByFluids()) { double d3; -@@ -3743,8 +3743,8 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3741,8 +3741,8 @@ public abstract class LivingEntity extends Entity implements Attackable { this.noJumpDelay = 0; } @@ -1811,7 +1811,7 @@ index acfd61118d7769c069127d793733b4df5a8f3924..b982f884aadc04d302d54405b50f1156 this.xxa *= 0.98F; this.zza *= 0.98F; if (this.isFallFlying()) { -@@ -3777,8 +3777,8 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3775,8 +3775,8 @@ public abstract class LivingEntity extends Entity implements Attackable { //} // Plazma - Remove persist 'isClientSide' flag this.calculateEntityAnimation(this instanceof FlyingAnimal); @@ -1822,7 +1822,7 @@ index acfd61118d7769c069127d793733b4df5a8f3924..b982f884aadc04d302d54405b50f1156 if (/*!this.level().isClientSide &&*/ !this.isDeadOrDying() && !this.freezeLocked) { // Paper - Freeze Tick Lock API // Plazma - Remove persist 'isClientSide' flag int i = this.getTicksFrozen(); -@@ -3799,15 +3799,15 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3797,15 +3797,15 @@ public abstract class LivingEntity extends Entity implements Attackable { } } @@ -1839,10 +1839,10 @@ index acfd61118d7769c069127d793733b4df5a8f3924..b982f884aadc04d302d54405b50f1156 - gameprofilerfiller.pop(); + //gameprofilerfiller.pop(); // Plazma - Completely remove Mojang profiler // Paper start - Add EntityMoveEvent - // Purpur start + // Purpur start - Ridables if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index dd82dbb3eca667d54eabe1f284bd3d0318a7fe0d..30c33a464076bc7f35f3d745c1b7a111f04f2d9b 100644 +index ae1dcf013b03c6d04ccf34be4e54048581479183..af8a02ea3daaf8c147f87e5a58d25a1583490413 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -34,8 +34,8 @@ import net.minecraft.sounds.SoundEvent; @@ -2092,7 +2092,7 @@ index 116b1e251ffe68bae5c404d0823c2bc7c1afddf6..24aa626c1ccd12c6a00d004ac3af4698 this.seen.add(i); } else { 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 29c8489d956f41b683d94e0c098bce3efef30513..43c41dc6069c83fc5ea0175d86b348a4f2e22f19 100644 +index 502277270c38cfcbd686455552d2b54701774e5f..f63ae92412184949e085ee23c434a4bc1a236b16 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 @@ -31,8 +31,8 @@ import net.minecraft.tags.GameEventTags; @@ -2106,7 +2106,7 @@ index 29c8489d956f41b683d94e0c098bce3efef30513..43c41dc6069c83fc5ea0175d86b348a4 import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.SimpleContainer; -@@ -279,15 +279,15 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS +@@ -280,15 +280,15 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS private int behaviorTick = 0; // Pufferfish @Override protected void customServerAiStep(ServerLevel world) { @@ -2128,7 +2128,7 @@ index 29c8489d956f41b683d94e0c098bce3efef30513..43c41dc6069c83fc5ea0175d86b348a4 } diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java -index 9c97ac81dd898ebaa1fcf888bb898ad55ffc455a..255a3aba3124c819d7163640e0422cf2ea64dfee 100644 +index d239c8325468c72fc7acf3831115c3cdf1f77f43..ece73c0cdf7358fa0e2bdc4512fbd873c085983b 100644 --- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java +++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java @@ -23,8 +23,8 @@ import net.minecraft.util.ByIdMap; @@ -2142,7 +2142,7 @@ index 9c97ac81dd898ebaa1fcf888bb898ad55ffc455a..255a3aba3124c819d7163640e0422cf2 import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; -@@ -164,15 +164,15 @@ public class Armadillo extends Animal { +@@ -166,15 +166,15 @@ public class Armadillo extends Animal { private int behaviorTick; // Plazma - Add missing pufferfish configurations @Override protected void customServerAiStep(ServerLevel world) { @@ -2164,7 +2164,7 @@ index 9c97ac81dd898ebaa1fcf888bb898ad55ffc455a..255a3aba3124c819d7163640e0422cf2 this.forceDrops = true; // CraftBukkit if (this.dropFromGiftLootTable(world, BuiltInLootTables.ARMADILLO_SHED, this::spawnAtLocation)) { 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 ee9be9de7d64c9354b579dc22954058873e7ab5e..33718841e1d97185ba59142bcc484adcb488fc56 100644 +index a38bca8cf5fbb218f8dbd2fb27705051c4d4836f..87bc28617a2c56bd4d04705885631de43a038a65 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 @@ -26,8 +26,8 @@ import net.minecraft.util.ByIdMap; @@ -2178,7 +2178,7 @@ index ee9be9de7d64c9354b579dc22954058873e7ab5e..33718841e1d97185ba59142bcc484adc import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -335,15 +335,15 @@ public class Axolotl extends Animal implements VariantHolder, B +@@ -339,15 +339,15 @@ public class Axolotl extends Animal implements VariantHolder, B private int behaviorTick = 0; // Pufferfish @Override protected void customServerAiStep(ServerLevel world) { @@ -2200,7 +2200,7 @@ index ee9be9de7d64c9354b579dc22954058873e7ab5e..33718841e1d97185ba59142bcc484adc Optional optional = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS); diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index 538020c17702585db1d3ebdd14c0136863a00a17..a54297fc425a2eaf04ffb3af51644efdaf0cd7ea 100644 +index 70c3bb5d0c35fa79f74f76f452e9b34ebfe8041e..6e3572c9151743b231fafcc81b56b5d114691e65 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java @@ -17,8 +17,8 @@ import net.minecraft.sounds.SoundSource; @@ -2214,7 +2214,7 @@ index 538020c17702585db1d3ebdd14c0136863a00a17..a54297fc425a2eaf04ffb3af51644efd import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -167,17 +167,17 @@ public class Camel extends AbstractHorse { +@@ -169,17 +169,17 @@ public class Camel extends AbstractHorse { private int behaviorTick = 0; // Plazma - Add missing pufferfish configurations @Override protected void customServerAiStep(ServerLevel world) { @@ -2238,7 +2238,7 @@ index 538020c17702585db1d3ebdd14c0136863a00a17..a54297fc425a2eaf04ffb3af51644efd } diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index 305fe2c13ae2d81b99ff36f8ef18e24c23255eae..8a228f3cbaf706bc02ee142b11fdebfa3192e3e8 100644 +index 963e55584c741a3a3f903f465d897c7ecbf5cd4d..3dbd2205fdabf316819d05818e9f75089bc506cf 100644 --- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java @@ -28,8 +28,8 @@ import net.minecraft.tags.ItemTags; @@ -2252,7 +2252,7 @@ index 305fe2c13ae2d81b99ff36f8ef18e24c23255eae..8a228f3cbaf706bc02ee142b11fdebfa import net.minecraft.world.DifficultyInstance; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.AgeableMob; -@@ -258,14 +258,14 @@ public class Frog extends Animal implements VariantHolder> { +@@ -260,14 +260,14 @@ public class Frog extends Animal implements VariantHolder> { private int behaviorTick = 0; // Pufferfish @Override protected void customServerAiStep(ServerLevel world) { @@ -2273,7 +2273,7 @@ index 305fe2c13ae2d81b99ff36f8ef18e24c23255eae..8a228f3cbaf706bc02ee142b11fdebfa } 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 4b9e57c271b5b4bdaa92f8da7e0770e2c1adba96..d41526c5cc223162f0298ff1ccf65acc1dfdcbca 100644 +index e5affd87506a717f4cffa9fad4873c1efbded295..f69bfc81a7990ddb9043557a767083f687aeb248 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 @@ -12,8 +12,8 @@ import net.minecraft.server.level.ServerLevel; @@ -2309,7 +2309,7 @@ index 4b9e57c271b5b4bdaa92f8da7e0770e2c1adba96..d41526c5cc223162f0298ff1ccf65acc } 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 d508cb2a61866c8fd7f381f8deb558ed86f7c845..d911c311b28e80843d3e162553093fe54168a0c6 100644 +index 9cd08bb4e9069bb2f701ef3825ba4c5af6f56790..ea1c1fe3da78b90a3a2b5d40b17508d25eb05b03 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 @@ -20,8 +20,8 @@ import net.minecraft.tags.ItemTags; @@ -2323,7 +2323,7 @@ index d508cb2a61866c8fd7f381f8deb558ed86f7c845..d911c311b28e80843d3e162553093fe5 import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -227,15 +227,15 @@ public class Goat extends Animal { +@@ -230,15 +230,15 @@ public class Goat extends Animal { private int behaviorTick = 0; // Pufferfish @Override protected void customServerAiStep(ServerLevel world) { @@ -2345,7 +2345,7 @@ index d508cb2a61866c8fd7f381f8deb558ed86f7c845..d911c311b28e80843d3e162553093fe5 } diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index a108cba43a7272f53cd53b885dc03874fbf27ba4..83d0b7587919a607e44e86b3b8d8806265889455 100644 +index 5a101b5ff1f2e3f6f3882f84e219ba7c502ec462..4f9c44973a125e7a82b289f405b4451542310f5d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java @@ -30,8 +30,8 @@ import net.minecraft.tags.BlockTags; @@ -2359,7 +2359,7 @@ index a108cba43a7272f53cd53b885dc03874fbf27ba4..83d0b7587919a607e44e86b3b8d88062 import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; -@@ -512,14 +512,14 @@ public class Sniffer extends Animal { +@@ -514,14 +514,14 @@ public class Sniffer extends Animal { private int behaviorTick; // Plazma - Add missing pufferfish configurations @Override protected void customServerAiStep(ServerLevel world) { @@ -2379,7 +2379,7 @@ index a108cba43a7272f53cd53b885dc03874fbf27ba4..83d0b7587919a607e44e86b3b8d88062 } 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 3eb20ffc4a0446b2d0580de40b42eca53b53ec03..18325bcb3274e746b913dbacf28663b4d32786a9 100644 +index a933e33a1b30d53e90d10bea3dadf1f35ed94398..eae9a9d433f425e3f2e2fed727dfd00facdea262 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java @@ -15,8 +15,8 @@ import net.minecraft.network.syncher.SynchedEntityData; @@ -2393,7 +2393,7 @@ index 3eb20ffc4a0446b2d0580de40b42eca53b53ec03..18325bcb3274e746b913dbacf28663b4 import net.minecraft.util.valueproviders.UniformInt; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.damagesource.DamageSource; -@@ -281,11 +281,11 @@ public class Zoglin extends Monster implements HoglinBase { +@@ -284,11 +284,11 @@ public class Zoglin extends Monster implements HoglinBase { @Override protected void customServerAiStep(ServerLevel world) { @@ -2442,7 +2442,7 @@ index 0f2e655eae6c6ab00cead76e256dfad5b19cbb60..2aaf70c202b3d08add495ebda0700d75 } diff --git a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java -index fdf4b44278961346282845270d3db3cffb497819..424d8bcf774b0c443978c2ec1c10b306053f66c9 100644 +index cff47b1e136c07b0fa21efa76b7fd5675d0d0b02..5d6166a9fd22f909f8e4c2192ebe11d9ccf2043d 100644 --- a/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java +++ b/src/main/java/net/minecraft/world/entity/monster/creaking/Creaking.java @@ -19,8 +19,8 @@ import net.minecraft.server.level.ServerLevel; @@ -2456,7 +2456,7 @@ index fdf4b44278961346282845270d3db3cffb497819..424d8bcf774b0c443978c2ec1c10b306 import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.AnimationState; import net.minecraft.world.entity.Entity; -@@ -234,11 +234,11 @@ public class Creaking extends Monster { +@@ -241,11 +241,11 @@ public class Creaking extends Monster { @Override protected void customServerAiStep(ServerLevel world) { @@ -2472,7 +2472,7 @@ index fdf4b44278961346282845270d3db3cffb497819..424d8bcf774b0c443978c2ec1c10b306 } 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 28ca4b511ea37f6fd0eefc7a8d449c85075b855d..840f62cdb2a691bcfb5c27f00745cebfeb97df96 100644 +index 5ff8c677d54a9538c07425ac1a6336e17be51760..6dcdd3ef9de2a46275aee3b3580c4a5f63a3aa00 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 @@ -16,8 +16,8 @@ import net.minecraft.sounds.SoundEvents; @@ -2486,7 +2486,7 @@ index 28ca4b511ea37f6fd0eefc7a8d449c85075b855d..840f62cdb2a691bcfb5c27f00745cebf import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -179,12 +179,12 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { +@@ -183,12 +183,12 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { private int behaviorTick; // Pufferfish @Override protected void customServerAiStep(ServerLevel world) { @@ -2503,7 +2503,7 @@ index 28ca4b511ea37f6fd0eefc7a8d449c85075b855d..840f62cdb2a691bcfb5c27f00745cebf 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 edcba583e41ce1cc87ecd28cccaa2387fe0736cf..7ef1c83464f3fdff7ca77eb40aa072c4bda017b3 100644 +index 60dadde71ae0d32dfe04d7aad282b9f17cf05823..7b090b48fa9379940728c8c737a684ba0cabae00 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 @@ -8,8 +8,8 @@ import net.minecraft.tags.ItemTags; @@ -2517,7 +2517,7 @@ index edcba583e41ce1cc87ecd28cccaa2387fe0736cf..7ef1c83464f3fdff7ca77eb40aa072c4 import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -@@ -343,12 +343,12 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -346,12 +346,12 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento private int behaviorTick; // Pufferfish @Override protected void customServerAiStep(ServerLevel world) { @@ -2534,7 +2534,7 @@ index edcba583e41ce1cc87ecd28cccaa2387fe0736cf..7ef1c83464f3fdff7ca77eb40aa072c4 super.customServerAiStep(world); } 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 bc3b0eb21200eae7e419b2571871b36fc1e07c0f..7134120e8f22904c222ac31b763f67fc12a970ee 100644 +index 24e198440d4841daac664dc6c5a8a3dc6825b469..e6f642e4004ce54c5c49436315869c57f850150a 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 @@ -8,8 +8,8 @@ import net.minecraft.server.level.ServerLevel; @@ -2548,7 +2548,7 @@ index bc3b0eb21200eae7e419b2571871b36fc1e07c0f..7134120e8f22904c222ac31b763f67fc import net.minecraft.world.DifficultyInstance; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.EntitySpawnReason; -@@ -148,11 +148,11 @@ public class PiglinBrute extends AbstractPiglin { +@@ -151,11 +151,11 @@ public class PiglinBrute extends AbstractPiglin { @Override protected void customServerAiStep(ServerLevel world) { @@ -2564,7 +2564,7 @@ index bc3b0eb21200eae7e419b2571871b36fc1e07c0f..7134120e8f22904c222ac31b763f67fc PiglinBruteAi.maybePlayActivitySound(this); super.customServerAiStep(world); 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 d121fd2796382654aee39c6bebf8adb72b064d71..2c578b92b2773f61ce527a62668fd03c4f6a0205 100644 +index 839a5550a6d613abf4567b32b5f1a04700d6ccf4..fdadca863827f19f8a27915fd7d2bb296064cc78 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 @@ -32,8 +32,8 @@ import net.minecraft.tags.TagKey; @@ -2595,7 +2595,7 @@ index d121fd2796382654aee39c6bebf8adb72b064d71..2c578b92b2773f61ce527a62668fd03c if ((this.tickCount + this.getId()) % 120 == 0) { Warden.applyDarknessAround(world, this.position(), this, 20); 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 c6d4a963ae5bde8a43fe84b6a9d3ed05c5be8ed1..324a324d3eeb4c2669e1b3c87abacacf77805914 100644 +index e15d07f33db78872363f02cc5a631b7ab1255314..95d9bba10fa589c4858fd99d2cc6de3397bdcab2 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -38,8 +38,8 @@ import net.minecraft.stats.Stats; @@ -2609,7 +2609,7 @@ index c6d4a963ae5bde8a43fe84b6a9d3ed05c5be8ed1..324a324d3eeb4c2669e1b3c87abacacf import net.minecraft.world.Difficulty; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; -@@ -344,9 +344,9 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -349,9 +349,9 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } protected void customServerAiStep(ServerLevel world, boolean inactive) { // Purpur - not final // Paper end - EAR 2 @@ -2621,8 +2621,8 @@ index c6d4a963ae5bde8a43fe84b6a9d3ed05c5be8ed1..324a324d3eeb4c2669e1b3c87abacacf // Purpur start if (this.level().purpurConfig.villagerLobotomizeEnabled) { // treat as inactive if lobotomized -@@ -360,7 +360,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler - this.getBrain().tick(world, this); // Paper // Purpur +@@ -365,7 +365,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler + this.getBrain().tick(world, this); // Paper // Purpur - Ridables } // Pufferfish end - gameprofilerfiller.pop(); @@ -2662,7 +2662,7 @@ index 2483627f807d7a3907f6848a8bc45d7a798e746d..3f5bda2682891a15c7507ef10dbaad38 RecipeManager.LOGGER.info("Loaded {} recipes", prepared.values().size()); } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 7005b8b6cf9e583b67362a9a7b360e62d81478ed..7f95c8d4999b8ccaf4128570aeace8d2c7070e06 100644 +index 9a6152fc74ba6c71b32da7519cec537e34291fa2..805db223ad83b50546c32747fc127d9fe42b34f9 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -36,8 +36,8 @@ import net.minecraft.util.AbortableIterationConsumer; @@ -2770,7 +2770,7 @@ index dc15c15951e4ca30b8341d24f813259a77f41c77..ff61aee501131c4141c79354f408d89b // Paper start - Add mobcaps commands diff --git a/src/main/java/net/minecraft/world/level/ServerExplosion.java b/src/main/java/net/minecraft/world/level/ServerExplosion.java -index e2763ee67530074d8ec78fbff694eb84f5373de0..7f1e3fb265270b8105e1bbb3d6337e45fe35c544 100644 +index 4c7e4683c53afb0800b7f17c5964ba8ff31848d1..f894b47b228a2dc37b4486f7e5b89681cdcaa849 100644 --- a/src/main/java/net/minecraft/world/level/ServerExplosion.java +++ b/src/main/java/net/minecraft/world/level/ServerExplosion.java @@ -15,8 +15,8 @@ import net.minecraft.core.BlockPos; @@ -2800,7 +2800,7 @@ index e2763ee67530074d8ec78fbff694eb84f5373de0..7f1e3fb265270b8105e1bbb3d6337e45 if (this.fire) { 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 44cd8ba60233ec86d9c9316fe7c28eee5ce88f7a..1586803c9f94c449b6b92e0d924606375ce2c735 100644 +index 2144652adb3259a4d5113fe3337e13280cda3f12..ee836953b1d6a362a3a785dc1fd0ea0416bdd984 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -26,8 +26,8 @@ import net.minecraft.network.FriendlyByteBuf; @@ -2916,7 +2916,7 @@ index 778e6476c86d823dc8efe603a95e589e8b2ea9d9..fe3ba3e7fb5c2711edfa7c78441a590b this.rescheduleLeftoverContainers(); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a7853ce8028c2fc0c8fe71f767700fc624a8007c..a730524b3334fca09323d8c940320ee167c3b1c3 100644 +index deddf588826dda9b15beff3acf20be56837d240b..0c1409f190d67029b090c025f1657467d8113004 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -471,7 +471,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0050-Port-minor-SparklyPaper-patches.patch b/patches/server/0051-Port-minor-SparklyPaper-patches.patch similarity index 98% rename from patches/server/0050-Port-minor-SparklyPaper-patches.patch rename to patches/server/0051-Port-minor-SparklyPaper-patches.patch index 7a33052c2..d486e9c3a 100644 --- a/patches/server/0050-Port-minor-SparklyPaper-patches.patch +++ b/patches/server/0051-Port-minor-SparklyPaper-patches.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Port minor SparklyPaper patches diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index b0675953a75ff01f714cf5f35ad3907281648724..168547ce0ceed07ea4471112adc3882760009e99 100644 +index 2bec5ed591e658765602379f9065b8089f5df6ea..ddcf301f098bbe55dbef7751180110a22bccc68d 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java @@ -58,6 +58,7 @@ import org.bukkit.event.player.PlayerVelocityEvent; diff --git a/patches/server/0051-SparklyPaper-Optimize-framed-map-tracker-ticking.patch b/patches/server/0052-SparklyPaper-Optimize-framed-map-tracker-ticking.patch similarity index 98% rename from patches/server/0051-SparklyPaper-Optimize-framed-map-tracker-ticking.patch rename to patches/server/0052-SparklyPaper-Optimize-framed-map-tracker-ticking.patch index 8b2768e81..1537afb60 100644 --- a/patches/server/0051-SparklyPaper-Optimize-framed-map-tracker-ticking.patch +++ b/patches/server/0052-SparklyPaper-Optimize-framed-map-tracker-ticking.patch @@ -5,7 +5,7 @@ Subject: [PATCH] SparklyPaper - Optimize framed map tracker ticking diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 3b11cc112e98cea1067ecdfe20d894f8ba753b93..f33e7f7fdee160b7397b1156c179a5c95816307a 100644 +index ddcf301f098bbe55dbef7751180110a22bccc68d..92422a9251be5c6334b55f47079f8c8e72439aef 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java @@ -129,33 +129,31 @@ public class ServerEntity { @@ -80,7 +80,7 @@ index 3b11cc112e98cea1067ecdfe20d894f8ba753b93..f33e7f7fdee160b7397b1156c179a5c9 public Vec3 getPositionBase() { 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 27f7a0abf77e94f15ff5f42e54e979377c94e63c..d1b8edccf3d7418a4aceba8491491b3a339b645a 100644 +index ad3f17ee59e2508886551204b87d95482ce9b100..360289fea15e1097068bc4898c5b1b3e3aaf58ad 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java @@ -175,6 +175,16 @@ public class ItemFrame extends HangingEntity { diff --git a/patches/server/0052-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch b/patches/server/0053-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch similarity index 97% rename from patches/server/0052-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch rename to patches/server/0053-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch index f1751c1dc..09498caa3 100644 --- a/patches/server/0052-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch +++ b/patches/server/0053-SparklyPaper-Skip-executeTick-check-if-there-s-no-ta.patch @@ -75,7 +75,7 @@ index c03608fec96b51e1867f43d8f42e5aefb1520e46..9bb01accce426fafbddc1965a61257a7 throw new IllegalStateException("Ticking retired scheduler"); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e66ba297c6f92fe855d992ceb5d4468be5670377..6ea53f0ad431a77f3f75ca89abd74f6eba98f898 100644 +index f8377d6165f77bc19b904ca81a0c4aa139e728b0..fd74856160fa048941e10f52d2061e4ccdc86f31 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -337,6 +337,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.pickupDelay != 32767) { 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 9ecd1b747066fa954608c3064867d06d4937dc85..515da2d32aa23286cea47e160e01c7581d5b02be 100644 +index 5a9e85c44fbb716dc1e8616645732cb8db947ee9..4ea1a327c80f915aa45ccf3a5955ed6ff42692c1 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -305,6 +305,11 @@ public abstract class Player extends LivingEntity { @@ -167,7 +167,7 @@ index c8ae6e4cd74549f753ec04def5d882de1ab72308..b01b80ff0318f95a737ce3f93a5c6942 protected void spawnAfterBreak(BlockState state, ServerLevel world, BlockPos pos, ItemStack tool, boolean dropExperience) {} 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 f2d6d432f1314bc8bbc262f70c1632af5faff52d..3b2d12b4869a22b0161d8d67ff782a396d8773aa 100644 +index a1756429e8fc09cfd78109c4d5113857304b317d..158da3ebd4b09d8c682960ff658a2e861cbee6dc 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1081,8 +1081,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p diff --git a/patches/server/0058-Add-option-to-disable-beacon-effect-ambient.patch b/patches/server/0059-Add-option-to-disable-beacon-effect-ambient.patch similarity index 97% rename from patches/server/0058-Add-option-to-disable-beacon-effect-ambient.patch rename to patches/server/0059-Add-option-to-disable-beacon-effect-ambient.patch index 13500e985..c048b92c5 100644 --- a/patches/server/0058-Add-option-to-disable-beacon-effect-ambient.patch +++ b/patches/server/0059-Add-option-to-disable-beacon-effect-ambient.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add option to disable beacon effect ambient 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 69ef5c805d802575a639027fd40064d92fcfe89d..31d6bf6c1bcca32ce8a8a8810807dec4d5000ab9 100644 +index c8ac3df678bc62985972d520f84f26a44ddd6970..ee97079a57750cc5f0ee06567704575987afea47 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 @@ -368,24 +368,20 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name diff --git a/patches/server/0059-Tick-toggle-subcommand.patch b/patches/server/0060-Tick-toggle-subcommand.patch similarity index 100% rename from patches/server/0059-Tick-toggle-subcommand.patch rename to patches/server/0060-Tick-toggle-subcommand.patch diff --git a/patches/server/0060-Configurable-player-list-file-path.patch b/patches/server/0061-Configurable-player-list-file-path.patch similarity index 97% rename from patches/server/0060-Configurable-player-list-file-path.patch rename to patches/server/0061-Configurable-player-list-file-path.patch index 47c8fba4e..190ef8cd0 100644 --- a/patches/server/0060-Configurable-player-list-file-path.patch +++ b/patches/server/0061-Configurable-player-list-file-path.patch @@ -45,7 +45,7 @@ index 1f2958d21c279ecb377b7c90ba643ea83e217eca..6a411f609c48b28115b947494062f9f7 if (OldUsersConverter.OLD_WHITELIST.exists() && OldUsersConverter.OLD_WHITELIST.isFile()) { if (whitelist.getFile().exists()) { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 70bb8a45217b51d3a156aabce32efbca1ae7fcc9..dee8346f0c9507576142e0f74e303b29b60af0c0 100644 +index d5d09bf63f4b7fba73188f75d5fe9599b8da2844..8ab6df63d9a22ac76b2ba14bc8fef318e65484c8 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -126,10 +126,12 @@ import org.bukkit.event.player.PlayerSpawnChangeEvent; @@ -83,7 +83,7 @@ index 70bb8a45217b51d3a156aabce32efbca1ae7fcc9..dee8346f0c9507576142e0f74e303b29 this.registries = registryManager; this.maxPlayers = maxPlayers; diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index ba002bf801ec34f88671031fe916e0dddf86a437..61bd19718a5bf5f574b62013298217f0a88685a8 100644 +index a75f3328ba32466b6ceeddb0069c856524f19c0a..10308192df338ebb3db8d2e1ebade4786ee4ec28 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -205,6 +205,32 @@ public class Main { diff --git a/patches/server/0061-Add-option-to-set-player-can-bypass-limit.patch b/patches/server/0062-Add-option-to-set-player-can-bypass-limit.patch similarity index 77% rename from patches/server/0061-Add-option-to-set-player-can-bypass-limit.patch rename to patches/server/0062-Add-option-to-set-player-can-bypass-limit.patch index 08db55d73..a1274851a 100644 --- a/patches/server/0061-Add-option-to-set-player-can-bypass-limit.patch +++ b/patches/server/0062-Add-option-to-set-player-can-bypass-limit.patch @@ -5,32 +5,23 @@ Subject: [PATCH] Add option to set player can bypass limit diff --git a/src/main/java/net/minecraft/server/commands/OpCommand.java b/src/main/java/net/minecraft/server/commands/OpCommand.java -index e7b444a10b244828827b3c66c53465206ea8e0ec..02b037ab5ef746598903be17e93f7f49c095b434 100644 +index e7b444a10b244828827b3c66c53465206ea8e0ec..af455e7f1c22fda87dbc5b487b757d046dcc2d49 100644 --- a/src/main/java/net/minecraft/server/commands/OpCommand.java +++ b/src/main/java/net/minecraft/server/commands/OpCommand.java -@@ -2,6 +2,8 @@ package net.minecraft.server.commands; - - import com.mojang.authlib.GameProfile; - import com.mojang.brigadier.CommandDispatcher; -+import com.mojang.brigadier.arguments.BoolArgumentType; -+import com.mojang.brigadier.arguments.IntegerArgumentType; - import com.mojang.brigadier.exceptions.CommandSyntaxException; - import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; - import java.util.Collection; -@@ -34,20 +36,41 @@ public class OpCommand { +@@ -34,20 +34,41 @@ public class OpCommand { } ) .executes(context -> opPlayers(context.getSource(), GameProfileArgument.getGameProfiles(context, "targets"))) + // Plazma start - Add an option to set player can bypass limit + .then( -+ Commands.argument("permissionLevel", IntegerArgumentType.integer(0, 4)) ++ Commands.argument("permissionLevel", com.mojang.brigadier.arguments.IntegerArgumentType.integer(0, 4)) + .executes(context -> -+ opPlayers(context.getSource(), GameProfileArgument.getGameProfiles(context, "targets"), IntegerArgumentType.getInteger(context, "permissionLevel"), false) ++ opPlayers(context.getSource(), GameProfileArgument.getGameProfiles(context, "targets"), com.mojang.brigadier.arguments.IntegerArgumentType.getInteger(context, "permissionLevel"), false) + ) + .then( -+ Commands.argument("bypassPlayerLimit", BoolArgumentType.bool()) ++ Commands.argument("bypassPlayerLimit", com.mojang.brigadier.arguments.BoolArgumentType.bool()) + .executes(context -> -+ opPlayers(context.getSource(), GameProfileArgument.getGameProfiles(context, "targets"), IntegerArgumentType.getInteger(context, "permissionLevel"), BoolArgumentType.getBool(context, "bypassPlayerLimit")) ++ opPlayers(context.getSource(), GameProfileArgument.getGameProfiles(context, "targets"), com.mojang.brigadier.arguments.IntegerArgumentType.getInteger(context, "permissionLevel"), com.mojang.brigadier.arguments.BoolArgumentType.getBool(context, "bypassPlayerLimit")) + ) + ) + ) @@ -81,21 +72,8 @@ index 20c531f11b310dab0a867e589c769393ed835df5..7d9358f3e287d1f05d799b1c8f59509e + } + // Plazma end - Add an option to set player can bypass limit } -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 3fdac9a6b2cbc9c9b460d83e53c309323d30a213..d7dbdd4c65c398b628bcb81a14b1fe0d3738024d 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayer.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1933,6 +1933,8 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple - - @Override - protected void checkFallDamage(double heightDifference, boolean onGround, BlockState state, BlockPos landedPosition) { -+ LOGGER.info("Fall distance: {}, height difference: {}", this.fallDistance, heightDifference); -+ - if (this.spawnExtraParticlesOnFall && onGround && this.fallDistance > 0.0F) { - Vec3 vec3d = landedPosition.getCenter().add(0.0D, 0.5D, 0.0D); - int i = (int) Mth.clamp(50.0F * this.fallDistance, 0.0F, 200.0F); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index dee8346f0c9507576142e0f74e303b29b60af0c0..80c8a0963617c241d3643e702b2c623c64acf7ab 100644 +index 8ab6df63d9a22ac76b2ba14bc8fef318e65484c8..81bae0453e09454c43d547c48de2f201a5e41023 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1085,8 +1085,14 @@ public abstract class PlayerList { diff --git a/patches/server/0063-fixup-Setup-basic-configuration-sections.patch b/patches/server/0063-fixup-Setup-basic-configuration-sections.patch new file mode 100644 index 000000000..2250e9638 --- /dev/null +++ b/patches/server/0063-fixup-Setup-basic-configuration-sections.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AlphaKR93 +Date: Wed, 25 Dec 2024 18:40:23 +0900 +Subject: [PATCH] fixup! Setup basic configuration sections + + +diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +index 7ea1b7e41557b7960b65b2e6d2dcb6fd2f9a24af..898f9e6ec6f306a15639ee0d03bcfe7bf55e2c6c 100644 +--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java ++++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +@@ -28,6 +28,12 @@ public class GlobalConfiguration extends ConfigurationPart { + @Setting(Configuration.VERSION_FIELD) + int version = VERSION; + ++ public Messages messages; ++ public class Messages extends ConfigurationPart { ++ ++ ++ } ++ + public Command command; + public class Command extends ConfigurationPart { + diff --git a/patches/server/0064-Add-heal-command.patch b/patches/server/0064-Add-heal-command.patch new file mode 100644 index 000000000..825f4e9d0 --- /dev/null +++ b/patches/server/0064-Add-heal-command.patch @@ -0,0 +1,107 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AlphaKR93 +Date: Wed, 25 Dec 2024 19:07:19 +0900 +Subject: [PATCH] Add heal command + + +diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java +index 2ef4dc9169a9bec304b4922a2e91c31b966c711d..6d7af7e8923219145e79a6b5673566634740023c 100644 +--- a/src/main/java/net/minecraft/commands/Commands.java ++++ b/src/main/java/net/minecraft/commands/Commands.java +@@ -263,6 +263,7 @@ public class Commands { + org.purpurmc.purpur.command.CompassCommand.register(this.dispatcher); // Purpur + org.purpurmc.purpur.command.RamBarCommand.register(this.dispatcher); // Purpur - Implement ram and rambar commands + org.purpurmc.purpur.command.RamCommand.register(this.dispatcher); // Purpur - Implement ram and rambar commands ++ org.plazmamc.plazma.commands.HealCommand.register(this.dispatcher); // Plazma - Add heal command + } + + if (environment.includeIntegrated) { +diff --git a/src/main/java/org/plazmamc/plazma/commands/HealCommand.java b/src/main/java/org/plazmamc/plazma/commands/HealCommand.java +new file mode 100644 +index 0000000000000000000000000000000000000000..2e9f1c95b5532eb020f5d1466c4f7aed8fc1b3d6 +--- /dev/null ++++ b/src/main/java/org/plazmamc/plazma/commands/HealCommand.java +@@ -0,0 +1,65 @@ ++package org.plazmamc.plazma.commands; ++ ++import com.mojang.brigadier.CommandDispatcher; ++import com.mojang.brigadier.exceptions.CommandSyntaxException; ++import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; ++import io.papermc.paper.adventure.PaperAdventure; ++import net.kyori.adventure.text.Component; ++import net.kyori.adventure.text.TextComponent; ++import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder; ++import net.minecraft.commands.CommandSourceStack; ++import net.minecraft.commands.arguments.EntityArgument; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.LivingEntity; ++import net.minecraft.world.entity.player.Player; ++import org.checkerframework.checker.nullness.qual.NonNull; ++import org.checkerframework.framework.qual.DefaultQualifier; ++import org.jetbrains.annotations.Contract; ++import org.plazmamc.plazma.configurations.GlobalConfiguration; ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.Collections; ++ ++import static net.kyori.adventure.text.minimessage.MiniMessage.miniMessage; ++ ++@DefaultQualifier(NonNull.class) ++public class HealCommand { ++ ++ public static void register(final CommandDispatcher dispatcher) { ++ dispatcher.register(net.minecraft.commands.Commands.literal("heal") ++ .requires(source -> source.hasPermission(2, "bukkit.command.heal")) ++ .executes(ctx -> execute(ctx.getSource(), Collections.singleton(ctx.getSource().getEntityOrException()))) ++ .then(net.minecraft.commands.Commands.argument("targets", EntityArgument.entities()) ++ .requires(source -> source.hasPermission(3, "bukkit.command.heal.others")) ++ .executes(ctx -> execute(ctx.getSource(), EntityArgument.getEntities(ctx, "targets"))) ++ ) ++ ); ++ } ++ ++ @Contract(pure = true) ++ private static int execute(final CommandSourceStack sender, Collection targets) throws CommandSyntaxException { ++ final ArrayList success = new ArrayList<>(); ++ ++ for (Entity target : targets) { ++ if (!(target instanceof LivingEntity entity)) continue; ++ if (entity.isDeadOrDying()) continue; ++ ++ entity.heal(entity.getMaxHealth()); ++ success.add(PaperAdventure.asAdventure(entity.getDisplayName())); ++ ++ if (!(entity instanceof Player player)) continue; ++ player.getFoodData().setFoodLevel(20); ++ player.getFoodData().setSaturation(5.0F); ++ } ++ ++ if (success.isEmpty()) { ++ throw new SimpleCommandExceptionType(PaperAdventure.asVanilla(miniMessage().deserialize(GlobalConfiguration.get().messages.heal.noTargets))).create(); ++ } ++ ++ final Component successJoined = success.stream().reduce((a, b) -> a.append(Component.text(", ").append(b))).orElseThrow(); ++ ++ sender.sendSuccess(miniMessage().deserialize(GlobalConfiguration.get().messages.heal.healed, Placeholder.component("targets", successJoined))); ++ return success.size(); ++ } ++ ++} +diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +index 898f9e6ec6f306a15639ee0d03bcfe7bf55e2c6c..02a164ff2c855864e246dcaaf8186274421edea7 100644 +--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java ++++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java +@@ -31,6 +31,13 @@ public class GlobalConfiguration extends ConfigurationPart { + public Messages messages; + public class Messages extends ConfigurationPart { + ++ public Heal heal; ++ public class Heal extends ConfigurationPart { ++ ++ public String healed = "Healed %s"; ++ public String noTargets = "No targets matched selector"; ++ ++ } + + } + diff --git a/patches/server/0065-Add-missing-argument-place-for-compass-command.patch b/patches/server/0065-Add-missing-argument-place-for-compass-command.patch new file mode 100644 index 000000000..5000ffa61 --- /dev/null +++ b/patches/server/0065-Add-missing-argument-place-for-compass-command.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AlphaKR93 +Date: Wed, 25 Dec 2024 19:10:40 +0900 +Subject: [PATCH] Add missing argument place for /compass command + + +diff --git a/src/main/java/org/purpurmc/purpur/command/CompassCommand.java b/src/main/java/org/purpurmc/purpur/command/CompassCommand.java +index 79b8490832d2a0cc7846ddcb091cb6bcac74ea45..bc4bdb86dc9a8f454058e0e9555e0af6f70d6b37 100644 +--- a/src/main/java/org/purpurmc/purpur/command/CompassCommand.java ++++ b/src/main/java/org/purpurmc/purpur/command/CompassCommand.java +@@ -22,6 +22,24 @@ public class CompassCommand { + } + return 1; + }) ++ // Plazma start - Add missing argument place for /compass command ++ .then(Commands.argument("targets", net.minecraft.commands.arguments.EntityArgument.players()) ++ .requires(listener -> listener.hasPermission(2, "bukkit.command.compass.other")) ++ .executes(context -> { ++ for (ServerPlayer player : net.minecraft.commands.arguments.EntityArgument.getPlayers(context, "targets")) { ++ CompassTask task = CompassTask.instance(); ++ if (player.compassBar()) { ++ task.removePlayer(player.getBukkitEntity()); ++ player.compassBar(false); ++ } else { ++ task.addPlayer(player.getBukkitEntity()); ++ player.compassBar(true); ++ } ++ } ++ return net.minecraft.commands.arguments.EntityArgument.getPlayers(context, "targets").size(); ++ }) ++ ) ++ // Plazma end - Add missing argument place for /compass command + ); + } + }