]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blob - src/main/java/com/irtimaled/bbor/client/models/BoundingBoxSpawningSphere.java
5d3087ebd816bfbf9b4c671a2c09264266d67929
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / models / BoundingBoxSpawningSphere.java
1 package com.irtimaled.bbor.client.models;
2
3 import com.irtimaled.bbor.common.BoundingBoxType;
4 import net.minecraft.util.math.BlockPos;
5
6 import java.util.HashSet;
7 import java.util.Set;
8
9 public class BoundingBoxSpawningSphere extends BoundingBoxSphere {
10     public static final int SAFE_RADIUS = 24;
11     public static final int SPAWN_RADIUS = 128;
12
13     private final Set<BlockPos> blocks = new HashSet<>();
14     private Integer spawnableCount;
15
16     public BoundingBoxSpawningSphere(Point point) {
17         super(point, SPAWN_RADIUS, BoundingBoxType.AFKSphere);
18     }
19
20     public Set<BlockPos> getBlocks() {
21         return blocks;
22     }
23
24     public boolean isWithinSphere(Point point) {
25         return this.getPoint().getDistance(point) <= getRadius() + 0.5D;
26     }
27
28     public void setSpawnableCount(int count) {
29         this.spawnableCount = count;
30     }
31
32     public Integer getSpawnableSpacesCount() {
33         return this.spawnableCount;
34     }
35 }