File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
common/src/main/java/net/modgarden/silicate/api/condition Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change 1- ## Added
2- - ` EntityProjectileOwnerCondition ` - Checks the owner of a projectile entity/` TraceableEntity ` (mojmap).
3- - ` EntityTameOwnerCondition ` - Checks the owner of a tamed entity/` OwnableEntity ` (mojmap).
1+ ## Fixed
2+ - Fixed GameConditions being unable to be sent from the server to clients.
Original file line number Diff line number Diff line change @@ -32,14 +32,7 @@ public interface GameCondition<T extends GameCondition<T>> extends Predicate<Gam
3232 Codec <GameCondition <?>> TYPED_CODEC = SilicateBuiltInRegistries .GAME_CONDITION_TYPE .byNameCodec ()
3333 .dispatch ("type" , GameCondition ::getType , GameConditionType ::codec );
3434 @ SuppressWarnings ("unchecked" ) // We use ConditionTemplate which uses raw types. Everything is checked at runtime.
35- Codec <GameCondition <?>> CODEC = Codec .either (ResourceLocation .CODEC , TYPED_CODEC )
36- .flatComapMap (
37- either -> either .map (
38- ConditionTemplate ::new ,
39- Function .identity ()
40- ),
41- condition -> DataResult .error (() -> "Cannot convert pre-existing GameCondition to ResourceLocation" )
42- );
35+ Codec <GameCondition <?>> CODEC = Codec .withAlternative (TYPED_CODEC , ResourceLocation .CODEC , ConditionTemplate ::new );
4336
4437 @ Override
4538 boolean test (GameContext context );
You can’t perform that action at this time.
0 commit comments