From 67711bcb0ddea4278351b3bfe2b15eef939f0e75 Mon Sep 17 00:00:00 2001 From: DanLT Date: Wed, 1 Sep 2021 13:05:36 -0800 Subject: [PATCH] Fix eb & biome context --- .../volmit/iris/core/commands/CommandStudio.java | 10 +++++++++- .../com/volmit/iris/engine/framework/Engine.java | 13 +++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/volmit/iris/core/commands/CommandStudio.java b/src/main/java/com/volmit/iris/core/commands/CommandStudio.java index ff7885728..72891f843 100644 --- a/src/main/java/com/volmit/iris/core/commands/CommandStudio.java +++ b/src/main/java/com/volmit/iris/core/commands/CommandStudio.java @@ -267,9 +267,17 @@ public class CommandStudio implements DecreeExecutor { @Param(contextual = true, description = "The biome to edit") IrisBiome biome ) { - if (noStudio()) return; + if (noStudio()) { + return; + } try { + if(biome.getLoadFile() == null) + { + sender().sendMessage(C.GOLD + "Cannot find the file for the biome you are in! Perhaps it was not loaded directly from a file?"); + return; + } + Desktop.getDesktop().open(biome.getLoadFile()); } catch (Throwable e) { Iris.reportError(e); diff --git a/src/main/java/com/volmit/iris/engine/framework/Engine.java b/src/main/java/com/volmit/iris/engine/framework/Engine.java index 80a13fa11..2fc33b23a 100644 --- a/src/main/java/com/volmit/iris/engine/framework/Engine.java +++ b/src/main/java/com/volmit/iris/engine/framework/Engine.java @@ -678,6 +678,14 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat return getSurfaceBiome(x, z); } + default IrisBiome getBiomeOrMantle(int x, int y, int z) { + if (y <= getHeight(x, z) - 2) { + return getCaveOrMantleBiome(x, y, z); + } + + return getSurfaceBiome(x, z); + } + default String getObjectPlacementKey(int x, int y, int z) { PlacedObject o = getObjectPlacement(x, y, z); @@ -718,4 +726,9 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat } int getCacheID(); + + default IrisBiome getBiomeOrMantle(Location l) + { + return getBiomeOrMantle(l.getBlockX(), l.getBlockY(), l.getBlockZ()); + } }