From b05736e4fb1e4145eb3515b0ba489862d4e2174b Mon Sep 17 00:00:00 2001 From: Daniel Mills Date: Wed, 14 Jul 2021 02:29:47 -0400 Subject: [PATCH] What biome support datapack biomes --- .../command/what/CommandIrisWhatBiome.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBiome.java b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBiome.java index 5dfe5f6af..22f5e5d39 100644 --- a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBiome.java +++ b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBiome.java @@ -1,15 +1,34 @@ package com.volmit.iris.manager.command.what; import com.volmit.iris.Iris; +import com.volmit.iris.nms.INMS; import com.volmit.iris.object.IrisBiome; import com.volmit.iris.scaffold.IrisWorlds; import com.volmit.iris.scaffold.engine.IrisAccess; import com.volmit.iris.util.KList; import com.volmit.iris.util.MortarCommand; import com.volmit.iris.util.MortarSender; +import net.minecraft.core.BlockPosition; +import net.minecraft.core.IRegistry; +import net.minecraft.core.IRegistryCustom; +import net.minecraft.core.IRegistryWritable; +import net.minecraft.data.RegistryGeneration; +import net.minecraft.data.worldgen.biome.BiomeRegistry; +import net.minecraft.resources.MinecraftKey; +import net.minecraft.resources.ResourceKey; +import net.minecraft.server.commands.CommandLocateBiome; +import net.minecraft.server.level.WorldServer; +import net.minecraft.world.level.biome.BiomeBase; import org.bukkit.World; +import org.bukkit.block.Biome; +import org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import org.bukkit.craftbukkit.v1_17_R1.CraftWorld; +import org.bukkit.craftbukkit.v1_17_R1.block.CraftBlock; import org.bukkit.entity.Player; +import java.lang.reflect.Field; +import java.util.Map; + public class CommandIrisWhatBiome extends MortarCommand { public CommandIrisWhatBiome() @@ -41,11 +60,25 @@ public class CommandIrisWhatBiome extends MortarCommand assert g != null; IrisBiome b = g.getBiome(p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ()); sender.sendMessage("IBiome: " + b.getLoadKey() + " (" + b.getDerivative().name() + ")"); + } catch(Throwable e) { sender.sendMessage("Non-Iris Biome: " + p.getLocation().getBlock().getBiome().name()); + + if(p.getLocation().getBlock().getBiome().equals(Biome.CUSTOM)) + { + try + { + sender.sendMessage("Data Pack Biome: " + INMS.get().getTrueBiomeBaseKey(p.getLocation()) + " (ID: " + INMS.get().getTrueBiomeBaseId(INMS.get().getTrueBiomeBase(p.getLocation())) + ")"); + } + + catch(Throwable ex) + { + + } + } } }