SteamWar/FightSystem
Archiviert
13
1

Merge pull request 'Dragonegg Teleport' (#356) from Dragonegg_teleport into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #356
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2022-07-03 16:10:35 +02:00
Commit 49caee0c0b

Datei anzeigen

@ -29,10 +29,12 @@ import de.steamwar.fightsystem.states.FightState;
import de.steamwar.fightsystem.states.StateDependentListener; import de.steamwar.fightsystem.states.StateDependentListener;
import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.ChatMessageType;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.entity.SpawnerSpawnEvent; import org.bukkit.event.entity.SpawnerSpawnEvent;
@ -147,4 +149,19 @@ public class Permanent implements Listener {
if(!Config.ArenaLeaveable) if(!Config.ArenaLeaveable)
e.getWorld().setAutoSave(false); e.getWorld().setAutoSave(false);
} }
@EventHandler
public void onBlockFromTo(BlockFromToEvent event) {
if(!event.getBlock().getType().equals(Material.DRAGON_EGG)) return;
for (FightTeam team : Fight.teams()) {
if(team.getExtendRegion().inRegion(event.getBlock())){
if(team.getExtendRegion().inRegion(event.getToBlock())) return;
}
}
event.setCancelled(true);
}
} }