Merge commit 'befdd2c10a
' into 1.17.1
This commit is contained in:
commit
24e16a1850
4 changed files with 13 additions and 1 deletions
|
@ -65,6 +65,7 @@ def useApi(String dep) {
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property "version", project.version
|
inputs.property "version", project.version
|
||||||
|
duplicatesStrategy = 'EXCLUDE'
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include "fabric.mod.json"
|
include "fabric.mod.json"
|
||||||
|
|
|
@ -91,6 +91,9 @@ public class BiomeAPI {
|
||||||
* @return {@link BCLBiome} or {@code BiomeAPI.EMPTY_BIOME}.
|
* @return {@link BCLBiome} or {@code BiomeAPI.EMPTY_BIOME}.
|
||||||
*/
|
*/
|
||||||
public static BCLBiome getFromBiome(Biome biome) {
|
public static BCLBiome getFromBiome(Biome biome) {
|
||||||
|
if (biomeRegistry == null) {
|
||||||
|
return EMPTY_BIOME;
|
||||||
|
}
|
||||||
return ID_MAP.getOrDefault(biomeRegistry.getKey(biome), EMPTY_BIOME);
|
return ID_MAP.getOrDefault(biomeRegistry.getKey(biome), EMPTY_BIOME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,12 @@ public class BaseSlabBlock extends SlabBlock implements BlockModelProvider {
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
|
public @Nullable BlockModel getBlockModel(ResourceLocation blockId, BlockState blockState) {
|
||||||
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
|
ResourceLocation parentId = Registry.BLOCK.getKey(parent);
|
||||||
Optional<String> pattern = PatternsHelper.createJson(BasePatterns.BLOCK_SLAB, parentId);
|
Optional<String> pattern;
|
||||||
|
if (blockState.getValue(TYPE) == SlabType.DOUBLE) {
|
||||||
|
pattern = PatternsHelper.createBlockSimple(parentId);
|
||||||
|
} else {
|
||||||
|
pattern = PatternsHelper.createJson(BasePatterns.BLOCK_SLAB, parentId);
|
||||||
|
}
|
||||||
return ModelsHelper.fromPattern(pattern);
|
return ModelsHelper.fromPattern(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.world.level.dimension.DimensionType;
|
||||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||||
import net.minecraft.world.level.storage.ServerLevelData;
|
import net.minecraft.world.level.storage.ServerLevelData;
|
||||||
import net.minecraft.world.level.storage.WritableLevelData;
|
import net.minecraft.world.level.storage.WritableLevelData;
|
||||||
|
import ru.bclib.api.BiomeAPI;
|
||||||
import ru.bclib.api.DataFixerAPI;
|
import ru.bclib.api.DataFixerAPI;
|
||||||
import ru.bclib.api.WorldDataAPI;
|
import ru.bclib.api.WorldDataAPI;
|
||||||
|
|
||||||
|
@ -35,6 +36,8 @@ public abstract class ServerLevelMixin extends Level {
|
||||||
|
|
||||||
@Inject(method = "<init>*", at = @At("TAIL"))
|
@Inject(method = "<init>*", at = @At("TAIL"))
|
||||||
private void bcl_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorageSource.LevelStorageAccess session, ServerLevelData properties, ResourceKey<Level> registryKey, DimensionType dimensionType, ChunkProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List<CustomSpawner> list, boolean bl, CallbackInfo info) {
|
private void bcl_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorageSource.LevelStorageAccess session, ServerLevelData properties, ResourceKey<Level> registryKey, DimensionType dimensionType, ChunkProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List<CustomSpawner> list, boolean bl, CallbackInfo info) {
|
||||||
|
BiomeAPI.initRegistry(server);
|
||||||
|
|
||||||
if (bcl_lastWorld != null && bcl_lastWorld.equals(session.getLevelId())) {
|
if (bcl_lastWorld != null && bcl_lastWorld.equals(session.getLevelId())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue