Java 类net.minecraft.entity.monster.EntityGolem 实例源码

项目:Progression    文件:FilterEntityType.java   
@Override
protected boolean matches(EntityLivingBase entity) {
    if (type == BOSS) return !entity.isNonBoss();
    else if (!entity.isNonBoss()) return false;

    switch (type) {
        case ANIMAL:    return entity instanceof EntityAnimal;
        case MONSTER:   return entity instanceof IMob;
        case TAMEABLE:  return entity instanceof IEntityOwnable;
        case PLAYER:    return entity instanceof EntityPlayer;
        case WATER:     return entity instanceof EntityWaterMob || entity instanceof EntityGuardian;
        case NPC:       return entity instanceof INpc;
        case GOLEM:     return entity instanceof EntityGolem;
        default:        return false;
    }
}
项目:ForbiddenMagic    文件:ItemRidingCrop.java   
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase victim, EntityLivingBase player) {
    stack.damageItem(1, player);
    if (victim instanceof EntityHorse || victim instanceof EntityPig)
        victim.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 200, 5));
    else if (victim instanceof EntityPlayer || victim instanceof EntityGolem) {
        victim.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 200, 1));
        victim.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 200, 1));
        victim.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 200, 1));
    }
    if (!player.worldObj.isRemote && !Config.noLust && player.worldObj.provider.dimensionId == -1 && player.worldObj.rand.nextInt(15) == 1) {
        EntityItem ent = victim.entityDropItem(new ItemStack(ForbiddenItems.deadlyShards, 1, 4), 1.0F);
        ent.motionY += player.worldObj.rand.nextFloat() * 0.05F;
        ent.motionX += (player.worldObj.rand.nextFloat() - player.worldObj.rand.nextFloat()) * 0.1F;
        ent.motionZ += (player.worldObj.rand.nextFloat() - player.worldObj.rand.nextFloat()) * 0.1F;
    }
    return true;
}
项目:VillagerTweaks    文件:MagicHelper.java   
/**
 * Applies all related effects on a golem that was just created
 * with a enchanted pumpkin.
 * 
 */
