1.5r2 p1
This commit is contained in:
parent
620a949b9b
commit
5856a07c63
15 changed files with 8 additions and 3 deletions
|
|
@ -36,7 +36,11 @@ public class BuyEnchantment {
|
|||
return false;
|
||||
} else {
|
||||
PlayerStats playerStats = PlayerStats.getPlayerStats((Player) sender);
|
||||
double cost = EnchantBaseValues.enchantBaseValues.get(enchantment) * (double) (itemToApply.getEnchantmentLevel(enchantment) + 1);
|
||||
int currentLevel = itemToApply.getEnchantmentLevel(enchantment);
|
||||
int vanillaMax = enchantment.getMaxLevel();
|
||||
int levelsAboveVanilla = Math.max(0, currentLevel - vanillaMax);
|
||||
double multiplier = Math.pow(2, levelsAboveVanilla);
|
||||
double cost = EnchantBaseValues.enchantBaseValues.get(enchantment) * (double) (currentLevel + 1) * multiplier;
|
||||
if (playerStats.getStat("money", Double.class) < cost) {
|
||||
sender.sendMessage("Not enough money.");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ public class EntitySpawnEvent {
|
|||
double maxHealth = livingEntity.getAttribute(Attribute.MAX_HEALTH).getValue();
|
||||
String healthBar = generateHealthBar(livingEntity.getHealth(), maxHealth);
|
||||
|
||||
livingEntity.setCustomName(null);
|
||||
metadata.originalName = livingEntity.getName();
|
||||
String displayName = levelColor + "[" + finalLevel + "] " + ChatColor.WHITE + metadata.originalName + " " + healthBar;
|
||||
livingEntity.setCustomName(displayName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue