Dieser Commit ist enthalten in:
Ursprung
ed5a0fbd7c
Commit
aae9b0c267
@ -23,6 +23,7 @@ import de.steamwar.lobby.command.ModifyCommand;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -32,20 +33,18 @@ public class InventoryInteraction extends BasicListener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void handlePlayerInteract(PlayerInteractEvent event) {
|
public void handlePlayerInteract(PlayerInteractEvent event) {
|
||||||
ItemStack item = event.getItem();
|
ItemStack item = event.getItem();
|
||||||
if(item == null || item.getType() == Material.FIREWORK_ROCKET)
|
if(item == null)
|
||||||
return;
|
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()))
|
if(!ModifyCommand.modifying(event.getPlayer()))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void handleItemConsume(PlayerItemConsumeEvent event) {
|
|
||||||
ItemStack item = event.getItem();
|
|
||||||
if (item.getType() == Material.FIREWORK_ROCKET)
|
|
||||||
item.setAmount(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void handlePlayerDropItem(PlayerDropItemEvent event) {
|
public void handlePlayerDropItem(PlayerDropItemEvent event) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -215,7 +215,7 @@ public class FightserverPortal implements PortalHandler, Comparable<FightserverP
|
|||||||
case "PRE_RUNNING":
|
case "PRE_RUNNING":
|
||||||
return "Kampfbeginn in";
|
return "Kampfbeginn in";
|
||||||
case "RUNNING":
|
case "RUNNING":
|
||||||
return "Kampf läuft noch";
|
return "Kampf läuft";
|
||||||
case "end":
|
case "end":
|
||||||
case "SPECTATE":
|
case "SPECTATE":
|
||||||
return "Zuschauerphase";
|
return "Zuschauerphase";
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren