#919: Add internal ItemType and BlockType, delegate Material methods to them

By: Jishuna <joshl5324@gmail.com>
Also-by: Bjarne Koll <lynxplay101@gmail.com>
Also-by: DerFrZocker <derrieple@gmail.com>
Also-by: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2024-05-05 10:08:51 +10:00
parent ba1db8acb9
commit fc9e5af885
6 changed files with 6165 additions and 6037 deletions

View File

@@ -4,7 +4,9 @@ import java.util.Collection;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.World;
import org.bukkit.block.BlockType;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -59,6 +61,28 @@ public interface DataPackManager {
*/
public boolean isEnabledByFeature(@NotNull Material material, @NotNull World world);
/**
* Gets if the ItemType is enabled for use by the features in World.
*
* @param itemType ItemType to check
* @param world World to check
* @return {@code True} if the ItemType is enabled
* @apiNote this method is not ready for public usage yet
*/
@ApiStatus.Internal
public boolean isEnabledByFeature(@NotNull ItemType itemType, @NotNull World world);
/**
* Gets if the BlockType is enabled for use by the features in World.
*
* @param blockType BlockType to check
* @param world World to check
* @return {@code True} if the BlockType is enabled
* @apiNote this method is not ready for public usage yet
*/
@ApiStatus.Internal
public boolean isEnabledByFeature(@NotNull BlockType blockType, @NotNull World world);
/**
* Gets if the EntityType is enabled for use by the Features in World.
*