public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) { if (p_142018_1_ instanceof EntityWolf) { EntityWolf entitywolf = (EntityWolf)p_142018_1_; if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_) { return false; } } return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame(); } else { return false; } }
/** * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime */ protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) { float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); if ((int)(f * 10.0F) % 2 == 0) { return 0; } else { int i = (int)(f * 0.2F * 255.0F); i = MathHelper.clamp_int(i, 0, 255); return i << 24 | 16777215; } }
/** * What shader to use when spectating this entity */ public void loadEntityShader(Entity entityIn) { if (OpenGlHelper.shadersSupported) { if (this.theShaderGroup != null) { this.theShaderGroup.deleteShaderGroup(); } this.theShaderGroup = null; if (entityIn instanceof EntityCreeper) { this.loadShader(new ResourceLocation("shaders/post/creeper.json")); } else if (entityIn instanceof EntitySpider) { this.loadShader(new ResourceLocation("shaders/post/spider.json")); } else if (entityIn instanceof EntityEnderman) { this.loadShader(new ResourceLocation("shaders/post/invert.json")); } } }
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) { if (p_142018_1_ instanceof EntityFrienderman) { EntityFrienderman frienderman = (EntityFrienderman) p_142018_1_; if (frienderman.isTamed() && frienderman.getOwner() == p_142018_2_) { return false; } } return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame(); } else { return false; } }
@Override public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) { if (stack.getItemDamage() != 20) return; if (!(entity instanceof EntityPlayer) || (entity instanceof FakePlayer)) return; if (itemSlot < ((EntityPlayer)entity).inventory.getHotbarSize()) { List<EntityLiving> entities = entity.worldObj.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(entity.getPosition().add(-range, -range, -range), entity.getPosition().add(range, range, range))); for (EntityLiving ent : entities) { List<EntityAITaskEntry> entries = new ArrayList(ent.tasks.taskEntries); entries.addAll(new ArrayList(ent.targetTasks.taskEntries)); for (EntityAITaskEntry entry : entries) { if (entry.action instanceof EntityAIAttackRangedBow) { makeSkellyShootSlower((EntityAIAttackRangedBow)entry.action); } } if (ent instanceof EntityCreeper) ReflectionHelper.setPrivateValue(EntityCreeper.class, (EntityCreeper)ent, 60, this.FUSETIME); } } }
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) { if (p_142018_1_ instanceof EntityWolf) { EntityWolf entitywolf = (EntityWolf)p_142018_1_; if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_) { return false; } } return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof AbstractHorse) || !((AbstractHorse)p_142018_1_).isTame(); } else { return false; } }
/** * Gets an RGBA int color multiplier to apply. */ protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) { float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); if ((int)(f * 10.0F) % 2 == 0) { return 0; } else { int i = (int)(f * 0.2F * 255.0F); i = MathHelper.clamp(i, 0, 255); return i << 24 | 822083583; } }
/** * Gets an RGBA int color multiplier to apply. */ protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) { float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); if ((int)(f * 10.0F) % 2 == 0) { return 0; } else { int i = (int)(f * 0.2F * 255.0F); i = MathHelper.clamp_int(i, 0, 255); return i << 24 | 822083583; } }
@Override public void performEffect(EntityLivingBase entity, int level) { if(entity instanceof EntityCreeper) { //spawn firefly particles return; } if (entity instanceof EntityPlayer) { entity.resetActiveHand(); } entity.attackEntityFrom(DamageSource.LIGHTNING_BOLT, 0.1f); entity.heal(0.1f); entity.motionX = 0; entity.motionY = 0; entity.motionZ = 0; }
@Override public int compare(Entity p_compare_1_, Entity p_compare_2_) { double compareDistance1 = this.theEntity.getDistanceSqToEntity(p_compare_1_); double compareDistance2 = this.theEntity.getDistanceSqToEntity(p_compare_2_); boolean b0 = false; boolean b1i = true; if (!ConfigValues.HUNTCREEPERS && p_compare_1_ instanceof EntityCreeper) b0 = true; if (!ConfigValues.HUNTCREEPERS && p_compare_2_ instanceof EntityCreeper) b1i = false; if (!b0 && b1i) { return Double.compare(compareDistance1, compareDistance2); } else if (b0 && b1i) { return 1; } else if (!b0) { return -1; } else { return 0; } }
/** * Register your movement tasks here. */ public void addMovementTasks() { switch (dataManager.get(MOVEMENT_MODE)) { case 1: if (!ConfigValues.HUNTCREEPERS) this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityCreeper.class, 10.0F, 1.2D, 1.6D)); this.tasks.addTask(4, new EntityAIOpenDoor(this, getAttackMode() != 2)); this.tasks.addTask(6, new EntityAIFollowMaster(this, 1.0D, 10.0F, 2.0F)); case 0: this.detachHome(); break; case 2: default: this.setHomePosAndDistance(new BlockPos(this.posX, this.posY, this.posZ), 20); this.tasks.addTask(2, new EntityAIRestrictSun(this)); this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D)); if (!ConfigValues.HUNTCREEPERS) this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityCreeper.class, 10.0F, 1.2D, 1.6D)); this.tasks.addTask(4, new EntityAIOpenDoor(this, getAttackMode() != 2)); this.tasks.addTask(7, new EntityAIWanderBase(this, 1.0D)); } }
public boolean shouldAttackEntity(EntityLivingBase target){ EntityLivingBase owner = getOwner(); if (ConfigValues.HUNTCREEPERS || !(target instanceof EntityCreeper)) { if (target instanceof EntityWolf) { EntityWolf entitywolf = (EntityWolf) target; if (entitywolf.isTamed() && entitywolf.getOwner() == owner || Alliances.getInstance().isAlliedTo(entitywolf.getOwnerId(), getOwnerId())) return false; } if (target instanceof EntityArmyMember) if ((getAttackMode() < 2 && Enemies.getInstance().isNotEnemiesWith(((EntityArmyMember) target).getOwnerId(), getOwnerId())) || ((EntityArmyMember) target).getOwnerId().equals(getOwnerId()) || Alliances.getInstance().isAlliedTo(((EntityArmyMember) target).getOwnerId(), getOwnerId())) return false; return !(target instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target)) && (!(target instanceof EntityHorse) || !((EntityHorse) target).isTame()); } else return false; }
@Override public void onDeath(@Nonnull DamageSource cause) { super.onDeath(cause); Entity damageCause = cause.getTrueSource(); if (damageCause instanceof EntityCreeper && ((EntityCreeper) damageCause).getPowered() && !((EntityCreeper) damageCause).isAIDisabled()) { ((EntityCreeper) damageCause).incrementDroppedSkulls(); this.entityDropItem(new ItemStack(Items.SKULL), 0.0F); } if (!this.world.isRemote) { for (int i = 0; i < equipInventory.getSizeInventory(); i++) { if (!equipInventory.getStackInSlot(i).isEmpty()) { EntityItem entityitem = new EntityItem(world, posX, posY, posZ, equipInventory.getStackInSlot(i)); entityitem.setDefaultPickupDelay(); world.spawnEntity(entityitem); } } } }
@Override public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) { if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) { if (par1EntityLivingBase instanceof EntitySlimeling) { EntitySlimeling slimeling = (EntitySlimeling) par1EntityLivingBase; if (slimeling.isTamed() && slimeling.getOwner() == par2EntityLivingBase) { return false; } } return !(par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase)) && (!(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame()); } else { return false; } }
protected void updateCreeperScale(EntityCreeper par1GCEntityCreeper, float par2) { float var4 = par1GCEntityCreeper.getCreeperFlashIntensity(par2); final float var5 = 1.0F + MathHelper.sin(var4 * 100.0F) * var4 * 0.01F; if (var4 < 0.0F) { var4 = 0.0F; } if (var4 > 1.0F) { var4 = 1.0F; } var4 *= var4; var4 *= var4; final float var6 = (1.0F + var4 * 0.4F) * var5; final float var7 = (1.0F + var4 * 0.1F) / var5; GL11.glScalef(0.2F + var6, 0.2F + var7, 0.2F + var6); }
public boolean isEntityValidToAttack(EntityMinionWarrior minion, EntityLivingBase entity) { if(entity == minion || entity == minion.getRidingEntity() || !EntityAITarget.isSuitableTarget(minion, entity, false, false) || entity.getClass() == EntityCreeper.class) return false; if (entity instanceof EntityMob && (getTargetBehavior() == EnumCombatBehaviors.TARGET_HOSTILE_MOBS || getTargetBehavior() == EnumCombatBehaviors.TARGET_PASSIVE_OR_HOSTILE_MOBS)) { return true; } else if (entity instanceof EntityAnimal && (getTargetBehavior() == EnumCombatBehaviors.TARGET_PASSIVE_MOBS || getTargetBehavior() == EnumCombatBehaviors.TARGET_PASSIVE_OR_HOSTILE_MOBS)) { return true; } else { return false; } }
public EntitySlave(World p_i1688_1_) { super(p_i1688_1_); this.setSize(0.8F, 1.6F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, this.aiSit); this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.diamond, true)); this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F)); this.tasks.addTask(5, new EntityAIAvoidEntity(this, EntityCreeper.class, 16.0F, 0.8D, 1.33D)); this.tasks.addTask(6, new EntityAILeapAtTarget(this, 0.3F)); this.tasks.addTask(7, new EntityAIOcelotAttack(this)); this.tasks.addTask(8, new EntityAIMate(this, 0.8D)); this.tasks.addTask(9, new EntityAIWander(this, 0.8D)); this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityMob.class, 750, false)); this.setType(this.rand.nextInt(4)); this.setRandomStuff(); }
/** * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime */ protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime) { float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime); if ((int)(f * 10.0F) % 2 == 0) { return 0; } else { int i = (int)(f * 0.2F * 255.0F); i = MathHelper.clamp(i, 0, 255); return i << 24 | 16777215; } }
protected void initEntityAI() { areaAI = new EntityAIMoveIntoArea(this, 0.5D, 30); tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackMelee(this, 0.6D, false)); tasks.addTask(4, areaAI); tasks.addTask(7, new EntityAIWander(this, 0.35D)); tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(8, new EntityAILookIdle(this)); targetTasks.addTask(2, new EntityAINearestAttackableCivTarget(this)); targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, 10, false, false, new Predicate<EntityMob>() { @Override public boolean apply(EntityMob target) { return !(target instanceof EntityCreeper); } })); }
@SubscribeEvent(priority = EventPriority.HIGH) public void onEntityLivingDeath(LivingDeathEvent event) { if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { if (ExtendedConfig.spawnSkullCrawlersAtMobsDeath) { if (event.getEntity() instanceof AbstractSkeleton) { EntitySkullCrawler crawler; if (MobSpawn.isWitherSkeleton((AbstractSkeleton) event.getEntity())) { crawler = new EntityWitherSkullCrawler(event.getEntity().getEntityWorld()); } else if (MobSpawn.isStraySkeleton((AbstractSkeleton) event.getEntity())) { crawler = new EntityStraySkullCrawler(event.getEntity().getEntityWorld()); } else { crawler = new EntitySkullCrawler(event.getEntity().getEntityWorld()); } MobSpawn.spawnCrawler(event.getEntity(), crawler); } else if (event.getEntity() instanceof EntityZombie) { MobSpawn.spawnCrawler(event.getEntity(), new EntityZombieSkullCrawler(event.getEntity().getEntityWorld())); } } if (event.getEntity() instanceof EntityCreeper && ((EntityCreeper) event.getEntity()).getPowered()) { // drop creeper statue if entity is a charged creeper GSBlock.MEMORIAL.dropCreeperMemorial(event.getEntity().getEntityWorld(), new BlockPos(event.getEntity())); } } }
@Override public long inputEnergy(long amount, boolean simulate) { if (!simulate && !charged) { if (creature instanceof EntityPig) { final EntityPigZombie pigman = new EntityPigZombie(creature.world); pigman.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_AXE)); pigman.setLocationAndAngles(creature.posX, creature.posY, creature.posZ, creature.rotationYaw, creature.rotationPitch); pigman.setNoAI(creature.isAIDisabled()); if (creature.hasCustomName()) { pigman.setCustomNameTag(creature.getCustomNameTag()); pigman.setAlwaysRenderNameTag(creature.getAlwaysRenderNameTag()); } creature.world.spawnEntity(pigman); creature.setDead(); } else if (creature instanceof EntityCreeper) creature.onStruckByLightning(null); charged = true; return 1; } return charged ? 0 : 1; }
@Override public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) { if (p_142018_1_ instanceof DemoEntityTameable) { DemoEntityTameable demoEntityTameable = (DemoEntityTameable) p_142018_1_; if (demoEntityTameable.isTamed() && demoEntityTameable.getOwnerEntity() == p_142018_2_) { return false; } } return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame(); } else { return false; } }
public boolean canTargetCreature(EntityLivingBase targetMob, EntityLivingBase thisMob) { if (!(targetMob instanceof EntityCreeper) && !(targetMob instanceof EntityGhast)) { if (targetMob instanceof EntityIatWolf) { EntityIatWolf entitywolf = (EntityIatWolf)targetMob; if (entitywolf.isTamed() && entitywolf.getOwner() == thisMob) { return false; } } return targetMob instanceof EntityPlayer && thisMob instanceof EntityPlayer && !((EntityPlayer)thisMob).canAttackPlayer((EntityPlayer)targetMob) ? false : !(targetMob instanceof EntityHorse) || !((EntityHorse)targetMob).isTame(); } else { return false; } }
public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) { if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) { if (par1EntityLivingBase instanceof EntityWolf) { EntityWolf var3 = (EntityWolf)par1EntityLivingBase; if (var3.isTamed() && var3.getOwner() == par2EntityLivingBase) { return false; } } return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).canAttackPlayer((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).isTame(); } else { return false; } }
/** * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: * entityLiving, partialTickTime */ protected void preRenderCallback(EntityCreeper par1EntityCreeper, float par2) { float var3 = par1EntityCreeper.getCreeperFlashIntensity(par2); float var4 = 1.0F + MathHelper.sin(var3 * 100.0F) * var3 * 0.01F; if (var3 < 0.0F) { var3 = 0.0F; } if (var3 > 1.0F) { var3 = 1.0F; } var3 *= var3; var3 *= var3; float var5 = (1.0F + var3 * 0.4F) * var4; float var6 = (1.0F + var3 * 0.1F) / var4; GL11.glScalef(var5, var6, var5); }
public EntityRana(World par1World, int par2) { super(par1World); randomTickDivider = 0; isPlayingFlag = false; villageObj = null; setProfession(par2); dead = false; ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true); tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntitySkeleton.class, 8.0F, 0.6D, 0.6D)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntitySpider.class, 8.0F, 0.6D, 0.6D)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityTNTPrimed.class, 8.0F, 0.6D, 0.6D)); this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityCreeper.class, 8.0F, 0.6D, 0.6D)); tasks.addTask(5, new EntityAIMoveIndoors(this)); tasks.addTask(6, new EntityAIRestrictOpenDoor(this)); tasks.addTask(7, new EntityAIOpenDoor(this, true)); tasks.addTask(8, new EntityAIMoveTowardsRestriction(this, 0.3F)); tasks.addTask(9, new EntityAIWatchClosest2(this, net.minecraft.entity.player.EntityPlayer.class, 3F, 1.0F)); tasks.addTask(10, new EntityAIWatchClosest2(this, net.minecraft.entity.passive.EntityVillager.class, 5F, 0.02F)); tasks.addTask(11, new EntityAIWatchClosest2(this, com.stormister.rediscovered.EntityRana.class, 5F, 0.02F)); tasks.addTask(12, new EntityAIWatchClosest2(this, com.stormister.rediscovered.EntitySteve.class, 5F, 0.02F)); tasks.addTask(13, new EntityAIWander(this, 0.3F)); tasks.addTask(14, new EntityAIWatchClosest(this, net.minecraft.entity.EntityLiving.class, 8F)); }
@SubscribeEvent public void onDeathDrops(LivingDropsEvent event){ if(event.entityLiving instanceof EntityCreeper){ EntityItem item = new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, new ItemStack(modItems.itemCreepLeaf, 1)); if(((EntityCreeper)event.entity).getPowered()){ item = new EntityItem(event.entity.worldObj, event.entity.posX, event.entity.posY, event.entity.posZ, new ItemStack(modItems.itemChargedCreepLeaf, 1)); } event.drops.add(item); } else if(event.entityLiving.getDisplayName().equals("Harry9137")){ if(event.source.getEntity() instanceof EntityPlayer){ EntityPlayer badperson = (EntityPlayer)event.source.getEntity(); badperson.addChatMessage(new ChatComponentText("§4§lYou Don't Know What You've Done...")); } } }
@SuppressWarnings({"unchecked","rawtypes"}) @Override public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType,int i,int j,int k){ if (par1EnumCreatureType == EnumCreatureType.monster) { List monsters=new ArrayList(); monsters.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 8, 2, 3)); monsters.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 8, 2, 3)); monsters.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 8, 2, 3)); monsters.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 8, 2, 3)); monsters.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 8, 1, 3)); monsters.add(new BiomeGenBase.SpawnListEntry(EntityPixelOneSwingman.class, 1, 1, 1)); return monsters; } if (par1EnumCreatureType == EnumCreatureType.creature) { List creatures=new ArrayList(); creatures.add(new BiomeGenBase.SpawnListEntry(EntityhumanPixel.class, 8, 2, 3)); creatures.add(new BiomeGenBase.SpawnListEntry(EntitypixelPig.class, 8, 1, 3)); creatures.add(new BiomeGenBase.SpawnListEntry(EntitypixelCow.class, 8, 1, 3)); return creatures; } return null; }
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) { if (p_142018_1_ instanceof EntityKortor) { EntityKortor entitywolf = (EntityKortor)p_142018_1_; if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_) { return false; } } return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame(); } else { return false; } }
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) { if (p_142018_1_ instanceof EntityForisZertum) { EntityForisZertum entitywolf = (EntityForisZertum)p_142018_1_; if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_) { return false; } } return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame(); } else { return false; } }
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) { if (p_142018_1_ instanceof EntityDestroZertum) { EntityDestroZertum entitywolf = (EntityDestroZertum)p_142018_1_; if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_) { return false; } } return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame(); } else { return false; } }
@SubscribeEvent public void onLivingHurt(LivingHurtEvent event) { ItemStack boots = event.entityLiving.getEquipmentInSlot(1); ItemStack leggings = event.entityLiving.getEquipmentInSlot(2); ItemStack chestPlate = event.entityLiving.getEquipmentInSlot(3); ItemStack helmet = event.entityLiving.getEquipmentInSlot(4); if(boots != null && boots.getItem() == ModTutoriel.bootsTuto && leggings != null && leggings.getItem() == ModTutoriel.leggingsTuto && chestPlate != null && chestPlate.getItem() == ModTutoriel.chestPlateTuto && helmet != null && helmet.getItem() == ModTutoriel.helmetTuto) { if(event.source.getEntity() != null && event.source.getEntity() instanceof EntityCreeper) { boots.damageItem(MathHelper.floor_float(event.ammount / 4), event.entityLiving); leggings.damageItem(MathHelper.floor_float(event.ammount / 4), event.entityLiving); chestPlate.damageItem(MathHelper.floor_float(event.ammount / 4), event.entityLiving); helmet.damageItem(MathHelper.floor_float(event.ammount / 4), event.entityLiving); event.ammount = 0F; } else if(event.source.getDamageType().equals("cactus")) { event.entityLiving.worldObj.newExplosion(event.entityLiving, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, event.ammount, true, true); } } }
public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) { if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) { if (p_142018_1_ instanceof EntityIceZertum) { EntityIceZertum entitywolf = (EntityIceZertum)p_142018_1_; if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_) { return false; } } return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame(); } else { return false; } }