net.minecraft.entity.monster.EntityMagmaCube Java Examples

The following examples show how to use net.minecraft.entity.monster.EntityMagmaCube. 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: ModelDireSlime.java    From EnderZoo with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
@Override
public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) {
  EntityMagmaCube entitymagmacube = (EntityMagmaCube) p_78086_1_;
  float f3 = entitymagmacube.prevSquishFactor + (entitymagmacube.squishFactor - entitymagmacube.prevSquishFactor) * p_78086_4_;
  int size = entitymagmacube.getSlimeSize();

  if (f3 < 0.0F) {
    f3 = 0.0F;
  }

  if (size > 1) {
    int i = (p_78086_1_.ticksExisted >> 2) % 8;
    coreRenderer = coreRenderers[i];
  } else {
    coreRenderer = coreRendererClay;
  }

  coreRenderer.rotationPointY = f3 * 1.7F;

  for (int i = 0; i < this.sliceRenderers.length; ++i) {
    this.sliceRenderers[i].rotationPointY = (-(4 - i)) * f3 * 1.7F;
  }
}
 
Example #2
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
public static void ClearVanillaMobSpawns()
{
    for (int i = 0; i < BiomeGenBase.biomeList.length; i++)
    {
        if (BiomeGenBase.biomeList[i] != null)
        {
            EntityRegistry.removeSpawn(EntityCreeper.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySkeleton.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityZombie.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySpider.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityEnderman.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityCaveSpider.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySlime.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityGhast.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityPigZombie.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityMagmaCube.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityOcelot.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
        }
    }
}
 
Example #3
Source File: CivilizationHandlers.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
private boolean isHostileMob(EntityLivingBase victim) {
	return victim instanceof EntityMob ||
			victim instanceof EntitySlime ||
			victim instanceof EntityMagmaCube ||
			victim instanceof EntityGhast ||
			victim instanceof EntityShulker;
}
 
Example #4
Source File: PlayerListener.java    From SkyblockAddons with MIT License 4 votes vote down vote up
/**
     * The main timer for the magma boss checker.
     */
    @SubscribeEvent()
    public void onClientTickMagma(TickEvent.ClientTickEvent e) {
        if (e.phase == TickEvent.Phase.START) {
            Minecraft mc = Minecraft.getMinecraft();
            if (main.getConfigValues().isEnabled(Feature.MAGMA_WARNING) && main.getUtils().isOnSkyblock()) {
                if (mc != null && mc.theWorld != null) {
                    if (magmaTick % 5 == 0) {
                        boolean foundBoss = false;
                        long currentTime = System.currentTimeMillis();
                        for (Entity entity : mc.theWorld.loadedEntityList) { // Loop through all the entities.
                            if (entity instanceof EntityMagmaCube) {
                                EntitySlime magma = (EntitySlime) entity;
                                if (magma.getSlimeSize() > 10) { // Find a big magma boss
                                    foundBoss = true;
                                    if ((lastBoss == -1 || System.currentTimeMillis() - lastBoss > 1800000)) {
                                        lastBoss = System.currentTimeMillis();
                                        main.getRenderListener().setTitleFeature(Feature.MAGMA_WARNING); // Enable warning and disable again in four seconds.
                                        magmaTick = 16; // so the sound plays instantly
                                        main.getScheduler().schedule(Scheduler.CommandType.RESET_TITLE_FEATURE, main.getConfigValues().getWarningSeconds());
//                                logServer(mc);
                                    }
                                    magmaAccuracy = EnumUtils.MagmaTimerAccuracy.SPAWNED;
                                    if (currentTime - lastBossSpawnPost > 300000) {
                                        lastBossSpawnPost = currentTime;
                                        main.getUtils().sendInventiveTalentPingRequest(EnumUtils.MagmaEvent.BOSS_SPAWN);
                                    }
                                }
                            }
                        }
                        if (!foundBoss && main.getRenderListener().getTitleFeature() == Feature.MAGMA_WARNING) {
                            main.getRenderListener().setTitleFeature(null);
                        }
                        if (!foundBoss && magmaAccuracy == EnumUtils.MagmaTimerAccuracy.SPAWNED) {
                            magmaAccuracy = EnumUtils.MagmaTimerAccuracy.ABOUT;
                            magmaTime = 7200;
                            if (currentTime - lastBossDeathPost > 300000) {
                                lastBossDeathPost = currentTime;
                                main.getUtils().sendInventiveTalentPingRequest(EnumUtils.MagmaEvent.BOSS_DEATH);
                            }
                        }
                    }
                    if (main.getRenderListener().getTitleFeature() == Feature.MAGMA_WARNING && magmaTick % 4 == 0) { // Play sound every 4 ticks or 1/5 second.
                        main.getUtils().playLoudSound("random.orb", 0.5);
                    }
                }
            }
            magmaTick++;
            if (magmaTick > 20) {
                if ((magmaAccuracy == EnumUtils.MagmaTimerAccuracy.EXACTLY || magmaAccuracy == EnumUtils.MagmaTimerAccuracy.ABOUT)
                        && magmaTime == 0) {
                    magmaAccuracy = EnumUtils.MagmaTimerAccuracy.SPAWNED_PREDICTION;
                    main.getScheduler().schedule(Scheduler.CommandType.RESET_MAGMA_PREDICTION, 20);
                }
                magmaTime--;
                magmaTick = 1;
            }
        }
    }
 
Example #5
Source File: PlayerListener.java    From SkyblockAddons with MIT License 4 votes vote down vote up
@SubscribeEvent()
    public void onTickMagmaBossChecker(EntityEvent.EnteringChunk e) {
        Entity entity = e.entity;

        if (main.getUtils().isOnSkyblock() && main.getConfigValues().isEnabled(Feature.ZEALOT_COUNTER_EXPLOSIVE_BOW_SUPPORT) && entity instanceof EntityArrow) {
            EntityArrow arrow = (EntityArrow)entity;

            EntityPlayerSP p = Minecraft.getMinecraft().thePlayer;
            ItemStack heldItem = p.getHeldItem();
            if (heldItem != null && "EXPLOSIVE_BOW".equals(ItemUtils.getSkyBlockItemID(heldItem))) {

                AxisAlignedBB playerRadius = new AxisAlignedBB(p.posX - 3, p.posY - 3, p.posZ - 3, p.posX + 3, p.posY + 3, p.posZ + 3);
                if (playerRadius.isVecInside(arrow.getPositionVector())) {

//                    System.out.println("Spawned explosive arrow!");
                    main.getNewScheduler().scheduleRepeatingTask(new SkyblockRunnable() {
                        @Override
                        public void run() {
                            if (arrow.isDead || arrow.isCollided || arrow.inGround) {
                                cancel();

//                                System.out.println("Arrow is done, added an explosion!");
                                Vec3 explosionLocation = new Vec3(arrow.posX, arrow.posY, arrow.posZ);
                                explosiveBowExplosions.put(System.currentTimeMillis(), explosionLocation);

                                recentlyKilledZealots.keySet().removeIf((killedTime) -> System.currentTimeMillis() - killedTime > 150);
                                Set<Vec3> filteredRecentlyKilledZealots = new HashSet<>();
                                for (Map.Entry<Long, Set<Vec3>> recentlyKilledZealotEntry : recentlyKilledZealots.entrySet()) {
                                    filteredRecentlyKilledZealots.addAll(recentlyKilledZealotEntry.getValue());
                                }
                                if (filteredRecentlyKilledZealots.isEmpty()) return;

//                                int possibleZealotsKilled = filteredRecentlyKilledZealots.size();
//                                System.out.println("This means "+possibleZealotsKilled+" may have been killed...");
//                                int originalPossibleZealotsKilled = possibleZealotsKilled;

                                for (Vec3 zealotDeathLocation : filteredRecentlyKilledZealots) {
                                    double distance = explosionLocation.distanceTo(zealotDeathLocation);
                                    System.out.println("Distance was "+distance+"!");
                                    if (distance < 4.6) {
//                                        possibleZealotsKilled--;

                                        main.getPersistentValues().addKill();
                                        EndstoneProtectorManager.onKill();
                                    }
                                }

//                                System.out.println((originalPossibleZealotsKilled-possibleZealotsKilled)+" zealots were actually killed...");
                            }
                        }
                    }, 0, 1);
                }
            }
        }

        if (main.getUtils().getLocation() == Location.BLAZING_FORTRESS) {
            if (magmaBossSpawnArea.isVecInside(new Vec3(entity.posX, entity.posY, entity.posZ))) { // timers will trigger if 15 magmas/8 blazes spawn in the box within a 4 second time period
                long currentTime = System.currentTimeMillis();
                if (e.entity instanceof EntityMagmaCube) {
                    if (!recentlyLoadedChunks.contains(new IntPair(e.newChunkX, e.newChunkZ)) && entity.ticksExisted == 0) {
                        recentMagmaCubes++;
                        main.getScheduler().schedule(Scheduler.CommandType.SUBTRACT_MAGMA_COUNT, 4);
                        if (recentMagmaCubes >= 17) {
                            magmaTime = 600;
                            magmaAccuracy = EnumUtils.MagmaTimerAccuracy.EXACTLY;
                            if (currentTime - lastMagmaWavePost > 300000) {
                                lastMagmaWavePost = currentTime;
                                main.getUtils().sendInventiveTalentPingRequest(EnumUtils.MagmaEvent.MAGMA_WAVE);
                            }
                        }
                    }
                } else if (e.entity instanceof EntityBlaze) {
                    if (!recentlyLoadedChunks.contains(new IntPair(e.newChunkX, e.newChunkZ)) && entity.ticksExisted == 0) {
                        recentBlazes++;
                        main.getScheduler().schedule(Scheduler.CommandType.SUBTRACT_BLAZE_COUNT, 4);
                        if (recentBlazes >= 10) {
                            magmaTime = 1200;
                            magmaAccuracy = EnumUtils.MagmaTimerAccuracy.EXACTLY;
                            if (currentTime - lastBlazeWavePost > 300000) {
                                lastBlazeWavePost = currentTime;
                                main.getUtils().sendInventiveTalentPingRequest(EnumUtils.MagmaEvent.BLAZE_WAVE);
                            }
                        }
                    }
                }
            }
        }
    }
 
Example #6
Source File: CraftMagmaCube.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftMagmaCube(CraftServer server, EntityMagmaCube entity) {
    super(server, entity);
}
 
Example #7
Source File: CraftMagmaCube.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public EntityMagmaCube getHandle() {
    return (EntityMagmaCube) entity;
}