mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 02:25:28 +01:00
Updated Upstream (Bukkit/CraftBukkit) (#8991)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 2b4582fb SPIGOT-5916: getLastColors does not work with the rgb colors CraftBukkit Changes: f7707086d SPIGOT-7299: Fix indirect/anvil damage events and minor improvements
This commit is contained in:
parent
79db3a2a4b
commit
5730a94208
@ -1,34 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Gerrygames <gecam59@gmail.com>
|
||||
Date: Thu, 16 Jul 2020 10:40:10 +0200
|
||||
Subject: [PATCH] Support hex colors in getLastColors
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
|
||||
index 24ade174df77d75339b44bcd4b035e0c46d95dc3..f6eb30f53dad684f156102cf7147b2f00c82c71e 100644
|
||||
--- a/src/main/java/org/bukkit/ChatColor.java
|
||||
+++ b/src/main/java/org/bukkit/ChatColor.java
|
||||
@@ -363,6 +363,7 @@ public enum ChatColor {
|
||||
return new String(b);
|
||||
}
|
||||
|
||||
+ private static final Pattern HEX_COLOR_PATTERN = Pattern.compile(COLOR_CHAR + "x(?>" + COLOR_CHAR + "[0-9a-f]){6}", Pattern.CASE_INSENSITIVE); // Paper - Support hex colors in getLastColors
|
||||
/**
|
||||
* Gets the ChatColors used at the end of the given input string.
|
||||
*
|
||||
@@ -380,6 +381,15 @@ public enum ChatColor {
|
||||
for (int index = length - 1; index > -1; index--) {
|
||||
char section = input.charAt(index);
|
||||
if (section == COLOR_CHAR && index < length - 1) {
|
||||
+ // Paper start - Support hex colors
|
||||
+ if (index > 11 && input.charAt(index - 12) == COLOR_CHAR && (input.charAt(index - 11) == 'x' || input.charAt(index - 11) == 'X')) {
|
||||
+ String color = input.substring(index - 12, index + 2);
|
||||
+ if (HEX_COLOR_PATTERN.matcher(color).matches()) {
|
||||
+ result = color + result;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
char c = input.charAt(index + 1);
|
||||
ChatColor color = getByChar(c);
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Cache the result of Material#isBlock
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 0aa1692731ffb05e812f904459853da6080c3f9f..f8440fd7a7c9a00124cb387c6ba3b0973df0d145 100644
|
||||
index 9117bbfb5208231752cfa757c0d088bc270d43b9..f0f81ecad42fc3dc894ec0c150346206d70a8720 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -4348,6 +4348,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..74ef8395cc040ce488c2acaa416db202
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index f8440fd7a7c9a00124cb387c6ba3b0973df0d145..1afeac98a9facbe25edc9a96d906b31d8327f047 100644
|
||||
index f0f81ecad42fc3dc894ec0c150346206d70a8720..467282a76dbf2edfd88baa4275991ae1163c0919 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -4414,6 +4414,17 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
@ -5,7 +5,7 @@ Subject: [PATCH] Attributes API for item defaults
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 1afeac98a9facbe25edc9a96d906b31d8327f047..a2a5c3d6ab37dd5908ba5dbd228e8ad4bea2f799 100644
|
||||
index 467282a76dbf2edfd88baa4275991ae1163c0919..31ec16d134fd8eb5607d18e17f93225eef402d7e 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -4425,6 +4425,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
@ -23,7 +23,7 @@ index aa534b1a9a1fb84a2fbd4b372f313bb4b63325fa..43b53c21af01e0f496c8aaacff82dfdf
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index cc61e030f1bdb4d1ef52a0a1ae4983f95d2460fd..9ab91154c74b5a3001cf4d5df1b4ae1e26508b60 100644
|
||||
index 16536dae04b020de43f9e13ff32c659b9e6cab0c..72f7bf02ec1ace2c835e4ad58e3e59b3d7357972 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -546,6 +546,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user