Update VillagerWorkstationEvent to remove outdated api use

This commit is contained in:
akastijn 2026-05-14 19:38:50 +02:00
parent 8ad6fe2608
commit 85e5effc15

View File

@ -38,7 +38,7 @@ public class VillagerWorkstationEvent implements Listener {
} }
private void showWorkstation(Player player, Villager villager) { private void showWorkstation(Player player, Villager villager) {
String professionName = formatName(villager.getProfession().name()); String professionName = formatName(villager.getProfession().key().asMinimalString());
Location jobSite = villager.getMemory(MemoryKey.JOB_SITE); Location jobSite = villager.getMemory(MemoryKey.JOB_SITE);
if (jobSite == null) { if (jobSite == null) {
@ -73,7 +73,7 @@ public class VillagerWorkstationEvent implements Listener {
double angle = (2 * Math.PI * i) / count; double angle = (2 * Math.PI * i) / count;
double x = cx + 0.5 * Math.cos(angle); double x = cx + 0.5 * Math.cos(angle);
double z = cz + 0.5 * Math.sin(angle); double z = cz + 0.5 * Math.sin(angle);
player.spawnParticle(Particle.VILLAGER_HAPPY, x, cy, z, 1, 0, 0, 0, 0); player.spawnParticle(Particle.HAPPY_VILLAGER, x, cy, z, 1, 0, 0, 0, 0);
} }
} }