]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/commitdiff
Expose active to be toggled externally
authorIrtimaled <irtimaled@gmail.com>
Sun, 3 Mar 2019 07:02:22 +0000 (23:02 -0800)
committerIrtimaled <irtimaled@gmail.com>
Sun, 10 Mar 2019 01:43:25 +0000 (17:43 -0800)
src/main/java/com/irtimaled/bbor/client/ClientProxy.java

index 90cb526e78aa2d99bb035d1d9027573e676a974a..4746b882afa196f6d48989e0f54f53ee439e3777 100644 (file)
@@ -25,8 +25,8 @@ public class ClientProxy extends CommonProxy {
     public static final String KeyCategory = "Bounding Box Outline Reloaded";
     public static KeyBinding ActiveHotKey = new KeyBinding("Toggle On/Off", 0x42, KeyCategory);
     public static KeyBinding OuterBoxOnlyHotKey = new KeyBinding("Toggle Display Outer Box Only", 0x4f, KeyCategory);
+    public static boolean active;
 
-    private boolean active;
     private ClientRenderer renderer;
 
     @Override
@@ -47,16 +47,20 @@ public class ClientProxy extends CommonProxy {
         EntityPlayer entityPlayer = Minecraft.getInstance().player;
         PlayerData.setPlayerPosition(partialTicks, entityPlayer);
 
-        if (this.active) {
+        if (active) {
             renderer.render(DimensionType.getById(entityPlayer.dimension), ConfigManager.outerBoxesOnly.get());
         }
     }
 
+    public static void toggleActive() {
+        active = !active;
+        if (active)
+            PlayerData.setActiveY();
+    }
+
     private void keyPressed() {
         if (ActiveHotKey.isPressed()) {
-            active = !active;
-            if (active)
-                PlayerData.setActiveY();
+            toggleActive();
         } else if (OuterBoxOnlyHotKey.isPressed()) {
             Setting<Boolean> outerBoxesOnly = ConfigManager.outerBoxesOnly;
             outerBoxesOnly.set(!outerBoxesOnly.get());
@@ -115,4 +119,4 @@ public class ClientProxy extends CommonProxy {
         BlockPos maxBlockPos = new BlockPos(midX + midOffset, 0, midZ + midOffset);
         return BoundingBoxWorldSpawn.from(minBlockPos, maxBlockPos, type);
     }
-}
\ No newline at end of file
+}