This commit is contained in:
tyuXX 2026-07-09 14:24:33 +03:00
parent 620a949b9b
commit 5856a07c63
15 changed files with 8 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View file

@ -3,7 +3,7 @@ plugins {
}
group = 'org.gsdistance'
version = '1.5r1'
version = '1.5r2'
repositories {
mavenCentral()

Binary file not shown.

View file

@ -4,7 +4,7 @@ description: A spigot plugin made by Grimm and tyuXX, it adds player leveling, a
website: www.gsdistance.org
prefix: Grimm's
main: org.gsdistance.grimmsServer.GrimmsServer
version: 1.5r1
version: 1.5r2
api-version: 1.20
load: STARTUP
commands:

View file

@ -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;

View file

@ -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);