Fire Orb activates fire resistance on player if they are burning and has the orb in their inventory
This commit is contained in:
parent
f5c8581a4e
commit
70b72eef8b
1 changed files with 7 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ import MysticWorld.Items.ItemHandler$1;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.entity.projectile.EntityPotion;
|
import net.minecraft.entity.projectile.EntityPotion;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
|
|
@ -35,6 +36,12 @@ public class TickHandler implements IScheduledTickHandler
|
||||||
public void tickEnd(EnumSet<TickType> type, Object... tickData){
|
public void tickEnd(EnumSet<TickType> type, Object... tickData){
|
||||||
EntityPlayer player = (EntityPlayer)tickData[0];
|
EntityPlayer player = (EntityPlayer)tickData[0];
|
||||||
World world = player.worldObj;
|
World world = player.worldObj;
|
||||||
|
InventoryPlayer inventory = player.inventory;
|
||||||
|
|
||||||
|
if (inventory.hasItem(ItemHandler$1.fireOrb.itemID)){
|
||||||
|
if (player.isBurning())
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 20, 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnumSet ticks(){
|
public EnumSet ticks(){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue