PaperMC/paper-server/nms-patches/net/minecraft/util/InclusiveRange.patch
CraftBukkit/Spigot 43702a9e10 Update to Minecraft 1.18-pre5
By: md_5 <git@md-5.net>
2021-11-22 09:00:00 +11:00

47 lines
1.5 KiB
Diff

--- a/net/minecraft/util/InclusiveRange.java
+++ b/net/minecraft/util/InclusiveRange.java
@@ -4,19 +4,23 @@
import com.mojang.serialization.DataResult;
import java.util.function.Function;
-public final class InclusiveRange extends Record {
+// CraftBukkit start - decompile error
+public final record InclusiveRange<T extends Comparable<T>>(T minInclusive, T maxInclusive) {
+ /*
private final T minInclusive;
private final T maxInclusive;
+ */
public static final Codec<InclusiveRange<Integer>> INT = codec(Codec.INT);
- public InclusiveRange(T t0, T t1) {
- if (t0.compareTo(t1) > 0) {
+ public InclusiveRange(T minInclusive, T maxInclusive) {
+ if (minInclusive.compareTo(maxInclusive) > 0) {
throw new IllegalArgumentException("min_inclusive must be less than or equal to max_inclusive");
} else {
- this.minInclusive = t0;
- this.maxInclusive = t1;
+ this.minInclusive = minInclusive;
+ this.maxInclusive = maxInclusive;
}
+ // CraftBukkit end
}
public static <T extends Comparable<T>> Codec<InclusiveRange<T>> codec(Codec<T> codec) {
@@ -47,6 +51,8 @@
return "[" + this.minInclusive + ", " + this.maxInclusive + "]";
}
+ // CraftBukkit start
+ /*
public final int hashCode() {
return this.hashCode < invokedynamic > (this);
}
@@ -62,4 +68,6 @@
public T maxInclusive() {
return this.maxInclusive;
}
+ */
+ // CraftBukkit end
}