fix: Added a config option to prevent crash with guidebook loading on some locales. Note that if you use this config, you won't have the Wizard's Handbook in an usable state!
Fixes #815, Fixes #814, Fixes #800, Fixes #768
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
|
|||||||
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||||
|
|
||||||
|
|
||||||
version = "4.3.7"
|
version = "4.3.8"
|
||||||
group= "electroblob.wizardry"// http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group= "electroblob.wizardry"// http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = "ElectroblobsWizardry"
|
archivesBaseName = "ElectroblobsWizardry"
|
||||||
|
|
||||||
|
|||||||
@@ -379,6 +379,9 @@ public final class Settings {
|
|||||||
public boolean showSpellHUD = true;
|
public boolean showSpellHUD = true;
|
||||||
/** <b>[Client-only]</b> Whether to show the charge meter when charging up a spell. */
|
/** <b>[Client-only]</b> Whether to show the charge meter when charging up a spell. */
|
||||||
public boolean showChargeMeter = true;
|
public boolean showChargeMeter = true;
|
||||||
|
/** <b>[Client-only]</b> Whether to initialise the handbook's data. Setting this to false will break the in-game handbook, but might help with some
|
||||||
|
* startup crashes */
|
||||||
|
public boolean loadHandbook = true;
|
||||||
/** <b>[Client-only]</b> The position of the spell HUD. */
|
/** <b>[Client-only]</b> The position of the spell HUD. */
|
||||||
public GuiPosition spellHUDPosition = GuiPosition.BOTTOM_LEFT;
|
public GuiPosition spellHUDPosition = GuiPosition.BOTTOM_LEFT;
|
||||||
|
|
||||||
@@ -1112,6 +1115,13 @@ public final class Settings {
|
|||||||
showChargeMeter = property.getBoolean();
|
showChargeMeter = property.getBoolean();
|
||||||
propOrder.add(property.getName());
|
propOrder.add(property.getName());
|
||||||
|
|
||||||
|
property = config.get(CLIENT_CATEGORY, "loadHandbook", true, "Whether to initialise the in-game handbook. Setting this to false will brick the in-game handbook, but it might help if you have startup crashes.");
|
||||||
|
property.setLanguageKey("config." + Wizardry.MODID + ".load_handbook");
|
||||||
|
property.setRequiresWorldRestart(false);
|
||||||
|
Wizardry.proxy.setToNamedBooleanEntry(property);
|
||||||
|
loadHandbook = property.getBoolean();
|
||||||
|
propOrder.add(property.getName());
|
||||||
|
|
||||||
property = config.get(CLIENT_CATEGORY, "spellHUDPosition", GuiPosition.BOTTOM_LEFT.name, "The position of the spell HUD.", GuiPosition.names);
|
property = config.get(CLIENT_CATEGORY, "spellHUDPosition", GuiPosition.BOTTOM_LEFT.name, "The position of the spell HUD.", GuiPosition.names);
|
||||||
property.setLanguageKey("config." + Wizardry.MODID + ".spell_hud_position");
|
property.setLanguageKey("config." + Wizardry.MODID + ".spell_hud_position");
|
||||||
spellHUDPosition = GuiPosition.fromName(property.getString());
|
spellHUDPosition = GuiPosition.fromName(property.getString());
|
||||||
|
|||||||
@@ -127,11 +127,10 @@ public class Wizardry {
|
|||||||
public void preInit(FMLPreInitializationEvent event){
|
public void preInit(FMLPreInitializationEvent event){
|
||||||
|
|
||||||
logger = event.getModLog();
|
logger = event.getModLog();
|
||||||
|
|
||||||
proxy.registerResourceReloadListeners();
|
|
||||||
|
|
||||||
configDirectory = new File(event.getModConfigurationDirectory(), Wizardry.MODID);
|
configDirectory = new File(event.getModConfigurationDirectory(), Wizardry.MODID);
|
||||||
settings.initConfig(event);
|
settings.initConfig(event);
|
||||||
|
proxy.registerResourceReloadListeners();
|
||||||
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
tisTheSeason = calendar.get(Calendar.MONTH) + 1 == 12 && calendar.get(Calendar.DAY_OF_MONTH) >= 24
|
tisTheSeason = calendar.get(Calendar.MONTH) + 1 == 12 && calendar.get(Calendar.DAY_OF_MONTH) >= 24
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package electroblob.wizardry.client;
|
package electroblob.wizardry.client;
|
||||||
|
|
||||||
import electroblob.wizardry.CommonProxy;
|
import electroblob.wizardry.CommonProxy;
|
||||||
|
import electroblob.wizardry.Settings;
|
||||||
import electroblob.wizardry.Wizardry;
|
import electroblob.wizardry.Wizardry;
|
||||||
import electroblob.wizardry.block.BlockBookshelf;
|
import electroblob.wizardry.block.BlockBookshelf;
|
||||||
import electroblob.wizardry.client.animation.ActionAnimation;
|
import electroblob.wizardry.client.animation.ActionAnimation;
|
||||||
@@ -164,7 +165,8 @@ public class ClientProxy extends CommonProxy {
|
|||||||
IResourceManager manager = Minecraft.getMinecraft().getResourceManager();
|
IResourceManager manager = Minecraft.getMinecraft().getResourceManager();
|
||||||
if(manager instanceof IReloadableResourceManager){
|
if(manager instanceof IReloadableResourceManager){
|
||||||
((IReloadableResourceManager)manager).registerReloadListener(GuiSpellDisplay::loadSkins);
|
((IReloadableResourceManager)manager).registerReloadListener(GuiSpellDisplay::loadSkins);
|
||||||
((IReloadableResourceManager)manager).registerReloadListener(GuiWizardHandbook::loadHandbookFile);
|
if (Wizardry.settings.loadHandbook)
|
||||||
|
((IReloadableResourceManager)manager).registerReloadListener(GuiWizardHandbook::loadHandbookFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import net.minecraft.util.ActionResult;
|
|||||||
import net.minecraft.util.EnumActionResult;
|
import net.minecraft.util.EnumActionResult;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.text.Style;
|
import net.minecraft.util.text.Style;
|
||||||
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@@ -36,7 +37,11 @@ public class ItemWizardHandbook extends Item {
|
|||||||
@Override
|
@Override
|
||||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
|
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
|
||||||
ItemStack stack = player.getHeldItem(hand);
|
ItemStack stack = player.getHeldItem(hand);
|
||||||
player.openGui(Wizardry.instance, WizardryGuiHandler.WIZARD_HANDBOOK, world, 0, 0, 0);
|
if (Wizardry.settings.loadHandbook) {
|
||||||
|
player.openGui(Wizardry.instance, WizardryGuiHandler.WIZARD_HANDBOOK, world, 0, 0, 0);
|
||||||
|
} else if (!world.isRemote){
|
||||||
|
player.sendStatusMessage(new TextComponentTranslation("item." + Wizardry.MODID + ":wizard_handbook.disabled"), false);
|
||||||
|
}
|
||||||
return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
|
return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ item.ebwizardry\:arcane_tome.desc=Upgrades any %1$s wand with sufficient progres
|
|||||||
item.ebwizardry\:wizard_handbook.name=The Wizard's Handbook
|
item.ebwizardry\:wizard_handbook.name=The Wizard's Handbook
|
||||||
item.ebwizardry\:wizard_handbook.author=by %1$s
|
item.ebwizardry\:wizard_handbook.author=by %1$s
|
||||||
item.ebwizardry\:wizard_handbook.desc=Your not-so-pocket-sized guide to the arcane arts! A must-have for any aspiring wizard who seeks to learn the secrets of magic.\n\nRight-click while holding this book to read it.
|
item.ebwizardry\:wizard_handbook.desc=Your not-so-pocket-sized guide to the arcane arts! A must-have for any aspiring wizard who seeks to learn the secrets of magic.\n\nRight-click while holding this book to read it.
|
||||||
|
item.ebwizardry\:wizard_handbook.disabled=This item was disabled in the config!
|
||||||
|
|
||||||
item.ebwizardry\:wand.generic=wand
|
item.ebwizardry\:wand.generic=wand
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user