protected boolean func_175817_a(World worldIn, StructureBoundingBox p_175817_2_, int p_175817_3_, int p_175817_4_, int p_175817_5_) { int i = this.getXWithOffset(p_175817_3_, p_175817_5_); int j = this.getYWithOffset(p_175817_4_); int k = this.getZWithOffset(p_175817_3_, p_175817_5_); if (p_175817_2_.isVecInside(new BlockPos(i, j, k))) { EntityGuardian entityguardian = new EntityGuardian(worldIn); entityguardian.setElder(true); entityguardian.heal(entityguardian.getMaxHealth()); entityguardian.setLocationAndAngles((double)i + 0.5D, (double)j, (double)k + 0.5D, 0.0F, 0.0F); entityguardian.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityguardian)), (IEntityLivingData)null); worldIn.spawnEntityInWorld(entityguardian); return true; } else { return false; } }
/** * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death), * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...) */ public void handleEntityStatus(S19PacketEntityStatus packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Entity entity = packetIn.getEntity(this.clientWorldController); if (entity != null) { if (packetIn.getOpCode() == 21) { this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity)); } else { entity.handleStatusUpdate(packetIn.getOpCode()); } } }
@SubscribeEvent public void checkSetTarget(LivingSetAttackTargetEvent event) { if (event.getTarget() == null) return; if (!(event.getTarget() instanceof EntityPlayer) || event.getTarget() instanceof FakePlayer) return; if (!(event.getEntity() instanceof EntityLiving)) return; EntityPlayer player = (EntityPlayer)event.getTarget(); EntityLiving ent = (EntityLiving)event.getEntity(); boolean flag = player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() == UCItems.poncho && NBTUtils.getInt(player.inventory.armorInventory[2], ItemGeneric.TAG_UPGRADE, -1) == 10; if (flag && ent.isNonBoss() && !(ent instanceof EntityGuardian || ent instanceof EntityShulker)) { ent.setAttackTarget(null); ent.setRevengeTarget(null); } }
protected boolean spawnElder(World worldIn, StructureBoundingBox p_175817_2_, int p_175817_3_, int p_175817_4_, int p_175817_5_) { int i = this.getXWithOffset(p_175817_3_, p_175817_5_); int j = this.getYWithOffset(p_175817_4_); int k = this.getZWithOffset(p_175817_3_, p_175817_5_); if (p_175817_2_.isVecInside(new BlockPos(i, j, k))) { EntityGuardian entityguardian = new EntityGuardian(worldIn); entityguardian.setElder(true); entityguardian.heal(entityguardian.getMaxHealth()); entityguardian.setLocationAndAngles((double)i + 0.5D, (double)j, (double)k + 0.5D, 0.0F, 0.0F); entityguardian.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityguardian)), (IEntityLivingData)null); worldIn.spawnEntityInWorld(entityguardian); return true; } else { return false; } }
/** * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death), * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...) */ public void handleEntityStatus(SPacketEntityStatus packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Entity entity = packetIn.getEntity(this.clientWorldController); if (entity != null) { if (packetIn.getOpCode() == 21) { this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity)); } else { entity.handleStatusUpdate(packetIn.getOpCode()); } } }
@SubscribeEvent public void onRenderFog(EntityViewRenderEvent.FogDensity event) { if (event.getEntity() instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.getEntity(); PossessivePlayer possessivePlayer = PossessHandler.get(player); if (possessivePlayer != null && (possessivePlayer.getPossessing().canBreatheUnderwater() || possessivePlayer.getPossessing() instanceof EntityGuardian)) { if (ActiveRenderInfo.getBlockStateAtEntityViewpoint(ClientEventHandler.MINECRAFT.theWorld, player, (float) event.getRenderPartialTicks()).getMaterial() != Material.WATER) { GlStateManager.setFog(GlStateManager.FogMode.EXP); event.setDensity(0.125F); event.setCanceled(true); } else { GlStateManager.setFog(GlStateManager.FogMode.EXP); event.setDensity(0.02F); event.setCanceled(true); } } } }
@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; } }
/** * Called to update the entity's position/logic. */ public void onUpdate() { super.onUpdate(); if (this.entity == null) { EntityGuardian entityguardian = new EntityGuardian(this.worldObj); entityguardian.setElder(); this.entity = entityguardian; } }
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ) { if (super.shouldRender(livingEntity, camera, camX, camY, camZ)) { return true; } else { if (livingEntity.hasTargetedEntity()) { EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity(); if (entitylivingbase != null) { Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F); Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F); if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord))) { return true; } } } return false; } }
/** * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: * entityLiving, partialTickTime */ protected void preRenderCallback(EntityGuardian entitylivingbaseIn, float partialTickTime) { if (entitylivingbaseIn.isElder()) { GlStateManager.scale(2.35F, 2.35F, 2.35F); } }
public GuardianSound(EntityGuardian guardian) { super(new ResourceLocation("minecraft:mob.guardian.attack")); this.guardian = guardian; this.attenuationType = ISound.AttenuationType.NONE; this.repeat = true; this.repeatDelay = 0; }
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ) { if (super.shouldRender((EntityLiving)livingEntity, camera, camX, camY, camZ)) { return true; } else { if (livingEntity.hasTargetedEntity()) { EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity(); if (entitylivingbase != null) { Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F); Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F); if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord))) { return true; } } } return false; } }
/** * Invokes the entities' handleUpdateHealth method which is implemented in * LivingBase (hurt/death), MinecartMobSpawner (spawn delay), FireworkRocket & * MinecartTNT (explosion), IronGolem (throwing,...), Witch (spawn particles), * Zombie (villager transformation), Animal (breeding mode particles), Horse * (breeding/smoke particles), Sheep (...), Tameable (...), Villager (particles * for breeding mode, angry and happy), Wolf (...) */ public void handleEntityStatus(S19PacketEntityStatus packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Entity entity = packetIn.getEntity(this.clientWorldController); if (entity != null) { if (packetIn.getOpCode() == 21) { this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian) entity)); } else { entity.handleStatusUpdate(packetIn.getOpCode()); } } }
/** * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death), * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...) */ public void handleEntityStatus(SPacketEntityStatus packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Entity entity = packetIn.getEntity(this.clientWorldController); if (entity != null) { if (packetIn.getOpCode() == 21) { this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity)); } else if (packetIn.getOpCode() == 35) { int i = 40; this.gameController.effectRenderer.func_191271_a(entity, EnumParticleTypes.TOTEM, 30); this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.field_191263_gW, entity.getSoundCategory(), 1.0F, 1.0F, false); if (entity == this.gameController.player) { this.gameController.entityRenderer.func_190565_a(new ItemStack(Items.field_190929_cY)); } } else { entity.handleStatusUpdate(packetIn.getOpCode()); } } }
/** * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death), * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...) */ public void handleEntityStatus(SPacketEntityStatus packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Entity entity = packetIn.getEntity(this.clientWorldController); if (entity != null) { if (packetIn.getOpCode() == 21) { this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity)); } else if (packetIn.getOpCode() == 35) { int i = 40; this.gameController.effectRenderer.func_191271_a(entity, EnumParticleTypes.TOTEM, 30); this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.field_191263_gW, entity.getSoundCategory(), 1.0F, 1.0F, false); if (entity == this.gameController.player) { if (!Hacks.findMod(AntiTotemAnimation.class).isEnabled()) { this.gameController.entityRenderer.func_190565_a(new ItemStack(Items.field_190929_cY)); } } } else { entity.handleStatusUpdate(packetIn.getOpCode()); } } }
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ) { if (super.shouldRender(livingEntity, camera, camX, camY, camZ)) { return true; } else { if (livingEntity.hasTargetedEntity()) { EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity(); if (entitylivingbase != null) { Vec3d vec3d = this.getPosition(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F); Vec3d vec3d1 = this.getPosition(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F); if (camera.isBoundingBoxInFrustum(new AxisAlignedBB(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, vec3d.xCoord, vec3d.yCoord, vec3d.zCoord))) { return true; } } } return false; } }
public GuardianSound(EntityGuardian guardian) { super(SoundEvents.ENTITY_GUARDIAN_ATTACK, SoundCategory.HOSTILE); this.guardian = guardian; this.attenuationType = ISound.AttenuationType.NONE; this.repeat = true; this.repeatDelay = 0; }
public void onUpdate() { super.onUpdate(); if (this.entity == null) { EntityGuardian entityguardian = new EntityGuardian(this.worldObj); entityguardian.setElder(); this.entity = entityguardian; } }
/** * Allows the render to do state modifications necessary before the model is rendered. */ protected void preRenderCallback(EntityGuardian entitylivingbaseIn, float partialTickTime) { if (entitylivingbaseIn.isElder()) { GlStateManager.scale(2.35F, 2.35F, 2.35F); } }
@SubscribeEvent public void onEntityKill(LivingDeathEvent e){ if(e.getEntityLiving() instanceof EntityGuardian && e.getEntityLiving().worldObj.provider instanceof MonumentWorldProvider){ EntityGuardian ent = (EntityGuardian) e.getEntityLiving(); Entity ds = e.getSource().getEntity(); if(ent.isElder()){ if(ds != null && ds instanceof EntityPlayerMP){ EntityPlayerMP player = (EntityPlayerMP) ds; Random rand = new Random(); String msg = elder_kill_msg[rand.nextInt(elder_kill_msg.length)]; player.addChatMessage(new TextComponentString(ChatFormatting.GRAY + "" + ChatFormatting.ITALIC + msg + "...")); } } } }
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) })); }
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn) { this.renderEngine = renderEngineIn; this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this)); this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this)); this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F)); this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F)); this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F)); this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F)); this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F)); this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F)); this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F)); this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F)); this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this)); this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this)); this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this)); this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this)); this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this)); this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this)); this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this)); this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this)); this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this)); this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this)); this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F)); this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this)); this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F)); this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this)); this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F)); this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this)); this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this)); this.entityRenderMap.put(EntityBat.class, new RenderBat(this)); this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this)); this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this)); this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this)); this.entityRenderMap.put(EntityWither.class, new RenderWither(this)); this.entityRenderMap.put(Entity.class, new RenderEntity(this)); this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this)); this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn)); this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this)); this.entityRenderMap.put(EntityArrow.class, new RenderArrow(this)); this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.snowball, itemRendererIn)); this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ender_pearl, itemRendererIn)); this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ender_eye, itemRendererIn)); this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.egg, itemRendererIn)); this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn)); this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.experience_bottle, itemRendererIn)); this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.fireworks, itemRendererIn)); this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F)); this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F)); this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this)); this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn)); this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this)); this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this)); this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this)); this.entityRenderMap.put(EntityArmorStand.class, new ArmorStandRenderer(this)); this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this)); this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this)); this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this)); this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this)); this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this)); this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F)); this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this)); this.playerRenderer = new RenderPlayer(this); this.skinMap.put("default", this.playerRenderer); this.skinMap.put("slim", new RenderPlayer(this, true)); }