diff --git a/gradle.properties b/gradle.properties index 674a043..46f3610 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,13 @@ org.gradle.jvmargs=-Xmx4G # BTA -bta_version=7.1-pre1a +bta_version=7.1-pre2a # Loader loader_version=0.14.19-babric.3-bta # HalpLibe -halplibe_version=3.1.4 +halplibe_version=3.4.17 # Mod mod_version=1.3.0 diff --git a/output/production/commander-bta.main/net/pedroricardo/commander/content/commands/server/StopCommand.class b/output/production/commander-bta.main/net/pedroricardo/commander/content/commands/server/StopCommand.class index b75d756..3e0fdd3 100644 Binary files a/output/production/commander-bta.main/net/pedroricardo/commander/content/commands/server/StopCommand.class and b/output/production/commander-bta.main/net/pedroricardo/commander/content/commands/server/StopCommand.class differ diff --git a/src/main/java/net/pedroricardo/commander/content/commands/HealCommand.java b/src/main/java/net/pedroricardo/commander/content/commands/HealCommand.java index 7dadf31..d687ded 100644 --- a/src/main/java/net/pedroricardo/commander/content/commands/HealCommand.java +++ b/src/main/java/net/pedroricardo/commander/content/commands/HealCommand.java @@ -28,14 +28,10 @@ public static void register(CommandDispatcher dispatcher int entitiesAffected = 0; for (Entity entity : entities) { if (entity instanceof EntityLiving) { - int maxHealth = 20; - try { - maxHealth = ((EntityLiving)entity.getClass().getConstructor(World.class).newInstance(c.getSource().getWorld())).health; - } catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException ignored) { - } - int originalHealth = ((EntityLiving)entity).health; - ((EntityLiving)entity).health = MathHelper.clamp(((EntityLiving)entity).health + amount, 0, maxHealth); - if (((EntityLiving)entity).health != originalHealth) ++entitiesAffected; + int maxHealth = ((EntityLiving) entity).getMaxHealth(); + int originalHealth = ((EntityLiving) entity).getHealth(); + ((EntityLiving)entity).setHealthRaw(MathHelper.clamp(((EntityLiving)entity).getHealth() + amount, 0, maxHealth)); + if (((EntityLiving)entity).getHealth() != originalHealth) ++entitiesAffected; } } c.getSource().sendTranslatableMessage("commands.commander.heal.success_" + (entitiesAffected == 1 ? "single" : "multiple"), entitiesAffected); diff --git a/src/main/java/net/pedroricardo/commander/content/commands/server/StopCommand.java b/src/main/java/net/pedroricardo/commander/content/commands/server/StopCommand.java index 96c0ffe..e9636d5 100644 --- a/src/main/java/net/pedroricardo/commander/content/commands/server/StopCommand.java +++ b/src/main/java/net/pedroricardo/commander/content/commands/server/StopCommand.java @@ -23,7 +23,7 @@ public static void register(CommandDispatcher dispatcher server.playerList.savePlayerStates(); } for (int i = 0; i < server.dimensionWorlds.length; ++i) { - server.dimensionWorlds[i].saveWorld(true, null); + server.dimensionWorlds[i].saveWorld(true, null, true); } server.initiateShutdown(); return Command.SINGLE_SUCCESS;