本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例6: getComparatorInputOverride
import net.minecraft.inventory.Container; //導入方法依賴的package包/類
public int getComparatorInputOverride(World worldIn, BlockPos pos)
{
return Container.calcRedstoneFromInventory(this.getLockableContainer(worldIn, pos));
}
示例7: getComparatorInputOverride
import net.minecraft.inventory.Container; //導入方法依賴的package包/類
public int getComparatorInputOverride(World worldIn, BlockPos pos) {
return Container.calcRedstoneFromInventory(this.getLockableContainer(worldIn, pos));
}
示例8: getComparatorInputOverride
import net.minecraft.inventory.Container; //導入方法依賴的package包/類
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
return Container.calcRedstoneFromInventory(this.getLockableContainer(worldIn, pos));
}
示例9: getComparatorInputOverride
import net.minecraft.inventory.Container; //導入方法依賴的package包/類
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos)
{
return Container.calcRedstoneFromInventory((IInventory)worldIn.getTileEntity(pos));
}