Add achievements
This commit is contained in:
parent
976df4e0e5
commit
2d6b1c4462
10 changed files with 201 additions and 57 deletions
|
@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.achievements;
|
|||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
|
@ -32,13 +33,25 @@ public class AchievementTrigger
|
|||
{
|
||||
for (Item item : AchievementsRegistry.craftinglist)
|
||||
{
|
||||
if (event.crafting != null && event.crafting.getItem() == item)
|
||||
if (event.crafting != null)
|
||||
{
|
||||
Achievement achievement = AchievementsRegistry.getAchievementForItem(event.crafting.getItem());
|
||||
|
||||
if (achievement != null)
|
||||
if (event.crafting.getItem() == item)
|
||||
{
|
||||
event.player.addStat(achievement, 1);
|
||||
Achievement achievement = AchievementsRegistry.getAchievementForItem(event.crafting.getItem());
|
||||
|
||||
if (achievement != null)
|
||||
{
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
if (event.crafting.getItem() instanceof ItemBlock)
|
||||
{
|
||||
Achievement achievement = AchievementsRegistry.getAchievementForBlock(((ItemBlock) event.crafting.getItem()).field_150939_a);
|
||||
|
||||
if (achievement != null)
|
||||
{
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue