Fix for entity spawning and some code cleanup

By: Tahg <tahgtahv@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2011-12-06 19:21:10 -05:00
parent a84f36b67f
commit ae5c797119
2 changed files with 5 additions and 6 deletions

View file

@ -7,7 +7,7 @@ import java.util.ArrayList;
import static org.bukkit.craftbukkit.util.Java15Compat.Arrays_copyOf; 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[][][] values = new EntryBase[256][][];
EntryBase cache = null; EntryBase cache = null;

View file

@ -1,11 +1,10 @@
package org.bukkit.craftbukkit.util; package org.bukkit.craftbukkit.util;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.server.Chunk;
import net.minecraft.server.MinecraftServer;
import static org.bukkit.craftbukkit.util.Java15Compat.Arrays_copyOf; import static org.bukkit.craftbukkit.util.Java15Compat.Arrays_copyOf;
public class LongHashtable<V> extends LongAbstractHashtable { public class LongHashtable<V> extends LongBaseHashtable {
public void put(int msw, int lsw, V value) { public void put(int msw, int lsw, V value) {
put(toLong(msw, lsw), value); put(toLong(msw, lsw), value);
@ -20,7 +19,7 @@ public class LongHashtable<V> extends LongAbstractHashtable {
} }
public synchronized V get(long key) { public synchronized V get(long key) {
Entry entry = ((Entry)getEntry(key)); Entry entry = ((Entry) getEntry(key));
return entry != null ? entry.value : null; return entry != null ? entry.value : null;
} }
@ -30,7 +29,7 @@ public class LongHashtable<V> extends LongAbstractHashtable {
ArrayList<EntryBase> entries = entries(); ArrayList<EntryBase> entries = entries();
for(EntryBase entry : entries) { for(EntryBase entry : entries) {
ret.add(((Entry)entry).value); ret.add(((Entry) entry).value);
} }
return ret; return ret;
} }