Skip to content

Commit

Permalink
Add egg textures for each breed
Browse files Browse the repository at this point in the history
  • Loading branch information
ata4 committed Aug 13, 2014
1 parent 7bfb5bd commit c5a1a3b
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class DragonModel extends ModelBase {
public final ResourceLocation bodyTexture;
public final ResourceLocation glowTexture;
public final ResourceLocation saddleTexture;
public final ResourceLocation eggTexture;

// model parts
public ModelPart head;
Expand Down Expand Up @@ -86,6 +87,7 @@ public DragonModel(DragonBreed breed) {
bodyTexture = new ResourceLocation(DragonMounts.AID, DragonRenderer.TEX_BASE + breed.getSkin() + "/body.png");
glowTexture = new ResourceLocation(DragonMounts.AID, DragonRenderer.TEX_BASE + breed.getSkin() + "/glow.png");
saddleTexture = new ResourceLocation(DragonMounts.AID, DragonRenderer.TEX_BASE + breed.getSkin() + "/saddle.png");
eggTexture = new ResourceLocation(DragonMounts.AID, DragonRenderer.TEX_BASE + breed.getSkin() + "/egg.png");

this.breed = breed;

Expand Down Expand Up @@ -124,6 +126,10 @@ public DragonModel(DragonBreed breed) {
buildLegs();
}

public ResourceLocation getEggTexture() {
return eggTexture;
}

private void buildHead() {
head = new ModelPart(this, "head");
head.addBox("upperjaw", -6, -1, -8 + HEAD_OFS, 12, 5, 16);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public class DragonRenderer extends RenderLiving {
private Map<DragonBreed, DragonModel> breedModels = new HashMap<DragonBreed, DragonModel>();
private DragonModel dragonModel;
private ResourceLocation dissolveTexture;
private ResourceLocation eggTexture;
private IModelCustom eggModel;

public DragonRenderer() {
Expand All @@ -54,7 +53,6 @@ public DragonRenderer() {

// create textures
dissolveTexture = new ResourceLocation(DragonMounts.AID, TEX_BASE + "dissolve.png");
eggTexture = new ResourceLocation(DragonMounts.AID, TEX_BASE + "dragon_egg.png");

// load egg model
eggModel = AdvancedModelLoader.loadModel(new ResourceLocation(DragonMounts.AID, MDL_BASE + "dragon_egg.obj"));
Expand Down Expand Up @@ -137,7 +135,7 @@ protected void renderEgg(EntityTameableDragon dragon, double x, double y, double
glRotatef(rotX, 1, 0, 0);
glRotatef(rotZ, 0, 0, 1);

bindTexture(eggTexture);
bindTexture(dragonModel.getEggTexture());
eggModel.renderAll();

glPopMatrix();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c5a1a3b

Please sign in to comment.