Dieser Commit ist enthalten in:
Ursprung
96b090b699
Commit
c1493be6c1
@ -77,6 +77,7 @@ public class FightSystem extends JavaPlugin {
|
|||||||
new DenyInventoryMovement();
|
new DenyInventoryMovement();
|
||||||
new EventJoin();
|
new EventJoin();
|
||||||
new Recording();
|
new Recording();
|
||||||
|
new BlockFromToListener();
|
||||||
//new ResourcePack();
|
//new ResourcePack();
|
||||||
new Check();
|
new Check();
|
||||||
new Shutdown();
|
new Shutdown();
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren