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


Java ProbeMode.NORMAL属性代码示例

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


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

示例1: addProbeInfo

/**
 * Called by TOP compatibility handler
 * @param mode
 * @param probeInfo
 * @param player
 * @param world
 * @param blockState
 * @param data
 */
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
	TileEntity te = world.getTileEntity(data.getPos());
	if (te instanceof TileEntityChunkProtector) {
		TileEntityChunkProtector chunkprotector = (TileEntityChunkProtector) te;
		int secondsLeft = chunkprotector.getSecondsBeforeDestroyed();
		int ticksLeft = chunkprotector.getTicksBeforeDestroyed();
		if (ticksLeft != -1) {
			if (mode == ProbeMode.NORMAL) {
				probeInfo.text(TextFormatting.BLUE + Integer.toString(secondsLeft) + " seconds left in world");
			} else if (mode == ProbeMode.EXTENDED) {
				probeInfo.text(TextFormatting.BLUE + Integer.toString(ticksLeft) + " ticks left in world");
			} else if (mode == ProbeMode.DEBUG) {
				probeInfo.text(TextFormatting.BLUE + Integer.toString(secondsLeft) + " seconds left in world");
				probeInfo.text(TextFormatting.BLUE + Integer.toString(ticksLeft) + " ticks left in world");
			}
		} else probeInfo.text(TextFormatting.GRAY + "Won't decay");
	}
}
 
开发者ID:Maxwell-lt,项目名称:MobBlocker,代码行数:27,代码来源:BlockChunkProtector.java

示例2: mkRangeLine

