本文整理汇总了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()));
}
}
示例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;
}
示例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"));
}
}
示例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));
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}