mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +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
08482e72bb
commit
0d1524d04f
4 changed files with 3 additions and 37 deletions
|
@ -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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/ChatColor.java
|
||||
+++ b/src/main/java/org/bukkit/ChatColor.java
|
||||
@@ -0,0 +0,0 @@ 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.
|
||||
*
|
||||
@@ -0,0 +0,0 @@ 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);
|
||||
|
|
@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
- return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled);
|
||||
+ return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
|
||||
} else if (sourceType == DamageTypes.OUT_OF_WORLD) {
|
||||
} else if (source.is(DamageTypes.OUT_OF_WORLD)) {
|
||||
EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions);
|
||||
event.setCancelled(cancelled);
|
||||
@@ -0,0 +0,0 @@ public class CraftEventFactory {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 2651717c7d47696a774dfbe3ba1db6c6cfb8a4c5
|
||||
Subproject commit 2b4582fb6538a04313af12510624853d02250aba
|
|
@ -1 +1 @@
|
|||
Subproject commit dbc32ffa0667ee6d02771283f19c7ccf8c965563
|
||||
Subproject commit f7707086d107d825109234dd3020e22558dd1378
|
Loading…
Reference in a new issue