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

The following examples show how to use net.minecraft.entity.player.EntityPlayer#addExhaustion() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: TofuCraftReload   File: BlockYuba.java    License: MIT License 6 votes vote down vote up
@Override
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, @Nullable ItemStack stack)
{
    player.addStat(StatList.getBlockStats(this), 1);
    player.addExhaustion(0.025F);

    if (this.canSilkHarvest(worldIn, pos, state, player) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0)
    {
        this.dropYuba(worldIn, pos, state);
    }
    else
    {
        if (stack != null && OreDictionary.containsMatch(false, OreDictionary.getOres("stickWood"), new ItemStack(Items.STICK)))
        {
            this.dropYuba(worldIn, pos, state);
        }
    }
}
 
Example 2
@Override
    public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
    {
        super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);

        par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
        par2EntityPlayer.addExhaustion(0.025F);

/*
        if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
        {
            ItemStack itemstack = this.createStackedBlock(par6);

            if(itemstack != null)
            {
                this.dropBlockAsItem(par1World, par3, par4, par5, itemstack);
            }
        }
        */
    }
 
Example 3
@Override
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
	super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);

	par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
	par2EntityPlayer.addExhaustion(0.025F);

	/*
	 * if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { ItemStack itemstack =
	 * this.createStackedBlock(par6);
	 * 
	 * if(itemstack != null) { this.dropBlockAsItem(par1World, par3, par4, par5, itemstack); } }
	 */
}
 
Example 4
@Override
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) {
	super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6);

	par2EntityPlayer.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1);
	par2EntityPlayer.addExhaustion(0.025F);

	/*
	 * if(this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { ItemStack itemstack =
	 * this.createStackedBlock(par6);
	 * 
	 * if(itemstack != null) { this.dropBlockAsItem(par1World, par3, par4, par5, itemstack); } }
	 */
}
 
Example 5
Source Project: WearableBackpacks   File: BlockBackpack.java    License: MIT License 5 votes vote down vote up
@Override
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack) {
	player.addStat(StatList.getBlockStats(this));
	player.addExhaustion(0.005F);

	harvesters.set(player);
	dropBackpack(worldIn, pos, te);
	harvesters.set(null);
}
 
Example 6
Source Project: OpenModsLib   File: OpenBlock.java    License: MIT License 5 votes vote down vote up
@Override
public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te, @Nonnull ItemStack stack) {
	player.addStat(StatList.getBlockStats(this));
	player.addExhaustion(0.025F);

	if (canSilkHarvest(world, pos, state, player) && EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) > 0) {
		handleSilkTouchDrops(world, player, pos, state, te);
	} else {
		handleNormalDrops(world, player, pos, state, te, stack);
	}
}
 
Example 7
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {

	if (player.isInWater()) {

	}

	// Minecraft.getMinecraft().thePlayer.movementInput =

	effectPlayer(player, MobEffects.SLOWNESS, 2);

	// effectPlayer(player, MobEffects.jump, -2);

	if (player.isSwingInProgress) {
		player.addExhaustion(0.025f);
	}
}
 
Example 8
Source Project: TFC2   File: BlockPitKiln.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack)
{
	player.addStat(StatList.getBlockStats(this));
	player.addExhaustion(0.005F);
}