13
0

Fix fireworks
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2022-03-11 17:23:42 +01:00
Ursprung ed5a0fbd7c
Commit aae9b0c267
2 geänderte Dateien mit 8 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -23,6 +23,7 @@ import de.steamwar.lobby.command.ModifyCommand;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.*;
import org.bukkit.inventory.ItemStack;
@ -32,20 +33,18 @@ public class InventoryInteraction extends BasicListener {
@EventHandler
public void handlePlayerInteract(PlayerInteractEvent event) {
ItemStack item = event.getItem();
if(item == null || item.getType() == Material.FIREWORK_ROCKET)
if(item == null)
return;
if(item.getType() == Material.FIREWORK_ROCKET && (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)) {
item.setAmount(2);
return;
}
if(!ModifyCommand.modifying(event.getPlayer()))
event.setCancelled(true);
}
@EventHandler
public void handleItemConsume(PlayerItemConsumeEvent event) {
ItemStack item = event.getItem();
if (item.getType() == Material.FIREWORK_ROCKET)
item.setAmount(2);
}
@EventHandler
public void handlePlayerDropItem(PlayerDropItemEvent event) {
event.setCancelled(true);

Datei anzeigen

@ -215,7 +215,7 @@ public class FightserverPortal implements PortalHandler, Comparable<FightserverP
case "PRE_RUNNING":
return "Kampfbeginn in";
case "RUNNING":
return "Kampf läuft noch";
return "Kampf läuft";
case "end":
case "SPECTATE":
return "Zuschauerphase";