Fix NPE with enchantable (#11557)

This commit is contained in:
Lulu13022002
2024-11-09 23:26:01 +01:00
parent bbc8fc8fec
commit 16f8d0f984
41 changed files with 161 additions and 110 deletions

View File

@@ -51,7 +51,7 @@ import org.bukkit.entity.WanderingTrader;
import org.bukkit.entity.Wither;
import org.bukkit.entity.Wolf;
import org.bukkit.entity.Zombie;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for Mob Goals.
@@ -67,6 +67,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.3")
@NullMarked
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);
@@ -440,8 +441,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);
private static <T extends Mob> @NonNull GoalKey<T> create(final @NonNull String key,
final @NonNull Class<T> type) {
private static <T extends Mob> GoalKey<T> create(final String key, final Class<T> type) {
return GoalKey.of(type, NamespacedKey.minecraft(key));
}
}