use of de.sanandrew.mods.claysoldiers.api.soldier.ISoldier in project ClaySoldiersMod by SanAndreasP.
the class LayerGunpowder method doRenderLayer.
@Override
public void doRenderLayer(EntityCreature creature, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (!(creature instanceof ISoldier)) {
return;
}
ISoldier soldier = (ISoldier) creature;
if (soldier.hasUpgrade(Upgrades.MC_GUNPOWDER, EnumUpgradeType.MISC)) {
this.renderer.bindSoldierTexture(Resources.ENTITY_WEARABLE_GUNPOWDER.resource);
this.modelGunpwd.setModelAttributes(this.renderer.getSoldierModel());
this.modelGunpwd.render(creature, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
}
use of de.sanandrew.mods.claysoldiers.api.soldier.ISoldier in project ClaySoldiersMod by SanAndreasP.
the class LayerMagmaCreamCharge method doRenderLayer.
@Override
public void doRenderLayer(EntityCreature creature, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (!(creature instanceof ISoldier)) {
return;
}
ISoldier soldier = (ISoldier) creature;
if (soldier.hasEffect(Effects.TIME_BOMB)) {
float durationPerc = soldier.getEffectDurationLeft(Effects.TIME_BOMB) / (float) UpgradeMagmaCream.MAX_TIME_DETONATION;
boolean isInvisible = soldier.getEntity().isInvisible();
float ticks = soldier.getEntity().ticksExisted + partialTicks;
GlStateManager.depthMask(!isInvisible);
this.renderer.bindSoldierTexture(Resources.LIGHTNING_OVERLAY.resource);
GlStateManager.matrixMode(GL11.GL_TEXTURE);
GlStateManager.loadIdentity();
GlStateManager.translate(ticks * 0.01F, ticks * 0.01F, 0.0F);
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
GlStateManager.enableBlend();
GlStateManager.color(0.5F * (1.0F - durationPerc), 0.5F * durationPerc, 0.0F, 1.0F);
GlStateManager.disableLighting();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
this.chargedModel.setModelAttributes(this.renderer.getSoldierModel());
this.chargedModel.render(soldier.getEntity(), limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.matrixMode(GL11.GL_TEXTURE);
GlStateManager.loadIdentity();
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GlStateManager.depthMask(isInvisible);
}
}
use of de.sanandrew.mods.claysoldiers.api.soldier.ISoldier in project ClaySoldiersMod by SanAndreasP.
the class LayerCrown method doRenderLayer.
@Override
public void doRenderLayer(EntityCreature creature, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (!(creature instanceof ISoldier)) {
return;
}
ISoldier soldier = (ISoldier) creature;
boolean hasDiamond = soldier.hasUpgrade(Upgrades.MC_DIAMOND, EnumUpgradeType.MISC) || soldier.hasUpgrade(Upgrades.MC_DIAMONDBLOCK, EnumUpgradeType.MISC);
if (hasDiamond || soldier.hasUpgrade(Upgrades.MC_GOLDNUGGET, EnumUpgradeType.MISC)) {
GlStateManager.pushMatrix();
this.renderer.getSoldierModel().bipedHead.postRender(scale);
if (this.model.texture != null) {
if (hasDiamond) {
GlStateManager.color(0.0F, 0.9F, 1.0F);
} else {
GlStateManager.color(1.0F, 0.9F, 0.0F);
}
this.renderer.bindSoldierTexture(this.model.texture);
this.model.render(scale);
GlStateManager.color(1.0F, 1.0F, 1.0F);
}
GlStateManager.popMatrix();
}
}
use of de.sanandrew.mods.claysoldiers.api.soldier.ISoldier in project ClaySoldiersMod by SanAndreasP.
the class LayerHeldItem method doRenderLayer.
public void doRenderLayer(EntityCreature creature, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (!(creature instanceof ISoldier)) {
return;
}
ISoldier soldier = (ISoldier) creature;
renderHeldItem(soldier, EnumHandSide.RIGHT);
renderHeldItem(soldier, EnumHandSide.LEFT);
renderWornItem(soldier, EnumHandSide.RIGHT);
renderWornItem(soldier, EnumHandSide.LEFT);
}
use of de.sanandrew.mods.claysoldiers.api.soldier.ISoldier in project ClaySoldiersMod by SanAndreasP.
the class UpgradeIronIngot method onAttackSuccess.
@Override
public void onAttackSuccess(ISoldier<?> soldier, ISoldierUpgradeInst upgradeInst, Entity target) {
if (target instanceof ISoldier) {
ISoldier mark = (ISoldier) target;
double xRatio = soldier.getEntity().posX - target.posX;
double zRatio = soldier.getEntity().posZ - target.posZ;
double prevMotionX = mark.getEntity().motionX;
if (mark.hasUpgrade(Upgrades.CR_IRONINGOT, EnumUpgradeType.CORE)) {
mark.getEntity().knockBack(soldier.getEntity(), 1.6F, xRatio, zRatio);
} else {
mark.getEntity().knockBack(soldier.getEntity(), 0.8F, xRatio, zRatio);
}
mark.getEntity().motionX = prevMotionX;
}
}
Aggregations