diff --git a/src/main/java/com/minelittlepony/unicopia/UnicopiaMixinPlugin.java b/src/main/java/com/minelittlepony/unicopia/UnicopiaMixinPlugin.java index 48dcf6b7..df5394d9 100644 --- a/src/main/java/com/minelittlepony/unicopia/UnicopiaMixinPlugin.java +++ b/src/main/java/com/minelittlepony/unicopia/UnicopiaMixinPlugin.java @@ -35,6 +35,9 @@ public class UnicopiaMixinPlugin implements IMixinConfigPlugin { if (mixinClassName.indexOf("ad_astra") != -1) { return FabricLoader.getInstance().isModLoaded("ad_astra"); } + if (mixinClassName.indexOf("minelp") != -1) { + return FabricLoader.getInstance().isModLoaded("minelp"); + } } return true; } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/client/minelp/MixinPonyPosture.java b/src/main/java/com/minelittlepony/unicopia/mixin/client/minelp/MixinPonyPosture.java new file mode 100644 index 00000000..618907d7 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/mixin/client/minelp/MixinPonyPosture.java @@ -0,0 +1,22 @@ +package com.minelittlepony.unicopia.mixin.client.minelp; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import com.minelittlepony.api.pony.PonyPosture; +import com.minelittlepony.unicopia.Race; +import com.minelittlepony.unicopia.entity.player.Pony; + +import net.minecraft.entity.LivingEntity; + +@Mixin(PonyPosture.class) +abstract class MixinPonyPosture { + @Inject(method = "isPartiallySubmerged", at = @At("HEAD"), cancellable = true) + private static void isPartiallySubmerged(LivingEntity entity, CallbackInfoReturnable info) { + if (Pony.of(entity).filter(pony -> pony.getCompositeRace().includes(Race.SEAPONY)).isPresent()) { + info.setReturnValue(true); + } + } +} diff --git a/src/main/resources/unicopia.mixin.json b/src/main/resources/unicopia.mixin.json index b85f5823..0c6d99ef 100644 --- a/src/main/resources/unicopia.mixin.json +++ b/src/main/resources/unicopia.mixin.json @@ -78,6 +78,7 @@ "client.MixinTranslationStorage", "client.MixinWorldRenderer", "client.sodium.MixinSodiumWorldRenderer", + "client.minelp.MixinPonyPosture", "trinkets.MixinTrinketCreativeSlot" ], "injectors": {