closed security leak (gm3 teleport)
Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
1fd4bb48f8
Commit
42cf7ecd13
@ -87,6 +87,7 @@ public class FightSystem extends JavaPlugin {
|
|||||||
pm.registerEvents(new PlayerRespawnListener(), plugin);
|
pm.registerEvents(new PlayerRespawnListener(), plugin);
|
||||||
pm.registerEvents(new EntityDamageListener(), plugin);
|
pm.registerEvents(new EntityDamageListener(), plugin);
|
||||||
pm.registerEvents(new EntityExplodeListener(), plugin);
|
pm.registerEvents(new EntityExplodeListener(), plugin);
|
||||||
|
pm.registerEvents(new PlayerTeleportListener(), plugin);
|
||||||
|
|
||||||
//WinConditions
|
//WinConditions
|
||||||
if(Config.AllDead) pm.registerEvents(new WinconditionAllDead(), plugin);
|
if(Config.AllDead) pm.registerEvents(new WinconditionAllDead(), plugin);
|
||||||
|
22
src/me/yaruma/fightsystem/listener/PlayerTeleportListener.java
Normale Datei
22
src/me/yaruma/fightsystem/listener/PlayerTeleportListener.java
Normale Datei
@ -0,0 +1,22 @@
|
|||||||
|
package me.yaruma.fightsystem.listener;
|
||||||
|
|
||||||
|
import me.yaruma.fightsystem.FightSystem;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
|
|
||||||
|
public class PlayerTeleportListener implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onTpGM3(PlayerTeleportEvent e) {
|
||||||
|
if (e.getPlayer().hasPermission("bukkit.command.teleport")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (e.getCause() == PlayerTeleportEvent.TeleportCause.SPECTATE) {
|
||||||
|
e.setCancelled(true);
|
||||||
|
e.getPlayer().sendMessage(FightSystem.PREFIX + "§cDu darfst die GM3 Teleportfunktion nicht benutzen!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren