From 6c08b21f7fd0169fb68679988bc5936688c9bc01 Mon Sep 17 00:00:00 2001
From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com>
Date: Fri, 22 May 2020 17:54:53 +0100
Subject: [PATCH] More accurate descriptions, and make it synchronised
---
src/main/java/electroblob/wizardry/Settings.java | 7 +++----
.../electroblob/wizardry/packet/PacketSyncSettings.java | 3 +++
src/main/resources/assets/ebwizardry/lang/en_gb.lang | 4 ++--
src/main/resources/assets/ebwizardry/lang/en_us.lang | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/main/java/electroblob/wizardry/Settings.java b/src/main/java/electroblob/wizardry/Settings.java
index 376d4a28..72f795b9 100644
--- a/src/main/java/electroblob/wizardry/Settings.java
+++ b/src/main/java/electroblob/wizardry/Settings.java
@@ -158,8 +158,6 @@ public final class Settings {
public boolean teleportThroughUnbreakableBlocks = false;
/** [Server-only] Whether to allow players to damage their designated allies using magic. */
public FriendlyFire friendlyFire = FriendlyFire.ALL;
- /** [Server-only] Whether passive mobs should count as allies, i.e. they should not be targeted by minions, lightning chaining, etc. */
- public boolean passiveMobsAreAllies = false;
/** [Server-only] Whether to allow players to disarm other players using the telekinesis spell. */
public boolean telekineticDisarmament = true;
/** [Server-only] Whether summoned creatures can revenge attack their caster if their caster attacks them. */
@@ -277,6 +275,8 @@ public final class Settings {
* effect.
*/
public boolean slowTimeAffectsPlayers = true;
+ /** [Synchronised] Whether passive mobs should count as allies, i.e. they should not be damaged indirectly by spells */
+ public boolean passiveMobsAreAllies = false;
/** [Synchronised] Whether to replace Minecraft's own fireballs with wizardry fireballs. */
public boolean replaceVanillaFireballs = true;
/** [Synchronised] Chance of 'misreading' an undiscovered spell and triggering a forfeit instead. */
@@ -581,10 +581,9 @@ public final class Settings {
propOrder.add(property.getName());
property = config.get(DIFFICULTY_CATEGORY, "passiveMobsAreAllies", false,
- "Whether passive mobs should count as allies, i.e. they should not be targeted by minions, lightning chaining, etc.");
+ "Whether passive mobs should count as allies, i.e. they should not be damaged indirectly by spells.");
property.setLanguageKey("config." + Wizardry.MODID + ".passive_mobs_are_allies");
Wizardry.proxy.setToNamedBooleanEntry(property);
- property.setRequiresWorldRestart(false);
passiveMobsAreAllies = property.getBoolean();
propOrder.add(property.getName());
diff --git a/src/main/java/electroblob/wizardry/packet/PacketSyncSettings.java b/src/main/java/electroblob/wizardry/packet/PacketSyncSettings.java
index 24b0be25..92743f7c 100644
--- a/src/main/java/electroblob/wizardry/packet/PacketSyncSettings.java
+++ b/src/main/java/electroblob/wizardry/packet/PacketSyncSettings.java
@@ -42,6 +42,7 @@ public class PacketSyncSettings implements IMessageHandler {
Wizardry.settings.bookshelfSearchRadius = message.settings.bookshelfSearchRadius;
Wizardry.settings.bookshelfBlocks = message.settings.bookshelfBlocks;
Wizardry.settings.bookItems = message.settings.bookItems;
+ Wizardry.settings.passiveMobsAreAllies = message.settings.passiveMobsAreAllies;
}
public static class Message implements IMessage {
@@ -71,6 +72,7 @@ public class PacketSyncSettings implements IMessageHandler {
settings.bookshelfSearchRadius = buf.readInt();
settings.bookshelfBlocks = readMetaItems(buf);
settings.bookItems = readMetaItems(buf);
+ settings.passiveMobsAreAllies = buf.readBoolean();
}
@Override
@@ -83,6 +85,7 @@ public class PacketSyncSettings implements IMessageHandler {
buf.writeInt(settings.bookshelfSearchRadius);
writeMetaItems(buf, settings.bookshelfBlocks);
writeMetaItems(buf, settings.bookItems);
+ buf.writeBoolean(settings.passiveMobsAreAllies);
}
@SuppressWarnings("unchecked")
diff --git a/src/main/resources/assets/ebwizardry/lang/en_gb.lang b/src/main/resources/assets/ebwizardry/lang/en_gb.lang
index eac15cba..a96cf2fa 100644
--- a/src/main/resources/assets/ebwizardry/lang/en_gb.lang
+++ b/src/main/resources/assets/ebwizardry/lang/en_gb.lang
@@ -1194,9 +1194,9 @@ config.ebwizardry.legacy_wand_levelling.false=No - Level me up!
config.ebwizardry.friendly_fire=Friendly Fire
config.ebwizardry.friendly_fire.tooltip=Controls which creatures may be damaged by your magic when allied to you. Your spells will not target your allies or creatures summoned/owned by them regardless of this setting, but this setting makes them completely immune if disabled.
config.ebwizardry.passive_mobs_are_allies=Passive Mobs Are Allies
-config.ebwizardry.passive_mobs_are_allies.tooltip=Whether passive mobs should count as allies, i.e. they should not be targeted by minions, lightning chaining, etc.
+config.ebwizardry.passive_mobs_are_allies.tooltip=Whether all passive mobs should count as allies, i.e. they should not be damaged indirectly by spells. Tamed mobs always count as allies.
config.ebwizardry.passive_mobs_are_allies.true=Yes - don't hurt the animals!
-config.ebwizardry.passive_mobs_are_allies.false=No - I like my steak phoenix-grilled!
+config.ebwizardry.passive_mobs_are_allies.false=No - I like my steak lightning-grilled!
config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting
config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge-attack players or creatures that they would not otherwise be able to attack.
config.ebwizardry.minion_revenge_targeting.true=Yes - I'd never hurt them!
diff --git a/src/main/resources/assets/ebwizardry/lang/en_us.lang b/src/main/resources/assets/ebwizardry/lang/en_us.lang
index 7ec233f7..7a4feba1 100644
--- a/src/main/resources/assets/ebwizardry/lang/en_us.lang
+++ b/src/main/resources/assets/ebwizardry/lang/en_us.lang
@@ -1194,9 +1194,9 @@ config.ebwizardry.legacy_wand_levelling.false=No - Level me up!
config.ebwizardry.friendly_fire=Friendly Fire
config.ebwizardry.friendly_fire.tooltip=Controls which creatures may be damaged by your magic when allied to you. Your spells will not target your allies or creatures summoned/owned by them regardless of this setting, but this setting makes them completely immune if disabled.
config.ebwizardry.passive_mobs_are_allies=Passive Mobs Are Allies
-config.ebwizardry.passive_mobs_are_allies.tooltip=Whether passive mobs should count as allies, i.e. they should not be targeted by minions, lightning chaining, etc.
+config.ebwizardry.passive_mobs_are_allies.tooltip=Whether all passive mobs should count as allies, i.e. they should not be damaged indirectly by spells. Tamed mobs always count as allies.
config.ebwizardry.passive_mobs_are_allies.true=Yes - don't hurt the animals!
-config.ebwizardry.passive_mobs_are_allies.false=No - I like my steak phoenix-grilled!
+config.ebwizardry.passive_mobs_are_allies.false=No - I like my steak lightning-grilled!
config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting
config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge-attack players or creatures that they would not otherwise be able to attack.
config.ebwizardry.minion_revenge_targeting.true=Yes - I'd never hurt them!