net.minecraft.entity.monster.EntityIronGolem Java Examples

The following examples show how to use net.minecraft.entity.monster.EntityIronGolem. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TofuVillage.java    From TofuCraftReload with MIT License 5 votes vote down vote up
/**
 * Called periodically by TofuVillageCollection
 */
public void tick(int tickCounterIn) {
    this.tickCounter = tickCounterIn;
    this.removeDeadAndOutOfRangeDoors();
    this.removeDeadAndOldAgressors();

    if (tickCounterIn % 20 == 0) {
        this.updateNumTofuVillagers();
    }

    if (tickCounterIn % 30 == 0) {
        this.updateNumIronGolems();
    }

    int i = this.numTofuVillagers / 10;

    if (this.numIronGolems < i && this.villageDoorInfoList.size() > 20 && this.world.rand.nextInt(7000) == 0) {
        Vec3d vec3d = this.findRandomSpawnPos(this.center, 2, 4, 2);

        if (vec3d != null) {
            EntityIronGolem entityirongolem = new EntityIronGolem(this.world);
            entityirongolem.setPosition(vec3d.x, vec3d.y, vec3d.z);
            this.world.spawnEntity(entityirongolem);
            ++this.numIronGolems;
        }
    }
}
 
Example #2
Source File: EntityTofuGandlem.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
   protected void initEntityAI() {
       this.tasks.addTask(0, new AIDoNothing());
       this.tasks.addTask(3, new AIHealSpell());
       this.tasks.addTask(4, new AISoyShot());
       this.tasks.addTask(5, new AITofuShoot());
       this.tasks.addTask(6, new AISummonSpell());
       this.tasks.addTask(7, new EntityAIAttackMoveRanged(this, 1.0D, 60, 16.0F) {
           @Override
           public boolean shouldExecute() {
               return super.shouldExecute() && !isSpellcasting() && !isSoyShot();
           }

           @Override
           public boolean shouldContinueExecuting() {
               return super.shouldContinueExecuting() && !isSpellcasting();
           }
       });
       this.tasks.addTask(8, new EntityAIWanderAvoidWater(this, 1.1D));
       this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
       this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
       this.tasks.addTask(9, new EntityAILookIdle(this));
       this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
       this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, true));
       this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<>(this, EntityTofunian.class, true));
       this.targetTasks.addTask(4, new EntityAINearestAttackableTarget<>(this, AbstractIllager.class, true));
       this.targetTasks.addTask(5, new EntityAINearestAttackableTarget<>(this, EntityIronGolem.class, true));
   }
 
Example #3
Source File: EntityTofuMindCore.java    From TofuCraftReload with MIT License 5 votes vote down vote up
protected void initEntityAI() {
    this.tasks.addTask(3, new EntityAIAttackMelee(this, 1.15D, true));
    this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityIronGolem>(this, EntityIronGolem.class, true));
}
 
Example #4
Source File: EntityTofuTurret.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@Override
protected void initEntityAI() {
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(3, new EntityAIAttackMoveRanged<>(this, 1.0D, 35, 16.0F));
    this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.1D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new AICopyOwnerTarget(this));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<>(this, EntityIronGolem.class, true));
}
 
Example #5
Source File: EntityTofuSpider.java    From TofuCraftReload with MIT License 5 votes vote down vote up
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(3, new EntityAIAttackMoveRanged<>(this, 1.0D, 24, 17.0F));
    this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class,true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<>(this, EntityIronGolem.class,true));
}
 
Example #6
Source File: EntitySamuraiIllager.java    From Sakura_mod with MIT License 5 votes vote down vote up
protected void initEntityAI() {
    super.initEntityAI();
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIRestrictOpenDoor(this));
    this.tasks.addTask(2, new EntityAIOpenDoor(this, true));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(8, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 3.0F, 1.0F));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[]{AbstractIllager.class}));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityVillager>(this, EntityVillager.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityIronGolem>(this, EntityIronGolem.class, true));
}
 
Example #7
Source File: EntityUtils.java    From ForgeHax with MIT License 5 votes vote down vote up
/**
 * If the mob is friendly (not aggressive)
 */
public static boolean isFriendlyMob(Entity entity) {
  return (entity.isCreatureType(EnumCreatureType.CREATURE, false)
      && !EntityUtils.isNeutralMob(entity))
      || (entity.isCreatureType(EnumCreatureType.AMBIENT, false) && !isBatsDisabled)
      || entity instanceof EntityVillager
      || entity instanceof EntityIronGolem
      || (isNeutralMob(entity) && !EntityUtils.isMobAggressive(entity));
}
 
Example #8
Source File: EntityHalloweenCow.java    From Moo-Fluids with GNU General Public License v3.0 5 votes vote down vote up
protected void applyEntityAI() {
  this.tasks.addTask(4, new EntityHalloweenCow.AICowAttack(this));
  this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
  targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>
      (this, EntityPlayer.class, true));
  targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityVillager>
      (this, EntityVillager.class, false));
  targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityIronGolem>
      (this, EntityIronGolem.class, true));
}
 
Example #9
Source File: EndstoneProtectorManager.java    From SkyblockAddons with MIT License 4 votes vote down vote up
public static void checkGolemStatus() {
    Minecraft mc = Minecraft.getMinecraft();
    SkyblockAddons main = SkyblockAddons.getInstance();

    if (mc.theWorld != null && (main.getUtils().getLocation() == Location.THE_END || main.getUtils().getLocation() == Location.DRAGONS_NEST) &&
            main.getConfigValues().isEnabled(Feature.ENDSTONE_PROTECTOR_DISPLAY)) {
        World world = mc.theWorld;

        Chunk chunk = world.getChunkFromBlockCoords(new BlockPos(-689, 5, -273)); // This is the original spawn.
        if (chunk == null || !chunk.isLoaded()) {
            canDetectSkull = false;
            return;
        }

        Stage newStage = Stage.detectStage();
        for (Entity entity : world.loadedEntityList) {
            if (entity instanceof EntityIronGolem) {
                newStage = Stage.GOLEM_ALIVE;
                break;
            }
        }

        canDetectSkull = true;
        if (minibossStage != newStage) {
            int timeTaken = (int) (System.currentTimeMillis()-lastWaveStart);
            String previousStage = (minibossStage == null ? "null" : minibossStage.name());

            String zealotsKilled = "N/A";
            if (minibossStage != null) {
                zealotsKilled = String.valueOf(zealotCount);
            }

            int totalSeconds = timeTaken/1000;
            int minutes = totalSeconds/60;
            int seconds = totalSeconds%60;

            main.getLogger().info("Endstone Protector stage updated from "+previousStage+" to "+newStage.name()+". " +
                    "Your zealot kill count was "+zealotsKilled+". This took "+minutes+"m "+seconds+"s.");

            if (minibossStage == Stage.GOLEM_ALIVE && newStage == Stage.NO_HEAD) {
                zealotCount = 0;
            }

            minibossStage = newStage;
            lastWaveStart = System.currentTimeMillis();
        }
    } else {
        canDetectSkull = false;
    }
}
 
Example #10
Source File: TofuVillage.java    From TofuCraftReload with MIT License 4 votes vote down vote up
private void updateNumIronGolems() {
    List<EntityIronGolem> list = this.world.<EntityIronGolem>getEntitiesWithinAABB(EntityIronGolem.class, new AxisAlignedBB((double) (this.center.getX() - this.villageRadius), (double) (this.center.getY() - 4), (double) (this.center.getZ() - this.villageRadius), (double) (this.center.getX() + this.villageRadius), (double) (this.center.getY() + 4), (double) (this.center.getZ() + this.villageRadius)));
    this.numIronGolems = list.size();
}
 
Example #11
Source File: CraftIronGolem.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftIronGolem(CraftServer server, EntityIronGolem entity) {
    super(server, entity);
}
 
Example #12
Source File: CraftIronGolem.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EntityIronGolem getHandle() {
    return (EntityIronGolem) entity;
}
 
Example #13
Source File: ItemInfo.java    From NotEnoughItems with MIT License 4 votes vote down vote up
private static void addSpawnEggs()
{
    addEntityEgg(EntitySnowman.class, 0xEEFFFF, 0xffa221);
    addEntityEgg(EntityIronGolem.class, 0xC5C2C1, 0xffe1cc);
}
 
Example #14
Source File: BlockCarvablePumpkin.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onBlockAdded(World world, int x, int y, int z){
    if(world.getBlock(x, y - 1, z) == Blocks.snow && world.getBlock(x, y - 2, z) == Blocks.snow){
        if(!world.isRemote){
            //Let's grab the pumpkin before we start
            ItemStack pumpkin = new ItemStack(world.getBlock(x, y, z), world.getBlockMetadata(x, y, z));

            world.setBlock(x, y, z, Blocks.air, 0, 2);
            world.setBlock(x, y - 1, z, Blocks.air, 0, 2);
            world.setBlock(x, y - 2, z, Blocks.air, 0, 2);
            EntityChiselSnowman snowman = new EntityChiselSnowman(world);
            snowman.setCurrentItemOrArmor(2, pumpkin);
            snowman.setLocationAndAngles((double) x + 0.5D, (double) y - 1.95D, (double) z + 0.5D, 0.0F, 0.0F);
            world.spawnEntityInWorld(snowman);
            world.notifyBlockChange(x, y, z, Blocks.air);
            world.notifyBlockChange(x, y - 1, z, Blocks.air);
            world.notifyBlockChange(x, y - 2, z, Blocks.air);
        }

        //Spawn some lovely particles
        for(int c = 0; c < 120; ++c){
            world.spawnParticle("snowshovel", (double)x + world.rand.nextDouble(), (double) (y - 2) + world.rand.nextDouble() * 2.5D, (double) z + world.rand.nextDouble(), 0.0D, 0.0D, 0.0D);
        }
    } else if(world.getBlock(x, y - 1, z) == Blocks.iron_block || world.getBlock(x, y - 2, z) == Blocks.iron_block){
        boolean flag = world.getBlock(x - 1, y - 1, z) == Blocks.iron_block && world.getBlock(x + 1, y - 1, z) == Blocks.iron_block;
        boolean flag1 = world.getBlock(x, y - 1, z - 1) == Blocks.iron_block && world.getBlock(x, y - 1, z + 1) == Blocks.iron_block;

        if(flag || flag1){
            world.setBlock(x, y, z, Blocks.air, 0, 2);
            world.setBlock(x, y - 1, z, Blocks.air, 0, 2);
            world.setBlock(x, y - 2, z, Blocks.air, 0, 2);

            if(flag){
                world.setBlock(x - 1, y - 1, z, Blocks.air, 0, 2);
                world.setBlock(x + 1, y - 1, z, Blocks.air, 0, 2);
            } else {
                world.setBlock(x, y - 1, z - 1, Blocks.air, 0, 2);
                world.setBlock(x, y - 1, z + 1, Blocks.air, 0, 2);
            }

            EntityIronGolem ironGolem = new EntityIronGolem(world);
            ironGolem.setPlayerCreated(true);
            ironGolem.setLocationAndAngles((double) x + 0.5D, (double) y - 1.95D, (double) z + 0.5D, 0.0F, 0.0F);
            world.spawnEntityInWorld(ironGolem);

            world.notifyBlockChange(x, y, z, Blocks.air);
            world.notifyBlockChange(x, y - 1, z, Blocks.air);
            world.notifyBlockChange(x, y - 2, z, Blocks.air);

            if(flag){
                world.notifyBlockChange(x - 1, y - 1, z, Blocks.air);
                world.notifyBlockChange(x + 1, y - 1, z, Blocks.air);
            } else {
                world.notifyBlockChange(x, y - 1, z - 1, Blocks.air);
                world.notifyBlockChange(x, y - 1, z + 1, Blocks.air);
            }
        }
    }
}