import com.irtimaled.bbor.client.providers.CustomBoxProvider;
import com.irtimaled.bbor.client.providers.CustomLineProvider;
import com.irtimaled.bbor.client.providers.CustomSphereProvider;
+import com.irtimaled.bbor.client.providers.FlowerForestProvider;
import com.irtimaled.bbor.client.providers.IBoundingBoxProvider;
import com.irtimaled.bbor.client.providers.ICachingProvider;
import com.irtimaled.bbor.client.providers.MobSpawnerProvider;
registerProvider(new SpawnableBlocksProvider());
registerProvider(new CustomLineProvider());
registerProvider(new CustomSphereProvider());
-// registerProvider(new FlowerForestProvider());
+ registerProvider(new FlowerForestProvider());
registerProvider(new BedrockCeilingProvider());
}
registerType(BoundingBoxType.Custom, ConfigManager.drawConduits, ConfigManager.colorCustom);
registerType(BoundingBoxType.Conduit, ConfigManager.drawConduits, ConfigManager.colorConduits);
registerType(BoundingBoxType.SpawnableBlocks, ConfigManager.drawSpawnableBlocks, ConfigManager.colorSpawnableBlocks);
-// registerType(BoundingBoxType.FlowerForest, ConfigManager.drawFlowerForests, null);
+ registerType(BoundingBoxType.FlowerForest, ConfigManager.drawFlowerForests, null);
registerType(BoundingBoxType.BedrockCeiling, ConfigManager.drawBedrockCeilingBlocks, ConfigManager.colorBedrockCeilingBlocks);
registerType(BoundingBoxType.JungleTemple, ConfigManager.drawJungleTemples, ConfigManager.colorJungleTemples);
public static Setting<Integer> spawnableBlocksRenderHeight;
public static Setting<Boolean> invertBoxColorPlayerInside;
public static Setting<Boolean> renderSphereAsDots;
-// public static Setting<Boolean> drawFlowerForests;
-// public static Setting<Integer> flowerForestsRenderDistance;
+ public static Setting<Boolean> drawFlowerForests;
+ public static Setting<Integer> flowerForestsRenderDistance;
public static Setting<Boolean> drawBedrockCeilingBlocks;
public static Setting<HexColor> colorWorldSpawn;
biomeBordersRenderDistance = setup(config, "biomeBorders", "biomeBordersRenderDistance", 3, "The distance from the player where biome borders will be drawn.");
biomeBordersMaxY = setup(config, "biomeBorders", "biomeBordersMaxY", -1, "The maximum top of the biome borders. If set to -1 it will use the value when activated, if set to 0 it will always track the players feet.");
-// drawFlowerForests = setup(config, "flowerForests", "drawFlowerForests", true, "If set to true flower forest flower overlays will be drawn.");
-// flowerForestsRenderDistance = setup(config, "flowerForests", "flowerForestsRenderDistance", 3, "The distance from the player where flower forests will be drawn.");
+ drawFlowerForests = setup(config, "flowerForests", "drawFlowerForests", true, "If set to true flower forest flower overlays will be drawn.");
+ flowerForestsRenderDistance = setup(config, "flowerForests", "flowerForestsRenderDistance", 3, "The distance from the player where flower forests will be drawn.");
drawBedrockCeilingBlocks = setup(config, "bedrockCeiling", "drawBedrockCeilingBlocks", true, "If set to true position with only one layer of bedrock will be drawn.");
.addDisplayValue(1, I18n.translate("bbor.options.distance.nearest"))
.addDisplayValue(2, I18n.translate("bbor.options.distance.nearer"))
.addDisplayValue(3, I18n.translate("bbor.options.distance.normal")))
-// .section(I18n.translate("bbor.features.flowerForests"),
-// width -> new BoundingBoxTypeButton(width, I18n.translate("bbor.features.flowerForests"), BoundingBoxType.FlowerForest),
-// width -> new IntSettingSlider(width, 1, 3, "bbor.options.distance", ConfigManager.flowerForestsRenderDistance)
-// .addDisplayValue(1, I18n.translate("bbor.options.distance.nearest"))
-// .addDisplayValue(2, I18n.translate("bbor.options.distance.nearer"))
-// .addDisplayValue(3, I18n.translate("bbor.options.distance.normal")))
+ .section(I18n.translate("bbor.features.flowerForests"),
+ width -> new BoundingBoxTypeButton(width, I18n.translate("bbor.features.flowerForests"), BoundingBoxType.FlowerForest),
+ width -> new IntSettingSlider(width, 1, 6, "bbor.options.distance", ConfigManager.flowerForestsRenderDistance)
+ .addDisplayValue(1, I18n.translate("bbor.options.distance.nearest"))
+ .addDisplayValue(2, I18n.translate("bbor.options.distance.nearer"))
+ .addDisplayValue(3, I18n.translate("bbor.options.distance.normal"))
+ .addDisplayValue(4, I18n.translate("bbor.options.distance.farther"))
+ .addDisplayValue(5, I18n.translate("bbor.options.distance.far"))
+ .addDisplayValue(6, I18n.translate("bbor.options.distance.veryFar")))
.section(I18n.translate("bbor.features.bedrockCeilingBlocks"),
width -> new BoundingBoxTypeButton(width, I18n.translate("bbor.features.bedrockCeilingBlocks"), BoundingBoxType.BedrockCeiling))
.section(I18n.translate("bbor.features.mobSpawners"),
-/*
package com.irtimaled.bbor.client.interop;
import com.irtimaled.bbor.client.config.ConfigManager;
import com.irtimaled.bbor.client.config.HexColor;
import com.irtimaled.bbor.client.config.Setting;
import com.irtimaled.bbor.common.models.Coords;
+import com.irtimaled.bbor.mixin.access.IPlacedFeature;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.MinecraftClient;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeKeys;
import net.minecraft.world.gen.feature.ConfiguredFeature;
-import net.minecraft.world.gen.feature.FeatureConfig;
-import net.minecraft.world.gen.feature.FlowerFeature;
+import net.minecraft.world.gen.feature.PlacedFeature;
+import net.minecraft.world.gen.feature.SimpleBlockFeature;
+import net.minecraft.world.gen.feature.SimpleBlockFeatureConfig;
+import net.minecraft.world.gen.feature.VegetationConfiguredFeatures;
+import net.minecraft.world.gen.stateprovider.BlockStateProvider;
import java.util.HashMap;
import java.util.Map;
private static final Random random = new Random();
private static final Map<BlockState, Setting<HexColor>> flowerColorMap = new HashMap<>();
- private static final FlowerFeature flowersFeature;
- private static final FeatureConfig flowersConfig;
public static final Biome BIOME = BuiltinRegistries.BIOME.get(BiomeKeys.FLOWER_FOREST);
+ private static BlockStateProvider blockStateProvider;
+
static {
flowerColorMap.put(Blocks.DANDELION.getDefaultState(), ConfigManager.colorFlowerForestDandelion);
flowerColorMap.put(Blocks.POPPY.getDefaultState(), ConfigManager.colorFlowerForestPoppy);
flowerColorMap.put(Blocks.OXEYE_DAISY.getDefaultState(), ConfigManager.colorFlowerForestOxeyeDaisy);
flowerColorMap.put(Blocks.CORNFLOWER.getDefaultState(), ConfigManager.colorFlowerForestCornflower);
flowerColorMap.put(Blocks.LILY_OF_THE_VALLEY.getDefaultState(), ConfigManager.colorFlowerForestLilyOfTheValley);
- ConfiguredFeature<?, ?> config = BIOME.getGenerationSettings().getFlowerFeatures().get(0);
- flowersFeature = (FlowerFeature) config.feature;
- flowersConfig = config.config;
+ final PlacedFeature placedFeature = VegetationConfiguredFeatures.FLOWER_FLOWER_FOREST.config.feature().get();
+ final ConfiguredFeature<SimpleBlockFeatureConfig, SimpleBlockFeature> configuredFeature = (ConfiguredFeature<SimpleBlockFeatureConfig, SimpleBlockFeature>) ((IPlacedFeature) placedFeature).getFeature().get();
+ blockStateProvider = configuredFeature.getConfig().toPlace();
}
public static Setting<HexColor> getFlowerColorAtPos(Coords coords) {
int x = coords.getX();
int z = coords.getZ();
- BlockState blockState = flowersFeature.getFlowerState(random, new BlockPos(x, coords.getY(), z), flowersConfig);
+ BlockState blockState = blockStateProvider.getBlockState(random, new BlockPos(x, coords.getY(), z));
return flowerColorMap.get(blockState);
}
return MinecraftClient.getInstance().world.getBlockState(new BlockPos(x, y, z)).getBlock() == Blocks.GRASS_BLOCK;
}
}
-
- */
\ No newline at end of file
-/*
package com.irtimaled.bbor.client.models;
import com.irtimaled.bbor.client.RenderCulling;
return RenderCulling.isVisibleCulling(coords.getX(), coords.getY() + 0.01d, coords.getZ(), coords.getX() + 1, coords.getY(), coords.getZ() + 1);
}
}
- */
-/*
package com.irtimaled.bbor.client.providers;
import com.irtimaled.bbor.client.Player;
return 0;
}
}
-
- */
\ No newline at end of file
import com.irtimaled.bbor.common.MathHelper;
import com.irtimaled.bbor.common.models.Coords;
import com.irtimaled.bbor.common.models.DimensionId;
+import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.world.ClientWorld;
import net.minecraft.world.gen.random.ChunkRandom;
import java.util.HashSet;
public Iterable<BoundingBoxSlimeChunk> get(DimensionId dimensionId) {
Set<BoundingBoxSlimeChunk> slimeChunks = new HashSet<>();
int renderDistanceChunks = ClientInterop.getRenderDistanceChunks();
+ final ClientWorld world = MinecraftClient.getInstance().world;
+ final int minimumY;
+ if (world != null) {
+ minimumY = world.getDimension().getMinimumY();
+ } else {
+ minimumY = 0;
+ }
int playerChunkX = MathHelper.floor(Player.getX() / CHUNK_SIZE);
int playerChunkZ = MathHelper.floor(Player.getZ() / CHUNK_SIZE);
for (int chunkX = playerChunkX - renderDistanceChunks; chunkX <= playerChunkX + renderDistanceChunks; ++chunkX) {
if (isSlimeChunk(chunkX, chunkZ)) {
int chunkXStart = chunkX << 4;
int chunkZStart = chunkZ << 4;
- Coords minCoords = new Coords(chunkXStart, 1, chunkZStart);
+ Coords minCoords = new Coords(chunkXStart, minimumY + 1, chunkZStart);
Coords maxCoords = new Coords(chunkXStart + 15, 38, chunkZStart + 15);
slimeChunks.add(new BoundingBoxSlimeChunk(minCoords, maxCoords));
}
void renderCuboid(MatrixStack matrixStack, OffsetBox bb, Color color, boolean fillOnly, int fillAlpha) {
matrixStack.push();
- renderCuboid0(matrixStack, bb, color, fillOnly, fillAlpha, false);
+ renderCuboid0(matrixStack, bb.nudge(), color, fillOnly, fillAlpha, false);
matrixStack.pop();
}
int z = coords.getZ();
renderCuboid(matrixStack, new OffsetBox(new OffsetPoint(x, y + 1.01d, z),
new OffsetPoint(x + 1, y + 1.01d, z + 1)),
- BoundingBoxTypeHelper.getColor(boundingBox.getType()), true, 127);
+ BoundingBoxTypeHelper.getColor(boundingBox.getType()), false, 127);
}
}
-/*
package com.irtimaled.bbor.client.renderers;
import com.irtimaled.bbor.client.models.BoundingBoxFlowerForest;
boundingBox.getColor(), true, 127);
}
}
- */
}
public static String debugString() {
- return String.format("[BBOR] Statistics: Filled faces: %d,%d Lines: %d @ %.2fms", quadMaskedCountLast.get(), quadNonMaskedCountLast.get(), lineCountLast.get(), lastDurationNanos.get() / 1_000_000.0);
+ return String.format("[BBOR] Statistics: Filled faces: %d+%d Lines: %d @ %.2fms", quadMaskedCountLast.get(), quadNonMaskedCountLast.get(), lineCountLast.get(), lastDurationNanos.get() / 1_000_000.0);
}
}
public static final BoundingBoxType Beacon = register("Beacon");
public static final BoundingBoxType Conduit = register("Conduit");
public static final BoundingBoxType SpawnableBlocks = register("Spawnable Blocks");
-// public static final BoundingBoxType FlowerForest = register("Flower Forest");
+ public static final BoundingBoxType FlowerForest = register("Flower Forest");
public static final BoundingBoxType BedrockCeiling = register("Bedrock Ceiling");
public static final BoundingBoxType JungleTemple = register("jungle_pyramid");
--- /dev/null
+package com.irtimaled.bbor.mixin.access;
+
+import net.minecraft.world.gen.feature.ConfiguredFeature;
+import net.minecraft.world.gen.feature.PlacedFeature;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.gen.Accessor;
+
+import java.util.function.Supplier;
+
+@Mixin(PlacedFeature.class)
+public interface IPlacedFeature {
+
+ @Accessor
+ Supplier<ConfiguredFeature<?, ?>> getFeature();
+
+}
"bbor.options.distance.nearest": "Nearest",
"bbor.options.distance.nearer": "Nearer",
"bbor.options.distance.normal": "Normal",
+ "bbor.options.distance.farther": "Farther",
+ "bbor.options.distance.far": "Far",
+ "bbor.options.distance.veryFar": "Very Far",
"bbor.options.distance.y": "Distance (Y): %s",
"bbor.options.distance.xz": "Distance (X/Z): %s",
"package": "com.irtimaled.bbor.mixin",
"mixins": [
"access.IBeaconBlockEntity",
+ "access.IPlacedFeature",
"access.IStructureStart",
"client.renderer.MixinDebugHud",
"client.renderer.MixinWorldRenderer",