コード例 #1
0
  public void manageBiostats(InputEvent.KeyInputEvent event) {
    AndroidPlayer androidPlayer =
        AndroidPlayer.get(FMLClientHandler.instance().getClientPlayerEntity());

    for (IBionicStat stat : AndroidStatRegistry.stats.values()) {
      int level = androidPlayer.getUnlockedLevel(stat);
      if (level > 0 && stat.isEnabled(androidPlayer, level)) {
        stat.onKeyPress(
            androidPlayer,
            androidPlayer.getUnlockedLevel(stat),
            Keyboard.getEventKey(),
            Keyboard.getEventKeyState());
      }
    }
  }
コード例 #2
0
  @Override
  public boolean isEnabled() {

    if (stat.canBeUnlocked(player, level)) {
      if (player.getUnlockedLevel(stat) < stat.maxLevel()) {
        return true;
      }
    }
    return false;
  }