13
0

Hotfix InventoryInteraction
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-11-30 20:28:00 +01:00
Ursprung 66a6396e43
Commit 5ae758fe34

Datei anzeigen

@ -33,6 +33,9 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
import org.bukkit.inventory.ItemStack;
import java.time.LocalDate;
import java.time.Month;
public class InventoryInteraction extends BasicListener {
@EventHandler
@ -42,8 +45,17 @@ public class InventoryInteraction extends BasicListener {
return;
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(), () -> {
event.getPlayer().getInventory().setItem(PlayerSpawn.FIREWORK_SLOT, PlayerSpawn.FIREWORK);
event.getPlayer().getInventory().setItem(PlayerSpawn.FIREWORK_SLOT + offset, PlayerSpawn.FIREWORK);
}, 1L);
return;
}