Java Code Examples for net.minecraft.entity.player.EntityPlayer.isWet()

The following are Jave code examples for showing how to use isWet() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AdvancedCombat   File: ItemArmorWood.java   View Source Code Vote up 6 votes
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {
	if(!world.isRemote) {
		
		// flammability: 5 damage to the armor per second
		if(player.isBurning() && player.ticksExisted % 4 == 0) {
			armor.damageItem(1, player);
		}
		
		// ecological II: repair 1 damage per second when wet
		// repair 1 damage per 12 seconds when not wet
		if(armor.getItemDamage() > 0) {
			if((player.isWet() && player.ticksExisted % 20 == 0) || player.ticksExisted % 240 == 0) {
				armor.damageItem(-1, player);
			}
		}
	}
}
 
Example 2
Project: AdvancedCombat   File: ItemArmorStone.java   View Source Code Vote up 5 votes
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {
	if(!world.isRemote) {

		// ecological I: repair 1 damage per 5 seconds when wet
		// repair 1 damage per 60 seconds when not wet
		if(armor.getItemDamage() > 0) {
			if((player.isWet() && player.ticksExisted % 100 == 0) || player.ticksExisted % 1200 == 0) {
				armor.damageItem(-1, player);
			}
		}
		
	}
}