Skip to content

Commit

Permalink
start!
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jun 22, 2024
1 parent e234432 commit 3cc9cf9
Show file tree
Hide file tree
Showing 145 changed files with 872 additions and 1,682 deletions.
44 changes: 4 additions & 40 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import io.papermc.paperweight.util.*
import kotlin.io.path.*

plugins {
java
`maven-publish`
id("io.papermc.paperweight.patcher") version "1.7.1"
id("org.leavesmc.leavesweight.patcher") version "1.0.0-SNAPSHOT"
}

allprojects {
Expand Down Expand Up @@ -54,14 +51,14 @@ subprojects {
repositories {
mavenCentral()
maven("https://repo.leavesmc.org/releases") {
content { onlyForConfigurations("paperclip") }
content { onlyForConfigurations("leavesclip") }
}
}

dependencies {
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
decompiler("org.vineflower:vineflower:1.10.1")
paperclip("org.leavesmc:leavesclip:2.0.0")
leavesclip("org.leavesmc:leavesclip:2.0.0")
}

paperweight {
Expand Down Expand Up @@ -100,37 +97,4 @@ allprojects {
}
}
}
}

if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()) {

tasks.withType<io.papermc.paperweight.tasks.CollectATsFromPatches>().configureEach {
val dir = layout.projectDirectory.dir("patches/unapplied")
if (dir.path.isDirectory()) {
extraPatchDir = dir
}
}
tasks.withType<io.papermc.paperweight.tasks.RebuildGitPatches>().configureEach {
filterPatches = false
}
}

tasks.register("createMojmapLeavesclipJar") {
group = "paperweight"
dependsOn("createMojmapPaperclipJar")
doLast {
file("build/libs/Leaves-paperclip-${project.version}-mojmap.jar").renameTo(
file("build/libs/Leaves-leavesclip-${project.version}-mojmap.jar")
)
}
}

