mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-19 15:09:27 +00:00
Update to Paper 1.21.3
This commit is contained in:
4
.github/workflows/auto-update.yml
vendored
4
.github/workflows/auto-update.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: 'SparklyPaper'
|
||||
ref: 'ver/1.21.1'
|
||||
ref: 'ver/1.21.3'
|
||||
token: ${{ secrets.LORITTA_PAT }}
|
||||
|
||||
- name: Checkout Paper Repository
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
with:
|
||||
path: 'Paper'
|
||||
repository: "PaperMC/Paper"
|
||||
ref: 'ver/1.21.1'
|
||||
ref: 'master'
|
||||
token: ${{ secrets.LORITTA_PAT }}
|
||||
|
||||
- name: Get Paper Latest Commit Hash
|
||||
|
||||
@@ -3,7 +3,7 @@ plugins {
|
||||
`maven-publish`
|
||||
|
||||
// In general, keep this version in sync with upstream. Sometimes a newer version than upstream might work, but an older version is extremely likely to break.
|
||||
id("io.papermc.paperweight.patcher") version "1.7.1"
|
||||
id("io.papermc.paperweight.patcher") version "1.7.5"
|
||||
}
|
||||
|
||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
group=net.sparklypower.sparklypaper
|
||||
version=1.21.1-R0.1-SNAPSHOT
|
||||
version=1.21.3-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion=1.21.1
|
||||
paperRef=b48403bd69f534ffd43fe2afb4e8e1f1ffa95fe1
|
||||
mcVersion=1.21.3
|
||||
paperRef=a63013cf48e46e2ec056c7ace60e018ec9be208e
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Thu, 23 Nov 2023 12:08:39 -0300
|
||||
Subject: [PATCH] Parallel world ticking
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
|
||||
index e81d0bc309de877ed2b5da6122f55c162e9b5f10..718cbe97a2bc0e415ffaaf0aaa174ac1fbe71b4f 100644
|
||||
--- a/src/main/java/co/aikar/timings/Timings.java
|
||||
+++ b/src/main/java/co/aikar/timings/Timings.java
|
||||
@@ -55,6 +55,7 @@ public final class Timings {
|
||||
private static int historyInterval = -1;
|
||||
private static int historyLength = -1;
|
||||
private static boolean warnedAboutDeprecationOnEnable;
|
||||
+ private static boolean warnedAboutParallelWorldTickingOnEnable; // SparklyPaper - parallel world ticking
|
||||
|
||||
private Timings() {}
|
||||
|
||||
@@ -145,6 +146,12 @@ public final class Timings {
|
||||
* @param enabled Should timings be reported
|
||||
*/
|
||||
public static void setTimingsEnabled(boolean enabled) {
|
||||
+ // SparklyPaper - parallel world ticking
|
||||
+ if (enabled) {
|
||||
+ warnAboutParallelWorldTickingOnEnable();
|
||||
+ return;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
timingsEnabled = enabled;
|
||||
warnAboutDeprecationOnEnable();
|
||||
reset();
|
||||
@@ -174,6 +181,34 @@ public final class Timings {
|
||||
.build();
|
||||
}
|
||||
|
||||
+ // SparklyPaper start - parallel world ticking
|
||||
+ private static void warnAboutParallelWorldTickingOnEnable() {
|
||||
+ if (!warnedAboutParallelWorldTickingOnEnable) {
|
||||
+ Bukkit.getLogger().warning(PlainTextComponentSerializer.plainText().serialize(parallelWorldTickingMessage()));
|
||||
+ warnedAboutParallelWorldTickingOnEnable = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static Component parallelWorldTickingMessage() {
|
||||
+ return Component.text()
|
||||
+ .color(TextColor.color(0xf3ef91))
|
||||
+ .append(Component.text("[!] The timings profiler attempted to be enabled, but was disabled because timings is not compatible with " + Bukkit.getName() + "'s Parallel World Ticking feature."))
|
||||
+ .append(Component.newline())
|
||||
+ .append(
|
||||
+ Component.text(" We recommend installing the spark profiler as a replacement: ")
|
||||
+ .append(
|
||||
+ Component.text()
|
||||
+ .content("https://spark.lucko.me/")
|
||||
+ .clickEvent(ClickEvent.openUrl("https://spark.lucko.me/")))
|
||||
+ )
|
||||
+ .append(Component.newline())
|
||||
+ .append(
|
||||
+ Component.text(" Or, if you really need timings, get a build without the Parallel World Ticking feature")
|
||||
+ )
|
||||
+ .build();
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
+
|
||||
/**
|
||||
* <p>Sets whether or not the Timings should monitor at Verbose level.</p>
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
index 5df19bd701c67506689fc7f49d91f99ebfbc83f0..b38edfa6eca2138ebeffe8647b7b5c6b3206d85a 100644
|
||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
||||
@@ -39,7 +39,7 @@ public class SimpleCommandMap implements CommandMap {
|
||||
register("bukkit", new VersionCommand("version"));
|
||||
register("bukkit", new ReloadCommand("reload"));
|
||||
//register("bukkit", new PluginsCommand("plugins")); // Paper
|
||||
- register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper
|
||||
+ // register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper // SparklyPaper - parallel world ticking
|
||||
}
|
||||
|
||||
public void setFallbackCommands() {
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] SPARKLYPOWER Add custom blocks
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
index be212b4fbeabab32a4dab6ae554768c368efaa88..fc885e551b1e8393569ec1391ee3decdce8d7efb 100644
|
||||
index 41eaa8159f8c028faa118300e95f6a0fb9cfe989..5b5ddb19b39d5201da422f9b10e2491ab9334925 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
||||
@@ -83,6 +83,7 @@ public class MaterialTags {
|
||||
@@ -33,10 +33,10 @@ index be212b4fbeabab32a4dab6ae554768c368efaa88..fc885e551b1e8393569ec1391ee3decd
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 77a15a99e441bd81650806142581bd5b24f30e10..d001e142857f2bd1db3c916587f79e872ec53687 100644
|
||||
index c7ce8fa1ff9feda66d5a4e497112a24ff51c9d2b..b121cf287460b9256eb6c26fae98d831b9bc7eea 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -3680,6 +3680,22 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
@@ -3843,6 +3843,22 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
BIG_DRIPLEAF_STEM(13167, Dripleaf.class),
|
||||
POTTED_AZALEA_BUSH(20430),
|
||||
POTTED_FLOWERING_AZALEA_BUSH(10609),
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] new fork who dis - Rebrand to SparklyPaper and Build Changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index de0474b8dce58cb419c00b7614d7dd66be832a02..a7482b87f8a015c6eb1cdf52f2b655632fa281d2 100644
|
||||
index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..144c7a15a51f0d22f3c35412fa7aa395d092bebc 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -3,6 +3,8 @@ import java.time.Instant
|
||||
@@ -17,8 +17,8 @@ index de0474b8dce58cb419c00b7614d7dd66be832a02..a7482b87f8a015c6eb1cdf52f2b65563
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
@@ -13,7 +15,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
val alsoShade: Configuration by configurations.creating
|
||||
@@ -25,7 +27,12 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||
// Paper end - configure mockito agent that is needed in newer java versions
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":paper-api"))
|
||||
@@ -29,9 +29,9 @@ index de0474b8dce58cb419c00b7614d7dd66be832a02..a7482b87f8a015c6eb1cdf52f2b65563
|
||||
+ implementation("com.charleskorn.kaml:kaml:0.55.0")
|
||||
+ // SparklyPaper end
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
@@ -80,7 +87,12 @@ tasks.jar {
|
||||
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
||||
@@ -94,7 +101,12 @@ tasks.jar {
|
||||
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
|
||||
val build = System.getenv("BUILD_NUMBER") ?: null
|
||||
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||
@@ -45,7 +45,7 @@ index de0474b8dce58cb419c00b7614d7dd66be832a02..a7482b87f8a015c6eb1cdf52f2b65563
|
||||
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
|
||||
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||
attributes(
|
||||
@@ -91,8 +103,8 @@ tasks.jar {
|
||||
@@ -105,8 +117,8 @@ tasks.jar {
|
||||
"Specification-Title" to "Paper",
|
||||
"Specification-Version" to project.version,
|
||||
"Specification-Vendor" to "Paper Team",
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] SparklyPaper config files
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index dd56c8e041116ef3602a9f89c998c8208ab89b51..b7c39d2e93abbc5f988271d738490de68ce50b3b 100644
|
||||
index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..bb8975cd3d3b1c57f313ad31b5e767fa93ad8e13 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -238,6 +238,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -235,6 +235,15 @@ 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
|
||||
@@ -25,19 +25,19 @@ index dd56c8e041116ef3602a9f89c998c8208ab89b51..b7c39d2e93abbc5f988271d738490de6
|
||||
|
||||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 507671476c3d2d92a2fdb05be24443af27d26dcf..350a703f9973c35f8e2af977b87fbfe19ac0b799 100644
|
||||
index 2cc264f577fdd81d02783e0d6146bea9728789c7..8433caa61a973d81a5eedc44428926e999c21a03 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -173,6 +173,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -174,6 +174,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 net.sparklypower.sparklypaper.configs.SparklyPaperConfig.SparklyPaperWorldConfig sparklyPaperConfig; // SparklyPaper
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
@@ -687,6 +688,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray
|
||||
private org.spigotmc.TickLimiter tileLimiter;
|
||||
@@ -842,6 +843,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
// 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.sparklyPaperConfig = net.sparklypower.sparklypaper.configs.SparklyPaperConfigUtils.INSTANCE.getWorldSettings(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // SparklyPaper
|
||||
@@ -116,7 +116,7 @@ index 0000000000000000000000000000000000000000..bc0ec96f91f7c9ab9f9a865a50f69707
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index c7df339aeb62ee627edaf1bb4c8474b61e357ba6..146f6c79ffbe45e016661d27cd1bf3cf78c92aea 100644
|
||||
index cac8592e3a2f438fe9ca167a4fdcd65152bbb2de..e6ee056e828d3ce410db000be160164d1a6f1dc4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -111,6 +111,7 @@ import net.minecraft.world.level.storage.PlayerDataStorage;
|
||||
@@ -127,15 +127,15 @@ index c7df339aeb62ee627edaf1bb4c8474b61e357ba6..146f6c79ffbe45e016661d27cd1bf3cf
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -1072,6 +1073,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1074,6 +1075,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
+ net.sparklypower.sparklypaper.configs.SparklyPaperConfigUtils.INSTANCE.init((File) console.options.valueOf("sparklypaper-settings")); // SparklyPaper
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -1087,6 +1089,7 @@ public final class CraftServer implements Server {
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -1089,6 +1091,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
@@ -143,7 +143,7 @@ index c7df339aeb62ee627edaf1bb4c8474b61e357ba6..146f6c79ffbe45e016661d27cd1bf3cf
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -1104,6 +1107,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1106,6 +1109,7 @@ public final class CraftServer implements Server {
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
this.spark.registerCommandBeforePlugins(this); // Paper - spark
|
||||
@@ -152,7 +152,7 @@ index c7df339aeb62ee627edaf1bb4c8474b61e357ba6..146f6c79ffbe45e016661d27cd1bf3cf
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index b3ba6bccdbb08af27916f0c611c60b2595b90164..bbd6e3b1bcec18e653313270136530ed82ea1448 100644
|
||||
index be0d38544395a9b3befb898bb961f34e32fe9509..522efbfaedb20fe3650c6ebe3c1678ee5c0f236a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -176,6 +176,14 @@ public class Main {
|
||||
|
||||
@@ -11,10 +11,10 @@ now is just updating dirty map/decoration data.
|
||||
When no bukkit renderers are added to the map, we also re-use the same packet for all players who are tracking it which avoids a lot of work.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 8ea2f24695f5dad55e21f238b69442513e7a90c6..e8781c8857d4b8b241515c811a4686feda437abb 100644
|
||||
index 90eb4927fa51ce3df86aa7b6c71f49150a03e337..9938d359de5b179ff486390288d481d6ece1ecf3 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -124,27 +124,40 @@ public class ServerEntity {
|
||||
@@ -128,27 +128,40 @@ public class ServerEntity {
|
||||
|
||||
Entity entity = this.entity;
|
||||
|
||||
@@ -60,7 +60,7 @@ index 8ea2f24695f5dad55e21f238b69442513e7a90c6..e8781c8857d4b8b241515c811a4686fe
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,6 +396,19 @@ public class ServerEntity {
|
||||
@@ -421,6 +434,19 @@ public class ServerEntity {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,12 +81,12 @@ index 8ea2f24695f5dad55e21f238b69442513e7a90c6..e8781c8857d4b8b241515c811a4686fe
|
||||
|
||||
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 5b7245cd99593ee90e17c97e0104f3aba9ae05ea..03432d084f8ed0cb7716d612b35f740943dcc4c0 100644
|
||||
index bbdaaa1cc0b4aed28bc39385508d221055b99d4d..7562147721fc8c6aa6c435f027a1757cf5b61818 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -419,6 +419,16 @@ public class ItemFrame extends HangingEntity {
|
||||
@@ -175,6 +175,16 @@ public class ItemFrame extends HangingEntity {
|
||||
this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()), false);
|
||||
}
|
||||
this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()));
|
||||
// Paper end - Add PlayerItemFrameChangeEvent
|
||||
+ // Paper start - add decoration and mark everything dirty for other players who are already tracking this frame
|
||||
+ final ItemStack item = this.getItem();
|
||||
@@ -98,14 +98,14 @@ index 5b7245cd99593ee90e17c97e0104f3aba9ae05ea..03432d084f8ed0cb7716d612b35f7409
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
this.gameEvent(GameEvent.BLOCK_CHANGE, player);
|
||||
itemstack.consume(1, player);
|
||||
}
|
||||
this.dropItem(world, source.getEntity(), false);
|
||||
this.gameEvent(GameEvent.BLOCK_CHANGE, source.getEntity());
|
||||
this.playSound(this.getRemoveItemSound(), 1.0F, 1.0F);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
index 6794466051dd4b725d579b2136c37844995a648e..95b2078d24c83e56760bc8be404df603a15b37c5 100644
|
||||
index ae321b3b8d98e42ef07fd1f0f738c1a2b428f6db..3515ce1e69b35cc8072b833e4f95632c7aa53bc1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
@@ -80,6 +80,16 @@ public class MapItemSavedData extends SavedData {
|
||||
@@ -81,6 +81,16 @@ public class MapItemSavedData extends SavedData {
|
||||
private final Map<String, MapFrame> frameMarkers = Maps.newHashMap();
|
||||
private int trackedDecorationCount;
|
||||
private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper
|
||||
@@ -122,7 +122,7 @@ index 6794466051dd4b725d579b2136c37844995a648e..95b2078d24c83e56760bc8be404df603
|
||||
|
||||
// CraftBukkit start
|
||||
public final CraftMapView mapView;
|
||||
@@ -351,7 +361,7 @@ public class MapItemSavedData extends SavedData {
|
||||
@@ -370,7 +380,7 @@ public class MapItemSavedData extends SavedData {
|
||||
--this.trackedDecorationCount;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ index 6794466051dd4b725d579b2136c37844995a648e..95b2078d24c83e56760bc8be404df603
|
||||
}
|
||||
|
||||
public static void addTargetDecoration(ItemStack stack, BlockPos pos, String id, Holder<MapDecorationType> decorationType) {
|
||||
@@ -433,6 +443,7 @@ public class MapItemSavedData extends SavedData {
|
||||
@@ -407,6 +417,7 @@ public class MapItemSavedData extends SavedData {
|
||||
}
|
||||
|
||||
this.setDecorationsDirty();
|
||||
@@ -139,7 +139,7 @@ index 6794466051dd4b725d579b2136c37844995a648e..95b2078d24c83e56760bc8be404df603
|
||||
}
|
||||
|
||||
}
|
||||
@@ -446,6 +457,20 @@ public class MapItemSavedData extends SavedData {
|
||||
@@ -478,6 +489,20 @@ public class MapItemSavedData extends SavedData {
|
||||
|
||||
public void setColorsDirty(int x, int z) {
|
||||
this.setDirty();
|
||||
@@ -160,15 +160,15 @@ index 6794466051dd4b725d579b2136c37844995a648e..95b2078d24c83e56760bc8be404df603
|
||||
Iterator iterator = this.carriedBy.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -528,6 +553,7 @@ public class MapItemSavedData extends SavedData {
|
||||
public void removedFromFrame(BlockPos pos, int id) {
|
||||
@@ -561,6 +586,7 @@ public class MapItemSavedData extends SavedData {
|
||||
this.removeDecoration(MapItemSavedData.getFrameKey(id));
|
||||
this.frameMarkers.remove(MapFrame.frameId(pos));
|
||||
this.setDirty();
|
||||
+ this.dirtyFrameDecorations = true; // Paper
|
||||
}
|
||||
|
||||
public boolean updateColor(int x, int z, byte color) {
|
||||
@@ -589,6 +615,93 @@ public class MapItemSavedData extends SavedData {
|
||||
@@ -622,6 +648,93 @@ public class MapItemSavedData extends SavedData {
|
||||
return "frame-" + id;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ The "distanceToSqr" call is a bit expensive, so avoiding it is pretty nice, arou
|
||||
We could also check if the x,y,z coordinates are equal, but for now, let's just keep the identity check, which also helps us since Minecraft's code does reuse the original delta movement Vec3 object
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index e8781c8857d4b8b241515c811a4686feda437abb..aafa06b3730fa3826941cbec7177b58fbd672040 100644
|
||||
index 9938d359de5b179ff486390288d481d6ece1ecf3..ff5bf212e194dd0914c06e636a8268e8e8f6fff8 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -229,6 +229,7 @@ public class ServerEntity {
|
||||
@@ -243,6 +243,7 @@ public class ServerEntity {
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
Vec3 vec3d1 = this.entity.getDeltaMovement();
|
||||
@@ -20,7 +20,7 @@ index e8781c8857d4b8b241515c811a4686feda437abb..aafa06b3730fa3826941cbec7177b58f
|
||||
double d0 = vec3d1.distanceToSqr(this.lastSentMovement);
|
||||
|
||||
if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
||||
@@ -243,6 +244,7 @@ public class ServerEntity {
|
||||
@@ -257,6 +258,7 @@ public class ServerEntity {
|
||||
this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ Optimizes "image in map" maps, without requiring the map to be locked, which som
|
||||
This has the disadvantage that the vanilla map data will never be updated while the CraftMapRenderer is not present, but that's not a huuuge problem for us
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
index ce461b1a8d7fab87ae28e30205f6fab67f1808b6..7891187eb974c3fb5ebe831ab01db6ab4c5be3bf 100644
|
||||
index 571f2540a1e9422025efe651167e26b44b437daa..70dd7d49807d8290b3a306550c2e1999c7e3553e 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
|
||||
@@ -276,7 +276,7 @@ public class MapItem extends ComplexItem {
|
||||
@@ -275,7 +275,7 @@ public class MapItem extends Item {
|
||||
mapItemSavedData.tickCarriedBy(player, stack);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,21 +73,21 @@ index c03608fec96b51e1867f43d8f42e5aefb1520e46..15b21fa3907db1b77ed5b5d1050a37f4
|
||||
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 696d075ca2883f3c37e35f983c4d020e5db89d16..1a7daaebdfd616e1417eb6aade727ca23fa77b18 100644
|
||||
index 663b4ecd520e82aa108d44f2d5c2a20cfc7bc01f..bca2e29e2e2bb4d79e6d3d0eef76a14fcde52022 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -322,7 +322,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile Thread shutdownThread; // Paper
|
||||
@@ -333,7 +333,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
private List<String> pluginsBlockingSleep = new ArrayList<>(); // Paper - API to allow/disallow tick sleeping
|
||||
-
|
||||
+ public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
+
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> { // Paper - rewrite chunk system
|
||||
@@ -1725,6 +1726,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
|
||||
@@ -1803,6 +1804,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
+ // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
||||
@@ -103,9 +103,9 @@ index 696d075ca2883f3c37e35f983c4d020e5db89d16..1a7daaebdfd616e1417eb6aade727ca2
|
||||
+ }
|
||||
+ /*
|
||||
getAllLevels().forEach(level -> {
|
||||
for (final Entity entity : level.moonrise$getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system
|
||||
for (final Entity entity : level.getEntities().getAll()) {
|
||||
if (entity.isRemoved()) {
|
||||
@@ -1736,6 +1749,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1814,6 +1827,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -113,12 +113,12 @@ index 696d075ca2883f3c37e35f983c4d020e5db89d16..1a7daaebdfd616e1417eb6aade727ca2
|
||||
+ // SparklyPaper end
|
||||
// Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
this.profiler.push("commandFunctions");
|
||||
gameprofilerfiller.push("commandFunctions");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 89c8713d2c2206d1b0d8c0a392c9d13b3e736f0c..0495941a51c1dafa796c7f08a77d34bc377d3774 100644
|
||||
index ddabaed899c755925ad8618b78c33dacaf2126ac..ae74ce4954cbe5004654f447e4c083196cc1be55 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -71,7 +71,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -72,7 +72,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftEntity.DATA_TYPE_REGISTRY);
|
||||
protected net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers
|
||||
// Paper start - Folia shedulers
|
||||
@@ -127,7 +127,7 @@ index 89c8713d2c2206d1b0d8c0a392c9d13b3e736f0c..0495941a51c1dafa796c7f08a77d34bc
|
||||
private final io.papermc.paper.threadedregions.scheduler.FoliaEntityScheduler apiScheduler = new io.papermc.paper.threadedregions.scheduler.FoliaEntityScheduler(this);
|
||||
|
||||
@Override
|
||||
@@ -84,6 +84,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -85,6 +85,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
this.server = server;
|
||||
this.entity = entity;
|
||||
this.entityType = CraftEntityType.minecraftToBukkit(entity.getType());
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Blazingly Simple Farm Checks
|
||||
|
||||
|
||||
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 112d2feba5f75a2a873b595617780515945c10e4..d19d6e0082c3dba2581aab4911cfe9d36dc22453 100644
|
||||
index 1ada5ed825501666addacf527a513ab7bd4a3a58..1ce3d73753b72a62272c3a9b8d7642bd4ffdf378 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
@@ -81,6 +81,57 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
|
||||
@@ -76,7 +76,7 @@ index 112d2feba5f75a2a873b595617780515945c10e4..d19d6e0082c3dba2581aab4911cfe9d3
|
||||
}
|
||||
|
||||
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 d59e33e7326489c6d55d316d0130f22235f4c63c..3a2c875f8131fc4a30807a69f426b6acb5deb557 100644
|
||||
index c3dba0c2c94f3804338f86621dc42405e380a6b3..bfa98fe6df8e61512d913f98710d369d18467fed 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -93,6 +93,19 @@ public class FarmBlock extends Block {
|
||||
@@ -99,7 +99,7 @@ index d59e33e7326489c6d55d316d0130f22235f4c63c..3a2c875f8131fc4a30807a69f426b6ac
|
||||
if (i > 0 && world.paperConfig().tickRates.wetFarmland != 1 && (world.paperConfig().tickRates.wetFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.wetFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
if (i == 0 && world.paperConfig().tickRates.dryFarmland != 1 && (world.paperConfig().tickRates.dryFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.dryFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
|
||||
@@ -151,7 +164,7 @@ public class FarmBlock extends Block {
|
||||
@@ -153,7 +166,7 @@ public class FarmBlock extends Block {
|
||||
return world.getBlockState(pos.above()).is(BlockTags.MAINTAINS_FARMLAND);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ index d59e33e7326489c6d55d316d0130f22235f4c63c..3a2c875f8131fc4a30807a69f426b6ac
|
||||
int xOff = pos.getX();
|
||||
int yOff = pos.getY();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/StemBlock.java b/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
index 924d80eb41d9a71d1e521c40742557251cf51832..e79ab379ac4ed5cde82a144a83c0326c8b3a6349 100644
|
||||
index 76109aceb24a4719d49c1a55e3621cf2a63bbe16..4b46fbb7a03de8f2616a398c6fa3794da60a1eea 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
@@ -73,6 +73,56 @@ public class StemBlock extends BushBlock implements BonemealableBlock {
|
||||
@@ -144,7 +144,7 @@ index 924d80eb41d9a71d1e521c40742557251cf51832..e79ab379ac4ed5cde82a144a83c0326c
|
||||
+ BlockState iblockdata1 = world.getBlockState(blockposition1.below());
|
||||
+
|
||||
+ if (world.getBlockState(blockposition1).isAir() && (iblockdata1.is(Blocks.FARMLAND) || iblockdata1.is(BlockTags.DIRT))) {
|
||||
+ Registry<Block> iregistry = world.registryAccess().registryOrThrow(Registries.BLOCK);
|
||||
+ Registry<Block> iregistry = world.registryAccess().get(Registries.BLOCK).get().value();
|
||||
+ Optional<Block> optional = iregistry.getOptional(this.fruit);
|
||||
+ Optional<Block> optional1 = iregistry.getOptional(this.attachedStem);
|
||||
+
|
||||
|
||||
@@ -10,12 +10,12 @@ Caches when Bat's spooky season starts and ends, and when Skeleton and Zombies h
|
||||
Avoids unnecessary date checks, even tho that this shouldn't really improve performance that much... unless you have a lot of bats/zombies/skeletons spawning.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 1a7daaebdfd616e1417eb6aade727ca23fa77b18..3ad7a0a6b698ed2ff040fe1015b59e897a173811 100644
|
||||
index bca2e29e2e2bb4d79e6d3d0eef76a14fcde52022..ae085afa4d532c13a02321407d9f5059e4a3e567 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -323,7 +323,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
@@ -334,7 +334,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
private List<String> pluginsBlockingSleep = new ArrayList<>(); // Paper - API to allow/disallow tick sleeping
|
||||
public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
-
|
||||
+ public net.sparklypower.sparklypaper.HalloweenManager halloweenManager = new net.sparklypower.sparklypaper.HalloweenManager(); // SparklyPaper - Spooky month optimizations
|
||||
@@ -24,10 +24,10 @@ index 1a7daaebdfd616e1417eb6aade727ca23fa77b18..3ad7a0a6b698ed2ff040fe1015b59e89
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
Thread thread = new ca.spottedleaf.moonrise.common.util.TickThread(() -> { // Paper - rewrite chunk system
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index b7c39d2e93abbc5f988271d738490de68ce50b3b..1395e8f98bd87a060fb609c65a3311c220f5e9a8 100644
|
||||
index bb8975cd3d3b1c57f313ad31b5e767fa93ad8e13..e49e8e98ebbd3c8ba8a784f1626132699209b4e3 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -247,6 +247,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -244,6 +244,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
}
|
||||
net.sparklypower.sparklypaper.SparklyPaperCommands.INSTANCE.registerCommands(this);
|
||||
// SparklyPaper end
|
||||
@@ -39,10 +39,10 @@ index b7c39d2e93abbc5f988271d738490de68ce50b3b..1395e8f98bd87a060fb609c65a3311c2
|
||||
|
||||
this.setPvpAllowed(dedicatedserverproperties.pvp);
|
||||
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 dc27ddf5131e7398a5390a5187261d4c7fb6ccaa..6c8664c9cf75a88007e43348059fad7e5c60f963 100644
|
||||
index 60c2868f255d372226e0c1389caaa5477bbef41e..64b601a5275374ae8038eaa63f2dddfbb09f593a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
@@ -229,7 +229,7 @@ public class Bat extends AmbientCreature {
|
||||
@@ -232,7 +232,7 @@ public class Bat extends AmbientCreature {
|
||||
int i = world.getMaxLocalRawBrightness(pos);
|
||||
byte b0 = 4;
|
||||
|
||||
@@ -51,7 +51,7 @@ index dc27ddf5131e7398a5390a5187261d4c7fb6ccaa..6c8664c9cf75a88007e43348059fad7e
|
||||
b0 = 7;
|
||||
} else if (random.nextBoolean()) {
|
||||
return false;
|
||||
@@ -239,6 +239,8 @@ public class Bat extends AmbientCreature {
|
||||
@@ -242,6 +242,8 @@ public class Bat extends AmbientCreature {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ index dc27ddf5131e7398a5390a5187261d4c7fb6ccaa..6c8664c9cf75a88007e43348059fad7e
|
||||
private static boolean isHalloween() {
|
||||
LocalDate localdate = LocalDate.now();
|
||||
int i = localdate.get(ChronoField.DAY_OF_MONTH);
|
||||
@@ -246,6 +248,7 @@ public class Bat extends AmbientCreature {
|
||||
@@ -249,6 +251,7 @@ public class Bat extends AmbientCreature {
|
||||
|
||||
return j == 10 && i >= 20 || j == 11 && i <= 3;
|
||||
}
|
||||
@@ -69,10 +69,10 @@ index dc27ddf5131e7398a5390a5187261d4c7fb6ccaa..6c8664c9cf75a88007e43348059fad7e
|
||||
private void setupAnimationStates() {
|
||||
if (this.isResting()) {
|
||||
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 3b5cf6ffb74d11bea5eb21bd66d679734ff5000c..97bdeb56fee6fb4ae924973730e34dbf933eef68 100644
|
||||
index 32670a3cb4b54b66d655197e3fde834d2b2b6d34..68818edaf2762c0610377814aa6cb065fe72d290 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
@@ -157,10 +157,12 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
@@ -159,10 +159,12 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
this.setCanPickUpLoot(this.level().paperConfig().entities.behavior.mobsCanAlwaysPickUpLoot.skeletons || randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper - Add world settings for mobs picking up loot
|
||||
if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
|
||||
LocalDate localdate = LocalDate.now();
|
||||
@@ -89,10 +89,10 @@ index 3b5cf6ffb74d11bea5eb21bd66d679734ff5000c..97bdeb56fee6fb4ae924973730e34dbf
|
||||
this.armorDropChances[EquipmentSlot.HEAD.getIndex()] = 0.0F;
|
||||
}
|
||||
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 2b43337ac63d051718a2074fcc46e128a1d65129..896e253f349b0cf21fda0d798aca8a70942c8f86 100644
|
||||
index a12461907278cfbfa3b1c0aa74b9f07a31768b8a..558f885fc0d9d1da54bcb9cfc65efb6ceba77fde 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -550,10 +550,11 @@ public class Zombie extends Monster {
|
||||
@@ -563,10 +563,11 @@ public class Zombie extends Monster {
|
||||
|
||||
if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
|
||||
LocalDate localdate = LocalDate.now();
|
||||
|
||||
@@ -14,10 +14,10 @@ This seems stupid, but it does seem that it improves the performance a bit, and
|
||||
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index af8cb316ac169aa8d98a88765b85bb013b9ba961..250f8ba3c77830ea0978fdeeb7748336ca150939 100644
|
||||
index 5b3a886c624b36557cbfaccdc3fb05a46a4ba36a..f0fbc31f5acd49fa233e92d595060cf0382d7522 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1258,7 +1258,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1295,7 +1295,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper end - Configurable entity tracking range by Y
|
||||
|
||||
// CraftBukkit start - respect vanish API
|
||||
@@ -27,10 +27,10 @@ index af8cb316ac169aa8d98a88765b85bb013b9ba961..250f8ba3c77830ea0978fdeeb7748336
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 42d7660efe5baa6f796f2a7606686c765b6f2478..d047114737164e12491223bc68a141efc1c389fe 100644
|
||||
index d0010dfd22463986bf3be9b3ee015ce92735753e..3a8ffed79f1db9b2e2b3306bf7e456102787b492 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -200,7 +200,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -205,7 +205,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
private boolean hasPlayedBefore = false;
|
||||
private final ConversationTracker conversationTracker = new ConversationTracker();
|
||||
private final Set<String> channels = new HashSet<String>();
|
||||
@@ -39,7 +39,7 @@ index 42d7660efe5baa6f796f2a7606686c765b6f2478..d047114737164e12491223bc68a141ef
|
||||
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
||||
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
|
||||
private int hash = 0;
|
||||
@@ -2252,9 +2252,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2262,9 +2262,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Revert "Fix MC-117075: Block entity unload lag spike"
|
||||
This reverts commit f3453b204569ea865cc1d1302edb6d125e7f0cb3.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index e086114c3d4b1d8ed46eec98e4b66cfc21451139..2d44c17a63b12df0e3c5b39cb9a80924470a8428 100644
|
||||
index 8433caa61a973d81a5eedc44428926e999c21a03..db9eb10c33848ca5b342bf00e4a05738210d26b0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1387,8 +1387,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1458,8 +1458,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
int tickedEntities = 0; // Paper - rewrite chunk system
|
||||
|
||||
int tilesThisCycle = 0;
|
||||
@@ -18,7 +18,7 @@ index e086114c3d4b1d8ed46eec98e4b66cfc21451139..2d44c17a63b12df0e3c5b39cb9a80924
|
||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
|
||||
@@ -1397,7 +1395,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1468,7 +1466,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
if (tickingblockentity.isRemoved()) {
|
||||
// Spigot start
|
||||
tilesThisCycle--;
|
||||
@@ -27,11 +27,11 @@ index e086114c3d4b1d8ed46eec98e4b66cfc21451139..2d44c17a63b12df0e3c5b39cb9a80924
|
||||
// Spigot end
|
||||
} else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
tickingblockentity.tick();
|
||||
@@ -1408,7 +1406,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1479,7 +1477,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
}
|
||||
- this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||
|
||||
this.timings.tileEntityTick.stopTiming(); // Spigot
|
||||
this.tickingBlockEntities = false;
|
||||
gameprofilerfiller.pop();
|
||||
|
||||
@@ -8,10 +8,10 @@ We replaced the `blockEntityTickers` list with a custom list based on fastutil's
|
||||
This is WAY FASTER than using `removeAll` with a list of entries to be removed, because we don't need to calculate the identity of each block entity to be removed, and we can jump directly to where the search should begin, giving a performance boost for small removals (because we don't need to loop thru the entire list to find what element should be removed) and a performance boost for big removals (no need to calculate the identity of each block entity).
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 2d44c17a63b12df0e3c5b39cb9a80924470a8428..32b782bab750351caddafe6d6327e406bb26fb93 100644
|
||||
index db9eb10c33848ca5b342bf00e4a05738210d26b0..1e20c525cd0c75079fe971ae830120c69fee362e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -116,7 +116,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -118,7 +118,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public static final int TICKS_PER_DAY = 24000;
|
||||
public static final int MAX_ENTITY_SPAWN_Y = 20000000;
|
||||
public static final int MIN_ENTITY_SPAWN_Y = -20000000;
|
||||
@@ -20,7 +20,7 @@ index 2d44c17a63b12df0e3c5b39cb9a80924470a8428..32b782bab750351caddafe6d6327e406
|
||||
protected final NeighborUpdater neighborUpdater;
|
||||
private final List<TickingBlockEntity> pendingBlockEntityTickers = Lists.newArrayList();
|
||||
private boolean tickingBlockEntities;
|
||||
@@ -1395,7 +1395,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1466,7 +1466,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
if (tickingblockentity.isRemoved()) {
|
||||
// Spigot start
|
||||
tilesThisCycle--;
|
||||
@@ -29,15 +29,15 @@ index 2d44c17a63b12df0e3c5b39cb9a80924470a8428..32b782bab750351caddafe6d6327e406
|
||||
// Spigot end
|
||||
} else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
tickingblockentity.tick();
|
||||
@@ -1406,7 +1406,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1477,7 +1477,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
}
|
||||
-
|
||||
+ this.blockEntityTickers.removeMarkedEntries(); // SparklyPaper - optimize block entity removals
|
||||
this.timings.tileEntityTick.stopTiming(); // Spigot
|
||||
this.tickingBlockEntities = false;
|
||||
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
|
||||
gameprofilerfiller.pop();
|
||||
this.spigotConfig.currentPrimedTnt = 0; // Spigot
|
||||
diff --git a/src/main/java/net/sparklypower/sparklypaper/BlockEntityTickersList.java b/src/main/java/net/sparklypower/sparklypaper/BlockEntityTickersList.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7affec7e343c39a83390ae13ce23f3bfa0db1eb6
|
||||
|
||||
@@ -12,10 +12,10 @@ But here's the thing: We don't care if we have a small performance penalty if th
|
||||
And finally, we also cache the chunk's coordinate key when creating the block entity, which is actually "free" because we just reuse the already cached chunk coordinate key from the chunk!
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 32b782bab750351caddafe6d6327e406bb26fb93..38d73f50360685a573740e811f186d7fa582003c 100644
|
||||
index 1e20c525cd0c75079fe971ae830120c69fee362e..97b31dffbaf965e86ad706a1bba7586cd3514ead 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1387,6 +1387,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1458,6 +1458,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
int tickedEntities = 0; // Paper - rewrite chunk system
|
||||
|
||||
int tilesThisCycle = 0;
|
||||
@@ -26,7 +26,7 @@ index 32b782bab750351caddafe6d6327e406bb26fb93..38d73f50360685a573740e811f186d7f
|
||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
|
||||
@@ -1397,13 +1401,25 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1468,13 +1472,25 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
tilesThisCycle--;
|
||||
this.blockEntityTickers.markAsRemoved(this.tileTickPosition); // this.blockEntityTickers.remove(this.tileTickPosition--); // SparklyPaper - optimize block entity removals
|
||||
// Spigot end
|
||||
@@ -65,10 +65,10 @@ index 28e3b73507b988f7234cbf29c4024c88180d0aef..427cf73383155c52bca8fb4b32f43029
|
||||
+ long getChunkCoordinateKey(); // SparklyPaper - optimize tickBlockEntities
|
||||
}
|
||||
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 7c11853c5090fbc4fa5b3e73a69acf166158fdec..d7fe57e9a5aa59a7a9d611bcaa6152e72ec4c300 100644
|
||||
index 4640baec5bed6c2d53cc0f8ca1d273cc115abe9b..b4c16fe7c9215b5610b7e7488c29b497b5357ecc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -74,6 +74,13 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -75,6 +75,13 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
public String getType() {
|
||||
return "<null>";
|
||||
}
|
||||
@@ -82,7 +82,7 @@ index 7c11853c5090fbc4fa5b3e73a69acf166158fdec..d7fe57e9a5aa59a7a9d611bcaa6152e7
|
||||
};
|
||||
private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel;
|
||||
public boolean loaded;
|
||||
@@ -952,7 +959,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -981,7 +988,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
}
|
||||
|
||||
private <T extends BlockEntity> TickingBlockEntity createTicker(T blockEntity, BlockEntityTicker<T> blockEntityTicker) {
|
||||
@@ -91,7 +91,7 @@ index 7c11853c5090fbc4fa5b3e73a69acf166158fdec..d7fe57e9a5aa59a7a9d611bcaa6152e7
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
@@ -1003,6 +1010,13 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1038,6 +1045,13 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
public String toString() {
|
||||
return String.valueOf(this.ticker) + " <wrapped>";
|
||||
}
|
||||
@@ -105,7 +105,7 @@ index 7c11853c5090fbc4fa5b3e73a69acf166158fdec..d7fe57e9a5aa59a7a9d611bcaa6152e7
|
||||
}
|
||||
|
||||
private class BoundTickingBlockEntity<T extends BlockEntity> implements TickingBlockEntity {
|
||||
@@ -1010,10 +1024,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1045,10 +1059,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
private final T blockEntity;
|
||||
private final BlockEntityTicker<T> ticker;
|
||||
private boolean loggedInvalidBlockState;
|
||||
@@ -119,7 +119,7 @@ index 7c11853c5090fbc4fa5b3e73a69acf166158fdec..d7fe57e9a5aa59a7a9d611bcaa6152e7
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1081,5 +1097,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1112,5 +1128,12 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
return "Level ticker for " + s + "@" + String.valueOf(this.getPos());
|
||||
}
|
||||
|
||||
@@ -56,13 +56,13 @@ index 8b5293b0c696ef21d0101493ffa41b60bf0bc86b..601198a33adb29316b0617d5390d1620
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3ad7a0a6b698ed2ff040fe1015b59e897a173811..f91374c44c392f9d28799fbf3538f99258d727b4 100644
|
||||
index ae085afa4d532c13a02321407d9f5059e4a3e567..712ca8371188fceb99e1e3a898e5f8067e5a8a5a 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1817,7 +1817,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1888,7 +1888,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
gameprofilerfiller.push("tick");
|
||||
|
||||
try {
|
||||
worldserver.timings.doTick.startTiming(); // Spigot
|
||||
+ long i = Util.getNanos(); // SparklyPaper - track world's MSPT
|
||||
worldserver.tick(shouldKeepTicking);
|
||||
+ // SparklyPaper start - track world's MSPT
|
||||
@@ -73,14 +73,14 @@ index 3ad7a0a6b698ed2ff040fe1015b59e897a173811..f91374c44c392f9d28799fbf3538f992
|
||||
+ worldserver.tickTimes10s.add(this.tickCount, j);
|
||||
+ worldserver.tickTimes60s.add(this.tickCount, j);
|
||||
+ // SparklyPaper end
|
||||
worldserver.timings.doTick.stopTiming(); // Spigot
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index f9abf63e12ea930275121b470e4e4906cff0fc12..7d3d46d693a0d0dd1c1932c29b18e98555d4e3da 100644
|
||||
index 957cae6ddeba9efe3b55588567ae51e8b86b6a42..be488eb582f15996921eab5d63bcc73655e61a0b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -497,6 +497,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -595,6 +595,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
// Paper end - lag compensation
|
||||
|
||||
@@ -92,4 +92,4 @@ index f9abf63e12ea930275121b470e4e4906cff0fc12..7d3d46d693a0d0dd1c1932c29b18e985
|
||||
+
|
||||
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
|
||||
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
|
||||
// IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error
|
||||
super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Helpful NMS packet changes
|
||||
Some nice changes to the packet internals to make packet sending and manipulation easier for us to avoid Reflection and JVM internals (ooo theUnsafe spooky) usage
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java
|
||||
index 792b9a72a610cc512a8920d61013b6ba02f71e47..6e273098d9f2c0a78e9e98d7bbd8ed4c8de4ebc1 100644
|
||||
index f66e40326c510aa3267542b1a24ed75d1ed6d3f1..797640c4f26abb32a480a611820bbcd72e43d1ac 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundAddEntityPacket.java
|
||||
@@ -22,7 +22,7 @@ public class ClientboundAddEntityPacket implements Packet<ClientGamePacketListen
|
||||
@@ -19,7 +19,7 @@ index 792b9a72a610cc512a8920d61013b6ba02f71e47..6e273098d9f2c0a78e9e98d7bbd8ed4c
|
||||
private final double y;
|
||||
private final double z;
|
||||
@@ -180,6 +180,32 @@ public class ClientboundAddEntityPacket implements Packet<ClientGamePacketListen
|
||||
return (float)(this.yHeadRot * 360) / 256.0F;
|
||||
return Mth.unpackDegrees(this.yHeadRot);
|
||||
}
|
||||
|
||||
+ // SparklyPaper - Helpful NMS packet changes: expose raw rotational fields
|
||||
@@ -78,10 +78,10 @@ index 0a8d07bf68b0ceabd13c70196d357fce79dcc2c3..0b5abaf11508fa6c6809b73f53d6854a
|
||||
// Paper start - Handle oversized block entities in chunks
|
||||
private final java.util.List<net.minecraft.network.protocol.Packet<?>> extraPackets = new java.util.ArrayList<>();
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java
|
||||
index 9a18277754fc1657e862b2ff4c077a54a4e24977..81bce96598dcfcc919e435ce47b9dc9c195c32fa 100644
|
||||
index ab44c24ce5f4570dee9d84b4216299bedfa800d8..99fbb958b82a3398564febb1e87e3ef4efca5b1a 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundRotateHeadPacket.java
|
||||
@@ -19,6 +19,13 @@ public class ClientboundRotateHeadPacket implements Packet<ClientGamePacketListe
|
||||
@@ -20,6 +20,13 @@ public class ClientboundRotateHeadPacket implements Packet<ClientGamePacketListe
|
||||
this.yHeadRot = headYaw;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerBlockDestroySpeedEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index d0109633e8bdf109cfc9178963d7b6cf92f8b189..b70feb1f18d13207c16cb71c9715c0cf1847227d 100644
|
||||
index 99fd67a78539133adf78d65e2c520ff3dd260301..96640ae707c9babe1c4f4895f39d4d7cfc71a765 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -339,6 +339,14 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -336,6 +336,14 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
protected float getDestroyProgress(BlockState state, Player player, BlockGetter world, BlockPos pos) {
|
||||
float f = state.getDestroySpeed(world, pos);
|
||||
|
||||
@@ -24,10 +24,10 @@ index d0109633e8bdf109cfc9178963d7b6cf92f8b189..b70feb1f18d13207c16cb71c9715c0cf
|
||||
return 0.0F;
|
||||
} else {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 77ef27f9254235180a8596c6c8c4af750dc759d1..44bec90466967933b5322a8ca8b5e86e0c96d443 100644
|
||||
index e37aaf77f94b97b736cc20ef070cefdff0400188..a46f0c810ee2b9679c0530e5e6d3505b3d1f661c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2267,4 +2267,13 @@ public class CraftEventFactory {
|
||||
@@ -2271,4 +2271,13 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
// Paper end - add EntityFertilizeEggEvent
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Add CraftItemRecipeEvent
|
||||
Used when a player OR a crafter block crafts an item, as an alternative to PrepareItemCraftEvent and CraftItemEvent, because both events are not triggered when a item is crafted from a crafter
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index befeaac4786760f6847a5945da2296a3e68dbb17..d918f1fc104795be2a04c1f57265d27e20e9df09 100644
|
||||
index b5d5dbc50a7b8c40739a15f164ffd08fdc534f9c..01a67fde6c823cac52a6b09720f09acc825d3f86 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -3192,6 +3192,21 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -3218,6 +3218,21 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
} else {
|
||||
event = new CraftItemEvent(recipe, inventory, type, packet.getSlotNum(), click, action);
|
||||
}
|
||||
@@ -32,10 +32,10 @@ index befeaac4786760f6847a5945da2296a3e68dbb17..d918f1fc104795be2a04c1f57265d27e
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
|
||||
index deb5b4fab94618c08a51e432c33e49b1627bd717..703fbeafc78889cbfea292847678207d9d8c5cab 100644
|
||||
index 0e609b1e3abd50b415d8376dc550375a8a0251b6..8dbac20e32b70879eeee1c3563948e36c2eae342 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
|
||||
@@ -202,6 +202,13 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||
@@ -203,6 +203,13 @@ public class CrafterBlock extends BaseEntityBlock {
|
||||
}
|
||||
itemstack = CraftItemStack.asNMSCopy(event.getResult());
|
||||
// CraftBukkit end
|
||||
@@ -50,10 +50,10 @@ index deb5b4fab94618c08a51e432c33e49b1627bd717..703fbeafc78889cbfea292847678207d
|
||||
world.levelEvent(1050, pos, 0);
|
||||
} else {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index b2760b9a66c1bcb848d43582c3a913c6fb43102b..beddb6a64e0ba5112d369794a066ca6b9f2ac303 100644
|
||||
index a46f0c810ee2b9679c0530e5e6d3505b3d1f661c..85926a55066ac793b2e4cfe3502f9ab201df91a3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1467,6 +1467,24 @@ public class CraftEventFactory {
|
||||
@@ -1471,6 +1471,24 @@ public class CraftEventFactory {
|
||||
Bukkit.getPluginManager().callEvent(crafterCraftEvent);
|
||||
return crafterCraftEvent;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow item version downgrades
|
||||
The server WON'T convert the item data from a newer version to an older version, so proceed with caution
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index d06aab9bd5cd901c8367f9680f5d27ddb17b3dc4..52fd5fdbba10f7b1bb5f77e84f1c50d558de037d 100644
|
||||
index 507f908916cbeb592496f963b46e4c2121a7b5e3..d9361a5bb576da7f9ea47236620746f21119ab4d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -75,6 +75,7 @@ import org.bukkit.potion.PotionType;
|
||||
@@ -76,6 +76,7 @@ import org.bukkit.potion.PotionType;
|
||||
public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public static final CraftMagicNumbers INSTANCE = new CraftMagicNumbers();
|
||||
public static final boolean DISABLE_OLD_API_SUPPORT = Boolean.getBoolean("paper.disableOldApiSupport"); // Paper
|
||||
@@ -17,7 +17,7 @@ index d06aab9bd5cd901c8367f9680f5d27ddb17b3dc4..52fd5fdbba10f7b1bb5f77e84f1c50d5
|
||||
|
||||
private final Commodore commodore = new Commodore();
|
||||
|
||||
@@ -242,7 +243,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -237,7 +238,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@Override
|
||||
public Material getMaterial(String material, int version) {
|
||||
Preconditions.checkArgument(material != null, "material == null");
|
||||
@@ -26,7 +26,7 @@ index d06aab9bd5cd901c8367f9680f5d27ddb17b3dc4..52fd5fdbba10f7b1bb5f77e84f1c50d5
|
||||
|
||||
// Fastpath up to date materials
|
||||
if (version == this.getDataVersion()) {
|
||||
@@ -594,7 +595,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -610,7 +611,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
int dataVersion = compound.getInt("DataVersion");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,83 +5,78 @@ Subject: [PATCH] SPARKLYPOWER Add custom blocks
|
||||
|
||||
|
||||
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 223259e7a09ada681b6181c898f6857888594f85..ad5ad428b72f696a68a9ed1436bede7135c534e5 100644
|
||||
index 66a07f7cbf1c1d6ecbe055cbf4f63eb07d93e90c..2738ccd47cbb7d26a6c92c2d86b1735003df9e2e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
@@ -41,9 +41,9 @@ import net.minecraft.world.level.material.PushReaction;
|
||||
|
||||
public class Blocks {
|
||||
private static final BlockBehaviour.StatePredicate NOT_CLOSED_SHULKER = (state, world, pos) -> !(
|
||||
- world.getBlockEntity(pos) instanceof ShulkerBoxBlockEntity shulkerBoxBlockEntity
|
||||
- )
|
||||
- || shulkerBoxBlockEntity.isClosed();
|
||||
+ world.getBlockEntity(pos) instanceof ShulkerBoxBlockEntity shulkerBoxBlockEntity
|
||||
+ )
|
||||
+ || shulkerBoxBlockEntity.isClosed();
|
||||
public static final Block AIR = register("air", new AirBlock(BlockBehaviour.Properties.of().replaceable().noCollission().noLootTable().air()));
|
||||
public static final Block STONE = register(
|
||||
"stone",
|
||||
@@ -7623,6 +7623,48 @@ public class Blocks {
|
||||
.explosionResistance(1200.0F)
|
||||
)
|
||||
@@ -6725,10 +6725,55 @@ public class Blocks {
|
||||
.pushReaction(PushReaction.DESTROY)
|
||||
.requiredFeatures(FeatureFlags.WINTER_DROP)
|
||||
);
|
||||
+ // SparklyPaper start - SparklyPower Survival custom blocks
|
||||
+ // Blocks' strength should be synced with the replaced block on the client side!
|
||||
+ public static final Block SPARKLYPOWER_RAINBOW_WOOL = register(
|
||||
+ "sparklypower_rainbow_wool", new Block(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS))
|
||||
+ "sparklypower_rainbow_wool",
|
||||
+ Block::new,
|
||||
+ BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS)
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_RAINBOW_CONCRETE = register(
|
||||
+ "sparklypower_rainbow_concrete", new Block(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS))
|
||||
+ "sparklypower_rainbow_concrete",
|
||||
+ Block::new,
|
||||
+ BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS)
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_RAINBOW_TERRACOTTA = register(
|
||||
+ "sparklypower_rainbow_terracotta", new Block(BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS))
|
||||
+ "sparklypower_rainbow_terracotta",
|
||||
+ Block::new,
|
||||
+ BlockBehaviour.Properties.of().mapColor(MapColor.TERRACOTTA_RED).strength(0.5F).sound(SoundType.GRASS)
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_ASPHALT_SERVER = register(
|
||||
+ "sparklypower_asphalt_server", new Block(
|
||||
+ "sparklypower_asphalt_server",
|
||||
+ Block::new,
|
||||
+ BlockBehaviour.Properties.of()
|
||||
+ .mapColor(MapColor.COLOR_BLACK)
|
||||
+ .instrument(NoteBlockInstrument.BASEDRUM)
|
||||
+ .requiresCorrectToolForDrops()
|
||||
+ .strength(1.5F, 6.0F)
|
||||
+ )
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_ASPHALT_SERVER_SLAB = register(
|
||||
+ "sparklypower_asphalt_server_slab",
|
||||
+ new SlabBlock(
|
||||
+ SlabBlock::new,
|
||||
+ BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLACK).instrument(NoteBlockInstrument.BASEDRUM).requiresCorrectToolForDrops().strength(2.0F, 6.0F)
|
||||
+ )
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_ASPHALT_PLAYER = register(
|
||||
+ "sparklypower_asphalt_player", new Block(
|
||||
+ "sparklypower_asphalt_player",
|
||||
+ Block::new,
|
||||
+ BlockBehaviour.Properties.of()
|
||||
+ .mapColor(MapColor.COLOR_BLACK)
|
||||
+ .instrument(NoteBlockInstrument.BASEDRUM)
|
||||
+ .requiresCorrectToolForDrops()
|
||||
+ .strength(1.5F, 6.0F)
|
||||
+ )
|
||||
+ );
|
||||
+ public static final Block SPARKLYPOWER_ASPHALT_PLAYER_SLAB = register(
|
||||
+ "sparklypower_asphalt_player_slab",
|
||||
+ new SlabBlock(
|
||||
+ SlabBlock::new,
|
||||
+ BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLACK).instrument(NoteBlockInstrument.BASEDRUM).requiresCorrectToolForDrops().strength(2.0F, 6.0F)
|
||||
+ )
|
||||
+ );
|
||||
+ // SparklyPaper end
|
||||
|
||||
private static ToIntFunction<BlockState> litBlockEmission(int litLevel) {
|
||||
return state -> state.getValue(BlockStateProperties.LIT) ? litLevel : 0;
|
||||
- return state -> state.getValue(BlockStateProperties.LIT) ? litLevel : 0;
|
||||
- }
|
||||
+ return state -> state.getValue(BlockStateProperties.LIT) ? litLevel : 0; }
|
||||
|
||||
private static Function<BlockState, MapColor> waterloggedMapColor(MapColor mapColor) {
|
||||
return state -> state.getValue(BlockStateProperties.WATERLOGGED) ? MapColor.WATER : mapColor;
|
||||
diff --git a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java
|
||||
index b441eac617347131f2c58ae5092428eb0538c839..cb5d89b0fb8d9a579438387d5d317d662d0f1e0c 100644
|
||||
index 91926be355af20bba86be4c569cf7f972c79fbb5..26aa9cf0288055d5c8d9165ddc2ad3707b950ea4 100644
|
||||
--- a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java
|
||||
+++ b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java
|
||||
@@ -126,7 +126,9 @@ public class LegacyTest {
|
||||
Material.FLOW_ARMOR_TRIM_SMITHING_TEMPLATE, Material.BOLT_ARMOR_TRIM_SMITHING_TEMPLATE, Material.FLOW_POTTERY_SHERD, Material.GUSTER_POTTERY_SHERD, Material.SCRAPE_POTTERY_SHERD, Material.BREEZE_ROD, Material.OMINOUS_TRIAL_KEY, Material.OMINOUS_BOTTLE,
|
||||
// 1.21
|
||||
Material.MUSIC_DISC_CREATOR, Material.MUSIC_DISC_CREATOR_MUSIC_BOX, Material.MUSIC_DISC_PRECIPICE,
|
||||
- //
|
||||
+ // SparklyPaper start - custom blocks
|
||||
+ Material.SPARKLYPOWER_RAINBOW_WOOL, Material.SPARKLYPOWER_RAINBOW_CONCRETE, Material.SPARKLYPOWER_RAINBOW_TERRACOTTA, Material.SPARKLYPOWER_ASPHALT_SERVER, Material.SPARKLYPOWER_ASPHALT_SERVER_SLAB, Material.SPARKLYPOWER_ASPHALT_PLAYER, Material.SPARKLYPOWER_ASPHALT_PLAYER_SLAB,
|
||||
+ // SparklyPaper end
|
||||
@@ -132,6 +132,9 @@ public class LegacyTest {
|
||||
Material.CREAKING_SPAWN_EGG, Material.PALE_HANGING_MOSS, Material.PALE_MOSS_BLOCK, Material.PALE_MOSS_CARPET, Material.PALE_OAK_BOAT, Material.PALE_OAK_BUTTON, Material.PALE_OAK_CHEST_BOAT, Material.PALE_OAK_DOOR, Material.PALE_OAK_FENCE,
|
||||
Material.PALE_OAK_FENCE_GATE, Material.PALE_OAK_HANGING_SIGN, Material.PALE_OAK_LEAVES, Material.PALE_OAK_LOG, Material.PALE_OAK_PLANKS, Material.PALE_OAK_PRESSURE_PLATE, Material.PALE_OAK_SAPLING, Material.PALE_OAK_SIGN, Material.PALE_OAK_SLAB,
|
||||
Material.PALE_OAK_STAIRS, Material.PALE_OAK_TRAPDOOR, Material.PALE_OAK_WALL_SIGN, Material.PALE_OAK_WALL_HANGING_SIGN, Material.PALE_OAK_WOOD, Material.POTTED_PALE_OAK_SAPLING, Material.STRIPPED_PALE_OAK_LOG, Material.STRIPPED_PALE_OAK_WOOD,
|
||||
+ // SparklyPower custom blocks
|
||||
+ Material.SPARKLYPOWER_RAINBOW_WOOL, Material.SPARKLYPOWER_RAINBOW_CONCRETE, Material.SPARKLYPOWER_RAINBOW_TERRACOTTA, Material.SPARKLYPOWER_ASPHALT_PLAYER, Material.SPARKLYPOWER_ASPHALT_SERVER, Material.SPARKLYPOWER_ASPHALT_PLAYER_SLAB,
|
||||
+ Material.SPARKLYPOWER_ASPHALT_SERVER_SLAB,
|
||||
//
|
||||
Material.LEGACY_AIR, Material.LEGACY_DEAD_BUSH, Material.LEGACY_BURNING_FURNACE, Material.LEGACY_WALL_SIGN, Material.LEGACY_REDSTONE_TORCH_OFF, Material.LEGACY_SKULL, Material.LEGACY_REDSTONE_COMPARATOR_ON, Material.LEGACY_WALL_BANNER, Material.LEGACY_MONSTER_EGG));
|
||||
|
||||
private final Set<Material> INVERSION_FAILS = new HashSet<>(Arrays.asList(Material.LEGACY_DOUBLE_STEP, Material.LEGACY_GLOWING_REDSTONE_ORE, Material.LEGACY_DIODE_BLOCK_ON, Material.LEGACY_REDSTONE_LAMP_ON, Material.LEGACY_WOOD_DOUBLE_STEP,
|
||||
|
||||
Reference in New Issue
Block a user