Skip to content

Commit

Permalink
Malachite Guard. WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Andromander committed Mar 10, 2018
1 parent 3e6ff62 commit af7600b
Show file tree
Hide file tree
Showing 7 changed files with 221 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/androsa/gaiadimension/GaiaDimension.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class GaiaDimension
public static DimensionType dimType;
public static int backupdimensionID = -258;

public static final EnumCreatureAttribute GAIAN = EnumHelper.addCreatureAttribute("GAIAN");
public static final EnumCreatureAttribute CORRUPT = EnumHelper.addCreatureAttribute("CORRUPT");

@Instance(MODID)
Expand Down Expand Up @@ -92,5 +93,6 @@ private void registerCreatures() {
GaiaEntities.registerEntity(GaiaEntityNames.SPELLBOUND_ELEMENTAL, androsa.gaiadimension.entity.GDSpellElement.class, id++, 0xFFFF00, 0x0000FF);

GaiaEntities.registerEntity(GaiaEntityNames.BLUE_HOWLITE_WOLF, androsa.gaiadimension.entity.boss.GDBlueHowliteWolf.class, id++, 0x00FF00, 0xFF00FF);
GaiaEntities.registerEntity(GaiaEntityNames.MALACHITE_GUARD, androsa.gaiadimension.entity.boss.GDMalachiteGuard.class, id++, 0x0000FF, 0x00FF00);
}
}
1 change: 1 addition & 0 deletions src/main/java/androsa/gaiadimension/GaiaEntityNames.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class GaiaEntityNames {
public static final ResourceLocation SPELLBOUND_ELEMENTAL = prefix("spellbound_elemental");

public static final ResourceLocation BLUE_HOWLITE_WOLF = prefix("blue_howlite_wolf");
public static final ResourceLocation MALACHITE_GUARD = prefix("malachite_guard");

private static ResourceLocation prefix(String path) {
return new ResourceLocation(GaiaDimension.MODID, path);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package androsa.gaiadimension.entity.boss;

import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;

public class GDMalachiteGuard extends EntityMob {

public GDMalachiteGuard(World world) {
super(world);

this.setSize(0.8F, 3.0F);
}

@Override
protected final void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(200.0D);
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6);
}

@Override
protected void initEntityAI() {
super.initEntityAI();
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(3, new EntityAILookIdle(this));
this.tasks.addTask(1, new EntityAIWander(this, 0.5D));
}

@Override
public void onUpdate() {
super.onUpdate();
if (!world.isRemote && world.getDifficulty() == EnumDifficulty.PEACEFUL) {
this.setDead();
}
}
//Keep this commented out until later
/*
@Override
public boolean isNonBoss() {
return false;
}
*/
}
142 changes: 142 additions & 0 deletions src/main/java/androsa/gaiadimension/model/ModelMalachiteGuard.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
package androsa.gaiadimension.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

