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

The following are Jave code examples for showing how to use stopActiveHand() 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: Melodium   File: ItemTempSpellCaster.java   View Source Code Vote up 5 votes
@Override
public void onUsingTick(ItemStack stack, EntityLivingBase entityLiving, int count)
{
	if (entityLiving instanceof EntityPlayer) {
		EntityPlayer player = (EntityPlayer) entityLiving;
		count = getMaxItemUseDuration(stack) - count;
		int interval = count / spell.getIntervalLength();
		int progress = count % spell.getIntervalLength();
		if (progress == 0 && interval != 0)
		{
			spell.intervalStarted(player, stack, interval);
		}
		boolean res = spell.songTick(player, stack, interval, progress, spell.getIntervalLength());
		if (!res) {
			player.stopActiveHand();
		}
		
		/*for (SongNote note : spell.getNotes())
		{
			if (note.time == progress)
			{
				float f = (float)Math.pow(2.0D, (double)(note.value.ordinal() - 12) / 12.0D);
				player.world.playSound((EntityPlayer)null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_NOTE_HARP, SoundCategory.RECORDS, 3.0F, f);
			}
		}*/
	}
}
 
Example 2
Project: Zombe-Modpack   File: PlayerControllerMP.java   View Source Code Vote up 4 votes
public void onStoppedUsingItem(EntityPlayer playerIn)
{
    this.syncCurrentPlayItem();
    this.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN));
    playerIn.stopActiveHand();
}
 
Example 3
Project: Backmemed   File: PlayerControllerMP.java   View Source Code Vote up 4 votes
public void onStoppedUsingItem(EntityPlayer playerIn)
{
    this.syncCurrentPlayItem();
    this.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN));
    playerIn.stopActiveHand();
}
 
Example 4
Project: CustomWorldGen   File: PlayerControllerMP.java   View Source Code Vote up 4 votes
public void onStoppedUsingItem(EntityPlayer playerIn)
{
    this.syncCurrentPlayItem();
    this.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN));
    playerIn.stopActiveHand();
}