mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-25 09:59:28 +00:00
PlayerCosmeticHide & Show refactored to be more in line with other events
This commit is contained in:
@@ -5,12 +5,12 @@ import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class PlayerHideCosmeticEvent extends Event implements Cancellable {
|
||||
public class PlayerCosmeticHideEvent extends Event implements Cancellable {
|
||||
|
||||
private CosmeticUser user;
|
||||
private boolean isCancelled;
|
||||
|
||||
public PlayerHideCosmeticEvent(CosmeticUser user) {
|
||||
public PlayerCosmeticHideEvent(CosmeticUser user) {
|
||||
this.user = user;
|
||||
this.isCancelled = false;
|
||||
}
|
||||
@@ -5,12 +5,12 @@ import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class PlayerShowCosmeticEvent extends Event implements Cancellable {
|
||||
public class PlayerCosmeticShowEvent extends Event implements Cancellable {
|
||||
|
||||
private CosmeticUser user;
|
||||
private boolean isCancelled;
|
||||
|
||||
public PlayerShowCosmeticEvent(CosmeticUser user) {
|
||||
public PlayerCosmeticShowEvent(CosmeticUser user) {
|
||||
this.user = user;
|
||||
this.isCancelled = false;
|
||||
}
|
||||
@@ -345,7 +345,7 @@ public class CosmeticUser {
|
||||
|
||||
public void hideCosmetics() {
|
||||
if (hideCosmetics == true) return;
|
||||
PlayerHideCosmeticEvent event = new PlayerHideCosmeticEvent(this);
|
||||
PlayerCosmeticHideEvent event = new PlayerCosmeticHideEvent(this);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
@@ -368,7 +368,7 @@ public class CosmeticUser {
|
||||
public void showCosmetics() {
|
||||
if (hideCosmetics == false) return;
|
||||
|
||||
PlayerShowCosmeticEvent event = new PlayerShowCosmeticEvent(this);
|
||||
PlayerCosmeticShowEvent event = new PlayerCosmeticShowEvent(this);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user