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