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


Java ItemStack.isOnItemFrame方法代码示例

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


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

示例1: renderItem

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
	if (stack.isEmpty() || !(stack.getItem() instanceof ItemDankNullPanel)) {
		return;
	}

	IBakedModel model = getModel(stack);

	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	GlStateManager.enableLighting();
	GlStateManager.enableBlend();
	GlStateManager.enableRescaleNormal();
	if (stack.isOnItemFrame()) {
		GlStateManager.scale(1.25D, 1.25D, 1.25D);
		GlStateManager.translate(-0.1D, -0.1D, -0.25D);
	}

	GlStateManager.pushMatrix();

	RenderModel.render(model, stack);
	if (stack.hasEffect()) {
		if (Options.superShine) {
			GlintEffectRenderer.apply2(model, DankNullUtils.getColor(stack.getMetadata(), false));
		}
		else {
			GlintEffectRenderer.apply(model, stack.getMetadata());
		}
	}

	GlStateManager.popMatrix();

	GlStateManager.disableRescaleNormal();

}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:35,代码来源:DankNullPanelRenderer.java

示例2: renderSkull

import net.minecraft.item.ItemStack; //导入方法依赖的package包/类
public void renderSkull(float rot, ModelSkullBase modelIn, ItemStack stack) {
	ModelSkullBase modelbase = modelIn;
	bindTexture(modelbase.getTexture());
	GlStateManager.pushAttrib();
	GlStateManager.pushMatrix();
	//GlStateManager.disableCull();
	//GlStateManager.enableAlpha();
	//GlStateManager.disableDepth();
	GlStateManager.enableLighting();
	GlStateManager.translate(0.5, 0.0, 0.5);
	if (stack.isOnItemFrame()) {
		GlStateManager.scale(-2.0F, -2.0F, 2.0F);
	}
	else {
		GlStateManager.scale(-1.5F, -1.5F, 1.5F);
	}
	if (stack.isOnItemFrame()) {
		rot = 180.0F;
	}
	modelbase.render(rot);

	modelbase.renderOverlay(rot);
	if (modelbase.getLightMap() != null) {
		bindTexture(modelbase.getLightMap());
		modelbase.renderLightMap(rot);
	}
	GlStateManager.translate(-0.5, -0.0, -0.5);
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	GlStateManager.disableLighting();
	//GlStateManager.enableDepth();
	GlStateManager.popMatrix();
	GlStateManager.popAttrib();
}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:34,代码来源:ItemSkullRenderer.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.isOnItemFrame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。