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:
@@ -158,11 +158,6 @@ public class Wizardry {
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, new WizardryGuiHandler());
|
||||
WizardryPacketHandler.initPackets();
|
||||
|
||||
// Recipes
|
||||
WizardryRegistry.registerRecipes();
|
||||
|
||||
WizardryTabs.sort();
|
||||
|
||||
proxy.initGuiBits();
|
||||
}
|
||||
|
||||
@@ -200,7 +195,7 @@ public class Wizardry {
|
||||
@EventHandler
|
||||
public static void onMissingMappingEvent(RegistryEvent.MissingMappings<Item> event){
|
||||
// Just get, not getAll, since the mod id didn't change!
|
||||
for(MissingMappings.Mapping<Item> mapping : event.getAllMappings()){
|
||||
for(RegistryEvent.MissingMappings.Mapping<Item> mapping : event.getAllMappings()){
|
||||
if(mapping.key.getResourceDomain().equals(Wizardry.MODID)){
|
||||
|
||||
Item replacement = null;
|
||||
|
||||
@@ -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?
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package electroblob.wizardry.registry;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.constants.Tier;
|
||||
@@ -20,6 +21,7 @@ import net.minecraft.init.Biomes;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
@@ -36,7 +38,6 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
package electroblob.wizardry.spell;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.constants.SpellType;
|
||||
@@ -30,6 +24,12 @@ import net.minecraftforge.registries.ForgeRegistry;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Generic spell class which is the superclass to all spells in wizardry. When extending this class, you must do the
|
||||
* following:
|
||||
|
||||
Reference in New Issue
Block a user