public static void applyMagicEffectsOnNewlySpawnedGolem(EntityGolem golem, ItemStack enchantedPumpkin)
{
    if (ConfigurationHandler.onDebug) {
        LogHelper.info("-- Enchanted Golem found at [" + golem.getPosition() + "], applying extra info");
    }

    MagicHelper.applyPumpkinExtraInfo(golem, enchantedPumpkin);
    MagicHelper.applyPassiveEffects(golem);
    MagicHelper.applyRefreshEffects(golem);

    // Heals the golem, if needed (so enchantments that raise health actually work)
    if (golem.getHealth() < golem.getMaxHealth()) {
        golem.heal(golem.getMaxHealth());
    }        
}
项目:pnc-repressurized    文件:EventHandlerPneumaticCraft.java   
@SideOnly(Side.CLIENT)
private void warnPlayerIfNecessary(LivingSetAttackTargetEvent event) {
    EntityPlayer player = FMLClientHandler.instance().getClient().player;
    if (event.getTarget() == player && (event.getEntityLiving() instanceof EntityGolem || event.getEntityLiving() instanceof EntityMob)) {
        ItemStack helmetStack = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
        if (helmetStack.getItem() == Itemss.PNEUMATIC_HELMET && ((IPressurizable) helmetStack.getItem()).getPressure(helmetStack) > 0 && ItemPneumaticArmor.getUpgrades(EnumUpgrade.ENTITY_TRACKER, helmetStack) > 0 && GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade.coreComponents").checked && GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade." + EntityTrackUpgradeHandler.UPGRADE_NAME).checked) {
            HUDHandler.instance().getSpecificRenderer(EntityTrackUpgradeHandler.class).warnIfNecessary(event.getEntity());
        }
    } else {
        HUDHandler.instance().getSpecificRenderer(EntityTrackUpgradeHandler.class).removeTargetingEntity(event.getEntityLiving());
    }
}
项目:ForgeHax    文件:FriendlyMob.java   
@Override
public boolean isMobType(Entity entity) {
    return entity.isCreatureType(EnumCreatureType.CREATURE, false)
            || entity.isCreatureType(EnumCreatureType.AMBIENT, false)
            || entity.isCreatureType(EnumCreatureType.WATER_CREATURE, false)
            || entity instanceof EntityVillager
            || entity instanceof EntityGolem;
}
项目:EMC    文件:IEntity.java   
public boolean instanceOf(EntityType e) {
    // Generic types and players
    if (e.equals(EntityType.ENTITY_PLAYER_SP)) {
        return entity instanceof EntityPlayerSP;
    } else if (e.equals(EntityType.ENTITY_PLAYER)) {
        return entity instanceof EntityPlayer;
    } else if (e.equals(EntityType.ENTITY_LIVING_BASE)) {
        return entity instanceof EntityLivingBase;
    } else if (e.equals(EntityType.ENTITY_LIVING)) {
        return entity instanceof EntityLiving;
    }
    // Mobs
    if (e.equals(EntityType.ENTITY_WOLF)) {
        return entity instanceof EntityWolf;
    } else if (e.equals(EntityType.Entity_Ageable)) {
        return entity instanceof EntityAgeable;
    } else if (e.equals(EntityType.EntityAmbientCreature)) {
        return entity instanceof EntityAmbientCreature;
    } else if (e.equals(EntityType.EntityWaterMob)) {
        return entity instanceof EntityWaterMob;
    } else if (e.equals(EntityType.EntityMob)) {
        return entity instanceof EntityMob;
    } else if (e.equals(EntityType.EntitySlime)) {
        return entity instanceof EntitySlime;
    } else if (e.equals(EntityType.EntityFlying)) {
        return entity instanceof EntityFlying;
    } else if (e.equals(EntityType.EntityGolem)) {
        return entity instanceof EntityGolem;
    } else if (e.equals(EntityType.ENTITY_SPIDER)) {
        return entity instanceof EntitySpider;
    } else if (e.equals(EntityType.ENTITY_SPIDER)) {
        return entity instanceof EntitySpider;
    } else if (e.equals(EntityType.ENTITY_ZOMBIE_PIGMAN)) {
        return entity instanceof EntityZombie;
    } else if (e.equals(EntityType.ENTITY_ENDERMAN)) {
        return entity instanceof EntityEnderman;
    }
    return false;
}
项目:DynamicSurroundings    文件:BattleScanner.java   
private boolean isApplicableType(final Entity e) {
    if (e instanceof EntityLiving) {
        if (e instanceof IMob)
            return true;
        if (e instanceof EntityPlayer)
            return true;
        if (e instanceof EntityGolem)
            return true;
        if (e instanceof EntityPolarBear)
            return true;
    }
    return false;
}
项目:CivRadar    文件:Config.java   
public Config() {
    mobs = new ArrayList<Entity>(Arrays.asList(new Entity[]{
            new Entity(EntityBat.class), 
            new Entity(EntityChicken.class),
            new Entity(EntityCow.class),
            new Entity(EntityHorse.class),
            new Entity(EntityMooshroom.class),
            new Entity(EntityOcelot.class),
            new Entity(EntityPig.class),
            new Entity(EntityRabbit.class),
            new Entity(EntitySheep.class),
            new Entity(EntitySquid.class),
            new Entity(EntityVillager.class),
            new Entity(EntityWolf.class),
            new Entity(EntityBlaze.class),
            new Entity(EntityCaveSpider.class),
            new Entity(EntityCreeper.class),
            new Entity(EntityEnderman.class),
            new Entity(EntityGhast.class),
            new Entity(EntityGolem.class),
            new Entity(EntityGuardian.class),
            new Entity(EntityIronGolem.class),
            new Entity(EntityMagmaCube.class),
            new Entity(EntityPigZombie.class),
            new Entity(EntitySilverfish.class),
            new Entity(EntitySkeleton.class),
            new Entity(EntitySlime.class),
            new Entity(EntitySnowman.class),
            new Entity(EntitySpider.class),
            new Entity(EntityWitch.class),
            new Entity(EntityZombie.class),
            new Entity(EntityItem.class),
            new Entity(EntityMinecart.class),
            new Entity(EntityPlayer.class)
            }));
}
项目:ZeldaSwordSkills    文件:ZSSEntityEvents.java   
/**
 * Applies permanent buffs / debuffs to vanilla mobs
 */
