Small fix, cleanup

This commit is contained in:
paulevsGitch 2021-12-01 14:52:21 +03:00
parent 211d0fc751
commit 72e29223a1
4 changed files with 47 additions and 38 deletions

View file

@ -3,6 +3,7 @@ package ru.bclib.world.biomes;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.data.BuiltinRegistries; import net.minecraft.data.BuiltinRegistries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -26,6 +27,14 @@ public class BCLBiome {
private float genChance = 1.0F; private float genChance = 1.0F;
private float edgeSize = 0.0F; private float edgeSize = 0.0F;
/**
* Create wrapper for existing biome using its {@link ResourceLocation} identifier.
* @param biomeKey {@link ResourceKey} for the {@link Biome}.
*/
public BCLBiome(ResourceKey<Biome> biomeKey) {
this(biomeKey.location());
}
/** /**
* Create wrapper for existing biome using its {@link ResourceLocation} identifier. * Create wrapper for existing biome using its {@link ResourceLocation} identifier.
* @param biomeID {@link ResourceLocation} biome ID. * @param biomeID {@link ResourceLocation} biome ID.
@ -43,6 +52,7 @@ public class BCLBiome {
} }
public BCLBiome(ResourceLocation biomeID, Biome biome) { public BCLBiome(ResourceLocation biomeID, Biome biome) {
this.subbiomes.add(this, 1.0F);
this.biomeID = biomeID; this.biomeID = biomeID;
this.biome = biome; this.biome = biome;
} }

View file

@ -65,7 +65,7 @@ public class HexBiomeChunk {
} }
for (short index = 0; index < SIZE; index++) { for (short index = 0; index < SIZE; index++) {
if (random.nextInt(4) == 0) { if (outBuffer[index] != null && random.nextInt(4) == 0) {
circle(outBuffer, index, outBuffer[index].getSubBiome(random), outBuffer[index]); circle(outBuffer, index, outBuffer[index].getSubBiome(random), outBuffer[index]);
} }
} }

View file

@ -4,17 +4,17 @@
"package": "ru.bclib.mixin.client", "package": "ru.bclib.mixin.client",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"client": [ "client": [
"AnvilScreenMixin", "SimpleReloadableResourceManagerMixin",
"EnchantingTableBlockMixin",
"BackgroundRendererMixin", "BackgroundRendererMixin",
"ClientRecipeBookMixin", "ClientRecipeBookMixin",
"EnchantingTableBlockMixin", "ModelManagerMixin",
"GameMixin", "TextureAtlasMixin",
"AnvilScreenMixin",
"ModelBakeryMixin",
"MinecraftMixin", "MinecraftMixin",
"GameMixin", "GameMixin",
"ModelBakeryMixin", "GameMixin"
"ModelManagerMixin",
"SimpleReloadableResourceManagerMixin",
"TextureAtlasMixin"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1

View file

@ -4,41 +4,40 @@
"package": "ru.bclib.mixin.common", "package": "ru.bclib.mixin.common",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [
"AnvilBlockMixin", "SimpleReloadableResourceManagerMixin",
"AnvilMenuMixin", "shears.DiggingEnchantmentMixin",
"ChunkGeneratorMixin", "LayerLightSectionStorageMixin",
"BoneMealItemMixin", "shears.TripWireBlockMixin",
"shears.BeehiveBlockMixin",
"shears.PumpkinBlockMixin",
"shears.MushroomCowMixin",
"ComposterBlockAccessor", "ComposterBlockAccessor",
"PotionBrewingAccessor", "PotionBrewingAccessor",
"RecipeManagerAccessor",
"CraftingMenuMixin",
"EnchantmentMenuMixin",
"LayerLightSectionStorageMixin",
"MainMixin",
"MinecraftServerMixin",
"PistonBaseBlockMixin",
"WorldGenRegionMixin",
"TheEndBiomeDataMixin",
"NetherBiomeDataMixin",
"RecipeManagerMixin",
"CraftingMenuMixin",
"BoneMealItemMixin",
"shears.SheepMixin",
"PortalShapeMixin",
"PotionBrewingAccessor", "PotionBrewingAccessor",
"RecipeManagerAccessor", "RecipeManagerAccessor",
"RecipeManagerMixin", "RecipeManagerAccessor",
"ServerLevelMixin",
"SimpleReloadableResourceManagerMixin",
"TagLoaderMixin",
"WorldGenRegionMixin",
"shears.BeehiveBlockMixin",
"shears.DiggingEnchantmentMixin",
"shears.MushroomCowMixin",
"shears.PumpkinBlockMixin",
"shears.SheepMixin",
"shears.SnowGolemMixin", "shears.SnowGolemMixin",
"shears.TripWireBlockMixin" "EnchantmentMenuMixin",
"MinecraftServerMixin",
"NetherBiomeDataMixin",
"PistonBaseBlockMixin",
"TheEndBiomeDataMixin",
"ChunkGeneratorMixin",
"WorldGenRegionMixin",
"WorldGenRegionMixin",
"RecipeManagerMixin",
"RecipeManagerMixin",
"BoneMealItemMixin",
"CraftingMenuMixin",
"CraftingMenuMixin",
"shears.SheepMixin",
"shears.SheepMixin",
"PortalShapeMixin",
"ServerLevelMixin",
"AnvilBlockMixin",
"AnvilMenuMixin",
"TagLoaderMixin",
"MainMixin"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1