Search in sources :

Example 1 with EntityClayMan

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();
    }
}
Also used : ModelClayMan(sanandreasp.mods.ClaySoldiersMod.client.model.ModelClayMan) EntityClayMan(sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan)

Example 2 with EntityClayMan

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();
    }
}
Also used : ModelClayMan(sanandreasp.mods.ClaySoldiersMod.client.model.ModelClayMan) EntityClayMan(sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan)

Example 3 with EntityClayMan

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);
        }
    }
}
Also used : EntityClayMan(sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan)

Example 4 with EntityClayMan

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;
}
Also used : Entity(net.minecraft.entity.Entity) EntityClayMan(sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan) EntityFireball(sanandreasp.mods.ClaySoldiersMod.entity.projectile.EntityFireball) EntityGravelChunk(sanandreasp.mods.ClaySoldiersMod.entity.projectile.EntityGravelChunk)

Example 5 with EntityClayMan

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;
    }
}
Also used : Entity(net.minecraft.entity.Entity) EntityClayMan(sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan) EntityLiving(net.minecraft.entity.EntityLiving) List(java.util.List)

Aggregations

EntityClayMan (sanandreasp.mods.ClaySoldiersMod.entity.EntityClayMan)24 Entity (net.minecraft.entity.Entity)12 List (java.util.List)7 EntityLiving (net.minecraft.entity.EntityLiving)5 EntityFireball (sanandreasp.mods.ClaySoldiersMod.entity.projectile.EntityFireball)4 EntityGravelChunk (sanandreasp.mods.ClaySoldiersMod.entity.projectile.EntityGravelChunk)4 EntityMob (net.minecraft.entity.monster.EntityMob)3 AxisAlignedBB (net.minecraft.util.AxisAlignedBB)3 MovingObjectPosition (net.minecraft.util.MovingObjectPosition)3 Vec3 (net.minecraft.util.Vec3)3 ModelClayMan (sanandreasp.mods.ClaySoldiersMod.client.model.ModelClayMan)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 WorldClient (net.minecraft.client.multiplayer.WorldClient)1 EntityItem (net.minecraft.entity.item.EntityItem)1 Item (net.minecraft.item.Item)1 PotionEffect (net.minecraft.potion.PotionEffect)1 EntityBunny (sanandreasp.mods.ClaySoldiersMod.entity.mount.EntityBunny)1 EntityGecko (sanandreasp.mods.ClaySoldiersMod.entity.mount.EntityGecko)1 EntityHorse (sanandreasp.mods.ClaySoldiersMod.entity.mount.EntityHorse)1 EntityPegasus (sanandreasp.mods.ClaySoldiersMod.entity.mount.EntityPegasus)1