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
@@ -13,6 +13,8 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
public class ItemArmourUpgrade extends Item {
public ItemArmourUpgrade(){
@@ -82,9 +82,9 @@ public class ItemSpectralArmour extends ItemArmor implements IConjuredItem {
@Override
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type){
if(slot == EntityEquipmentSlot.LEGS) return "wizardry:textures/armour/spectral_armour_legs.png";
if(slot == EntityEquipmentSlot.LEGS) return "ebwizardry:textures/armour/spectral_armour_legs.png";
return "wizardry:textures/armour/spectral_armour.png";
return "ebwizardry:textures/armour/spectral_armour.png";
}
@Override
@@ -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;
}
@@ -139,14 +139,14 @@ public class ItemWizardArmour extends ItemArmor implements ISpecialArmor {
// Do note however that a texture pack could override this.
if(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isInvisible()
&& !entity.getEntityData().getBoolean(Petrify.NBT_KEY))
return "wizardry:textures/armour/invisible_armour.png";
return "ebwizardry:textures/armour/invisible_armour.png";
if(slot == EntityEquipmentSlot.LEGS)
return this.element == null ? "wizardry:textures/armour/wizard_armour_legs.png"
: "wizardry:textures/armour/wizard_armour_" + this.element.getUnlocalisedName() + "_legs.png";
return this.element == null ? "ebwizardry:textures/armour/wizard_armour_legs.png"
: "ebwizardry:textures/armour/wizard_armour_" + this.element.getUnlocalisedName() + "_legs.png";
return this.element == null ? "wizardry:textures/armour/wizard_armour.png"
: "wizardry:textures/armour/wizard_armour_" + this.element.getUnlocalisedName() + ".png";
return this.element == null ? "ebwizardry:textures/armour/wizard_armour.png"
: "ebwizardry:textures/armour/wizard_armour_" + this.element.getUnlocalisedName() + ".png";
}
@Override
@@ -15,6 +15,8 @@ import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import javax.annotation.Nullable;
public class ItemWizardHandbook extends Item {
// Yep, I hardcoded my own name into the mod. Don't want people changing it now, do I?