Updated DragonTeleport in Permanent class
Dieser Commit ist enthalten in:
Ursprung
9774b28d57
Commit
c245f4c2ba
@ -77,7 +77,6 @@ public class FightSystem extends JavaPlugin {
|
||||
new DenyInventoryMovement();
|
||||
new EventJoin();
|
||||
new Recording();
|
||||
new BlockFromToListener();
|
||||
//new ResourcePack();
|
||||
new Check();
|
||||
new Shutdown();
|
||||
|
@ -1,31 +0,0 @@
|
||||
package de.steamwar.fightsystem.listener;
|
||||
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
|
||||
public class BlockFromToListener implements Listener {
|
||||
|
||||
public BlockFromToListener(){
|
||||
new StateDependentListener(ArenaMode.All, FightState.All, this);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBlockFromTo(BlockFromToEvent event) {
|
||||
if (Fight.getBlueTeam().getSchemRegion().inRegion(event.getBlock())
|
||||
&& Fight.getBlueTeam().getSchemRegion().inRegion(event.getToBlock())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Fight.getRedTeam().getSchemRegion().inRegion(event.getBlock())
|
||||
&& Fight.getRedTeam().getSchemRegion().inRegion(event.getToBlock())) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
@ -29,10 +29,12 @@ import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.SpawnerSpawnEvent;
|
||||
@ -147,4 +149,19 @@ public class Permanent implements Listener {
|
||||
if(!Config.ArenaLeaveable)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren