mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-27 20:58:40 +01:00
fabric-1.18: get rid of all Eclipse warnings
This commit is contained in:
parent
3d95f9250a
commit
038f9c7085
@ -130,6 +130,7 @@ public class ChunkSnapshot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class StateListException extends Exception {
|
public static class StateListException extends Exception {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
private static boolean loggedOnce = false;
|
private static boolean loggedOnce = false;
|
||||||
|
|
||||||
public StateListException(int x, int z, int actualLength, int expectedLength, int expectedLegacyLength) {
|
public StateListException(int x, int z, int actualLength, int expectedLength, int expectedLegacyLength) {
|
||||||
|
@ -21,6 +21,7 @@ import net.minecraft.server.command.ServerCommandSource;
|
|||||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.server.world.ChunkHolder;
|
import net.minecraft.server.world.ChunkHolder;
|
||||||
|
import net.minecraft.server.world.ServerChunkManager;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.collection.IdList;
|
import net.minecraft.util.collection.IdList;
|
||||||
@ -39,7 +40,6 @@ import org.dynmap.common.BiomeMap;
|
|||||||
import org.dynmap.common.DynmapCommandSender;
|
import org.dynmap.common.DynmapCommandSender;
|
||||||
import org.dynmap.common.DynmapListenerManager;
|
import org.dynmap.common.DynmapListenerManager;
|
||||||
import org.dynmap.common.DynmapPlayer;
|
import org.dynmap.common.DynmapPlayer;
|
||||||
import org.dynmap.fabric_1_18.DynmapPlugin.ChatMessage;
|
|
||||||
import org.dynmap.fabric_1_18.command.DmapCommand;
|
import org.dynmap.fabric_1_18.command.DmapCommand;
|
||||||
import org.dynmap.fabric_1_18.command.DmarkerCommand;
|
import org.dynmap.fabric_1_18.command.DmarkerCommand;
|
||||||
import org.dynmap.fabric_1_18.command.DynmapCommand;
|
import org.dynmap.fabric_1_18.command.DynmapCommand;
|
||||||
@ -76,14 +76,10 @@ public class DynmapPlugin {
|
|||||||
public static DynmapPlugin plugin;
|
public static DynmapPlugin plugin;
|
||||||
ChatHandler chathandler;
|
ChatHandler chathandler;
|
||||||
private HashMap<String, Integer> sortWeights = new HashMap<String, Integer>();
|
private HashMap<String, Integer> sortWeights = new HashMap<String, Integer>();
|
||||||
// Drop world load ticket after 30 seconds
|
|
||||||
private long worldIdleTimeoutNS = 30 * 1000000000L;
|
|
||||||
private HashMap<String, FabricWorld> worlds = new HashMap<String, FabricWorld>();
|
private HashMap<String, FabricWorld> worlds = new HashMap<String, FabricWorld>();
|
||||||
private WorldAccess last_world;
|
private WorldAccess last_world;
|
||||||
private FabricWorld last_fworld;
|
private FabricWorld last_fworld;
|
||||||
private Map<String, FabricPlayer> players = new HashMap<String, FabricPlayer>();
|
private Map<String, FabricPlayer> players = new HashMap<String, FabricPlayer>();
|
||||||
//TODO private ForgeMetrics metrics;
|
|
||||||
private HashSet<String> modsused = new HashSet<String>();
|
|
||||||
private FabricServer fserver;
|
private FabricServer fserver;
|
||||||
private boolean tickregistered = false;
|
private boolean tickregistered = false;
|
||||||
// TPS calculator
|
// TPS calculator
|
||||||
@ -94,9 +90,6 @@ public class DynmapPlugin {
|
|||||||
long perTickLimit = (50000000); // 50 ms
|
long perTickLimit = (50000000); // 50 ms
|
||||||
private boolean useSaveFolder = true;
|
private boolean useSaveFolder = true;
|
||||||
|
|
||||||
private static final int SIGNPOST_ID = 63;
|
|
||||||
private static final int WALLSIGN_ID = 68;
|
|
||||||
|
|
||||||
private static final String[] TRIGGER_DEFAULTS = {"blockupdate", "chunkpopulate", "chunkgenerate"};
|
private static final String[] TRIGGER_DEFAULTS = {"blockupdate", "chunkpopulate", "chunkgenerate"};
|
||||||
|
|
||||||
static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
||||||
@ -133,7 +126,6 @@ public class DynmapPlugin {
|
|||||||
public static DynmapBlockState[] stateByID;
|
public static DynmapBlockState[] stateByID;
|
||||||
|
|
||||||
private Map<String, LongOpenHashSet> knownloadedchunks = new HashMap<String, LongOpenHashSet>();
|
private Map<String, LongOpenHashSet> knownloadedchunks = new HashMap<String, LongOpenHashSet>();
|
||||||
private boolean didInitialKnownChunks = false;
|
|
||||||
|
|
||||||
private void addKnownChunk(FabricWorld fw, ChunkPos pos) {
|
private void addKnownChunk(FabricWorld fw, ChunkPos pos) {
|
||||||
LongOpenHashSet cset = knownloadedchunks.get(fw.getName());
|
LongOpenHashSet cset = knownloadedchunks.get(fw.getName());
|
||||||
@ -227,10 +219,10 @@ public class DynmapPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
|
// for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
|
||||||
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
|
// DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
|
||||||
//Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
|
// Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Item getItemByID(int id) {
|
public static final Item getItemByID(int id) {
|
||||||
@ -512,17 +504,6 @@ public class DynmapPlugin {
|
|||||||
/* Load saved world definitions */
|
/* Load saved world definitions */
|
||||||
loadWorlds();
|
loadWorlds();
|
||||||
|
|
||||||
/* Initialized the currently loaded worlds */
|
|
||||||
if (server.getWorlds() != null) {
|
|
||||||
for (ServerWorld world : server.getWorlds()) {
|
|
||||||
FabricWorld w = this.getWorld(world);
|
|
||||||
/*NOTYET - need rest of forge
|
|
||||||
if(DimensionManager.getWorld(world.provider.getDimensionId()) == null) { // If not loaded
|
|
||||||
w.setWorldUnloaded();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (FabricWorld w : worlds.values()) {
|
for (FabricWorld w : worlds.values()) {
|
||||||
if (core.processWorldLoad(w)) { /* Have core process load first - fire event listeners if good load after */
|
if (core.processWorldLoad(w)) { /* Have core process load first - fire event listeners if good load after */
|
||||||
if (w.isLoaded()) {
|
if (w.isLoaded()) {
|
||||||
@ -779,9 +760,9 @@ public class DynmapPlugin {
|
|||||||
for (ServerWorld world : server.getWorlds()) {
|
for (ServerWorld world : server.getWorlds()) {
|
||||||
FabricWorld fw = getWorld(world);
|
FabricWorld fw = getWorld(world);
|
||||||
if (fw == null) continue;
|
if (fw == null) continue;
|
||||||
Long2ObjectLinkedOpenHashMap<ChunkHolder> chunks = ((ThreadedAnvilChunkStorageAccessor) world.getChunkManager().threadedAnvilChunkStorage).getChunkHolders();
|
ServerChunkManager chunkManager = world.getChunkManager();
|
||||||
|
Long2ObjectLinkedOpenHashMap<ChunkHolder> chunks = ((ThreadedAnvilChunkStorageAccessor) chunkManager.threadedAnvilChunkStorage).getChunkHolders();
|
||||||
for (Map.Entry<Long, ChunkHolder> k : chunks.long2ObjectEntrySet()) {
|
for (Map.Entry<Long, ChunkHolder> k : chunks.long2ObjectEntrySet()) {
|
||||||
long key = k.getKey();
|
|
||||||
ChunkHolder ch = k.getValue();
|
ChunkHolder ch = k.getValue();
|
||||||
Chunk c = null;
|
Chunk c = null;
|
||||||
try {
|
try {
|
||||||
|
@ -28,17 +28,11 @@ import java.util.*;
|
|||||||
* Container for managing chunks - dependent upon using chunk snapshots, since rendering is off server thread
|
* Container for managing chunks - dependent upon using chunk snapshots, since rendering is off server thread
|
||||||
*/
|
*/
|
||||||
public class FabricMapChunkCache extends MapChunkCache {
|
public class FabricMapChunkCache extends MapChunkCache {
|
||||||
private final DynmapPlugin plugin;
|
|
||||||
|
|
||||||
private static boolean init = false;
|
private static boolean init = false;
|
||||||
private static Field updateEntityTick = null;
|
private static Field updateEntityTick = null;
|
||||||
/* ChunkManager fields */
|
/* ChunkManager fields */
|
||||||
private static Field chunksToRemove = null; // Map
|
private static Field chunksToRemove = null; // Map
|
||||||
|
|
||||||
/* ChunjManager Pending fields */
|
|
||||||
private static Field chunkCoord = null;
|
|
||||||
private static Field nbtTag = null;
|
|
||||||
|
|
||||||
private World w;
|
private World w;
|
||||||
private DynmapWorld dw;
|
private DynmapWorld dw;
|
||||||
private ServerChunkManager cps;
|
private ServerChunkManager cps;
|
||||||
@ -74,8 +68,6 @@ public class FabricMapChunkCache extends MapChunkCache {
|
|||||||
* Construct empty cache
|
* Construct empty cache
|
||||||
*/
|
*/
|
||||||
public FabricMapChunkCache(DynmapPlugin plugin) {
|
public FabricMapChunkCache(DynmapPlugin plugin) {
|
||||||
this.plugin = plugin;
|
|
||||||
|
|
||||||
Registry<Biome> biomeRegistry = plugin.getFabricServer().getBiomeRegistry();
|
Registry<Biome> biomeRegistry = plugin.getFabricServer().getBiomeRegistry();
|
||||||
Biome b[] = plugin.getFabricServer().getBiomeList(biomeRegistry);
|
Biome b[] = plugin.getFabricServer().getBiomeList(biomeRegistry);
|
||||||
BiomeMap[] bm = BiomeMap.values();
|
BiomeMap[] bm = BiomeMap.values();
|
||||||
@ -881,8 +873,6 @@ public class FabricMapChunkCache extends MapChunkCache {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean didError = false;
|
|
||||||
|
|
||||||
public NbtCompound readChunk(int x, int z) {
|
public NbtCompound readChunk(int x, int z) {
|
||||||
try {
|
try {
|
||||||
ThreadedAnvilChunkStorage acl = cps.threadedAnvilChunkStorage;
|
ThreadedAnvilChunkStorage acl = cps.threadedAnvilChunkStorage;
|
||||||
|
@ -38,8 +38,6 @@ import java.nio.file.Path;
|
|||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -203,7 +201,7 @@ public class FabricServer extends DynmapServerInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String stripChatColor(String s) {
|
public String stripChatColor(String s) {
|
||||||
return plugin.patternControlCode.matcher(s).replaceAll("");
|
return DynmapPlugin.patternControlCode.matcher(s).replaceAll("");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<DynmapListenerManager.EventType> registered = new HashSet<DynmapListenerManager.EventType>();
|
private Set<DynmapListenerManager.EventType> registered = new HashSet<DynmapListenerManager.EventType>();
|
||||||
@ -416,7 +414,7 @@ public class FabricServer extends DynmapServerInterface {
|
|||||||
Future<Boolean> f = this.callSyncMethod(new Callable<Boolean>() {
|
Future<Boolean> f = this.callSyncMethod(new Callable<Boolean>() {
|
||||||
public Boolean call() throws Exception {
|
public Boolean call() throws Exception {
|
||||||
// Update busy state on world
|
// Update busy state on world
|
||||||
FabricWorld fw = (FabricWorld) cc.getWorld();
|
//FabricWorld fw = (FabricWorld) cc.getWorld();
|
||||||
//TODO
|
//TODO
|
||||||
//setBusy(fw.getWorld());
|
//setBusy(fw.getWorld());
|
||||||
cc.getLoadedChunks();
|
cc.getLoadedChunks();
|
||||||
@ -521,11 +519,6 @@ public class FabricServer extends DynmapServerInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T> Predicate<T> distinctByKeyAndNonNull(Function<? super T, ?> keyExtractor) {
|
|
||||||
Set<Object> seen = ConcurrentHashMap.newKeySet();
|
|
||||||
return t -> t != null && seen.add(keyExtractor.apply(t));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<ModContainer> getModContainerById(String id) {
|
private Optional<ModContainer> getModContainerById(String id) {
|
||||||
return FabricLoader.getInstance().getModContainer(id);
|
return FabricLoader.getInstance().getModContainer(id);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user