Archived
0

Player(Client) settings

This commit is contained in:
2018-06-23 14:21:27 +03:00
parent 8472f741e7
commit 9b763961bf
5 changed files with 58 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ public class InMemoryPlayerManager implements PlayerManager, Runnable {
player.setName(name);
player.getLocation().set(defaultLocation);
player.getLook().set(defaultLook);
player.setSettings(new PlayerSettings());
synchronized (lock) {
players.add(player);

View File

@@ -24,4 +24,7 @@ public interface Player {
boolean isFlying();
void setFlying(boolean value);
PlayerSettings getSettings();
void setSettings(PlayerSettings settings);
}

View File

@@ -0,0 +1,32 @@
/*
* DmitriyMX <dimon550@gmail.com>
* 2018-06-23
*/
package mc.core.player;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PlayerSettings {
public static final int CHAT_ENABLED = 0,
CHAT_COMMANDS_ONLY = 1,
CHAT_HIDDEN = 2;
public static final int HAND_LEFT = 0,
HAND_RIGHT = 1;
private String locate = "en_US";
private int viewDistance = 8;
private int chatMode = CHAT_ENABLED;
private boolean chatColors = true;
private boolean capeEnabled = true,
jacketEnabled = true,
leftSleeveEnabled = true,
rightSleeveEnabled = true,
leftPantsLegEnabled = true,
rightPantsLegEnabled = true,
hatEnabled = true;
private int mainHand = HAND_RIGHT;
}

View File

@@ -20,6 +20,7 @@ public class SimplePlayer implements Player {
private Location location = new Location(0, 0, 0);
private Look look = new Look(0, 0);
private boolean flying = false;
private PlayerSettings settings;
public void setLocation(Location location) {
this.location.set(location);