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()); } } }
@Override public boolean isEnabled() { if (stat.canBeUnlocked(player, level)) { if (player.getUnlockedLevel(stat) < stat.maxLevel()) { return true; } } return false; }