本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}