Removed "CrunchyLegs.exe" from the Strong Legs upgrade.
Upgrade nbow removes a portion of your fall distance when falling, thus increasing how far you have to fall in order to receive damage from falling. No longer *directly* decreases fall damage as a result.
This commit is contained in:
parent
37051b4e34
commit
3dfb8e5f55
|
@ -92,13 +92,7 @@ public class LivingArmorRegistrar
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}));
|
}));
|
||||||
public static final LivingUpgradeRegistryObject<LivingUpgrade> UPGRADE_JUMP = UPGRADES.register("jump", () -> parseDefinition("jump").withArmorProvider((player, stats, source, upgrade, level) -> {
|
public static final LivingUpgradeRegistryObject<LivingUpgrade> UPGRADE_JUMP = UPGRADES.register("jump", () -> parseDefinition("jump"));
|
||||||
if (source == DamageSource.FALL)
|
|
||||||
{
|
|
||||||
return upgrade.getBonusValue("fall", level).doubleValue();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}));
|
|
||||||
|
|
||||||
public static final LivingUpgradeRegistryObject<LivingUpgrade> UPGRADE_HEALTH = UPGRADES.register("health", () -> parseDefinition("health").withAttributeProvider((stats, attributeMap, uuid, upgrade, level) -> {
|
public static final LivingUpgradeRegistryObject<LivingUpgrade> UPGRADE_HEALTH = UPGRADES.register("health", () -> parseDefinition("health").withAttributeProvider((stats, attributeMap, uuid, upgrade, level) -> {
|
||||||
attributeMap.put(Attributes.MAX_HEALTH, new AttributeModifier(uuid, "Health Modifier", upgrade.getBonusValue("hp", level).intValue(), AttributeModifier.Operation.ADDITION));
|
attributeMap.put(Attributes.MAX_HEALTH, new AttributeModifier(uuid, "Health Modifier", upgrade.getBonusValue("hp", level).intValue(), AttributeModifier.Operation.ADDITION));
|
||||||
|
|
|
@ -360,13 +360,31 @@ public class GenericHandler
|
||||||
{
|
{
|
||||||
if (event.getEntity().world.isRemote)
|
if (event.getEntity().world.isRemote)
|
||||||
{
|
{
|
||||||
return;
|
if (event.getEntityLiving() instanceof PlayerEntity)
|
||||||
|
{
|
||||||
|
PlayerEntity player = (PlayerEntity) event.getEntityLiving();
|
||||||
|
if (LivingUtil.hasFullSet(player))
|
||||||
|
{
|
||||||
|
LivingStats stats = LivingStats.fromPlayer(player, true);
|
||||||
|
if (!player.isOnGround() && player.getMotion().getY() < 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
int jumpLevel = stats.getLevel(LivingArmorRegistrar.UPGRADE_JUMP.get().getKey());
|
||||||
|
double fallDistanceMultiplier = LivingArmorRegistrar.UPGRADE_JUMP.get().getBonusValue("fall", jumpLevel).doubleValue();
|
||||||
|
player.fallDistance = (float) Math.max(0, player.fallDistance + fallDistanceMultiplier * player.getMotion().getY());
|
||||||
|
// System.out.println("Player's motion: " + player.getMotion().getY() + ", Player's fall reduction multiplier: " + fallDistanceMultiplier + ", Player's final fall distance: " + player.fallDistance);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (event.getEntityLiving() instanceof PlayerEntity)
|
if (event.getEntityLiving() instanceof PlayerEntity)
|
||||||
{
|
{
|
||||||
PlayerEntity player = (PlayerEntity) event.getEntityLiving();
|
PlayerEntity player = (PlayerEntity) event.getEntityLiving();
|
||||||
float percentIncrease = 0;
|
float percentIncrease = 0;
|
||||||
|
|
||||||
|
// System.out.println("Player's motion: " + player.getMotion().getY() + ", Player's final fall distance: " + player.fallDistance);
|
||||||
|
|
||||||
if (LivingUtil.hasFullSet(player))
|
if (LivingUtil.hasFullSet(player))
|
||||||
{
|
{
|
||||||
LivingStats stats = LivingStats.fromPlayer(player, true);
|
LivingStats stats = LivingStats.fromPlayer(player, true);
|
||||||
|
@ -405,6 +423,15 @@ public class GenericHandler
|
||||||
LivingUtil.applyNewExperience(player, LivingArmorRegistrar.UPGRADE_SPEED.get(), distance);
|
LivingUtil.applyNewExperience(player, LivingArmorRegistrar.UPGRADE_SPEED.get(), distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!player.isOnGround() && player.getMotion().getY() < 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
int jumpLevel = stats.getLevel(LivingArmorRegistrar.UPGRADE_JUMP.get().getKey());
|
||||||
|
double fallDistanceMultiplier = LivingArmorRegistrar.UPGRADE_JUMP.get().getBonusValue("fall", jumpLevel).doubleValue();
|
||||||
|
player.fallDistance = (float) Math.max(0, player.fallDistance + fallDistanceMultiplier * player.getMotion().getY());
|
||||||
|
// System.out.println("Player's motion: " + player.getMotion().getY() + ", Player's fall reduction multiplier: " + fallDistanceMultiplier + ", Player's final fall distance: " + player.fallDistance);
|
||||||
|
}
|
||||||
|
|
||||||
if (player.getFireTimer() > 0)
|
if (player.getFireTimer() > 0)
|
||||||
{
|
{
|
||||||
LivingUtil.applyNewExperience(player, LivingArmorRegistrar.UPGRADE_FIRE_RESIST.get(), 1);
|
LivingUtil.applyNewExperience(player, LivingArmorRegistrar.UPGRADE_FIRE_RESIST.get(), 1);
|
||||||
|
|
|
@ -26,16 +26,16 @@
|
||||||
1.3
|
1.3
|
||||||
],
|
],
|
||||||
"fall": [
|
"fall": [
|
||||||
0.1,
|
0.33,
|
||||||
0.2,
|
|
||||||
0.3,
|
|
||||||
0.4,
|
0.4,
|
||||||
|
0.45,
|
||||||
0.5,
|
0.5,
|
||||||
0.6,
|
0.55,
|
||||||
0.7,
|
0.60,
|
||||||
|
0.65,
|
||||||
0.75,
|
0.75,
|
||||||
0.8,
|
0.85,
|
||||||
0.85
|
0.95
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue