9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-21 07:49:18 +00:00

[ci-skip] finish patches

This commit is contained in:
NONPLAYT
2023-03-21 20:54:44 +03:00
parent 747de0799b
commit 340edaf4d3
62 changed files with 597 additions and 176 deletions

View File

@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 24 Apr 2017 20:27:23 -0400
Subject: [PATCH] EMC - Add ChatColor.getById
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
index e3f185dc982d1c38195a4e01ddd485c13ffa58c0..8a3d05702ad0cfa8384d3a9c7a5695d82e13523e 100644
--- a/src/main/java/org/bukkit/ChatColor.java
+++ b/src/main/java/org/bukkit/ChatColor.java
@@ -233,6 +233,10 @@ public enum ChatColor {
}
};
+ public int getId() {
+ return intCode;
+ }
+
/**
* The special character which prefixes all chat colour codes. Use this if
* you need to dynamically convert colour codes from your custom format.
@@ -296,6 +300,11 @@ public enum ChatColor {
return !isFormat && this != RESET;
}
+ @Nullable
+ public static ChatColor getById(int id) {
+ return BY_ID.get(id);
+ }
+
/**
* Gets the color represented by the specified color code
*

View File

@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Tue, 14 Mar 2023 21:03:19 +0300
Subject: [PATCH] Update Bungeecord Chat API
diff --git a/build.gradle.kts b/build.gradle.kts
index 181e9cd8623995f40e696ccfe49754dc340405d8..ba11fc979aac6f9a4bc812bc83b42b5ff2916b6d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -25,7 +25,7 @@ dependencies {
// api dependencies are listed transitively to API consumers
api("com.google.guava:guava:31.1-jre")
api("com.google.code.gson:gson:2.10")
- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.6") // Paper
+ api("net.md-5:bungeecord-chat:1.19-R0.1-SNAPSHOT") // Paper // DivineMC
api("org.yaml:snakeyaml:1.33")
// Paper start
api("com.googlecode.json-simple:json-simple:1.1.1") {

View File

@@ -0,0 +1,64 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Justin <justin@justinf.dev>
Date: Wed, 24 Aug 2022 05:08:52 -0700
Subject: [PATCH] Paper PR - Add Entity hidden by default API
This patch adds API that allows entities to be hidden by default. Entities that are hidden by
default are not shown to players until Player#showEntity is invoked on said entity. The same is
true for players that join the server after an Entity is hidden by default.
Hiding entities by default also respects precedent of keeping entities hidden when other plugins
explicitly hide them from a player. If an entity is hidden by default and by a plugin, the entity
must have the plugin that hid them from a player show them in order to be shown to a player again.
If no plugin had previously hidden the entity before the entity was hidden by default, then any
plugin that attempts to show the entity to a player will succeed in doing so.
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 365350d38b2eee00d22bad09ab95c6054f11d536..565a3bcc49ccb4650188263632751e9f6326a5d1 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -953,4 +953,25 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
boolean wouldCollideUsing(@NotNull BoundingBox boundingBox);
// Paper End - Collision API
+
+ // Paper start - Entity hiddenByDefault
+ /**
+ * Sets whether the entity is hidden by default. When an entity is hidden by default,
+ * {@link Player#showEntity(org.bukkit.plugin.Plugin, Entity)} must be called in order to
+ * display the entity again. Players that join the server do not see entities that are
+ * hidden by default at first and must be shown the entity with the same method above.
+ *
+ * This method also respects plugins hiding entities - if another plugin still wishes for an entity
+ * to be hidden (via {@link Player#hideEntity(org.bukkit.plugin.Plugin, Entity)}), then the entity will
+ * remain hidden even if hiddenByDefault is set to false again or if another plugin tries to show the entity.
+ *
+ * @param hiddenByDefault
+ */
+ void setHiddenByDefault(boolean hiddenByDefault);
+
+ /**
+ * @return true if the Entity is hidden by default, false otherwise
+ */
+ boolean isHiddenByDefault();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index b5fd857896b3afcfa69cce55cbc2696dd625f805..7d44d455a550490e8e505c205dfe26e1d048719e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1568,9 +1568,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Allows this player to see an entity that was previously hidden. If
- * another another plugin had hidden the entity too, then the entity will
+ * another plugin had hidden the entity too, then the entity will
* remain hidden until the other plugin calls this method too.
*
+ * If no other plugin is hiding the entity after this method is called,
+ * then this method also allows the player to see entities hidden by default
+ * with {@link Entity#setHiddenByDefault(boolean)}.
+ *
* @param plugin Plugin that wants to show the entity
* @param entity Entity to show
*/