mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Update HDSkins
This commit is contained in:
parent
96c48383e0
commit
bb63d2ef04
7 changed files with 6 additions and 153 deletions
|
@ -19,5 +19,5 @@ org.gradle.daemon=false
|
||||||
# Dependencies
|
# Dependencies
|
||||||
modmenu_version=1.12.+
|
modmenu_version=1.12.+
|
||||||
kirin_version=1.6.4-1.16-rc1-1.16-SNAPSHOT
|
kirin_version=1.6.4-1.16-rc1-1.16-SNAPSHOT
|
||||||
hd_skins_version=6.1.4-1.16-rc1-1.16-SNAPSHOT
|
hd_skins_version=6.2-1.16-rc1-1.16-SNAPSHOT
|
||||||
mson_version=1.2-1.16-rc1-1.16-SNAPSHOT
|
mson_version=1.2-1.16-rc1-1.16-SNAPSHOT
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package com.minelittlepony.client.hdskins;
|
package com.minelittlepony.client.hdskins;
|
||||||
|
|
||||||
import net.minecraft.entity.EntityType;
|
|
||||||
import net.minecraft.entity.SpawnGroup;
|
|
||||||
|
|
||||||
import com.minelittlepony.hdskins.client.dummy.DummyPlayer;
|
import com.minelittlepony.hdskins.client.dummy.DummyPlayer;
|
||||||
import com.minelittlepony.hdskins.client.dummy.TextureProxy;
|
import com.minelittlepony.hdskins.client.dummy.TextureProxy;
|
||||||
import com.minelittlepony.hdskins.profile.SkinType;
|
import com.minelittlepony.hdskins.profile.SkinType;
|
||||||
|
@ -14,16 +11,10 @@ import com.minelittlepony.model.IRotatedSwimmer;
|
||||||
*/
|
*/
|
||||||
class DummyPony extends DummyPlayer implements IRotatedSwimmer {
|
class DummyPony extends DummyPlayer implements IRotatedSwimmer {
|
||||||
|
|
||||||
public static EntityType<DummyPony> TYPE = EntityType.Builder
|
|
||||||
.<DummyPony>create((t, w) -> new DummyPony(t, null), SpawnGroup.MISC)
|
|
||||||
.disableSaving()
|
|
||||||
.disableSummon()
|
|
||||||
.build("minelittlepony:dummy_pony");
|
|
||||||
|
|
||||||
public boolean wet = false;
|
public boolean wet = false;
|
||||||
|
|
||||||
public DummyPony(EntityType<DummyPony> type, TextureProxy textures) {
|
public DummyPony(TextureProxy textures) {
|
||||||
super(type, textures);
|
super(textures);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWet(boolean wet) {
|
public void setWet(boolean wet) {
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
package com.minelittlepony.client.hdskins;
|
|
||||||
|
|
||||||
import com.minelittlepony.client.model.entity.race.EarthPonyModel;
|
|
||||||
|
|
||||||
class DummyPonyModel extends EarthPonyModel<DummyPony> {
|
|
||||||
public DummyPonyModel(boolean smallArms) {
|
|
||||||
super(smallArms);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,126 +0,0 @@
|
||||||
package com.minelittlepony.client.hdskins;
|
|
||||||
|
|
||||||
import com.minelittlepony.api.pony.IPony;
|
|
||||||
import com.minelittlepony.api.pony.meta.Race;
|
|
||||||
import com.minelittlepony.client.MineLittlePony;
|
|
||||||
import com.minelittlepony.client.model.ClientPonyModel;
|
|
||||||
import com.minelittlepony.client.model.ModelType;
|
|
||||||
import com.minelittlepony.client.model.ModelWrapper;
|
|
||||||
import com.minelittlepony.client.render.IPonyRenderContext;
|
|
||||||
import com.minelittlepony.client.render.EquineRenderManager;
|
|
||||||
import com.minelittlepony.client.render.entity.feature.GearFeature;
|
|
||||||
import com.minelittlepony.client.render.entity.feature.GlowingItemFeature;
|
|
||||||
import com.minelittlepony.client.render.entity.feature.ArmourFeature;
|
|
||||||
import com.minelittlepony.client.render.entity.feature.ElytraFeature;
|
|
||||||
import com.minelittlepony.hdskins.client.dummy.DummyPlayerRenderer;
|
|
||||||
import com.minelittlepony.hdskins.profile.SkinType;
|
|
||||||
import com.minelittlepony.mson.api.ModelKey;
|
|
||||||
|
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.render.entity.feature.FeatureRenderer;
|
|
||||||
import net.minecraft.client.render.entity.model.PlayerEntityModel;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renderer used for the dummy pony model when selecting a skin.
|
|
||||||
*/
|
|
||||||
class DummyPonyRenderer extends DummyPlayerRenderer<DummyPony, ClientPonyModel<DummyPony>> implements IPonyRenderContext<DummyPony, ClientPonyModel<DummyPony>> {
|
|
||||||
|
|
||||||
protected final EquineRenderManager<DummyPony, ClientPonyModel<DummyPony>> manager = new EquineRenderManager<>(this);
|
|
||||||
|
|
||||||
public DummyPonyRenderer(EntityRenderDispatcher dispatcher) {
|
|
||||||
super(dispatcher, null);
|
|
||||||
addFeature(new GearFeature<>(this));
|
|
||||||
|
|
||||||
manager.setModel(ModelType.EARTH_PONY.getKey(false));
|
|
||||||
manager.setSkipBlend();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ModelWrapper<DummyPony, ClientPonyModel<DummyPony>> getModelWrapper() {
|
|
||||||
return manager.playerModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IPony getEntityPony(DummyPony entity) {
|
|
||||||
return MineLittlePony.getInstance().getManager().getPony(getTexture(entity));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void scale(DummyPony entity, MatrixStack stack, float tickDelta) {
|
|
||||||
manager.preRenderCallback(entity, stack, tickDelta);
|
|
||||||
if (getModel() instanceof PlayerEntityModel) {
|
|
||||||
((PlayerEntityModel<?>)getModel()).setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entity.isSwimming()) {
|
|
||||||
if (entity.getVelocity().x < 100) {
|
|
||||||
entity.addVelocity(100, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
model.getAttributes().motionPitch = 70;
|
|
||||||
} else {
|
|
||||||
model.getAttributes().motionPitch = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getModel().getAttributes().isSitting) {
|
|
||||||
stack.translate(0, entity.getHeightOffset(), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void render(DummyPony entity, float entityYaw, float tickDelta, MatrixStack stack, VertexConsumerProvider renderContext, int lightUv) {
|
|
||||||
super.render(entity, entityYaw, tickDelta, stack, renderContext, lightUv);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClientPonyModel<DummyPony> getEntityModel(DummyPony playermodel) {
|
|
||||||
Identifier loc = getTexture(playermodel);
|
|
||||||
|
|
||||||
boolean slim = playermodel.getTextures().usesThinSkin();
|
|
||||||
|
|
||||||
IPony thePony = MineLittlePony.getInstance().getManager().getPony(loc);
|
|
||||||
|
|
||||||
Race race = thePony.getRace(false);
|
|
||||||
|
|
||||||
boolean canWet = playermodel.wet && (loc == playermodel.getTextures().getBlankSkin(SkinType.SKIN) || race == Race.SEAPONY);
|
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
ModelKey<? extends ClientPonyModel<DummyPony>> key = (ModelKey<? extends ClientPonyModel<DummyPony>>)(canWet ? ModelType.SEA_PONY.getKey(slim) : ModelType.getPlayerModel(thePony.getRace(true)).getKey(slim));
|
|
||||||
|
|
||||||
return manager.setModel(key).apply(thePony.getMetadata()).getBody();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected FeatureRenderer<DummyPony, ClientPonyModel<DummyPony>> getArmourLayer() {
|
|
||||||
return new ArmourFeature<>(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected FeatureRenderer<DummyPony, ClientPonyModel<DummyPony>> getHeldItemLayer() {
|
|
||||||
return new GlowingItemFeature<>(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected FeatureRenderer<DummyPony, ClientPonyModel<DummyPony>> getElytraLayer() {
|
|
||||||
return new ElytraFeature<DummyPony, ClientPonyModel<DummyPony>>(this) {
|
|
||||||
@Override
|
|
||||||
protected Identifier getElytraTexture(DummyPony entity) {
|
|
||||||
return entity.getTextures().get(SkinType.ELYTRA).getId();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public EquineRenderManager<DummyPony, ClientPonyModel<DummyPony>> getInternalRenderer() {
|
|
||||||
return manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identifier findTexture(DummyPony entity) {
|
|
||||||
return getTexture(entity);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,7 +6,7 @@ import com.minelittlepony.common.event.ClientReadyCallback;
|
||||||
import com.minelittlepony.hdskins.client.SkinCacheClearCallback;
|
import com.minelittlepony.hdskins.client.SkinCacheClearCallback;
|
||||||
import com.minelittlepony.hdskins.client.gui.GuiSkins;
|
import com.minelittlepony.hdskins.client.gui.GuiSkins;
|
||||||
import com.minelittlepony.hdskins.profile.SkinType;
|
import com.minelittlepony.hdskins.profile.SkinType;
|
||||||
import com.minelittlepony.mson.api.Mson;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
|
@ -32,9 +32,6 @@ public class MineLPHDSkins extends SkinsProxy implements ClientModInitializer {
|
||||||
// Ponify the skins GUI.
|
// Ponify the skins GUI.
|
||||||
GuiSkins.setSkinsGui(GuiSkinsMineLP::new);
|
GuiSkins.setSkinsGui(GuiSkinsMineLP::new);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Preview on the select skin gui
|
|
||||||
Mson.getInstance().getEntityRendererRegistry().registerEntityRenderer(DummyPony.TYPE, DummyPonyRenderer::new);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,8 +15,8 @@ class PonyPreview extends PlayerPreview {
|
||||||
public static final Identifier NO_SKIN_ALEX_PONY = new Identifier("minelittlepony", "textures/mob/noskin_alex.png");
|
public static final Identifier NO_SKIN_ALEX_PONY = new Identifier("minelittlepony", "textures/mob/noskin_alex.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(DummyPony.TYPE, localTextures);
|
private final DummyPony localPony = new DummyPony(localTextures);
|
||||||
private final DummyPony remotePony = new DummyPony(DummyPony.TYPE, remoteTextures);
|
private final DummyPony remotePony = new DummyPony(remoteTextures);
|
||||||
|
|
||||||
public void setWet(boolean isWet) {
|
public void setWet(boolean isWet) {
|
||||||
localPony.setWet(isWet);
|
localPony.setWet(isWet);
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Loading…
Reference in a new issue