mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-15 17:14:22 +01:00
Fix elytras
This commit is contained in:
parent
e7cb03aa35
commit
7fce6c94a3
4 changed files with 15 additions and 10 deletions
|
@ -89,7 +89,7 @@ public class PlayerPonyRenderer
|
||||||
manager.updateState(entity, (PlayerPonyRenderState)state, mode);
|
manager.updateState(entity, (PlayerPonyRenderState)state, mode);
|
||||||
|
|
||||||
// Rotate cape to align with the pony back
|
// Rotate cape to align with the pony back
|
||||||
state.field_53536 += MathHelper.PI / 2;
|
//state.field_53536 += MathHelper.PI / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final PlayerPonyRenderState getAndUpdateRenderState(AbstractClientPlayerEntity entity, float tickDelta, ModelAttributes.Mode mode) {
|
public final PlayerPonyRenderState getAndUpdateRenderState(AbstractClientPlayerEntity entity, float tickDelta, ModelAttributes.Mode mode) {
|
||||||
|
|
|
@ -19,6 +19,9 @@ import net.minecraft.entity.EquipmentSlot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.equipment.EquipmentModel;
|
import net.minecraft.item.equipment.EquipmentModel;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.util.math.RotationAxis;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
public class ElytraFeature<
|
public class ElytraFeature<
|
||||||
S extends PonyRenderState,
|
S extends PonyRenderState,
|
||||||
|
@ -66,12 +69,13 @@ public class ElytraFeature<
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
protected void preRenderCallback(S state, MatrixStack stack) {
|
protected void preRenderCallback(S state, MatrixStack stack) {
|
||||||
if (state instanceof PonyRenderState ponyState && context instanceof PonyRenderContext context) {
|
if (state instanceof PonyRenderState ponyState && context instanceof PonyRenderContext context) {
|
||||||
stack.translate(0, ponyState.riderOffset, 0.125);
|
stack.translate(0, 0.45F, 0);
|
||||||
|
|
||||||
((ClientPonyModel<PonyRenderState>)context.getEquineManager().getModels().body()).transform(ponyState, BodyPart.BODY, stack);
|
((ClientPonyModel<PonyRenderState>)context.getEquineManager().getModels().body()).transform(ponyState, BodyPart.BODY, stack);
|
||||||
|
stack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(80));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
protected Identifier getElytraTexture(S state) {
|
protected Identifier getElytraTexture(S state) {
|
||||||
if (state instanceof PlayerEntityRenderState playerState) {
|
if (state instanceof PlayerEntityRenderState playerState) {
|
||||||
SkinTextures textures = playerState.skinTextures;
|
SkinTextures textures = playerState.skinTextures;
|
||||||
|
@ -85,6 +89,6 @@ public class ElytraFeature<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TEXTURE;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,6 @@ public class NativeUtil {
|
||||||
if (loadedTexture instanceof NativeImageBackedTexture nibt) {
|
if (loadedTexture instanceof NativeImageBackedTexture nibt) {
|
||||||
NativeImage image = nibt.getImage();
|
NativeImage image = nibt.getImage();
|
||||||
if (image != null) {
|
if (image != null) {
|
||||||
System.out.println("Format of in-memory resource " + resource + " is " + image.getFormat());
|
|
||||||
consumer.accept(image::getColorArgb);
|
consumer.accept(image::getColorArgb);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -116,11 +115,9 @@ public class NativeUtil {
|
||||||
Resource res = mc.getResourceManager().getResource(resource).orElse(null);
|
Resource res = mc.getResourceManager().getResource(resource).orElse(null);
|
||||||
if (res != null) {
|
if (res != null) {
|
||||||
try (InputStream inputStream = res.getInputStream()) {
|
try (InputStream inputStream = res.getInputStream()) {
|
||||||
NativeImage image = NativeImage.read(inputStream);
|
try (NativeImage image = NativeImage.read(inputStream)) {
|
||||||
|
consumer.accept(image::getColorArgb);
|
||||||
System.out.println("Format of stored resource " + resource + " is " + image.getFormat());
|
}
|
||||||
|
|
||||||
consumer.accept(image::getColorArgb);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,16 @@
|
||||||
"texture": {"u": 22, "w": 64, "h": 32},
|
"texture": {"u": 22, "w": 64, "h": 32},
|
||||||
"data": {
|
"data": {
|
||||||
"left_wing": {
|
"left_wing": {
|
||||||
|
"pivot": [ 5, 0, 0 ],
|
||||||
|
"rotate": [0.26, 0, -0.26],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{"from": [-10, 0, 0], "size": [10, 20, 2], "dilate": 1}
|
{"from": [-10, 0, 0], "size": [10, 20, 2], "dilate": 1}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"right_wing": {
|
"right_wing": {
|
||||||
"mirror": true,
|
"mirror": true,
|
||||||
|
"pivot": [-5, 0, 0 ],
|
||||||
|
"rotate": [0.26, 0, -0.26],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{"from": [ 0, 0, 0], "size": [10, 20, 2], "dilate": 1}
|
{"from": [ 0, 0, 0], "size": [10, 20, 2], "dilate": 1}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue