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,10 +1,7 @@
package electroblob.wizardry.entity.construct;
import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.advancement.AdvancementHelper;
import electroblob.wizardry.advancement.AdvancementHelper.EnumAdvancement;
import electroblob.wizardry.registry.WizardryAdvancementTriggers;
import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType;
@@ -24,6 +21,8 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import java.util.List;
public class EntityTornado extends EntityMagicConstruct {
private double velX, velZ;
@@ -104,7 +103,7 @@ public class EntityTornado extends EntityMagicConstruct {
// The 'Not Again...' achievement
if(target instanceof EntityPig && WizardryUtilities.getRider(target) instanceof EntityPlayer){
AdvancementHelper.grantAdvancement((EntityPlayer)WizardryUtilities.getRider(target), EnumAdvancement.pig_tornado);
WizardryAdvancementTriggers.pig_tornado.triggerFor((EntityPlayer)WizardryUtilities.getRider(target));
}
}
}