Add achievements

This commit is contained in:
Arcaratus 2015-07-13 14:25:10 -04:00
parent 976df4e0e5
commit 2d6b1c4462
10 changed files with 201 additions and 57 deletions

View file

@ -7,6 +7,8 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import WayofTime.alchemicalWizardry.common.achievements.ModAchievements;
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -15,7 +17,6 @@ import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.ItemStack;
@ -29,6 +30,7 @@ import net.minecraftforge.common.ISpecialArmor.ArmorProperties;
import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
@ -52,7 +54,6 @@ import WayofTime.alchemicalWizardry.common.omega.ReagentRegenConfiguration;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.EventPriority;
@ -806,6 +807,19 @@ public class AlchemicalWizardryEventHooks
}
}
@SubscribeEvent
public void onEntityDeath(LivingDeathEvent event)
{
EntityLivingBase entityLiving = event.entityLiving;
if (entityLiving instanceof IHoardDemon && event.source.getEntity() instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) event.source.getEntity();
player.addStat(ModAchievements.demons, 1);
}
}
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
if (event.modID.equals("AWWayofTime")) {