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.
Example 1
Project: Adventurers-Toolbox   File:   Source Code and License Vote up 4 votes
public void onPrismarineAdornedToolMine(PlayerEvent.BreakSpeed event) {

	if (event.getEntityPlayer() == null) {

	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);