private void initBuffs(EntityLivingBase entity) {
    ZSSEntityInfo info = ZSSEntityInfo.get(entity);
    if (!info.getActiveBuffs().isEmpty()) {
        return;
    }
    // double damage from cold effects, highly resistant to fire damage
    if (entity.isImmuneToFire()) {
        info.applyBuff(Buff.RESIST_FIRE, Integer.MAX_VALUE, 75);
        info.applyBuff(Buff.WEAKNESS_COLD, Integer.MAX_VALUE, 100);
    }
    if (entity.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) {
        if (!entity.isImmuneToFire()) {
            info.applyBuff(Buff.WEAKNESS_FIRE, Integer.MAX_VALUE, 50);
        }
        info.applyBuff(Buff.WEAKNESS_HOLY, Integer.MAX_VALUE, 300);
        info.applyBuff(Buff.RESIST_COLD, Integer.MAX_VALUE, 50);
        info.applyBuff(Buff.RESIST_STUN, Integer.MAX_VALUE, 50);
    }
    if (entity instanceof EntityGolem) {
        info.applyBuff(Buff.RESIST_COLD, Integer.MAX_VALUE, 100);
        info.applyBuff(Buff.RESIST_STUN, Integer.MAX_VALUE, 100);
    }
    if (entity instanceof EntityWitch) {
        info.applyBuff(Buff.RESIST_MAGIC, Integer.MAX_VALUE, 75);
    }
    if (entity instanceof EntityWither) {
        info.removeBuff(Buff.WEAKNESS_COLD);
    }
}
项目:MyEssentials-Core    文件:EntityUtils.java   
private static String getEntityTypeNonCache(Entity e) {
    if (e instanceof EntityGolem) {
        return "Golem";
    } else if (e instanceof IBossDisplayData) {
        return "Boss";
    } else if (e instanceof IAnimals) {
        return "Animal";
    } else if (e instanceof IMob) {
        return "Monster";
    } else if (e instanceof IProjectile) {
        return "Projectile";
    } else if (e instanceof INpc) {
        return "NPC";
    } else if (e instanceof EntityItem) {
        return "Item";
    } else if (e instanceof EntityMob) {
        return "Monster";
    } else if (e instanceof EntityPlayer) {
        return "Player";
    } else if (e instanceof EntityFireball) {
        return "Projectile";
    } else if (e instanceof EntityTNTPrimed) {
        return "TNT";
    } else {
        return "Unknown"; // e.getClass().getName();
    }
}
项目:PneumaticCraft    文件:EventHandlerPneumaticCraft.java   
@SideOnly(Side.CLIENT)
private void warnPlayerIfNecessary(LivingSetAttackTargetEvent event){
    EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
    if(event.target == player && (event.entityLiving instanceof EntityGolem || event.entityLiving instanceof EntityMob)) {
        ItemStack helmetStack = player.getCurrentArmor(3);
        if(helmetStack != null && helmetStack.getItem() == Itemss.pneumaticHelmet && ((IPressurizable)helmetStack.getItem()).getPressure(helmetStack) > 0 && ItemPneumaticArmor.getUpgrades(ItemMachineUpgrade.UPGRADE_ENTITY_TRACKER, helmetStack) > 0 && GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade.coreComponents").checked && GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade." + EntityTrackUpgradeHandler.UPGRADE_NAME).checked) {
            HUDHandler.instance().getSpecificRenderer(EntityTrackUpgradeHandler.class).warnIfNecessary(event.entityLiving);
        }
    } else {
        HUDHandler.instance().getSpecificRenderer(EntityTrackUpgradeHandler.class).removeTargetingEntity(event.entityLiving);
    }
}
项目:VillagerTweaks    文件:MagicHelper.java   
/**
 * Applies the extra info (name, enchantments) in the pumpkin to the golem created with it.
 * 
 */
