mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2026-04-07 16:36:13 +00:00
Addons + Commands on teleport event
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package me.SuperRonanCraft.BetterRTP.references.customEvents;
|
||||
|
||||
public interface RTPEvent {
|
||||
//Used purely to grab these classes during runtime without distinct class reference
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package me.SuperRonanCraft.BetterRTP.references.customEvents;
|
||||
|
||||
public enum RTPEvents {
|
||||
CANCELLED(RTP_CancelledEvent.class),
|
||||
COMMAND(RTP_CommandEvent.class),
|
||||
FINDLOCATION(RTP_FindLocationEvent.class),
|
||||
TELEPORT(RTP_TeleportEvent.class),
|
||||
TELEPORTPOST(RTP_TeleportPostEvent.class),
|
||||
TELEPORTPRE(RTP_TeleportPreEvent.class);
|
||||
|
||||
public Class cl;
|
||||
|
||||
RTPEvents(Class cl) {
|
||||
this.cl = cl;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class RTP_CancelledEvent extends Event {
|
||||
public class RTP_CancelledEvent extends Event implements RTPEvent { //Called when a delayed rtp is cancelled cause player moved
|
||||
|
||||
Player p;
|
||||
private static final HandlerList handler = new HandlerList();
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class RTP_CommandEvent extends Event {
|
||||
public class RTP_CommandEvent extends Event implements RTPEvent {
|
||||
|
||||
CommandSender sendi;
|
||||
RTPCommand cmd;
|
||||
|
||||
@@ -3,12 +3,15 @@ package me.SuperRonanCraft.BetterRTP.references.customEvents;
|
||||
import me.SuperRonanCraft.BetterRTP.references.worlds.RTPWorld;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class RTP_FindLocationEvent {
|
||||
public class RTP_FindLocationEvent extends Event implements RTPEvent {
|
||||
|
||||
Player p;
|
||||
RTPWorld world;
|
||||
Location loc = null;
|
||||
private static final HandlerList handler = new HandlerList();
|
||||
|
||||
public RTP_FindLocationEvent(Player p, RTPWorld world) {
|
||||
this.p = p;
|
||||
@@ -30,4 +33,13 @@ public class RTP_FindLocationEvent {
|
||||
public Player getPlayer() {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handler;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handler;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class RTP_TeleportEvent extends Event {
|
||||
public class RTP_TeleportEvent extends Event implements RTPEvent {
|
||||
|
||||
Player p;
|
||||
Location loc;
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class RTP_TeleportPostEvent extends Event {
|
||||
public class RTP_TeleportPostEvent extends Event implements RTPEvent {
|
||||
|
||||
Player p;
|
||||
Location loc;
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class RTP_TeleportPreEvent extends Event {
|
||||
public class RTP_TeleportPreEvent extends Event implements RTPEvent { //Called upon every rtp call, does not mean player will be teleported
|
||||
|
||||
Player p;
|
||||
private static final HandlerList handler = new HandlerList();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
main: me.SuperRonanCraft.BetterRTP.BetterRTP
|
||||
version: '3.0.4-1'
|
||||
version: '3.0.5'
|
||||
name: BetterRTP
|
||||
author: SuperRonanCraft
|
||||
softdepend:
|
||||
|
||||
Reference in New Issue
Block a user