Post-merge fixups

In particular, act as if a spellbook has been discovered during tooltip
generation if player is null. This allows JEI to index all the spell
names.
This commit is contained in:
Philipp Rustemeier
2018-03-16 17:40:50 +01:00
parent 873b5a4f4d
commit ea11910af2
9 changed files with 25 additions and 26 deletions
@@ -62,12 +62,11 @@ public class ItemSpellBook extends Item {
// Tooltip is left blank for wizards buying generic spell books.
if(itemstack.getItemDamage() != OreDictionary.WILDCARD_VALUE){
EntityPlayerSP player = Minecraft.getMinecraft().player;
if (player == null) { return; }
Spell spell = Spell.get(itemstack.getItemDamage());
boolean discovered = true;
if(Wizardry.settings.discoveryMode && !player.capabilities.isCreativeMode && WizardData.get(player) != null
if(player != null && Wizardry.settings.discoveryMode && !player.capabilities.isCreativeMode && WizardData.get(player) != null
&& !WizardData.get(player).hasSpellBeenDiscovered(spell)){
discovered = false;
}