mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 14:27:59 +01:00
1.19.3 -> 1.19.2
This commit is contained in:
parent
493c5f4b7f
commit
67831d232d
20 changed files with 85 additions and 78 deletions
|
@ -3,10 +3,10 @@ org.gradle.daemon=false
|
||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/develop
|
# check these on https://fabricmc.net/develop
|
||||||
minecraft_version=1.19.3
|
minecraft_version=1.19.2
|
||||||
yarn_mappings=1.19.3+build.2
|
yarn_mappings=1.19.2+build.28
|
||||||
loader_version=0.14.11
|
loader_version=0.14.14
|
||||||
fabric_version=0.68.1+1.19.3
|
fabric_version=0.73.2+1.19.2
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
group=com.minelittlepony
|
group=com.minelittlepony
|
||||||
|
@ -15,12 +15,12 @@ org.gradle.daemon=false
|
||||||
description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings.
|
description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings.
|
||||||
|
|
||||||
# Publishing
|
# Publishing
|
||||||
minecraft_version_range=>=1.19.3-pre1
|
minecraft_version_range=>=1.19.2
|
||||||
modrinth_loader_type=fabric
|
modrinth_loader_type=fabric
|
||||||
modrinth_project_id=JBjInUXM
|
modrinth_project_id=JBjInUXM
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
modmenu_version=5.0.0-alpha.3
|
modmenu_version=4.0.6
|
||||||
kirin_version=1.13.2
|
kirin_version=1.13.2+lts
|
||||||
hd_skins_version=6.7.6
|
hd_skins_version=6.7.6+lts
|
||||||
mson_version=1.7.1
|
mson_version=1.6.1
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.minelittlepony.api.model.armour;
|
package com.minelittlepony.api.model.armour;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.registry.Registries;
|
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.util.registry.Registry;
|
||||||
|
|
||||||
import com.minelittlepony.client.model.ModelType;
|
import com.minelittlepony.client.model.ModelType;
|
||||||
import com.minelittlepony.client.model.armour.PonyArmourModel;
|
import com.minelittlepony.client.model.armour.PonyArmourModel;
|
||||||
|
@ -17,11 +17,11 @@ public interface ArmorModelRegistry {
|
||||||
static final Map<Identifier, Optional<ModelKey<PonyArmourModel<?>>>> REGISTRY = new HashMap<>();
|
static final Map<Identifier, Optional<ModelKey<PonyArmourModel<?>>>> REGISTRY = new HashMap<>();
|
||||||
|
|
||||||
public static Optional<ModelKey<PonyArmourModel<?>>> getModelKey(Item item, ArmourLayer layer) {
|
public static Optional<ModelKey<PonyArmourModel<?>>> getModelKey(Item item, ArmourLayer layer) {
|
||||||
Identifier id = Registries.ITEM.getId(item);
|
Identifier id = Registry.ITEM.getId(item);
|
||||||
if (id.getNamespace().equals("minecraft")) {
|
if (id.getNamespace().equals("minecraft")) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
return REGISTRY.computeIfAbsent(id.withPath(p -> "models/armor/" + layer.name().toLowerCase() + "_" + p + ".json"), i -> {
|
return REGISTRY.computeIfAbsent(new Identifier(id.getNamespace(), "models/armor/" + layer.name().toLowerCase() + "_" + id.getPath() + ".json"), i -> {
|
||||||
return Optional.of(Mson.getInstance().registerModel(i, PonyArmourModel::new));
|
return Optional.of(Mson.getInstance().registerModel(i, PonyArmourModel::new));
|
||||||
}).filter(key -> key.getModelData().isPresent());
|
}).filter(key -> key.getModelData().isPresent());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,28 @@
|
||||||
package com.minelittlepony.api.pony;
|
package com.minelittlepony.api.pony;
|
||||||
|
|
||||||
|
import net.minecraft.client.util.DefaultSkinHelper;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import com.minelittlepony.api.config.PonyLevel;
|
||||||
import java.util.Map;
|
import com.minelittlepony.client.MineLittlePony;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
public final class DefaultPonySkinHelper {
|
public final class DefaultPonySkinHelper {
|
||||||
public static final Identifier STEVE = new Identifier("minelittlepony", "textures/entity/player/wide/steve_pony.png");
|
public static final Identifier STEVE = new Identifier("minelittlepony", "textures/entity/player/wide/steve_pony.png");
|
||||||
|
@Deprecated
|
||||||
private static final Map<Identifier, Identifier> SKINS = new HashMap<>();
|
public static final Identifier ALEX = new Identifier("minelittlepony", "textures/entity/player/slim/alex_pony.png");
|
||||||
|
|
||||||
public static Identifier getPonySkin(Identifier original) {
|
public static Identifier getPonySkin(Identifier original) {
|
||||||
return SKINS.computeIfAbsent(original, DefaultPonySkinHelper::computePonySkin);
|
return original.getPath().contains("steve") ? STEVE : ALEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Identifier computePonySkin(Identifier original) {
|
@Deprecated
|
||||||
return new Identifier("minelittlepony", original.getPath().replace(".png", "_pony.png"));
|
public static Identifier getPonySkin(UUID profileId, boolean slimArms) {
|
||||||
|
if (MineLittlePony.getInstance().getConfig().ponyLevel.get() != PonyLevel.PONIES) {
|
||||||
|
return DefaultSkinHelper.getTexture(profileId);
|
||||||
|
}
|
||||||
|
boolean alex = (profileId.hashCode() & 1) == 1;
|
||||||
|
return new Identifier("minelittlepony", "textures/entity/player/" + (slimArms ? "slim" : "wide") + "/" + (alex ? "alex" : "steve") + "_pony.png");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.minelittlepony.client.hdskins;
|
package com.minelittlepony.client.hdskins;
|
||||||
|
|
||||||
|
import net.minecraft.client.util.DefaultSkinHelper;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.client.world.ClientWorld;
|
import net.minecraft.client.world.ClientWorld;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
@ -40,7 +41,8 @@ class PonyPreview extends PlayerPreview {
|
||||||
return DefaultSkinGenerator.generateGreyScale(wearable.getDefaultTexture(), wearable.getDefaultTexture(), getExclusion());
|
return DefaultSkinGenerator.generateGreyScale(wearable.getDefaultTexture(), wearable.getDefaultTexture(), getExclusion());
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getDefaultSkin(type, slim);
|
Identifier skin = getBlankSkin(type, slim);
|
||||||
|
return DefaultSkinGenerator.generateGreyScale(type == SkinType.SKIN ? DefaultPonySkinHelper.getPonySkin(profile.getId(), slim) : skin, skin, getExclusion());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(ClientPlayerEntity.class)
|
@Mixin(ClientPlayerEntity.class)
|
||||||
abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity implements EquineRenderManager.RegistrationHandler {
|
abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity implements EquineRenderManager.RegistrationHandler {
|
||||||
public MixinClientPlayerEntity() { super(null, null); }
|
public MixinClientPlayerEntity() { super(null, null, null); }
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private IPony pony;
|
private IPony pony;
|
||||||
|
|
|
@ -595,12 +595,12 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
@Override
|
@Override
|
||||||
public void transform(BodyPart part, MatrixStack stack) {
|
public void transform(BodyPart part, MatrixStack stack) {
|
||||||
if (attributes.isSleeping || attributes.isRiptide) {
|
if (attributes.isSleeping || attributes.isRiptide) {
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90));
|
||||||
stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180));
|
stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (part == BodyPart.HEAD) {
|
if (part == BodyPart.HEAD) {
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(attributes.motionPitch));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(attributes.motionPitch));
|
||||||
}
|
}
|
||||||
|
|
||||||
PonyTransformation.forSize(getSize()).transform(this, part, stack);
|
PonyTransformation.forSize(getSize()).transform(this, part, stack);
|
||||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.client.render.Frustum;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.util.math.Box;
|
import net.minecraft.util.math.Box;
|
||||||
|
|
||||||
import org.joml.Matrix4f;
|
import net.minecraft.util.math.Matrix4f;
|
||||||
|
|
||||||
import com.minelittlepony.client.PonyBounds;
|
import com.minelittlepony.client.PonyBounds;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.screen.PlayerScreenHandler;
|
||||||
import net.minecraft.util.Arm;
|
import net.minecraft.util.Arm;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.UseAction;
|
import net.minecraft.util.UseAction;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.Vec3f;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class LevitatingItemRenderer {
|
public class LevitatingItemRenderer {
|
||||||
|
@ -140,8 +140,8 @@ public class LevitatingItemRenderer {
|
||||||
distanceChange);
|
distanceChange);
|
||||||
|
|
||||||
if (!handHeldTool) { // bows have to point forwards
|
if (!handHeldTool) { // bows have to point forwards
|
||||||
stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(sign * -60 + floatAmount));
|
stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(sign * -60 + floatAmount));
|
||||||
stack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(sign * 30 + driftAmount));
|
stack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(sign * 30 + driftAmount));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public abstract class MagicGlow extends RenderPhase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final RenderLayer MAGIC = RenderLayer.of("mlp_magic_glow", VertexFormats.POSITION_COLOR_LIGHT, VertexFormat.DrawMode.QUADS, 256, RenderLayer.MultiPhaseParameters.builder()
|
private static final RenderLayer MAGIC = RenderLayer.of("mlp_magic_glow", VertexFormats.POSITION_COLOR_LIGHT, VertexFormat.DrawMode.QUADS, 256, RenderLayer.MultiPhaseParameters.builder()
|
||||||
.program(EYES_PROGRAM)
|
.shader(EYES_SHADER)
|
||||||
.writeMaskState(COLOR_MASK)
|
.writeMaskState(COLOR_MASK)
|
||||||
.depthTest(LEQUAL_DEPTH_TEST)
|
.depthTest(LEQUAL_DEPTH_TEST)
|
||||||
.transparency(LIGHTNING_TRANSPARENCY)
|
.transparency(LIGHTNING_TRANSPARENCY)
|
||||||
|
@ -29,7 +29,7 @@ public abstract class MagicGlow extends RenderPhase {
|
||||||
private static final BiFunction<Identifier, Integer, RenderLayer> TINTED_LAYER = Util.memoize((texture, color) -> {
|
private static final BiFunction<Identifier, Integer, RenderLayer> TINTED_LAYER = Util.memoize((texture, color) -> {
|
||||||
return RenderLayer.of("mlp_tint_layer", VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL, VertexFormat.DrawMode.QUADS, 256, true, true, RenderLayer.MultiPhaseParameters.builder()
|
return RenderLayer.of("mlp_tint_layer", VertexFormats.POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL, VertexFormat.DrawMode.QUADS, 256, true, true, RenderLayer.MultiPhaseParameters.builder()
|
||||||
.texture(new Colored(texture, color))
|
.texture(new Colored(texture, color))
|
||||||
.program(EYES_PROGRAM)
|
.shader(EYES_SHADER)
|
||||||
.writeMaskState(COLOR_MASK)
|
.writeMaskState(COLOR_MASK)
|
||||||
.depthTest(LEQUAL_DEPTH_TEST)
|
.depthTest(LEQUAL_DEPTH_TEST)
|
||||||
.transparency(LIGHTNING_TRANSPARENCY)
|
.transparency(LIGHTNING_TRANSPARENCY)
|
||||||
|
|
|
@ -15,10 +15,9 @@ import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
import net.minecraft.client.render.VertexConsumer;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.Vec3f;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.joml.Vector3f;
|
|
||||||
|
|
||||||
public class MobSkull implements ISkull {
|
public class MobSkull implements ISkull {
|
||||||
private final Identifier texture;
|
private final Identifier texture;
|
||||||
|
@ -50,12 +49,12 @@ public class MobSkull implements ISkull {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAngles(float yaw, float animationProgress) {
|
public void setAngles(float yaw, float animationProgress) {
|
||||||
Vector3f v = new Vector3f(0, -2, 1.99F);
|
Vec3f v = new Vec3f(0, -2, 1.99F);
|
||||||
v.rotate(RotationAxis.POSITIVE_Y.rotationDegrees(yaw));
|
v.rotate(Vec3f.POSITIVE_Y.getDegreesQuaternion(yaw));
|
||||||
ModelPart head = ponyHead.get().getHead();
|
ModelPart head = ponyHead.get().getHead();
|
||||||
head.pivotX = v.x;
|
head.pivotX = v.getX();
|
||||||
head.pivotY = v.y;
|
head.pivotY = v.getY();
|
||||||
head.pivotZ = v.z;
|
head.pivotZ = v.getZ();
|
||||||
ponyHead.get().setVisible(true);
|
ponyHead.get().setVisible(true);
|
||||||
ponyHead.get().setHeadRotation(animationProgress, yaw, 0);
|
ponyHead.get().setHeadRotation(animationProgress, yaw, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,11 +18,10 @@ import net.minecraft.client.render.VertexConsumer;
|
||||||
import net.minecraft.client.util.DefaultSkinHelper;
|
import net.minecraft.client.util.DefaultSkinHelper;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.Uuids;
|
import net.minecraft.util.dynamic.DynamicSerializableUuid;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.Vec3f;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.joml.Vector3f;
|
|
||||||
|
|
||||||
public class PlayerPonySkull implements ISkull {
|
public class PlayerPonySkull implements ISkull {
|
||||||
private AbstractPonyModel<?> ponyHead;
|
private AbstractPonyModel<?> ponyHead;
|
||||||
|
@ -46,7 +45,7 @@ public class PlayerPonySkull implements ISkull {
|
||||||
return skin;
|
return skin;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefaultSkinHelper.getTexture(Uuids.getUuidFromProfile(profile));
|
return DefaultSkinHelper.getTexture(DynamicSerializableUuid.getUuidFromProfile(profile));
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefaultSkinHelper.getTexture();
|
return DefaultSkinHelper.getTexture();
|
||||||
|
@ -65,11 +64,11 @@ public class PlayerPonySkull implements ISkull {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAngles(float yaw, float animationProgress) {
|
public void setAngles(float yaw, float animationProgress) {
|
||||||
Vector3f v = new Vector3f(0, -2, 2);
|
Vec3f v = new Vec3f(0, -2, 2);
|
||||||
v.rotate(RotationAxis.POSITIVE_Y.rotationDegrees(yaw));
|
v.rotate(Vec3f.POSITIVE_Y.getDegreesQuaternion(yaw));
|
||||||
ponyHead.getHead().pivotX = v.x;
|
ponyHead.getHead().pivotX = v.getX();
|
||||||
ponyHead.getHead().pivotY = v.y;
|
ponyHead.getHead().pivotY = v.getY();
|
||||||
ponyHead.getHead().pivotZ = v.z;
|
ponyHead.getHead().pivotZ = v.getZ();
|
||||||
ponyHead.setVisible(true);
|
ponyHead.setVisible(true);
|
||||||
ponyHead.setHeadRotation(animationProgress, yaw, 0);
|
ponyHead.setHeadRotation(animationProgress, yaw, 0);
|
||||||
deadMau5.get().setHeadRotation(animationProgress, yaw, 0);
|
deadMau5.get().setHeadRotation(animationProgress, yaw, 0);
|
||||||
|
|
|
@ -99,9 +99,9 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen
|
||||||
float yaw = MathHelper.lerpAngleDegrees(tickDelta, entity.prevBodyYaw, entity.bodyYaw);
|
float yaw = MathHelper.lerpAngleDegrees(tickDelta, entity.prevBodyYaw, entity.bodyYaw);
|
||||||
float l = entity.getWidth() / 2 * manager.getPony(entity).metadata().getSize().getScaleFactor();
|
float l = entity.getWidth() / 2 * manager.getPony(entity).metadata().getSize().getScaleFactor();
|
||||||
|
|
||||||
stack.multiply(RotationAxis.NEGATIVE_Y.rotationDegrees(yaw));
|
stack.multiply(Vec3f.NEGATIVE_Y.getDegreesQuaternion(yaw));
|
||||||
stack.translate(0, 0, -l);
|
stack.translate(0, 0, -l);
|
||||||
stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(yaw));
|
stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(yaw));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import com.minelittlepony.client.render.entity.feature.HeldItemFeature;
|
||||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.Vec3f;
|
||||||
import net.minecraft.entity.mob.WitchEntity;
|
import net.minecraft.entity.mob.WitchEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Arm;
|
import net.minecraft.util.Arm;
|
||||||
|
@ -27,7 +27,7 @@ public class WitchRenderer extends PonyRenderer<WitchEntity, WitchPonyModel> {
|
||||||
@Override
|
@Override
|
||||||
protected void preItemRender(WitchEntity entity, ItemStack drop, ModelTransformation.Mode transform, Arm hand, MatrixStack stack) {
|
protected void preItemRender(WitchEntity entity, ItemStack drop, ModelTransformation.Mode transform, Arm hand, MatrixStack stack) {
|
||||||
super.preItemRender(entity, drop, transform, hand, stack);
|
super.preItemRender(entity, drop, transform, hand, stack);
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(10));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(10));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,11 +60,11 @@ public class CapeFeature<M extends ClientPonyModel<AbstractClientPlayerEntity>>
|
||||||
float camera = MathHelper.lerp(tickDelta, player.prevStrideDistance, player.strideDistance);
|
float camera = MathHelper.lerp(tickDelta, player.prevStrideDistance, player.strideDistance);
|
||||||
capeMotionY += MathHelper.sin(MathHelper.lerp(tickDelta, player.prevHorizontalSpeed, player.horizontalSpeed) * 6) * 32 * camera;
|
capeMotionY += MathHelper.sin(MathHelper.lerp(tickDelta, player.prevHorizontalSpeed, player.horizontalSpeed) * 6) * 32 * camera;
|
||||||
|
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(2 + capeMotionX / 12 + capeMotionY));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(2 + capeMotionX / 12 + capeMotionY));
|
||||||
stack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees( diagMotion / 2));
|
stack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion( diagMotion / 2));
|
||||||
stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-diagMotion / 2));
|
stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(-diagMotion / 2));
|
||||||
stack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(180));
|
stack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(180));
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90));
|
||||||
|
|
||||||
VertexConsumer vertices = renderContext.getBuffer(RenderLayer.getEntitySolid(player.getCapeTexture()));
|
VertexConsumer vertices = renderContext.getBuffer(RenderLayer.getEntitySolid(player.getCapeTexture()));
|
||||||
model.renderCape(stack, vertices, lightUv, OverlayTexture.DEFAULT_UV);
|
model.renderCape(stack, vertices, lightUv, OverlayTexture.DEFAULT_UV);
|
||||||
|
|
|
@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Arm;
|
import net.minecraft.util.Arm;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.UseAction;
|
import net.minecraft.util.UseAction;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.Vec3f;
|
||||||
|
|
||||||
public class HeldItemFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
|
public class HeldItemFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
|
||||||
|
|
||||||
|
@ -85,9 +85,9 @@ public class HeldItemFeature<T extends LivingEntity, M extends EntityModel<T> &
|
||||||
}
|
}
|
||||||
if (main == arm) {
|
if (main == arm) {
|
||||||
stack.translate(left * -0.05F, 0.5F, 0.7F);
|
stack.translate(left * -0.05F, 0.5F, 0.7F);
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-60));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(-60));
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-90));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(-90));
|
||||||
stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(left * 180));
|
stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(left * 180));
|
||||||
stack.translate(left * -0.2F, 0.125F, -1);
|
stack.translate(left * -0.2F, 0.125F, -1);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -98,8 +98,8 @@ public class HeldItemFeature<T extends LivingEntity, M extends EntityModel<T> &
|
||||||
stack.translate(left / 10, -0.2F, -0.5F);
|
stack.translate(left / 10, -0.2F, -0.5F);
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-90));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(-90));
|
||||||
stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(left * 180));
|
stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(left * 180));
|
||||||
stack.translate(left * -0.2F, 0.125F, -1);
|
stack.translate(left * -0.2F, 0.125F, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,11 @@ import net.minecraft.client.render.entity.ParrotEntityRenderer;
|
||||||
import net.minecraft.client.render.entity.model.EntityModelLayers;
|
import net.minecraft.client.render.entity.model.EntityModelLayers;
|
||||||
import net.minecraft.client.render.entity.model.ParrotEntityModel;
|
import net.minecraft.client.render.entity.model.ParrotEntityModel;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
import net.minecraft.entity.passive.ParrotEntity;
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.nbt.NbtCompound;
|
import net.minecraft.nbt.NbtCompound;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.util.math.Vec3f;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.BodyPart;
|
import com.minelittlepony.api.model.BodyPart;
|
||||||
import com.minelittlepony.client.model.ClientPonyModel;
|
import com.minelittlepony.client.model.ClientPonyModel;
|
||||||
|
@ -43,7 +42,7 @@ public class PassengerFeature<T extends PlayerEntity, M extends ClientPonyModel<
|
||||||
private Optional<Identifier> getShoulderParrot(NbtCompound tag) {
|
private Optional<Identifier> getShoulderParrot(NbtCompound tag) {
|
||||||
return EntityType.get(tag.getString("id"))
|
return EntityType.get(tag.getString("id"))
|
||||||
.filter(p -> p == EntityType.PARROT)
|
.filter(p -> p == EntityType.PARROT)
|
||||||
.map(type -> ParrotEntityRenderer.getTexture(ParrotEntity.Variant.byIndex(tag.getInt("Variant"))));
|
.map(type -> ParrotEntityRenderer.TEXTURES[tag.getInt("Variant")]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderShoulderParrot(MatrixStack stack, VertexConsumerProvider renderContext, int light, T entity, float limbDistance, float limbAngle, float headYaw, float headPitch, Identifier texture, int sigma) {
|
private void renderShoulderParrot(MatrixStack stack, VertexConsumerProvider renderContext, int light, T entity, float limbDistance, float limbAngle, float headYaw, float headPitch, Identifier texture, int sigma) {
|
||||||
|
@ -55,7 +54,7 @@ public class PassengerFeature<T extends PlayerEntity, M extends ClientPonyModel<
|
||||||
sigma * 0.25,
|
sigma * 0.25,
|
||||||
entity.isInSneakingPose() ? -0.9 : -1.2,
|
entity.isInSneakingPose() ? -0.9 : -1.2,
|
||||||
0.45);
|
0.45);
|
||||||
stack.multiply(RotationAxis.NEGATIVE_Z.rotationDegrees(sigma * -5));
|
stack.multiply(Vec3f.NEGATIVE_Z.getDegreesQuaternion(sigma * -5));
|
||||||
|
|
||||||
VertexConsumer buffer = renderContext.getBuffer(model.getLayer(texture));
|
VertexConsumer buffer = renderContext.getBuffer(model.getLayer(texture));
|
||||||
model.poseOnShoulder(stack, buffer, light, OverlayTexture.DEFAULT_UV, limbDistance, limbAngle, headYaw, headPitch, entity.age);
|
model.poseOnShoulder(stack, buffer, light, OverlayTexture.DEFAULT_UV, limbDistance, limbAngle, headYaw, headPitch, entity.age);
|
||||||
|
|
|
@ -19,7 +19,7 @@ import net.minecraft.client.render.entity.model.EntityModel;
|
||||||
import net.minecraft.client.render.entity.model.EntityModelLoader;
|
import net.minecraft.client.render.entity.model.EntityModelLoader;
|
||||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.Vec3f;
|
||||||
import net.minecraft.entity.EquipmentSlot;
|
import net.minecraft.entity.EquipmentSlot;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.item.ArmorItem;
|
import net.minecraft.item.ArmorItem;
|
||||||
|
@ -71,7 +71,7 @@ public class SkullFeature<T extends LivingEntity, M extends EntityModel<T> & IPo
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderBlock(MatrixStack stack, VertexConsumerProvider renderContext, T entity, ItemStack itemstack, int lightUv) {
|
private void renderBlock(MatrixStack stack, VertexConsumerProvider renderContext, T entity, ItemStack itemstack, int lightUv) {
|
||||||
stack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180));
|
stack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180));
|
||||||
stack.scale(0.625F, -0.625F, -0.625F);
|
stack.scale(0.625F, -0.625F, -0.625F);
|
||||||
stack.translate(0, 0.6F, -0.21F);
|
stack.translate(0, 0.6F, -0.21F);
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ import net.minecraft.client.render.entity.model.EntityModel;
|
||||||
import net.minecraft.client.render.entity.model.ModelWithHat;
|
import net.minecraft.client.render.entity.model.ModelWithHat;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.registry.Registries;
|
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.village.VillagerData;
|
import net.minecraft.village.VillagerData;
|
||||||
import net.minecraft.village.VillagerDataContainer;
|
import net.minecraft.village.VillagerDataContainer;
|
||||||
import net.minecraft.village.VillagerProfession;
|
import net.minecraft.village.VillagerProfession;
|
||||||
|
@ -56,9 +56,9 @@ class NpcClothingFeature<
|
||||||
M entityModel = getContextModel();
|
M entityModel = getContextModel();
|
||||||
|
|
||||||
if (entity.isBaby() || data.getProfession() == VillagerProfession.NONE) {
|
if (entity.isBaby() || data.getProfession() == VillagerProfession.NONE) {
|
||||||
Identifier typeSkin = createTexture("type", Registries.VILLAGER_TYPE.getId(data.getType()));
|
Identifier typeSkin = createTexture("type", Registry.VILLAGER_TYPE.getId(data.getType()));
|
||||||
if (!ResourceUtil.textureExists(typeSkin)) {
|
if (!ResourceUtil.textureExists(typeSkin)) {
|
||||||
typeSkin = createTexture("type", Registries.VILLAGER_TYPE.getId(VillagerType.PLAINS));
|
typeSkin = createTexture("type", Registry.VILLAGER_TYPE.getId(VillagerType.PLAINS));
|
||||||
}
|
}
|
||||||
renderModel(entityModel, typeSkin, matrixStack, provider, i, entity, 1, 1, 1);
|
renderModel(entityModel, typeSkin, matrixStack, provider, i, entity, 1, 1, 1);
|
||||||
} else {
|
} else {
|
||||||
|
@ -71,8 +71,8 @@ class NpcClothingFeature<
|
||||||
VillagerProfession profession = data.getProfession();
|
VillagerProfession profession = data.getProfession();
|
||||||
int level = MathHelper.clamp(data.getLevel(), 1, LEVEL_TO_ID.size());
|
int level = MathHelper.clamp(data.getLevel(), 1, LEVEL_TO_ID.size());
|
||||||
|
|
||||||
Identifier typeId = Registries.VILLAGER_TYPE.getId(type);
|
Identifier typeId = Registry.VILLAGER_TYPE.getId(type);
|
||||||
Identifier profId = Registries.VILLAGER_PROFESSION.getId(profession);
|
Identifier profId = Registry.VILLAGER_PROFESSION.getId(profession);
|
||||||
|
|
||||||
Identifier key = new Identifier("minelittlepony", (typeId + "/" + profId + "/" + level).replace(':', '_'));
|
Identifier key = new Identifier("minelittlepony", (typeId + "/" + profId + "/" + level).replace(':', '_'));
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ class NpcClothingFeature<
|
||||||
}
|
}
|
||||||
|
|
||||||
public Identifier createTexture(VillagerDataContainer entity, String category) {
|
public Identifier createTexture(VillagerDataContainer entity, String category) {
|
||||||
return createTexture(category, Registries.VILLAGER_PROFESSION.getId(entity.getVillagerData().getProfession()));
|
return createTexture(category, Registry.VILLAGER_PROFESSION.getId(entity.getVillagerData().getProfession()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Identifier createTexture(String category, Identifier identifier) {
|
private Identifier createTexture(String category, Identifier identifier) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.minelittlepony.client.transform;
|
package com.minelittlepony.client.transform;
|
||||||
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.Vec3f;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.IModel;
|
import com.minelittlepony.api.model.IModel;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import net.minecraft.entity.LivingEntity;
|
||||||
public class PostureElytra implements PonyPosture<LivingEntity> {
|
public class PostureElytra implements PonyPosture<LivingEntity> {
|
||||||
@Override
|
@Override
|
||||||
public void transform(IModel model, LivingEntity entity, MatrixStack stack, double motionX, double motionY, double motionZ, float yaw, float ticks) {
|
public void transform(IModel model, LivingEntity entity, MatrixStack stack, double motionX, double motionY, double motionZ, float yaw, float ticks) {
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90));
|
||||||
stack.translate(0, model.getAttributes().isCrouching ? 0.2F : -1, 0);
|
stack.translate(0, model.getAttributes().isCrouching ? 0.2F : -1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import com.minelittlepony.common.util.animation.MotionCompositor;
|
||||||
|
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.Vec3f;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
|
||||||
public class PostureFlight extends MotionCompositor implements PonyPosture<PlayerEntity> {
|
public class PostureFlight extends MotionCompositor implements PonyPosture<PlayerEntity> {
|
||||||
|
@ -22,7 +22,7 @@ public class PostureFlight extends MotionCompositor implements PonyPosture<Playe
|
||||||
|
|
||||||
roll = model.getMetadata().getInterpolator(player.getUuid()).interpolate("pegasusRoll", roll, 10);
|
roll = model.getMetadata().getInterpolator(player.getUuid()).interpolate("pegasusRoll", roll, 10);
|
||||||
|
|
||||||
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(model.getAttributes().motionPitch));
|
stack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(model.getAttributes().motionPitch));
|
||||||
stack.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(roll));
|
stack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(roll));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue