Continue mapping migration

This commit is contained in:
Aleksey 2021-04-12 21:38:22 +03:00
parent 99ade39404
commit f03fd03bd0
499 changed files with 12567 additions and 12723 deletions

View file

@ -2,10 +2,9 @@ package ru.betterend.integration.byg;
import java.util.List;
import java.util.stream.Collectors;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.collection.WeightedList;
import net.minecraft.data.BuiltinRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.ai.behavior.WeightedList;
import net.minecraft.world.level.biome.Biome;
import ru.betterend.integration.Integrations;
import ru.betterend.integration.ModIntegration;
@ -32,31 +31,31 @@ public class BYGIntegration extends ModIntegration {
@Override
public void addBiomes() {
BYGBiomes.addBiomes();
Class<?> biomeClass = this.getClass("corgiaoc.byg.common.world.biome.BYGEndBiome");
List<Object> biomes = this.getStaticFieldValue(biomeClass, "BYG_END_BIOMES");
if (biomes != null && biomeClass != null) {
biomes.forEach((obj) -> {
Biome biome = this.getAndExecuteRuntime(biomeClass, obj, "getBiome");
if (biome != null) {
ResourceLocation biomeID = BuiltinRegistries.BIOME.getId(biome);
ResourceLocation biomeID = BuiltinRegistries.BIOME.getKey(biome);
EndBiome endBiome = EndBiomes.getBiome(biomeID);
Biome edge = this.getAndExecuteRuntime(biomeClass, obj, "getEdge");
if (edge != null) {
ResourceLocation edgeID = BuiltinRegistries.BIOME.getId(edge);
ResourceLocation edgeID = BuiltinRegistries.BIOME.getKey(edge);
EndBiomes.LAND_BIOMES.removeMutableBiome(edgeID);
EndBiomes.VOID_BIOMES.removeMutableBiome(edgeID);
EndBiome edgeBiome = EndBiomes.getBiome(edgeID);
endBiome.setEdge(edgeBiome);
} else {
}
else {
Boolean isVoid = this.getAndExecuteRuntime(biomeClass, obj, "isVoid");
if (isVoid != null && isVoid.booleanValue()) {
EndBiomes.LAND_BIOMES.removeMutableBiome(biomeID);
EndBiomes.VOID_BIOMES.addBiomeMutable(endBiome);
}
WeightedList<ResourceLocation> subBiomes = this.getAndExecuteRuntime(biomeClass, obj,
"getHills");
WeightedList<ResourceLocation> subBiomes = this.getAndExecuteRuntime(biomeClass, obj, "getHills");
if (subBiomes != null) {
subBiomes.stream().collect(Collectors.toList()).forEach((id) -> {
EndBiome subBiome = EndBiomes.getBiome(id);