public static void applyPumpkinExtraInfo(EntityGolem golem, ItemStack pumpkin) {
    if (golem == null || pumpkin == null) return;

    int[] pumpkinEnchants = getEnchantmentIds(pumpkin);
    String customName = pumpkin.getDisplayName();
    if (customName.equals(Blocks.pumpkin.getLocalizedName())) customName = "";


    // Check if a custom name exists
    if (customName != "") {
        // Applies the custom name to the golem
        golem.setCustomNameTag(customName);
    }

    // Check if it's an enchanted pumpkin
    if (pumpkinEnchants != null && pumpkinEnchants.length > 0) {
        final ExtendedGolem properties = ExtendedGolem.get(golem);
        if (properties == null) {
            LogHelper.warn("Could not load extened properties for Iron Golem ID " + golem.getEntityId() + ", enchantments won't be applied.");
        } else {
            properties.setEnchantments(pumpkinEnchants);
            LogHelper.info("--> Applying enchantments on golem " + golem.getEntityId() + ": " + Arrays.toString(pumpkinEnchants));

            NetworkHelper.sendEnchantedGolemInfoMessage(golem, properties);
        }
    }

}
项目:VillagerTweaks    文件:EntityEventHandler.java   
@SubscribeEvent
public void onLivingAttack(LivingAttackEvent event)
{
    Entity target = event.entity;


    if (target instanceof EntityGolem || event.source.getSourceOfDamage() instanceof EntityGolem) {
        LogHelper.info("== onLivingAttack() ==");
    }


    // NOTE: since the offensive enchantments apply special effect and don't just add more damage, 
    // I can intercept this event. If I were to do any damage modifier, the correct event is LivingHurtEvent.
    // NOTE 2: This code also works on LivingHurtEvent, but I feel it's more appropriate here.

    // An iron golem attacked a target, apply the offensive enchantments
    if (event.source.getDamageType() == "mob" && event.source.getSourceOfDamage() instanceof EntityIronGolem) {
        MagicHelper.applyAttackEffects(event.source.getSourceOfDamage(), target);
    }

    // A snow golem attacked a target, apply the offensive enchantments
    else if (event.source.getSourceOfDamage() instanceof EntitySnowball && ((EntitySnowball)event.source.getSourceOfDamage()).getThrower() instanceof EntitySnowman) {
        MagicHelper.applyAttackEffects(((EntitySnowball)event.source.getSourceOfDamage()).getThrower(), target);
    }


    // A golem was attacked by a target, check if should cancel the event
    if (target instanceof EntityGolem) {
        boolean ignoreDamage = MagicHelper.applyDamageCancelEffects(target, event.source);
        if (ignoreDamage) event.setCanceled(true);
    }

}
项目:VillagerTweaks    文件:EntityEventHandler.java   
@SubscribeEvent
public void onLivingHurt(LivingHurtEvent event)
{
    Entity target = event.entity;


    if (target instanceof EntityGolem || event.source.getSourceOfDamage() instanceof EntityGolem) {
        LogHelper.info("== onLivingHurt() ==");
        LogHelper.info("    " + event.entity);
        LogHelper.info("    source: " + event.source.getDamageType());
        LogHelper.info("    source: " + event.source.getSourceOfDamage());
        LogHelper.info("    damage: " + event.ammount);
    }



    // A golem was attacked, apply the defensive enchantments
    if (target instanceof EntityGolem) {
        event.ammount = MagicHelper.applyDefenseEffects(target, event.source, event.ammount);
    }

    // An iron golem caused damage, apply damage modifiers
    else if (event.source.getDamageType() == "mob" && event.source.getSourceOfDamage() instanceof EntityIronGolem) {
        event.ammount = MagicHelper.applyDamagingEffects(event.source.getSourceOfDamage(), target, event.ammount);
    }

    // A snow golem caused damage, apply damage modifiers
    else if (event.source.getSourceOfDamage() instanceof EntitySnowball && ((EntitySnowball)event.source.getSourceOfDamage()).getThrower() instanceof EntitySnowman) {
        event.ammount = MagicHelper.applyDamagingEffects(((EntitySnowball)event.source.getSourceOfDamage()).getThrower(), target, event.ammount);
    }

}
项目:VillagerTweaks    文件:EntityEventHandler.java   
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event)
{

    // Adds the Extended Properties to zombies
    if (GenericHelper.isVanillaZombie(event.entity)  && ExtendedVillagerZombie.get((EntityZombie) event.entity) == null) {
        ExtendedVillagerZombie.register((EntityZombie) event.entity);
    }

    // Adds the Extended Properties to golems
    else if (event.entity instanceof EntityGolem && ExtendedGolem.get((EntityGolem)event.entity) == null) {
        ExtendedGolem.register((EntityGolem) event.entity);
    }

}
项目:VillagerTweaks    文件:ClientInfoTracker.java   
/**
 * Attempts to locate the entity by it's ID and apply the 
 * extended properties.
 */