/**
* ModelMalachiteGuard - Undefined
* Created using Tabula 7.0.0
*/
public class ModelMalachiteGuard extends ModelBase {
public ModelRenderer legR;
public ModelRenderer legL;
public ModelRenderer hips;
public ModelRenderer waist;
public ModelRenderer shoulderR;
public ModelRenderer torso;
public ModelRenderer shoulderL;
public ModelRenderer head;
public ModelRenderer footR;
public ModelRenderer footL;
public ModelRenderer upperArmR;
public ModelRenderer lowerArmR;
public ModelRenderer neck;
public ModelRenderer upperArmL;
public ModelRenderer lowerArmL;
public ModelRenderer helmet;
public ModelRenderer bladeR;
public ModelRenderer bladeL;

public ModelMalachiteGuard() {
this.textureWidth = 128;
this.textureHeight = 64;
//head
this.head = new ModelRenderer(this, 17, 9);
this.head.setRotationPoint(0.0F, -20.0F, 0.0F);
this.head.addBox(-3.5F, -7.0F, -3.5F, 7, 7, 7, 0.0F);
//helmet
this.helmet = new ModelRenderer(this, 20, 23);
this.helmet.setRotationPoint(0.0F, 0.0F, 0.0F);
this.helmet.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F);
//right helmet blade
this.bladeR = new ModelRenderer(this, 8, 35);
this.bladeR.setRotationPoint(-4.1F, -6.0F, 0.0F);
this.bladeR.addBox(0.0F, -7.0F, 0.0F, 0, 7, 4, 0.0F);
this.setRotateAngle(bladeR, -1.0471975511965976F, 0.0F, 0.0F);
//left helmet blade
this.bladeL = new ModelRenderer(this, 0, 35);
this.bladeL.setRotationPoint(4.1F, -6.0F, 0.0F);
this.bladeL.addBox(0.0F, -7.0F, 0.0F, 0, 7, 4, 0.0F);
this.setRotateAngle(bladeL, -1.0471975511965976F, 0.0F, 0.0F);
//neck
this.neck = new ModelRenderer(this, 65, 12);
this.neck.setRotationPoint(0.0F, -4.0F, 0.0F);
this.neck.addBox(-1.5F, 0.0F, -1.0F, 3, 4, 2, 0.0F);
//torso
this.torso = new ModelRenderer(this, 88, 0);
this.torso.setRotationPoint(0.0F, -16.0F, 0.0F);
this.torso.addBox(-6.0F, 0.0F, -2.5F, 12, 6, 5, 0.0F);
//right shoulder
this.shoulderR = new ModelRenderer(this, 70, 0);
this.shoulderR.setRotationPoint(-6.0F, -14.5F, 0.0F);
this.shoulderR.addBox(-5.0F, -2.0F, -2.0F, 5, 2, 4, 0.0F);
//right upper arm
this.upperArmR = new ModelRenderer(this, 99, 11);
this.upperArmR.setRotationPoint(-2.5F, 0.0F, 0.0F);
this.upperArmR.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
//right lower arm
this.lowerArmR = new ModelRenderer(this, 107, 11);
this.lowerArmR.setRotationPoint(0.0F, 8.0F, 0.0F);
this.lowerArmR.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
//left shoulder
this.shoulderL = new ModelRenderer(this, 66, 6);
this.shoulderL.setRotationPoint(6.0F, -14.5F, 0.0F);
this.shoulderL.addBox(0.0F, -2.0F, -2.0F, 5, 2, 4, 0.0F);
//left upper arm
this.upperArmL = new ModelRenderer(this, 0, 13);
this.upperArmL.setRotationPoint(2.5F, 0.0F, 0.0F);
this.upperArmL.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, 0.0F);
//left lower arm
this.lowerArmL = new ModelRenderer(this, 4, 19);
this.lowerArmL.setRotationPoint(0.0F, 8.0F, 0.0F);
this.lowerArmL.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
//waist
this.waist = new ModelRenderer(this, 58, 0);
this.waist.setRotationPoint(0.0F, -10.0F, 0.0F);
this.waist.addBox(-2.0F, 0.0F, -1.0F, 4, 5, 2, 0.0F);
//hips
this.hips = new ModelRenderer(this, 24, 0);
this.hips.setRotationPoint(0.0F, -5.0F, -2.5F);
this.hips.addBox(-6.0F, 0.0F, 0.0F, 12, 4, 5, 0.0F);
//left leg
this.legR = new ModelRenderer(this, 0, 0);
this.legR.setRotationPoint(-4.5F, -1.0F, 0.0F);
this.legR.addBox(-1.5F, 0.0F, -1.5F, 3, 10, 3, 0.0F);
//right foot
this.footR = new ModelRenderer(this, 45, 9);
this.footR.setRotationPoint(0.0F, 10.0F, 0.0F);
this.footR.addBox(-2.5F, 0.0F, -2.5F, 5, 15, 5, 0.0F);
//left leg
this.legL = new ModelRenderer(this, 12, 0);
this.legL.setRotationPoint(4.5F, -1.0F, 0.0F);
this.legL.addBox(-1.5F, 0.0F, -1.5F, 3, 10, 3, 0.0F);
//left foot
this.footL = new ModelRenderer(this, 79, 11);
this.footL.setRotationPoint(0.0F, 10.0F, 0.0F);
this.footL.addBox(-2.5F, 0.0F, -2.5F, 5, 15, 5, 0.0F);

