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


Java ItemStack.setItemFrame方法代码示例

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


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

示例1: setDisplayedItemWithUpdate

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
private void setDisplayedItemWithUpdate(ItemStack p_174864_1_, boolean p_174864_2_)
{
    if (p_174864_1_ != null)
    {
        p_174864_1_ = p_174864_1_.copy();
        p_174864_1_.stackSize = 1;
        p_174864_1_.setItemFrame(this);
    }

    this.getDataWatcher().updateObject(8, p_174864_1_);
    this.getDataWatcher().setObjectWatched(8);

    if (p_174864_2_ && this.hangingPosition != null)
    {
        this.worldObj.updateComparatorOutputLevel(this.hangingPosition, Blocks.air);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:EntityItemFrame.java

示例2: setDisplayedItemWithUpdate

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
private void setDisplayedItemWithUpdate(ItemStack stack, boolean p_174864_2_)
{
    if (!stack.func_190926_b())
    {
        stack = stack.copy();
        stack.func_190920_e(1);
        stack.setItemFrame(this);
    }

    this.getDataManager().set(ITEM, stack);
    this.getDataManager().setDirty(ITEM);

    if (!stack.func_190926_b())
    {
        this.playSound(SoundEvents.ENTITY_ITEMFRAME_ADD_ITEM, 1.0F, 1.0F);
    }

    if (p_174864_2_ && this.hangingPosition != null)
    {
        this.world.updateComparatorOutputLevel(this.hangingPosition, Blocks.AIR);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:23,代码来源:EntityItemFrame.java

示例3: setDisplayedItemWithUpdate

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
private void setDisplayedItemWithUpdate(@Nullable ItemStack stack, boolean p_174864_2_)
{
    if (stack != null)
    {
        stack = stack.copy();
        stack.stackSize = 1;
        stack.setItemFrame(this);
    }

    this.getDataManager().set(ITEM, Optional.fromNullable(stack));
    this.getDataManager().setDirty(ITEM);

    if (stack != null)
    {
        this.playSound(SoundEvents.ENTITY_ITEMFRAME_ADD_ITEM, 1.0F, 1.0F);
    }

    if (p_174864_2_ && this.hangingPosition != null)
    {
        this.worldObj.updateComparatorOutputLevel(this.hangingPosition, Blocks.AIR);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:EntityItemFrame.java

示例4: removeFrameFromMap

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Removes the dot representing this frame's position from the map when the item frame is broken.
 */
private void removeFrameFromMap(ItemStack p_110131_1_)
{
    if (p_110131_1_ != null)
    {
        if (p_110131_1_.getItem() == Items.filled_map)
        {
            MapData mapdata = ((ItemMap)p_110131_1_.getItem()).getMapData(p_110131_1_, this.worldObj);
            mapdata.mapDecorations.remove("frame-" + this.getEntityId());
        }

        p_110131_1_.setItemFrame((EntityItemFrame)null);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:EntityItemFrame.java

示例5: removeFrameFromMap

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Removes the dot representing this frame's position from the map when the item frame is broken.
 */
private void removeFrameFromMap(ItemStack stack)
{
    if (!stack.func_190926_b())
    {
        if (stack.getItem() == Items.FILLED_MAP)
        {
            MapData mapdata = ((ItemMap)stack.getItem()).getMapData(stack, this.world);
            mapdata.mapDecorations.remove("frame-" + this.getEntityId());
        }

        stack.setItemFrame((EntityItemFrame)null);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:EntityItemFrame.java

示例6: notifyDataManagerChange

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void notifyDataManagerChange(DataParameter<?> key)
{
    if (key.equals(ITEM))
    {
        ItemStack itemstack = this.getDisplayedItem();

        if (!itemstack.func_190926_b() && itemstack.getItemFrame() != this)
        {
            itemstack.setItemFrame(this);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:EntityItemFrame.java

示例7: removeFrameFromMap

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Removes the dot representing this frame's position from the map when the item frame is broken.
 */
private void removeFrameFromMap(ItemStack stack)
{
    if (stack != null)
    {
        if (stack.getItem() instanceof net.minecraft.item.ItemMap)
        {
            MapData mapdata = ((ItemMap)stack.getItem()).getMapData(stack, this.worldObj);
            mapdata.mapDecorations.remove("frame-" + this.getEntityId());
        }

        stack.setItemFrame((EntityItemFrame)null);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:17,代码来源:EntityItemFrame.java

示例8: notifyDataManagerChange

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void notifyDataManagerChange(DataParameter<?> key)
{
    if (key.equals(ITEM))
    {
        ItemStack itemstack = this.getDisplayedItem();

        if (itemstack != null && itemstack.getItemFrame() != this)
        {
            itemstack.setItemFrame(this);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:EntityItemFrame.java


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