use of sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan in project ClaySoldiersMod by SanAndreasP.
the class UpgradeRenderHelper method onRightItemRender.
// ------------------------------- RIGHT HAND ITEMS ------------------------------- //
public static void onRightItemRender(RightHandUpgrade upg, RenderManager manager, IUpgradeEntity entity, float partTicks, ModelBase model) {
if (entity instanceof EntityClayMan && model instanceof ModelClayMan) {
EntityClayMan kootra = (EntityClayMan) entity;
ModelClayMan corpse = (ModelClayMan) model;
GL11.glPushMatrix();
corpse.bipedRightArm.postRender(0.0625F);
GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
float scale = 0.175F;
GL11.glTranslatef(0.05F, -0.15F, -0.08F);
GL11.glScalef(scale + 0.2F, scale, scale);
GL11.glRotatef(140F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-90F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(0F, 0.0F, 0.0F, 1.0F);
manager.itemRenderer.renderItem(kootra, upg.getHeldItem(entity), 0);
GL11.glPopMatrix();
}
}
use of sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan in project ClaySoldiersMod by SanAndreasP.
the class UpgradeRenderHelper method onLeftItemRender.
// ------------------------------- LEFT HAND ITEMS ------------------------------- //
public static void onLeftItemRender(LeftHandUpgrade upg, RenderManager manager, IUpgradeEntity entity, float partTicks, ModelBase model) {
if (entity instanceof EntityClayMan && model instanceof ModelClayMan) {
EntityClayMan kootra = (EntityClayMan) entity;
ModelClayMan corpse = (ModelClayMan) model;
GL11.glPushMatrix();
corpse.bipedLeftArm.postRender(0.0625F);
GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
float scale = 0.175F;
GL11.glTranslatef(0.05F, -0.15F, -0.08F);
GL11.glScalef(scale + 0.2F, scale, scale);
GL11.glRotatef(140F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-90F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(0F, 0.0F, 0.0F, 1.0F);
manager.itemRenderer.renderItem(kootra, upg.getHeldItem(entity), 0);
GL11.glPopMatrix();
}
}
use of sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan in project ClaySoldiersMod by SanAndreasP.
the class EntityBunny method updateEntityActionState.
@Override
public void updateEntityActionState() {
if (riddenByEntity == null || !(riddenByEntity instanceof EntityClayMan)) {
super.updateEntityActionState();
} else {
EntityClayMan rider = (EntityClayMan) riddenByEntity;
// isJumping = rider.isJumping() || handleWaterMovement();
this.isJumping = true;
moveForward = rider.getMoveForward() * rider.getSpeedMulti();
moveStrafing = rider.getMoveStrafing() * rider.getSpeedMulti();
rotationYaw = prevRotationYaw = rider.rotationYaw;
rotationPitch = prevRotationPitch = rider.rotationPitch;
rider.renderYawOffset = renderYawOffset;
riddenByEntity.fallDistance = 0.0F;
if (rider.isDead || rider.getHealth() <= 0) {
rider.mountEntity(null);
}
}
}
use of sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan in project ClaySoldiersMod by SanAndreasP.
the class EntityHorse method attackEntityFrom.
@Override
public boolean attackEntityFrom(DamageSource damagesource, float i) {
float origDmg = i;
boolean hasSpec = rand.nextInt(16) == 0;
if (damagesource.isFireDamage() && this.dataWatcher.getWatchableObjectByte(18) <= 0 && hasSpec)
specDeath = true;
else
specDeath = false;
Entity e = damagesource.getSourceOfDamage();
if ((e == null || !(e instanceof EntityClayMan)) && !damagesource.isFireDamage()) {
i = 100;
}
if (damagesource.isFireDamage() && this.dataWatcher.getWatchableObjectByte(18) > 0) {
i = 0;
}
if (riddenByEntity != null && riddenByEntity instanceof EntityClayMan) {
if (e instanceof EntityGravelChunk) {
if (((EntityGravelChunk) e).getClayTeam() == ((EntityClayMan) riddenByEntity).getClayTeam())
return false;
else
i = origDmg;
}
if (e instanceof EntityFireball) {
if (((EntityFireball) e).getClayTeam() == ((EntityClayMan) riddenByEntity).getClayTeam())
return false;
else
i = origDmg;
}
if (e instanceof EntitySnowball) {
if (((EntitySnowball) e).getClayTeam() == ((EntityClayMan) riddenByEntity).getClayTeam())
return false;
else
i = origDmg;
}
}
boolean fred = super.attackEntityFrom(damagesource, i);
if (fred && this.getHealth() <= 0) {
// Item item1 = CSM_ModRegistry.horseDoll;
for (int j = 0; j < 4; j++) {
double a = posX + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
double b = boundingBox.minY + 0.125D + ((rand.nextFloat() - rand.nextFloat()) * 0.25D);
double c = posZ + ((rand.nextFloat() - rand.nextFloat()) * 0.125D);
CSMModRegistry.proxy.showEffect(this.worldObj, this, 13);
// if (FMLCommonHandler.instance().getSide().isClient())
// CSM_ModRegistry.proxy.showEffect((new EntityDiggingFX(CSM_ModRegistry.proxy.getClientWorld(), a, b, c, 0.0D, 0.0D, 0.0D, Block.dirt, 0, 0)));
}
if (damagesource.isFireDamage() && this.dataWatcher.getWatchableObjectByte(18) <= 0 && this.getHealth() <= 2 && hasSpec) {
EntityHorse entity = new EntityHorse(worldObj, posX, posY, posZ, this.getType());
entity.setNightmare(true);
entity.setAltTex(rand.nextInt(3) != 0 ? 0 : rand.nextInt(Textures.HORSE_NIGHTMARE.length));
// entity.texture = entity.dirtHorseTexture(entity.dataWatcher.getWatchableObjectShort(19));
entity.setHorseSpecs(entity.getType());
worldObj.spawnEntityInWorld(entity);
}
isDead = true;
}
return fred;
}
use of sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan in project ClaySoldiersMod by SanAndreasP.
the class EntityHorse method onUpdate.
// public String dirtHorseTexture(int i) {
// String epona = "/sanandreasp/mods/ClaySoldiersMod/claymans/horse/horse";
// if (this.dataWatcher.getWatchableObjectByte(18) > 0) {
// epona = epona + "Nightmare";
// } else if (this.dataWatcher.getWatchableObjectByte(18) > 0 && hasAltSkin2()) {
// epona = epona + "Nightmare2";
// } else if (i == 0 && hasAltSkin1() && hasAltSkin2()) {
// epona = epona + "Dirt3";
// } else if (i == 0 && hasAltSkin2()) {
// epona = epona + "Dirt4";
// } else if (i == 0 && hasAltSkin1()) {
// epona = epona + "Dirt2";
// } else if (i == 0) {
// epona = epona + "Dirt";
// } else if (i == 1) {
// epona = epona + "Sand";
// } else if (i == 2 && hasAltSkin2()) {
// epona = epona + "Gravel2";
// } else if (i == 2) {
// epona = epona + "Gravel";
// } else if (i == 3) {
// epona = epona + "Snow";
// } else if (i == 4 && hasAltSkin1()) {
// epona = epona + "Grass2";
// } else if (i == 4) {
// epona = epona + "Grass";
// } else if (i == 5) {
// epona = epona + "Lapis";
// } else if (i == 6) {
// epona = epona + "Clay";
// } else if (i == 7 && hasAltSkin1() && hasAltSkin2()) {
// epona = epona + "Carrot2";
// } else if (i == 7) {
// epona = epona + "Carrot";
// } else if (i == 8) {
// epona = epona + "Soul";
// } else if (i == 9) {
// epona = epona + "Cake";
// }
// return epona + ".png";
// }
//
// @Override
// @SideOnly(Side.CLIENT)
// public String getTexture() {
// return dirtHorseTexture(this.dataWatcher.getWatchableObjectShort(19));
// }
@Override
public void onUpdate() {
super.onUpdate();
if (gotRider) {
if (riddenByEntity != null) {
gotRider = false;
return;
}
List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(0.1D, 0.1D, 0.1D));
for (int i = 0; i < list.size(); i++) {
Entity entity = (Entity) list.get(i);
if (!(entity instanceof EntityClayMan)) {
continue;
}
EntityLiving entityliving = (EntityLiving) entity;
if (entityliving.ridingEntity != null || entityliving.riddenByEntity == this) {
continue;
}
entity.mountEntity(this);
break;
}
gotRider = false;
}
}
Aggregations