bow can now only be used after fight begin
Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
92c519f445
Commit
f5b1f23b63
@ -87,6 +87,7 @@ public class FightSystem extends JavaPlugin {
|
|||||||
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);
|
pm.registerEvents(new PlayerTeleportListener(), plugin);
|
||||||
|
pm.registerEvents(new ProjectileLaunchListener(), plugin);
|
||||||
|
|
||||||
//WinConditions
|
//WinConditions
|
||||||
if(Config.AllDead) pm.registerEvents(new WinconditionAllDead(), plugin);
|
if(Config.AllDead) pm.registerEvents(new WinconditionAllDead(), plugin);
|
||||||
|
24
src/me/yaruma/fightsystem/listener/ProjectileLaunchListener.java
Normale Datei
24
src/me/yaruma/fightsystem/listener/ProjectileLaunchListener.java
Normale Datei
@ -0,0 +1,24 @@
|
|||||||
|
package me.yaruma.fightsystem.listener;
|
||||||
|
|
||||||
|
import me.yaruma.fightsystem.FightSystem;
|
||||||
|
import me.yaruma.fightsystem.fight.FightState;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||||
|
|
||||||
|
public class ProjectileLaunchListener implements Listener {
|
||||||
|
|
||||||
|
FightSystem instance = FightSystem.getPlugin();
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void handleProjectileLaunch(ProjectileLaunchEvent event) {
|
||||||
|
Player player = (Player) event.getEntity().getShooter();
|
||||||
|
if(instance.getFightState() != FightState.RUNNING) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage(FightSystem.PREFIX + "§cDu kannst den Bogen erst nach Fightbeginn nutzen!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren