Force ponies to use the seapony model (if they have one) when they are a seapony in unicopia

This commit is contained in:
Sollace 2023-11-25 21:27:29 +00:00
parent e44347e8ed
commit ea78257ffd
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
3 changed files with 26 additions and 0 deletions

View file

@ -35,6 +35,9 @@ public class UnicopiaMixinPlugin implements IMixinConfigPlugin {
if (mixinClassName.indexOf("ad_astra") != -1) { if (mixinClassName.indexOf("ad_astra") != -1) {
return FabricLoader.getInstance().isModLoaded("ad_astra"); return FabricLoader.getInstance().isModLoaded("ad_astra");
} }
if (mixinClassName.indexOf("minelp") != -1) {
return FabricLoader.getInstance().isModLoaded("minelp");
}
} }
return true; return true;
} }

View file

@ -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<Boolean> info) {
if (Pony.of(entity).filter(pony -> pony.getCompositeRace().includes(Race.SEAPONY)).isPresent()) {
info.setReturnValue(true);
}
}
}

View file

@ -78,6 +78,7 @@
"client.MixinTranslationStorage", "client.MixinTranslationStorage",
"client.MixinWorldRenderer", "client.MixinWorldRenderer",
"client.sodium.MixinSodiumWorldRenderer", "client.sodium.MixinSodiumWorldRenderer",
"client.minelp.MixinPonyPosture",
"trinkets.MixinTrinketCreativeSlot" "trinkets.MixinTrinketCreativeSlot"
], ],
"injectors": { "injectors": {