Skip to content

Commit

Permalink
Update to Minecraft 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Dec 9, 2023
1 parent d9d7969 commit 6989f76
Show file tree
Hide file tree
Showing 18 changed files with 284 additions and 310 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<h1 align="center">✨ SparklyPaper ✨</h1>
</p>

![Minecraft Version](https://badgen.now.sh/badge/minecraft%20version/1.20.4/blue) ![Blazing Fast](https://badgen.now.sh/badge/speed/blazing%20%F0%9F%94%A5/green)

SparklyPower's Paper fork, making large servers snappier with high-performance optimizations and improvements! Focused on performance improvements for Survival servers with high player counts.

Our fork has handmade patches to add and optimize some of the things that we have in our server, with some cherry-picked patches from other forks.
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id("com.github.johnrengelman.shadow") version "8.1.1" apply false

// 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.5.7"
id("io.papermc.paperweight.patcher") version "1.5.11"
}

val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
Expand All @@ -19,7 +19,7 @@ repositories {
}

dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.6:fat") // Must be kept in sync with upstream
remapper("net.fabricmc:tiny-remapper:0.8.10:fat") // Must be kept in sync with upstream
decompiler("net.minecraftforge:forgeflower:2.0.627.2") // Must be kept in sync with upstream
paperclip("io.papermc:paperclip:3.0.3") // You probably want this to be kept in sync with upstream
}
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
group=net.sparklypower.sparklypaper
version=1.20.2-R0.1-SNAPSHOT
version=1.20.4-R0.1-SNAPSHOT

mcVersion=1.20.2
paperRef=ffa41152390b121b919454b64f99097f356b25bf
mcVersion=1.20.4
paperRef=b42a1da8737895f4fcacfae9b4d49a96b1445972

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 79beac737c17412913983614bd478d33e3c6ed58..5812c7056d11be2cc966728de6b07cd903e8d320 100644
index 170a915098f09ace226648da342a04c5c7583d11..5c2c47b6e01c65ade4da9df65e8a799fb2654989 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -3,6 +3,8 @@ import io.papermc.paperweight.util.*
Expand All @@ -17,16 +17,16 @@ index 79beac737c17412913983614bd478d33e3c6ed58..5812c7056d11be2cc966728de6b07cd9
id("com.github.johnrengelman.shadow")
}

