Minor code changes

This commit is contained in:
MattBDev 2020-01-29 17:10:59 -05:00
parent 15e7c6734b
commit 7236b0a026
3 changed files with 3 additions and 6 deletions

View File

@ -576,7 +576,7 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
public BukkitPlayer getCachedPlayer(Player player) { public BukkitPlayer getCachedPlayer(Player player) {
List<MetadataValue> meta = player.getMetadata("WE"); List<MetadataValue> meta = player.getMetadata("WE");
if (meta == null || meta.isEmpty()) { if (meta.isEmpty()) {
return null; return null;
} }
return (BukkitPlayer) meta.get(0).value(); return (BukkitPlayer) meta.get(0).value();

View File

@ -66,7 +66,6 @@ public enum FaweCache implements Trimable {
public final char[] EMPTY_CHAR_4096 = new char[4096]; public final char[] EMPTY_CHAR_4096 = new char[4096];
private final IdentityHashMap<Class<?>, CleanableThreadLocal> REGISTERED_SINGLETONS = new IdentityHashMap<>();
private final IdentityHashMap<Class<?>, Pool> REGISTERED_POOLS = new IdentityHashMap<>(); private final IdentityHashMap<Class<?>, Pool> REGISTERED_POOLS = new IdentityHashMap<>();
/* /*
@ -91,9 +90,6 @@ public enum FaweCache implements Trimable {
MUTABLE_VECTOR3.clean(); MUTABLE_VECTOR3.clean();
MUTABLE_BLOCKVECTOR3.clean(); MUTABLE_BLOCKVECTOR3.clean();
SECTION_BITS_TO_CHAR.clean(); SECTION_BITS_TO_CHAR.clean();
for (Map.Entry<Class<?>, CleanableThreadLocal> entry : REGISTERED_SINGLETONS.entrySet()) {
entry.getValue().clean();
}
} }
for (Map.Entry<Class<?>, Pool> entry : REGISTERED_POOLS.entrySet()) { for (Map.Entry<Class<?>, Pool> entry : REGISTERED_POOLS.entrySet()) {
Pool pool = entry.getValue(); Pool pool = entry.getValue();

View File

@ -15,13 +15,14 @@ import java.io.IOException;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.IntStream; import java.util.stream.IntStream;
import org.jetbrains.annotations.Range;
/** /**
* Shared interface for IGetBlocks and ISetBlocks * Shared interface for IGetBlocks and ISetBlocks
*/ */
public interface IBlocks extends Trimable { public interface IBlocks extends Trimable {
boolean hasSection(int layer); boolean hasSection(@Range(from = 0, to = 15) int layer);
char[] load(int layer); char[] load(int layer);