Additional methods in BlockData interfaces

XMLWordPrintable

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Minor
    • None
    • Affects Version/s: None
    • None
    • CraftBukkit version 4409-Spigot-33ece3e-e28af08 (MC: 1.21.4) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
    • Yes

      While implementing a small plugin that can (amongst other things) iterate over all possible block states, I noticed that some useful methods are missing from the API in BlockData interfaces.

      1. All integer properties should have a getMinimum<PropertyName>() in addition to getMaximum<PropertyName>() method. Reason: there is a general inconsistency. Some interfaces which do not have this method, can actually start at different values (for example: interface org.bukkit.block.data.Levelled is used for fluids and composters, which start at 0, and water and powder snow cauldron, which start at 1). Meanwhile, some interfaces which do have this method always start at the same value (for example: interface org.bukkit.block.data.type.Repeater has getMinimumDelay() method). And it would be useful to be able to check the minimum value of a property without having to look it up on wiki.
      Missing methods:

      • org.bukkit.block.data.Ageable, getMinimumAge
      • org.bukkit.block.data.AnaloguePowerable, getMinimumPower
      • org.bukkit.block.data.type.Beehive, getMinimumHoneyLevel
      • org.bukkit.block.data.Brushable, getMinimumDusted
      • org.bukkit.block.data.type.Cake, getMinimumBites
      • org.bukkit.block.data.type.Candle, getMinimumCandles
      • org.bukkit.block.data.type.Farmland, getMinimumMoisture
      • org.bukkit.block.data.Hatchable, getMinimumHatch
      • org.bukkit.block.data.type.Leaves, getMinimumDistance
      • org.bukkit.block.data.type.Leaves, getMaximumDistance
      • org.bukkit.block.data.Levelled, getMinimumLevel
      • org.bukkit.block.data.type.PinkPetals, getMinimumFlowerAmount
      • org.bukkit.block.data.type.RespawnAnchor, getMinimumCharges
      • org.bukkit.block.data.type.Sapling, getMinimumStage
      • org.bukkit.block.data.type.Scaffolding, getMinimumDistance

      2. When an enum is used, but not all values are accepted, there should be a method indicating which values are correct. This is already the case for most of the BlockData interfaces (for example: getFaces in org.bukkit.block.data.Directional, getAllowedFaces in org.bukkit.block.data.MultipleFacing), but I found some in which this method is missing:

      • org.bukkit.block.data.type.MossyCarpet, missing a method indicating which faces are accepted for setHeight
      • org.bukkit.block.data.Rotatable, missing a method indicating which faces are accepted for setRotation
      • org.bukkit.block.data.type.Wall, missing a method indicating which faces are accepted for setHeight

            Assignee:
            Unassigned
            Reporter:
            MikoĊ‚aj Nowak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: