mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-21 20:18:01 +01:00
Add some compatibility for unicopia
This commit is contained in:
parent
3b3b1740fe
commit
2d6f0cce2e
4 changed files with 35 additions and 1 deletions
|
@ -3,6 +3,8 @@ package com.minelittlepony.api.model;
|
|||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface IPart {
|
||||
/**
|
||||
* Sets the model's various rotation angles.
|
||||
|
@ -11,6 +13,13 @@ public interface IPart {
|
|||
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
default void setRotationAndAngles(boolean goingFast, UUID interpolatorId, float limbAngle, float limbSpeed, float bodySwing, float animationProgress) {
|
||||
Compat.attributes.isGoingFast = goingFast;
|
||||
Compat.attributes.interpolatorId = interpolatorId;
|
||||
setPartAngles(Compat.attributes, limbAngle, limbSpeed, bodySwing, animationProgress);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders this model component.
|
||||
*/
|
||||
|
@ -22,4 +31,14 @@ public interface IPart {
|
|||
default void setVisible(boolean visible, ModelAttributes attributes) {
|
||||
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
default void setVisible(boolean visible) {
|
||||
setVisible(visible, Compat.attributes);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
class Compat {
|
||||
public static ModelAttributes attributes = new ModelAttributes();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ public class ModelAttributes {
|
|||
* Unique id of the interpolator used for this model.
|
||||
* Usually the UUID of the entity being rendered.
|
||||
*/
|
||||
private UUID interpolatorId = UUID.randomUUID();
|
||||
UUID interpolatorId = UUID.randomUUID();
|
||||
|
||||
/**
|
||||
* The actual, visible height of this model when rendered.
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.util.Hand;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.minelittlepony.api.model.ModelAttributes;
|
||||
import com.minelittlepony.api.model.IPart;
|
||||
import com.minelittlepony.api.model.fabric.PonyModelPrepareCallback;
|
||||
import com.minelittlepony.api.pony.IPony;
|
||||
import com.minelittlepony.api.pony.IPonyData;
|
||||
|
@ -48,6 +49,7 @@ public abstract class ClientPonyModel<T extends LivingEntity> extends MsonPlayer
|
|||
|
||||
@Override
|
||||
public void updateLivingState(T entity, IPony pony, ModelAttributes.Mode mode) {
|
||||
IPart.Compat.attributes = attributes;
|
||||
child = entity.isBaby();
|
||||
attributes.updateLivingState(entity, pony, mode);
|
||||
PonyModelPrepareCallback.EVENT.invoker().onPonyModelPrepared(entity, this, mode);
|
||||
|
|
|
@ -21,6 +21,17 @@ import net.minecraft.util.math.RotationAxis;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
public class LevitatingItemRenderer {
|
||||
@Deprecated
|
||||
private static int COLOR;
|
||||
@Deprecated
|
||||
public static boolean isEnabled() {
|
||||
return false;
|
||||
}
|
||||
@Deprecated
|
||||
public static RenderLayer getRenderLayer(Identifier texture) {
|
||||
return MagicGlow.getColoured(texture, COLOR);
|
||||
}
|
||||
|
||||
private VertexConsumerProvider getProvider(IPony pony, VertexConsumerProvider renderContext) {
|
||||
final int color = pony.metadata().getGlowColor();
|
||||
return layer -> {
|
||||
|
@ -41,6 +52,8 @@ public class LevitatingItemRenderer {
|
|||
|
||||
IPony pony = IPony.getManager().getPony((PlayerEntity)entity);
|
||||
|
||||
COLOR = pony.metadata().getGlowColor();
|
||||
|
||||
matrix.push();
|
||||
|
||||
boolean doMagic = MineLittlePony.getInstance().getConfig().fpsmagic.get() && pony.hasMagic();
|
||||
|
|
Loading…
Reference in a new issue