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


Java IWailaDataAccessor.getNBTData方法代码示例

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


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

示例1: addTipToMachine

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
public static void addTipToMachine(List<String> currenttip, IWailaDataAccessor accessor) {
    NBTTagCompound tag = accessor.getNBTData();
    //This is used so that we can split values later easier and have them all in the same layout.
    Map<String, String> values = new HashMap<>();

    if (tag.hasKey("redstoneMode")) {
        int mode = tag.getInteger("redstoneMode");
        GuiPneumaticContainerBase gui = (GuiPneumaticContainerBase) PneumaticCraftRepressurized.proxy.getClientGuiElement(((BlockPneumaticCraft) accessor.getBlock()).getGuiID().ordinal(),
                accessor.getPlayer(), accessor.getWorld(), accessor.getPosition().getX(), accessor.getPosition().getY(), accessor.getPosition().getZ());
        TileEntity te = accessor.getTileEntity();
        if (te instanceof TileEntityBase) {
            values.put(((TileEntityBase) te).getRedstoneString(), ((TileEntityBase) te).getRedstoneButtonText(mode));
        }
    }

    //Get all the values from the map and put them in the list.
    for (Map.Entry<String, String> entry : values.entrySet()) {
        currenttip.add(TextFormatting.RED + I18n.format(entry.getKey()) + ": " + I18n.format(entry.getValue()));
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:21,代码来源:WailaRedstoneControl.java

示例2: getWailaBody

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) 
{
	NBTTagCompound tag = accessor.getNBTData();
	TileEntity tileEntity = accessor.getTileEntity();
	
	if(Loader.isModLoaded("Steamcraft") && ConfigSettings.FSPWailaIntegration)
	{
		if (tileEntity != null && tileEntity instanceof TEBoiler)
		{
			currenttip.add(StatCollector.translateToLocal("gui.tfptweaks.watertank") + ": " + tag.getInteger("water") + " / " + ((TEBoiler)tileEntity).myTank.getCapacity());
			currenttip.add(StatCollector.translateToLocal("gui.tfptweaks.steamtank") + ": " + tag.getInteger("steam") + " / " + ((TEBoiler)tileEntity).getCapacity());
		}
		else if (tileEntity != null && tileEntity instanceof TEFlashBoiler && ((TEFlashBoiler)tileEntity).hasMaster())
		{
			currenttip.add(StatCollector.translateToLocal("gui.tfptweaks.watertank") + ": " + ((TEFlashBoiler)tileEntity).getMasterTileEntity().getTank().getFluidAmount() + " / " + ((TEFlashBoiler)tileEntity).getMasterTileEntity().getTank().getCapacity());
			currenttip.add(StatCollector.translateToLocal("gui.tfptweaks.steamtank") + ": "+ tag.getInteger("steam") + " / " + ((TEFlashBoiler)tileEntity).getMasterTileEntity().getCapacity());
		}
	}
	
	return currenttip;
}
 
开发者ID:StrayWolfe,项目名称:TerrafirmaPunk-Tweaks,代码行数:23,代码来源:WAILAInfo.java

示例3: addTipToMachine

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
private static void addTipToMachine(List<String> currenttip, IWailaDataAccessor accessor) {
    NBTTagCompound tag = accessor.getNBTData();
    TileEntity te = accessor.getTileEntity();
    if(te instanceof IInfoForwarder){
        BlockPos infoPos = new BlockPos(tag.getInteger("infoX"), tag.getInteger("infoY"), tag.getInteger("infoZ"));
        te = accessor.getWorld().getTileEntity(infoPos);
    }
    
    if (te instanceof IPneumaticMachine) {
        addTipToMachine(currenttip, (IPneumaticMachine) te, tag.getFloat("pressure"));
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:13,代码来源:WailaPneumaticHandler.java

示例4: addTipToMachine

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
private static void addTipToMachine(List<String> currenttip, IWailaDataAccessor accessor) {
    NBTTagCompound tag = accessor.getNBTData();
    if (tag.hasKey("heat")) {
        NBTTagList tagList = tag.getTagList("heat", 10);
        for (int i = 0; i < tagList.tagCount(); i++) {
            NBTTagCompound heatTag = tagList.getCompoundTagAt(i);
            String dir = EnumFacing.getFront(heatTag.getByte("side")).toString().toLowerCase();
            currenttip.add(I18n.format("waila.temperature." + dir, heatTag.getInteger("temp") - 273));
        }
    } else {
        currenttip.add(I18n.format("waila.temperature", tag.getInteger("temp") - 273));
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:14,代码来源:WailaHeatHandler.java

示例5: getWailaBody

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
	NBTTagCompound tag = accessor.getNBTData();
	String playerName = tag.getString("player");
	if (!playerName.equals("")) {
		currenttip.add(I18n.format("tomsMod.waila.playerName") + " " + TextFormatting.YELLOW + playerName);
	}
	return currenttip;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:10,代码来源:WailaEnderMemory.java

示例6: getWailaBody

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
	NBTTagCompound tag = accessor.getNBTData();
	if (!tag.hasNoTags()) {
		if (WailaHandler.hasMultimeter(accessor, config) || tag.getBoolean("integrated")) {
			for (int i = 0;i < tag.getInteger("size");i++) {
				NBTTagCompound t = tag.getCompoundTag(accessor.getSide().getName() + "_" + i);
				if (!t.hasNoTags())
					currenttip.add(I18n.format("tomsMod.waila.energyStored") + " " + TextFormatting.values()[t.getInteger("c")] + t.getString("type") + TextFormatting.RESET + ": " + t.getInteger("MaxEnergy") + "/" + t.getDouble("Energy"));
			}
		}
	}
	return currenttip;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:15,代码来源:WailaEnergyHandler.java

示例7: getWailaBody

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
	NBTTagCompound tag = accessor.getNBTData();
	int amount = tag.getInteger("amount");
	if (amount != 0)
		currenttip.add(I18n.format("fluid.tomsmodplasma") + " " + I18n.format("tomsMod.waila.fluidStored", Configs.BASIC_TANK_SIZE, amount));
	return currenttip;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:9,代码来源:WailaFusionExtractor.java

示例8: getWailaBody

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
	NBTTagCompound tag = accessor.getNBTData();
	int amount = tag.getInteger("amount");
	currenttip.add(I18n.format("fluid.tomsmodfusionfuel") + " " + I18n.format("tomsMod.waila.fluidStored", Configs.BASIC_TANK_SIZE, amount));
	return currenttip;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:8,代码来源:WailaFusionInjector.java

示例9: getWailaBody

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
{
    TileNetworkTest network = (TileNetworkTest) accessor.getTileEntity();
    GraphObject object = network.getNetworkHandler();

    NBTTagCompound tag = accessor.getNBTData();

    currenttip.add("The graph ID is only for debugging purposes,");
    currenttip.add("the numbers below are " + TextFormatting.WHITE + "SUPPOSED" + TextFormatting.GRAY + " to be different!");
    currenttip.add(String.format("Client Graph Instance ID: %s", object == null ? -1 : object.getGraph().getGraphUid()));
    currenttip.add(String.format("Server Graph Instance ID: %s", tag.getInteger("graphUid")));

    return currenttip;
}
 
开发者ID:gigaherz,项目名称:GraphLib,代码行数:16,代码来源:WailaProviders.java

示例10: getWailaStack

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
	return accessor != null && accessor.getNBTData() != null ? TomsModUtils.loadItemStackFromNBT(accessor.getNBTData().getCompoundTag("stack")) : null;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:5,代码来源:WailaHidden.java

示例11: getWailaStack

import mcp.mobius.waila.api.IWailaDataAccessor; //导入方法依赖的package包/类
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
	NBTTagCompound tag = accessor.getNBTData();
	return tag.getBoolean("camo") ? TomsModUtils.loadItemStackFromNBT(tag.getCompoundTag("camoStack")) : new ItemStack(CoreInit.EnderPlayerSensor);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:6,代码来源:WailaEnderSensor.java


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