Skip to content

Commit

Permalink
Updated Upstream (Gale/Purpur/Leaves)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Jun 13, 2024
1 parent 8742091 commit 2e32ca3
Show file tree
Hide file tree
Showing 55 changed files with 281 additions and 571 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group = cn.dreeam.leaf
mcVersion = 1.20.6
version = 1.20.6-R0.1-SNAPSHOT

galeCommit = c67ad06166d774550eb1e177857acdae6ac72fb8
galeCommit = 2a97bf832e63e6905be5f08621b20180fb39914d

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0001-Rebrand.patch
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ index bdc8d830f54e4567ec0b03041221fdcd016ce76c..957f15a91f6aa1235c12b82079e32bb4
* Gets the {@code ServerBuildInfo}.
*
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
index e64bb57f74e6d6f78927be228825b3e0bdf41f48..5bccca7740dbec750960d96d4d951cff5da688da 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 {
@@ -215,7 +215,7 @@ public class VersionCommand extends BukkitCommand {
String version = Bukkit.getVersion();
// Paper start
if (version.startsWith("null")) { // running from ide?
Expand Down
6 changes: 3 additions & 3 deletions patches/api/0003-Pufferfish-Sentry.patch
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ index 0000000000000000000000000000000000000000..c7772aac00f6db664f7a5673bc2585fa
+ }
+}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 07a9c9e254188c251165ca84c8e961fccda01175..5dc64d8c9aeae612fd31af0673f3530a9e777dfc 100644
index 003bece642b682985625db93cad93026352bfc66..e8ba4f1108f2548a487877027e37d81fc150e042 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -596,7 +596,9 @@ public final class SimplePluginManager implements PluginManager {
@@ -597,7 +597,9 @@ public final class SimplePluginManager implements PluginManager {

// Paper start
private void handlePluginException(String msg, Throwable ex, Plugin plugin) {
Expand All @@ -203,7 +203,7 @@ index 07a9c9e254188c251165ca84c8e961fccda01175..5dc64d8c9aeae612fd31af0673f3530a
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerPluginEnableDisableException(msg, ex, plugin)));
}
// Paper end
@@ -666,9 +668,11 @@ public final class SimplePluginManager implements PluginManager {
@@ -667,9 +669,11 @@ public final class SimplePluginManager implements PluginManager {
));
}
} catch (Throwable ex) {
Expand Down
68 changes: 26 additions & 42 deletions patches/api/0004-Purpur-API-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur

Commit: 79d199c7f07d4acd9af6a9858cd895722ce16429
Commit: 72192634b0629433aa531dedaf8c918755f82fbe

Patches below are removed in this patch:
Pufferfish-API-Changes.patch
Expand Down Expand Up @@ -167,18 +167,10 @@ index d8cd53f7e45d3b5276aa360b10ff05ce7275a3a3..8c4619de2a52003a9684cc95f920b12e
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc857cb8e9 100644
index 918a045165cdcde264bc24082b7afebb407271de..e98d6321c5f2cdde91b54f8a74cbcc045eae75a8 100644
--- a/src/main/java/org/bukkit/ChatColor.java
+++ b/src/main/java/org/bukkit/ChatColor.java
@@ -3,6 +3,7 @@ package org.bukkit;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import java.util.Map;
+import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
@@ -456,4 +457,77 @@ public enum ChatColor {
@@ -456,4 +456,77 @@ public enum ChatColor {
BY_CHAR.put(color.code, color);
}
}
Expand All @@ -193,7 +185,7 @@ index 918a045165cdcde264bc24082b7afebb407271de..687d11619379aead7f665d4a5f8f8bcc
+ @NotNull
+ public static String toMM(@NotNull String str) {
+ StringBuilder sb = new StringBuilder(str);
+ Matcher m = STRIP_COLOR_PATTERN.matcher(sb);
+ java.util.regex.Matcher m = STRIP_COLOR_PATTERN.matcher(sb);
+ while (m.find()) {
+ sb.replace(m.start(), m.end(), sb.substring(m.start(), m.end()).toLowerCase());
+ }
Expand Down Expand Up @@ -257,10 +249,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 7509b61dfdc0a6675256970cb850b08f9e814580..c1986ca90c3adb81daca4f72b62cda65e5465bff 100644
index 762216a117145676d3df2b74036799b024461fb7..54c080d650f807b05e5d8347f78e2bc243791172 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -5733,4 +5733,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -5764,4 +5764,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
return Registry.BLOCK.get(material.key);
}
Expand Down Expand Up @@ -541,10 +533,10 @@ index 12dd25921625db145287edba783ae6d7e904ce80..9ed8f4e3e3d33e4bdefc7db85d5f65e3
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 26622cafbb9811fafe18d5dd9b25f56960154772..7707963157ef98eedbf7143a0dbd9c22580a426d 100644
index fdb87adfb8d6eff2bfabe7a41398c53d15d4cd98..0f2f7cb8acb226d6f9a1085ec9cac3f8faa77813 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4249,6 +4249,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4276,6 +4276,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
public DragonBattle getEnderDragonBattle();

Expand Down Expand Up @@ -661,10 +653,10 @@ index 739911cda33b373f99df627a3a378b37d7d461aa..51e78c22cd021722b963fe31d1d9175d
* Add an entity to the block.
*
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index c3a9cf65db73ed534bf20996c7f05b5eb0aaebe1..83f84a76cbfdf5138ecccf3a886d38151a500bf2 100644
index 5df19bd701c67506689fc7f49d91f99ebfbc83f0..a09b5458191eb5df4787859b72a37fa1fa2bffba 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -152,6 +152,19 @@ public class SimpleCommandMap implements CommandMap {
@@ -153,6 +153,19 @@ public class SimpleCommandMap implements CommandMap {
return false;
}

Expand All @@ -684,7 +676,7 @@ index c3a9cf65db73ed534bf20996c7f05b5eb0aaebe1..83f84a76cbfdf5138ecccf3a886d3815
// Paper start - Plugins do weird things to workaround normal registration
if (target.timings == null) {
target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target);
@@ -161,7 +174,7 @@ public class SimpleCommandMap implements CommandMap {
@@ -162,7 +175,7 @@ public class SimpleCommandMap implements CommandMap {
try {
try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
Expand Down Expand Up @@ -970,10 +962,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 dbd6eba668cd20a72ca6df9968c69743bca116ee..7e0aab5a34b45a032b73e566ce94bbb86a14ecf0 100644
index 6324b7980dc0e4fc2194cbf55a2bb56f142d318c..6a11a44099ceced971e2909b564d40ed687f62e2 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3816,4 +3816,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3864,4 +3864,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
Spigot spigot();
// Spigot end
Expand Down Expand Up @@ -1255,7 +1247,7 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index c64413a6740b604282984dea2a8430a6e7478d68..5c609d916e2d2f08ba90ebd23f13c5c9a14bc73c 100644
index 40cde68c7b73a0a92e2a96667a90138d67ce66ff..fee2469bdedff0e55ef4dcda410cac35c6319258 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -19,6 +19,17 @@ import org.bukkit.inventory.meta.ItemMeta;
Expand All @@ -1276,7 +1268,7 @@ index c64413a6740b604282984dea2a8430a6e7478d68..5c609d916e2d2f08ba90ebd23f13c5c9

/**
* Represents a stack of items.
@@ -1079,4 +1090,565 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -1081,4 +1092,565 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
return Bukkit.getUnsafe().computeTooltipLines(this, tooltipContext, player);
}
// Paper end - expose itemstack tooltip lines
Expand Down Expand Up @@ -1843,44 +1835,36 @@ index c64413a6740b604282984dea2a8430a6e7478d68..5c609d916e2d2f08ba90ebd23f13c5c9
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
index 1cd6601c9d2e86ef850011fcb9e59811207b4af7..5ec7d9dab1935bb743e3264d9f7390795fd9f55c 100644
index e7796054f3f65f5bea7f93c75320195f6c2f0561..1b1d05b77e93abe93ed782883f8d791f6559f778 100644
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
@@ -10,6 +10,7 @@ import java.util.function.Predicate;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable; // Purpur

/**
* Represents a potential item match within a recipe. All choices within a
@@ -180,6 +181,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@@ -191,6 +191,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
public static class ExactChoice implements RecipeChoice {

private List<ItemStack> choices;
+ private Predicate<ItemStack> predicate; // Purpur

public ExactChoice(@NotNull ItemStack stack) {
this(Arrays.asList(stack));
@@ -229,6 +231,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@@ -241,6 +242,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {

@Override
public boolean test(@NotNull ItemStack t) {
+ if (predicate != null) return predicate.test(t); // Purpur
for (ItemStack match : choices) {
if (t.isSimilar(match)) {
return true;
@@ -238,6 +241,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@@ -250,6 +252,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
return false;
}

+ // Purpur start
+ @Nullable
+ @org.jetbrains.annotations.Nullable
+ public Predicate<ItemStack> getPredicate() {
+ return predicate;
+ }
+
+ public void setPredicate(@Nullable Predicate<ItemStack> predicate) {
+ public void setPredicate(@org.jetbrains.annotations.Nullable Predicate<ItemStack> predicate) {
+ this.predicate = predicate;
+ }
+ // Purpur end
Expand All @@ -1906,25 +1890,25 @@ index cb7040876a99a5a7e49b81684ef0f3b79584c376..22d8f31b1b8a5dbb5ab3275068642937
+ // Purpur - end
}
diff --git a/src/main/java/org/bukkit/permissions/PermissibleBase.java b/src/main/java/org/bukkit/permissions/PermissibleBase.java
index cd3296fea01648592d2af89b3d80135acb6d0958..45797a6fbae1d8edc4211cb30def24ad4f59bd49 100644
index 75b77cc4fe189b4b6baa1af3663dc492e992a266..30b98d1645c571ba5c18e5cc93b0bec3f74b1d3b 100644
--- a/src/main/java/org/bukkit/permissions/PermissibleBase.java
+++ b/src/main/java/org/bukkit/permissions/PermissibleBase.java
@@ -168,7 +168,7 @@ public class PermissibleBase implements Permissible {
@@ -169,7 +169,7 @@ public class PermissibleBase implements Permissible {

for (Permission perm : defaults) {
String name = perm.getName().toLowerCase(java.util.Locale.ENGLISH);
String name = perm.getName().toLowerCase(Locale.ROOT);
- permissions.put(name, new PermissionAttachmentInfo(parent, name, null, true));
+ permissions.put(name, new PermissionAttachmentInfo(parent, name, null, perm.getDefault().getValue(isOp()))); // Purpur
Bukkit.getServer().getPluginManager().subscribeToPermission(name, parent);
calculateChildPermissions(perm.getChildren(), false, null);
}
@@ -196,7 +196,7 @@ public class PermissibleBase implements Permissible {
@@ -197,7 +197,7 @@ public class PermissibleBase implements Permissible {
String name = entry.getKey();

Permission perm = Bukkit.getServer().getPluginManager().getPermission(name);
- boolean value = entry.getValue() ^ invert;
+ boolean value = (entry.getValue() == null && perm != null ? perm.getDefault().getValue(isOp()) : entry.getValue()) ^ invert; // Purpur
String lname = name.toLowerCase(java.util.Locale.ENGLISH);
String lname = name.toLowerCase(Locale.ROOT);

permissions.put(lname, new PermissionAttachmentInfo(parent, lname, attachment, value));
diff --git a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
Expand Down
Loading

0 comments on commit 2e32ca3

Please sign in to comment.