]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/commitdiff
Tidy up code
authorIrtimaled <irtimaled@gmail.com>
Tue, 14 May 2019 05:03:34 +0000 (22:03 -0700)
committerIrtimaled <irtimaled@gmail.com>
Tue, 14 May 2019 05:03:34 +0000 (22:03 -0700)
src/main/java/com/irtimaled/bbor/client/gui/SettingsScreen.java
src/main/java/com/irtimaled/bbor/mixin/client/gui/MixinGuiOptions.java
src/main/java/com/irtimaled/bbor/mixin/server/dedicated/MixinDedicatedServer.java
src/main/java/com/irtimaled/bbor/mixin/server/management/MixinPlayerInteractionManager.java

index 6b13932ee3b742c7ade362d44bf62edbeedb2a3d..9e2357444f5bbb1a647d74de245bd71496f6a9c6 100644 (file)
@@ -108,6 +108,7 @@ public class SettingsScreen extends GuiScreen {
         }
     }
 
+    @Override
     protected void initGui() {
         this.title = ClientProxy.Name;
 
index f559d6665ad214653a38a666bb361726dffaea39..66dd298980847cb2192b385ca803144a91e0eba1 100644 (file)
@@ -15,8 +15,9 @@ public class MixinGuiOptions extends GuiScreen {
     private void initGui(CallbackInfo ci) {
         //shuffle middle buttons up by 12 px to make space
         int top = this.height / 6 + 42;
+        int bottom = this.height / 6 + 168;
         for (GuiButton button : buttons) {
-            if (button.id != 200 && button.y >= top)
+            if (button.y >= top && button.y < bottom)
                 button.y -= 12;
         }
         this.addButton(new SettingsScreenButton(200, this.width / 2 - 155, top + 84, 150, "BBOR", this));
index 6a65d3f4a1297964a56c00f93cc2a68303dc915f..dd2074060dc6e4b3c0fe213cf47c3947f1c3fe7e 100644 (file)
@@ -14,8 +14,7 @@ import java.io.File;
 public class MixinDedicatedServer {
     @Inject(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/dedicated/DedicatedServer;loadAllWorlds(Ljava/lang/String;Ljava/lang/String;JLnet/minecraft/world/WorldType;Lcom/google/gson/JsonElement;)V"))
     private void init(CallbackInfoReturnable<Boolean> cir) {
-        File gameDir = ((DedicatedServer) (Object) this).getDataDirectory();
-        ConfigManager.loadConfig(gameDir);
+        ConfigManager.loadConfig(new File("."));
         new CommonProxy().init();
     }
 }
index 4958b2f1e57b7f6a5de7335c887d386803d0696d..32d710d5cbe7b22f3ebc20f0996544543aec0f4a 100644 (file)
@@ -23,8 +23,7 @@ public class MixinPlayerInteractionManager {
     @Inject(method = "tryHarvestBlock", at = @At("HEAD"))
     private void tryHarvestBlock(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
         Block block = this.world.getBlockState(pos).getBlock();
-        TypeHelper.doIfType(block, BlockMobSpawner.class, ms -> {
-            EventBus.publish(new MobSpawnerBroken(this.world.dimension.getType().getId(), new Coords(pos)));
-        });
+        TypeHelper.doIfType(block, BlockMobSpawner.class, ms ->
+                EventBus.publish(new MobSpawnerBroken(this.world.dimension.getType().getId(), new Coords(pos))));
     }
 }