Replace Achievements with Advancements

- Advancements are now in JSON files, converted by the included migration script.
- WizardryAdvancementTrigger is a generic achievement trigger that can be reused throughout the code to trigger custom advancements not covered by the JSON conditions.
- Plus some other small and obvious fixes.
This commit is contained in:
Philipp Rustemeier
2018-03-14 19:12:13 +01:00
parent 62c2a9e9b8
commit 612bbdb64d
48 changed files with 706 additions and 723 deletions
@@ -1,7 +1,5 @@
package electroblob.wizardry;
import org.apache.logging.log4j.Logger;
import electroblob.wizardry.command.CommandCastSpell;
import electroblob.wizardry.command.CommandDiscoverSpell;
import electroblob.wizardry.command.CommandSetAlly;
@@ -18,7 +16,6 @@ import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.Capability.IStorage;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.event.RegistryEvent.MissingMappings;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
@@ -30,6 +27,7 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import org.apache.logging.log4j.Logger;
@Mod(modid = Wizardry.MODID, name = Wizardry.NAME, version = Wizardry.VERSION, guiFactory = "electroblob." + Wizardry.MODID + ".WizardryGuiFactory")
public class Wizardry {
@@ -37,7 +35,7 @@ public class Wizardry {
/** Wizardry's mod ID. */
// This is going to have to change for 1.12 or it'll conflict with the other wizardry mod.
// They were there first, it's only fair... although I wonder if that will have unintended side-effects?
public static final String MODID = "wizardry"; // How about 'ebwizardry', to keep it short?
public static final String MODID = "ebwizardry";
/** Wizardry's mod name, in readable form. */
public static final String NAME = "Electroblob's Wizardry";
/**
@@ -50,7 +48,7 @@ public class Wizardry {
* 1.x.x represents Minecraft 1.7.x versions, 2.x.x represents Minecraft 1.10.x versions, 3.x.x represents Minecraft
* 1.11.x versions, and so on.
*/
public static final String VERSION = "3.1.0";
public static final String VERSION = "4.0.0";
// IDEA: Improve the algorithm that finds a place to summon creatures to take walls into account.
// IDEA: Replace all uses of Math.cos and Math.sin with MathHelper versions
@@ -138,6 +136,8 @@ public class Wizardry {
// The check for the generateLoot setting is now done within this method.
WizardryRegistry.registerLoot();
WizardryRegistry.registerAdvancementTriggers();
// Moved to preInit, because apparently it has to be here now.
proxy.registerRenderers();
// It seems this also has to be here
@@ -158,7 +158,9 @@ public class Wizardry {
NetworkRegistry.INSTANCE.registerGuiHandler(this, new WizardryGuiHandler());
WizardryPacketHandler.initPackets();
// NOTE: Will need to be moved to init for 1.12, as will anything that needs to be after the registry events.
// Recipes
WizardryRegistry.registerRecipes();
WizardryTabs.sort();
proxy.initGuiBits();