private void mkRangeLine(ProbeMode mode, EioBox eiobox, TOPData data) {
  if (data.hasRange) {
    if (mode != ProbeMode.NORMAL || topShowRangeByDefault) {
      int sizeX = (int) data.bounds.sizeX();
      int sizeY = (int) data.bounds.sizeY();
      int sizeZ = (int) data.bounds.sizeZ();

      addIcon(eiobox.get().horizontal(eiobox.center()), IconEIO.SHOW_RANGE)
          .text(loc("top.range.header", EnderIO.lang.localize("top.range", sizeX, sizeY, sizeZ)));
    } else {
      eiobox.addMore();
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:14,代码来源:TOPCompatibility.java

示例3: mkSideConfigLine

private void mkSideConfigLine(ProbeMode mode, EioBox eiobox, TOPData data) {
  if (data.hasIOMode) {
    if (mode != ProbeMode.NORMAL || topShowSideConfigByDefault) {
      addIcon(eiobox.get().horizontal(eiobox.center()), IconEIO.IO_CONFIG_UP).vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1))
          .text(TextFormatting.YELLOW + loc("top.machine.side", TextFormatting.WHITE + loc("top.machine.side." + data.sideName)))
          .text(TextFormatting.YELLOW + loc("top.machine.ioMode", loc(data.ioMode.getColorerUnlocalizedName())));
    } else {
      eiobox.addMore();
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:11,代码来源:TOPCompatibility.java

示例4: mkRedstoneLine

private void mkRedstoneLine(ProbeMode mode, EioBox eiobox, TOPData data) {
  if (data.hasRedstone) {
    if (mode != ProbeMode.NORMAL || topShowRedstoneByDefault) {
      addIcon(eiobox.get().horizontal(eiobox.center()), data.redstoneIcon).vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1))
          .text(loc(data.redstoneTooltip)).text(loc("top.redstone.header", loc("top.redstone." + data.redstoneControlStatus)));
    } else {
      eiobox.addMore();
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:10,代码来源:TOPCompatibility.java

示例5: mkRfLine

private void mkRfLine(ProbeMode mode, EioBox eiobox, TOPData data) {
  if (data.hasRF) {
    if (mode != ProbeMode.NORMAL || topShowPowerByDefault) {
      IProbeInfo rfLine = eiobox.get().horizontal(eiobox.center()).item(Material.POWDER_INFINITY.getStack());
      if (data.hasRFIO) {
        rfLine = rfLine.vertical();
      }
      if (data.isPowered) {
        rfLine.progress(data.rf, data.maxrf, eiobox.getProbeinfo().defaultProgressStyle().suffix(EnderIO.lang.localize("top.suffix.rf"))
            .filledColor(0xffd63223).alternateFilledColor(0xffd63223));
      } else {
        rfLine.text(loc("top.machine.outofpower"));
      }
      if (data.hasRFIO) {
        rfLine = rfLine.horizontal();
        rfLine.vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1))//
            .text(loc("top.rf.header.avg")).text(loc("top.rf.header.maxin")).text(loc("top.rf.header.maxout"));

        // LangPower.format should be run on the client, but we have no way to do that
        String line1 = loc("top.rf.value",
            (data.avgRF == 0 ? TextFormatting.WHITE : data.avgRF > 0 ? TextFormatting.GREEN + "+" : TextFormatting.RED) + LangPower.format(data.avgRF));
        String line2 = loc("top.rf.value", LangPower.format(data.maxRFIn));
        String line3 = loc("top.rf.value", LangPower.format(data.maxRFOut));
        rfLine = rfLine.vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1)).text(line1).text(line2).text(line3);
      }
    } else {
      eiobox.addMore();
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:30,代码来源:TOPCompatibility.java

示例6: mkXPLine

private void mkXPLine(ProbeMode mode, EioBox eiobox, TOPData data) {
  if (data.hasXP) {
    if (mode != ProbeMode.NORMAL || topShowXPByDefault) {
      // We need to put the number of levels in as "current" value for it to be displayed as text. To make the progress bar scale to the partial level, we set
      // the "max" value in a way that is in the same ratio to the number of levels as the xp needed for the next level is to the current xp. If the bar
      // should be empty but we do have at least one level in, there will be a small error, as (levels/Integer.MAX_VALUE) > 0.
      int scalemax = data.xpBarScaled > 0 ? data.experienceLevel * 100 / data.xpBarScaled : Integer.MAX_VALUE;
      eiobox.get().horizontal(eiobox.center()).item(new ItemStack(Items.EXPERIENCE_BOTTLE)).progress(data.experienceLevel, scalemax,
          eiobox.getProbeinfo().defaultProgressStyle().suffix(EnderIO.lang.localize("top.suffix.levels")).filledColor(0xff00FF0F)
              .alternateFilledColor(0xff00AA0A).borderColor(0xff00AA0A));
    } else {
      eiobox.addMore();
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:15,代码来源:TOPCompatibility.java

示例7: mkItemFillLevelLine

private void mkItemFillLevelLine(ProbeMode mode, EioBox eiobox, TOPData data) {
  if (data.hasItemFillLevel) {
    if (mode != ProbeMode.NORMAL || topShowItemCountDefault) {
      eiobox.get().horizontal(eiobox.center()).item(new ItemStack(Blocks.CHEST)).progress(data.fillCur, data.fillMax,
          eiobox.getProbeinfo().defaultProgressStyle().suffix(EnderIO.lang.localize("top.suffix.items")).filledColor(0xfff8f83c)
              .alternateFilledColor(0xffcfac0b).borderColor(0xffcfac0b));
    } else {
      eiobox.addMore();
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:11,代码来源:TOPCompatibility.java

示例8: mkProgressLine

private void mkProgressLine(ProbeMode mode, EioBox eiobox, TOPData data) {
  if (data.progressResult != TOPData.ProgressResult.NONE) {
    if (mode != ProbeMode.NORMAL || topShowProgressByDefault || data.progressResult == TOPData.ProgressResult.PROGRESS_NO_POWER) {
      final IProbeInfo progressLine = eiobox.get().horizontal(eiobox.center()).item(new ItemStack(Items.CLOCK));
      switch (data.progressResult) {
      case PROGRESS:
        progressLine.progress((int) (data.progress * 100), 100, eiobox.getProbeinfo().defaultProgressStyle()
            .suffix(EnderIO.lang.localize("top.suffix.percent")).filledColor(0xffffb600).alternateFilledColor(0xffffb600));
        break;
      case PROGRESS_NO_POWER:
        progressLine.text(loc("top.progress.outofpower"));
        break;
      case PROGRESS_ACTIVE:
      case NO_PROGRESS_ACTIVE:
        progressLine.text(loc("top.machine.active"));
        break;
      case PROGRESS_IDLE:
      case NO_PROGRESS_IDLE:
        progressLine.text(loc("top.machine.idle"));
        break;
      case NONE:
        break;
      }
    } else {
      eiobox.addMore();
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:28,代码来源:TOPCompatibility.java

示例9: mkTankLines

private void mkTankLines(ProbeMode mode, EioBox eiobox, TOPData data) {
  if (data.tankData != null && !data.tankData.isEmpty()) {
    if (mode != ProbeMode.NORMAL || topShowTanksByDefault) {
      for (ITankData tank : data.tankData) {
        SmartTank smartTank = new SmartTank(1000);
        String content1;
        String content2;
        final FluidStack fluid = tank.getContent();
        if (fluid != null) {
          FluidStack fluid2 = fluid.copy();
          fluid2.amount = fluid.amount * 1000 / tank.getCapacity();
          smartTank.setFluid(fluid2);
          content1 = NullHelper.first(fluid.getLocalizedName(), "(???)");
          // TODO lang-format those numbers
          content2 = loc("top.tank.content", "" + fluid.amount, "" + tank.getCapacity());
        } else {
          content1 = loc("top.tank.content.empty");
          // TODO lang-format those numbers
          content2 = loc("top.tank.content", "0", "" + tank.getCapacity());
        }
        switch (tank.getTankType()) {
        case INPUT:
          content1 = loc("top.tank.header.input", content1);
          break;
        case OUTPUT:
          content1 = loc("top.tank.header.output", content1);
          break;
        case STORAGE:
          content1 = loc("top.tank.header.storage", content1);
          break;
        }
        ItemStack stack = new ItemStack(ModObject.blockFusedQuartz.getBlockNN()); // sic!
        ItemTankHelper.setTank(stack, smartTank);
        NbtValue.FAKE.setBoolean(stack, true);

        eiobox.get().horizontal(eiobox.center()).item(stack).vertical(eiobox.getProbeinfo().defaultLayoutStyle().spacing(-1)).text(content1).text(content2);

      }
    } else {
      eiobox.addMore();
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:43,代码来源:TOPCompatibility.java


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