Interface DropType


public interface DropType
  • Method Details

    • getId

      String getId()
      Returns the identifier for this type.
      Returns:
      The identifier
    • getName

      default String getName()
      Returns getConfigName(), but formats it into the default configured language.
      Returns:
      The name in the default language
    • getName

      String getName(@Nullable @Nullable CommandSender sender)
      Returns getConfigName(), but formats it and translates it to the given sender.
      Parameters:
      sender - The person from which it should look up the language. Null if it should take the default language
      Returns:
      The name in the language of the sender
    • getName

      String getName(@Nullable @Nullable CommandSender sender, int amount)
      Returns getConfigName() or getConfigPluralName(), depending on the amount but formats it and translates it to the given sender.
      Parameters:
      sender - The person from which it should look up the language. Null if it should take the default language
      amount - used to desied if the plural or non-plural name should be sent
      Returns:
      The name in the language of the sender
    • getPluralName

      default String getPluralName()
      Returns getConfigPluralName(), but formats it into the default configured language.
      Returns:
      The plural name in the default language
    • getPluralName

      String getPluralName(@Nullable @Nullable CommandSender sender)
      Returns getConfigPluralName(), but formats it and translates it to the given sender.
      Parameters:
      sender - The person from which it should look up the language. Null if it should take the default language
      Returns:
      The plural name in the language of the sender
    • getConfigName

      String getConfigName()
      Returns the name of the spawner exactly the same as it has been configured.
      Returns:
      The raw name
    • getConfigPluralName

      String getConfigPluralName()
      Returns the plural name of the spawner exactly the same as it has been configured.
      Returns:
      The raw plural name
    • setConfigName

      void setConfigName(String name)
      Set the unformatted name of the config.
      Parameters:
      name - The new raw name
    • setConfigPluralName

      void setConfigPluralName(String name)
      Set the unformatted plural name of the config.
      Parameters:
      name - The new raw plural name
    • getDroppingMaterials

      ItemStack[] getDroppingMaterials()
      Returns the materials that will be dropped.
      Returns:
      The dropping materials
    • getConfigDroppingMaterials

      ItemStack[] getConfigDroppingMaterials()
      Returns the original materials as they were configured. Doesn't contain any included name and etc.
      Returns:
      The original dropping materials
    • setConfigDroppingMaterials

      void setConfigDroppingMaterials(ItemStack[] droppingMaterials)
      Set the items that will be dropped.
      Parameters:
      droppingMaterials - The new materials
    • setIcon

      void setIcon(ItemStack icon)
      Set the icon that will be shown inside GUIs.
      Parameters:
      icon - The new icon
    • getIcon

      ItemStack getIcon()
      Returns the item that shall be shown in GUIs.
      Returns:
      The icon
    • getDropDuration

      double getDropDuration()
      Returns the interval between the spawns in seconds.

      Keep in mind that this might differ with an actual spawner as their duration is modifiable during a match. Use Spawner.getCurrentDropDuration() to return the actual value of a match.

      Returns:
      The general spawn duration
    • setDropDuration

      void setDropDuration(double dropDuration)
      Set the interval between the spawns in seconds.

      Keep in mind that this might differ with an actual spawner as their duration is modifiable during a match. Use Spawner.getCurrentDropDuration() to return the actual value of a match.

      Parameters:
      dropDuration - The new general spawn duration
    • getSpawnSound

      @Nullable @Nullable VarSound getSpawnSound()
      The sound that should be played whenever it drops something. Returns null if it doesn't play any sound.
      Returns:
      The sound it plays
    • setSpawnSound

      void setSpawnSound(@Nullable @Nullable VarSound sound)
      Set the sound that it should play whenever it drops something. Pass null when you don't want it to play anything.
      Parameters:
      sound - The new sound it shall play whenever it drops something
    • getSpawnEffect

      @Nullable @Nullable VarParticle getSpawnEffect()
      The effect that should be played whenever it drops something. Returns null if it doesn't play anything.
      Returns:
      The effect it plays
    • setSpawnEffect

      void setSpawnEffect(@Nullable @Nullable VarParticle particle)
      Set the effect that it should play whenever it drops something. Pass null when you don't want it to play anything.
      Parameters:
      particle - The new effect it shall play whenever it drops something
    • getSpawnRadius

      int getSpawnRadius()
      Get the radius in which the item may randomly spawns. The center is the set Location at Spawner.getLocation().
      Returns:
      The spawn radius
    • setSpawnRadius

      void setSpawnRadius(int radius)
      Set the radius in which the item may randomly spawns. The center is the set Location at Spawner.getLocation().
      Parameters:
      radius - The new spawn raadius
    • isTranquil

      boolean isTranquil()
      Returns whether or not the item is tranquil. true means that it will stay at it's location and won't fly away in the x and z directions.
      Returns:
      If it's tranquil or not
    • setTranquil

      void setTranquil(boolean tranquil)
      Set whether the item is tranquil or not. true means that it will stay at it's location and won't fly away in the x and z directions.
      Parameters:
      tranquil - The new tranquil value
    • isMerging

      boolean isMerging()
      Returns whether or not it merges with other items.

      It does that by giving every item an unique lore, which prevents it from merging with other items. MBedwars will nevertheless merge them when there are too many items at the spawn location to prevent lag.

      Returns:
      Whether or not it merges with other items
    • setMerging

      void setMerging(boolean merge)
      Set whether or not it should merge with other items.

      It does that by giving every item an unique lore, which prevents it from merging with other items. MBedwars will nevertheless merge them when there are too many items at the spawn location to prevent lag.

      Parameters:
      merge - The new merge value
    • getHologramMaterial

      @Nullable @Nullable ItemStack getHologramMaterial()
      The material of the hologram that will be shown above the spawner ingame. null means that none will be spawned.
      Returns:
      The material of the hologram
    • setHologramMaterial

      void setHologramMaterial(@Nullable @Nullable ItemStack material)
      Set the material of the hologram that will be shown above the spawner ingame. null means that none will be spawned.
      Parameters:
      material - The new material of the hologram
    • getMaxNearbyItems

      int getMaxNearbyItems()
      Returns the max amount of items that can be near the spawner until it's stops spawning any further. 0 or less if there's no limit.
      Returns:
      Max amount of nearby laying items till it stops spawning any further
    • setMaxNearbyItems

      void setMaxNearbyItems(int maxNearby)
      Set the amount of items that can lay near the spawner until it stops spawning more items. 0 or less to set no limit.
      Parameters:
      maxNearby - Max amount of nearby laying items till it stops spawning any further
    • getCustomHandlerId

      @Nullable @Nullable String getCustomHandlerId()
      Returns the id of the custom handler.

      This method can return a non-null value even if getCustomHandler() returns null as the custom handler might hasn't been registered yet.

      Returns:
      The id of the custom handler
    • setCustomHandlerId

      void setCustomHandlerId(String id)
      Changes the id of the custom handler. Will also automatically update the setCustomHandler(CustomSpawnerHandler) when the custom handler has been found.
      Parameters:
      id - The new id
    • getCustomHandler

      @Nullable @Nullable CustomSpawnerHandler getCustomHandler()
      Returns a custom handler that'll overtake the spawning process. Materials will get dropped as usual when it returns null
      Returns:
      The custom spawning handler
      Throws:
      IllegalStateException - If the handler hasn't been registered yet with GameAPI.registerCustomSpawnerHandler(CustomSpawnerHandler)
    • setCustomHandler

      void setCustomHandler(@Nullable @Nullable CustomSpawnerHandler handler)
      Changes the custom handler that'll overtake the spawning process. Make sure that the given handler is registered, otherwise no change will be applied.

      Materials will continue to drop as usual when setting null. It'll also automatically update setCustomHandlerId(String).

      Parameters:
      handler - The new custom handler
    • getHoldingAmount

      int getHoldingAmount(Player player)
      Returns the amount of dropped spawners that the player is currently holding in his inventory.
      Parameters:
      player - The player we want to check
      Returns:
      The amount the player is holding
    • getHoldingAmount

      int getHoldingAmount(ItemStack[] inv)
      Returns the amount of dropped spawners that given inventory is holding.
      Parameters:
      inv - The inventory we want to check
      Returns:
      The amount the inventory is currently holding
    • isRegistered

      boolean isRegistered()
      Returns whether or not it has been added to the registry.
      Returns:
      If it has been added to the mbedwars system