2 package com.irtimaled.bbor.client.models;
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.interop.CommonInterop;
12 import com.irtimaled.bbor.common.models.AbstractBoundingBox;
13 import com.irtimaled.bbor.common.models.Coords;
17 public class BoundingBoxFlowerForest extends AbstractBoundingBox {
18 private static final AbstractRenderer<BoundingBoxFlowerForest> RENDERER = CommonInterop.registerRenderer(BoundingBoxFlowerForest.class, () -> new FlowerForestRenderer());
20 private final Coords coords;
21 private final Setting<HexColor> colorSetting;
23 public BoundingBoxFlowerForest(Coords coords, Setting<HexColor> colorSetting) {
24 super(BoundingBoxType.FlowerForest);
26 this.colorSetting = colorSetting;
30 public Boolean intersectsBounds(int minX, int minZ, int maxX, int maxZ) {
31 return coords.getX() >= minX && coords.getZ() >= minZ && coords.getX() <= maxX && coords.getZ() <= maxZ;
34 public Color getColor() {
35 return ColorHelper.getColor(colorSetting);
38 public Coords getCoords() {
43 public double getDistanceX(double x) {
44 return x - coords.getX();
48 public double getDistanceY(double y) {
49 return y - coords.getY();
53 public double getDistanceZ(double z) {
54 return z - coords.getZ();
58 public AbstractRenderer<?> getRenderer() {
63 public boolean isVisibleCulling() {
64 return RenderCulling.isVisibleCulling(coords.getX(), coords.getY() + 0.01d, coords.getZ(), coords.getX() + 1, coords.getY(), coords.getZ() + 1);