Fixed compiler and Startup Errors

This commit is contained in:
Frank 2021-09-25 13:18:32 +02:00
parent e2ab77658b
commit 08f35ab52c
9 changed files with 16 additions and 24 deletions

View file

@ -97,7 +97,7 @@ public class BiomeAPI {
registerBiome(biome);
NETHER_BIOME_PICKER.addBiome(biome);
Random random = new Random(biome.getID().hashCode());
//TODO: did they add depth and scale as two new params here???
//TODO: (1.18) did they add depth and scale as two new params here???
Climate.ParameterPoint parameters = Climate.parameters(
MHelper.randRange(-1.5F, 1.5F, random),
MHelper.randRange(-1.5F, 1.5F, random),

View file

@ -181,13 +181,11 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, Cust
@Override
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) {
// TODO Auto-generated method stub
return super.canPlaceLiquid(world, pos, state, fluid);
}
@Override
public boolean placeLiquid(LevelAccessor world, BlockPos pos, BlockState state, FluidState fluidState) {
// TODO Auto-generated method stub
return super.placeLiquid(world, pos, state, fluidState);
}

View file

@ -29,7 +29,7 @@ public class BoneMealItemMixin {
Level world = context.getLevel();
BlockPos blockPos = context.getClickedPos();
if (!world.isClientSide) {
BlockPos offseted = blockPos.relative(context.getClickedFace());
//BlockPos offset = blockPos.relative(context.getClickedFace());
if (BonemealAPI.isTerrain(world.getBlockState(blockPos).getBlock())) {
boolean consume = false;
if (BonemealAPI.isSpreadableTerrain(world.getBlockState(blockPos).getBlock())) {

View file

@ -2,7 +2,9 @@ package ru.bclib.mixin.common;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.WorldGenRegion;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.StructureFeatureManager;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.WorldgenRandom;
@ -12,17 +14,17 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Biome.class)
public class BiomeMixin {
@Mixin(ChunkGenerator.class)
public class ChunkGeneratorMixin {
private int bclib_featureIteratorSeed;
@ModifyArg(method = "generate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/WorldgenRandom;setFeatureSeed(JII)J"))
@ModifyArg(method = "applyBiomeDecoration", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/WorldgenRandom;setFeatureSeed(JII)V"))
private long bclib_updateFeatureSeed(long seed) {
return Long.rotateRight(seed, bclib_featureIteratorSeed++);
}
@Inject(method = "generate", at = @At("HEAD"))
private void bclib_obBiomeGenerate(StructureFeatureManager structureFeatureManager, ChunkGenerator chunkGenerator, WorldGenRegion worldGenRegion, long l, WorldgenRandom worldgenRandom, BlockPos blockPos, CallbackInfo info) {
@Inject(method = "applyBiomeDecoration", at = @At("HEAD"))
private void bclib_obBiomeGenerate(WorldGenLevel level, ChunkPos pos, StructureFeatureManager manager, CallbackInfo ci) {
bclib_featureIteratorSeed = 0;
}
}

View file

@ -9,7 +9,7 @@ import ru.bclib.api.datafixer.DataFixerAPI;
@Mixin(Main.class)
abstract public class MainMixin {
@ModifyArg(method="main", at=@At(value="INVOKE", target="Lnet/minecraft/server/MinecraftServer;convertFromRegionFormatIfNeeded(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;)V"))
@ModifyArg(method="main", at=@At(value="INVOKE_ASSIGN", target="Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;getSummary()Lnet/minecraft/world/level/storage/LevelSummary;"))
private static LevelStorageSource.LevelStorageAccess bclib_callServerFix(LevelStorageSource.LevelStorageAccess session){
DataFixerAPI.fixData(session, false, (didFix)->{/* not called when showUI==false */});
return session;

View file

@ -49,15 +49,6 @@ public class MinecraftServerMixin {
DataExchangeAPI.prepareServerside();
}
@Inject(method = "convertFromRegionFormatIfNeeded", at = @At("HEAD"))
private static void bclib_applyPatches(LevelStorageSource.LevelStorageAccess session, CallbackInfo ci) {
/*File levelPath = session.getLevelPath(LevelResource.ROOT).toFile();
WorldDataAPI.load(new File(levelPath, "data"));
DataFixerAPI.fixData(levelPath, session.getLevelId());*/
}
@Inject(method = "reloadResources", at = @At(value = "RETURN"), cancellable = true)
private void bclib_reloadResources(Collection<String> collection, CallbackInfoReturnable<CompletableFuture<Void>> info) {
bclib_injectRecipes();

View file

@ -321,8 +321,8 @@ public class BCLBiomeDef {
});
generationSettings.surfaceBuilder(surface == null ? net.minecraft.data.worldgen.SurfaceBuilders.END : surface);
//TODO: Removed now. Seems to part of a registry step per biome now
structures.forEach((structure) -> generationSettings.addStructureStart(structure));
//TODO: (1.18) Removed now. Seems to part of a registry step per biome now
//structures.forEach((structure) -> generationSettings.addStructureStart(structure));
features.forEach((info) -> generationSettings.addFeature(info.featureStep, info.feature));
carvers.forEach((info) -> generationSettings.addCarver(info.carverStep, info.carver));

View file

@ -1,7 +1,6 @@
package ru.bclib.world.structures;
import net.fabricmc.fabric.api.structure.v1.FabricStructureBuilder;
import net.fabricmc.fabric.mixin.structure.FlatChunkGeneratorConfigAccessor;
import net.minecraft.data.BuiltinRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.levelgen.GenerationStep;
@ -25,7 +24,9 @@ public class BCLStructureFeature {
.register();
this.featureConfigured = this.structure.configured(NoneFeatureConfiguration.NONE);
BuiltinRegistries.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, id, this.featureConfigured);
FlatLevelGeneratorSettings.getStructureToFeatures().put(this.structure, this.featureConfigured);
// TODO: (1.18) Find Alternative for this mapping
//FlatLevelGeneratorSettings.getStructureToFeatures().put(this.structure, this.featureConfigured);
}
public StructureFeature<NoneFeatureConfiguration> getStructure() {

View file

@ -18,7 +18,7 @@
"AnvilBlockMixin",
"AnvilMenuMixin",
"TagLoaderMixin",
"BiomeMixin",
"ChunkGeneratorMixin",
"MainMixin",
"TheEndBiomeDataMixin",
"NetherBiomeDataMixin"