mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Move saddlebags away from pure white and do ABSOLUTELY NOTHING ELSE
This commit is contained in:
parent
bc04d43f3c
commit
153d32af3f
5 changed files with 73 additions and 7 deletions
|
@ -0,0 +1,49 @@
|
||||||
|
package com.minelittlepony.model.components;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureManager;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
|
import com.minelittlepony.model.capabilities.IModelPart;
|
||||||
|
import com.minelittlepony.render.PonyRenderer;
|
||||||
|
|
||||||
|
public class Muffin implements IModelPart {
|
||||||
|
|
||||||
|
private static final ResourceLocation TEXTURE = new ResourceLocation("minelittlepony", "textures/models/muffin.png");
|
||||||
|
|
||||||
|
private PonyRenderer crown;
|
||||||
|
|
||||||
|
AbstractPonyModel model;
|
||||||
|
|
||||||
|
public Muffin(AbstractPonyModel model) {
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(float yOffset, float stretch) {
|
||||||
|
crown = new PonyRenderer(model, 0, 0).size(64, 44)
|
||||||
|
.around(-4, -12, -6)
|
||||||
|
.box(0, 0, 0, 8, 4, 8, stretch)
|
||||||
|
.box(3, -1.5F, 3, 2, 2, 2, stretch)
|
||||||
|
.tex(0, 12).box(1.5F, -1, 1.5F, 5, 1, 5, stretch)
|
||||||
|
.tex(0, 18).box(2, 1, 1, 4, 7, 6, stretch)
|
||||||
|
.tex(0, 18).box(1, 1, 2, 6, 7, 4, stretch);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderPart(float scale) {
|
||||||
|
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||||
|
|
||||||
|
TextureManager tex = Minecraft.getMinecraft().getRenderManager().renderEngine;
|
||||||
|
tex.bindTexture(TEXTURE);
|
||||||
|
|
||||||
|
crown.render(scale);
|
||||||
|
|
||||||
|
GlStateManager.popAttrib();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -5,7 +5,8 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.monster.EntityZombieVillager;
|
import net.minecraft.entity.monster.EntityZombieVillager;
|
||||||
import net.minecraft.entity.passive.EntityVillager;
|
import net.minecraft.entity.passive.EntityVillager;
|
||||||
|
|
||||||
import com.minelittlepony.model.components.SaddleBags;
|
import com.minelittlepony.model.capabilities.IModelPart;
|
||||||
|
import com.minelittlepony.model.components.Muffin;
|
||||||
import com.minelittlepony.model.player.ModelAlicorn;
|
import com.minelittlepony.model.player.ModelAlicorn;
|
||||||
import com.minelittlepony.pony.data.PonyWearable;
|
import com.minelittlepony.pony.data.PonyWearable;
|
||||||
import com.minelittlepony.render.plane.PlaneRenderer;
|
import com.minelittlepony.render.plane.PlaneRenderer;
|
||||||
|
@ -14,9 +15,11 @@ public class ModelVillagerPony extends ModelAlicorn {
|
||||||
|
|
||||||
public PlaneRenderer apron, trinket;
|
public PlaneRenderer apron, trinket;
|
||||||
|
|
||||||
|
public IModelPart muffin;
|
||||||
|
|
||||||
private int profession;
|
private int profession;
|
||||||
|
|
||||||
private boolean special;
|
public boolean special;
|
||||||
|
|
||||||
public ModelVillagerPony() {
|
public ModelVillagerPony() {
|
||||||
super(false);
|
super(false);
|
||||||
|
@ -48,6 +51,15 @@ public class ModelVillagerPony extends ModelAlicorn {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void renderHead(Entity entity, float move, float swing, float ticks, float headYaw, float headPitch, float scale) {
|
||||||
|
super.renderHead(entity, move, swing, ticks, headYaw, headPitch, scale);
|
||||||
|
|
||||||
|
if (special && entity.getUniqueID().getLeastSignificantBits() % 20 == 0) {
|
||||||
|
muffin.renderPart(scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isWearing(PonyWearable wearable) {
|
public boolean isWearing(PonyWearable wearable) {
|
||||||
if (wearable == PonyWearable.SADDLE_BAGS) {
|
if (wearable == PonyWearable.SADDLE_BAGS) {
|
||||||
|
@ -70,8 +82,9 @@ public class ModelVillagerPony extends ModelAlicorn {
|
||||||
@Override
|
@Override
|
||||||
public void init(float yOffset, float stretch) {
|
public void init(float yOffset, float stretch) {
|
||||||
super.init(yOffset, stretch);
|
super.init(yOffset, stretch);
|
||||||
saddlebags = new SaddleBags(this);
|
|
||||||
saddlebags.init(yOffset, stretch);
|
muffin = new Muffin(this);
|
||||||
|
muffin.init(yOffset, stretch);
|
||||||
|
|
||||||
apron = new PlaneRenderer(this, 56, 16)
|
apron = new PlaneRenderer(this, 56, 16)
|
||||||
.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
.offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z)
|
||||||
|
|
|
@ -5,7 +5,8 @@ import java.util.List;
|
||||||
|
|
||||||
public enum PonyWearable implements ITriggerPixelMapped<PonyWearable> {
|
public enum PonyWearable implements ITriggerPixelMapped<PonyWearable> {
|
||||||
NONE(0),
|
NONE(0),
|
||||||
SADDLE_BAGS(255),
|
SADDLE_BAGS(200),
|
||||||
|
MUFFIN(50),
|
||||||
HAT(100);
|
HAT(100);
|
||||||
|
|
||||||
private int triggerValue;
|
private int triggerValue;
|
||||||
|
|
|
@ -59,8 +59,11 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> ex
|
||||||
return setTextureOffset(x, y);
|
return setTextureOffset(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public T size(int x, int y) {
|
/**
|
||||||
return (T) setTextureSize(x, y);
|
* Sets the texture size for this renderer.
|
||||||
|
*/
|
||||||
|
public T size(int w, int h) {
|
||||||
|
return (T) setTextureSize(w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 549 B |
Loading…
Reference in a new issue