Add support for locate command on new versions from 1.18 to 1.20 (#318)

Co-authored-by: Antonio Cheong <teapotv8@proton.me>
This commit is contained in:
gptlang
2024-03-08 09:29:32 +00:00
committed by GitHub
parent cb27c81df8
commit 9fdb0c5f17
3 changed files with 96 additions and 33 deletions

View File

@@ -3,6 +3,8 @@ package anticope.rejects.utils;
import anticope.rejects.utils.seeds.Seed;
import anticope.rejects.utils.seeds.Seeds;
import baritone.api.BaritoneAPI;
import cubitect.Cubiomes;
import com.seedfinding.mcbiome.source.BiomeSource;
import com.seedfinding.mcfeature.misc.SlimeChunk;
import com.seedfinding.mcfeature.structure.*;
@@ -126,7 +128,20 @@ public class WorldGenUtils {
desert_pyramid
}
public static BlockPos locateFeature(Feature feature, BlockPos center) {
public static BlockPos locateFeature(Cubiomes.StructureType cfeature, BlockPos center) {
Feature feature = switch (cfeature) {
case Treasure -> Feature.buried_treasure;
case Mansion -> Feature.mansion;
case Stronghold -> Feature.stronghold;
case Fortress -> Feature.nether_fortress;
case Monument -> Feature.ocean_monument;
case Bastion -> Feature.bastion_remnant;
case End_City -> Feature.end_city;
case Village -> Feature.village;
case Mineshaft -> Feature.mineshaft;
case Desert_Pyramid -> Feature.desert_pyramid;
default -> null;
};
Seed seed = Seeds.get().getSeed();
BlockPos pos = null;
if (!checkIfInDimension(getDimension(feature))) {