-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathPlayerClickHeadEvent.java
More file actions
141 lines (124 loc) · 3.47 KB
/
PlayerClickHeadEvent.java
File metadata and controls
141 lines (124 loc) · 3.47 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
* Head Database is a fast and user-friendly plugin to allow thousands of custom heads for Minecraft.
* Copyright (C) Arcaniax-Development
* Copyright (C) Arcaniax team and contributors
*
* 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 3 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, see <https://www.gnu.org/licenses/>.
*/
package me.arcaniax.hdb.api;
import me.arcaniax.hdb.enums.CategoryEnum;
import me.arcaniax.hdb.enums.EconomyEnum;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.ItemStack;
public class PlayerClickHeadEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Player player;
private final CategoryEnum categoryEnum;
private final ItemStack head;
private double price = 0.0D;
private String headID = "";
private boolean economy = false;
private EconomyEnum economyEnum = EconomyEnum.CURRENCY;
private boolean isCancelled = false;
public PlayerClickHeadEvent(
Player player,
double price,
String headID,
EconomyEnum economyEnum,
ItemStack head,
CategoryEnum categoryEnum
) {
this.player = player;
this.price = price;
this.headID = headID;
this.economy = true;
this.economyEnum = economyEnum;
this.head = head;
this.categoryEnum = categoryEnum;
}
public PlayerClickHeadEvent(Player player, String headID, ItemStack head, CategoryEnum categoryEnum) {
this.player = player;
this.headID = headID;
this.head = head;
this.categoryEnum = categoryEnum;
}
/**
* @return handlers
*/
public static HandlerList getHandlerList() {
return handlers;
}
/**
* @return {@link CategoryEnum}
*/
public CategoryEnum getCategoryEnum() {
return this.categoryEnum;
}
/**
* @return the player
*/
public Player getPlayer() {
return this.player;
}
/**
* @return the head price
*/
public double getPrice() {
return this.price;
}
/**
* @return the headID
*/
public String getHeadID() {
return this.headID;
}
/**
* @return whether economy is in use
*/
public boolean isEconomy() {
return this.economy;
}
/**
* @return {@link EconomyEnum}
*/
public EconomyEnum getEconomyEnum() {
return this.economyEnum;
}
/**
* @return null
*/
public ItemStack getHead() {
return this.head;
}
/**
* @return Whether something is cancelled
*/
public boolean isCancelled() {
return this.isCancelled;
}
/**
* @param b cancel
*/
public void setCancelled(Boolean b) {
this.isCancelled = b;
}
/**
* @return HDB Handlers
*/
public HandlerList getHandlers() {
return handlers;
}
}