mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-12-01 16:27:59 +01:00
Convert the gear to mson
This commit is contained in:
parent
3b38ec908c
commit
45577a76d0
6 changed files with 36 additions and 1 deletions
|
@ -7,12 +7,13 @@ import net.minecraft.client.render.VertexConsumer;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
|
||||||
import com.minelittlepony.model.gear.IGear;
|
import com.minelittlepony.model.gear.IGear;
|
||||||
|
import com.minelittlepony.mson.api.MsonModel;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public abstract class AbstractGear extends Model implements IGear {
|
public abstract class AbstractGear extends Model implements IGear, MsonModel {
|
||||||
|
|
||||||
private final List<ModelPart> parts = new ArrayList<>();
|
private final List<ModelPart> parts = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
import com.minelittlepony.model.BodyPart;
|
import com.minelittlepony.model.BodyPart;
|
||||||
import com.minelittlepony.model.IModel;
|
import com.minelittlepony.model.IModel;
|
||||||
|
import com.minelittlepony.mson.api.ModelContext;
|
||||||
import com.minelittlepony.pony.meta.Wearable;
|
import com.minelittlepony.pony.meta.Wearable;
|
||||||
import com.minelittlepony.util.math.Color;
|
import com.minelittlepony.util.math.Color;
|
||||||
|
|
||||||
|
@ -38,6 +39,12 @@ public class ChristmasHat extends AbstractGear {
|
||||||
|
|
||||||
private int tint;
|
private int tint;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(ModelContext context) {
|
||||||
|
left = context.findByName("left");
|
||||||
|
right = context.findByName("right");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRender(IModel model, Entity entity) {
|
public boolean canRender(IModel model, Entity entity) {
|
||||||
return isChristmasDay() || model.isWearing(Wearable.ANTLERS);
|
return isChristmasDay() || model.isWearing(Wearable.ANTLERS);
|
||||||
|
|
|
@ -6,12 +6,18 @@ import net.minecraft.util.Identifier;
|
||||||
import com.minelittlepony.model.BodyPart;
|
import com.minelittlepony.model.BodyPart;
|
||||||
import com.minelittlepony.model.IModel;
|
import com.minelittlepony.model.IModel;
|
||||||
import com.minelittlepony.model.gear.IStackable;
|
import com.minelittlepony.model.gear.IStackable;
|
||||||
|
import com.minelittlepony.mson.api.ModelContext;
|
||||||
import com.minelittlepony.pony.meta.Wearable;
|
import com.minelittlepony.pony.meta.Wearable;
|
||||||
|
|
||||||
public class Muffin extends AbstractGear implements IStackable {
|
public class Muffin extends AbstractGear implements IStackable {
|
||||||
|
|
||||||
private static final Identifier TEXTURE = new Identifier("minelittlepony", "textures/models/muffin.png");
|
private static final Identifier TEXTURE = new Identifier("minelittlepony", "textures/models/muffin.png");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(ModelContext context) {
|
||||||
|
accept(context.findByName("crown"));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRender(IModel model, Entity entity) {
|
public boolean canRender(IModel model, Entity entity) {
|
||||||
return model.isWearing(Wearable.MUFFIN);
|
return model.isWearing(Wearable.MUFFIN);
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.minelittlepony.client.util.render.Part;
|
||||||
import com.minelittlepony.model.BodyPart;
|
import com.minelittlepony.model.BodyPart;
|
||||||
import com.minelittlepony.model.IModel;
|
import com.minelittlepony.model.IModel;
|
||||||
import com.minelittlepony.model.IPegasus;
|
import com.minelittlepony.model.IPegasus;
|
||||||
|
import com.minelittlepony.mson.api.ModelContext;
|
||||||
import com.minelittlepony.pony.meta.Race;
|
import com.minelittlepony.pony.meta.Race;
|
||||||
import com.minelittlepony.pony.meta.Wearable;
|
import com.minelittlepony.pony.meta.Wearable;
|
||||||
|
|
||||||
|
@ -32,6 +33,13 @@ public class SaddleBags extends AbstractGear {
|
||||||
|
|
||||||
private IModel model;
|
private IModel model;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(ModelContext context) {
|
||||||
|
strap = context.findByName("strap");
|
||||||
|
leftBag = context.findByName("left_bag");
|
||||||
|
rightBag = context.findByName("right_bag");
|
||||||
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void init(float yOffset, float stretch) {
|
public void init(float yOffset, float stretch) {
|
||||||
leftBag = new Part(this, 56, 19);
|
leftBag = new Part(this, 56, 19);
|
||||||
|
|
|
@ -6,11 +6,17 @@ import net.minecraft.util.Identifier;
|
||||||
import com.minelittlepony.model.BodyPart;
|
import com.minelittlepony.model.BodyPart;
|
||||||
import com.minelittlepony.model.IModel;
|
import com.minelittlepony.model.IModel;
|
||||||
import com.minelittlepony.model.gear.IStackable;
|
import com.minelittlepony.model.gear.IStackable;
|
||||||
|
import com.minelittlepony.mson.api.ModelContext;
|
||||||
import com.minelittlepony.pony.meta.Wearable;
|
import com.minelittlepony.pony.meta.Wearable;
|
||||||
|
|
||||||
public class Stetson extends AbstractGear implements IStackable {
|
public class Stetson extends AbstractGear implements IStackable {
|
||||||
private static final Identifier TEXTURE = new Identifier("minelittlepony", "textures/models/stetson.png");
|
private static final Identifier TEXTURE = new Identifier("minelittlepony", "textures/models/stetson.png");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(ModelContext context) {
|
||||||
|
accept(context.findByName("rim"));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BodyPart getGearLocation() {
|
public BodyPart getGearLocation() {
|
||||||
return BodyPart.HEAD;
|
return BodyPart.HEAD;
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.minelittlepony.client.util.render.Part;
|
||||||
import com.minelittlepony.model.BodyPart;
|
import com.minelittlepony.model.BodyPart;
|
||||||
import com.minelittlepony.model.IModel;
|
import com.minelittlepony.model.IModel;
|
||||||
import com.minelittlepony.model.gear.IStackable;
|
import com.minelittlepony.model.gear.IStackable;
|
||||||
|
import com.minelittlepony.mson.api.ModelContext;
|
||||||
import com.minelittlepony.pony.meta.Wearable;
|
import com.minelittlepony.pony.meta.Wearable;
|
||||||
|
|
||||||
public class WitchHat extends AbstractGear implements IStackable {
|
public class WitchHat extends AbstractGear implements IStackable {
|
||||||
|
@ -16,6 +17,12 @@ public class WitchHat extends AbstractGear implements IStackable {
|
||||||
|
|
||||||
private ModelPart witchHat;
|
private ModelPart witchHat;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(ModelContext context) {
|
||||||
|
witchHat = context.findByName("witch_hat");
|
||||||
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void init(float yOffset, float stretch) {
|
public void init(float yOffset, float stretch) {
|
||||||
accept(witchHat = new Part(this).size(64, 128));
|
accept(witchHat = new Part(this).size(64, 128));
|
||||||
|
|
Loading…
Reference in a new issue