Various minor cleanup

This commit is contained in:
Jason Penilla 2021-06-28 02:13:48 -07:00 committed by Jason
parent 0c5fec4187
commit f7b7b93251
12 changed files with 29 additions and 21 deletions

View file

@ -46,6 +46,7 @@ public interface ProtoItemStack {
* Get whether this {@link ProtoItemStack} contains extra data besides the {@link Material}.
*
* @return whether there is extra data
* @since 1.5.0
*/
boolean hasExtraData();
@ -56,6 +57,7 @@ public interface ProtoItemStack {
* @param respectMaximumStackSize whether to respect the maximum stack size for the material
* @return the created {@link ItemStack}
* @throws IllegalArgumentException if the {@link ItemStack} could not be created, due to max stack size or other reasons
* @since 1.5.0
*/
@NonNull ItemStack createItemStack(int stackSize, boolean respectMaximumStackSize)
throws IllegalArgumentException;

View file

@ -47,6 +47,7 @@
*/
package cloud.commandframework.bukkit.internal;
import com.google.common.annotations.Beta;
import com.mojang.brigadier.arguments.ArgumentType;
import org.bukkit.NamespacedKey;
import org.checkerframework.checker.nullness.qual.NonNull;
@ -58,9 +59,12 @@ import java.util.Arrays;
/**
* A registry of the {@link ArgumentType}s provided by Minecraft.
*
* <p>
* This file is taken from MIT licensed code in commodore (https://github.com/lucko/commodore).
*
* <p>This is not API, and as such, may break, change, or be removed without any notice.</p>
*/
@Beta
public final class MinecraftArgumentTypes {
private MinecraftArgumentTypes() {
@ -116,7 +120,9 @@ public final class MinecraftArgumentTypes {
* @throws IllegalArgumentException if no such argument is registered
*/
@SuppressWarnings("unchecked")
public static Class<? extends ArgumentType<?>> getClassByKey(final @NonNull NamespacedKey key) throws IllegalArgumentException {
public static Class<? extends ArgumentType<?>> getClassByKey(
final @NonNull NamespacedKey key
) throws IllegalArgumentException {
try {
Object minecraftKey = MINECRAFT_KEY_CONSTRUCTOR.newInstance(key.getNamespace(), key.getKey());
Object entry = ARGUMENT_REGISTRY_GET_BY_KEY_METHOD.invoke(null, minecraftKey);

View file

@ -22,6 +22,6 @@
// SOFTWARE.
//
/**
* cloud implementation for Bukkit 1.8-1.16
* cloud implementation for Bukkit 1.8-1.17
*/
package cloud.commandframework.bukkit;