More 1.14 work
This commit is contained in:
@@ -9,7 +9,7 @@ object identity checks safely.
|
||||
Use a simpler optimized hashcode
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockState.java b/src/main/java/net/minecraft/server/BlockState.java
|
||||
index d95c0955a9..ea0e0ff4fe 100644
|
||||
index 77b25317a..be7e10d85 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockState.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockState.java
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockState<T extends Comparable<T>> implements IBlockState
|
||||
@@ -28,7 +28,7 @@ index d95c0955a9..ea0e0ff4fe 100644
|
||||
+ return this == object; // Paper - only one instance per configuration
|
||||
}
|
||||
|
||||
+ private static java.util.concurrent.atomic.AtomicInteger hashId = new java.util.concurrent.atomic.AtomicInteger(1);// Paper - only one instance per configuration
|
||||
+ private static final java.util.concurrent.atomic.AtomicInteger hashId = new java.util.concurrent.atomic.AtomicInteger(1); // Paper - only one instance per configuration
|
||||
+ private final int hashCode = 92821 * hashId.getAndIncrement(); // Paper - only one instance per configuration
|
||||
public final int hashCode() {
|
||||
- if (this.c == null) {
|
||||
@@ -36,44 +36,47 @@ index d95c0955a9..ea0e0ff4fe 100644
|
||||
- }
|
||||
-
|
||||
- return this.c;
|
||||
+ return hashCode; // Paper - only one instance per configuration
|
||||
+ return this.hashCode; // Paper - only one instance per configuration
|
||||
}
|
||||
|
||||
public int c() {
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockStateBoolean.java b/src/main/java/net/minecraft/server/BlockStateBoolean.java
|
||||
index 4c1d39d67c..71d2ad9703 100644
|
||||
index 31cb8ac84..3f085c7d6 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockStateBoolean.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockStateBoolean.java
|
||||
@@ -0,0 +0,0 @@ public class BlockStateBoolean extends BlockState<Boolean> {
|
||||
return obool.toString();
|
||||
}
|
||||
|
||||
- @Override
|
||||
- public boolean equals(Object object) {
|
||||
+ public boolean equals_unused(Object object) { // Paper
|
||||
if (this == object) {
|
||||
return true;
|
||||
} else if (object instanceof BlockStateBoolean && super.equals(object)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
|
||||
index 986b9ccea8..facbf30b4e 100644
|
||||
index 59d86fc66..82a1fac6f 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java
|
||||
@@ -0,0 +0,0 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends BlockState<T>
|
||||
return ((INamable) t0).getName();
|
||||
}
|
||||
|
||||
- @Override
|
||||
- public boolean equals(Object object) {
|
||||
+ public boolean equals_unused(Object object) { // Paper
|
||||
if (this == object) {
|
||||
return true;
|
||||
} else if (object instanceof BlockStateEnum && super.equals(object)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockStateInteger.java b/src/main/java/net/minecraft/server/BlockStateInteger.java
|
||||
index 2f12e15e07..613cd0bce2 100644
|
||||
index 6861c2b05..74ef69952 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockStateInteger.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockStateInteger.java
|
||||
@@ -0,0 +0,0 @@ public class BlockStateInteger extends BlockState<Integer> {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
- @Override
|
||||
- public boolean equals(Object object) {
|
||||
+ public boolean equals_unused(Object object) { // Paper
|
||||
if (this == object) {
|
||||
|
||||
Reference in New Issue
Block a user