当前位置: 首页>>代码示例>>Java>>正文


Java ForgeHooks.onPlayerTossEvent方法代码示例

本文整理汇总了Java中net.minecraftforge.common.ForgeHooks.onPlayerTossEvent方法的典型用法代码示例。如果您正苦于以下问题:Java ForgeHooks.onPlayerTossEvent方法的具体用法?Java ForgeHooks.onPlayerTossEvent怎么用?Java ForgeHooks.onPlayerTossEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.ForgeHooks的用法示例。


在下文中一共展示了ForgeHooks.onPlayerTossEvent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dropOneItem

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
public EntityItem dropOneItem(boolean p_71040_1_)
{
    ItemStack stack = inventory.getCurrentItem();

    if (stack == null)
    {
        return null;
    }

    if (stack.getItem().onDroppedByPlayer(stack, this))
    {
        int count = p_71040_1_ && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1;
        return ForgeHooks.onPlayerTossEvent(this, inventory.decrStackSize(inventory.currentItem, count), true);
    }

    return null;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:18,代码来源:EntityPlayer.java

示例2: dropOneItem

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
/**
 * Called when player presses the drop item key
 */
public EntityItem dropOneItem(boolean par1)
{
    ItemStack stack = inventory.getCurrentItem();

    if (stack == null)
    {
        return null;
    }

    if (stack.getItem().onDroppedByPlayer(stack, this))
    {
        int count = par1 && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1;
        return ForgeHooks.onPlayerTossEvent(this, inventory.decrStackSize(inventory.currentItem, count));
    }

    return null;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:21,代码来源:EntityPlayer.java

示例3: dropOneItem

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
public EntityItem dropOneItem(boolean p_71040_1_)
{
	ItemStack stack = this.inventory.getCurrentItem();
	if (stack == null) {
		return null;
	}
	if (stack.getItem().onDroppedByPlayer(stack, this))
	{
		int count = (p_71040_1_) && (this.inventory.getCurrentItem() != null) ? this.inventory.getCurrentItem().stackSize : 1;
		return ForgeHooks.onPlayerTossEvent(this, this.inventory.decrStackSize(this.inventory.currentItem, count), true);
	}
	return null;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:EntityPlayer.java

示例4: dropPlayerItemWithRandomChoice

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
public EntityItem dropPlayerItemWithRandomChoice(ItemStack p_71019_1_, boolean p_71019_2_)
{
	return ForgeHooks.onPlayerTossEvent(this, p_71019_1_, false);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:EntityPlayer.java

示例5: dropPlayerItemWithRandomChoice

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
public EntityItem dropPlayerItemWithRandomChoice(ItemStack p_71019_1_, boolean p_71019_2_)
{
    return ForgeHooks.onPlayerTossEvent(this, p_71019_1_, false);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:5,代码来源:EntityPlayer.java

示例6: dropPlayerItem

import net.minecraftforge.common.ForgeHooks; //导入方法依赖的package包/类
/**
 * Args: itemstack - called when player drops an item stack that's not in his inventory (like items still placed in
 * a workbench while the workbench'es GUI gets closed)
 */
public EntityItem dropPlayerItem(ItemStack par1ItemStack)
{
    return ForgeHooks.onPlayerTossEvent(this, par1ItemStack);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:EntityPlayer.java


注:本文中的net.minecraftforge.common.ForgeHooks.onPlayerTossEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。