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

@@ -1,8 +1,8 @@
package org.bukkit;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import java.util.Map;
import org.apache.commons.lang.Validate;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -127,7 +127,7 @@ public class Note {
* value. The value has to be in the interval [0;&nbsp;24].
*/
public Note(int note) {
Validate.isTrue(note >= 0 && note <= 24, "The note value has to be between 0 and 24.");
Preconditions.checkArgument(note >= 0 && note <= 24, "The note value has to be between 0 and 24.");
this.note = (byte) note;
}
@@ -161,7 +161,7 @@ public class Note {
*/
@NotNull
public static Note flat(int octave, @NotNull Tone tone) {
Validate.isTrue(octave != 2, "Octave cannot be 2 for flats");
Preconditions.checkArgument(octave != 2, "Octave cannot be 2 for flats");
tone = tone == Tone.G ? Tone.F : Tone.values()[tone.ordinal() - 1];
return new Note(octave, tone, tone.isSharpable());
}
@@ -188,7 +188,7 @@ public class Note {
*/
@NotNull
public static Note natural(int octave, @NotNull Tone tone) {
Validate.isTrue(octave != 2, "Octave cannot be 2 for naturals");
Preconditions.checkArgument(octave != 2, "Octave cannot be 2 for naturals");
return new Note(octave, tone, false);
}
@@ -197,7 +197,7 @@ public class Note {
*/
@NotNull
public Note sharped() {
Validate.isTrue(note < 24, "This note cannot be sharped because it is the highest known note!");
Preconditions.checkArgument(note < 24, "This note cannot be sharped because it is the highest known note!");
return new Note(note + 1);
}
@@ -206,7 +206,7 @@ public class Note {
*/
@NotNull
public Note flattened() {
Validate.isTrue(note > 0, "This note cannot be flattened because it is the lowest known note!");
Preconditions.checkArgument(note > 0, "This note cannot be flattened because it is the lowest known note!");
return new Note(note - 1);
}