@@ -13,8 +15,15 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
val alsoShade: Configuration by configurations.creating
@@ -27,8 +29,15 @@ repositories {

dependencies {
extraRuntime(platform("net.kyori:adventure-bom:4.15.0-SNAPSHOT"))
- implementation(project(":paper-api"))
- implementation(project(":paper-mojangapi"))
+ // SparklyPaper start
+ implementation(project(":sparklypaper-api"))
+ implementation(kotlin("reflect"))
+ implementation("io.papermc.paper:paper-mojangapi:1.20.2-R0.1-SNAPSHOT") {
+ implementation("io.papermc.paper:paper-mojangapi:1.20.4-R0.1-SNAPSHOT") {
+ exclude("io.papermc.paper", "paper-api")
+ }
+ implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
Expand All @@ -35,7 +35,7 @@ index 79beac737c17412913983614bd478d33e3c6ed58..5812c7056d11be2cc966728de6b07cd9
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -64,13 +73,18 @@ tasks.jar {
@@ -78,13 +87,18 @@ tasks.jar {
manifest {
val git = Git(rootProject.layout.projectDirectory.path)
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
Expand All @@ -56,7 +56,7 @@ index 79beac737c17412913983614bd478d33e3c6ed58..5812c7056d11be2cc966728de6b07cd9
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
@@ -154,7 +168,7 @@ fun TaskContainer.registerRunTask(
@@ -168,7 +182,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {
Expand All @@ -66,10 +66,10 @@ index 79beac737c17412913983614bd478d33e3c6ed58..5812c7056d11be2cc966728de6b07cd9
standardInput = System.`in`
workingDir = rootProject.layout.projectDirectory
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8f31413c939cc2b0454ad3d9a1b618dbae449d00..25367df06a8a6e8b0b3a56652a5fb1c70a15632d 100644
index 34f19ac897a30c0c4e3ab406013fcca1c8b7db93..f1c65967b74e79452870438eea0942cc700fe0e9 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1697,7 +1697,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1866,7 +1866,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

@DontObfuscate
public String getServerModName() {
Expand All @@ -79,10 +79,10 @@ index 8f31413c939cc2b0454ad3d9a1b618dbae449d00..25367df06a8a6e8b0b3a56652a5fb1c7

public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9c08303de2891de92e06de8a939a618b7a6f7321..aaf04e2be3ed707e51a81d2b1c58dda6f7a8092a 100644
index 782bb8ca67517dde5dba8f0a133eb8699353dd01..e81a3a5e9aab6cb0c76d9e557a31d94536680ce4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper
@@ -270,7 +270,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper

public final class CraftServer implements Server {
Expand Down
20 changes: 10 additions & 10 deletions patches/server/0002-SparklyPaper-config-files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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 1c9742ad81f04052d2c3bc18c7636f45b2fc5160..9a6915a87ae8aa4ffefea575d7a7d5199c800799 100644
index 58536aabf607015939a1326f80207c0a06eed8ff..b69860955a6c1efb68b17e1fc9b0c42771f40e15 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -218,6 +218,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
Expand All @@ -25,18 +25,18 @@ index 1c9742ad81f04052d2c3bc18c7636f45b2fc5160..9a6915a87ae8aa4ffefea575d7a7d519
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
// Paper end
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 2354a0e5d15e9be633d9fe3a1a9feefe7b9b7782..b9e0822638a3979bd43392efdb595153e6f34675 100644
index 0b56e5f7f18fc4286992af22d402205b771165a3..f5e3c87581cbdc762806ad4412b68d3c84612b88 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -176,6 +176,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -179,6 +179,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end

public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
+ public net.sparklypower.sparklypaper.configs.SparklyPaperWorldConfig sparklyPaperConfig; // SparklyPaper
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter;
@@ -213,6 +214,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -216,6 +217,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
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 - Async-Anti-Xray - Pass executor
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
Expand Down Expand Up @@ -116,34 +116,34 @@ index 0000000000000000000000000000000000000000..bc0ec96f91f7c9ab9f9a865a50f69707
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 73e373c04986582d8841ec896a4ee9565eee2e95..d03563baf1e9e25fce8bab1f9fe3f2e57358590b 100644
index e81a3a5e9aab6cb0c76d9e557a31d94536680ce4..ec838fa5248743ccd96f2c19b25b17d9a2ace3d0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -117,6 +117,7 @@ import net.minecraft.world.level.storage.WorldData;
@@ -118,6 +118,7 @@ import net.minecraft.world.level.storage.PrimaryLevelData;
import net.minecraft.world.level.storage.loot.LootDataManager;
import net.minecraft.world.level.validation.ContentValidationException;
import net.minecraft.world.phys.Vec3;
+import net.sparklypower.sparklypaper.configs.SparklyPaperConfigUtils;
import org.bukkit.BanList;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -1041,6 +1042,7 @@ public final class CraftServer implements Server {
@@ -1036,6 +1037,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))
@@ -1056,6 +1058,7 @@ public final class CraftServer implements Server {
@@ -1051,6 +1053,7 @@ public final class CraftServer implements Server {
}
}
world.spigotConfig.init(); // Spigot
+ world.sparklyPaperConfig = SparklyPaperConfigUtils.INSTANCE.getWorldSettings(world.serverLevelData.getLevelName()); // SparklyPaper
}

Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@@ -1071,6 +1074,7 @@ public final class CraftServer implements Server {
@@ -1066,6 +1069,7 @@ public final class CraftServer implements Server {
this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
Expand All @@ -152,7 +152,7 @@ index 73e373c04986582d8841ec896a4ee9565eee2e95..d03563baf1e9e25fce8bab1f9fe3f2e5
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 c737c5d62407337d3db2899cfc01713a058a6467..5e3033fe176d161ed5a18a73bae752d6689a3e01 100644
index 4b457cbfc56e55e0ae0fee5b69e2e75349702aab..2791bd21e570c6bbcb3be19fac4a520a810f952d 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -174,6 +174,14 @@ public class Main {
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0003-Optimize-entity-coordinate-key.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data is already available in the blockPosition struct, so we use that
instead of re-doing the casting.

diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index d02546b18cb689724887b4e85e8d32a18828a4ad..91eaff58bb422ba188e6cfaa9c20b45bec211edd 100644
index 8240bb085b619f257f8c0a25775e0b15068e440f..6d9668d993bb922ae9d2b76a4d766903cc3f98a4 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -213,7 +213,7 @@ public final class MCUtil {
Expand All @@ -24,10 +24,10 @@ index d02546b18cb689724887b4e85e8d32a18828a4ad..91eaff58bb422ba188e6cfaa9c20b45b

public static long getCoordinateKey(final ChunkPos pair) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d435d04ab50b2f64e6438c6c26639b6048322013..9906cde792a07a433e45613518e741801026077d 100644
index 9abe817ae202edaa2d88cd59ae5c7db0b1c634be..cfb4daaa28263aef1c74eac574b4f0e8b2f87776 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -306,7 +306,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -307,7 +307,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public double yo;
public double zo;
private Vec3 position;
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0004-Rewrite-framed-map-tracker-ticking.patch
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ index 35674f92a67f93382103c2766df4b678ba5c862f..bfdd0ce9acfae75a403d3689b391dd8f

private void sendDirtyEntityData() {
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 759ecd79534a7706f7d4a63eb9dacbefcfe54674..0780dd4abf035cdd4001fb9702494c54be83361a 100644
index 69912c5b300b67394dce3876d2d96872033cf156..bde22dcbc67211a62c2280b0c6cf5b85aa3b96eb 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -488,6 +488,16 @@ public class ItemFrame extends HangingEntity {
@@ -483,6 +483,16 @@ public class ItemFrame extends HangingEntity {
}
this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()));
// Paper end
Expand All @@ -104,7 +104,7 @@ index 759ecd79534a7706f7d4a63eb9dacbefcfe54674..0780dd4abf035cdd4001fb9702494c54
if (!player.getAbilities().instabuild) {
itemstack.shrink(1);
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 e4c4948e076cd64686dfd16ae0568fafc1437140..0e7c7593eec47bc266f53ee8b2053917a84ae61e 100644
index e4c4948e076cd64686dfd16ae0568fafc1437140..fec7d474df8cfc8c36f5a69faac7ad03ad648d45 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
@@ -67,6 +67,16 @@ public class MapItemSavedData extends SavedData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 c368b437597edf7e165326727ae778a69c3fcc83..190716ea7857c7ad5427a527ad8d6b5a241a00b6 100644
index 797415866a7f182d804f6b8e57ceb07a6ac2a20a..fc824f471e5d814cb3eee48516731c2b001fb54e 100644
--- a/src/main/java/net/minecraft/world/item/MapItem.java
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
@@ -332,7 +332,7 @@ public class MapItem extends ComplexItem {
@@ -324,7 +324,7 @@ public class MapItem extends ComplexItem {
worldmap.tickCarriedBy(entityhuman, stack);
}

Expand Down
Loading

0 comments on commit 6989f76

Please sign in to comment.