mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
[ci skip] inline fqn imports
This commit is contained in:
@@ -5,18 +5,10 @@ Subject: [PATCH] ChatColor conveniences
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -31,7 +23,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());
|
||||
+ }
|
||||
|
||||
@@ -5,18 +5,10 @@ Subject: [PATCH] Add predicate to recipe's ExactChoice ingredient
|
||||
|
||||
|
||||
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 1cd6601c9d2e86ef850011fcb9e59811207b4af7..81c563d44c311ea1b49425d93c57f46beb4a2ef9 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 {
|
||||
@@ -180,6 +180,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||
public static class ExactChoice implements RecipeChoice {
|
||||
|
||||
private List<ItemStack> choices;
|
||||
@@ -24,7 +16,7 @@ index 1cd6601c9d2e86ef850011fcb9e59811207b4af7..5ec7d9dab1935bb743e3264d9f739079
|
||||
|
||||
public ExactChoice(@NotNull ItemStack stack) {
|
||||
this(Arrays.asList(stack));
|
||||
@@ -229,6 +231,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||
@@ -229,6 +230,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||
|
||||
@Override
|
||||
public boolean test(@NotNull ItemStack t) {
|
||||
@@ -32,17 +24,17 @@ index 1cd6601c9d2e86ef850011fcb9e59811207b4af7..5ec7d9dab1935bb743e3264d9f739079
|
||||
for (ItemStack match : choices) {
|
||||
if (t.isSimilar(match)) {
|
||||
return true;
|
||||
@@ -238,6 +241,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
|
||||
@@ -238,6 +240,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
|
||||
|
||||
Reference in New Issue
Block a user