<commit_before>/**
 * EpicWar
 * The MIT License
 * Copyright (C) 2015 Mararok <<EMAIL>>
 */
package com.mararok.epicwar.player.internal;

import org.bukkit.Location;
import org.bukkit.entity.Player;

import com.mararok.epiccore.Position3D;
import com.mararok.epiccore.entity.ObservedEntity;
import com.mararok.epicwar.War;
import com.mararok.epicwar.control.ControlPoint;
import com.mararok.epicwar.control.Sector;
import com.mararok.epicwar.control.Subsector;
import com.mararok.epicwar.faction.Faction;
import com.mararok.epicwar.player.PlayerStats;
import com.mararok.epicwar.player.WarPlayer;
import com.mararok.epicwar.player.WarPlayerData;

public class WarPlayerImpl extends ObservedEntity implements WarPlayer {
  private Player nativePlayer;
  private PlayerStats stats;
  private Faction faction;

  private Position3D position = new Position3D();
  private Subsector subsector;

  public WarPlayerImpl(WarPlayerData data, Player nativePlayer, War war) {
    super(data.id);
    this.nativePlayer = nativePlayer;
    this.stats = data.stats;

    this.faction = war.getFactionManager().findById(data.factionId);
    position = new Position3D();
  }

  public void update(Location nextPosition) {
    int newX = nextPosition.getBlockX();
    int newY = nextPosition.getBlockY();
    int newZ = nextPosition.getBlockZ();

    if (position.y != newY || position.x != newX || position.z != newZ) {<commit_msg>Refactored<commit_after>/**
 * EpicWar
 * The MIT License
 * Copyright (C) 2015 Mararok <<EMAIL>>
 */
package com.mararok.epicwar.player.internal;

import org.bukkit.Location;
import org.bukkit.entity.Player;

import com.mararok.epiccore.entity.ObservedEntity;
import com.mararok.epiccore.math.Position3D;
import com.mararok.epicwar.War;
import com.mararok.epicwar.control.ControlPoint;
import com.mararok.epicwar.control.Sector;
import com.mararok.epicwar.control.Subsector;
import com.mararok.epicwar.faction.Faction;
import com.mararok.epicwar.player.PlayerStats;
import com.mararok.epicwar.player.WarPlayer;
import com.mararok.epicwar.player.WarPlayerData;

public class WarPlayerImpl extends ObservedEntity implements WarPlayer {
  private Player nativePlayer;
  private PlayerStats stats;
  private Faction faction;

  private Position3D position = new Position3D();
  private Subsector subsector;

  public WarPlayerImpl(WarPlayerData data, Player nativePlayer, War war) {
    super(data.id);
    this.nativePlayer = nativePlayer;
    this.stats = data.stats;

    this.faction = war.getFactionManager().findById(data.factionId);
    position = new Position3D();
  }

  public void updatePosition(Location nextPosition) {
    int newX = nextPosition.getBlockX();
    int newY = nextPosition.getBlockY();
    int newZ = nextPosition.getBlockZ();

    if (position.y != newY || position.x != newX || position.z != newZ) {
{'fraction_non_alphanumeric': 0.10661505981703026, 'fraction_numerical': 0.005629838142153413, 'mean_word_length': 4.778455284552845, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2403505', 'n_tokens_mistral': 952, 'n_tokens_neox': 919, 'n_words': 194}