aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/notnite/gloppers/GlobUtil.java10
-rw-r--r--src/main/java/com/notnite/gloppers/mixin/HopperBlockEntityMixin.java2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/com/notnite/gloppers/GlobUtil.java b/src/main/java/com/notnite/gloppers/GlobUtil.java
index 38d0e44..2ae051c 100644
--- a/src/main/java/com/notnite/gloppers/GlobUtil.java
+++ b/src/main/java/com/notnite/gloppers/GlobUtil.java
@@ -4,6 +4,16 @@ import java.util.BitSet;
public class GlobUtil {
+ public static boolean matchGlobSequence(String name, String globs) {
+ int nextSplit, lastSplit = 0;
+ while ((nextSplit = globs.indexOf(',', lastSplit)) > 0) {
+ if (matchGlob(name, globs.substring(lastSplit, nextSplit)))
+ return true;
+ lastSplit = nextSplit + 1;
+ }
+ return matchGlob(name, globs.substring(lastSplit));
+ }
+
/**
* Match a string against a glob.
*/
diff --git a/src/main/java/com/notnite/gloppers/mixin/HopperBlockEntityMixin.java b/src/main/java/com/notnite/gloppers/mixin/HopperBlockEntityMixin.java
index 06eb93e..52cbdcc 100644
--- a/src/main/java/com/notnite/gloppers/mixin/HopperBlockEntityMixin.java
+++ b/src/main/java/com/notnite/gloppers/mixin/HopperBlockEntityMixin.java
@@ -44,7 +44,7 @@ public abstract class HopperBlockEntityMixin {
var itemName = itemRegistryEntry.get().getValue().getPath();
// Check if itemstack matches glob
- if (!GlobUtil.matchGlob(itemName, glob)) return false;
+ if (!GlobUtil.matchGlobSequence(itemName, glob)) return false;
return true;
}