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


Java ItemStack.getItemFrame方法代码示例

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


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

示例1: 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

示例2: 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

示例3: updateVisiblePlayers

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Adds the player passed to the list of visible players and checks to see which players are visible
 */
public void updateVisiblePlayers(EntityPlayer player, ItemStack mapStack)
{
    if (!this.playersHashMap.containsKey(player))
    {
        MapData.MapInfo mapdata$mapinfo = new MapData.MapInfo(player);
        this.playersHashMap.put(player, mapdata$mapinfo);
        this.playersArrayList.add(mapdata$mapinfo);
    }

    if (!player.inventory.hasItemStack(mapStack))
    {
        this.mapDecorations.remove(player.getName());
    }

    for (int i = 0; i < this.playersArrayList.size(); ++i)
    {
        MapData.MapInfo mapdata$mapinfo1 = (MapData.MapInfo)this.playersArrayList.get(i);

        if (!mapdata$mapinfo1.entityplayerObj.isDead && (mapdata$mapinfo1.entityplayerObj.inventory.hasItemStack(mapStack) || mapStack.isOnItemFrame()))
        {
            if (!mapStack.isOnItemFrame() && mapdata$mapinfo1.entityplayerObj.dimension == this.dimension)
            {
                this.updateDecorations(0, mapdata$mapinfo1.entityplayerObj.worldObj, mapdata$mapinfo1.entityplayerObj.getName(), mapdata$mapinfo1.entityplayerObj.posX, mapdata$mapinfo1.entityplayerObj.posZ, (double)mapdata$mapinfo1.entityplayerObj.rotationYaw);
            }
        }
        else
        {
            this.playersHashMap.remove(mapdata$mapinfo1.entityplayerObj);
            this.playersArrayList.remove(mapdata$mapinfo1);
        }
    }

    if (mapStack.isOnItemFrame())
    {
        EntityItemFrame entityitemframe = mapStack.getItemFrame();
        BlockPos blockpos = entityitemframe.getHangingPosition();
        this.updateDecorations(1, player.worldObj, "frame-" + entityitemframe.getEntityId(), (double)blockpos.getX(), (double)blockpos.getZ(), (double)(entityitemframe.facingDirection.getHorizontalIndex() * 90));
    }

    if (mapStack.hasTagCompound() && mapStack.getTagCompound().hasKey("Decorations", 9))
    {
        NBTTagList nbttaglist = mapStack.getTagCompound().getTagList("Decorations", 10);

        for (int j = 0; j < nbttaglist.tagCount(); ++j)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(j);

            if (!this.mapDecorations.containsKey(nbttagcompound.getString("id")))
            {
                this.updateDecorations(nbttagcompound.getByte("type"), player.worldObj, nbttagcompound.getString("id"), nbttagcompound.getDouble("x"), nbttagcompound.getDouble("z"), nbttagcompound.getDouble("rot"));
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:58,代码来源:MapData.java

示例4: updateVisiblePlayers

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Adds the player passed to the list of visible players and checks to see which players are visible
 */
public void updateVisiblePlayers(EntityPlayer player, ItemStack mapStack)
{
    if (!this.playersHashMap.containsKey(player))
    {
        MapData.MapInfo mapdata$mapinfo = new MapData.MapInfo(player);
        this.playersHashMap.put(player, mapdata$mapinfo);
        this.playersArrayList.add(mapdata$mapinfo);
    }

    if (!player.inventory.hasItemStack(mapStack))
    {
        this.mapDecorations.remove(player.getName());
    }

    for (int i = 0; i < this.playersArrayList.size(); ++i)
    {
        MapData.MapInfo mapdata$mapinfo1 = (MapData.MapInfo)this.playersArrayList.get(i);

        if (!mapdata$mapinfo1.entityplayerObj.isDead && (mapdata$mapinfo1.entityplayerObj.inventory.hasItemStack(mapStack) || mapStack.isOnItemFrame()))
        {
            if (!mapStack.isOnItemFrame() && mapdata$mapinfo1.entityplayerObj.dimension == this.dimension && this.trackingPosition)
            {
                this.func_191095_a(MapDecoration.Type.PLAYER, mapdata$mapinfo1.entityplayerObj.world, mapdata$mapinfo1.entityplayerObj.getName(), mapdata$mapinfo1.entityplayerObj.posX, mapdata$mapinfo1.entityplayerObj.posZ, (double)mapdata$mapinfo1.entityplayerObj.rotationYaw);
            }
        }
        else
        {
            this.playersHashMap.remove(mapdata$mapinfo1.entityplayerObj);
            this.playersArrayList.remove(mapdata$mapinfo1);
        }
    }

    if (mapStack.isOnItemFrame() && this.trackingPosition)
    {
        EntityItemFrame entityitemframe = mapStack.getItemFrame();
        BlockPos blockpos = entityitemframe.getHangingPosition();
        this.func_191095_a(MapDecoration.Type.FRAME, player.world, "frame-" + entityitemframe.getEntityId(), (double)blockpos.getX(), (double)blockpos.getZ(), (double)(entityitemframe.facingDirection.getHorizontalIndex() * 90));
    }

    if (mapStack.hasTagCompound() && mapStack.getTagCompound().hasKey("Decorations", 9))
    {
        NBTTagList nbttaglist = mapStack.getTagCompound().getTagList("Decorations", 10);

        for (int j = 0; j < nbttaglist.tagCount(); ++j)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(j);

            if (!this.mapDecorations.containsKey(nbttagcompound.getString("id")))
            {
                this.func_191095_a(MapDecoration.Type.func_191159_a(nbttagcompound.getByte("type")), player.world, nbttagcompound.getString("id"), nbttagcompound.getDouble("x"), nbttagcompound.getDouble("z"), nbttagcompound.getDouble("rot"));
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:58,代码来源:MapData.java

示例5: updateVisiblePlayers

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
/**
 * Adds the player passed to the list of visible players and checks to see which players are visible
 */
public void updateVisiblePlayers(EntityPlayer player, ItemStack mapStack)
{
    if (!this.playersHashMap.containsKey(player))
    {
        MapData.MapInfo mapdata$mapinfo = new MapData.MapInfo(player);
        this.playersHashMap.put(player, mapdata$mapinfo);
        this.playersArrayList.add(mapdata$mapinfo);
    }

    if (!player.inventory.hasItemStack(mapStack))
    {
        this.mapDecorations.remove(player.getName());
    }

    for (int i = 0; i < this.playersArrayList.size(); ++i)
    {
        MapData.MapInfo mapdata$mapinfo1 = (MapData.MapInfo)this.playersArrayList.get(i);

        if (!mapdata$mapinfo1.entityplayerObj.isDead && (mapdata$mapinfo1.entityplayerObj.inventory.hasItemStack(mapStack) || mapStack.isOnItemFrame()))
        {
            if (!mapStack.isOnItemFrame() && mapdata$mapinfo1.entityplayerObj.dimension == this.dimension && this.trackingPosition)
            {
                this.updateDecorations(0, mapdata$mapinfo1.entityplayerObj.worldObj, mapdata$mapinfo1.entityplayerObj.getName(), mapdata$mapinfo1.entityplayerObj.posX, mapdata$mapinfo1.entityplayerObj.posZ, (double)mapdata$mapinfo1.entityplayerObj.rotationYaw);
            }
        }
        else
        {
            this.playersHashMap.remove(mapdata$mapinfo1.entityplayerObj);
            this.playersArrayList.remove(mapdata$mapinfo1);
        }
    }

    if (mapStack.isOnItemFrame() && this.trackingPosition)
    {
        EntityItemFrame entityitemframe = mapStack.getItemFrame();
        BlockPos blockpos = entityitemframe.getHangingPosition();
        this.updateDecorations(1, player.worldObj, "frame-" + entityitemframe.getEntityId(), (double)blockpos.getX(), (double)blockpos.getZ(), (double)(entityitemframe.facingDirection.getHorizontalIndex() * 90));
    }

    if (mapStack.hasTagCompound() && mapStack.getTagCompound().hasKey("Decorations", 9))
    {
        NBTTagList nbttaglist = mapStack.getTagCompound().getTagList("Decorations", 10);

        for (int j = 0; j < nbttaglist.tagCount(); ++j)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(j);

            if (!this.mapDecorations.containsKey(nbttagcompound.getString("id")))
            {
                this.updateDecorations(nbttagcompound.getByte("type"), player.worldObj, nbttagcompound.getString("id"), nbttagcompound.getDouble("x"), nbttagcompound.getDouble("z"), nbttagcompound.getDouble("rot"));
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:58,代码来源:MapData.java


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