diff options
author | Detrav <witalyezep@gmail.com> | 2017-04-01 11:50:38 +0300 |
---|---|---|
committer | Detrav <witalyezep@gmail.com> | 2017-04-01 11:50:38 +0300 |
commit | 1e2ad53e4af786ff3bf5a263f6854eddb013b5c0 (patch) | |
tree | 1a8715d44ee78f697762d83349f04e4b0a961308 /src/main/java/com/detrav/events | |
parent | 12515322fdba0b7ba04352e9b2f3c432312ce328 (diff) | |
download | GT5-Unofficial-1e2ad53e4af786ff3bf5a263f6854eddb013b5c0.tar.gz GT5-Unofficial-1e2ad53e4af786ff3bf5a263f6854eddb013b5c0.tar.bz2 GT5-Unofficial-1e2ad53e4af786ff3bf5a263f6854eddb013b5c0.zip |
fixes and additions
- fixed empty message of propick
- fixed low hp after login
+ Added smart tree tap
Diffstat (limited to 'src/main/java/com/detrav/events')
-rw-r--r-- | src/main/java/com/detrav/events/DetravLevelUpEvent.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/detrav/events/DetravLevelUpEvent.java b/src/main/java/com/detrav/events/DetravLevelUpEvent.java index cb47220c6e..6dbcf4bfca 100644 --- a/src/main/java/com/detrav/events/DetravLevelUpEvent.java +++ b/src/main/java/com/detrav/events/DetravLevelUpEvent.java @@ -24,8 +24,8 @@ public class DetravLevelUpEvent { EntityPlayer player = ev.entityPlayer; if (player != null) { if (!player.getEntityWorld().isRemote) { - if ((player.experience + ev.orb.xpValue) >= player.xpBarCap()) { - UpdateHealthAttribute(player); + if ((player.experience + ev.orb.xpValue*2) >= player.xpBarCap()) { + UpdateHealthAttribute(player,1); } } } @@ -33,14 +33,20 @@ public class DetravLevelUpEvent { public static void UpdateHealthAttribute(EntityPlayer player) { + UpdateHealthAttribute(player,0); + } + + public static void UpdateHealthAttribute(EntityPlayer player,int bonus) + { if (!player.getEntityWorld().isRemote) { - AttributeModifier mod = GetAttributeModifier(player.experienceLevel); + AttributeModifier mod = GetAttributeModifier(player.experienceLevel+bonus); player.getEntityAttribute( SharedMonsterAttributes.maxHealth ).removeModifier(mod); player.getEntityAttribute( SharedMonsterAttributes.maxHealth ).applyModifier(mod); + player.heal(player.getMaxHealth()); } } |