Add the MinecraftWrapper

This commit is contained in:
James Seibel
2021-09-06 11:20:32 -05:00
parent 42bd0fbde9
commit 13a1e7ed56
10 changed files with 228 additions and 100 deletions
@@ -33,8 +33,8 @@ import com.seibel.lod.objects.LevelPos.LevelPos;
import com.seibel.lod.util.DetailDistanceUtil;
import com.seibel.lod.util.LodThreadFactory;
import com.seibel.lod.util.LodUtil;
import com.seibel.lod.wrapper.MinecraftWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.DimensionType;
import net.minecraft.world.server.ServerChunkProvider;
@@ -47,7 +47,7 @@ import net.minecraft.world.server.ServerWorld;
*
* @author Leonardo Amato
* @author James Seibel
* @version 8-8-2021
* @version 9-6-2021
*/
public class LodDimension
{
@@ -89,7 +89,7 @@ public class LodDimension
dimension = newDimension;
width = newWidth;
halfWidth = (int) Math.floor(width / 2);
Minecraft mc = Minecraft.getInstance();
MinecraftWrapper mc = MinecraftWrapper.INSTANCE;
if (newDimension != null && lodWorld != null)
{
try
@@ -110,8 +110,8 @@ public class LodDimension
{
// connected to server
saveDir = new File(mc.gameDirectory.getCanonicalFile().getPath() +
File.separatorChar + "lod server data" + File.separatorChar + LodUtil.getDimensionIDFromWorld(mc.level));
saveDir = new File(mc.getGameDirectory().getCanonicalFile().getPath() +
File.separatorChar + "lod server data" + File.separatorChar + mc.getCurrentDimensionId());
}
fileHandler = new LodDimensionFileHandler(saveDir, this);
@@ -243,8 +243,6 @@ public class LodDimension
*/
public int getMinMemoryNeeded()
{
int regionX;
int regionZ;
int count = 0;
LodRegion region;
@@ -696,9 +694,6 @@ public class LodDimension
@Override
public String toString()
{
int regionX;
int regionZ;
LevelPos levelPos;
LodRegion region;
StringBuilder stringBuilder = new StringBuilder();