-
Notifications
You must be signed in to change notification settings - Fork 2
/
LocalPlayer.java
127 lines (102 loc) · 2.94 KB
/
LocalPlayer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* Copyright (c) 2011 GuntherDW
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.guntherdw.bukkit.tweakcraft.Packages;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
/**
* @author GuntherDW
*/
public class LocalPlayer {
private String name;
private Player bukkitPlayer;
private boolean afk;
private int spamcounter;
private long lastmessagetime;
private String nick=null;
private boolean invisible=false;
private String replyTo=null;
private boolean tntArrow=false;
public boolean isInvisible() {
return this.invisible;
}
public void setInvisible(boolean state) {
this.invisible = state;
}
public boolean isTntArrow() {
return tntArrow;
}
public void setTntArrow(boolean tntArrow) {
this.tntArrow = tntArrow;
}
public boolean hasNick() {
return nick!=null;
}
public String getNick() {
return this.nick;
}
public String getReplyTo() {
return replyTo;
}
public void setReplyTo(String replyTo) {
this.replyTo = replyTo;
}
public void setNick(String nick) {
this.nick = nick;
}
public Player getBukkitPlayerSafe() {
if(this.bukkitPlayer == null) {
Player p = Bukkit.getPlayerExact(name);
if(p!=null) bukkitPlayer=p;
}
return bukkitPlayer;
}
public Player getBukkitPlayer() {
return bukkitPlayer;
}
public void setBukkitPlayer(Player bukkitPlayer) {
this.bukkitPlayer = bukkitPlayer;
}
public boolean isAfk() {
return afk;
}
public void setAfk(boolean afk) {
this.afk = afk;
}
public long getLastmessagetime() {
return lastmessagetime;
}
public void setLastmessagetime(long lastmessagetime) {
this.lastmessagetime = lastmessagetime;
}
public int getSpamcounter() {
return spamcounter;
}
public void setSpamcounter(int spamcounter) {
this.spamcounter = spamcounter;
}
public String getName() {
return name;
}
public LocalPlayer(Player player) {
this.bukkitPlayer = player;
this.name = player.getName();
}
public LocalPlayer(String name) {
this.name = name;
}
}