//kiddiewinkles
this.head.addChild(this.helmet);
this.upperArmL.addChild(this.lowerArmL);
this.helmet.addChild(this.bladeL);
this.shoulderR.addChild(this.upperArmR);
this.shoulderL.addChild(this.upperArmL);
this.torso.addChild(this.neck);
this.legR.addChild(this.footR);
this.helmet.addChild(this.bladeR);
this.legL.addChild(this.footL);
this.upperArmR.addChild(this.lowerArmR);
}

@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
this.head.render(f5);
this.waist.render(f5);
this.shoulderR.render(f5);
this.hips.render(f5);
this.legR.render(f5);
this.legL.render(f5);
this.torso.render(f5);
this.shoulderL.render(f5);
}

/**
* This is a helper function from Tabula to set the rotation of model parts
*/
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
4 changes: 4 additions & 0 deletions src/main/java/androsa/gaiadimension/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import androsa.gaiadimension.entity.GDHowliteWolf;
import androsa.gaiadimension.entity.GDSpellElement;
import androsa.gaiadimension.entity.boss.GDBlueHowliteWolf;
import androsa.gaiadimension.entity.boss.GDMalachiteGuard;
import androsa.gaiadimension.model.ModelBlueHowliteWolf;
import androsa.gaiadimension.model.ModelHowliteWolf;
import androsa.gaiadimension.model.ModelMalachiteGuard;
import androsa.gaiadimension.model.ModelSpellElement;
import androsa.gaiadimension.renderer.EntityRenderBlueHowliteWolf;
import androsa.gaiadimension.renderer.EntityRenderHowliteWolf;
import androsa.gaiadimension.renderer.EntityRenderMalachiteGuard;
import androsa.gaiadimension.renderer.EntityRenderSpellElement;
import net.minecraft.world.World;
import net.minecraftforge.fml.client.FMLClientHandler;
Expand All @@ -22,6 +25,7 @@ public void doPreLoadRegistration() {
RenderingRegistry.registerEntityRenderingHandler(GDSpellElement.class, m -> new EntityRenderSpellElement(m, new ModelSpellElement(), 0.0F));

RenderingRegistry.registerEntityRenderingHandler(GDBlueHowliteWolf.class, m -> new EntityRenderBlueHowliteWolf(m, new ModelBlueHowliteWolf(), 1.2F));
RenderingRegistry.registerEntityRenderingHandler(GDMalachiteGuard.class, m -> new EntityRenderMalachiteGuard(m, new ModelMalachiteGuard(), 1.0F));
}
@Override
public void doOnLoadRegistration() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package androsa.gaiadimension.renderer;

import androsa.gaiadimension.GaiaDimension;
import androsa.gaiadimension.entity.boss.GDMalachiteGuard;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;

public class EntityRenderMalachiteGuard extends RenderLiving<GDMalachiteGuard> {
private static final ResourceLocation textureLoc = new ResourceLocation(GaiaDimension.MODEL_DIR + "malachiteguard.png");

public EntityRenderMalachiteGuard(RenderManager manager, ModelBase model, float shadowSize) {
super(manager, model, shadowSize);
}

@Override
protected ResourceLocation getEntityTexture(GDMalachiteGuard par1Entity) {
return textureLoc;
}
}
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 af7600b

Please sign in to comment.