Player(Client) settings
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -24,4 +24,7 @@ public interface Player {
|
||||
|
||||
boolean isFlying();
|
||||
void setFlying(boolean value);
|
||||
|
||||
PlayerSettings getSettings();
|
||||
void setSettings(PlayerSettings settings);
|
||||
}
|
||||
|
||||
32
core/src/main/java/mc/core/player/PlayerSettings.java
Normal file
32
core/src/main/java/mc/core/player/PlayerSettings.java
Normal 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;
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user