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


Java Items.FILLED_MAP属性代码示例

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


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

示例1: getCraftingResult

/**
 * Returns an Item that is the result of this recipe
 */
public ItemStack getCraftingResult(InventoryCrafting inv)
{
    ItemStack itemstack = ItemStack.field_190927_a;

    for (int i = 0; i < inv.getSizeInventory() && itemstack.func_190926_b(); ++i)
    {
        ItemStack itemstack1 = inv.getStackInSlot(i);

        if (itemstack1.getItem() == Items.FILLED_MAP)
        {
            itemstack = itemstack1;
        }
    }

    itemstack = itemstack.copy();
    itemstack.func_190920_e(1);

    if (itemstack.getTagCompound() == null)
    {
        itemstack.setTagCompound(new NBTTagCompound());
    }

    itemstack.getTagCompound().setInteger("map_scale_direction", 1);
    return itemstack;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:RecipesMapExtending.java

示例2: getSellingStack

@Override
		public ItemStack getSellingStack(ITradeList t)
		{
//			TreasureMapForEmeralds trade = (TreasureMapForEmeralds)t;
			ItemStack stack = new ItemStack(Items.FILLED_MAP, 1);
			return stack;
		}
 
开发者ID:crazysnailboy,项目名称:VillagerTrades,代码行数:7,代码来源:TradeHandlers.java

示例3: removeFrameFromMap

/**
 * 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,代码行数:16,代码来源:EntityItemFrame.java

示例4: func_190906_a

public static ItemStack func_190906_a(World p_190906_0_, double p_190906_1_, double p_190906_3_, byte p_190906_5_, boolean p_190906_6_, boolean p_190906_7_)
{
    ItemStack itemstack = new ItemStack(Items.FILLED_MAP, 1, p_190906_0_.getUniqueDataId("map"));
    String s = "map_" + itemstack.getMetadata();
    MapData mapdata = new MapData(s);
    p_190906_0_.setItemData(s, mapdata);
    mapdata.scale = p_190906_5_;
    mapdata.calculateMapCenter(p_190906_1_, p_190906_3_, mapdata.scale);
    mapdata.dimension = (byte)p_190906_0_.provider.getDimensionType().getId();
    mapdata.trackingPosition = p_190906_6_;
    mapdata.field_191096_f = p_190906_7_;
    mapdata.markDirty();
    return itemstack;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:ItemMap.java

示例5: matches

/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    if (!super.matches(inv, worldIn))
    {
        return false;
    }
    else
    {
        ItemStack itemstack = ItemStack.field_190927_a;

        for (int i = 0; i < inv.getSizeInventory() && itemstack.func_190926_b(); ++i)
        {
            ItemStack itemstack1 = inv.getStackInSlot(i);

            if (itemstack1.getItem() == Items.FILLED_MAP)
            {
                itemstack = itemstack1;
            }
        }

        if (itemstack.func_190926_b())
        {
            return false;
        }
        else
        {
            MapData mapdata = Items.FILLED_MAP.getMapData(itemstack, worldIn);
            return mapdata == null ? false : (this.func_190934_a(mapdata) ? false : mapdata.scale < 4);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:34,代码来源:RecipesMapExtending.java

示例6: matches

/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    int i = 0;
    ItemStack itemstack = ItemStack.field_190927_a;

    for (int j = 0; j < inv.getSizeInventory(); ++j)
    {
        ItemStack itemstack1 = inv.getStackInSlot(j);

        if (!itemstack1.func_190926_b())
        {
            if (itemstack1.getItem() == Items.FILLED_MAP)
            {
                if (!itemstack.func_190926_b())
                {
                    return false;
                }

                itemstack = itemstack1;
            }
            else
            {
                if (itemstack1.getItem() != Items.MAP)
                {
                    return false;
                }

                ++i;
            }
        }
    }

    return !itemstack.func_190926_b() && i > 0;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:RecipesMapCloning.java

示例7: matches

/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    if (!super.matches(inv, worldIn))
    {
        return false;
    }
    else
    {
        ItemStack itemstack = null;

        for (int i = 0; i < inv.getSizeInventory() && itemstack == null; ++i)
        {
            ItemStack itemstack1 = inv.getStackInSlot(i);

            if (itemstack1 != null && itemstack1.getItem() == Items.FILLED_MAP)
            {
                itemstack = itemstack1;
            }
        }

        if (itemstack == null)
        {
            return false;
        }
        else
        {
            MapData mapdata = Items.FILLED_MAP.getMapData(itemstack, worldIn);
            return mapdata == null ? false : mapdata.scale < 4;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:RecipesMapExtending.java

示例8: getCraftingResult

/**
 * Returns an Item that is the result of this recipe
 */
@Nullable
public ItemStack getCraftingResult(InventoryCrafting inv)
{
    ItemStack itemstack = null;

    for (int i = 0; i < inv.getSizeInventory() && itemstack == null; ++i)
    {
        ItemStack itemstack1 = inv.getStackInSlot(i);

        if (itemstack1 != null && itemstack1.getItem() == Items.FILLED_MAP)
        {
            itemstack = itemstack1;
        }
    }

    itemstack = itemstack.copy();
    itemstack.stackSize = 1;

    if (itemstack.getTagCompound() == null)
    {
        itemstack.setTagCompound(new NBTTagCompound());
    }

    itemstack.getTagCompound().setInteger("map_scale_direction", 1);
    return itemstack;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:29,代码来源:RecipesMapExtending.java

示例9: matches

/**
 * Used to check if a recipe matches current crafting inventory
 */
public boolean matches(InventoryCrafting inv, World worldIn)
{
    int i = 0;
    ItemStack itemstack = null;

    for (int j = 0; j < inv.getSizeInventory(); ++j)
    {
        ItemStack itemstack1 = inv.getStackInSlot(j);

        if (itemstack1 != null)
        {
            if (itemstack1.getItem() == Items.FILLED_MAP)
            {
                if (itemstack != null)
                {
                    return false;
                }

                itemstack = itemstack1;
            }
            else
            {
                if (itemstack1.getItem() != Items.MAP)
                {
                    return false;
                }

                ++i;
            }
        }
    }

    return itemstack != null && i > 0;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:37,代码来源:RecipesMapCloning.java

示例10: onItemRightClick

public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
{
    ItemStack itemstack = new ItemStack(Items.FILLED_MAP, 1, worldIn.getUniqueDataId("map"));
    String s = "map_" + itemstack.getMetadata();
    MapData mapdata = new MapData(s);
    worldIn.setItemData(s, mapdata);
    mapdata.scale = 0;
    mapdata.calculateMapCenter(playerIn.posX, playerIn.posZ, mapdata.scale);
    mapdata.dimension = worldIn.provider.getDimension();
    mapdata.trackingPosition = true;
    mapdata.markDirty();
    --itemStackIn.stackSize;

    if (itemStackIn.stackSize <= 0)
    {
        return new ActionResult(EnumActionResult.SUCCESS, itemstack);
    }
    else
    {
        if (!playerIn.inventory.addItemStackToInventory(itemstack.copy()))
        {
            playerIn.dropItem(itemstack, false);
        }

        playerIn.addStat(StatList.getObjectUseStats(this));
        return new ActionResult(EnumActionResult.SUCCESS, itemStackIn);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:ItemEmptyMap.java

示例11: RecipesMapExtending

public RecipesMapExtending()
{
    super(3, 3, new ItemStack[] {new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.FILLED_MAP, 1, 32767), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER)}, new ItemStack(Items.MAP));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:4,代码来源:RecipesMapExtending.java

示例12: getCraftingResult

/**
 * Returns an Item that is the result of this recipe
 */
public ItemStack getCraftingResult(InventoryCrafting inv)
{
    int i = 0;
    ItemStack itemstack = ItemStack.field_190927_a;

    for (int j = 0; j < inv.getSizeInventory(); ++j)
    {
        ItemStack itemstack1 = inv.getStackInSlot(j);

        if (!itemstack1.func_190926_b())
        {
            if (itemstack1.getItem() == Items.FILLED_MAP)
            {
                if (!itemstack.func_190926_b())
                {
                    return ItemStack.field_190927_a;
                }

                itemstack = itemstack1;
            }
            else
            {
                if (itemstack1.getItem() != Items.MAP)
                {
                    return ItemStack.field_190927_a;
                }

                ++i;
            }
        }
    }

    if (!itemstack.func_190926_b() && i >= 1)
    {
        ItemStack itemstack2 = new ItemStack(Items.FILLED_MAP, i + 1, itemstack.getMetadata());

        if (itemstack.hasDisplayName())
        {
            itemstack2.setStackDisplayName(itemstack.getDisplayName());
        }

        if (itemstack.hasTagCompound())
        {
            itemstack2.setTagCompound(itemstack.getTagCompound());
        }

        return itemstack2;
    }
    else
    {
        return ItemStack.field_190927_a;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:56,代码来源:RecipesMapCloning.java

示例13: doRender

/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityItemFrame entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    BlockPos blockpos = entity.getHangingPosition();
    double d0 = (double)blockpos.getX() - entity.posX + x;
    double d1 = (double)blockpos.getY() - entity.posY + y;
    double d2 = (double)blockpos.getZ() - entity.posZ + z;
    GlStateManager.translate(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D);
    GlStateManager.rotate(180.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
    this.renderManager.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
    ModelManager modelmanager = blockrendererdispatcher.getBlockModelShapes().getModelManager();
    IBakedModel ibakedmodel;

    if (!entity.getDisplayedItem().func_190926_b() && entity.getDisplayedItem().getItem() == Items.FILLED_MAP)
    {
        ibakedmodel = modelmanager.getModel(this.mapModel);
    }
    else
    {
        ibakedmodel = modelmanager.getModel(this.itemFrameModel);
    }

    GlStateManager.pushMatrix();
    GlStateManager.translate(-0.5F, -0.5F, -0.5F);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    blockrendererdispatcher.getBlockModelRenderer().renderModelBrightnessColor(ibakedmodel, 1.0F, 1.0F, 1.0F, 1.0F);

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.popMatrix();
    GlStateManager.translate(0.0F, 0.0F, 0.4375F);
    this.renderItem(entity);
    GlStateManager.popMatrix();
    this.renderName(entity, x + (double)((float)entity.facingDirection.getFrontOffsetX() * 0.3F), y - 0.25D, z + (double)((float)entity.facingDirection.getFrontOffsetZ() * 0.3F));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:49,代码来源:RenderItemFrame.java

示例14: RecipesMapExtending

public RecipesMapExtending()
{
    super(3, 3, new ItemStack[] {new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.FILLED_MAP, 0, 32767), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER), new ItemStack(Items.PAPER)}, new ItemStack(Items.MAP, 0, 0));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:4,代码来源:RecipesMapExtending.java

示例15: getCraftingResult

/**
 * Returns an Item that is the result of this recipe
 */
@Nullable
public ItemStack getCraftingResult(InventoryCrafting inv)
{
    int i = 0;
    ItemStack itemstack = null;

    for (int j = 0; j < inv.getSizeInventory(); ++j)
    {
        ItemStack itemstack1 = inv.getStackInSlot(j);

        if (itemstack1 != null)
        {
            if (itemstack1.getItem() == Items.FILLED_MAP)
            {
                if (itemstack != null)
                {
                    return null;
                }

                itemstack = itemstack1;
            }
            else
            {
                if (itemstack1.getItem() != Items.MAP)
                {
                    return null;
                }

                ++i;
            }
        }
    }

    if (itemstack != null && i >= 1)
    {
        ItemStack itemstack2 = new ItemStack(Items.FILLED_MAP, i + 1, itemstack.getMetadata());

        if (itemstack.hasDisplayName())
        {
            itemstack2.setStackDisplayName(itemstack.getDisplayName());
        }

        return itemstack2;
    }
    else
    {
        return null;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:52,代码来源:RecipesMapCloning.java


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