tasks.register("createReobfLeavesclipJar") {
group = "paperweight"
dependsOn("createReobfPaperclipJar")
doLast {
file("build/libs/Leaves-paperclip-${project.version}-reobf.jar").renameTo(
file("build/libs/Leaves-leavesclip-${project.version}-reobf.jar")
)
}
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
group=org.leavesmc.leaves
version=1.20.6-R0.1-SNAPSHOT
version=1.21-R0.1-SNAPSHOT

mcVersion=1.20.6
mcVersion=1.21
org.gradle.jvmargs=-Xmx2G
paperRef=79e2cb620ef03539390d97940824b38b707918f5
preVersion=false
paperRef=0a1b133c28bfa9b71cd23a10b42b521ad50aacb5
preVersion=true
updatingMinecraft=true
4 changes: 2 additions & 2 deletions patches/api/0001-Leaves-Server-Config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Leaves Server Config


diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 0614bd7e2d658172a7765925adf81b75b5620f11..4304649def2a4e00058e98e7b12b799f6e261325 100644
index bbc4d7d3ca84642828f9a3f788ca26bba900d15b..f1163c857bc9012d1fc32ada575a5f6514e2c956 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2256,6 +2256,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2250,6 +2250,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
throw new UnsupportedOperationException("Not supported yet.");
}
// Paper end
Expand Down
10 changes: 5 additions & 5 deletions patches/api/0003-Add-fakeplayer-api.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ index 97e78e27ee0eea2c8b24886eeb19164d552323fe..9764fa643039f215627c20a33ca70c9e
/.factorypath
+
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 47039514503d99e84cb99f4941707a7726286516..345dbebf7a291d43f6f6ceccfba0184af86da531 100644
index b9b751ea0d11381e846d5f35f39f285c075c171a..6610aa562f2eaf0e889406b395b1fad8deba8411 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2909,6 +2909,17 @@ public final class Bukkit {
@@ -2903,6 +2903,17 @@ public final class Bukkit {
}
// Paper end - Folia region threading API

Expand All @@ -36,18 +36,18 @@ index 47039514503d99e84cb99f4941707a7726286516..345dbebf7a291d43f6f6ceccfba0184a
public static Server.Spigot spigot() {
return server.spigot();
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 4304649def2a4e00058e98e7b12b799f6e261325..1300fb43cf20f9400eb337d3104158383951eae8 100644
index f1163c857bc9012d1fc32ada575a5f6514e2c956..d506fc269c666d847e4a8590c017bf91e2fcb6d6 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -61,6 +61,7 @@ import org.bukkit.util.CachedServerIcon;
@@ -62,6 +62,7 @@ import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.leavesmc.leaves.entity.BotManager;

/**
* Represents a server implementation.
@@ -2554,4 +2555,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2548,4 +2549,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
// Paper end - Folia region threading API
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0008-Force-peaceful-mode-switch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Force peaceful mode switch


diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index fdb87adfb8d6eff2bfabe7a41398c53d15d4cd98..531a6cae97fe2a415cf906108a0899bf04e613d8 100644
index d8a23aa0d898ca3360757721e38ddb97387f7d21..d744614204a840012b51e1f40148caf5f9dc6097 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4344,6 +4344,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4213,6 +4213,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
void setSendViewDistance(int viewDistance);
// Paper end - view distance api

Expand Down
10 changes: 5 additions & 5 deletions patches/api/0009-Replay-Mod-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ index 9764fa643039f215627c20a33ca70c9e36b2d599..97e78e27ee0eea2c8b24886eeb19164d
/.factorypath
-
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 345dbebf7a291d43f6f6ceccfba0184af86da531..f633ddbc5041d93333f3db0cb675deb47d423224 100644
index 6610aa562f2eaf0e889406b395b1fad8deba8411..9e7264149efc346d1e8e323b84bb8c19c0c5c58c 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2919,6 +2919,11 @@ public final class Bukkit {
@@ -2913,6 +2913,11 @@ public final class Bukkit {
return server.getBotManager();
}
// Leaves end - Bot API
Expand All @@ -30,18 +30,18 @@ index 345dbebf7a291d43f6f6ceccfba0184af86da531..f633ddbc5041d93333f3db0cb675deb4
@NotNull
public static Server.Spigot spigot() {
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 1300fb43cf20f9400eb337d3104158383951eae8..98ca0f656ea3a5be30ad49bc7fb22c886adbef03 100644
index d506fc269c666d847e4a8590c017bf91e2fcb6d6..fe93598096c904ed7c085ebce49bca2ce882cb75 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -62,6 +62,7 @@ import org.jetbrains.annotations.Contract;
@@ -63,6 +63,7 @@ import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.leavesmc.leaves.entity.BotManager;
+import org.leavesmc.leaves.entity.PhotographerManager;

/**
* Represents a server implementation.
@@ -2564,4 +2565,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2558,4 +2559,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
@NotNull BotManager getBotManager();
// Leaves end - Bot API
Expand Down
12 changes: 6 additions & 6 deletions patches/api/0010-Bytebuf-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Bytebuf API


diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index f633ddbc5041d93333f3db0cb675deb47d423224..992db8d11b6cb230488c0e77ce8f4834932bbded 100644
index 9e7264149efc346d1e8e323b84bb8c19c0c5c58c..a5be047695fa8fa495da6f8773946768aeaeb05a 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2925,6 +2925,12 @@ public final class Bukkit {
@@ -2919,6 +2919,12 @@ public final class Bukkit {
}
// Leaves end - Photographer API

Expand All @@ -22,10 +22,10 @@ index f633ddbc5041d93333f3db0cb675deb47d423224..992db8d11b6cb230488c0e77ce8f4834
public static Server.Spigot spigot() {
return server.spigot();
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 98ca0f656ea3a5be30ad49bc7fb22c886adbef03..79ad3c362e5437b28e44270a9c7b8947ce8b00d5 100644
index fe93598096c904ed7c085ebce49bca2ce882cb75..1206268f19defd269c63e3391336b9920573454f 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2568,4 +2568,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2562,4 +2562,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
// Leaves start - Photographer API
@NotNull PhotographerManager getPhotographerManager();
// Leaves end - Photographer API
Expand All @@ -35,10 +35,10 @@ index 98ca0f656ea3a5be30ad49bc7fb22c886adbef03..79ad3c362e5437b28e44270a9c7b8947
+ // Leaves end - Bytebuf API
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index eb34f22e973fe46529eb93f435f5bf7f85091404..ba79992f0c170ab1c0db402698feb5071fe8cf62 100644
index 7c56182acaf827f4b1a986a61cea8e9960604c98..45f820485e6f6e3a6a37a30a30c1c6a65b4615bb 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3850,6 +3850,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3855,6 +3855,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
boolean isChunkSent(long chunkKey);
// Paper end

Expand Down
30 changes: 15 additions & 15 deletions patches/server/0001-Build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Build changes


diff --git a/build.gradle.kts b/build.gradle.kts
index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..16b742b5131376ceca04570dd4c088caff62e677 100644
index 299b7b029384c58fed80d53cc0b77c420d62eed7..c46b46d10b37e60d1565273f7ca2560165165088 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
Expand All @@ -18,7 +18,7 @@ index 4998aff0b7cb084dcda15c6a18bbe45e99b6000a..16b742b5131376ceca04570dd4c088ca
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -67,6 +67,15 @@ paperweight {
craftBukkitPackageVersion.set("v1_20_R4") // also needs to be updated in MappingEnvironment
craftBukkitPackageVersion.set("v1_21_R1") // also needs to be updated in MappingEnvironment
}

+// Leaves start - hide irrelevant compilation warnings
Expand Down Expand Up @@ -164,10 +164,10 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..c060857cb0551fff8f5033553b887f3a
private static final String BUILD_DEV = "DEV";

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3751c2a077bd13bac330b93c6efc2a640a17f4f2..2235e5cfd853216fd79cf26244f9f029af1fc3b4 100644
index 68f60e77e0bfd42b6419491c1d59b6432974216b..759f87f8214a1b97a0c84e2d7ba2de49eae0b4cc 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1165,7 +1165,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1186,7 +1186,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
LOGGER.info("*************************************************************************************");
LOGGER.info("This is the first time you're starting this server.");
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
Expand All @@ -176,7 +176,7 @@ index 3751c2a077bd13bac330b93c6efc2a640a17f4f2..2235e5cfd853216fd79cf26244f9f029
LOGGER.info("*************************************************************************************");
}
// Paper end - Add onboarding message for initial server start
@@ -1920,7 +1920,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1869,7 +1869,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

@DontObfuscate
public String getServerModName() {
Expand All @@ -186,10 +186,10 @@ index 3751c2a077bd13bac330b93c6efc2a640a17f4f2..2235e5cfd853216fd79cf26244f9f029

public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index ad967cc2283f902c76e48a59d59cf0dbdacbb5e3..422d87c1503340f3efe50785c4ad0cef6cf67702 100644
index 7d82cc6b847124cf4225428ba310309544928148..4214ed228125c6ba36ef2c763f842a54f33446fc 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -231,9 +231,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -235,9 +235,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
Expand All @@ -215,10 +215,10 @@ index 759062d219ff490a3cb19e710c4d18e3e08288e0..3952428c02fe87477f4139f4fa983815

javax.swing.JLabel jLabel = new javax.swing.JLabel("If you need help setting up your server you can visit:");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index b86ba59158964f73abd6622341a9acb98a33fa44..1155fc80c0292c8d7efb21dbac3d984176fcaa2d 100644
index 6e1f92b45504cef0c4dcbbebf3df339ef4cad0a1..459f47244bdfeab63b5f16d780b0291d36310de8 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -303,7 +303,7 @@ public class Main {
@@ -273,7 +273,7 @@ public class Main {
if (buildDate.before(deadline.getTime())) {
// Paper start - This is some stupid bullshit
System.err.println("*** Warning, you've not updated in a while! ***");
Expand All @@ -241,10 +241,10 @@ index 774556a62eb240da42e84db4502e2ed43495be17..fdef98a7796d84c7b0ee61241859e10c

if (stream != null) {
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 6db566e3111ec08a99aa429624979cb83a85e272..824679785bbe0ac038c4d529b4cbe857e2e102ca 100644
index e5e41dc2d4f7a8c3fea704212507ca0b951664db..6f65c34dab1f031b4015ff3bb9ccdad28e679d38 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
@@ -83,14 +83,14 @@ public class WatchdogThread extends Thread
if (isLongTimeout) {
// Paper end
log.log( Level.SEVERE, "------------------------------" );
Expand All @@ -262,7 +262,7 @@ index 6db566e3111ec08a99aa429624979cb83a85e272..824679785bbe0ac038c4d529b4cbe857
//
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
{
@@ -184,12 +184,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
@@ -112,12 +112,12 @@ public class WatchdogThread extends Thread
// Paper end
} else
{
Expand All @@ -274,10 +274,10 @@ index 6db566e3111ec08a99aa429624979cb83a85e272..824679785bbe0ac038c4d529b4cbe857
log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Leaves!):" ); // Paper // Leaevs
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
this.dumpTickingInfo(); // Paper - log detailed tick information
ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(MinecraftServer.getServer(), isLongTimeout); // Paper - rewrite chunk system
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
@@ -205,7 +205,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
log.log( Level.SEVERE, "------------------------------" );
@@ -132,7 +132,7 @@ public class WatchdogThread extends Thread
WatchdogThread.dumpThread( thread, log );
}
} else {
Expand Down
Loading

0 comments on commit 3cc9cf9

Please sign in to comment.