SteamWar/FightSystem
Archiviert
13
1

Hotfix flying in arena issue

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-06-04 13:27:28 +02:00
Ursprung eb6f45a485
Commit cf8f36630e
2 geänderte Dateien mit 7 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -228,18 +228,8 @@ public class FightTeam implements IFightTeam{
return ready;
}
private void allowFlying(boolean fly){
for(FightPlayer p : players){
if(p.getPlayer() != null){
p.getPlayer().setAllowFlight(fly);
p.getPlayer().setFlying(fly);
}
}
}
public void pasteSchematic(){
FreezeWorld freezer = new FreezeWorld();
allowFlying(true);
DyeColor c = ColorConverter.chat2dye(color);
EditSession e;
try {
@ -276,7 +266,6 @@ public class FightTeam implements IFightTeam{
broadcast(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic");
throw new SecurityException("Error pasting arena in schematic", ex);
}
allowFlying(false);
Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> HandlerList.unregisterAll(freezer), 3);
Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), this::teleportToSpawn,40);
}

Datei anzeigen

@ -13,6 +13,7 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryPickupItemEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerKickEvent;
import java.util.EnumSet;
@ -47,6 +48,12 @@ public class FreezeWorldStateListener extends BasicListener {
event.setCancelled(true);
}
@EventHandler
public void handlePlayerKickEvent(PlayerKickEvent e){
if(e.getReason().equals("Flying is not enabled on this server!"))
e.setCancelled(true);
}
@EventHandler
public void onInventoryDrag(InventoryDragEvent event) {
if(PersonalKitCreator.notInKitCreator(event.getWhoClicked()))