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