Skip to content

Commit

Permalink
1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Sep 25, 2023
1 parent 78531a5 commit ecb834e
Show file tree
Hide file tree
Showing 38 changed files with 1,638 additions and 2,059 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Leaf 1.20.1
name: Build Leaf 1.20.2
on: [ push, pull_request ]
jobs:
build:
Expand All @@ -21,18 +21,18 @@ jobs:
- name: Create ReobfPaperclipJar
run: ./gradlew -Dorg.gradle.jvmargs="-Dgraal.CompilerConfiguration=enterprise -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true --add-modules jdk.incubator.vector" createReobfPaperclipJar --stacktrace --no-daemon
- name: Rename Paperclip Jar
run: mv build/libs/Leaf-paperclip-1.20.1-R0.1-SNAPSHOT-reobf.jar ./leaf-1.20.1.jar
run: mv build/libs/Leaf-paperclip-1.20.2-R0.1-SNAPSHOT-reobf.jar ./leaf-1.20.2.jar
- name: Upload Leaf
uses: actions/upload-artifact@v3
with:
name: Leaf
path: ./leaf-1.20.1.jar
path: ./leaf-1.20.2.jar
- name: Release Leaf
if: github.ref_name == 'ver/1.20.1'
if: github.ref_name == 'ver/1.20.2'
uses: marvinpinto/action-automatic-releases@latest
with:
title: "Leaf 1.20.1"
automatic_release_tag: "ver-1.20.1"
title: "Leaf 1.20.2"
automatic_release_tag: "ver-1.20.2"
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: "./leaf-1.20.1.jar"
files: "./leaf-1.20.2.jar"
prerelease: false
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Leaf

