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