Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 19:10:09 +01:00
05466e3b47
Upstream has released updates that appear to apply compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing. Bukkit Changes: d2834556 SPIGOT-4219: Event for PigZombies angering. CraftBukkit Changes:a9c796f1
SPIGOT-4184: Fix furnaces not matching Vanilla smelt or animations195f071e
SPIGOT-4219: Event for PigZombies angering.5e3082c7
SPIGOT-4230: Improve legacy block types
31 Zeilen
1.4 KiB
Diff
31 Zeilen
1.4 KiB
Diff
From 4fa048db1658629e71132678cc4e754b3e55597e Mon Sep 17 00:00:00 2001
|
|
From: Brokkonaut <hannos17@gmx.de>
|
|
Date: Fri, 20 Oct 2017 04:33:45 +0200
|
|
Subject: [PATCH] Replace HashSet with fastutil's ObjectOpenHashSet in
|
|
HashTreeSet
|
|
|
|
HashSet sometimes uses compareTo() instead of equals() and this breaks the comparison of net.minecraft.server.NextTickListEntry (the only place where HashTreeSet is used).
|
|
|
|
In this cases duplicate entries could be added to the HashSet of HashTreeSet, because NextTickListEntry.compareTo() does not return 0, even if NextTickListEntry.equals() returns true.
|
|
|
|
ObjectOpenHashSet never uses compareTo(), so the inconsistencies of NextTickListEntry cause no problems.
|
|
|
|
Fixes https://github.com/PaperMC/Paper/issues/588
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java b/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java
|
|
index 80a5c29f3b..cd864c4047 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java
|
|
@@ -8,7 +8,7 @@ import java.util.TreeSet;
|
|
|
|
public class HashTreeSet<V> implements Set<V> {
|
|
|
|
- private HashSet<V> hash = new HashSet<V>();
|
|
+ private Set<V> hash = new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<V>(); //Paper - Replace java.util.HashSet with ObjectOpenHashSet
|
|
private TreeSet<V> tree = new TreeSet<V>();
|
|
|
|
public HashTreeSet() {
|
|
--
|
|
2.18.0
|
|
|