當前位置: 首頁>>代碼示例>>Java>>正文


Java IWailaConfigHandler.getConfig方法代碼示例

本文整理匯總了Java中mcp.mobius.waila.api.IWailaConfigHandler.getConfig方法的典型用法代碼示例。如果您正苦於以下問題:Java IWailaConfigHandler.getConfig方法的具體用法?Java IWailaConfigHandler.getConfig怎麽用?Java IWailaConfigHandler.getConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mcp.mobius.waila.api.IWailaConfigHandler的用法示例。


在下文中一共展示了IWailaConfigHandler.getConfig方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getWailaStack

import mcp.mobius.waila.api.IWailaConfigHandler; //導入方法依賴的package包/類
@Override
public ItemStack getWailaStack (IWailaDataAccessor data, IWailaConfigHandler cfg) {

    final Block block = Block.getBlockFromItem(data.getStack().getItem());

    if (block instanceof BlockSneaky && !data.getTileEntity().isInvalid()) {

        final TileEntitySneaky tile = (TileEntitySneaky) data.getTileEntity();

        if (cfg.getConfig(CONFIG_SNEAKY_OWNERS) && tile.playerID != null && !tile.playerID.isEmpty() && data.getPlayer().getUniqueID().toString().equals(tile.playerID)) {
            return data.getStack();
        }

        if (tile.heldState != null) {
            return new ItemStack(tile.heldState.getBlock(), 1, tile.heldState.getBlock().getMetaFromState(tile.heldState));
        }
    }

    else if (data.getBlock() instanceof BlockFakeTNT) {
        return new ItemStack(Blocks.TNT, 1, 0);
    }

    return new ItemStack(data.getStack().getItem(), 1, 0);
}
 
開發者ID:Darkhax-Minecraft,項目名稱:Dark-Utilities,代碼行數:25,代碼來源:DarkUtilsTileProvider.java

示例2: getWailaBody

import mcp.mobius.waila.api.IWailaConfigHandler; //導入方法依賴的package包/類
@Override
public List<String> getWailaBody (ItemStack stack, List<String> tip, IWailaDataAccessor data, IWailaConfigHandler cfg) {

    if (data.getBlock() instanceof BlockFilter && cfg.getConfig(CONFIG_FILTER_TYPE) && !(stack.getMetadata() > FilterType.getTypes().length)) {
        tip.add(I18n.format("tooltip.darkutils.filter.type") + ": " + TextFormatting.AQUA + I18n.format("tooltip.darkutils.filter.type." + FilterType.getTypes()[stack.getMetadata()]));
    }
    else if (data.getBlock() instanceof BlockTimer && cfg.getConfig(CONFIG_TIMER_TIME) && data.getTileEntity() instanceof TileEntityTimer && !data.getTileEntity().isInvalid()) {

        final int delay = data.getNBTData().getInteger("TickRate");
        final int currentTime = data.getNBTData().getInteger("CurrentTime");

        tip.add(I18n.format("gui.darkutils.timer.delay") + ": " + delay);
        tip.add(I18n.format("gui.darkutils.timer.remaining") + ": " + StringUtils.ticksToElapsedTime(delay - currentTime));
    }

    return tip;
}
 
開發者ID:Darkhax-Minecraft,項目名稱:Dark-Utilities,代碼行數:18,代碼來源:DarkUtilsTileProvider.java

示例3: oreStack

import mcp.mobius.waila.api.IWailaConfigHandler; //導入方法依賴的package包/類
private ItemStack oreStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
	int meta = accessor.getMetadata();
	TEModOre te = (TEModOre) accessor.getTileEntity();
	ItemStack itemstack = null;
	
	if (accessor.getBlock() == ModBlocks.ore) {
		if (config.getConfig("tfc.oreQuality"))
			itemstack = new ItemStack(ModItems.oreChunk, 1, getOreGrade(te, meta)); // Shows specific quality ore.
		else
			itemstack = new ItemStack(ModItems.oreChunk, 1, meta); // All normal quality ores.
			
		return itemstack;
	}
	
	return null;
}
 
開發者ID:Shurgent,項目名稱:TFCTech,代碼行數:17,代碼來源:WAILAData.java

示例4: getWailaStack

import mcp.mobius.waila.api.IWailaConfigHandler; //導入方法依賴的package包/類
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
	ItemStack stack = accessor.getStack();
	if (accessor.getBlock() instanceof BlockInfusedBlockOre && accessor.getPlayer() != null
			&& config.getConfig("hideinfusedore")) {
		stack = ((BlockInfusedBlockOre) accessor.getBlock()).getPickBlock(accessor.getPosition(),
				accessor.getWorld(), accessor.getPosition().blockX, accessor.getPosition().blockY,
				accessor.getPosition().blockZ, accessor.getPlayer());
	}
	return stack;
}
 
開發者ID:MJaroslav,項目名稱:ThaumOres,代碼行數:12,代碼來源:WailaInfusedBlockOre.java

示例5: isWailaUsesMultimeter

import mcp.mobius.waila.api.IWailaConfigHandler; //導入方法依賴的package包/類
public static boolean isWailaUsesMultimeter(IWailaConfigHandler config) {
	return wailaUsesMultimeterForce ? true : config.getConfig(WailaHandler.ENERGY_HANDLER_ID);
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:4,代碼來源:Config.java


注:本文中的mcp.mobius.waila.api.IWailaConfigHandler.getConfig方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。