Fixed compiler and Startup Errors
This commit is contained in:
parent
e2ab77658b
commit
08f35ab52c
9 changed files with 16 additions and 24 deletions
|
@ -97,7 +97,7 @@ public class BiomeAPI {
|
||||||
registerBiome(biome);
|
registerBiome(biome);
|
||||||
NETHER_BIOME_PICKER.addBiome(biome);
|
NETHER_BIOME_PICKER.addBiome(biome);
|
||||||
Random random = new Random(biome.getID().hashCode());
|
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(
|
Climate.ParameterPoint parameters = Climate.parameters(
|
||||||
MHelper.randRange(-1.5F, 1.5F, random),
|
MHelper.randRange(-1.5F, 1.5F, random),
|
||||||
MHelper.randRange(-1.5F, 1.5F, random),
|
MHelper.randRange(-1.5F, 1.5F, random),
|
||||||
|
|
|
@ -181,13 +181,11 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, Cust
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) {
|
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.canPlaceLiquid(world, pos, state, fluid);
|
return super.canPlaceLiquid(world, pos, state, fluid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean placeLiquid(LevelAccessor world, BlockPos pos, BlockState state, FluidState fluidState) {
|
public boolean placeLiquid(LevelAccessor world, BlockPos pos, BlockState state, FluidState fluidState) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.placeLiquid(world, pos, state, fluidState);
|
return super.placeLiquid(world, pos, state, fluidState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class BoneMealItemMixin {
|
||||||
Level world = context.getLevel();
|
Level world = context.getLevel();
|
||||||
BlockPos blockPos = context.getClickedPos();
|
BlockPos blockPos = context.getClickedPos();
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
BlockPos offseted = blockPos.relative(context.getClickedFace());
|
//BlockPos offset = blockPos.relative(context.getClickedFace());
|
||||||
if (BonemealAPI.isTerrain(world.getBlockState(blockPos).getBlock())) {
|
if (BonemealAPI.isTerrain(world.getBlockState(blockPos).getBlock())) {
|
||||||
boolean consume = false;
|
boolean consume = false;
|
||||||
if (BonemealAPI.isSpreadableTerrain(world.getBlockState(blockPos).getBlock())) {
|
if (BonemealAPI.isSpreadableTerrain(world.getBlockState(blockPos).getBlock())) {
|
||||||
|
|
|
@ -2,7 +2,9 @@ package ru.bclib.mixin.common;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.server.level.WorldGenRegion;
|
import net.minecraft.server.level.WorldGenRegion;
|
||||||
|
import net.minecraft.world.level.ChunkPos;
|
||||||
import net.minecraft.world.level.StructureFeatureManager;
|
import net.minecraft.world.level.StructureFeatureManager;
|
||||||
|
import net.minecraft.world.level.WorldGenLevel;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.WorldgenRandom;
|
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.ModifyArg;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(Biome.class)
|
@Mixin(ChunkGenerator.class)
|
||||||
public class BiomeMixin {
|
public class ChunkGeneratorMixin {
|
||||||
private int bclib_featureIteratorSeed;
|
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) {
|
private long bclib_updateFeatureSeed(long seed) {
|
||||||
return Long.rotateRight(seed, bclib_featureIteratorSeed++);
|
return Long.rotateRight(seed, bclib_featureIteratorSeed++);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "generate", at = @At("HEAD"))
|
@Inject(method = "applyBiomeDecoration", at = @At("HEAD"))
|
||||||
private void bclib_obBiomeGenerate(StructureFeatureManager structureFeatureManager, ChunkGenerator chunkGenerator, WorldGenRegion worldGenRegion, long l, WorldgenRandom worldgenRandom, BlockPos blockPos, CallbackInfo info) {
|
private void bclib_obBiomeGenerate(WorldGenLevel level, ChunkPos pos, StructureFeatureManager manager, CallbackInfo ci) {
|
||||||
bclib_featureIteratorSeed = 0;
|
bclib_featureIteratorSeed = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@ import ru.bclib.api.datafixer.DataFixerAPI;
|
||||||
|
|
||||||
@Mixin(Main.class)
|
@Mixin(Main.class)
|
||||||
abstract public class MainMixin {
|
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){
|
private static LevelStorageSource.LevelStorageAccess bclib_callServerFix(LevelStorageSource.LevelStorageAccess session){
|
||||||
DataFixerAPI.fixData(session, false, (didFix)->{/* not called when showUI==false */});
|
DataFixerAPI.fixData(session, false, (didFix)->{/* not called when showUI==false */});
|
||||||
return session;
|
return session;
|
||||||
|
|
|
@ -49,15 +49,6 @@ public class MinecraftServerMixin {
|
||||||
DataExchangeAPI.prepareServerside();
|
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)
|
@Inject(method = "reloadResources", at = @At(value = "RETURN"), cancellable = true)
|
||||||
private void bclib_reloadResources(Collection<String> collection, CallbackInfoReturnable<CompletableFuture<Void>> info) {
|
private void bclib_reloadResources(Collection<String> collection, CallbackInfoReturnable<CompletableFuture<Void>> info) {
|
||||||
bclib_injectRecipes();
|
bclib_injectRecipes();
|
||||||
|
|
|
@ -321,8 +321,8 @@ public class BCLBiomeDef {
|
||||||
});
|
});
|
||||||
|
|
||||||
generationSettings.surfaceBuilder(surface == null ? net.minecraft.data.worldgen.SurfaceBuilders.END : surface);
|
generationSettings.surfaceBuilder(surface == null ? net.minecraft.data.worldgen.SurfaceBuilders.END : surface);
|
||||||
//TODO: Removed now. Seems to part of a registry step per biome now
|
//TODO: (1.18) Removed now. Seems to part of a registry step per biome now
|
||||||
structures.forEach((structure) -> generationSettings.addStructureStart(structure));
|
//structures.forEach((structure) -> generationSettings.addStructureStart(structure));
|
||||||
features.forEach((info) -> generationSettings.addFeature(info.featureStep, info.feature));
|
features.forEach((info) -> generationSettings.addFeature(info.featureStep, info.feature));
|
||||||
carvers.forEach((info) -> generationSettings.addCarver(info.carverStep, info.carver));
|
carvers.forEach((info) -> generationSettings.addCarver(info.carverStep, info.carver));
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package ru.bclib.world.structures;
|
package ru.bclib.world.structures;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.structure.v1.FabricStructureBuilder;
|
import net.fabricmc.fabric.api.structure.v1.FabricStructureBuilder;
|
||||||
import net.fabricmc.fabric.mixin.structure.FlatChunkGeneratorConfigAccessor;
|
|
||||||
import net.minecraft.data.BuiltinRegistries;
|
import net.minecraft.data.BuiltinRegistries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.level.levelgen.GenerationStep;
|
import net.minecraft.world.level.levelgen.GenerationStep;
|
||||||
|
@ -25,7 +24,9 @@ public class BCLStructureFeature {
|
||||||
.register();
|
.register();
|
||||||
this.featureConfigured = this.structure.configured(NoneFeatureConfiguration.NONE);
|
this.featureConfigured = this.structure.configured(NoneFeatureConfiguration.NONE);
|
||||||
BuiltinRegistries.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, id, this.featureConfigured);
|
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() {
|
public StructureFeature<NoneFeatureConfiguration> getStructure() {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
"AnvilBlockMixin",
|
"AnvilBlockMixin",
|
||||||
"AnvilMenuMixin",
|
"AnvilMenuMixin",
|
||||||
"TagLoaderMixin",
|
"TagLoaderMixin",
|
||||||
"BiomeMixin",
|
"ChunkGeneratorMixin",
|
||||||
"MainMixin",
|
"MainMixin",
|
||||||
"TheEndBiomeDataMixin",
|
"TheEndBiomeDataMixin",
|
||||||
"NetherBiomeDataMixin"
|
"NetherBiomeDataMixin"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue