Dieser Commit ist enthalten in:
Ursprung
66a6396e43
Commit
5ae758fe34
@ -33,6 +33,9 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
|
|||||||
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.Month;
|
||||||
|
|
||||||
public class InventoryInteraction extends BasicListener {
|
public class InventoryInteraction extends BasicListener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -42,8 +45,17 @@ public class InventoryInteraction extends BasicListener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(item.getType() == Material.FIREWORK_ROCKET && (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)) {
|
if(item.getType() == Material.FIREWORK_ROCKET && (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)) {
|
||||||
|
int offset;
|
||||||
|
LocalDate localDate = LocalDate.now();
|
||||||
|
Month month = localDate.getMonth();
|
||||||
|
if (month == Month.NOVEMBER || month == Month.DECEMBER || month == Month.JANUARY) {
|
||||||
|
offset = -1;
|
||||||
|
} else {
|
||||||
|
offset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> {
|
Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> {
|
||||||
event.getPlayer().getInventory().setItem(PlayerSpawn.FIREWORK_SLOT, PlayerSpawn.FIREWORK);
|
event.getPlayer().getInventory().setItem(PlayerSpawn.FIREWORK_SLOT + offset, PlayerSpawn.FIREWORK);
|
||||||
}, 1L);
|
}, 1L);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren