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


Java Container.calcRedstoneFromInventory方法代码示例

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


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

示例1: getComparatorInputOverride

import net.minecraft.inventory.Container; //导入方法依赖的package包/类
public int getComparatorInputOverride(World worldIn, BlockPos pos)
{
    if (((Boolean)worldIn.getBlockState(pos).getValue(POWERED)).booleanValue())
    {
        List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>findMinecarts(worldIn, pos, EntityMinecartCommandBlock.class, new Predicate[0]);

        if (!list.isEmpty())
        {
            return ((EntityMinecartCommandBlock)list.get(0)).getCommandBlockLogic().getSuccessCount();
        }

        List<EntityMinecart> list1 = this.<EntityMinecart>findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[] {EntitySelectors.selectInventories});

        if (!list1.isEmpty())
        {
            return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
        }
    }

    return 0;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:BlockRailDetector.java

示例2: getComparatorInputOverride

import net.minecraft.inventory.Container; //导入方法依赖的package包/类
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
    if (((Boolean)blockState.getValue(POWERED)).booleanValue())
    {
        List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>findMinecarts(worldIn, pos, EntityMinecartCommandBlock.class, new Predicate[0]);

        if (!list.isEmpty())
        {
            return ((EntityMinecartCommandBlock)list.get(0)).getCommandBlockLogic().getSuccessCount();
        }

        List<EntityMinecart> list1 = this.<EntityMinecart>findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[] {EntitySelectors.HAS_INVENTORY});

        if (!list1.isEmpty())
        {
            return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
        }
    }

    return 0;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:BlockRailDetector.java

示例3: getComparatorInputOverride

import net.minecraft.inventory.Container; //导入方法依赖的package包/类
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
    if (((Boolean)blockState.getValue(POWERED)).booleanValue())
    {
        List<EntityMinecart> carts = this.findMinecarts(worldIn, pos, EntityMinecart.class);
        if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel();
        List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>findMinecarts(worldIn, pos, EntityMinecartCommandBlock.class, new Predicate[0]);

        if (!list.isEmpty())
        {
            return ((EntityMinecartCommandBlock)list.get(0)).getCommandBlockLogic().getSuccessCount();
        }

        List<EntityMinecart> list1 = this.<EntityMinecart>findMinecarts(worldIn, pos, EntityMinecart.class, new Predicate[] {EntitySelectors.HAS_INVENTORY});

        if (!list1.isEmpty())
        {
            return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
        }
    }

    return 0;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:BlockRailDetector.java

示例4: applyDrag

import net.minecraft.inventory.Container; //导入方法依赖的package包/类
protected void applyDrag()
{
    int i = 15 - Container.calcRedstoneFromInventory(this);
    float f = 0.98F + (float)i * 0.001F;
    this.motionX *= (double)f;
    this.motionY *= 0.0D;
    this.motionZ *= (double)f;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:9,代码来源:EntityMinecartContainer.java

示例5: applyDrag

import net.minecraft.inventory.Container; //导入方法依赖的package包/类
protected void applyDrag()
{
    float f = 0.98F;

    if (this.lootTable == null)
    {
        int i = 15 - Container.calcRedstoneFromInventory(this);
        f += (float)i * 0.001F;
    }

    this.motionX *= (double)f;
    this.motionY *= 0.0D;
    this.motionZ *= (double)f;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:15,代码来源:EntityMinecartContainer.java

示例6: getComparatorInputOverride

import net.minecraft.inventory.Container; //导入方法依赖的package包/类
public int getComparatorInputOverride(World worldIn, BlockPos pos)
{
    return Container.calcRedstoneFromInventory(this.getLockableContainer(worldIn, pos));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:BlockChest.java

示例7: getComparatorInputOverride

import net.minecraft.inventory.Container; //导入方法依赖的package包/类
public int getComparatorInputOverride(World worldIn, BlockPos pos) {
	return Container.calcRedstoneFromInventory(this.getLockableContainer(worldIn, pos));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:4,代码来源:BlockChest.java

示例8: getComparatorInputOverride

import net.minecraft.inventory.Container; //导入方法依赖的package包/类
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
    return Container.calcRedstoneFromInventory(this.getLockableContainer(worldIn, pos));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:BlockChest.java

示例9: getComparatorInputOverride

import net.minecraft.inventory.Container; //导入方法依赖的package包/类
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
    return Container.calcRedstoneFromInventory((IInventory)worldIn.getTileEntity(pos));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:BlockShulkerBox.java


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