Fix eb & biome context

This commit is contained in:
DanLT 2021-09-01 13:05:36 -08:00
parent f93c158caa
commit 67711bcb0d
2 changed files with 22 additions and 1 deletions

View File

@ -267,9 +267,17 @@ public class CommandStudio implements DecreeExecutor {
@Param(contextual = true, description = "The biome to edit") @Param(contextual = true, description = "The biome to edit")
IrisBiome biome IrisBiome biome
) { ) {
if (noStudio()) return; if (noStudio()) {
return;
}
try { 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()); Desktop.getDesktop().open(biome.getLoadFile());
} catch (Throwable e) { } catch (Throwable e) {
Iris.reportError(e); Iris.reportError(e);

View File

@ -678,6 +678,14 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
return getSurfaceBiome(x, z); 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) { default String getObjectPlacementKey(int x, int y, int z) {
PlacedObject o = getObjectPlacement(x, y, z); PlacedObject o = getObjectPlacement(x, y, z);
@ -718,4 +726,9 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
} }
int getCacheID(); int getCacheID();
default IrisBiome getBiomeOrMantle(Location l)
{
return getBiomeOrMantle(l.getBlockX(), l.getBlockY(), l.getBlockZ());
}
} }