|
1 | 1 | package net.blay09.mods.shogi.common; |
2 | 2 |
|
3 | | -import net.blay09.mods.shogi.common.effect.compose.*; |
| 3 | +import net.blay09.mods.shogi.common.effect.compose.AggregateEffect; |
| 4 | +import net.blay09.mods.shogi.common.effect.compose.AndEffect; |
| 5 | +import net.blay09.mods.shogi.common.effect.compose.AnyEffect; |
| 6 | +import net.blay09.mods.shogi.common.effect.compose.ConditionEffect; |
4 | 7 | import net.blay09.mods.shogi.common.effect.condition.context.player.AnyHand; |
5 | | -import net.blay09.mods.shogi.common.effect.condition.entity.HasEntityTag; |
6 | | -import net.blay09.mods.shogi.common.effect.condition.entity.IsOnAnyVehicle; |
7 | | -import net.blay09.mods.shogi.common.effect.condition.entity.IsOnVehicle; |
| 8 | +import net.blay09.mods.shogi.common.effect.condition.entity.*; |
8 | 9 | import net.blay09.mods.shogi.common.effect.condition.item.HasEnchantment; |
9 | 10 | import net.blay09.mods.shogi.common.effect.condition.item.IsItem; |
10 | 11 | import net.blay09.mods.shogi.common.effect.condition.player.HasItem; |
11 | | -import net.blay09.mods.shogi.common.effect.condition.player.HasMobEffect; |
12 | | -import net.blay09.mods.shogi.common.effect.condition.player.IsPlayer; |
| 12 | +import net.blay09.mods.shogi.common.effect.condition.player.SimplePlayerEffects; |
13 | 13 | import net.blay09.mods.shogi.common.effect.condition.pos.*; |
14 | | -import net.blay09.mods.shogi.common.effect.condition.pos.CanSeeSky; |
15 | | -import net.blay09.mods.shogi.common.effect.condition.pos.IsDimension; |
16 | 14 | import net.blay09.mods.shogi.common.effect.context.player.OffHand; |
| 15 | +import net.blay09.mods.shogi.common.effect.cost.DamageItem; |
17 | 16 | import net.blay09.mods.shogi.common.effect.cost.ExperienceLevelCost; |
18 | 17 | import net.blay09.mods.shogi.common.effect.cost.ExperiencePointsCost; |
19 | 18 | import net.blay09.mods.shogi.common.effect.cost.ItemCost; |
20 | | -import net.blay09.mods.shogi.common.effect.cost.DamageItem; |
21 | 19 | import net.blay09.mods.shogi.common.effect.failure.Failure; |
| 20 | +import net.blay09.mods.shogi.common.effect.player.Dismount; |
22 | 21 | import net.blay09.mods.shogi.common.effect.server.condition.player.HasAdvancement; |
23 | 22 | import net.blay09.mods.shogi.common.effect.server.condition.pos.IsNearPoi; |
24 | 23 | import net.blay09.mods.shogi.common.effect.server.cooldown.AddCooldown; |
25 | 24 | import net.blay09.mods.shogi.common.effect.server.cooldown.CooldownCost; |
26 | 25 | import net.blay09.mods.shogi.common.effect.server.cooldown.HasCooldown; |
27 | | -import net.blay09.mods.shogi.common.effect.player.Dismount; |
28 | 26 | import net.blay09.mods.shogi.common.effect.server.cooldown.IsCooldownAbove; |
29 | 27 | import net.blay09.mods.shogi.common.effect.variable.*; |
30 | 28 | import net.blay09.mods.shogi.common.network.ShogiNetworkCacheImpl; |
|
33 | 31 | import net.blay09.mods.shogi.effect.EmptyEffect; |
34 | 32 | import net.blay09.mods.shogi.scope.ShogiScope; |
35 | 33 |
|
36 | | -import java.util.*; |
| 34 | +import java.util.List; |
| 35 | + |
| 36 | +import static net.blay09.mods.shogi.common.ShogiCommon.id; |
37 | 37 |
|
38 | 38 | public class ShogiDefaults { |
39 | 39 |
|
@@ -63,15 +63,17 @@ private static void registerEffects(ShogiScope scope) { |
63 | 63 | scope.registerEffect(OffHand.IDENTIFIER, OffHand.mapCodec(scope), List.of("effect")); |
64 | 64 |
|
65 | 65 | scope.registerEffect(HasEntityTag.IDENTIFIER, HasEntityTag.MAP_CODEC, List.of("tag")); |
| 66 | + scope.registerEffect(HasMobEffect.IDENTIFIER, HasMobEffect.MAP_CODEC, List.of("effect")); |
66 | 67 | scope.registerEffect(IsOnAnyVehicle.IDENTIFIER, IsOnAnyVehicle.MAP_CODEC); |
67 | 68 | scope.registerEffect(IsOnVehicle.IDENTIFIER, IsOnVehicle.MAP_CODEC, List.of("vehicle")); |
| 69 | + scope.registerEffect(IsPlayer.IDENTIFIER, IsPlayer.MAP_CODEC); |
68 | 70 |
|
69 | 71 | scope.registerEffect(HasEnchantment.IDENTIFIER, HasEnchantment.MAP_CODEC, List.of("enchantment", "level")); |
70 | 72 | scope.registerEffect(IsItem.IDENTIFIER, IsItem.MAP_CODEC, List.of("item")); |
71 | 73 |
|
72 | 74 | scope.registerEffect(HasItem.IDENTIFIER, HasItem.mapCodec(scope), List.of("item", "count")); |
73 | | - scope.registerEffect(HasMobEffect.IDENTIFIER, HasMobEffect.MAP_CODEC, List.of("effect")); |
74 | | - scope.registerEffect(IsPlayer.IDENTIFIER, IsPlayer.MAP_CODEC); |
| 75 | + scope.registerSimpleEffect(id("has_empty_inventory"), SimplePlayerEffects::hasEmptyInventory); |
| 76 | + scope.registerSimpleEffect(id("is_wearing_any_armor"), SimplePlayerEffects::isWearingAnyArmor); |
75 | 77 |
|
76 | 78 | scope.registerEffect(CanSeeSky.IDENTIFIER, CanSeeSky.MAP_CODEC); |
77 | 79 | scope.registerEffect(IsAboveY.IDENTIFIER, IsAboveY.MAP_CODEC, List.of("y")); |
|
0 commit comments