aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0102-Optimise-BlockState-s-hashCode-equals.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0102-Optimise-BlockState-s-hashCode-equals.patch')
-rw-r--r--patches/server/0102-Optimise-BlockState-s-hashCode-equals.patch21
1 files changed, 7 insertions, 14 deletions
diff --git a/patches/server/0102-Optimise-BlockState-s-hashCode-equals.patch b/patches/server/0102-Optimise-BlockState-s-hashCode-equals.patch
index b303f4e71f..313921f28d 100644
--- a/patches/server/0102-Optimise-BlockState-s-hashCode-equals.patch
+++ b/patches/server/0102-Optimise-BlockState-s-hashCode-equals.patch
@@ -9,7 +9,7 @@ object identity checks safely.
Use a simpler optimized hashcode
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/BooleanProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/BooleanProperty.java
-index 3084343b724098de9791bb74ffb037a499c0c430..8da64429eaf083578c672cd34f52dd42389ff396 100644
+index ee2f1bff22fed14cda434173dc6286e4d4520822..b63116b333b6e06494091a82588acfb639bddb71 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/BooleanProperty.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/BooleanProperty.java
@@ -30,8 +30,7 @@ public class BooleanProperty extends Property<Boolean> {
@@ -23,10 +23,10 @@ index 3084343b724098de9791bb74ffb037a499c0c430..8da64429eaf083578c672cd34f52dd42
return true;
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java
-index 647e295c7761b95db6da28f6fd043ec963f27872..0a7a6c0e7635d0ada101074d4229df7edc6dd31b 100644
+index bc7890e8ccfb133992605b06b37114424ccb093d..cd7efe4a09e114ab68a90365a6f5363a5c4c17a2 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/EnumProperty.java
-@@ -45,8 +45,7 @@ public class EnumProperty<T extends Enum<T> & StringRepresentable> extends Prope
+@@ -44,8 +44,7 @@ public class EnumProperty<T extends Enum<T> & StringRepresentable> extends Prope
return value.getSerializedName();
}
@@ -37,7 +37,7 @@ index 647e295c7761b95db6da28f6fd043ec963f27872..0a7a6c0e7635d0ada101074d4229df7e
return true;
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java b/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java
-index d6c1b1817ba79a652c4094f003a7d899d4939971..cbe6e4579cc55a427dd8f8fe403478faf6d35b8f 100644
+index 3c590d400032d8266de63aae301fedbd83d37a1d..3a850321a4bcc68058483b5fd53e829c425a68af 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/IntegerProperty.java
@@ -35,8 +35,7 @@ public class IntegerProperty extends Property<Integer> {
@@ -51,21 +51,14 @@ index d6c1b1817ba79a652c4094f003a7d899d4939971..cbe6e4579cc55a427dd8f8fe403478fa
return true;
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
-index d1f2e29623b15fdb99ba082fd757a54fd4713761..08c2e4ba9147fbea41e0fce26ad20586832a525b 100644
+index ce06c1702e9ff2e966d94a0d622264e16ded493c..bad6c58b0adc1ca630d3e943a86a2bc66dd94c9f 100644
--- a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
-@@ -70,14 +70,7 @@ public abstract class Property<T extends Comparable<T>> {
+@@ -70,7 +70,7 @@ public abstract class Property<T extends Comparable<T>> {
@Override
public boolean equals(Object object) {
-- if (this == object) {
-- return true;
-- } else if (!(object instanceof Property)) {
-- return false;
-- } else {
-- Property<?> property = (Property)object;
-- return this.clazz.equals(property.clazz) && this.name.equals(property.name);
-- }
+- return this == object || object instanceof Property<?> property && this.clazz.equals(property.clazz) && this.name.equals(property.name);
+ return this == object; // Paper - Perf: Optimize hashCode/equals
}