From b440d0257d02e30f7a252e9eff4926501f91f7e1 Mon Sep 17 00:00:00 2001 From: Julian Krings Date: Thu, 19 Jun 2025 19:50:08 +0200 Subject: [PATCH] fix iris what commands --- .../iris/core/commands/CommandWhat.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/com/volmit/iris/core/commands/CommandWhat.java b/core/src/main/java/com/volmit/iris/core/commands/CommandWhat.java index 48d8c726e..c2c8015da 100644 --- a/core/src/main/java/com/volmit/iris/core/commands/CommandWhat.java +++ b/core/src/main/java/com/volmit/iris/core/commands/CommandWhat.java @@ -74,22 +74,22 @@ public class CommandWhat implements DecreeExecutor { } catch (Throwable e) { Iris.reportError(e); sender().sendMessage("Non-Iris Biome: " + player().getLocation().getBlock().getBiome().name()); - - if (player().getLocation().getBlock().getBiome().equals(Biome.CUSTOM)) { - try { - sender().sendMessage("Data Pack Biome: " + INMS.get().getTrueBiomeBaseKey(player().getLocation()) + " (ID: " + INMS.get().getTrueBiomeBaseId(INMS.get().getTrueBiomeBase(player().getLocation())) + ")"); - } catch (Throwable ee) { - Iris.reportError(ee); - } - } + var loc = player().getLocation(); + var sender = sender(); + Iris.platform.getRegionScheduler().run(loc, () -> { + var biome = loc.getBlock().getBiome(); + if (biome != Biome.CUSTOM && biome.getKey().getNamespace().equals("minecraft")) + return; + sender.sendMessage("Data Pack Biome: " + INMS.get().getTrueBiomeBaseKey(loc) + " (ID: " + INMS.get().getTrueBiomeBaseId(INMS.get().getTrueBiomeBase(loc)) + ")"); + }); } } @Decree(description = "What region am i in?", origin = DecreeOrigin.PLAYER) public void region() { try { - Chunk chunk = world().getChunkAt(player().getLocation().getBlockZ() / 16, player().getLocation().getBlockZ() / 16); - IrisRegion r = engine().getRegion(chunk); + var loc = player().getLocation(); + IrisRegion r = engine().getRegion(loc); sender().sendMessage("IRegion: " + r.getLoadKey() + " (" + r.getName() + ")"); } catch (Throwable e) {