2019-11-23 23:19:13 +02:00
|
|
|
package com.minelittlepony.client.hdskins;
|
2019-05-28 19:02:07 +02:00
|
|
|
|
2022-01-13 11:33:53 +02:00
|
|
|
import net.minecraft.client.world.ClientWorld;
|
|
|
|
|
2022-12-08 20:53:30 +00:00
|
|
|
import com.minelittlepony.api.pony.IPony;
|
2021-05-16 16:20:02 +02:00
|
|
|
import com.minelittlepony.api.pony.IPonyManager;
|
2020-11-10 22:49:30 +02:00
|
|
|
import com.minelittlepony.client.IPreviewModel;
|
2022-12-08 21:19:40 +00:00
|
|
|
import com.minelittlepony.client.render.EquineRenderManager;
|
2022-12-08 01:53:59 +00:00
|
|
|
import com.minelittlepony.hdskins.client.dummy.*;
|
2019-05-28 19:02:07 +02:00
|
|
|
|
2022-12-11 01:09:16 +00:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2019-05-28 19:02:07 +02:00
|
|
|
/**
|
|
|
|
* Dummy model used for the skin uploading screen.
|
|
|
|
*/
|
2023-03-27 16:45:39 +01:00
|
|
|
class DummyPony extends DummyPlayer implements IPreviewModel, IPonyManager.ForcedPony, EquineRenderManager.RegistrationHandler {
|
2019-05-28 19:02:07 +02:00
|
|
|
|
2022-12-08 01:53:59 +00:00
|
|
|
public DummyPony(ClientWorld world, PlayerSkins<?> textures) {
|
2022-01-13 11:33:53 +02:00
|
|
|
super(world, textures);
|
2022-12-11 01:09:16 +00:00
|
|
|
setUuid(UUID.randomUUID()); // uuid must be random so animations aren't linked between the two previews
|
2019-05-28 19:02:07 +02:00
|
|
|
}
|
|
|
|
|
2021-06-20 19:17:01 +02:00
|
|
|
@Override
|
2022-12-08 20:53:30 +00:00
|
|
|
public boolean shouldUpdateRegistration(IPony pony) {
|
2021-06-20 19:17:01 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-11-10 22:49:30 +02:00
|
|
|
@Override
|
|
|
|
public boolean isSubmergedInWater() {
|
2022-12-08 01:53:59 +00:00
|
|
|
return getTextures().getPosture().getActiveSkinType() == MineLPHDSkins.seaponySkinType || super.isSubmergedInWater();
|
2020-11-10 22:49:30 +02:00
|
|
|
}
|
2019-05-28 19:02:07 +02:00
|
|
|
|
2020-11-10 22:49:30 +02:00
|
|
|
@Override
|
|
|
|
public String getModel() {
|
2022-12-08 01:53:59 +00:00
|
|
|
if (getTextures().getPosture().getActiveSkinType() == MineLPHDSkins.seaponySkinType) {
|
2020-11-10 22:49:30 +02:00
|
|
|
return getTextures().usesThinSkin() ? "slimseapony" : "seapony";
|
2019-05-28 19:02:07 +02:00
|
|
|
}
|
2022-12-11 00:38:00 +00:00
|
|
|
return IPony.getManager()
|
2020-11-10 22:49:30 +02:00
|
|
|
.getPony(this)
|
2022-12-08 20:53:30 +00:00
|
|
|
.metadata()
|
2022-11-03 00:46:04 +01:00
|
|
|
.getRace()
|
2022-11-23 21:32:25 +00:00
|
|
|
.getModelId(getTextures().usesThinSkin());
|
2019-05-28 19:02:07 +02:00
|
|
|
}
|
|
|
|
}
|