本文整理汇总了Java中dan200.computercraft.api.peripheral.IPeripheral.getMethodNames方法的典型用法代码示例。如果您正苦于以下问题:Java IPeripheral.getMethodNames方法的具体用法?Java IPeripheral.getMethodNames怎么用?Java IPeripheral.getMethodNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dan200.computercraft.api.peripheral.IPeripheral
的用法示例。
在下文中一共展示了IPeripheral.getMethodNames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldTrackWithThisEntry
import dan200.computercraft.api.peripheral.IPeripheral; //导入方法依赖的package包/类
@Override
public boolean shouldTrackWithThisEntry(IBlockAccess world, BlockPos pos, IBlockState state, TileEntity te) {
if (state.getBlock() instanceof IPeripheralProvider) {
IPeripheral peripheral = ((IPeripheralProvider) state.getBlock()).getPeripheral(te.getWorld(), pos, EnumFacing.DOWN);
return peripheral != null && peripheral.getMethodNames().length != 0;
} else {
return false;
}
}
示例2: addInformation
import dan200.computercraft.api.peripheral.IPeripheral; //导入方法依赖的package包/类
@Override
public void addInformation(World world, BlockPos pos, TileEntity te, List<String> infoList) {
infoList.add("blockTracker.info.peripheral.title");
infoList.add("blockTracker.info.peripheral.availableMethods");
IPeripheral peripheral = ((IPeripheralProvider) world.getBlockState(pos).getBlock()).getPeripheral(world, pos, EnumFacing.DOWN);
if (peripheral != null) {
for (String method : peripheral.getMethodNames()) {
infoList.add("-" + method);
}
}
}