mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-03 21:15:28 +02:00
Update code style
This commit is contained in:
@@ -6,6 +6,10 @@ import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
|
||||
public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancellable {
|
||||
/**
|
||||
* Rest of file is required boilerplate for custom events
|
||||
**/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private String oldAlly;
|
||||
private String newAlly;
|
||||
private EventReason reason;
|
||||
@@ -24,6 +28,10 @@ public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancel
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The party being left, or null if the player was not in a party
|
||||
*/
|
||||
@@ -45,6 +53,24 @@ public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancel
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Following are required for Cancellable
|
||||
**/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of reasons why the event may have been fired
|
||||
*/
|
||||
@@ -64,27 +90,4 @@ public class McMMOPartyAllianceChangeEvent extends PlayerEvent implements Cancel
|
||||
*/
|
||||
CUSTOM
|
||||
}
|
||||
|
||||
/** Following are required for Cancellable **/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
|
@@ -9,6 +9,10 @@ import org.bukkit.event.player.PlayerEvent;
|
||||
* Called when a player attempts to join, leave, or change parties.
|
||||
*/
|
||||
public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable {
|
||||
/**
|
||||
* Rest of file is required boilerplate for custom events
|
||||
**/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private String oldParty;
|
||||
private String newParty;
|
||||
private EventReason reason;
|
||||
@@ -27,6 +31,10 @@ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable {
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The party being left, or null if the player was not in a party
|
||||
*/
|
||||
@@ -48,6 +56,24 @@ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable {
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Following are required for Cancellable
|
||||
**/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of reasons why the event may have been fired
|
||||
*/
|
||||
@@ -77,27 +103,4 @@ public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable {
|
||||
*/
|
||||
CUSTOM
|
||||
}
|
||||
|
||||
/** Following are required for Cancellable **/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,10 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class McMMOPartyLevelUpEvent extends Event implements Cancellable {
|
||||
/**
|
||||
* Rest of file is required boilerplate for custom events
|
||||
**/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Party party;
|
||||
private int levelsChanged;
|
||||
private boolean cancelled;
|
||||
@@ -16,6 +20,10 @@ public class McMMOPartyLevelUpEvent extends Event implements Cancellable {
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public Party getParty() {
|
||||
return party;
|
||||
}
|
||||
@@ -28,7 +36,9 @@ public class McMMOPartyLevelUpEvent extends Event implements Cancellable {
|
||||
this.levelsChanged = levelsChanged;
|
||||
}
|
||||
|
||||
/** Following are required for Cancellable **/
|
||||
/**
|
||||
* Following are required for Cancellable
|
||||
**/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
@@ -39,15 +49,8 @@ public class McMMOPartyLevelUpEvent extends Event implements Cancellable {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
|
@@ -8,6 +8,10 @@ import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
* Called just before a player teleports using the /ptp command.
|
||||
*/
|
||||
public class McMMOPartyTeleportEvent extends PlayerTeleportEvent {
|
||||
/**
|
||||
* Rest of file is required boilerplate for custom events
|
||||
**/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private String party;
|
||||
private Player target;
|
||||
|
||||
@@ -17,6 +21,10 @@ public class McMMOPartyTeleportEvent extends PlayerTeleportEvent {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The party the teleporting player is in
|
||||
*/
|
||||
@@ -31,15 +39,8 @@ public class McMMOPartyTeleportEvent extends PlayerTeleportEvent {
|
||||
return target;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,10 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class McMMOPartyXpGainEvent extends Event implements Cancellable {
|
||||
/**
|
||||
* Rest of file is required boilerplate for custom events
|
||||
**/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Party party;
|
||||
private float xpGained;
|
||||
private boolean cancelled;
|
||||
@@ -16,6 +20,10 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable {
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public Party getParty() {
|
||||
return party;
|
||||
}
|
||||
@@ -27,6 +35,13 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable {
|
||||
return xpGained;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xpGained set amount of experience gained in this event
|
||||
*/
|
||||
public void setRawXpGained(float xpGained) {
|
||||
this.xpGained = xpGained;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int amount of experience gained in this event
|
||||
*/
|
||||
@@ -35,13 +50,6 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable {
|
||||
return (int) xpGained;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xpGained set amount of experience gained in this event
|
||||
*/
|
||||
public void setRawXpGained(float xpGained) {
|
||||
this.xpGained = xpGained;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xpGained set int amount of experience gained in this event
|
||||
*/
|
||||
@@ -50,7 +58,9 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable {
|
||||
this.xpGained = xpGained;
|
||||
}
|
||||
|
||||
/** Following are required for Cancellable **/
|
||||
/**
|
||||
* Following are required for Cancellable
|
||||
**/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
@@ -61,15 +71,8 @@ public class McMMOPartyXpGainEvent extends Event implements Cancellable {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user