mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-30 05:53:35 +01:00
Adds Contract annotation to CompatibleMaterial#getMaterial
This commit is contained in:
parent
76b3dc6682
commit
72c96bc09a
@ -5,6 +5,7 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
@ -1542,6 +1543,7 @@ public enum CompatibleMaterial {
|
||||
*
|
||||
* @return LegacyMaterial or null if none found
|
||||
*/
|
||||
@Contract("_, !null -> !null")
|
||||
public static CompatibleMaterial getMaterial(String name, CompatibleMaterial def) {
|
||||
return name == null ? def : lookupMap.getOrDefault(name.toUpperCase(), def);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user