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

The following are Jave code examples for showing how to use isInWater() 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: Adventurers-Toolbox   File: SpecialToolAbilityHandler.java   View Source Code Vote up 4 votes
@SubscribeEvent
public void onPrismarineAdornedToolMine(PlayerEvent.BreakSpeed event) {

	if (event.getEntityPlayer() == null) {
		return;
	}

	EntityPlayer player = event.getEntityPlayer();
	ItemStack stack = event.getEntityPlayer().getHeldItemMainhand();

	if (stack.getItem() instanceof IAdornedTool
			&& IAdornedTool.getAdornmentMat(stack) == ModMaterials.ADORNMENT_PRISMARINE && player.isInWater()) {

		event.setNewSpeed(event.getOriginalSpeed() * 2F);

	}

}