File tree 5 files changed +14
-6
lines changed
src/main/java/com/provismet/CombatPlusCore/enchantment/loot/condition
5 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 10
10
import net .minecraft .loot .context .LootContext ;
11
11
import net .minecraft .loot .context .LootContextParameters ;
12
12
13
- public record IsDualWeaponCondition () implements ItemCondition {
13
+ public record IsDualWeaponCondition () implements ItemCondition {
14
14
public static final MapCodec <IsDualWeaponCondition > CODEC = MapCodec .unit (IsDualWeaponCondition ::new );
15
15
16
16
@ Override
@@ -23,4 +23,8 @@ public boolean test (LootContext lootContext) {
23
23
ItemStack item = lootContext .get (LootContextParameters .TOOL );
24
24
return item .isIn (CPCItemTags .DUAL_WEAPON ) || item .getItem () instanceof DualWeapon ;
25
25
}
26
+
27
+ public static ItemCondition .Builder builder () {
28
+ return IsDualWeaponCondition ::new ;
29
+ }
26
30
}
Original file line number Diff line number Diff line change 10
10
import net .minecraft .loot .context .LootContext ;
11
11
import net .minecraft .loot .context .LootContextParameters ;
12
12
13
- public record IsMeleeWeaponCondition () implements ItemCondition {
13
+ public record IsMeleeWeaponCondition () implements ItemCondition {
14
14
public static final MapCodec <IsMeleeWeaponCondition > CODEC = MapCodec .unit (IsMeleeWeaponCondition ::new );
15
15
16
16
@ Override
Original file line number Diff line number Diff line change @@ -28,4 +28,8 @@ public boolean test (LootContext lootContext) {
28
28
if (predicate .isPresent ()) return predicate .get ().test (lootContext .get (LootContextParameters .TOOL ));
29
29
return false ;
30
30
}
31
+
32
+ public static ItemCondition .Builder builder (Identifier function ) {
33
+ return () -> new ItemLambdaCondition (function );
34
+ }
31
35
}
Original file line number Diff line number Diff line change @@ -38,15 +38,15 @@ public Set<LootContextParameter<?>> getRequiredParameters() {
38
38
return SingleEntityCondition .getExtendedRequiredParameters ();
39
39
}
40
40
41
- public SingleEntityCondition .Builder builder (ItemCondition condition ) {
41
+ public static SingleEntityCondition .Builder builder (ItemCondition condition ) {
42
42
return () -> new ApplyToItem (condition );
43
43
}
44
44
45
- public SingleEntityCondition .Builder builder (ItemCondition .Builder condition ) {
45
+ public static SingleEntityCondition .Builder builder (ItemCondition .Builder condition ) {
46
46
return () -> new ApplyToItem (condition .build ());
47
47
}
48
48
49
- public SingleEntityCondition .Builder builder (MatchToolLootCondition condition ) {
49
+ public static SingleEntityCondition .Builder builder (MatchToolLootCondition condition ) {
50
50
return () -> new ApplyToItem ((condition ));
51
51
}
52
52
}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public boolean test (LootContext lootContext) {
35
35
else return predicate .get ().test (entity );
36
36
}
37
37
38
- SingleEntityCondition .Builder builder (Identifier function ) {
38
+ public static SingleEntityCondition .Builder builder (Identifier function ) {
39
39
return () -> new SingleEntityLambdaCondition (function );
40
40
}
41
41
}
You can’t perform that action at this time.
0 commit comments