forked from BLOCKFANTASY/LOOHP-Limbo
reupload
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.loohp.limbo.events.player;
|
||||
|
||||
import com.loohp.limbo.events.Cancellable;
|
||||
import com.loohp.limbo.player.Player;
|
||||
|
||||
public class PlayerChatEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
private String prefix;
|
||||
private String message;
|
||||
private boolean cancelled;
|
||||
|
||||
public PlayerChatEvent(Player player, String prefix, String message, boolean cancelled) {
|
||||
super(player);
|
||||
this.prefix = prefix;
|
||||
this.message = message;
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
||||
public void setPrefix(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.loohp.limbo.events.player;
|
||||
|
||||
import com.loohp.limbo.events.Event;
|
||||
import com.loohp.limbo.player.Player;
|
||||
|
||||
public class PlayerEvent extends Event {
|
||||
|
||||
private Player player;
|
||||
|
||||
public PlayerEvent(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.loohp.limbo.events.player;
|
||||
|
||||
import com.loohp.limbo.location.Location;
|
||||
import com.loohp.limbo.player.Player;
|
||||
|
||||
public class PlayerJoinEvent extends PlayerEvent {
|
||||
|
||||
private Location spawnLocation;
|
||||
|
||||
public PlayerJoinEvent(Player player, Location spawnLoc) {
|
||||
super(player);
|
||||
spawnLocation = spawnLoc;
|
||||
}
|
||||
|
||||
public Location getSpawnLocation() {
|
||||
return spawnLocation;
|
||||
}
|
||||
|
||||
public void setSpawnLocation(Location spawnLocation) {
|
||||
this.spawnLocation = spawnLocation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.loohp.limbo.events.player;
|
||||
|
||||
import com.loohp.limbo.events.Cancellable;
|
||||
import com.loohp.limbo.events.Event;
|
||||
import com.loohp.limbo.server.ClientConnection;
|
||||
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
|
||||
public class PlayerLoginEvent extends Event implements Cancellable {
|
||||
|
||||
private ClientConnection connection;
|
||||
private boolean cancelled;
|
||||
private BaseComponent[] cancelReason;
|
||||
|
||||
public PlayerLoginEvent(ClientConnection connection, boolean cancelled, BaseComponent... cancelReason) {
|
||||
this.connection = connection;
|
||||
this.cancelled = cancelled;
|
||||
this.cancelReason = cancelReason;
|
||||
}
|
||||
|
||||
public ClientConnection getConnection() {
|
||||
return connection;
|
||||
}
|
||||
|
||||
public BaseComponent[] getCancelReason() {
|
||||
return cancelReason;
|
||||
}
|
||||
|
||||
public void setCancelReason(BaseComponent... cancelReason) {
|
||||
this.cancelReason = cancelReason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.loohp.limbo.events.player;
|
||||
|
||||
import com.loohp.limbo.events.Cancellable;
|
||||
import com.loohp.limbo.location.Location;
|
||||
import com.loohp.limbo.player.Player;
|
||||
|
||||
/**
|
||||
* Holds information for player movement events
|
||||
*/
|
||||
public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
private boolean cancel = false;
|
||||
private Location from;
|
||||
private Location to;
|
||||
|
||||
public PlayerMoveEvent(Player player, Location from, Location to) {
|
||||
super(player);
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
* <p>
|
||||
* If a move or teleport event is cancelled, the player will be moved or
|
||||
* teleported back to the Location as defined by getFrom(). This will not
|
||||
* fire an event
|
||||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
* <p>
|
||||
* If a move or teleport event is cancelled, the player will be moved or
|
||||
* teleported back to the Location as defined by getFrom(). This will not
|
||||
* fire an event
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
@Override
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location this player moved from
|
||||
*
|
||||
* @return Location the player moved from
|
||||
*/
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location to mark as where the player moved from
|
||||
*
|
||||
* @param from New location to mark as the players previous location
|
||||
*/
|
||||
public void setFrom(Location from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location this player moved to
|
||||
*
|
||||
* @return Location the player moved to
|
||||
*/
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location that this player will move to
|
||||
*
|
||||
* @param to New Location this player will move to
|
||||
*/
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.loohp.limbo.events.player;
|
||||
|
||||
import com.loohp.limbo.player.Player;
|
||||
|
||||
public class PlayerQuitEvent extends PlayerEvent {
|
||||
|
||||
public PlayerQuitEvent(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.loohp.limbo.events.player;
|
||||
|
||||
import com.loohp.limbo.events.Cancellable;
|
||||
import com.loohp.limbo.player.Player;
|
||||
|
||||
public class PlayerSelectedSlotChangeEvent extends PlayerEvent implements Cancellable {
|
||||
|
||||
private boolean cancel = false;
|
||||
private byte slot;
|
||||
|
||||
public PlayerSelectedSlotChangeEvent(Player player, byte slot) {
|
||||
super(player);
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancel = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
public byte getSlot() {
|
||||
return slot;
|
||||
}
|
||||
|
||||
public void setSlot(byte slot) {
|
||||
this.slot = slot;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.loohp.limbo.events.player;
|
||||
|
||||
import com.loohp.limbo.location.Location;
|
||||
import com.loohp.limbo.player.Player;
|
||||
|
||||
public class PlayerTeleportEvent extends PlayerMoveEvent {
|
||||
|
||||
public PlayerTeleportEvent(Player player, Location from, Location to) {
|
||||
super(player, from, to);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user