當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。