mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-03 10:39:57 -04:00
Got everything to follow the checkstyle
This commit is contained in:
parent
89a874b96f
commit
a464bac675
9 changed files with 73 additions and 101 deletions
fabric-biome-api-v1/src
main/java/net/fabricmc/fabric
api/biome/v1
impl/biome
mixin/biome
testmod/java/net/fabricmc/fabric/test/biome
|
@ -16,11 +16,12 @@
|
|||
|
||||
package net.fabricmc.fabric.api.biome.v1;
|
||||
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeData;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeKeys;
|
||||
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeData;
|
||||
|
||||
/**
|
||||
* API that allows for adding biomes to the biome source for The End.
|
||||
*/
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.biome;
|
||||
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
/**
|
||||
* Represents a biome and its corresponding weight.
|
||||
*/
|
||||
final class ContinentalBiomeEntry {
|
||||
private final RegistryKey<Biome> biome;
|
||||
private final double weight;
|
||||
private final double upperWeightBound;
|
||||
|
||||
/**
|
||||
* @param biome the biome
|
||||
* @param weight how often a biome will be chosen
|
||||
* @param upperWeightBound the upper weight bound within the context of the other entries, used for the binary search
|
||||
*/
|
||||
ContinentalBiomeEntry(final RegistryKey<Biome> biome, final double weight, final double upperWeightBound) {
|
||||
this.biome = biome;
|
||||
this.weight = weight;
|
||||
this.upperWeightBound = upperWeightBound;
|
||||
}
|
||||
|
||||
RegistryKey<Biome> getBiome() {
|
||||
return biome;
|
||||
}
|
||||
|
||||
double getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the upper weight boundary for the search
|
||||
*/
|
||||
double getUpperWeightBound() {
|
||||
return upperWeightBound;
|
||||
}
|
||||
}
|
|
@ -16,11 +16,19 @@
|
|||
|
||||
package net.fabricmc.fabric.impl.biome;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldClimate;
|
||||
import net.fabricmc.fabric.mixin.biome.VanillaLayeredBiomeSourceAccessor;
|
||||
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeKeys;
|
||||
|
@ -28,7 +36,8 @@ import net.minecraft.world.biome.layer.BiomeLayers;
|
|||
import net.minecraft.world.biome.source.VanillaLayeredBiomeSource;
|
||||
import net.minecraft.world.gen.feature.StructureFeature;
|
||||
|
||||
import java.util.*;
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldClimate;
|
||||
import net.fabricmc.fabric.mixin.biome.VanillaLayeredBiomeSourceAccessor;
|
||||
|
||||
/**
|
||||
* Lists and maps for internal use only! Stores data that is used by the various mixins into the world generation
|
||||
|
|
|
@ -16,22 +16,24 @@
|
|||
|
||||
package net.fabricmc.fabric.impl.biome;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.IntConsumer;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldClimate;
|
||||
import net.fabricmc.fabric.mixin.biome.AddHillsLayerAccessor;
|
||||
import net.fabricmc.fabric.mixin.biome.BuiltinBiomesAccessor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BuiltinBiomes;
|
||||
import net.minecraft.world.biome.layer.util.LayerRandomnessSource;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.IntConsumer;
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldClimate;
|
||||
import net.fabricmc.fabric.mixin.biome.AddHillsLayerAccessor;
|
||||
import net.fabricmc.fabric.mixin.biome.BuiltinBiomesAccessor;
|
||||
|
||||
/**
|
||||
* Internal utilities used for biome sampling.
|
||||
|
|
|
@ -52,4 +52,4 @@ final class WeightedBiomeEntry {
|
|||
double getUpperWeightBound() {
|
||||
return upperWeightBound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,13 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.biome;
|
||||
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldBiomes;
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeData;
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeUtils;
|
||||
import java.util.Map;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeKeys;
|
||||
|
@ -26,12 +30,10 @@ import net.minecraft.world.biome.BuiltinBiomes;
|
|||
import net.minecraft.world.biome.layer.AddRiversLayer;
|
||||
import net.minecraft.world.biome.layer.util.LayerRandomnessSource;
|
||||
import net.minecraft.world.biome.layer.util.LayerSampler;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.util.Map;
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldBiomes;
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeData;
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeUtils;
|
||||
|
||||
/**
|
||||
* Sets river biomes specified with {@link OverworldBiomes#setRiverBiome(RegistryKey, RegistryKey)}.
|
||||
|
|
|
@ -16,19 +16,21 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.biome;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeData;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.source.MultiNoiseBiomeSource;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.source.MultiNoiseBiomeSource;
|
||||
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeData;
|
||||
|
||||
/**
|
||||
* This Mixin is responsible for adding mod-biomes to the NETHER preset in the MultiNoiseBiomeSource.
|
||||
|
|
|
@ -16,15 +16,9 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.biome;
|
||||
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeData;
|
||||
import net.fabricmc.fabric.impl.biome.SimpleLayerRandomnessSource;
|
||||
import net.fabricmc.fabric.impl.biome.WeightedBiomePicker;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeKeys;
|
||||
import net.minecraft.world.biome.layer.util.LayerRandomnessSource;
|
||||
import net.minecraft.world.biome.source.TheEndBiomeSource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
@ -34,8 +28,16 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeKeys;
|
||||
import net.minecraft.world.biome.layer.util.LayerRandomnessSource;
|
||||
import net.minecraft.world.biome.source.TheEndBiomeSource;
|
||||
|
||||
import net.fabricmc.fabric.impl.biome.InternalBiomeData;
|
||||
import net.fabricmc.fabric.impl.biome.SimpleLayerRandomnessSource;
|
||||
import net.fabricmc.fabric.impl.biome.WeightedBiomePicker;
|
||||
|
||||
@Mixin(TheEndBiomeSource.class)
|
||||
public class MixinTheEndBiomeSource {
|
||||
|
|
|
@ -17,11 +17,6 @@
|
|||
|
||||
package net.fabricmc.fabric.test.biome;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.biome.v1.NetherBiomes;
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldBiomes;
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldClimate;
|
||||
import net.fabricmc.fabric.api.biome.v1.TheEndBiomes;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.sound.BiomeMoodSound;
|
||||
|
@ -29,12 +24,26 @@ import net.minecraft.util.Identifier;
|
|||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.*;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.BiomeKeys;
|
||||
import net.minecraft.world.biome.DefaultBiomeCreator;
|
||||
import net.minecraft.world.biome.GenerationSettings;
|
||||
import net.minecraft.world.biome.SpawnSettings;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
||||
import net.minecraft.world.gen.feature.ConfiguredStructureFeatures;
|
||||
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
|
||||
import net.minecraft.world.gen.surfacebuilder.*;
|
||||
import net.minecraft.world.gen.surfacebuilder.ConfiguredSurfaceBuilder;
|
||||
import net.minecraft.world.gen.surfacebuilder.SurfaceBuilder;
|
||||
import net.minecraft.world.gen.surfacebuilder.SurfaceConfig;
|
||||
import net.minecraft.world.gen.surfacebuilder.TernarySurfaceConfig;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.biome.v1.NetherBiomes;
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldBiomes;
|
||||
import net.fabricmc.fabric.api.biome.v1.OverworldClimate;
|
||||
import net.fabricmc.fabric.api.biome.v1.TheEndBiomes;
|
||||
|
||||
/**
|
||||
* <b>NOTES FOR TESTING:</b>
|
||||
|
|
Loading…
Add table
Reference in a new issue