@SubscribeEvent public void onFlyFall(PlayerFlyableFallEvent event) { if (event.getEntityPlayer().getEntityWorld().provider.getDimension() == 0) { if (event.getEntityPlayer().fallDistance >= ConfigValues.underworldFallDistance) { BlockPos location = event.getEntityPlayer().getPosition(); BlockPos bedrock = PosUtils.checkNeighborBlocksThoroughly(event.getEntity().getEntityWorld(), location, Blocks.BEDROCK); if (bedrock != null) { if (event.getEntity().getEntityWorld().getBlockState(bedrock).getBlock() == Blocks.BEDROCK) { TeleportUtil.teleportToDimension(event.getEntityPlayer(), Wizardry.underWorld.getId(), 0, 300, 0); ((EntityPlayer) event.getEntity()).addPotionEffect(new PotionEffect(ModPotions.NULLIFY_GRAVITY, 100, 0, true, false)); fallResetter.add(event.getEntity().getUniqueID()); } } } } }
protected void fall(float p_70069_1_) { if (!this.capabilities.allowFlying) { if (p_70069_1_ >= 2.0F) { this.addStat(StatList.distanceFallenStat, (int)Math.round((double)p_70069_1_ * 100.0D)); } super.fall(p_70069_1_); } else { MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, p_70069_1_)); } }
/** * Called when the mob is falling. Calculates and applies fall damage. */ protected void fall(float par1) { if (!this.capabilities.allowFlying) { if (par1 >= 2.0F) { this.addStat(StatList.distanceFallenStat, (int)Math.round((double)par1 * 100.0D)); } super.fall(par1); } else { MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, par1)); } }
protected void fall(float p_70069_1_) { if (!this.capabilities.allowFlying) { if (p_70069_1_ >= 2.0F) { addStat(StatList.distanceFallenStat, (int)Math.round(p_70069_1_ * 100.0D)); } super.fall(p_70069_1_); } else { MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, p_70069_1_)); } }
@SubscribeEvent public void onCreativeFall(PlayerFlyableFallEvent event) { ZSSPlayerSkills skills = ZSSPlayerSkills.get(event.entityPlayer); if (skills.isSkillActive(SkillBase.leapingBlow)) { ((LeapingBlow) skills.getPlayerSkill(SkillBase.leapingBlow)).onImpact(event.entityPlayer, event.distance); } }
public static void onPlayerFall(EntityPlayer player, float distance, float multiplier) { MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(player, distance, multiplier)); }