Make replaceVanillaFallDamae a synchronised setting, should fix the problems people were having on servers where turning the option off seemed to do nothing

This commit is contained in:
Electroblob77
2020-09-24 18:46:43 +01:00
parent aac931f6b2
commit b4e9d86d1d
2 changed files with 9 additions and 5 deletions
@@ -192,11 +192,6 @@ public final class Settings {
public boolean dispenserBlockDamage = true;
/** <b>[Server-only]</b> Whether to revert to the old wand upgrade system, which only requires tomes of arcana. */
public boolean legacyWandLevelling = false;
/**
* <b>[Server-only]</b> Whether to replace Minecraft's distance-based fall damage calculation with an equivalent,
* velocity-based one.
*/
public boolean replaceVanillaFallDamage = true; // TODO: This should be synced
/** <b>[Server-only]</b> Whether to tweak the blindness effect to reduce follow distance when used on non-players. */
public boolean blindnessTweak = true;
/** <b>[Server-only]</b> Whether using bonemeal on grass blocks has a chance to grow crystal flowers. */
@@ -308,6 +303,11 @@ public final class Settings {
public boolean passiveMobsAreAllies = false;
/** <b>[Synchronised]</b> Whether to replace Minecraft's own fireballs with wizardry fireballs. */
public boolean replaceVanillaFireballs = true;
/**
* <b>[Synchronised]</b> Whether to replace Minecraft's distance-based fall damage calculation with an equivalent,
* velocity-based one.
*/
public boolean replaceVanillaFallDamage = true;
/** <b>[Synchronised]</b> Chance of 'misreading' an undiscovered spell and triggering a forfeit instead. */
public double forfeitChance = 0.2;
/**
@@ -745,6 +745,7 @@ public final class Settings {
"Whether to replace Minecraft's distance-based fall damage calculation with an equivalent, velocity-based one. This is done such that mobs in freefall will take exactly the same damage as normal, so it will not break falling-based mob farms. Disable this if you experience falling-related weirdness! If this is disabled, some spells will use a more simplistic method of resetting the player's fall damage in certain cases.");
property.setLanguageKey("config." + Wizardry.MODID + ".replace_vanilla_fall_damage");
Wizardry.proxy.setToNamedBooleanEntry(property);
property.setRequiresWorldRestart(true);
replaceVanillaFallDamage = property.getBoolean();
propOrder.add(property.getName());
@@ -38,6 +38,7 @@ public class PacketSyncSettings implements IMessageHandler<Message, IMessage> {
Wizardry.settings.creativeBypassesArcaneLock = message.settings.creativeBypassesArcaneLock;
Wizardry.settings.slowTimeAffectsPlayers = message.settings.slowTimeAffectsPlayers;
Wizardry.settings.replaceVanillaFireballs = message.settings.replaceVanillaFireballs;
Wizardry.settings.replaceVanillaFallDamage = message.settings.replaceVanillaFallDamage;
Wizardry.settings.forfeitChance = message.settings.forfeitChance;
Wizardry.settings.bookshelfSearchRadius = message.settings.bookshelfSearchRadius;
Wizardry.settings.bookshelfBlocks = message.settings.bookshelfBlocks;
@@ -68,6 +69,7 @@ public class PacketSyncSettings implements IMessageHandler<Message, IMessage> {
settings.creativeBypassesArcaneLock = buf.readBoolean();
settings.slowTimeAffectsPlayers = buf.readBoolean();
settings.replaceVanillaFireballs = buf.readBoolean();
settings.replaceVanillaFallDamage = buf.readBoolean();
settings.forfeitChance = buf.readFloat();
settings.bookshelfSearchRadius = buf.readInt();
settings.bookshelfBlocks = readMetaItems(buf);
@@ -81,6 +83,7 @@ public class PacketSyncSettings implements IMessageHandler<Message, IMessage> {
buf.writeBoolean(settings.creativeBypassesArcaneLock);
buf.writeBoolean(settings.slowTimeAffectsPlayers);
buf.writeBoolean(settings.replaceVanillaFireballs);
buf.writeBoolean(settings.replaceVanillaFallDamage);
buf.writeFloat((float)settings.forfeitChance); // Configs don't have floats but this can only be 0-1 anyway
buf.writeInt(settings.bookshelfSearchRadius);
writeMetaItems(buf, settings.bookshelfBlocks);