Update upstream B/CB/S
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Optimise BlockStateEnum hashCode and equals
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
|
||||
index 288c52c55..66c459d83 100644
|
||||
index 21ac1e06..a241d7d8 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>
|
||||
@@ -46,15 +46,23 @@ index 288c52c55..66c459d83 100644
|
||||
+ return this == object;
|
||||
}
|
||||
|
||||
+ @Override // Paper - override hashCode as BlockStateEnum is a singleton
|
||||
- // Spigot start
|
||||
- private int hashCode;
|
||||
+ @Override // Paper - override equals as BlockStateEnum is a singleton
|
||||
public int hashCode() {
|
||||
- int i = super.hashCode();
|
||||
- int hash = hashCode;
|
||||
- if (hash == 0) {
|
||||
- int i = super.hashCode();
|
||||
-
|
||||
- i = 31 * i + this.a.hashCode();
|
||||
- i = 31 * i + this.b.hashCode();
|
||||
- return i;
|
||||
- i = 31 * i + this.a.hashCode();
|
||||
- i = 31 * i + this.b.hashCode();
|
||||
- hashCode = hash = i;
|
||||
- }
|
||||
- return hash;
|
||||
+ return hashCode;
|
||||
}
|
||||
- // Spigot end
|
||||
|
||||
public static <T extends Enum<T> & INamable> BlockStateEnum<T> of(String s, Class<T> oclass) {
|
||||
return a(s, oclass, Predicates.alwaysTrue());
|
||||
--
|
||||
Reference in New Issue
Block a user