Dieser Commit ist enthalten in:
Commit
f6a70fafb2
@ -19,13 +19,18 @@
|
||||
|
||||
package de.steamwar.lobby.listener;
|
||||
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.command.ModifyCommand;
|
||||
import org.bukkit.Bukkit;
|
||||
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.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class InventoryInteraction extends BasicListener {
|
||||
@ -37,7 +42,9 @@ public class InventoryInteraction extends BasicListener {
|
||||
return;
|
||||
|
||||
if(item.getType() == Material.FIREWORK_ROCKET && (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)) {
|
||||
item.setAmount(2);
|
||||
Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> {
|
||||
event.getPlayer().getInventory().setItem(PlayerSpawn.FIREWORK_SLOT, PlayerSpawn.FIREWORK);
|
||||
}, 1L);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,12 @@ import org.bukkit.inventory.PlayerInventory;
|
||||
|
||||
public class PlayerSpawn extends BasicListener {
|
||||
|
||||
public static final int FIREWORK_SLOT = 3;
|
||||
public static final ItemStack FIREWORK = new ItemBuilder(Material.FIREWORK_ROCKET, 1).setDisplayName("§5Rakete").build();
|
||||
public static final int PARTICLE_SLOT = 5;
|
||||
public static final ItemStack PARTICLE = new ItemBuilder(Material.NAME_TAG).setDisplayName("§6Partikel").setUnbreakable(true).removeAllAttributes().build();
|
||||
private static final ItemStack ELYTRA = new ItemBuilder(Material.ELYTRA).setDisplayName("§5Elytra").setUnbreakable(true).removeAllAttributes().build();
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onJoin(PlayerJoinEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
@ -52,17 +58,14 @@ public class PlayerSpawn extends BasicListener {
|
||||
Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> new ImALobbyPacket().send(player), 20);
|
||||
}
|
||||
|
||||
private static final ItemStack ELYTRA = new ItemBuilder(Material.ELYTRA).setDisplayName("§5Elytra").setUnbreakable(true).removeAllAttributes().build();
|
||||
public static final ItemStack PARTICLE = new ItemBuilder(Material.NAME_TAG).setDisplayName("§6Partikel").setUnbreakable(true).removeAllAttributes().build();
|
||||
|
||||
private void giveItems(Player player) {
|
||||
PlayerInventory inventory = player.getInventory();
|
||||
|
||||
inventory.setItem(EquipmentSlot.CHEST, ELYTRA);
|
||||
|
||||
player.getInventory().setItem(3, new ItemBuilder(Material.FIREWORK_ROCKET, 1).setDisplayName("§5Rakete").build());
|
||||
player.getInventory().setItem(FIREWORK_SLOT, FIREWORK);
|
||||
|
||||
player.getInventory().setItem(5, PARTICLE);
|
||||
player.getInventory().setItem(PARTICLE_SLOT, PARTICLE);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren