clean up enchantments 2

This commit is contained in:
Sen 2025-06-17 23:03:26 +02:00
parent 38d29ba9c8
commit 9930d1bb6d
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
14 changed files with 218 additions and 250 deletions

View file

@ -5,6 +5,7 @@ import common.enchantment.Enchantment;
import common.inventory.ContainerEnchantment;
import common.inventory.InventoryPlayer;
import common.rng.Random;
import common.util.Pair;
import common.world.World;
public class GuiEnchant extends GuiContainer
@ -150,18 +151,15 @@ public class GuiEnchant extends GuiContainer
for (int j = 0; j < 3; ++j)
{
int k = this.container.mana[j];
int l = this.container.ids[j];
Pair<Enchantment, Integer> l = this.container.ench[j];
int i1 = j + 1;
if (this.isPointInRegion(60, 14 + 19 * j, 108, 17, mouseX, mouseY) && k > 0 && l >= 0)
if (this.isPointInRegion(60, 14 + 19 * j, 108, 17, mouseX, mouseY) && k > 0 && l != null)
{
StringBuilder sb = new StringBuilder();
if (l >= 0 && Enchantment.getEnchantmentById(l & 255) != null)
{
String s = Enchantment.getEnchantmentById(l & 255).getFormattedName((l & 65280) >> 8);
sb.append(TextColor.WHITE + s + " . . . ?");
}
String s = l.first().getFormattedName(l.second());
sb.append(TextColor.WHITE + s + " . . . ?");
// if (!flag)
// {