content: package com.covercorp.kaelaevent.minigame.games.platformrush.inventory;
  
  import com.covercorp.kaelaevent.KaelaEvent;
  import com.covercorp.kaelaevent.inventory.GlobalGlyphItemCollection;
  import com.covercorp.kaelaevent.inventory.GlobalUtilityItemCollection;
  import com.covercorp.kaelaevent.minigame.games.platformrush.player.PlatformRushPlayer;
  import com.covercorp.kaelaevent.minigame.games.platformrush.team.PlatformRushTeam;
  import com.covercorp.kaelaevent.util.ItemBuilder;
  import com.covercorp.kaelaevent.util.PlayerUtils;
  import org.bukkit.Bukkit;
  import org.bukkit.GameMode;
  import org.bukkit.Material;
  import org.bukkit.enchantments.Enchantment;
  import org.bukkit.entity.Player;
  import org.bukkit.inventory.Inventory;
  import org.bukkit.inventory.ItemStack;
  
  public final class PlatformRushItemCollection {
      private final static String HOTBAR_ERROR_NULL_PLAYER = "Could not setup game hotbar for %s";
      private final static String HOTBAR_ERROR_TEAM = "<red>Can't setup your hotbar, you are not in a team!";
  
      private final static ItemStack SHOVEL_ITEM = new ItemBuilder(Material.DIAMOND_SHOVEL)
              .withName("&aPlatform Rush Shovel")
              .withNBTTag("accessor", "spleef_shovel")
              .withCustomModel(1)
              .setUnbreakable()
              .withEnchantment(Enchantment.EFFICIENCY, 5)
              .hideEnchantments()
              .hideStats()
              .build();
  
      public final static ItemStack SNOW_BALL = new ItemBuilder(Material.SNOWBALL)
              .withName("&aBlock-breaking Snowballs")
              .build();
  
      public static void setupPlayerHotBar(final PlatformRushPlayer gamePlayer) {
          final Player player = Bukkit.getPlayer(gamePlayer.getUniqueId());
  
          if (player == null) {
              KaelaEvent.getKaelaEvent().getLogger().severe(String.format(HOTBAR_ERROR_NULL_PLAYER, gamePlayer.getUniqueId()));
              return;
          }
  
          final PlatformRushTeam gameTeam = (PlatformRushTeam) gamePlayer.getMiniGameTeam();
          if (gameTeam == null) {
              player.sendMessage(KaelaEvent.getKaelaEvent().getMiniGame().getMiniMessage().deserialize(HOTBAR_ERROR_TEAM));
              return;
          }
  
          final Inventory inventory = player.getInventory();
  
          player.getEquipment().setHelmet(GlobalGlyphItemCollection.BIRTHDAY_HAT_ITEM);
  
          inventory.setItem(0, SHOVEL_ITEM);
  
          if (PlayerUtils.isCool(player)) {
              inventory.setItem(7, GlobalUtilityItemCollection.START_GAME_ITEM);
              inventory.setItem(8, GlobalUtilityItemCollection.STOP_GAME_ITEM);
          }
      }
  
      public static void resetPlayerHotBar(final PlatformRushPlayer gamePlayer) {
          final Player player = Bukkit.getPlayer(gamePlayer.getUniqueId());
  
          if (player == null) {
              KaelaEvent.getKaelaEvent().getLogger().severe(String.format(HOTBAR_ERROR_NULL_PLAYER, gamePlayer.getUniqueId()));
              return;
          }
  
          player.setExp(0);
          player.setLevel(0);
          player.setGameMode(GameMode.ADVENTURE);
          player.setHealth(20);
          player.setFoodLevel(20);
          player.setSaturation(20);
          player.getActivePotionEffects().forEach(potionEffect -> player.removePotionEffect(potionEffect.getType()));
  
          final Inventory inventory = player.getInventory();
  
          inventory.clear();
  
          player.getEquipment().setHelmet(GlobalGlyphItemCollection.BIRTHDAY_HAT_ITEM);
  
          if (PlayerUtils.isCool(player)) {
              inventory.setItem(7, GlobalUtilityItemCollection.START_GAME_ITEM);
              inventory.setItem(8, GlobalUtilityItemCollection.STOP_GAME_ITEM);
          }
      }
  }
  