From ae5c797119128c37f69f85e112b8400f05e1ad62 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 6 Dec 2011 19:21:10 -0500 Subject: [PATCH] Fix for entity spawning and some code cleanup By: Tahg --- ...LongAbstractHashtable.java => LongBaseHashtable.java} | 2 +- .../java/org/bukkit/craftbukkit/util/LongHashtable.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) rename paper-server/src/main/java/org/bukkit/craftbukkit/util/{LongAbstractHashtable.java => LongBaseHashtable.java} (98%) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongAbstractHashtable.java b/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongBaseHashtable.java similarity index 98% rename from paper-server/src/main/java/org/bukkit/craftbukkit/util/LongAbstractHashtable.java rename to paper-server/src/main/java/org/bukkit/craftbukkit/util/LongBaseHashtable.java index 2da732cce2..c478f50c97 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongAbstractHashtable.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongBaseHashtable.java @@ -7,7 +7,7 @@ import java.util.ArrayList; import static org.bukkit.craftbukkit.util.Java15Compat.Arrays_copyOf; -public abstract class LongAbstractHashtable extends LongHash { +public class LongBaseHashtable extends LongHash { EntryBase[][][] values = new EntryBase[256][][]; EntryBase cache = null; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongHashtable.java b/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongHashtable.java index d3912e497e..154b877bb5 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongHashtable.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/util/LongHashtable.java @@ -1,11 +1,10 @@ package org.bukkit.craftbukkit.util; import java.util.ArrayList; -import net.minecraft.server.Chunk; -import net.minecraft.server.MinecraftServer; + import static org.bukkit.craftbukkit.util.Java15Compat.Arrays_copyOf; -public class LongHashtable extends LongAbstractHashtable { +public class LongHashtable extends LongBaseHashtable { public void put(int msw, int lsw, V value) { put(toLong(msw, lsw), value); @@ -20,7 +19,7 @@ public class LongHashtable extends LongAbstractHashtable { } public synchronized V get(long key) { - Entry entry = ((Entry)getEntry(key)); + Entry entry = ((Entry) getEntry(key)); return entry != null ? entry.value : null; } @@ -30,7 +29,7 @@ public class LongHashtable extends LongAbstractHashtable { ArrayList entries = entries(); for(EntryBase entry : entries) { - ret.add(((Entry)entry).value); + ret.add(((Entry) entry).value); } return ret; }