mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 04:27:59 +01:00
Update mson
This commit is contained in:
parent
9d65185fcd
commit
475e96726e
6 changed files with 14 additions and 36 deletions
|
@ -21,6 +21,6 @@ org.gradle.daemon=false
|
|||
|
||||
# Dependencies
|
||||
modmenu_version=7.1.0
|
||||
kirin_version=1.15.2
|
||||
hd_skins_version=6.10.0+1.20
|
||||
mson_version=1.8.1
|
||||
kirin_version=1.15.4+1.20
|
||||
hd_skins_version=6.10.3+1.20
|
||||
mson_version=1.9.2+1.20.1
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.minelittlepony.client.mixin;
|
||||
|
||||
import com.minelittlepony.api.pony.IPony;
|
||||
import com.minelittlepony.client.pony.Pony;
|
||||
import com.minelittlepony.client.render.EquineRenderManager;
|
||||
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
package com.minelittlepony.client.mixin;
|
||||
|
||||
import com.minelittlepony.api.model.PreviewModel;
|
||||
import com.minelittlepony.api.pony.IPony;
|
||||
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(EntityRenderDispatcher.class)
|
||||
abstract class MixinEntityRenderDispatcher {
|
||||
@Redirect(
|
||||
method = "getRenderer(Lnet/minecraft/entity/Entity;)Lnet/minecraft/client/render/entity/EntityRenderer;",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/client/network/AbstractClientPlayerEntity;getModel()Ljava/lang/String;"))
|
||||
private String getPlayerModel(AbstractClientPlayerEntity player, Entity entity) {
|
||||
if (player instanceof PreviewModel) {
|
||||
return player.getModel();
|
||||
}
|
||||
return IPony.getManager()
|
||||
.getPony(player)
|
||||
.race()
|
||||
.getModelId(player.getModel().contains("slim"));
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.minelittlepony.client.render;
|
|||
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.minelittlepony.api.pony.IPony;
|
||||
import com.minelittlepony.api.pony.meta.Race;
|
||||
import com.minelittlepony.client.mixin.MixinEntityRenderers;
|
||||
import com.minelittlepony.client.model.IPonyModel;
|
||||
|
@ -19,6 +20,7 @@ import net.minecraft.client.render.entity.model.EntityModel;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
/**
|
||||
* Render manager responsible for replacing and restoring entity renderers when the client settings change.
|
||||
|
@ -55,8 +57,14 @@ public class PonyRenderDispatcher {
|
|||
}
|
||||
|
||||
private void addPlayerSkin(EntityRenderDispatcher manager, boolean slimArms, Race race) {
|
||||
String modelId = race.getModelId(slimArms);
|
||||
Mson.getInstance().getEntityRendererRegistry().registerPlayerRenderer(
|
||||
race.getModelId(slimArms),
|
||||
new Identifier("minelittlepony", race.getModelId(slimArms)),
|
||||
player -> {
|
||||
return IPony.getManager()
|
||||
.getPony(player)
|
||||
.race().getModelId(slimArms).equalsIgnoreCase(modelId);
|
||||
},
|
||||
ModelType.getPlayerModel(race).getFactory(slimArms)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,8 @@
|
|||
"fabric-api-base": ">=0.1.0",
|
||||
"fabric-lifecycle-events-v1": ">=0.1.0",
|
||||
"fabric-resource-loader-v0": ">=0.1.0",
|
||||
"kirin": "*"
|
||||
"kirin": "*",
|
||||
"mson": "*"
|
||||
},
|
||||
"suggests": {
|
||||
"hdskins": "*",
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
"IResizeable",
|
||||
"MixinCamera",
|
||||
"MixinDefaultSkinHelper",
|
||||
"MixinEntityRenderDispatcher",
|
||||
"MixinEntityRenderers",
|
||||
"MixinSkullBlockEntityRenderer",
|
||||
"MixinHeldItemRenderer",
|
||||
|
|
Loading…
Reference in a new issue