[![Github Actions Build](https://img.shields.io/github/actions/workflow/status/Winds-Studio/Leaf/build-1201.yml?branch=ver%2F1.20.1&style=flat-square)](https://github.com/Winds-Studio/Leaf/releases)
[![Github Actions Build](https://img.shields.io/github/actions/workflow/status/Winds-Studio/Leaf/build-1202.yml?branch=ver%2F1.20.2&style=flat-square)](https://github.com/Winds-Studio/Leaf/releases)

<h5>Leaf is a drop-in replacement designed for removing some checks, customized, and high-performance built on top of <a href="https://github.com/GaleMC/Gale">Gale</a> with optimization from other forks.</h5>
<h8>Logo designed by <a href="https://www.bing.com/new">New Bing</a></h8>
Expand All @@ -17,7 +17,7 @@
- **Configurable UseItem distance** for anarchy server.
- **Latest dependencies**, keeping all dependencies in the newest version.
- **More customized** relying on features of [Purpur](https://github.com/PurpurMC/Purpur).
- **Maintenance friendly**, integrating with [Sentry](https://sentry.io/welcome/) of [Pufferfish](https://github.com/pufferfish-gg/Pufferfish/blob/ver/1.19/patches/server/0005-Add-Sentry.patch) to easy track all errors coming from your server in excruciating detail.
- **Maintenance friendly**, integrating with [Sentry](https://sentry.io/welcome/) of [Pufferfish](https://github.com/pufferfish-gg/Pufferfish) to easy track all errors coming from your server in excruciating detail.
- **Various optimization** blending from [other forks](https://github.com/Winds-Studio/Leaf#credits).
- ...

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = org.dreeam.leaf
version = 1.20.1-R0.1-SNAPSHOT
version = 1.20.2-R0.1-SNAPSHOT

galeCommit = 973966c1e838c5ece2d0197db2216675b5cfad22
galeCommit = 276e903b2688f23b19bdc8d493c0bf87656d2400

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
146 changes: 44 additions & 102 deletions patches/api/0003-Purpur-API-Changes.patch
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Github Actions <[email protected]>
Date: Fri, 16 Jun 2023 05:21:52 +0000
Date: Mon, 25 Sep 2023 03:15:07 +0000
Subject: [PATCH] Purpur API Changes

Commit: f6fd5f6ba6e672bfdbc79def7e8598d984ec8b3c
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur

Commit: e068628a9f2c66ba9dca5875ce8604db01e82bdb

Patches below are removed in this patch:
Pufferfish-API-Changes.patch
Fix-pufferfish-issues.patch
Build-System-Changes.patch
Remove-Timings.patch

Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
Add-log-suppression-for-LibraryLoader.patch
Fire-Immunity-API.patch

diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index b7a2cecb334ce39fa09d8ab949a29eedbdc44c36..b1f35c68373edfe666ca05b50f0ec022a1859ce9 100644
index 0c4dbb9ef63fa8575b5546239443cb2bd91ba847..b347224c223569297ee67ac630a710fdf28748ea 100644
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -201,6 +201,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
@@ -198,6 +198,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Mob> CLIMB_ON_TOP_OF_POWDER_SNOW = GoalKey.of(Mob.class, NamespacedKey.minecraft("climb_on_top_of_powder_snow"));
GoalKey<Wolf> WOLF_PANIC = GoalKey.of(Wolf.class, NamespacedKey.minecraft("wolf_panic"));

Expand All @@ -33,7 +37,7 @@ index b7a2cecb334ce39fa09d8ab949a29eedbdc44c36..b1f35c68373edfe666ca05b50f0ec022
+ // Purpur end
+
/**
* @deprecated removed in 1.16
* @deprecated removed in 1.20.2
*/
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
Expand Down Expand Up @@ -275,10 +279,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 03b47012447430a350e152920f754d993d4023db..3ad843d519e239430c5f4f5754a8da3026ed0f8e 100644
index 8a948a61d0bdb06b0b9a6eac8a27baeb35a7d36c..f6e0b39ba9ea34613ecb22c55d5c38d5dcad9a82 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -11047,4 +11047,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -11050,4 +11050,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
public boolean isEnabledByFeature(@NotNull World world) {
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
}
Expand Down Expand Up @@ -439,12 +443,12 @@ index bce07d84cafca677bb6fad78c21b82097f06430c..4ef0fa4f1ef72bb784674671473c6a32
+ // Purpur end - OfflinePlayer API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index a5938b0a960121bd77a13e4c8fc8a053bea481c5..43a57c9e32e5a51140e784a4a5a44c0b0b752133 100644
index a5938b0a960121bd77a13e4c8fc8a053bea481c5..c55819f56b4a3850496feef6900c1ec8a0bb1a9d 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2182,6 +2182,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Leaf end
@@ -2174,6 +2174,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi

// Paper end

+ // Purpur start
+ @NotNull
Expand All @@ -458,9 +462,9 @@ index a5938b0a960121bd77a13e4c8fc8a053bea481c5..43a57c9e32e5a51140e784a4a5a44c0b
+ }
+ // Purpur end
+
/**
* Sends the component to the player
*
// Leaf start
@NotNull
public org.bukkit.configuration.file.YamlConfiguration getLeafConfig()
@@ -2491,4 +2503,111 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
long getLastTickOversleepTime();
// Gale end - YAPFA - last tick time - API
Expand Down Expand Up @@ -574,7 +578,7 @@ index a5938b0a960121bd77a13e4c8fc8a053bea481c5..43a57c9e32e5a51140e784a4a5a44c0b
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index b8b97df069b28fa3cf32f1ad1f01f586a0cfbc78..63bf1d70cce9176f47a158a4a767b1bf38d60dbd 100644
index da524a71af74b02515b037f7fe09ba6988e2c8bf..3679c3b8d31ab8de08ecabd56bf92ffc062f971c 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4008,6 +4008,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
Expand Down Expand Up @@ -813,10 +817,10 @@ index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c
// Paper start
/**
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 762cb07861ca8ff058ce8d57ea6c15df1e588bf3..98de85d1382fe84cdc2e2c9db04bf1b4f157291c 100644
index 762cb07861ca8ff058ce8d57ea6c15df1e588bf3..52867495d0f746ff40e802c4f1018511e58fd03e 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -1049,4 +1049,55 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -1049,4 +1049,42 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
@NotNull String getScoreboardEntryName();
// Paper end - entity scoreboard name
Expand Down Expand Up @@ -857,19 +861,6 @@ index 762cb07861ca8ff058ce8d57ea6c15df1e588bf3..98de85d1382fe84cdc2e2c9db04bf1b4
+ * @return True if in daylight
+ */
+ boolean isInDaylight();
+
+ /**
+ * Checks if the entity is fire immune
+ *
+ * @return True if fire immune
+ */
+ boolean isImmuneToFire();
+
+ /**
+ * Sets if the entity is fire immune
+ * Set this to null to restore the entity type default
+ */
+ void setImmuneToFire(@Nullable Boolean fireImmune);
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/IronGolem.java b/src/main/java/org/bukkit/entity/IronGolem.java
Expand Down Expand Up @@ -1036,10 +1027,10 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 2672072ccddaacfebeaea45de472c7420345cde7..877ed7bea937e0be1c404d5ab5cef8fce5e6ac17 100644
index 4c33eac096619af16d571dca28411c4fff6f00f4..2156418958fb25eb9de08e39e42b90a5337bf92e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3285,4 +3285,143 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3290,4 +3290,122 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
Spigot spigot();
// Spigot end
Expand Down Expand Up @@ -1072,27 +1063,6 @@ index 2672072ccddaacfebeaea45de472c7420345cde7..877ed7bea937e0be1c404d5ab5cef8fc
+ void resetIdleTimer();
+
+ /**
+ * Check if player is invulnerable from recently spawning or accepting a resource pack
+ *
+ * @return True if invulnerable
+ */
+ boolean isSpawnInvulnerable();
+
+ /**
+ * Get invulnerable ticks remaining
+ *
+ * @return Invulnerable ticks
+ */
+ int getSpawnInvulnerableTicks();
+
+ /**
+ * Set invulnerable ticks remaining
+ *
+ * @param invulnerableTicks Invulnerable ticks remaining
+ */
+ void setSpawnInvulnerableTicks(int invulnerableTicks);
+
+ /**
+ * Creates debug block highlight on specified block location and show it to this player.
+ * <p>
+ * Clients may be inconsistent in displaying it.
Expand Down Expand Up @@ -2062,18 +2032,10 @@ index cd3296fea01648592d2af89b3d80135acb6d0958..45797a6fbae1d8edc4211cb30def24ad

permissions.put(lname, new PermissionAttachmentInfo(parent, lname, attachment, value));
diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java
index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f026703cb80 100644
index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf235eba7e89 100644
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
@@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableMap;
import java.util.Map;
import java.util.NoSuchElementException;
import org.bukkit.Color;
+import org.bukkit.NamespacedKey;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.SerializableAs;
import org.bukkit.entity.LivingEntity;
@@ -31,12 +32,14 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -32,12 +32,14 @@ public class PotionEffect implements ConfigurationSerializable {
private static final String AMBIENT = "ambient";
private static final String PARTICLES = "has-particles";
private static final String ICON = "has-icon";
Expand All @@ -2088,7 +2050,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02

/**
* Creates a potion effect.
@@ -49,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -50,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable {
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
*/
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon) {
Expand Down Expand Up @@ -2125,15 +2087,15 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
Preconditions.checkArgument(type != null, "effect type cannot be null");
this.type = type;
this.duration = duration;
@@ -56,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -57,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable {
this.ambient = ambient;
this.particles = particles;
this.icon = icon;
+ this.key = key; // Purpur - add key
}

/**
@@ -103,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -104,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable {
* @param map the map to deserialize from
*/
public PotionEffect(@NotNull Map<String, Object> map) {
Expand Down Expand Up @@ -2183,8 +2145,8 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
+
@NotNull
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
int type = getInt(map, TYPE);
@@ -159,17 +200,33 @@ public class PotionEffect implements ConfigurationSerializable {
PotionEffectType effect;
@@ -166,17 +206,33 @@ public class PotionEffect implements ConfigurationSerializable {
return def;
}

Expand All @@ -2203,21 +2165,16 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
@NotNull
public Map<String, Object> serialize() {
- return ImmutableMap.<String, Object>builder()
- .put(TYPE, type.getId())
- .put(DURATION, duration)
- .put(AMPLIFIER, amplifier)
- .put(AMBIENT, ambient)
- .put(PARTICLES, particles)
- .put(ICON, icon)
- .build();
+ // Purpur start - add key, don't serialize if null.
+ ImmutableMap.Builder<String, Object> builder = ImmutableMap.<String, Object>builder()
+ .put(TYPE, type.getId())
+ .put(DURATION, duration)
+ .put(AMPLIFIER, amplifier)
+ .put(AMBIENT, ambient)
+ .put(PARTICLES, particles)
+ .put(ICON, icon);
.put(TYPE, type.getKey().toString())
.put(DURATION, duration)
.put(AMPLIFIER, amplifier)
.put(AMBIENT, ambient)
.put(PARTICLES, particles)
- .put(ICON, icon)
- .build();
+ .put(ICON, icon);
+ if(key != null) {
+ builder.put(KEY, key.toString());
+ }
Expand All @@ -2226,7 +2183,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
}

/**
@@ -193,7 +250,7 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -200,7 +256,7 @@ public class PotionEffect implements ConfigurationSerializable {
return false;
}
PotionEffect that = (PotionEffect) obj;
Expand All @@ -2235,7 +2192,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
}

/**
@@ -289,6 +346,24 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -296,6 +352,24 @@ public class PotionEffect implements ConfigurationSerializable {
return icon;
}

Expand All @@ -2260,7 +2217,7 @@ index ccdca0d75868135dc7b96daeff2236b225c4add1..cad9f4ddc6be23c595e79419872f8f02
@Override
public int hashCode() {
int hash = 1;
@@ -303,6 +378,6 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -310,6 +384,6 @@ public class PotionEffect implements ConfigurationSerializable {

@Override
public String toString() {
Expand Down Expand Up @@ -3910,18 +3867,3 @@ index 0000000000000000000000000000000000000000..38483d908ed830e97883733bee2370f8
+ return getOrDefault(key.translationKey());
+ }
+}
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
index 06e96e5c98f1a7a68c8b4b5e527314c1aa774e38..49bba9a7a02b9cf3a552583315eff2b7dbe060c0 100644
--- a/src/test/java/org/bukkit/AnnotationTest.java
+++ b/src/test/java/org/bukkit/AnnotationTest.java
@@ -47,6 +47,10 @@ public class AnnotationTest {
"org/bukkit/plugin/java/PluginClassLoader",
// Generic functional interface
"org/bukkit/util/Consumer",
+ // Purpur start
+ "gg/pufferfish/pufferfish/sentry/SentryContext",
+ "gg/pufferfish/pufferfish/sentry/SentryContext$State",
+ // Purpur end
// Paper start
"io/papermc/paper/util/TransformingRandomAccessList",
"io/papermc/paper/util/TransformingRandomAccessList$TransformedListIterator",
Original file line number Diff line number Diff line change
Expand Up @@ -3246,10 +3246,10 @@ index 12946bd55fcf7c40d39081779a7fa30049ee6165..00000000000000000000000000000000
-
-}
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
index 49bba9a7a02b9cf3a552583315eff2b7dbe060c0..e57a67328941c08d0d3a61fddcefc4d6fa0b93d4 100644
index 88f1ca89fa640a686231b8eec87e70419b2d73ef..ef113b3b89f40ed7242d5c6361ea822693f87518 100644
--- a/src/test/java/org/bukkit/AnnotationTest.java
+++ b/src/test/java/org/bukkit/AnnotationTest.java
@@ -54,15 +54,6 @@ public class AnnotationTest {
@@ -50,15 +50,6 @@ public class AnnotationTest {
// Paper start
"io/papermc/paper/util/TransformingRandomAccessList",
"io/papermc/paper/util/TransformingRandomAccessList$TransformedListIterator",
Expand Down
Loading

0 comments on commit ecb834e

Please sign in to comment.