Update to Minecraft 1.19

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2022-06-08 02:00:00 +10:00
parent 9bfa9ca85b
commit ec575f5252
88 changed files with 1339 additions and 375 deletions

View File

@@ -205,6 +205,11 @@ public abstract class Enchantment implements Keyed {
*/
public static final Enchantment SOUL_SPEED = new EnchantmentWrapper("soul_speed");
/**
* Walk quicker while sneaking
*/
public static final Enchantment SWIFT_SNEAK = new EnchantmentWrapper("swift_sneak");
private static final Map<NamespacedKey, Enchantment> byKey = new HashMap<NamespacedKey, Enchantment>();
private static final Map<String, Enchantment> byName = new HashMap<String, Enchantment>();
private static boolean acceptingNew = true;

View File

@@ -1,6 +1,6 @@
package org.bukkit.enchantments;
import org.apache.commons.lang.Validate;
import com.google.common.base.Preconditions;
import org.jetbrains.annotations.NotNull;
/**
@@ -34,7 +34,7 @@ public class EnchantmentOffer {
* @param enchantment type of the enchantment
*/
public void setEnchantment(@NotNull Enchantment enchantment) {
Validate.notNull(enchantment, "The enchantment may not be null!");
Preconditions.checkArgument(enchantment != null, "The enchantment may not be null!");
this.enchantment = enchantment;
}
@@ -54,7 +54,7 @@ public class EnchantmentOffer {
* @param enchantmentLevel level of the enchantment
*/
public void setEnchantmentLevel(int enchantmentLevel) {
Validate.isTrue(enchantmentLevel > 0, "The enchantment level must be greater than 0!");
Preconditions.checkArgument(enchantmentLevel > 0, "The enchantment level must be greater than 0!");
this.enchantmentLevel = enchantmentLevel;
}
@@ -76,7 +76,7 @@ public class EnchantmentOffer {
* @param cost cost for this enchantment
*/
public void setCost(int cost) {
Validate.isTrue(cost > 0, "The cost must be greater than 0!");
Preconditions.checkArgument(cost > 0, "The cost must be greater than 0!");
this.cost = cost;
}