public static void buildAchievementStats ( JsonObject json , EntityPlayerMP player ) { StatisticsManagerServer sfw = player . getStatFile ( ) ; json . addProperty ( "DistanceTravelled" , sfw . readStat ( ( StatBase ) StatList . WALK_ONE_CM ) + sfw . readStat ( ( StatBase ) StatList . SWIM_ONE_CM ) + sfw . readStat ( ( StatBase ) StatList . DIVE_ONE_CM ) + sfw . readStat ( ( StatBase ) StatList . FALL_ONE_CM ) ) ; // TODO: there are many other ways of moving! json . addProperty ( "TimeAlive" , sfw . readStat ( ( StatBase ) StatList . TIME_SINCE_DEATH ) ) ; json . addProperty ( "MobsKilled" , sfw . readStat ( ( StatBase ) StatList . MOB_KILLS ) ) ; json . addProperty ( "PlayersKilled" , sfw . readStat ( ( StatBase ) StatList . PLAYER_KILLS ) ) ; json . addProperty ( "DamageTaken" , sfw . readStat ( ( StatBase ) StatList . DAMAGE_TAKEN ) ) ; json . addProperty ( "DamageDealt" , sfw . readStat ( ( StatBase ) StatList . DAMAGE_DEALT ) ) ; /* Other potential reinforcement signals that may be worth researching: json.addProperty("BlocksDestroyed", sfw.readStat((StatBase)StatList.objectBreakStats) - but objectBreakStats is an array of 32000 StatBase objects - indexed by block type.); json.addProperty("Blocked", ev.player.isMovementBlocked()) - but isMovementBlocker() is a protected method (can get round this with reflection) */ }
Builds the basic achievement world data to be used as observation signals by the listener .