當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。