From 0aac70c5fb3de1a6f9a34fc60641d1342542e769 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Mon, 2 Sep 2019 19:10:11 +0100 Subject: [PATCH] Reduce spells tracked for wand progression from 10 to 5 --- src/main/java/electroblob/wizardry/data/WizardData.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/electroblob/wizardry/data/WizardData.java b/src/main/java/electroblob/wizardry/data/WizardData.java index 433e3855..0511d67c 100644 --- a/src/main/java/electroblob/wizardry/data/WizardData.java +++ b/src/main/java/electroblob/wizardry/data/WizardData.java @@ -6,6 +6,7 @@ import electroblob.wizardry.enchantment.Imbuement; import electroblob.wizardry.entity.living.ISummonedCreature; import electroblob.wizardry.event.SpellCastEvent; import electroblob.wizardry.event.SpellCastEvent.Source; +import electroblob.wizardry.item.ItemWand; import electroblob.wizardry.packet.PacketCastContinuousSpell; import electroblob.wizardry.packet.PacketPlayerSync; import electroblob.wizardry.packet.WizardryPacketHandler; @@ -71,7 +72,7 @@ public class WizardData implements INBTSerializable { private static final Set storedVariables = new HashSet<>(); /** The maximum number of recent spells to track. */ - public static final int MAX_RECENT_SPELLS = 10; + public static final int MAX_RECENT_SPELLS = ItemWand.BASE_SPELL_SLOTS; /** The player this WizardData instance belongs to. */ private final EntityPlayer player; @@ -140,7 +141,7 @@ public class WizardData implements INBTSerializable { // All players can recognise magic missile. This is not done using discoverSpell because that seems to cause // a crash on load occasionally (probably something to do with achievements being initialised) this.spellsDiscovered.add(Spells.magic_missile); - this.recentSpells = EvictingQueue.create(MAX_RECENT_SPELLS); // Only keeps a reference to the last 10 spells cast + this.recentSpells = EvictingQueue.create(MAX_RECENT_SPELLS); // Only keeps a reference to the last 5 spells cast this.castCommandSpell = Spells.none; this.castCommandModifiers = new SpellModifiers(); this.castCommandTick = 0; @@ -272,7 +273,7 @@ public class WizardData implements INBTSerializable { * @param spell The spell to count casts for. */ public int countRecentCasts(Spell spell){ - return (int)this.recentSpells.stream().filter(s -> s == spell).count(); // We know this can't be more than 10 + return (int)this.recentSpells.stream().filter(s -> s == spell).count(); // We know this can't be more than 5 } // Imbuements