Add "Dh" prefix to DistantHorizons Worlds
This commit is contained in:
@@ -38,7 +38,7 @@ import com.seibel.lod.core.render.renderer.TestRenderer;
|
||||
import com.seibel.lod.core.util.RenderUtil;
|
||||
import com.seibel.lod.core.world.DhClientWorld;
|
||||
import com.seibel.lod.core.world.DhWorld;
|
||||
import com.seibel.lod.core.world.IClientWorld;
|
||||
import com.seibel.lod.core.world.IDhClientWorld;
|
||||
import com.seibel.lod.core.world.WorldEnvironment;
|
||||
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
|
||||
@@ -216,9 +216,9 @@ public class ClientApi
|
||||
ConfigBasedLogger.updateAll();
|
||||
ConfigBasedSpamLogger.updateAll(doFlush);
|
||||
|
||||
if (SharedApi.currentWorld instanceof IClientWorld)
|
||||
if (SharedApi.currentWorld instanceof IDhClientWorld)
|
||||
{
|
||||
((IClientWorld) SharedApi.currentWorld).clientTick();
|
||||
((IDhClientWorld) SharedApi.currentWorld).clientTick();
|
||||
}
|
||||
profiler.pop();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.seibel.lod.core.DependencyInjection.DhApiEventInjector;
|
||||
import com.seibel.lod.core.level.IDhLevel;
|
||||
import com.seibel.lod.core.world.DhClientServerWorld;
|
||||
import com.seibel.lod.core.world.DhServerWorld;
|
||||
import com.seibel.lod.core.world.IServerWorld;
|
||||
import com.seibel.lod.core.world.IDhServerWorld;
|
||||
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.lod.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.lod.core.wrapperInterfaces.IVersionConstants;
|
||||
@@ -66,8 +66,8 @@ public class ServerApi
|
||||
private int lastWorldGenTickDelta = 0;
|
||||
public void serverTickEvent()
|
||||
{
|
||||
if (SharedApi.currentWorld instanceof IServerWorld) {
|
||||
IServerWorld serverWorld = (IServerWorld) SharedApi.currentWorld;
|
||||
if (SharedApi.currentWorld instanceof IDhServerWorld) {
|
||||
IDhServerWorld serverWorld = (IDhServerWorld) SharedApi.currentWorld;
|
||||
serverWorld.serverTick();
|
||||
lastWorldGenTickDelta--;
|
||||
if (lastWorldGenTickDelta <= 0) {
|
||||
@@ -117,7 +117,7 @@ public class ServerApi
|
||||
@Deprecated
|
||||
public void serverSaveEvent() {
|
||||
if (ENABLE_EVENT_LOGGING) LOGGER.info("Server world {} saving", SharedApi.currentWorld);
|
||||
if (SharedApi.currentWorld instanceof IServerWorld)
|
||||
if (SharedApi.currentWorld instanceof IDhServerWorld)
|
||||
{
|
||||
SharedApi.currentWorld.saveAndFlush();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ package com.seibel.lod.core.util;
|
||||
|
||||
import com.seibel.lod.core.level.IDhClientLevel;
|
||||
import com.seibel.lod.core.world.DhWorld;
|
||||
import com.seibel.lod.core.world.IClientWorld;
|
||||
import com.seibel.lod.core.world.IDhClientWorld;
|
||||
import com.seibel.lod.core.api.internal.SharedApi;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
|
||||
@@ -213,7 +213,7 @@ public class RenderUtil
|
||||
if (dhWorld == null)
|
||||
return false;
|
||||
|
||||
if (!(SharedApi.currentWorld instanceof IClientWorld))
|
||||
if (!(SharedApi.currentWorld instanceof IDhClientWorld))
|
||||
return false; // don't attempt to render server worlds
|
||||
|
||||
//FIXME: Improve class hierarchy of DhWorld, IClientWorld, IServerWorld to fix all this hard casting
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.HashSet;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
public class DhClientServerWorld extends DhWorld implements IClientWorld, IServerWorld
|
||||
public class DhClientServerWorld extends DhWorld implements IDhClientWorld, IDhServerWorld
|
||||
{
|
||||
private final HashMap<ILevelWrapper, DhClientServerLevel> levelObjMap;
|
||||
private final HashSet<DhClientServerLevel> dhLevels;
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.Iterator;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
public class DhClientWorld extends DhWorld implements IClientWorld
|
||||
public class DhClientWorld extends DhWorld implements IDhClientWorld
|
||||
{
|
||||
private final HashMap<IClientLevelWrapper, DhClientLevel> levels;
|
||||
public final ClientOnlySaveStructure saveStructure;
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class DhServerWorld extends DhWorld implements IServerWorld
|
||||
public class DhServerWorld extends DhWorld implements IDhServerWorld
|
||||
{
|
||||
private final HashMap<IServerLevelWrapper, DhServerLevel> levels;
|
||||
public final LocalSaveStructure saveStructure;
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package com.seibel.lod.core.world;
|
||||
|
||||
public interface IClientWorld {
|
||||
public interface IDhClientWorld
|
||||
{
|
||||
void clientTick();
|
||||
}
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package com.seibel.lod.core.world;
|
||||
|
||||
public interface IServerWorld {
|
||||
public interface IDhServerWorld
|
||||
{
|
||||
void serverTick();
|
||||
void doWorldGen();
|
||||
}
|
||||
Reference in New Issue
Block a user