File tree Expand file tree Collapse file tree 2 files changed +32
-30
lines changed
src/main/java/com/falsepattern/lib/mixin Expand file tree Collapse file tree 2 files changed +32
-30
lines changed Original file line number Diff line number Diff line change @@ -21,27 +21,28 @@ default boolean shouldLoad(List<ITargetedMod> loadedMods) {
21
21
&& getFilter ().test (loadedMods );
22
22
}
23
23
24
- static Predicate <List <ITargetedMod >> never () {
25
- return (list ) -> false ;
24
+ final class PredicateHelpers {
25
+ public static Predicate <List <ITargetedMod >> never () {
26
+ return (list ) -> false ;
27
+ }
28
+
29
+ public static Predicate <List <ITargetedMod >> condition (Supplier <Boolean > condition ) {
30
+ return (list ) -> condition .get ();
31
+ }
32
+
33
+ public static Predicate <List <ITargetedMod >> always () {
34
+ return (list ) -> true ;
35
+ }
36
+
37
+ public static Predicate <List <ITargetedMod >> require (ITargetedMod mod ) {
38
+ return (list ) -> list .contains (mod );
39
+ }
40
+
41
+ public static Predicate <List <ITargetedMod >> avoid (ITargetedMod mod ) {
42
+ return (list ) -> !list .contains (mod );
43
+ }
26
44
}
27
45
28
- static Predicate <List <ITargetedMod >> condition (Supplier <Boolean > condition ) {
29
- return (list ) -> condition .get ();
30
- }
31
-
32
- static Predicate <List <ITargetedMod >> always () {
33
- return (list ) -> true ;
34
- }
35
-
36
- static Predicate <List <ITargetedMod >> require (ITargetedMod mod ) {
37
- return (list ) -> list .contains (mod );
38
- }
39
-
40
- static Predicate <List <ITargetedMod >> avoid (ITargetedMod mod ) {
41
- return (list ) -> !list .contains (mod );
42
- }
43
-
44
-
45
46
enum Side {
46
47
COMMON ,
47
48
CLIENT ,
Original file line number Diff line number Diff line change 6
6
import java .util .function .Predicate ;
7
7
8
8
public interface ITargetedMod {
9
- static Predicate <String > startsWith (String subString ) {
10
- return (name ) -> name .startsWith (subString );
11
- }
12
- static Predicate <String > contains (String subString ) {
13
- return (name ) -> name .contains (subString );
14
- }
15
- static Predicate <String > matches (String regex ) {
16
- return (name ) -> name .matches (regex );
17
- }
18
9
19
10
String getModName ();
20
11
Predicate <String > getCondition ();
@@ -28,7 +19,17 @@ default boolean isMatchingJar(Path path) {
28
19
return "jar" .equals (fileExtension ) && getCondition ().test (nameLowerCase );
29
20
}
30
21
31
- default String toStringDefault () {
32
- return String .format ("TargetedMod{%s}" , getModName ());
22
+ final class PredicateHelpers {
23
+ public static Predicate <String > startsWith (String subString ) {
24
+ return (name ) -> name .startsWith (subString );
25
+ }
26
+
27
+ public static Predicate <String > contains (String subString ) {
28
+ return (name ) -> name .contains (subString );
29
+ }
30
+
31
+ public static Predicate <String > matches (String regex ) {
32
+ return (name ) -> name .matches (regex );
33
+ }
33
34
}
34
35
}
You can’t perform that action at this time.
0 commit comments