1 package com.irtimaled.bbor.client.models;
3 import com.irtimaled.bbor.client.ClientRenderer;
4 import com.irtimaled.bbor.client.RenderCulling;
5 import com.irtimaled.bbor.client.config.ColorHelper;
6 import com.irtimaled.bbor.client.config.HexColor;
7 import com.irtimaled.bbor.client.config.Setting;
8 import com.irtimaled.bbor.client.renderers.AbstractRenderer;
9 import com.irtimaled.bbor.client.renderers.FlowerForestRenderer;
10 import com.irtimaled.bbor.common.BoundingBoxType;
11 import com.irtimaled.bbor.common.models.AbstractBoundingBox;
12 import com.irtimaled.bbor.common.models.Coords;
16 public class BoundingBoxFlowerForest extends AbstractBoundingBox {
17 private static final AbstractRenderer<BoundingBoxFlowerForest> RENDERER = ClientRenderer.registerRenderer(BoundingBoxFlowerForest.class, () -> new FlowerForestRenderer());
19 private final Coords coords;
20 private final Setting<HexColor> colorSetting;
22 public BoundingBoxFlowerForest(Coords coords, Setting<HexColor> colorSetting) {
23 super(BoundingBoxType.FlowerForest);
25 this.colorSetting = colorSetting;
29 public Boolean intersectsBounds(int minX, int minZ, int maxX, int maxZ) {
30 return coords.getX() >= minX && coords.getZ() >= minZ && coords.getX() <= maxX && coords.getZ() <= maxZ;
33 public Color getColor() {
34 return ColorHelper.getColor(colorSetting);
37 public Coords getCoords() {
42 public double getDistanceX(double x) {
43 return x - coords.getX();
47 public double getDistanceY(double y) {
48 return y - coords.getY();
52 public double getDistanceZ(double z) {
53 return z - coords.getZ();
57 public AbstractRenderer<?> getRenderer() {
62 public boolean isVisibleCulling() {
63 return RenderCulling.isVisibleCulling(coords.getX(), coords.getY() + 0.01d, coords.getZ(), coords.getX() + 1, coords.getY(), coords.getZ());