Class TypeUtil
java.lang.Object
tech.guilhermekaua.spigotboot.core.spigot.utils.TypeUtil
- Author:
- Yuhtin Github: https://github.com/Yuhtin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.ItemStackconvertFromLegacy(String materialName, int damage) static org.bukkit.MaterialgetMaterialFromLegacy(String materialName) Resolves aMaterialfrom a config name, preferring the modern (non-legacy) material.static org.bukkit.MaterialswapLegacy(String material, String legacy)
-
Constructor Details
-
TypeUtil
public TypeUtil()
-
-
Method Details
-
swapLegacy
-
convertFromLegacy
-
getMaterialFromLegacy
Resolves aMaterialfrom a config name, preferring the modern (non-legacy) material.The modern name is tried first so that names such as
BEDROCKresolve toMaterial.BEDROCKinstead ofLEGACY_BEDROCKon post-flattening servers (1.13+). Only when no modern material matches is aLEGACY_-prefixed lookup attempted, so that pre-1.13 names still resolve. On 1.8.8 (noLEGACY_*constants exist) the first lookup already returns the native material.- Parameters:
materialName- the material name from config, may be null or empty- Returns:
- the resolved material, or null if the name is null, empty, or unknown
-