Backported fall damage cancellation rework.
This commit is contained in:
parent
cccc9a9b03
commit
50de1ce529
|
@ -1,5 +1,7 @@
|
|||
package com.legacy.aether;
|
||||
|
||||
import com.legacy.aether.api.AetherAPI;
|
||||
import com.legacy.aether.api.player.IPlayerAether;
|
||||
import com.legacy.aether.entities.passive.mountable.EntityAerbunny;
|
||||
import com.legacy.aether.entities.projectile.darts.EntityDartBase;
|
||||
import com.legacy.aether.network.AetherNetwork;
|
||||
|
@ -41,6 +43,7 @@ import net.minecraftforge.event.entity.EntityStruckByLightningEvent;
|
|||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import net.minecraftforge.event.entity.player.*;
|
||||
|
||||
import com.legacy.aether.blocks.BlocksAether;
|
||||
|
@ -365,6 +368,20 @@ AetherEventHandler {
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onFall(LivingFallEvent event)
|
||||
{
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
IPlayerAether playerAether = PlayerAether.get((EntityPlayer) event.entityLiving);
|
||||
|
||||
if (playerAether.getAccessoryInventory().wearingArmor(new ItemStack(ItemsAether.sentry_boots)) || playerAether.getAccessoryInventory().isWearingGravititeSet() || playerAether.getAccessoryInventory().isWearingValkyrieSet())
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void performTimeSet(PlayerWakeUpEvent event, World world, WorldServer worldServer)
|
||||
{
|
||||
if (world.getGameRules().getGameRuleBooleanValue("doDaylightCycle") && event.entityPlayer.isPlayerFullyAsleep())
|
||||
|
|
|
@ -44,8 +44,6 @@ public class AbilityArmor implements IAetherAbility {
|
|||
this.player.getEntity().motionY = 1D;
|
||||
this.jumpBoosted = true;
|
||||
}
|
||||
|
||||
this.player.getEntity().fallDistance = -1F;
|
||||
}
|
||||
|
||||
if (this.player.getEntity().isWet()) {
|
||||
|
@ -75,10 +73,6 @@ public class AbilityArmor implements IAetherAbility {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.player.getAccessoryInventory().wearingArmor(new ItemStack(ItemsAether.sentry_boots))) {
|
||||
this.player.getEntity().fallDistance = 0F;
|
||||
}
|
||||
|
||||
if (!this.player.isJumping() && this.player.getEntity().onGround) {
|
||||
this.jumpBoosted = false;
|
||||
}
|
||||
|
|
|
@ -45,8 +45,6 @@ public class AbilityFlight implements IAetherAbility {
|
|||
this.flightMod = 1.0D;
|
||||
}
|
||||
|
||||
this.player.getEntity().fallDistance = -1F;
|
||||
|
||||
if (this.player.getEntity().onGround) {
|
||||
this.flightCount = 0;
|
||||
this.flightMod = 1.0D;
|
||||
|
|
Loading…
Reference in a new issue