Skip to content

Commit

Permalink
Updated Upstream (Paper)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@11c3963 Improve Recipe validation (#10707)
PaperMC/Paper@0688f21 Better way to keep paper datapack enabled
  • Loading branch information
granny committed May 13, 2024
1 parent 3e944ed commit da953af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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 = org.purpurmc.purpur
version = 1.20.6-R0.1-SNAPSHOT

mcVersion = 1.20.6
paperCommit = f041f48458e6d81a54895e988867c0b738922d4d
paperCommit = 0688f212f534f7ef8d9146b595f38e4c2b2eba42

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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 db8bcc66bdc4bedfffb4705db6338eda4c0ad29a..feda3ddfaaf37b6ee218a0e0b1fbc199899bd364 100644
index c143b0d8b97d514566bac8413d0346cf50822aeb..032a21766ce91471cb7d91b663d70e0d9fa66a26 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;
Expand All @@ -16,23 +16,23 @@ index db8bcc66bdc4bedfffb4705db6338eda4c0ad29a..feda3ddfaaf37b6ee218a0e0b1fbc199

/**
* Represents a potential item match within a recipe. All choices within a
@@ -150,6 +151,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@@ -157,6 +158,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));
@@ -194,6 +196,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@@ -206,6 +208,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;
@@ -203,6 +206,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@@ -215,6 +218,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
return false;
}

Expand Down

0 comments on commit da953af

Please sign in to comment.