Skip to content

Commit

Permalink
Updated Upstream (Leaf)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed May 26, 2024
1 parent 13ff24f commit b736aa9
Show file tree
Hide file tree
Showing 73 changed files with 862 additions and 221 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build-1204.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ jobs:
- name: Rename Paperclip Jar
run: mv build/libs/leaf-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar ./leaf-1.20.4.jar

- name: Publish API
if: github.event_name != 'pull_request'
run: |
echo "GITHUB_USERNAME=Leaf" >> $GITHUB_ENV
export GITHUB_USERNAME=Leaf
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
./gradlew :leaf-api:publish
./gradlew publishDevBundlePublicationToLeafRepository -PpublishDevBundle=true
# - name: Publish API
# if: github.event_name != 'pull_request'
# run: |
# echo "GITHUB_USERNAME=Leaf" >> $GITHUB_ENV
# export GITHUB_USERNAME=Leaf
# echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
# export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
# ./gradlew :leaf-api:publish
# ./gradlew publishDevBundlePublicationToLeafRepository -PpublishDevBundle=true

- name: Upload Leaf
uses: actions/upload-artifact@main
Expand Down
9 changes: 6 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ repositories {
maven(paperMavenPublicUrl) {
content { onlyForConfigurations(configurations.paperclip.name) }
}
maven("https://maven.nostal.ink/repository/maven-snapshots/")
}

dependencies {
remapper("net.fabricmc:tiny-remapper:0.10.1:fat")
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
decompiler("org.vineflower:vineflower:1.10.1")
paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT")
paperclip("cn.dreeam:quantumleaper:1.0.0-SNAPSHOT")
}

subprojects {
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")

Expand All @@ -30,7 +31,9 @@ subprojects {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
}

subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
group = org.dreeam.leaf
mcVersion = 1.20.4
version = 1.20.4-R0.1-SNAPSHOT

galeCommit = 05f24b652c77b253b1cffef14b21f4fe971a84fa
Expand Down
19 changes: 19 additions & 0 deletions patches/api/0001-Rebrand.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Tue, 21 May 2024 11:43:49 +0800
Subject: [PATCH] Rebrand


diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index fd5d9881abfd930bb883120f018f76dc78b62b14..dac207f2f5ae1838ca1b5092f7fe032adc038849 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -214,7 +214,7 @@ public class VersionCommand extends BukkitCommand {
String version = Bukkit.getVersion();
// Paper start
if (version.startsWith("null")) { // running from ide?
- setVersionMessage(Component.text("Unknown version, custom build?", NamedTextColor.YELLOW));
+ setVersionMessage(Component.text("* Unknown version, custom build?", NamedTextColor.RED)); // Leaf - Purpur - Clean up version command output
return;
}
setVersionMessage(getVersionFetcher().getVersionMessage(version));
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ Remove-Timings.patch
Add-log-suppression-for-LibraryLoader.patch
Fire-Immunity-API.patch

diff --git a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48cc50fad5b 100644
--- a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
@@ -26,6 +26,12 @@ public interface VersionFetcher {
@NotNull
Component getVersionMessage(@NotNull String serverVersion);

+ // Purpur start
+ default int distance() {
+ return 0;
+ }
+ // Purpur end
+
class DummyVersionFetcher implements VersionFetcher {

@Override
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index d8201747ede92a0123eec012844a7a674e6947f5..e0ecc43fc6a952b4897c530af2e89f2c0558740e 100644
--- a/src/main/java/org/bukkit/Bukkit.java
Expand Down Expand Up @@ -690,34 +673,6 @@ index ac9a28922f8a556944a4c3649d74c32c622f0cb0..e43d0e0a2c5edfcc82a677b6c4db9314
// Paper start - Plugins do weird things to workaround normal registration
if (target.timings == null) {
target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target);
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index fd5d9881abfd930bb883120f018f76dc78b62b14..d3dadad49df09e85c724c93e8cc88da2c985e9b4 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -214,7 +214,7 @@ public class VersionCommand extends BukkitCommand {
String version = Bukkit.getVersion();
// Paper start
if (version.startsWith("null")) { // running from ide?
- setVersionMessage(Component.text("Unknown version, custom build?", NamedTextColor.YELLOW));
+ setVersionMessage(Component.text("* Unknown version, custom build?", NamedTextColor.RED)); // Purpur
return;
}
setVersionMessage(getVersionFetcher().getVersionMessage(version));
@@ -255,9 +255,11 @@ public class VersionCommand extends BukkitCommand {
// Paper start
private void setVersionMessage(final @NotNull Component msg) {
lastCheck = System.currentTimeMillis();
- final Component message = Component.textOfChildren(
- Component.text(Bukkit.getVersionMessage(), NamedTextColor.WHITE),
- Component.newline(),
+ // Purpur start
+ int distance = getVersionFetcher().distance();
+ final Component message = Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()),
+ ChatColor.parseMM("<grey>Current: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
+ // Purpur end
msg
);
this.versionMessage = Component.text()
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
index 455ff52d90565838fe7640c3f045b27082a6c2f1..45f5493eebfecf56b7c0ef4659c078dfc62c0612 100644
--- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Original license: MIT
Original project: https://github.com/Cryptite/Slice

diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 69ba1660dae4ac69ec4e92f94dd6f95e9f70427d..dbd5e9faaf92d718c20ceaf076f2afd867232116 100644
index 89d124342522743206f8065a32f6e36b954b3b73..2727ca17317d083897c4c0c6575c57a40dd19cce 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3588,6 +3588,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
Expand Down
Loading

0 comments on commit b736aa9

Please sign in to comment.