]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blobdiff - src/main/java/com/irtimaled/bbor/client/providers/SpawningSphereProvider.java
Make clearing providers easier
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / client / providers / SpawningSphereProvider.java
index 2ef1cca6721780e7eded64c9fae0ef6051100420..d9782fa5a4c61ed9856c1693d09b6732a4e580fe 100644 (file)
@@ -15,7 +15,7 @@ import net.minecraft.client.Minecraft;
 import java.util.HashSet;
 import java.util.Set;
 
-public class SpawningSphereProvider implements IBoundingBoxProvider<BoundingBoxSpawningSphere> {
+public class SpawningSphereProvider implements IBoundingBoxProvider<BoundingBoxSpawningSphere>, ICachingProvider {
     public static final Minecraft minecraft = Minecraft.getInstance();
     private static Long lastGameTime = null;
 
@@ -25,14 +25,13 @@ public class SpawningSphereProvider implements IBoundingBoxProvider<BoundingBoxS
 
     public static void setSphere(Point point) {
         if (spawningSphere != null && spawningSphere.getPoint().equals(point)) return;
-        clear();
 
         dimensionId = Player.getDimensionId();
         spawningSphere = new BoundingBoxSpawningSphere(point);
         lastBoundingBox = null;
     }
 
-    public static boolean clear() {
+    public static boolean clearSphere() {
         if (spawningSphere != null) {
             lastBoundingBox = null;
             spawningSphere = null;
@@ -42,6 +41,10 @@ public class SpawningSphereProvider implements IBoundingBoxProvider<BoundingBoxS
         return false;
     }
 
+    public void clearCache() {
+        clearSphere();
+    }
+
     public static void calculateSpawnableSpacesCount(BlockProcessor blockProcessor) {
         if (spawningSphere != null) {
             Point sphereCenter = spawningSphere.getPoint();