@SideOnly(Side.CLIENT)
public static void SyncGolemMessage(int entityID) {

    // Seeks if the entity ID is loaded
    WorldClient world = Minecraft.getMinecraft().theWorld;
    if (world == null) return;
    Entity entity = world.getEntityByID(entityID);

    // If found the entity, attempt to sync with info sent by the server 
    if (entity instanceof EntityGolem) {
        ClientInfoTracker.SyncGolemMessage((EntityGolem)entity);
    }

}
项目:VillagerTweaks    文件:ClientInfoTracker.java   
/**
 * Attempts to locate a message with Extended Properties and apply to the golem. 
 */
@SideOnly(Side.CLIENT)
public static void SyncGolemMessage(EntityGolem golem) {

    // Try to locate messages sent by the server, containing special zombie info
    MessageGolemEnchantments msg = ClientInfoTracker.getGolemMessage(golem.getEntityId());

    // If a message was found, update the local zombie with that info
    if (msg != null) {
        ExtendedGolem properties = ExtendedGolem.get(golem);
        properties.setEnchantments(msg.getEnchantments());
    } 

}
项目:Uranium    文件:CraftGolem.java   
public CraftGolem(CraftServer server, EntityGolem entity) {
    super(server, entity);
}
项目:Uranium    文件:CraftGolem.java   
@Override
public EntityGolem getHandle() {
    return (EntityGolem) entity;
}
项目:ThermosRebased    文件:CraftGolem.java   
public CraftGolem(CraftServer server, EntityGolem entity) {
    super(server, entity);
}
项目:ThermosRebased    文件:CraftGolem.java   
@Override
public EntityGolem getHandle() {
    return (EntityGolem) entity;
}
项目:EvenWurse    文件:EntityUtils.java   
public static boolean isCorrectEntity(Object o, boolean ignoreFriends) {
    // non-entities
    if (!(o instanceof Entity)) return false;

    // friends
    if (ignoreFriends && o instanceof EntityPlayer) {
        if (WurstClient.INSTANCE.friends.contains(((EntityPlayer) o).getName())) return false;
    }

    TargetFeature targetFeature = WurstClient.INSTANCE.specialFeatures.targetFeature;

    // invisible entities
    if (((Entity) o).isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer)) {
        return targetFeature.invisibleMobs.isChecked() && o instanceof EntityLiving ||
                targetFeature.invisiblePlayers.isChecked() && o instanceof EntityPlayer;
    }

    // players
    if (o instanceof EntityPlayer) {
        return (((EntityPlayer) o).isPlayerSleeping() && targetFeature.sleepingPlayers.isChecked() ||
                !((EntityPlayer) o).isPlayerSleeping() && targetFeature.players.isChecked()) &&
                (!targetFeature.teams.isChecked() ||
                        checkName(((EntityPlayer) o).getDisplayName().getFormattedText()));
    }

    // animals
    if (o instanceof EntityAgeable || o instanceof EntityAmbientCreature || o instanceof EntityWaterMob) {
        return targetFeature.animals.isChecked() &&
                (!targetFeature.teams.isChecked() || !((Entity) o).hasCustomName() ||
                        checkName(((Entity) o).getCustomNameTag()));
    }

    // monsters
    if (o instanceof EntityMob || o instanceof EntitySlime || o instanceof EntityFlying) {
        return targetFeature.monsters.isChecked() &&
                (!targetFeature.teams.isChecked() || !((Entity) o).hasCustomName() ||
                        checkName(((Entity) o).getCustomNameTag()));
    }

    // golems
    return o instanceof EntityGolem && targetFeature.golems.isChecked() &&
            (!targetFeature.teams.isChecked() || !((Entity) o).hasCustomName() ||
                    checkName(((Entity) o).getCustomNameTag()));
}
项目:Thermos    文件:CraftGolem.java   
public CraftGolem(CraftServer server, EntityGolem entity) {
    super(server, entity);
}
项目:Thermos    文件:CraftGolem.java   
@Override
public EntityGolem getHandle() {
    return (EntityGolem) entity;
}
项目:KCauldron    文件:CraftGolem.java   
public CraftGolem(CraftServer server, EntityGolem entity) {
    super(server, entity);
}
项目:KCauldron    文件:CraftGolem.java   
@Override
public EntityGolem getHandle() {
    return (EntityGolem) entity;
}
项目:CauldronGit    文件:CraftGolem.java   
public CraftGolem(CraftServer server, EntityGolem entity) {
    super(server, entity);
}
项目:CauldronGit    文件:CraftGolem.java   
@Override
public EntityGolem getHandle() {
    return (EntityGolem) entity;
}
项目:Cauldron-Old    文件:CraftGolem.java   
public CraftGolem(CraftServer server, EntityGolem entity) {
    super(server, entity);
}
项目:Cauldron-Old    文件:CraftGolem.java   
@Override
public EntityGolem getHandle() {
    return (EntityGolem) entity;
}
项目:Cauldron-Reloaded    文件:CraftGolem.java   
public CraftGolem(CraftServer server, EntityGolem entity) {
    super(server, entity);
}
项目:Cauldron-Reloaded    文件:CraftGolem.java   
@Override
public EntityGolem getHandle() {
    return (EntityGolem) entity;
}
项目:FFoKC    文件:CraftGolem.java   
public CraftGolem(CraftServer server, EntityGolem entity) {
    super(server, entity);
}
项目:FFoKC    文件:CraftGolem.java   
@Override
public EntityGolem getHandle() {
    return (EntityGolem) entity;
}
项目:Rediscovered-Mod-1.8    文件:RenderSteve.java   
protected ResourceLocation getEntityTexture(Entity par1Entity)
{
    return this.getSquidTextures((EntityGolem)par1Entity);
}
项目:Rediscovered-Mod-1.8    文件:RenderSteve.java   
protected ResourceLocation getSquidTextures(EntityGolem par1EntitySkyChicken)
{
    return this.textures[(getTextureIndex(par1EntitySkyChicken) % this.textures.length)];
}
项目:Rediscovered-Mod-1.8.8    文件:RenderSteve.java   
protected ResourceLocation getEntityTexture(Entity par1Entity)
{
    return this.getSquidTextures((EntityGolem)par1Entity);
}
项目:Rediscovered-Mod-1.8.8    文件:RenderSteve.java   
protected ResourceLocation getSquidTextures(EntityGolem par1EntitySkyChicken)
{
    return this.textures[(getTextureIndex(par1EntitySkyChicken) % this.textures.length)];
}
项目:Cauldron    文件:CraftGolem.java   
public CraftGolem(CraftServer server, EntityGolem entity) {
    super(server, entity);
}
项目:Cauldron    文件:CraftGolem.java   
@Override
public EntityGolem getHandle() {
    return (EntityGolem) entity;
}