Skip to content

Instantly share code, notes, and snippets.

@BlockAfterBlock
Created June 2, 2011 23:30
Show Gist options
  • Save BlockAfterBlock/1005572 to your computer and use it in GitHub Desktop.
Save BlockAfterBlock/1005572 to your computer and use it in GitHub Desktop.
public boolean interact(EntityPlayer entityplayer)
{
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
if(!isWife)
{
if(itemstack != null && itemstack.itemID == Item.stick.shiftedIndex)
{
itemstack.stackSize--;
showHeartsOrSmokeFX(true);
isWife = true;
friendInt = 5;
health = 40;
prevHealth = 5;
ModLoader.getMinecraftInstance().thePlayer.triggerAchievement(mod_Family.Married);
}
if(itemstack != null && Item.itemsList[itemstack.itemID] instanceof ItemFood && !(itemstack.itemID == Item.porkCooked.shiftedIndex || itemstack.itemID == Item.porkRaw.shiftedIndex))
{
itemstack.stackSize--;
showHeartsOrSmokeFX(true);
heal(4); //2 Hearts
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment