mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Fixed crash when switching the the alex model on the skins gui
This commit is contained in:
parent
2dada0e88f
commit
a8ccee47e1
3 changed files with 14 additions and 6 deletions
|
@ -1,5 +1,8 @@
|
||||||
package com.minelittlepony.client.hdskins;
|
package com.minelittlepony.client.hdskins;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityCategory;
|
||||||
|
import net.minecraft.entity.EntityType;
|
||||||
|
|
||||||
import com.minelittlepony.hdskins.dummy.DummyPlayer;
|
import com.minelittlepony.hdskins.dummy.DummyPlayer;
|
||||||
import com.minelittlepony.hdskins.dummy.TextureProxy;
|
import com.minelittlepony.hdskins.dummy.TextureProxy;
|
||||||
import com.minelittlepony.hdskins.profile.SkinType;
|
import com.minelittlepony.hdskins.profile.SkinType;
|
||||||
|
@ -10,10 +13,16 @@ import com.minelittlepony.hdskins.resources.LocalTexture;
|
||||||
*/
|
*/
|
||||||
class DummyPony extends DummyPlayer {
|
class DummyPony extends DummyPlayer {
|
||||||
|
|
||||||
|
public static EntityType<DummyPony> TYPE = EntityType.Builder
|
||||||
|
.<DummyPony>create((t, w) -> new DummyPony(t, null), EntityCategory.MISC)
|
||||||
|
.disableSaving()
|
||||||
|
.disableSummon()
|
||||||
|
.build("minelittlepony:dummy_pony");
|
||||||
|
|
||||||
public boolean wet = false;
|
public boolean wet = false;
|
||||||
|
|
||||||
public DummyPony(TextureProxy textures) {
|
public DummyPony(EntityType<DummyPony> type, TextureProxy textures) {
|
||||||
super(textures);
|
super(type, textures);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWet(boolean wet) {
|
public void setWet(boolean wet) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.minelittlepony.client.MineLittlePony;
|
||||||
import com.minelittlepony.client.SkinsProxy;
|
import com.minelittlepony.client.SkinsProxy;
|
||||||
import com.minelittlepony.common.event.ClientReadyCallback;
|
import com.minelittlepony.common.event.ClientReadyCallback;
|
||||||
import com.minelittlepony.hdskins.SkinCacheClearCallback;
|
import com.minelittlepony.hdskins.SkinCacheClearCallback;
|
||||||
import com.minelittlepony.hdskins.dummy.DummyPlayer;
|
|
||||||
import com.minelittlepony.mson.api.Mson;
|
import com.minelittlepony.mson.api.Mson;
|
||||||
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
@ -23,7 +22,7 @@ class MineLPHDSkins {
|
||||||
ClientReadyCallback.EVENT.register(this::postInit);
|
ClientReadyCallback.EVENT.register(this::postInit);
|
||||||
|
|
||||||
// Preview on the select skin gui
|
// Preview on the select skin gui
|
||||||
Mson.getInstance().getEntityRendererRegistry().registerEntityRenderer(DummyPlayer.TYPE, DummyPonyRenderer::new);
|
Mson.getInstance().getEntityRendererRegistry().registerEntityRenderer(DummyPony.TYPE, DummyPonyRenderer::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void postInit(MinecraftClient minecraft) {
|
private void postInit(MinecraftClient minecraft) {
|
||||||
|
|
|
@ -14,8 +14,8 @@ class PonyPreview extends PlayerPreview {
|
||||||
public static final Identifier NO_SKIN_PONY = new Identifier("minelittlepony", "textures/mob/noskin.png");
|
public static final Identifier NO_SKIN_PONY = new Identifier("minelittlepony", "textures/mob/noskin.png");
|
||||||
public static final Identifier NO_SKIN_SEAPONY = new Identifier("minelittlepony", "textures/mob/noskin_seapony.png");
|
public static final Identifier NO_SKIN_SEAPONY = new Identifier("minelittlepony", "textures/mob/noskin_seapony.png");
|
||||||
|
|
||||||
private final DummyPony localPony = new DummyPony(localTextures);
|
private final DummyPony localPony = new DummyPony(DummyPony.TYPE, localTextures);
|
||||||
private final DummyPony remotePony = new DummyPony(remoteTextures);
|
private final DummyPony remotePony = new DummyPony(DummyPony.TYPE, remoteTextures);
|
||||||
|
|
||||||
public void setWet(boolean isWet) {
|
public void setWet(boolean isWet) {
|
||||||
localPony.setWet(isWet);
|
localPony.setWet(isWet);
|
||||||
|
|
Loading…
Reference in a new issue