Version change, removed old API functions, javadoc fixes
This commit is contained in:
parent
1f0403d1b3
commit
28228b35e2
6 changed files with 12 additions and 70 deletions
|
@ -11,7 +11,7 @@ loader_version= 0.11.6
|
|||
fabric_version = 0.36.1+1.17
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 0.3.2
|
||||
mod_version = 0.4.0
|
||||
maven_group = ru.bclib
|
||||
archives_base_name = bclib
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biomes;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.api.WorldDataAPI;
|
||||
import ru.bclib.api.dataexchange.DataExchangeAPI;
|
||||
|
@ -47,6 +49,14 @@ public class BCLib implements ModInitializer {
|
|||
));
|
||||
|
||||
Configs.save();
|
||||
|
||||
if (isDevEnvironment()) {
|
||||
BiomeAPI.registerEndLandBiome(BiomeAPI.getFromRegistry(Biomes.FOREST));
|
||||
BiomeAPI.registerEndLandBiome(BiomeAPI.getFromRegistry(Biomes.WARPED_FOREST));
|
||||
BiomeAPI.registerEndLandBiome(BiomeAPI.getFromRegistry(Biomes.TAIGA));
|
||||
BiomeAPI.registerEndLandBiome(BiomeAPI.getFromRegistry(Biomes.ICE_SPIKES));
|
||||
BiomeAPI.registerEndLandBiome(BiomeAPI.getFromRegistry(Biomes.MUSHROOM_FIELDS));
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isDevEnvironment() {
|
||||
|
|
|
@ -184,52 +184,6 @@ public class BiomeAPI {
|
|||
return bclBiome;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds {@link BCLBiome} to FabricAPI biomes as the Nether biome (with random {@link ClimateParameters}).
|
||||
*
|
||||
* @param biome - {@link BCLBiome}.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void addNetherBiomeToFabricApi(BCLBiome biome) {
|
||||
ResourceKey<Biome> key = BuiltinRegistries.BIOME.getResourceKey(biome.getBiome()).get();
|
||||
Random random = new Random(biome.getID().toString().hashCode());
|
||||
ClimateParameters parameters = new ClimateParameters(
|
||||
MHelper.randRange(-2F, 2F, random),
|
||||
MHelper.randRange(-2F, 2F, random),
|
||||
MHelper.randRange(-2F, 2F, random),
|
||||
MHelper.randRange(-2F, 2F, random),
|
||||
random.nextFloat()
|
||||
);
|
||||
InternalBiomeData.addNetherBiome(key, parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use BiomeAPI.registerEndLandBiome instead of this.
|
||||
* Adds {@link BCLBiome} to FabricAPI biomes as an End land biome (generating on islands).
|
||||
*
|
||||
* @param biome - {@link BCLBiome}.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void addEndLandBiomeToFabricApi(BCLBiome biome) {
|
||||
float weight = biome.getGenChance();
|
||||
ResourceKey<Biome> key = BuiltinRegistries.BIOME.getResourceKey(biome.getBiome()).get();
|
||||
InternalBiomeData.addEndBiomeReplacement(Biomes.END_HIGHLANDS, key, weight);
|
||||
InternalBiomeData.addEndBiomeReplacement(Biomes.END_MIDLANDS, key, weight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Use BiomeAPI.registerEndVoidBiome instead of this.
|
||||
* Adds {@link BCLBiome} to FabricAPI biomes as an End void biome (generating between islands in the void).
|
||||
*
|
||||
* @param biome - {@link BCLBiome}.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void addEndVoidBiomeToFabricApi(BCLBiome biome) {
|
||||
float weight = biome.getGenChance();
|
||||
ResourceKey<Biome> key = BuiltinRegistries.BIOME.getResourceKey(biome.getBiome()).get();
|
||||
InternalBiomeData.addEndBiomeReplacement(Biomes.SMALL_END_ISLANDS, key, weight);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get {@link BCLBiome} from {@link Biome} instance on server. Used to convert world biomes to BCLBiomes.
|
||||
*
|
||||
|
@ -254,9 +208,7 @@ public class BiomeAPI {
|
|||
BCLBiome endBiome = CLIENT.get(biome);
|
||||
if (endBiome == null) {
|
||||
Minecraft minecraft = Minecraft.getInstance();
|
||||
ResourceLocation id = minecraft.level.registryAccess()
|
||||
.registryOrThrow(Registry.BIOME_REGISTRY)
|
||||
.getKey(biome);
|
||||
ResourceLocation id = minecraft.level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY).getKey(biome);
|
||||
endBiome = id == null ? EMPTY_BIOME : ID_MAP.getOrDefault(id, EMPTY_BIOME);
|
||||
CLIENT.put(biome, endBiome);
|
||||
}
|
||||
|
@ -284,22 +236,6 @@ public class BiomeAPI {
|
|||
return ID_MAP.getOrDefault(biomeID, EMPTY_BIOME);
|
||||
}
|
||||
|
||||
/** Use inner biome field instead.
|
||||
* Get actual {@link Biome} from given {@link BCLBiome}. If it is null it will request it from current {@link Registry}.
|
||||
*
|
||||
* @param biome - {@link BCLBiome}.
|
||||
* @return {@link Biome}.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static Biome getActualBiome(BCLBiome biome) {
|
||||
Biome actual = biome.getActualBiome();
|
||||
if (actual == null) {
|
||||
biome.updateActualBiomes(biomeRegistry);
|
||||
actual = biome.getActualBiome();
|
||||
}
|
||||
return actual;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if biome with {@link ResourceLocation} exists in API registry.
|
||||
*
|
||||
|
|
|
@ -8,10 +8,8 @@ import ru.bclib.api.dataexchange.handler.DataExchange;
|
|||
import ru.bclib.config.Config;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class DataExchangeAPI extends DataExchange {
|
||||
private final static List<String> MODS = Lists.newArrayList();
|
||||
|
|
|
@ -6,7 +6,6 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.util.GsonHelper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import ru.bclib.api.dataexchange.handler.DataExchange;
|
||||
import ru.bclib.util.JsonFactory;
|
||||
|
||||
import java.io.File;
|
||||
|
|
|
@ -2,7 +2,6 @@ package ru.bclib.world.generator;
|
|||
|
||||
import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.RegistryLookupCodec;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue