Fixed a dupe bug with TC and NeoTech. Closes #704, #698

This commit is contained in:
Adubbz 2016-03-05 11:33:00 +11:00
parent 21af6c9fad
commit 887d715c61
1 changed files with 10 additions and 5 deletions

View File

@ -179,13 +179,18 @@ public class AchievementEventHandler
{
Item item = stack.getItem();
Block block = Block.getBlockFromItem(item);
IBlockState state = block != null ? block.getStateFromMeta(stack.getItemDamage()) : null;
//Yggdrasil
if (state == BlockBOPSapling.paging.getVariantState(BOPTrees.SACRED_OAK))
try
{
event.player.triggerAchievement(BOPAchievements.grow_sacred_oak);
IBlockState state = block != null ? block.getStateFromMeta(item.getMetadata(stack.getItemDamage())) : null;
//Yggdrasil
if (state == BlockBOPSapling.paging.getVariantState(BOPTrees.SACRED_OAK))
{
event.player.triggerAchievement(BOPAchievements.grow_sacred_oak);
}
}
catch(Exception e) {} //Fail quietly if there's a problem matching metadata to a block state
}
}