Small Changes to Surface/Biome API
This commit is contained in:
parent
b8b12623bf
commit
54b55be51a
5 changed files with 23 additions and 62 deletions
|
@ -8,6 +8,7 @@ import joptsimple.ArgumentAcceptingOptionSpec;
|
|||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
import org.betterx.bclib.api.LifeCycleAPI;
|
||||
import org.betterx.bclib.api.biomes.BiomeAPI;
|
||||
import org.betterx.bclib.api.datafixer.DataFixerAPI;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -23,6 +24,7 @@ import java.util.Optional;
|
|||
abstract public class MainMixin {
|
||||
@ModifyVariable(method = "main", ordinal = 0, at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;getSummary()Lnet/minecraft/world/level/storage/LevelSummary;"))
|
||||
private static LevelStorageSource.LevelStorageAccess bc_createAccess(LevelStorageSource.LevelStorageAccess levelStorageAccess) {
|
||||
BiomeAPI.prepareNewLevel();
|
||||
DataFixerAPI.fixData(levelStorageAccess, false, (didFix) -> {/* not called when showUI==false */});
|
||||
|
||||
LifeCycleAPI._runBeforeLevelLoad();
|
||||
|
|
|
@ -70,9 +70,4 @@ public class MinecraftServerMixin {
|
|||
accessor.bclib_setRecipesByName(BCLRecipeManager.getMapByName(accessor.bclib_getRecipesByName()));
|
||||
accessor.bclib_setRecipes(BCLRecipeManager.getMap(accessor.bclib_getRecipes()));
|
||||
}
|
||||
|
||||
@Inject(method = "createLevels", at = @At(value = "HEAD"))
|
||||
private void bcl_createLevel(ChunkProgressListener chunkProgressListener, CallbackInfo ci) {
|
||||
System.out.println(this.worldData);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,14 +31,14 @@ public class TheEndBiomeDataMixin implements TheEndBiomeDataAccessor {
|
|||
private Map<Holder<Biome>, WeightedPicker<Holder<Biome>>> endBarrensMap;
|
||||
|
||||
public boolean bcl_canGenerateAsEndBiome(ResourceKey<Biome> key) {
|
||||
return endBiomesMap.containsKey(key);
|
||||
return endBiomesMap == null ? false : endBiomesMap.containsKey(key);
|
||||
}
|
||||
|
||||
public boolean bcl_canGenerateAsEndMidlandBiome(ResourceKey<Biome> key) {
|
||||
return endMidlandsMap.containsKey(key);
|
||||
return endMidlandsMap == null ? false : endMidlandsMap.containsKey(key);
|
||||
}
|
||||
|
||||
public boolean bcl_canGenerateAsEndBarrensBiome(ResourceKey<Biome> key) {
|
||||
return endBarrensMap.containsKey(key);
|
||||
return endBarrensMap == null ? false : endBarrensMap.containsKey(key);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue