2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.minecraft.internal.message.data;
16 * Object representing Minecraft player.
18 * @author Mattias Markehed - Initial contribution
20 public class PlayerData {
22 protected String displayName;
23 protected String name;
25 protected int totalExperience;
26 protected float experience;
27 protected double health;
28 protected float walkSpeed;
29 protected LocationData location;
30 protected String gameMode;
33 * Get the display name of player.
35 * @return display name
37 public String getDisplayName() {
42 * Get the name of player
44 * @return name of player.
46 public String getName() {
51 * Get the player level.
53 * @return level of player
55 public int getLevel() {
60 * Get the total experience of player.
62 * @return total experience
64 public int getTotalExperience() {
65 return totalExperience;
69 * Get player experiance.
71 * @return experiance of player
73 public float getExperience() {
78 * Get health of player.
80 * @return player health
82 public double getHealth() {
87 * Get the walk speed of player.
89 * @return walk speed of player
91 public float getWalkSpeed() {
96 * Get location of player.
98 * @return location of player
100 public LocationData getLocation() {
105 * Get the players game mode.
109 public String getGameMode() {
114 public int hashCode() {
115 final int prime = 31;
117 result = prime * result + ((name == null) ? 0 : name.hashCode());
122 public boolean equals(Object obj) {
129 if (getClass() != obj.getClass()) {
132 PlayerData other = (PlayerData) obj;
134 if (other.name != null) {
137 } else if (!name.equals(other.name)) {