diff --git a/api/src/main/java/com/seibel/lod/api/DhApiMain.java b/api/src/main/java/com/seibel/lod/api/DhApiMain.java
index c1e790a6b..1d1632847 100644
--- a/api/src/main/java/com/seibel/lod/api/DhApiMain.java
+++ b/api/src/main/java/com/seibel/lod/api/DhApiMain.java
@@ -1,7 +1,6 @@
package com.seibel.lod.api;
import com.seibel.lod.core.ModInfo;
-import com.seibel.lod.core.datatype.full.FullDataSource;
/**
* This holds API methods related to version numbers and other unchanging endpoints.
@@ -39,10 +38,5 @@ public class DhApiMain
{
return ModInfo.PROTOCOL_VERSION;
}
- /** Returns the LOD file version. */
- public static int getLodFileFormatVersion()
- {
- return FullDataSource.LATEST_VERSION;
- }
}
diff --git a/api/src/main/java/com/seibel/lod/api/enums/DhApiEnumAssembly.java b/api/src/main/java/com/seibel/lod/api/enums/DhApiEnumAssembly.java
deleted file mode 100644
index f27545510..000000000
--- a/api/src/main/java/com/seibel/lod/api/enums/DhApiEnumAssembly.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.enums;
-
-import com.seibel.lod.api.items.enums.config.DhApiConfigEnumAssembly;
-import com.seibel.lod.api.items.enums.worldGeneration.DhApiWorldGenerationEnumAssembly;
-
-/**
- * Assembly classes are used to reference the package they are in.
- *
- * @author James Seibel
- * @version 2022-7-18
- */
-public class DhApiEnumAssembly
-{
- // These variables are added in order to load each package into the JVM's class loader.
- // This is done so they can be found via reflection.
- private static final DhApiWorldGenerationEnumAssembly worldGenerationAssembly = new DhApiWorldGenerationEnumAssembly();
- private static final DhApiConfigEnumAssembly configAssembly = new DhApiConfigEnumAssembly();
-
- /** All DH API enums should have this prefix */
- public static final String API_ENUM_PREFIX = "EDhApi";
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/DhApiConfigEnumAssembly.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/DhApiConfigEnumAssembly.java
deleted file mode 100644
index 48fd69c0d..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/DhApiConfigEnumAssembly.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * Assembly classes are used to reference the package they are in.
- *
- * @author James Seibel
- * @version 2022-7-13
- */
-public class DhApiConfigEnumAssembly
-{
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiBlocksToAvoid.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiBlocksToAvoid.java
deleted file mode 100644
index 5d988dce0..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiBlocksToAvoid.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * NONE,
- * NON_FULL,
- * NO_COLLISION,
- * BOTH,
- *
- * @author Leonardo Amato
- * @version 2022-7-1
- */
-public enum EDhApiBlocksToAvoid
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
- NONE(false, false),
-
- NON_FULL(true, false),
-
- NO_COLLISION(false, true),
-
- BOTH(true, true);
-
- public final boolean nonFull;
- public final boolean noCollision;
-
- EDhApiBlocksToAvoid(boolean nonFull, boolean noCollision)
- {
- this.nonFull = nonFull;
- this.noCollision = noCollision;
- }
-}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiBufferRebuildTimes.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiBufferRebuildTimes.java
deleted file mode 100644
index 74627f2f7..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiBufferRebuildTimes.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * CONSTANT
- * FREQUENT
- * NORMAL
- * RARE
- *
- * Determines how fast the buffers should be regenerated
- *
- * @author Leonardo Amato
- * @version 9-25-2021
- */
-public enum EDhApiBufferRebuildTimes
-{
- CONSTANT,
- FREQUENT,
- NORMAL,
- RARE;
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiDebugMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiDebugMode.java
deleted file mode 100644
index 892f15ad3..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiDebugMode.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * OFF,
- * SHOW_WIREFRAME,
- * SHOW_DETAIL,
- * SHOW_DETAIL_WIREFRAME,
- * SHOW_GENMODE,
- * SHOW_GENMODE_WIREFRAME,
- * SHOW_OVERLAPPING_QUADS,
- * SHOW_OVERLAPPING_QUADS_WIREFRAME,
- *
- * @author Leetom
- * @author James Seibel
- * @version 2022-7-2
- */
-public enum EDhApiDebugMode
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
-
- /** LODs are rendered normally */
- OFF,
-
- /** LOD draws in wireframe. */
- SHOW_WIREFRAME,
-
- /** LOD colors are based on their detail */
- SHOW_DETAIL,
-
- /** LOD colors are based on their detail, and draws in wireframe. */
- SHOW_DETAIL_WIREFRAME,
-
- /** LOD colors are based on their gen mode. */
- SHOW_GENMODE,
-
- /** LOD colors are based on their gen mode, and draws in wireframe. */
- SHOW_GENMODE_WIREFRAME,
-
- /** Only draw overlapping LOD quads. */
- SHOW_OVERLAPPING_QUADS,
-
- /** Only draw overlapping LOD quads, and draws in wireframe. */
- SHOW_OVERLAPPING_QUADS_WIREFRAME;
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiDistanceGenerationMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiDistanceGenerationMode.java
deleted file mode 100644
index 9bf12c2de..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiDistanceGenerationMode.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * NONE
- * BIOME_ONLY
- * BIOME_ONLY_SIMULATE_HEIGHT
- * SURFACE
- * FEATURES
- * FULL
- *
- * In order of fastest to slowest.
- *
- * @author James Seibel
- * @author Leonardo Amato
- * @version 2022-7-1
- */
-public enum EDhApiDistanceGenerationMode
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
-
- /** Don't generate anything except already existing chunks */
- NONE,
-
- /**
- * Only generate the biomes and use biome
- * grass/foliage color, water color, or ice color
- * to generate the color.
- * Doesn't generate height, everything is shown at sea level.
- * Multithreaded - Fastest (2-5 ms)
- */
- BIOME_ONLY,
-
- /**
- * Same as BIOME_ONLY, except instead
- * of always using sea level as the LOD height
- * different biome types (mountain, ocean, forest, etc.)
- * use predetermined heights to simulate having height data.
- */
- BIOME_ONLY_SIMULATE_HEIGHT,
-
- /**
- * Generate the world surface,
- * this does NOT include caves, trees,
- * or structures.
- * Multithreaded - Faster (10-20 ms)
- */
- SURFACE,
-
- /**
- * Generate including structures.
- * NOTE: This may cause world generation bugs or instability,
- * since some features can cause concurrentModification exceptions.
- * Multithreaded - Fast (15-20 ms)
- */
- FEATURES,
-
- /**
- * Ask the server to generate/load each chunk.
- * This is the most compatible, but causes server/simulation lag.
- * This will also show player made structures if you
- * are adding the mod on a pre-existing world.
- * Single-threaded - Slow (15-50 ms, with spikes up to 200 ms)
- */
- FULL;
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiDropoffQuality.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiDropoffQuality.java
deleted file mode 100644
index e746d5a7d..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiDropoffQuality.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2022 Tom Lee (TomTheFurry)
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * AUTO
- * SMOOTH_DROPOFF
- * PERFORMANCE_FOCUSED
- *
- * Determines how lod level drop off should be done
- *
- * @author Tom Lee
- * @version 7-1-2022
- */
-public enum EDhApiDropoffQuality
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
-
- /** SMOOTH_DROPOFF when <128 lod view distance, or PERFORMANCE_FOCUSED otherwise */
- AUTO(-1),
-
- SMOOTH_DROPOFF(10),
-
- PERFORMANCE_FOCUSED(0);
-
- public final int fastModeSwitch;
-
- EDhApiDropoffQuality(int fastModeSwitch) {
- this.fastModeSwitch = fastModeSwitch;
- }
-
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogColorMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogColorMode.java
deleted file mode 100644
index 2452fc5c5..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogColorMode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * USE_DEFAULT_FOG_COLOR,
- * USE_SKY_COLOR,
- *
- * @author James Seibel
- * @version 2022-6-9
- */
-public enum EDhApiFogColorMode
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
- /** Fog uses Minecraft's fog color. */
- USE_WORLD_FOG_COLOR,
-
- /**
- * Replicates the effect of the clear sky mod.
- * Making the fog blend in with the sky better
- * For it to look good you need one of the following mods:
- * https://www.curseforge.com/minecraft/mc-mods/clear-skies
- * https://www.curseforge.com/minecraft/mc-mods/clear-skies-forge-port
- */
- USE_SKY_COLOR,
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogDistance.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogDistance.java
deleted file mode 100644
index 05a4575b1..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogDistance.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * NEAR,
- * FAR,
- * NEAR_AND_FAR
- *
- * @author James Seibel
- * @version 2022-6-2
- */
-public enum EDhApiFogDistance
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
- NEAR,
- FAR,
- NEAR_AND_FAR
-}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogDrawMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogDrawMode.java
deleted file mode 100644
index 6252edb8c..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogDrawMode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * USE_OPTIFINE_FOG_SETTING,
- * FOG_ENABLED,
- * FOG_DISABLED
- *
- * @author James Seibel
- * @version 2022-6-2
- */
-public enum EDhApiFogDrawMode
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
-
- /**
- * Use whatever Fog setting optifine is using.
- * If optifine isn't installed this defaults to FOG_ENABLED.
- */
- USE_OPTIFINE_SETTING,
-
- FOG_ENABLED,
- FOG_DISABLED;
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogFalloff.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogFalloff.java
deleted file mode 100644
index ca17b8ec3..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiFogFalloff.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * LINEAR,
- * EXPONENTIAL,
- * EXPONENTIAL_SQUARED
- *
- * @author Leetom
- * @version 2022-6-30
- */
-public enum EDhApiFogFalloff
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
-
- LINEAR,
- EXPONENTIAL,
- EXPONENTIAL_SQUARED,
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiGenerationPriority.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiGenerationPriority.java
deleted file mode 100644
index eeb0dbfb6..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiGenerationPriority.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * AUTO
- * Near_First
- * Far_First
- *
- * Determines which LODs should have priority when generating
- * outside the normal view distance.
- *
- * @author Leonardo Amato
- * @version 12-1-2021
- */
-public enum EDhApiGenerationPriority
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
- /** NEAR_FIRST when connected to servers and BALANCED when on single player */
- AUTO,
-
- NEAR_FIRST,
-
- BALANCED,
-
- FAR_FIRST
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiGpuUploadMethod.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiGpuUploadMethod.java
deleted file mode 100644
index 1e6de21c1..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiGpuUploadMethod.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * AUTO,
- * BUFFER_STORAGE,
- * SUB_DATA,
- * BUFFER_MAPPING,
- * DATA
- *
- * @author Leetom
- * @author James Seibel
- * @version 2022-7-2
- */
-public enum EDhApiGpuUploadMethod
-{
- /** Picks the best option based on the GPU the user has. */
- AUTO,
-
- /**
- * Default for NVIDIA if OpenGL 4.5 is supported.
- * Fast rendering, no stuttering.
- */
- BUFFER_STORAGE,
-
- /**
- * Backup option for NVIDIA.
- * Fast rendering but may stutter when uploading.
- */
- SUB_DATA,
-
- /**
- * Default option for AMD/Intel.
- * May end up storing buffers in System memory.
- * Fast rending if in GPU memory, slow if in system memory,
- * but won't stutter when uploading.
- */
- BUFFER_MAPPING,
-
- /**
- * Backup option for AMD/Intel.
- * Fast rendering but may stutter when uploading.
- */
- DATA;
-
-}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHeightFogMixMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHeightFogMixMode.java
deleted file mode 100644
index adcc05ea7..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHeightFogMixMode.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * BASIC
- * IGNORE_HEIGHT
- * ADDITION
- * MAX
- * MULTIPLY
- * INVERSE_MULTIPLY
- * LIMITED_ADDITION
- * MULTIPLY_ADDITION
- * INVERSE_MULTIPLY_ADDITION
- * AVERAGE
- *
- * @author Leetom
- * @version 2022-4-14
- */
-public enum EDhApiHeightFogMixMode
-{
- BASIC,
- IGNORE_HEIGHT,
- ADDITION,
- MAX,
- MULTIPLY,
- INVERSE_MULTIPLY,
- LIMITED_ADDITION,
- MULTIPLY_ADDITION,
- INVERSE_MULTIPLY_ADDITION,
- AVERAGE,
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHeightFogMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHeightFogMode.java
deleted file mode 100644
index f7497ee99..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHeightFogMode.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * ABOVE_CAMERA,
- * BELOW_CAMERA,
- * ABOVE_AND_BELOW_CAMERA,
- * ABOVE_SET_HEIGHT,
- * BELOW_SET_HEIGHT,
- * ABOVE_AND_BELOW_SET_HEIGHT,
- *
- * @author Leetom
- * @version 6-30-2022
- */
-public enum EDhApiHeightFogMode
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
-
- ABOVE_CAMERA(true, true, false),
- BELOW_CAMERA(true, false, true),
- ABOVE_AND_BELOW_CAMERA(true, true, true),
- ABOVE_SET_HEIGHT(false, true, false),
- BELOW_SET_HEIGHT(false, false, true),
- ABOVE_AND_BELOW_SET_HEIGHT(false, true, true);
-
- public final boolean basedOnCamera;
- public final boolean above;
- public final boolean below;
-
- EDhApiHeightFogMode(boolean basedOnCamera, boolean above, boolean below)
- {
- this.basedOnCamera = basedOnCamera;
- this.above = above;
- this.below = below;
- }
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHorizontalQuality.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHorizontalQuality.java
deleted file mode 100644
index f56ad8fa8..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHorizontalQuality.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * LOWEST
- * LOW
- * MEDIUM
- * HIGH
- *
- * this indicates the base of the quadratic function we use for the quality drop-off
- *
- * @author Leonardo Amato
- * @version 9-29-2021
- */
-public enum EDhApiHorizontalQuality
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
-
- /** 1.0 AKA Linear */
- LOWEST(1.0f),
-
- /** exponent 1.5 */
- LOW(1.5f),
-
- /** exponent 2.0 */
- MEDIUM(2.0f),
-
- /** exponent 2.2 */
- HIGH(2.2f);
-
- public final double quadraticBase;
-
- EDhApiHorizontalQuality(double distanceUnit)
- {
- this.quadraticBase = distanceUnit;
- }
-}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHorizontalResolution.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHorizontalResolution.java
deleted file mode 100644
index c8c51839f..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiHorizontalResolution.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * BLOCK
- * TWO_BLOCKS
- * FOUR_BLOCKS
- * HALF_CHUNK
- * CHUNK
- *
- * @author James Seibel
- * @author Leonardo Amato
- * @version 2022-7-5
- */
-public enum EDhApiHorizontalResolution
-{
- /** render 256 LODs for each chunk */
- BLOCK,
-
- /** render 64 LODs for each chunk */
- TWO_BLOCKS,
-
- /** render 16 LODs for each chunk */
- FOUR_BLOCKS,
-
- /** render 4 LODs for each chunk */
- HALF_CHUNK,
-
- /** render 1 LOD for each chunk */
- CHUNK;
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiLightGenerationMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiLightGenerationMode.java
deleted file mode 100644
index 68516c28f..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiLightGenerationMode.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * FAST,
- * FANCY,
- *
- * @author Leetom
- * @version 2022-7-1
- */
-public enum EDhApiLightGenerationMode
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
- /** Fake light values using a height map */
- FAST,
-
- /** Run the lighting engine though the chunk to generate proper light values */
- FANCY
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiRendererMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiRendererMode.java
deleted file mode 100644
index e310c8921..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiRendererMode.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * DEFAULT,
- * DEBUG,
- * DISABLED,
- *
- * @version 2022-6-2
- */
-public enum EDhApiRendererMode
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
- DEFAULT,
- DEBUG,
- DISABLED;
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiServerFolderNameMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiServerFolderNameMode.java
deleted file mode 100644
index b7c8ea812..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiServerFolderNameMode.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2022 Tom Lee (TomTheFurry)
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * AUTO,
- * NAME_ONLY,
- * NAME_IP,
- * NAME_IP_PORT,
- *
- * Determines how the multiplayer folders should be named.
- *
- * @author James Seibel
- * @version 2022-7-1
- */
-public enum EDhApiServerFolderNameMode
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
-
- /**
- * NAME_IP for LAN connections
- * NAME_IP_PORT for all others
- */
- AUTO,
-
- /** Only use the server name */
- NAME_ONLY,
-
- /**
- * {SERVER_NAME} IP {IP}
- * Example: Minecraft Server IP 192.168.1.40
- */
- NAME_IP,
-
- /**
- * {SERVER_NAME} IP {IP}:{PORT}
- * Example: Minecraft Server IP 192.168.1.40:25565
- */
- NAME_IP_PORT,
-
- /**
- * {SERVER_NAME} IP {IP}
- * Example: Minecraft Server IP 192.168.1.40:25565 GameVersion 1.16.5
- *
- * Not normally recommended, since the game version can change if the
- * server installs paper or some other jar.
- * This is just here to provide backwards compatibility.
- */
- NAME_IP_PORT_MC_VERSION;
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiVanillaOverdraw.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiVanillaOverdraw.java
deleted file mode 100644
index bfd7d62f0..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiVanillaOverdraw.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * NEVER,
- * DYNAMIC,
- * ALWAYS
- *
- * This represents how far the LODs should overlap with
- * the vanilla Minecraft terrain.
- *
- * @author James Seibel
- * @version 2022-6-30
- */
-public enum EDhApiVanillaOverdraw
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
-
- /**
- * Don't draw LODs where a minecraft chunk could be.
- * Use Overdraw Offset to tweak the border thickness.
- */
- NEVER,
-
- /**
- * Draw LODs over the farther minecraft chunks.
- * Dynamically decides the border thickness
- */
- DYNAMIC,
-
- /** Draw LODs over all minecraft chunks. */
- ALWAYS,
-}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiVerticalQuality.java b/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiVerticalQuality.java
deleted file mode 100644
index c57d45969..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/config/EDhApiVerticalQuality.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.config;
-
-/**
- * LOW,
- * MEDIUM,
- * HIGH,
- * ULTRA
- *
- * @author Leonardo Amato
- * @version 2022-6-9
- */
-public enum EDhApiVerticalQuality
-{
- // Reminder:
- // when adding items: up the API minor version
- // when removing items: up the API major version
-
- LOW,
- MEDIUM,
- HIGH,
- ULTRA
-
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/lod/core/enums/rendering/ERendererMode.java b/api/src/main/java/com/seibel/lod/api/items/enums/rendering/ERendererMode.java
similarity index 97%
rename from core/src/main/java/com/seibel/lod/core/enums/rendering/ERendererMode.java
rename to api/src/main/java/com/seibel/lod/api/items/enums/rendering/ERendererMode.java
index c6dc73ca3..faa9ebae1 100644
--- a/core/src/main/java/com/seibel/lod/core/enums/rendering/ERendererMode.java
+++ b/api/src/main/java/com/seibel/lod/api/items/enums/rendering/ERendererMode.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package com.seibel.lod.core.enums.rendering;
+package com.seibel.lod.api.items.enums.rendering;
/**
* Default
diff --git a/api/src/main/java/com/seibel/lod/api/items/enums/worldGeneration/DhApiWorldGenerationEnumAssembly.java b/api/src/main/java/com/seibel/lod/api/items/enums/worldGeneration/DhApiWorldGenerationEnumAssembly.java
deleted file mode 100644
index 46ca55d09..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/enums/worldGeneration/DhApiWorldGenerationEnumAssembly.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.enums.worldGeneration;
-
-/**
- * Assembly classes are used to reference the package they are in.
- *
- * @author James Seibel
- * @version 2022-7-14
- */
-public class DhApiWorldGenerationEnumAssembly
-{
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/IDhApiUnsafeWrapper.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/IDhApiUnsafeWrapper.java
index d228a438a..d97b1c712 100644
--- a/api/src/main/java/com/seibel/lod/api/items/interfaces/IDhApiUnsafeWrapper.java
+++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/IDhApiUnsafeWrapper.java
@@ -1,7 +1,5 @@
package com.seibel.lod.api.items.interfaces;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.ICoreDhApiUnsafeWrapper;
-
/**
* The Distant Horizons' API objects can't cover
* every potential use case. Sometimes developers just need
@@ -10,7 +8,7 @@ import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.
* @author James Seibel
* @version 2022-9-6
*/
-public interface IDhApiUnsafeWrapper extends ICoreDhApiUnsafeWrapper
+public interface IDhApiUnsafeWrapper
{
/**
* Returns the Minecraft object this wrapper contains.
@@ -22,7 +20,6 @@ public interface IDhApiUnsafeWrapper extends ICoreDhApiUnsafeWrapper
* in order to determine what object this method returns for
* the specific version of Minecraft you are developing for.
*/
- @Override
public Object getWrappedMcObject_UNSAFE();
}
diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/override/AbstractDhApiWorldGenerator.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/override/AbstractDhApiWorldGenerator.java
index e14f574b6..ebc66b6c4 100644
--- a/api/src/main/java/com/seibel/lod/api/items/interfaces/override/AbstractDhApiWorldGenerator.java
+++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/override/AbstractDhApiWorldGenerator.java
@@ -4,37 +4,24 @@ import com.seibel.lod.api.items.enums.worldGeneration.EDhApiWorldGenerationStep;
import com.seibel.lod.api.items.enums.worldGeneration.EDhApiWorldGenThreadMode;
import com.seibel.lod.api.items.interfaces.world.IDhApiChunkWrapper;
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.override.worldGenerator.ICoreDhApiWorldGenerator;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.world.ICoreDhApiLevelWrapper;
-import com.seibel.lod.core.api.external.coreImplementations.objects.converters.GenericEnumConverter;
-import com.seibel.lod.core.enums.worldGeneration.EWorldGenThreadMode;
-import com.seibel.lod.core.enums.worldGeneration.EWorldGenerationStep;
-import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
/**
* @author James Seibel
* @version 2022-9-8
*/
-public abstract class AbstractDhApiWorldGenerator implements ICoreDhApiWorldGenerator, IDhApiOverrideable
-{
- private final GenericEnumConverter threadModeEnumConverter = new GenericEnumConverter<>(EWorldGenThreadMode.class, EDhApiWorldGenThreadMode.class);
- private final GenericEnumConverter generationStepEnumConverter = new GenericEnumConverter<>(EWorldGenerationStep.class, EDhApiWorldGenerationStep.class);
-
-
+public abstract class AbstractDhApiWorldGenerator implements IDhApiOverrideable
+{
/** Returns which thread chunk generation requests can be created on. */
public abstract EDhApiWorldGenThreadMode getThreadingMode();
- @Override
- public EWorldGenThreadMode getCoreThreadingMode()
+ public EDhApiWorldGenThreadMode getCoreThreadingMode()
{
- return threadModeEnumConverter.convertToCoreType(this.getThreadingMode());
+ return this.getThreadingMode();
}
public abstract IDhApiChunkWrapper generateChunk(int chunkPosX, int chunkPosZ, IDhApiLevelWrapper serverLevelWrapper, EDhApiWorldGenerationStep maxStepToGenerate);
- @Override
- public final IChunkWrapper generateCoreChunk(int chunkPosX, int chunkPosZ, ICoreDhApiLevelWrapper serverLevelWrapper, EWorldGenerationStep maxStepToGenerate)
+ public final IDhApiChunkWrapper generateCoreChunk(int chunkPosX, int chunkPosZ, IDhApiLevelWrapper serverLevelWrapper, EDhApiWorldGenerationStep maxStepToGenerate)
{
// TODO probably need to change the return type
return null; //generateChunk(chunkPosX, chunkPosZ, null, generationStepEnumConverter.convertToApiType(maxStepToGenerate));
diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/override/IDhApiOverrideable.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/override/IDhApiOverrideable.java
index bddb9617f..bd0ef9c36 100644
--- a/api/src/main/java/com/seibel/lod/api/items/interfaces/override/IDhApiOverrideable.java
+++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/override/IDhApiOverrideable.java
@@ -1,8 +1,7 @@
package com.seibel.lod.api.items.interfaces.override;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.override.ICoreDhApiOverrideable;
import com.seibel.lod.core.dependencyInjection.IBindable;
-import com.seibel.lod.core.dependencyInjection.OverrideInjector;
+import com.seibel.lod.core.dependencyInjection.IOverrideInjector;
/**
* Implemented by all DhApi objects that can be overridden.
@@ -10,13 +9,12 @@ import com.seibel.lod.core.dependencyInjection.OverrideInjector;
* @author James Seibel
* @version 2022-9-5
*/
-public interface IDhApiOverrideable extends ICoreDhApiOverrideable, IBindable
+public interface IDhApiOverrideable extends IBindable
{
/**
* Returns when this Override should be used.
* For most developers this can be left at the default.
*/
- @Override
- default int getPriority() { return OverrideInjector.DEFAULT_NON_CORE_OVERRIDE_PRIORITY; }
+ default int getPriority() { return IOverrideInjector.DEFAULT_NON_CORE_OVERRIDE_PRIORITY; }
}
diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/override/worldGenerator/IDhApiWorldGenerator.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/override/worldGenerator/IDhApiWorldGenerator.java
new file mode 100644
index 000000000..62154137b
--- /dev/null
+++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/override/worldGenerator/IDhApiWorldGenerator.java
@@ -0,0 +1,20 @@
+package com.seibel.lod.api.items.interfaces.override.worldGenerator;
+
+import com.seibel.lod.api.items.enums.worldGeneration.EDhApiWorldGenThreadMode;
+import com.seibel.lod.api.items.enums.worldGeneration.EDhApiWorldGenerationStep;
+import com.seibel.lod.api.items.interfaces.override.IDhApiOverrideable;
+import com.seibel.lod.api.items.interfaces.world.IDhApiChunkWrapper;
+import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
+
+/**
+ * @author James Seibel
+ * @version 2022-9-8
+ */
+public interface IDhApiWorldGenerator extends IDhApiOverrideable
+{
+ /** Returns which thread chunk generation requests can be created on. */
+ EDhApiWorldGenThreadMode getCoreThreadingMode();
+
+ IDhApiChunkWrapper generateCoreChunk(int chunkPosX, int chunkPosZ, IDhApiLevelWrapper serverLevelWrapper, EDhApiWorldGenerationStep maxStepToGenerate);
+
+}
diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/world/IDhApiDimensionTypeWrapper.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/world/IDhApiDimensionTypeWrapper.java
index 36364dedf..872f20828 100644
--- a/api/src/main/java/com/seibel/lod/api/items/interfaces/world/IDhApiDimensionTypeWrapper.java
+++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/world/IDhApiDimensionTypeWrapper.java
@@ -20,20 +20,16 @@
package com.seibel.lod.api.items.interfaces.world;
import com.seibel.lod.api.items.interfaces.IDhApiUnsafeWrapper;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.world.ICoreDhApiDimensionTypeWrapper;
/**
* @author James Seibel
* @version 2022-7-14
*/
-public interface IDhApiDimensionTypeWrapper extends ICoreDhApiDimensionTypeWrapper, IDhApiUnsafeWrapper
+public interface IDhApiDimensionTypeWrapper extends IDhApiUnsafeWrapper
{
- @Override
String getDimensionName();
- @Override
boolean hasCeiling();
- @Override
boolean hasSkyLight();
}
diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/world/IDhApiLevelWrapper.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/world/IDhApiLevelWrapper.java
index 9191efe70..0409b1c9b 100644
--- a/api/src/main/java/com/seibel/lod/api/items/interfaces/world/IDhApiLevelWrapper.java
+++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/world/IDhApiLevelWrapper.java
@@ -21,7 +21,6 @@ package com.seibel.lod.api.items.interfaces.world;
import com.seibel.lod.api.items.interfaces.IDhApiUnsafeWrapper;
import com.seibel.lod.api.items.enums.worldGeneration.EDhApiLevelType;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.world.ICoreDhApiLevelWrapper;
/**
* Can be either a Server or Client level.
@@ -29,22 +28,18 @@ import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.
* @author James Seibel
* @version 2022-7-14
*/
-public interface IDhApiLevelWrapper extends ICoreDhApiLevelWrapper, IDhApiUnsafeWrapper
+public interface IDhApiLevelWrapper extends IDhApiUnsafeWrapper
{
IDhApiDimensionTypeWrapper getDimensionType();
EDhApiLevelType getLevelType();
- @Override
boolean hasCeiling();
- @Override
boolean hasSkyLight();
- @Override
int getHeight();
- @Override
default int getMinHeight() { return 0; }
}
diff --git a/api/src/main/java/com/seibel/lod/api/items/objects/math/DhApiMat4f.java b/api/src/main/java/com/seibel/lod/api/items/objects/math/DhApiMat4f.java
deleted file mode 100644
index 81301f792..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/objects/math/DhApiMat4f.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.objects.math;
-
-import com.seibel.lod.core.util.math.Mat4f;
-
-/**
- * A simple way to store a 4x4 array
- * of floats without having to worry
- * about remembering which array is columns
- * and which one is rows.
- *
- * Based on Minecraft 1.16's implementation
- * of a 4x4 matrix.
- *
- * @author James Seibel
- * @version 2022-8-21
- */
-public class DhApiMat4f
-{
- private float m00;
- private float m01;
- private float m02;
- private float m03;
- private float m10;
- private float m11;
- private float m12;
- private float m13;
- private float m20;
- private float m21;
- private float m22;
- private float m23;
- private float m30;
- private float m31;
- private float m32;
- private float m33;
-
-
- public DhApiMat4f()
- {
-
- }
-
- public DhApiMat4f(DhApiMat4f sourceMatrix)
- {
- this.m00 = sourceMatrix.m00;
- this.m01 = sourceMatrix.m01;
- this.m02 = sourceMatrix.m02;
- this.m03 = sourceMatrix.m03;
- this.m10 = sourceMatrix.m10;
- this.m11 = sourceMatrix.m11;
- this.m12 = sourceMatrix.m12;
- this.m13 = sourceMatrix.m13;
- this.m20 = sourceMatrix.m20;
- this.m21 = sourceMatrix.m21;
- this.m22 = sourceMatrix.m22;
- this.m23 = sourceMatrix.m23;
- this.m30 = sourceMatrix.m30;
- this.m31 = sourceMatrix.m31;
- this.m32 = sourceMatrix.m32;
- this.m33 = sourceMatrix.m33;
- }
-
- public DhApiMat4f(float[] values)
- {
- m00 = values[0];
- m01 = values[1];
- m02 = values[2];
- m03 = values[3];
- m10 = values[4];
- m11 = values[5];
- m12 = values[6];
- m13 = values[7];
- m20 = values[8];
- m21 = values[9];
- m22 = values[10];
- m23 = values[11];
- m30 = values[12];
- m31 = values[13];
- m32 = values[14];
- m33 = values[15];
- }
-
- public DhApiMat4f(Mat4f sourceMatrix)
- {
- this(sourceMatrix.getValuesAsArray());
- }
-
-
-
- /** Returns the values of this matrix in row major order (AKA rows then columns) */
- private float[] getValuesAsArray()
- {
- return new float[] {
- this.m00,
- this.m01,
- this.m02,
- this.m03,
-
- this.m10,
- this.m11,
- this.m12,
- this.m13,
-
- this.m20,
- this.m21,
- this.m22,
- this.m23,
-
- this.m30,
- this.m31,
- this.m32,
- this.m33,
- };
- }
-
-
-
- @Override
- public boolean equals(Object obj)
- {
- if (this == obj)
- {
- return true;
- }
- else if (obj != null && this.getClass() == obj.getClass())
- {
- DhApiMat4f otherMatrix = (DhApiMat4f) obj;
- return Float.compare(otherMatrix.m00, this.m00) == 0
- && Float.compare(otherMatrix.m01, this.m01) == 0
- && Float.compare(otherMatrix.m02, this.m02) == 0
- && Float.compare(otherMatrix.m03, this.m03) == 0
- && Float.compare(otherMatrix.m10, this.m10) == 0
- && Float.compare(otherMatrix.m11, this.m11) == 0
- && Float.compare(otherMatrix.m12, this.m12) == 0
- && Float.compare(otherMatrix.m13, this.m13) == 0
- && Float.compare(otherMatrix.m20, this.m20) == 0
- && Float.compare(otherMatrix.m21, this.m21) == 0
- && Float.compare(otherMatrix.m22, this.m22) == 0
- && Float.compare(otherMatrix.m23, this.m23) == 0
- && Float.compare(otherMatrix.m30, this.m30) == 0
- && Float.compare(otherMatrix.m31, this.m31) == 0
- && Float.compare(otherMatrix.m32, this.m32) == 0
- && Float.compare(otherMatrix.m33, this.m33) == 0;
- }
- else
- {
- return false;
- }
- }
-
- @Override
- public int hashCode()
- {
- int i = this.m00 != 0.0F ? Float.floatToIntBits(this.m00) : 0;
- i = 31 * i + (this.m01 != 0.0F ? Float.floatToIntBits(this.m01) : 0);
- i = 31 * i + (this.m02 != 0.0F ? Float.floatToIntBits(this.m02) : 0);
- i = 31 * i + (this.m03 != 0.0F ? Float.floatToIntBits(this.m03) : 0);
- i = 31 * i + (this.m10 != 0.0F ? Float.floatToIntBits(this.m10) : 0);
- i = 31 * i + (this.m11 != 0.0F ? Float.floatToIntBits(this.m11) : 0);
- i = 31 * i + (this.m12 != 0.0F ? Float.floatToIntBits(this.m12) : 0);
- i = 31 * i + (this.m13 != 0.0F ? Float.floatToIntBits(this.m13) : 0);
- i = 31 * i + (this.m20 != 0.0F ? Float.floatToIntBits(this.m20) : 0);
- i = 31 * i + (this.m21 != 0.0F ? Float.floatToIntBits(this.m21) : 0);
- i = 31 * i + (this.m22 != 0.0F ? Float.floatToIntBits(this.m22) : 0);
- i = 31 * i + (this.m23 != 0.0F ? Float.floatToIntBits(this.m23) : 0);
- i = 31 * i + (this.m30 != 0.0F ? Float.floatToIntBits(this.m30) : 0);
- i = 31 * i + (this.m31 != 0.0F ? Float.floatToIntBits(this.m31) : 0);
- i = 31 * i + (this.m32 != 0.0F ? Float.floatToIntBits(this.m32) : 0);
- return 31 * i + (this.m33 != 0.0F ? Float.floatToIntBits(this.m33) : 0);
- }
-
-
- @Override
- public String toString()
- {
- return "Matrix4f:\n" +
- this.m00 + " " + this.m01 + " " + this.m02 + " " + this.m03 + "\n" +
- this.m10 + " " + this.m11 + " " + this.m12 + " " + this.m13 + "\n" +
- this.m20 + " " + this.m21 + " " + this.m22 + " " + this.m23 + "\n" +
- this.m30 + " " + this.m31 + " " + this.m32 + " " + this.m33 + "\n";
- }
-
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/objects/wrappers/DhApiDimensionTypeWrapper.java b/api/src/main/java/com/seibel/lod/api/items/objects/wrappers/DhApiDimensionTypeWrapper.java
deleted file mode 100644
index e60b17618..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/objects/wrappers/DhApiDimensionTypeWrapper.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.objects.wrappers;
-
-import com.seibel.lod.api.items.interfaces.IDhApiUnsafeWrapper;
-import com.seibel.lod.api.items.interfaces.world.IDhApiDimensionTypeWrapper;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.ICoreDhApiUnsafeWrapper;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.world.ICoreDhApiDimensionTypeWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.IDimensionTypeWrapper;
-
-/**
- * @author James Seibel
- * @version 2022-9-8
- */
-public class DhApiDimensionTypeWrapper implements IDhApiDimensionTypeWrapper
-{
- private final IDimensionTypeWrapper dimensionTypeWrapper;
-
-
- public DhApiDimensionTypeWrapper(IDimensionTypeWrapper newDimensionTypeWrapper)
- {
- this.dimensionTypeWrapper = newDimensionTypeWrapper;
- }
-
-
-
- @Override
- public String getDimensionName() { return this.dimensionTypeWrapper.getDimensionName(); }
-
- @Override
- public boolean hasCeiling() { return this.dimensionTypeWrapper.hasCeiling(); }
-
- @Override
- public boolean hasSkyLight() { return this.dimensionTypeWrapper.hasSkyLight(); }
-
-
- @Override
- public Object getWrappedMcObject_UNSAFE() { return this.dimensionTypeWrapper.getWrappedMcObject(); }
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/items/objects/wrappers/DhApiLevelWrapper.java b/api/src/main/java/com/seibel/lod/api/items/objects/wrappers/DhApiLevelWrapper.java
deleted file mode 100644
index 901f00abd..000000000
--- a/api/src/main/java/com/seibel/lod/api/items/objects/wrappers/DhApiLevelWrapper.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.api.items.objects.wrappers;
-
-import com.seibel.lod.api.items.enums.worldGeneration.EDhApiLevelType;
-import com.seibel.lod.api.items.interfaces.world.IDhApiDimensionTypeWrapper;
-import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.IClientLevelWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.IDimensionTypeWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.IServerLevelWrapper;
-
-/**
- * Can be either a Server or Client level.
- *
- * @author James Seibel
- * @version 2022-9-10
- */
-public class DhApiLevelWrapper implements IDhApiLevelWrapper
-{
- private final ILevelWrapper coreLevelWrapper;
- private final IDimensionTypeWrapper coreDimensionTypeWrapper;
-
-
- public DhApiLevelWrapper(ILevelWrapper newLevelWrapper)
- {
- this.coreLevelWrapper = newLevelWrapper;
- this.coreDimensionTypeWrapper = this.coreLevelWrapper.getDimensionType();
- }
-
-
- @Override
- public IDhApiDimensionTypeWrapper getDimensionType() { return new DhApiDimensionTypeWrapper(this.coreDimensionTypeWrapper); }
-
- @Override
- public EDhApiLevelType getLevelType()
- {
- if (this.coreLevelWrapper.getClass().isAssignableFrom(IClientLevelWrapper.class))
- {
- return EDhApiLevelType.CLIENT_LEVEL;
- }
- else if (this.coreLevelWrapper.getClass().isAssignableFrom(IServerLevelWrapper.class))
- {
- return EDhApiLevelType.CLIENT_LEVEL;
- }
- else
- {
- // shouldn't normally happen, but just in case
- return EDhApiLevelType.UNKNOWN;
- }
- }
-
- @Override
- public boolean hasCeiling() { return this.coreLevelWrapper.hasCeiling(); }
-
- @Override
- public boolean hasSkyLight() { return this.coreLevelWrapper.hasSkyLight(); }
-
- @Override
- public int getHeight() { return this.coreLevelWrapper.getHeight(); }
-
- @Override
- public int getMinHeight() { return this.coreLevelWrapper.getMinHeight(); }
-
-
- @Override
- public Object getWrappedMcObject_UNSAFE() { return this.coreLevelWrapper.unwrapLevel(); }
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/methods/config/DhApiConfig.java b/api/src/main/java/com/seibel/lod/api/methods/config/DhApiConfig.java
index 63e983adc..6cdc6ab93 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/config/DhApiConfig.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/config/DhApiConfig.java
@@ -1,9 +1,9 @@
package com.seibel.lod.api.methods.config;
import com.seibel.lod.api.items.interfaces.config.IDhApiConfig;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.config.IConverter;
-import com.seibel.lod.core.api.external.coreImplementations.objects.converters.DefaultConverter;
-import com.seibel.lod.core.config.types.ConfigEntry;
+import com.seibel.lod.core.interfaces.config.IConfigEntry;
+import com.seibel.lod.core.interfaces.config.IConverter;
+import com.seibel.lod.core.interfaces.config.converters.DefaultConverter;
/**
* A wrapper used to interface with Distant Horizon's Config.
@@ -18,7 +18,7 @@ import com.seibel.lod.core.config.types.ConfigEntry;
*/
public class DhApiConfig implements IDhApiConfig
{
- private final ConfigEntry configEntry;
+ private final IConfigEntry configEntry;
private final IConverter configConverter;
@@ -30,7 +30,7 @@ public class DhApiConfig implements IDhApiConfig
* Uses the default object converter, this requires coreType and apiType to be the same.
*/
@SuppressWarnings("unchecked") // DefaultConverter's cast is safe
- public DhApiConfig(ConfigEntry newConfigEntry)
+ public DhApiConfig(IConfigEntry newConfigEntry)
{
this.configEntry = newConfigEntry;
this.configConverter = (IConverter) new DefaultConverter();
@@ -40,7 +40,7 @@ public class DhApiConfig implements IDhApiConfig
* This constructor should only be called internally.
* There is no reason for API users to create this object.
*/
- public DhApiConfig(ConfigEntry newConfigEntry, IConverter newConverter)
+ public DhApiConfig(IConfigEntry newConfigEntry, IConverter newConverter)
{
this.configEntry = newConfigEntry;
this.configConverter = newConverter;
@@ -53,7 +53,7 @@ public class DhApiConfig implements IDhApiConfig
public boolean setValue(apiType newValue)
{
- if (this.configEntry.allowApiOverride)
+ if (this.configEntry.getAllowApiOverride())
{
this.configEntry.setApiValue(this.configConverter.convertToCoreType(newValue));
return true;
@@ -64,7 +64,7 @@ public class DhApiConfig implements IDhApiConfig
}
}
- public boolean getCanBeOverrodeByApi() { return this.configEntry.allowApiOverride; }
+ public boolean getCanBeOverrodeByApi() { return this.configEntry.getAllowApiOverride(); }
public apiType getDefaultValue() { return this.configConverter.convertToApiType(configEntry.getDefaultValue()); }
public apiType getMaxValue() { return this.configConverter.convertToApiType(this.configEntry.getMax()); }
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/DhApiEventRegister.java b/api/src/main/java/com/seibel/lod/api/methods/events/DhApiEventRegister.java
index bac209f8f..447dd2285 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/DhApiEventRegister.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/DhApiEventRegister.java
@@ -1,8 +1,7 @@
package com.seibel.lod.api.methods.events;
import com.seibel.lod.api.items.objects.DhApiResult;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
-import com.seibel.lod.core.dependencyInjection.DhApiEventInjector;
+import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
/**
* Handles adding/removing event handlers.
@@ -18,11 +17,11 @@ public class DhApiEventRegister
* If multiple of the same eventHandler are added DhApiResult will return
* the name of the already added handler and success = false.
*/
- public static DhApiResult on(Class extends ICoreDhApiEvent> eventInterface, ICoreDhApiEvent eventHandlerImplementation)
+ public static DhApiResult on(Class extends IDhApiEvent> eventInterface, IDhApiEvent eventHandlerImplementation)
{
try
{
- DhApiEventInjector.INSTANCE.bind(eventInterface, eventHandlerImplementation);
+// DhApiEventInjector.INSTANCE.bind(eventInterface, eventHandlerImplementation);
return DhApiResult.createSuccess();
}
catch (IllegalStateException e)
@@ -36,16 +35,16 @@ public class DhApiEventRegister
* If no eventHandler of the given class has been registered the result will return
* success = false.
*/
- public static DhApiResult off(Class extends ICoreDhApiEvent> eventInterface, Class eventHandlerClass)
+ public static DhApiResult off(Class extends IDhApiEvent> eventInterface, Class eventHandlerClass)
{
- if (DhApiEventInjector.INSTANCE.unbind(eventInterface, eventHandlerClass))
- {
- return DhApiResult.createSuccess();
- }
- else
- {
+// if (DhApiEventInjector.INSTANCE.unbind(eventInterface, eventHandlerClass))
+// {
+// return DhApiResult.createSuccess();
+// }
+// else
+// {
return DhApiResult.createFail("No event handler [" + eventHandlerClass.getSimpleName() + "] was bound for the event [" + eventInterface.getSimpleName() + "].");
- }
+// }
}
}
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiAfterDhInitEvent.java b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiAfterDhInitEvent.java
index 03d63c0f3..ba576877d 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiAfterDhInitEvent.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiAfterDhInitEvent.java
@@ -1,15 +1,13 @@
package com.seibel.lod.api.methods.events.abstractEvents;
import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiAfterDhInitEvent;
/**
* @author James Seibel
* @version 2022-9-6
*/
public abstract class DhApiAfterDhInitEvent
- extends CoreDhApiAfterDhInitEvent
- implements IDhApiEvent
+ implements IDhApiEvent
{
/** Fired after Distant Horizons finishes its initial setup on Minecraft startup. */
public abstract void afterDistantHorizonsInit();
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiAfterRenderEvent.java b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiAfterRenderEvent.java
index 6e711e8d8..700dd9065 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiAfterRenderEvent.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiAfterRenderEvent.java
@@ -2,15 +2,14 @@ package com.seibel.lod.api.methods.events.abstractEvents;
import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
import com.seibel.lod.api.methods.events.sharedParameterObjects.DhApiRenderParam;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiAfterRenderEvent;
+import com.seibel.lod.core.util.math.Mat4f;
/**
* @author James Seibel
* @version 2022-9-6
*/
public abstract class DhApiAfterRenderEvent
- extends CoreDhApiAfterRenderEvent
- implements IDhApiEvent
+ implements IDhApiEvent
{
/** Fired after Distant Horizons finishes rendering fake chunks. */
public abstract void afterRender(EventParam input);
@@ -21,9 +20,9 @@ public abstract class DhApiAfterRenderEvent
//=========================//
@Override
- public final boolean fireEvent(CoreEventParam input)
+ public final boolean fireEvent(EventParam input)
{
- afterRender(new EventParam(input));
+ afterRender(input);
return false;
}
@@ -37,7 +36,10 @@ public abstract class DhApiAfterRenderEvent
public static class EventParam extends DhApiRenderParam
{
- public EventParam(CoreEventParam dhApiRenderParam) { super(dhApiRenderParam); }
+ public EventParam(DhApiRenderParam parent)
+ {
+ super(parent.mcProjectionMatrix, parent.mcModelViewMatrix, parent.dhProjectionMatrix, parent.dhModelViewMatrix, parent.partialTicks);
+ }
}
}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiBeforeDhInitEvent.java b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiBeforeDhInitEvent.java
index a07f13245..c50f3fdc8 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiBeforeDhInitEvent.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiBeforeDhInitEvent.java
@@ -3,15 +3,13 @@ package com.seibel.lod.api.methods.events.abstractEvents;
import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiBeforeDhInitEvent;
/**
* @author James Seibel
* @version 2022-9-6
*/
public abstract class DhApiBeforeDhInitEvent
- extends CoreDhApiBeforeDhInitEvent
- implements IDhApiEvent
+ implements IDhApiEvent
{
/** Fired before Distant Horizons starts its initial setup on Minecraft startup. */
public abstract void beforeDistantHorizonsInit();
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiBeforeRenderEvent.java b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiBeforeRenderEvent.java
index 37bd31af1..8bdb4698a 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiBeforeRenderEvent.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiBeforeRenderEvent.java
@@ -2,15 +2,14 @@ package com.seibel.lod.api.methods.events.abstractEvents;
import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
import com.seibel.lod.api.methods.events.sharedParameterObjects.DhApiRenderParam;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiBeforeRenderEvent;
+import com.seibel.lod.core.util.math.Mat4f;
/**
* @author James Seibel
* @version 2022-9-6
*/
public abstract class DhApiBeforeRenderEvent
- extends CoreDhApiBeforeRenderEvent
- implements IDhApiEvent
+ implements IDhApiEvent
{
/**
* Fired before Distant Horizons renders fake chunks.
@@ -25,7 +24,7 @@ public abstract class DhApiBeforeRenderEvent
//=========================//
@Override
- public final boolean fireEvent(CoreEventParam input) { return beforeRender(new EventParam(input)); }
+ public final boolean fireEvent(EventParam input) { return beforeRender(input); }
@Override
public final boolean getCancelable() { return true; }
@@ -37,7 +36,10 @@ public abstract class DhApiBeforeRenderEvent
public static class EventParam extends DhApiRenderParam
{
- public EventParam(CoreEventParam dhApiRenderParam) { super(dhApiRenderParam); }
+ public EventParam(DhApiRenderParam parent)
+ {
+ super(parent.mcProjectionMatrix, parent.mcModelViewMatrix, parent.dhProjectionMatrix, parent.dhModelViewMatrix, parent.partialTicks);
+ }
}
}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelLoadEvent.java b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelLoadEvent.java
index ab678bb4a..2d5f147e7 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelLoadEvent.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelLoadEvent.java
@@ -1,18 +1,14 @@
package com.seibel.lod.api.methods.events.abstractEvents;
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
-import com.seibel.lod.api.items.objects.wrappers.DhApiLevelWrapper;
import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiLevelLoadEvent;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
/**
* @author James Seibel
* @version 2022-9-10
*/
public abstract class DhApiLevelLoadEvent
- extends CoreDhApiLevelLoadEvent
- implements IDhApiEvent
+ implements IDhApiEvent
{
/** Fired after Distant Horizons loads a new level. */
public abstract void onLevelLoad(EventParam input);
@@ -23,9 +19,9 @@ public abstract class DhApiLevelLoadEvent
//=========================//
@Override
- public final boolean fireEvent(CoreEventParam input)
+ public final boolean fireEvent(EventParam input)
{
- onLevelLoad(new EventParam(input.levelWrapper));
+ onLevelLoad(input);
return false;
}
@@ -43,7 +39,7 @@ public abstract class DhApiLevelLoadEvent
public final IDhApiLevelWrapper levelWrapper;
- public EventParam(ILevelWrapper newLevelWrapper) { this.levelWrapper = new DhApiLevelWrapper(newLevelWrapper); }
+ public EventParam(IDhApiLevelWrapper newLevelWrapper) { this.levelWrapper = newLevelWrapper; }
}
}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelSaveEvent.java b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelSaveEvent.java
index f241a62c2..e64675489 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelSaveEvent.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelSaveEvent.java
@@ -1,18 +1,14 @@
package com.seibel.lod.api.methods.events.abstractEvents;
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
-import com.seibel.lod.api.items.objects.wrappers.DhApiLevelWrapper;
import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiLevelSaveEvent;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
/**
* @author James Seibel
* @version 2022-9-10
*/
public abstract class DhApiLevelSaveEvent
- extends CoreDhApiLevelSaveEvent
- implements IDhApiEvent
+ implements IDhApiEvent
{
/** Fired after Distant Horizons saves LOD data for the server. */
public abstract void onLevelSave(EventParam input);
@@ -23,9 +19,9 @@ public abstract class DhApiLevelSaveEvent
//=========================//
@Override
- public final boolean fireEvent(CoreDhApiLevelSaveEvent.CoreEventParam input)
+ public final boolean fireEvent(EventParam input)
{
- onLevelSave(new EventParam(input.levelWrapper));
+ onLevelSave(input);
return false;
}
@@ -43,7 +39,7 @@ public abstract class DhApiLevelSaveEvent
public final IDhApiLevelWrapper levelWrapper;
- public EventParam(ILevelWrapper newLevelWrapper) { this.levelWrapper = new DhApiLevelWrapper(newLevelWrapper); }
+ public EventParam(IDhApiLevelWrapper newLevelWrapper) { this.levelWrapper = newLevelWrapper; }
}
}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelUnloadEvent.java b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelUnloadEvent.java
index 1e2673519..30c8ee0d4 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelUnloadEvent.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/abstractEvents/DhApiLevelUnloadEvent.java
@@ -1,18 +1,14 @@
package com.seibel.lod.api.methods.events.abstractEvents;
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
-import com.seibel.lod.api.items.objects.wrappers.DhApiLevelWrapper;
import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiLevelUnloadEvent;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
/**
* @author James Seibel
* @version 2022-9-10
*/
-public abstract class DhApiLevelUnloadEvent
- extends CoreDhApiLevelUnloadEvent
- implements IDhApiEvent
+public abstract class DhApiLevelUnloadEvent
+ implements IDhApiEvent
{
/** Fired before Distant Horizons unloads a level. */
public abstract void onLevelUnload(EventParam input);
@@ -23,9 +19,9 @@ public abstract class DhApiLevelUnloadEvent
//=========================//
@Override
- public final boolean fireEvent(CoreDhApiLevelUnloadEvent.CoreEventParam input)
+ public final boolean fireEvent(EventParam input)
{
- onLevelUnload(new EventParam(input.levelWrapper));
+ onLevelUnload(input);
return false;
}
@@ -43,7 +39,7 @@ public abstract class DhApiLevelUnloadEvent
public final IDhApiLevelWrapper levelWrapper;
- public EventParam(ILevelWrapper newLevelWrapper) { this.levelWrapper = new DhApiLevelWrapper(newLevelWrapper); }
+ public EventParam(IDhApiLevelWrapper newLevelWrapper) { this.levelWrapper = newLevelWrapper; }
}
}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/interfaces/IDhApiEvent.java b/api/src/main/java/com/seibel/lod/api/methods/events/interfaces/IDhApiEvent.java
index 60a4c25ff..0d1ea70ef 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/interfaces/IDhApiEvent.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/interfaces/IDhApiEvent.java
@@ -1,22 +1,22 @@
package com.seibel.lod.api.methods.events.interfaces;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
import com.seibel.lod.core.dependencyInjection.IBindable;
/**
* A combination of all interfaces required by all
* DH Api events.
*
- * @param This is the datatype that will be passed into the
- * event handler's method.
- * @param This is the datatype that will be passed in from Core
- * when the event is fired.
+ * @param This is the datatype that will be passed into the event handler's method.
*
* @author James Seibel
* @version 2022-9-6
*/
-public interface IDhApiEvent extends ICoreDhApiEvent, IBindable
+public interface IDhApiEvent extends IBindable
{
+ //==========//
+ // external //
+ //==========//
+
/**
* Returns if the event should be automatically unbound
* after firing.
@@ -24,7 +24,25 @@ public interface IDhApiEvent extends ICoreDhApiEven
*
* Defaults to False (the event will not be removed after firing).
*/
- @Override
default boolean removeAfterFiring() { return false; };
+
+ //==========//
+ // internal //
+ //==========//
+
+ /** Returns true if the event can be canceled. */
+ boolean getCancelable();
+
+ /**
+ * Called internally by Distant Horizons when the event happens.
+ * This method shouldn't directly be overridden and
+ * should call a more specific method instead.
+ *
+ * @param input the parameter object passed in from the event source. Can be null.
+ * @return whether the event should be canceled or not.
+ * A canceled event will still fire the other event handlers that are queued.
+ */
+ boolean fireEvent(T input);
+
}
diff --git a/api/src/main/java/com/seibel/lod/api/methods/events/sharedParameterObjects/DhApiRenderParam.java b/api/src/main/java/com/seibel/lod/api/methods/events/sharedParameterObjects/DhApiRenderParam.java
index f9d799e93..db5d29545 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/events/sharedParameterObjects/DhApiRenderParam.java
+++ b/api/src/main/java/com/seibel/lod/api/methods/events/sharedParameterObjects/DhApiRenderParam.java
@@ -1,7 +1,6 @@
package com.seibel.lod.api.methods.events.sharedParameterObjects;
-import com.seibel.lod.api.items.objects.math.DhApiMat4f;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.sharedParameterObjects.CoreDhApiRenderParam;
+import com.seibel.lod.core.util.math.Mat4f;
/**
* Parameter passed into Render events.
@@ -12,29 +11,32 @@ import com.seibel.lod.core.api.external.coreImplementations.objects.events.share
public class DhApiRenderParam
{
/** The projection matrix Minecraft is using to render this frame. */
- public final DhApiMat4f mcProjectionMatrix;
+ public final Mat4f mcProjectionMatrix;
/** The model view matrix Minecraft is using to render this frame. */
- public final DhApiMat4f mcModelViewMatrix;
+ public final Mat4f mcModelViewMatrix;
/** The projection matrix Distant Horizons is using to render this frame. */
- public final DhApiMat4f dhProjectionMatrix;
+ public final Mat4f dhProjectionMatrix;
/** The model view matrix Distant Horizons is using to render this frame. */
- public final DhApiMat4f dhModelViewMatrix;
+ public final Mat4f dhModelViewMatrix;
/** Indicates how far into this tick the frame is. */
public final float partialTicks;
- public DhApiRenderParam(CoreDhApiRenderParam param)
+ public DhApiRenderParam(
+ Mat4f newMcProjectionMatrix, Mat4f newMcModelViewMatrix,
+ Mat4f newDhProjectionMatrix, Mat4f newDhModelViewMatrix,
+ float newPartialTicks)
{
- this.mcProjectionMatrix = new DhApiMat4f(param.mcProjectionMatrix);
- this.mcModelViewMatrix = new DhApiMat4f(param.mcModelViewMatrix);
+ this.mcProjectionMatrix = newMcProjectionMatrix;
+ this.mcModelViewMatrix = newMcModelViewMatrix;
- this.dhProjectionMatrix = new DhApiMat4f(param.dhProjectionMatrix);
- this.dhModelViewMatrix = new DhApiMat4f(param.dhModelViewMatrix);
+ this.dhProjectionMatrix = newDhProjectionMatrix;
+ this.dhModelViewMatrix = newDhModelViewMatrix;
- this.partialTicks = param.partialTicks;
+ this.partialTicks = newPartialTicks;
}
}
diff --git a/api/src/main/java/com/seibel/lod/api/override/DhApiWorldGeneratorOverrideRegister.java b/api/src/main/java/com/seibel/lod/api/override/DhApiWorldGeneratorOverrideRegister.java
index 38333e5f0..646994bb8 100644
--- a/api/src/main/java/com/seibel/lod/api/override/DhApiWorldGeneratorOverrideRegister.java
+++ b/api/src/main/java/com/seibel/lod/api/override/DhApiWorldGeneratorOverrideRegister.java
@@ -2,8 +2,6 @@ package com.seibel.lod.api.override;
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
import com.seibel.lod.api.items.objects.DhApiResult;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.override.worldGenerator.ICoreDhApiWorldGenerator;
-import com.seibel.lod.core.dependencyInjection.WorldGeneratorInjector;
/**
* Handles adding world generator overrides.
@@ -21,18 +19,18 @@ public class DhApiWorldGeneratorOverrideRegister
* If another world generator has already been registered, DhApiResult will return
* the name of the previously registered generator and success = false.
*/
- public static DhApiResult registerWorldGeneratorOverride(ICoreDhApiWorldGenerator worldGenerator)
- {
- try
- {
- WorldGeneratorInjector.INSTANCE.bind(worldGenerator);
- return DhApiResult.createSuccess();
- }
- catch (Exception e)
- {
- return DhApiResult.createFail(e.getMessage());
- }
- }
+// public static DhApiResult registerWorldGeneratorOverride(ICoreDhApiWorldGenerator worldGenerator)
+// {
+// try
+// {
+// WorldGeneratorInjector.INSTANCE.bind(worldGenerator);
+// return DhApiResult.createSuccess();
+// }
+// catch (Exception e)
+// {
+// return DhApiResult.createFail(e.getMessage());
+// }
+// }
/**
* Registers the given world generator for the given level.
@@ -41,18 +39,18 @@ public class DhApiWorldGeneratorOverrideRegister
* If another world generator has already been registered, DhApiResult will return
* the name of the previously registered generator and success = false.
*/
- public static DhApiResult registerWorldGeneratorOverride(IDhApiLevelWrapper levelWrapper, ICoreDhApiWorldGenerator worldGenerator)
- {
- try
- {
+// public static DhApiResult registerWorldGeneratorOverride(IDhApiLevelWrapper levelWrapper, ICoreDhApiWorldGenerator worldGenerator)
+// {
+// try
+// {
// WorldGeneratorInjector.INSTANCE.bind(levelWrapper, worldGenerator);
- return DhApiResult.createSuccess();
- }
- catch (Exception e)
- {
- return DhApiResult.createFail(e.getMessage());
- }
- }
+// return DhApiResult.createSuccess();
+// }
+// catch (Exception e)
+// {
+// return DhApiResult.createFail(e.getMessage());
+// }
+// }
}
diff --git a/core/src/main/java/com/seibel/lod/core/ModInfo.java b/api/src/main/java/com/seibel/lod/core/ModInfo.java
similarity index 100%
rename from core/src/main/java/com/seibel/lod/core/ModInfo.java
rename to api/src/main/java/com/seibel/lod/core/ModInfo.java
diff --git a/core/src/main/java/com/seibel/lod/core/dependencyInjection/IBindable.java b/api/src/main/java/com/seibel/lod/core/dependencyInjection/IBindable.java
similarity index 100%
rename from core/src/main/java/com/seibel/lod/core/dependencyInjection/IBindable.java
rename to api/src/main/java/com/seibel/lod/core/dependencyInjection/IBindable.java
diff --git a/api/src/main/java/com/seibel/lod/core/dependencyInjection/IDependencyInjector.java b/api/src/main/java/com/seibel/lod/core/dependencyInjection/IDependencyInjector.java
new file mode 100644
index 000000000..b02272025
--- /dev/null
+++ b/api/src/main/java/com/seibel/lod/core/dependencyInjection/IDependencyInjector.java
@@ -0,0 +1,75 @@
+package com.seibel.lod.core.dependencyInjection;
+
+
+import java.util.ArrayList;
+
+public interface IDependencyInjector
+{
+
+ /**
+ * Links the given implementation object to an interface, so it can be referenced later.
+ *
+ * @param dependencyInterface The interface (or parent class) the implementation object should implement.
+ * @param dependencyImplementation An object that implements the dependencyInterface interface.
+ * @throws IllegalStateException if the interface has already been bound and duplicates aren't allowed
+ * @throws IllegalArgumentException if the implementation object doesn't implement the interface
+ */
+ void bind(Class extends BindableType> dependencyInterface, BindableType dependencyImplementation) throws IllegalStateException, IllegalArgumentException;
+ /**
+ * Checks if classToTest (or one of its ancestors)
+ * implements the given interface.
+ */
+ boolean checkIfClassImplements(Class> classToTest, Class> interfaceToLookFor);
+ /** Checks if classToTest extends the given class. */
+ boolean checkIfClassExtends(Class> classToTest, Class> extensionToLookFor);
+
+
+ /**
+ * This does not return incomplete dependencies.
+ * See {@link #get(Class, boolean) get(Class, boolean)} for full documentation.
+ *
+ * @see #get(Class, boolean)
+ */
+ @SuppressWarnings("unchecked")
+ T get(Class interfaceClass) throws ClassCastException;
+
+ /**
+ * Returns all dependencies of type T that have been bound.
+ * Returns an empty list if no dependencies have been bound.
+ *
+ * @param class of the dependency
+ * (inferred from the objectClass parameter)
+ * @param interfaceClass Interface of the dependency
+ * @return the dependency of type T
+ * @throws ClassCastException If the dependency isn't able to be cast to type T.
+ * (this shouldn't normally happen, unless the bound object changed somehow)
+ */
+ ArrayList getAll(Class interfaceClass) throws ClassCastException;
+
+ /**
+ * Returns a dependency of type T if one has been bound.
+ * Returns null if a dependency hasn't been bound.
+ *
+ * If the handler's {@link #allowDuplicateBindings} is true this returns the first bound dependency.
+ *
+ * @param class of the dependency
+ * (inferred from the interfaceClass parameter)
+ * @param interfaceClass Interface of the dependency
+ * @param allowIncompleteDependencies If true this method will also return dependencies that haven't completed their delayed setup.
+ * @return the dependency of type T
+ * @throws ClassCastException If the dependency isn't able to be cast to type T.
+ * (this shouldn't normally happen, unless the bound object changed somehow)
+ */
+ @SuppressWarnings("unchecked")
+ T get(Class interfaceClass, boolean allowIncompleteDependencies) throws ClassCastException;
+
+
+
+ /** Removes all bound dependencies. */
+ public void clear();
+
+
+
+ /** Runs delayed setup for any dependencies that require it. */
+ void runDelayedSetup();
+}
diff --git a/api/src/main/java/com/seibel/lod/core/dependencyInjection/IOverrideInjector.java b/api/src/main/java/com/seibel/lod/core/dependencyInjection/IOverrideInjector.java
new file mode 100644
index 000000000..3adc2f7d8
--- /dev/null
+++ b/api/src/main/java/com/seibel/lod/core/dependencyInjection/IOverrideInjector.java
@@ -0,0 +1,56 @@
+package com.seibel.lod.core.dependencyInjection;
+
+
+import com.seibel.lod.api.items.interfaces.override.IDhApiOverrideable;
+
+public interface IOverrideInjector
+{
+ /**
+ * All core overrides should have this priority.
+ * Should be lower than MIN_OVERRIDE_PRIORITY.
+ */
+ public static final int CORE_PRIORITY = -1;
+ /**
+ * The lowest priority non-core overrides can have.
+ * Should be higher than CORE_PRIORITY.
+ */
+ public static final int MIN_NON_CORE_OVERRIDE_PRIORITY = 0;
+ /** The priority given to overrides that don't explicitly define a priority. */
+ public static final int DEFAULT_NON_CORE_OVERRIDE_PRIORITY = 10;
+
+
+
+ /**
+ * See {@link IDependencyInjector#bind(Class, IBindable) bind(Class, IBindable)} for full documentation.
+ *
+ * @throws IllegalArgumentException if a non-Distant Horizons Override with the priority CORE is passed in or a invalid priority value.
+ * @throws IllegalStateException if another override with the given priority already has been bound.
+ * @see IDependencyInjector#bind(Class, IBindable)
+ */
+ void bind(Class extends IDhApiOverrideable> dependencyInterface, IDhApiOverrideable dependencyImplementation) throws IllegalStateException, IllegalArgumentException;
+
+ /**
+ * Returns the bound dependency with the highest priority.
+ * See {@link IDependencyInjector#get(Class, boolean) get(Class, boolean)} for full documentation.
+ *
+ * @see IDependencyInjector#get(Class, boolean)
+ */
+ T get(Class interfaceClass) throws ClassCastException;
+
+ /**
+ * Returns a dependency of type T with the specified priority if one has been bound.
+ * If there is a dependency, but it was bound with a different priority this will return null.
+ *
+ * See {@link IDependencyInjector#get(Class, boolean) get(Class, boolean)} for more documentation.
+ *
+ * @see IDependencyInjector#get(Class, boolean)
+ */
+ T get(Class interfaceClass, int priority) throws ClassCastException;
+
+
+
+ /** Removes all bound overrides. */
+ void clear();
+
+
+}
diff --git a/api/src/main/java/com/seibel/lod/core/interfaces/config/IConfigEntry.java b/api/src/main/java/com/seibel/lod/core/interfaces/config/IConfigEntry.java
new file mode 100644
index 000000000..35f361e88
--- /dev/null
+++ b/api/src/main/java/com/seibel/lod/core/interfaces/config/IConfigEntry.java
@@ -0,0 +1,59 @@
+package com.seibel.lod.core.interfaces.config;
+
+
+/**
+ * Use for making the config variables
+ *
+ * @author coolGi
+ * @version 2022-5-26
+ */
+public interface IConfigEntry
+{
+
+ /** Gets the default value of the option */
+ T getDefaultValue();
+
+ void setApiValue(T newApiValue);
+ T getApiValue();
+
+ /** Returns true if this config can be set via the API. */
+ boolean getAllowApiOverride();
+
+ void set(T newValue);
+ T get();
+ T getTrueValue();
+
+ /** Sets the value without saving */
+ void setWithoutSaving(T newValue);
+
+ /** Gets the min value */
+ T getMin();
+ /** Sets the min value */
+ void setMin(T newMin);
+ /** Gets the max value */
+ T getMax();
+ /** Sets the max value */
+ void setMax(T newMax);
+ /** Sets the min and max in 1 setter */
+ void setMinMax(T newMin, T newMax);
+
+ /** Gets the comment */
+ String getComment();
+ /** Sets the comment */
+ void setComment(String newComment);
+
+ /**
+ * Checks if the option is valid
+ *
+ * 0 == valid
+ * 1 == number too high
+ * -1 == number too low
+ */
+ byte isValid();
+ /** Checks if a value is valid */
+ byte isValid(T value);
+
+ /** Is the value of this equal to another */
+ boolean equals(IConfigEntry> obj);
+
+}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/config/IConverter.java b/api/src/main/java/com/seibel/lod/core/interfaces/config/IConverter.java
similarity index 83%
rename from core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/config/IConverter.java
rename to api/src/main/java/com/seibel/lod/core/interfaces/config/IConverter.java
index 6a7d7f674..ec72c638e 100644
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/config/IConverter.java
+++ b/api/src/main/java/com/seibel/lod/core/interfaces/config/IConverter.java
@@ -1,4 +1,4 @@
-package com.seibel.lod.core.api.external.coreImplementations.interfaces.config;
+package com.seibel.lod.core.interfaces.config;
/**
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/converters/DefaultConverter.java b/api/src/main/java/com/seibel/lod/core/interfaces/config/converters/DefaultConverter.java
similarity index 70%
rename from core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/converters/DefaultConverter.java
rename to api/src/main/java/com/seibel/lod/core/interfaces/config/converters/DefaultConverter.java
index 846512a7b..134954f74 100644
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/converters/DefaultConverter.java
+++ b/api/src/main/java/com/seibel/lod/core/interfaces/config/converters/DefaultConverter.java
@@ -1,6 +1,6 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.converters;
+package com.seibel.lod.core.interfaces.config.converters;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.config.IConverter;
+import com.seibel.lod.core.interfaces.config.IConverter;
/**
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/converters/RenderModeEnabledConverter.java b/api/src/main/java/com/seibel/lod/core/interfaces/config/converters/RenderModeEnabledConverter.java
similarity index 68%
rename from core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/converters/RenderModeEnabledConverter.java
rename to api/src/main/java/com/seibel/lod/core/interfaces/config/converters/RenderModeEnabledConverter.java
index 86edf9c92..e43d9ae0f 100644
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/converters/RenderModeEnabledConverter.java
+++ b/api/src/main/java/com/seibel/lod/core/interfaces/config/converters/RenderModeEnabledConverter.java
@@ -1,7 +1,7 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.converters;
+package com.seibel.lod.core.interfaces.config.converters;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.config.IConverter;
-import com.seibel.lod.core.enums.rendering.ERendererMode;
+import com.seibel.lod.api.items.enums.rendering.ERendererMode;
+import com.seibel.lod.core.interfaces.config.IConverter;
/**
* Used for simplifying the fake chunk rendering on/off setting.
diff --git a/api/src/main/java/com/seibel/lod/core/util/MathUtil.java b/api/src/main/java/com/seibel/lod/core/util/MathUtil.java
new file mode 100644
index 000000000..d232be9fc
--- /dev/null
+++ b/api/src/main/java/com/seibel/lod/core/util/MathUtil.java
@@ -0,0 +1,64 @@
+package com.seibel.lod.core.util;
+
+public class MathUtil
+{
+ /**
+ * Clamps the given value between the min and max values.
+ * May behave strangely if min > max.
+ */
+ public static int clamp(int min, int value, int max)
+ {
+ return Math.min(max, Math.max(value, min));
+ }
+
+ /**
+ * Clamps the given value between the min and max values.
+ * May behave strangely if min > max.
+ */
+ public static float clamp(float min, float value, float max)
+ {
+ return Math.min(max, Math.max(value, min));
+ }
+
+ /**
+ * Clamps the given value between the min and max values.
+ * May behave strangely if min > max.
+ */
+ public static double clamp(double min, double value, double max)
+ {
+ return Math.min(max, Math.max(value, min));
+ }
+
+ /**
+ * Like Math.floorDiv, but reverse in that it is a ceilDiv
+ */
+ public static int ceilDiv(int value, int divider) {
+ return -Math.floorDiv(-value, divider);
+ }
+
+ // Why is this not in the standard library?! Come on Java!
+ public static byte min(byte a, byte b) {
+ return a < b ? a : b;
+ }
+ public static byte max(byte a, byte b) {
+ return a > b ? a : b;
+ }
+
+
+ /** This is copied from Minecraft's MathHelper class */
+ public static float fastInvSqrt(float numb)
+ {
+ float half = 0.5F * numb;
+ int i = Float.floatToIntBits(numb);
+ i = 1597463007 - (i >> 1);
+ numb = Float.intBitsToFloat(i);
+ return numb * (1.5F - half * numb * numb);
+ }
+ public static float pow2(float x) {return x*x;}
+ public static double pow2(double x) {return x*x;}
+ public static int pow2(int x) {return x*x;}
+
+ public static long pow2(long x) {return x*x;}
+
+
+}
diff --git a/core/src/main/java/com/seibel/lod/core/util/math/Mat4f.java b/api/src/main/java/com/seibel/lod/core/util/math/Mat4f.java
similarity index 100%
rename from core/src/main/java/com/seibel/lod/core/util/math/Mat4f.java
rename to api/src/main/java/com/seibel/lod/core/util/math/Mat4f.java
diff --git a/core/src/main/java/com/seibel/lod/core/util/math/Vec3d.java b/api/src/main/java/com/seibel/lod/core/util/math/Vec3d.java
similarity index 97%
rename from core/src/main/java/com/seibel/lod/core/util/math/Vec3d.java
rename to api/src/main/java/com/seibel/lod/core/util/math/Vec3d.java
index 403a4f03f..992d35264 100644
--- a/core/src/main/java/com/seibel/lod/core/util/math/Vec3d.java
+++ b/api/src/main/java/com/seibel/lod/core/util/math/Vec3d.java
@@ -19,7 +19,7 @@
package com.seibel.lod.core.util.math;
-import com.seibel.lod.core.util.LodUtil;
+import com.seibel.lod.core.util.MathUtil;
/**
* This is closer to MC's implementation of a
@@ -116,9 +116,9 @@ public class Vec3d
public void clamp(double min, double max)
{
- this.x = LodUtil.clamp(min, this.x, max);
- this.y = LodUtil.clamp(min, this.y, max);
- this.z = LodUtil.clamp(min, this.z, max);
+ this.x = MathUtil.clamp(min, this.x, max);
+ this.y = MathUtil.clamp(min, this.y, max);
+ this.z = MathUtil.clamp(min, this.z, max);
}
public void set(double x, double y, double z)
diff --git a/core/src/main/java/com/seibel/lod/core/util/math/Vec3f.java b/api/src/main/java/com/seibel/lod/core/util/math/Vec3f.java
similarity index 96%
rename from core/src/main/java/com/seibel/lod/core/util/math/Vec3f.java
rename to api/src/main/java/com/seibel/lod/core/util/math/Vec3f.java
index b9e308023..4c50f1a92 100644
--- a/core/src/main/java/com/seibel/lod/core/util/math/Vec3f.java
+++ b/api/src/main/java/com/seibel/lod/core/util/math/Vec3f.java
@@ -19,7 +19,7 @@
package com.seibel.lod.core.util.math;
-import com.seibel.lod.core.util.LodUtil;
+import com.seibel.lod.core.util.MathUtil;
/**
* A (almost) exact copy of Minecraft's 1.16.5
@@ -109,9 +109,9 @@ public class Vec3f
public void clamp(float min, float max)
{
- this.x = LodUtil.clamp(min, this.x, max);
- this.y = LodUtil.clamp(min, this.y, max);
- this.z = LodUtil.clamp(min, this.z, max);
+ this.x = MathUtil.clamp(min, this.x, max);
+ this.y = MathUtil.clamp(min, this.y, max);
+ this.z = MathUtil.clamp(min, this.z, max);
}
public void set(float x, float y, float z)
@@ -156,7 +156,7 @@ public class Vec3f
}
else
{
- float f1 = LodUtil.fastInvSqrt(squaredSum);
+ float f1 = MathUtil.fastInvSqrt(squaredSum);
this.x *= f1;
this.y *= f1;
this.z *= f1;
diff --git a/core/src/main/java/com/seibel/lod/core/util/math/Vec3i.java b/api/src/main/java/com/seibel/lod/core/util/math/Vec3i.java
similarity index 95%
rename from core/src/main/java/com/seibel/lod/core/util/math/Vec3i.java
rename to api/src/main/java/com/seibel/lod/core/util/math/Vec3i.java
index 2c27c11a6..dc0d2c6a2 100644
--- a/core/src/main/java/com/seibel/lod/core/util/math/Vec3i.java
+++ b/api/src/main/java/com/seibel/lod/core/util/math/Vec3i.java
@@ -19,7 +19,7 @@
package com.seibel.lod.core.util.math;
-import com.seibel.lod.core.util.LodUtil;
+import com.seibel.lod.core.util.MathUtil;
/**
* A (almost) exact copy of Minecraft's 1.16.5
@@ -109,9 +109,9 @@ public class Vec3i
public void clamp(int min, int max)
{
- this.x = LodUtil.clamp(min, this.x, max);
- this.y = LodUtil.clamp(min, this.y, max);
- this.z = LodUtil.clamp(min, this.z, max);
+ this.x = MathUtil.clamp(min, this.x, max);
+ this.y = MathUtil.clamp(min, this.y, max);
+ this.z = MathUtil.clamp(min, this.z, max);
}
public void set(int x, int y, int z)
diff --git a/api/src/test/java/testItems/events/abstractObjects/DhApiTestEvent.java b/api/src/test/java/testItems/events/abstractObjects/DhApiTestEvent.java
index 82fa1cd28..8952cb2d6 100644
--- a/api/src/test/java/testItems/events/abstractObjects/DhApiTestEvent.java
+++ b/api/src/test/java/testItems/events/abstractObjects/DhApiTestEvent.java
@@ -1,12 +1,6 @@
package testItems.events.abstractObjects;
-import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
-import com.seibel.lod.api.items.objects.wrappers.DhApiLevelWrapper;
-import com.seibel.lod.api.methods.events.abstractEvents.DhApiLevelLoadEvent;
import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiLevelLoadEvent;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiTestEvent;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
/**
* A dummy event implementation used for unit testing.
@@ -15,12 +9,15 @@ import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
* @version 2022-9-11
*/
public abstract class DhApiTestEvent
- extends CoreDhApiTestEvent
- implements IDhApiEvent
+ implements IDhApiEvent
{
public abstract void onTestEvent(Boolean input);
+ /** just used for testing */
+ public abstract boolean getTestValue();
+
+
//=========================//
// internal DH API methods //
diff --git a/api/src/test/java/tests/ApiEnumSyncTests.java b/api/src/test/java/tests/ApiEnumSyncTests.java
deleted file mode 100644
index 40ed41aaf..000000000
--- a/api/src/test/java/tests/ApiEnumSyncTests.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package tests;
-
-import com.seibel.lod.api.enums.DhApiEnumAssembly;
-import com.seibel.lod.core.enums.rendering.EFogDrawMode;
-import com.seibel.lod.core.enums.CoreEnumAssembly;
-import com.seibel.lod.core.enums.config.EVerticalQuality;
-import com.seibel.lod.core.util.EnumUtil;
-import org.junit.Test;
-import org.junit.Assert;
-
-import java.util.ArrayList;
-
-/**
- * These tests were primary created to confirm that the
- * API enums are properly synced with their Core variants.
- *
- * @author James Seibel
- * @version 2022-6-9
- */
-public class ApiEnumSyncTests
-{
-
- /** Make sure each DhApi enum has the same values as its corresponding core enum. */
-// @Test
- public void ConfirmEnumsAreSynced()
- {
- //=================//
- // test validation //
- //=================//
-
- // this should always succeed (comparing an enum to itself)
- AssertEnumsValuesAreEqual(EnumUtil.compareEnumClassesByValues(EVerticalQuality.class, EVerticalQuality.class), true);
- // this should always fail (two completely different enums)
- AssertEnumsValuesAreEqual(EnumUtil.compareEnumClassesByValues(EVerticalQuality.class, EFogDrawMode.class), false);
-
-
-
-
- //================//
- // Api enum Setup //
- //================//
-
- // make sure the enum packages are loaded
- new DhApiEnumAssembly();
- new CoreEnumAssembly();
-
- // get the list of API enums
- ArrayList>> apiEnumClassList = new ArrayList<>();
- ArrayList apiConfigEnumPackageNames = EnumTestHelper.findPackageNamesStartingWith(DhApiEnumAssembly.class.getPackage().getName());
- for (String apiEnumPackageName : apiConfigEnumPackageNames)
- {
- apiEnumClassList.addAll(EnumTestHelper.getAllEnumsFromPackage(apiEnumPackageName));
- }
-
-
- // get the list of core enums
- ArrayList>> coreEnumClassList = new ArrayList<>();
- ArrayList coreEnumPackageNames = EnumTestHelper.findPackageNamesStartingWith(CoreEnumAssembly.class.getPackage().getName());
- for (String coreEnumPackageName : coreEnumPackageNames)
- {
- coreEnumClassList.addAll(EnumTestHelper.getAllEnumsFromPackage(coreEnumPackageName));
- }
-
-
- //======================//
- // Api enum comparisons //
- //======================//
-
- // compare each API enum to its corresponding Core enum
- for (Class extends Enum>> apiEnumClass : apiEnumClassList)
- {
- String coreEnumName = CoreEnumAssembly.ENUM_PREFIX + apiEnumClass.getSimpleName().substring(DhApiEnumAssembly.API_ENUM_PREFIX.length());
- boolean coreEnumFound = false;
-
- // find the core enum to compare against
- for (Class extends Enum>> coreEnumClass : coreEnumClassList)
- {
- if (coreEnumClass.getSimpleName().equals(coreEnumName))
- {
- AssertEnumsValuesAreEqual(EnumUtil.compareEnumClassesByValues(coreEnumClass, apiEnumClass), true);
- coreEnumFound = true;
- break;
- }
- }
-
- if (!coreEnumFound)
- {
- Assert.fail("API enum [" + coreEnumName + "] not found in Core.");
- }
- }
-
-
- }
-
-
-
- /** Helper method to make enum comparisons a little cleaner */
- private void AssertEnumsValuesAreEqual(EnumUtil.EnumComparisonResult comparisonResult, boolean assertEqual)
- {
- if (assertEqual)
- {
- Assert.assertTrue(comparisonResult.failMessage, comparisonResult.success);
- }
- else
- {
- Assert.assertFalse(comparisonResult.failMessage, comparisonResult.success);
- }
- }
-
-}
diff --git a/api/src/test/java/tests/EnumTestHelper.java b/api/src/test/java/tests/EnumTestHelper.java
deleted file mode 100644
index 9555f5b03..000000000
--- a/api/src/test/java/tests/EnumTestHelper.java
+++ /dev/null
@@ -1,184 +0,0 @@
-package tests;/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-import org.junit.Assert;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-
-/**
- * A list of methods related to the Enum unit tests.
- *
- * @author James Seibel
- * @version 2022-9-5
- */
-public class EnumTestHelper
-{
-
- /**
- * Returns a list of every Enum in the package with the given full name.
- *
- * @param packageFullName includes the package path
- */
- @SuppressWarnings("unchecked")
- public static ArrayList>> getAllEnumsFromPackage(String packageFullName)
- {
- ArrayList>> enumList = new ArrayList<>();
- List> classesInPackage = getClassesInPackage(packageFullName, true, "DistantHorizons");
-
- // get the enums from each file
- Assert.assertTrue("No files found in the package [" + packageFullName + "].", classesInPackage.size() != 0);
- for (Class> clazz : classesInPackage)
- {
- // ignore internal classes
- if (!clazz.getName().contains("$"))
- {
- // attempt to parse the file's class into an enum
- if (Enum.class.isAssignableFrom(clazz))
- {
- enumList.add((Class extends Enum>>) clazz);
- }
- else
- {
- System.out.println("The Class [" + clazz + "] isn't an enum.");
- }
- }
- }
-
- return enumList;
- }
-
- /**
- * Returns every class in the given package.
- *
- * Originally from:
- * https://stackoverflow.com/questions/28678026/how-can-i-get-all-class-files-in-a-specific-package-in-java
- *
- * @param packageName
- * @param onlySearchJars if true only jar files will be searched, otherwise jars and loose files will be searched
- * @param expectedJarPathString Only search jars that contain this string
- */
- public static List> getClassesInPackage(String packageName, boolean onlySearchJars, String expectedJarPathString)
- {
- String path = packageName.replace('.', '/');
- List> classes = new ArrayList<>();
- String[] classPathEntries = System.getProperty("java.class.path").split(
- System.getProperty("path.separator")
- );
-
- String name;
- for (String classpathEntry : classPathEntries)
- {
- if (classpathEntry.endsWith(".jar") && classpathEntry.toLowerCase().contains(expectedJarPathString.toLowerCase()))
- {
- File jar = new File(classpathEntry);
- try
- {
- JarInputStream is = new JarInputStream(new FileInputStream(jar));
- JarEntry entry;
- while ((entry = is.getNextJarEntry()) != null)
- {
- name = entry.getName();
- if (name.endsWith(".class"))
- {
- if (name.contains(path) && name.endsWith(".class"))
- {
- try
- {
- String classPath = name.substring(0, entry.getName().length() - 6);
- classPath = classPath.replaceAll("[\\|/]", ".");
- classes.add(Class.forName(classPath));
- }
- catch (ClassNotFoundException ex)
- {
- // the class wasn't found
- System.err.println("The Class [" + packageName + "." + name + "] failed to load.");
- }
- }
- }
- }
- }
- catch (IOException e)
- {
- System.err.println("Error reading the jar [" + jar.getPath() + "].");
- }
- }
- else if (!onlySearchJars)
- {
- File base = new File(classpathEntry + File.separatorChar + path);
- File[] files = base.listFiles();
- if (files != null)
- {
- for (File file : files)
- {
- try
- {
- name = file.getName();
- if (name.endsWith(".class"))
- {
- name = name.substring(0, name.length() - 6);
- classes.add(Class.forName(packageName + "." + name));
- }
- }
- catch (ClassNotFoundException ex)
- {
- // the class wasn't found
- System.err.println("The Class [" + packageName + "." + file.getName() + "] failed to load.");
- }
- }
- }
- }
- }
-
- return classes;
- }
-
-
- /**
- * Returns every loaded package that begins with the given string.
- *
- * Note: this will only search packages that have been loaded
- * at some point during the JVM's lifetime.
- * To Make sure the package(s) you want to find are loaded you can
- * initialize an object from that package to load it.
- */
- public static ArrayList findPackageNamesStartingWith(String packagePrefix)
- {
- ArrayList nestedPackages = new ArrayList<>();
-
- // search all the loaded packages
- Package[] packageArray = Package.getPackages();
- for (Package pack : packageArray)
- {
- String packageName = pack.getName();
- if (packageName.startsWith(packagePrefix))
- {
- nestedPackages.add(packageName);
- }
- }
-
- return nestedPackages;
- }
-
-}
diff --git a/api/src/test/java/tests/EventInjectorTest.java b/api/src/test/java/tests/EventInjectorTest.java
index e881d4a1b..4888aa9fa 100644
--- a/api/src/test/java/tests/EventInjectorTest.java
+++ b/api/src/test/java/tests/EventInjectorTest.java
@@ -1,7 +1,5 @@
package tests;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.CoreDhApiTestEvent;
-import com.seibel.lod.core.dependencyInjection.DhApiEventInjector;
import org.junit.Assert;
import testItems.events.abstractObjects.DhApiTestEvent;
import testItems.events.objects.DhTestEvent;
@@ -17,66 +15,66 @@ import java.util.ArrayList;
public class EventInjectorTest
{
- //@Test
- public void testEventDependencies() // this also tests list dependencies since there can be more than one event handler bound per event
- {
- // Injector setup
- DhApiEventInjector TEST_EVENT_HANDLER = new DhApiEventInjector();
-
-
- // pre-dependency setup
- Assert.assertNull("Nothing should have been bound.", TEST_EVENT_HANDLER.get(DhApiTestEvent.class));
-
-
- // dependency setup
- TEST_EVENT_HANDLER.bind(DhApiTestEvent.class, new DhTestEvent());
- TEST_EVENT_HANDLER.bind(DhApiTestEvent.class, new DhTestEventAlt());
- TEST_EVENT_HANDLER.runDelayedSetup();
-
-
- // get first
- CoreDhApiTestEvent afterRenderEvent = TEST_EVENT_HANDLER.get(CoreDhApiTestEvent.class);
- Assert.assertNotNull("Event not bound.", afterRenderEvent);
-
-
- // get list
- ArrayList afterRenderEventList = TEST_EVENT_HANDLER.getAll(CoreDhApiTestEvent.class);
- Assert.assertEquals("Bound list doesn't contain the correct number of items.", 2, afterRenderEventList.size());
- // object one
- Assert.assertNotNull("Event not bound.", afterRenderEventList.get(0));
- Assert.assertEquals("First event object setup incorrectly.", null, afterRenderEventList.get(0).getTestValue());
- // object two
- Assert.assertNotNull("Event not bound.", afterRenderEventList.get(1));
- Assert.assertEquals("First event object setup incorrectly.", null, afterRenderEventList.get(1).getTestValue());
-
-
- // event firing
- Assert.assertEquals("fireAllEvents canceled returned canceled incorrectly.", true, TEST_EVENT_HANDLER.fireAllEvents(CoreDhApiTestEvent.class, true));
- // object one
- Assert.assertEquals("Event not fired for first object.", true, afterRenderEventList.get(0).getTestValue());
- // object two
- Assert.assertEquals("Event not fired for second object.", true, afterRenderEventList.get(1).getTestValue());
-
-
- // unbind
- CoreDhApiTestEvent unboundEvent = afterRenderEventList.get(0);
- Assert.assertTrue("Unbind should've removed item.", TEST_EVENT_HANDLER.unbind(CoreDhApiTestEvent.class, DhTestEvent.class));
- Assert.assertFalse("Unbind should've already removed item.", TEST_EVENT_HANDLER.unbind(CoreDhApiTestEvent.class, DhTestEvent.class));
-
- // check unbinding
- afterRenderEventList = TEST_EVENT_HANDLER.getAll(CoreDhApiTestEvent.class);
- Assert.assertEquals("Unbound list doesn't contain the correct number of items.", 1, afterRenderEventList.size());
- Assert.assertNotNull("Unbinding removed all items.", afterRenderEventList.get(0));
-
-
- // check unbound event firing
- Assert.assertEquals("fireAllEvents canceled returned canceled incorrectly.", false, TEST_EVENT_HANDLER.fireAllEvents(CoreDhApiTestEvent.class, false));
- // remaining event
- Assert.assertEquals("Event not fired for remaining object.", false, ((DhTestEventAlt) afterRenderEventList.get(0)).eventFiredValue);
- // unbound event
- Assert.assertEquals("Event fired for unbound object.", true, unboundEvent.getTestValue());
-
- }
+// //@Test
+// public void testEventDependencies() // this also tests list dependencies since there can be more than one event handler bound per event
+// {
+// // Injector setup
+// DhApiEventInjector TEST_EVENT_HANDLER = new DhApiEventInjector();
+//
+//
+// // pre-dependency setup
+// Assert.assertNull("Nothing should have been bound.", TEST_EVENT_HANDLER.get(DhApiTestEvent.class));
+//
+//
+// // dependency setup
+// TEST_EVENT_HANDLER.bind(DhApiTestEvent.class, new DhTestEvent());
+// TEST_EVENT_HANDLER.bind(DhApiTestEvent.class, new DhTestEventAlt());
+// TEST_EVENT_HANDLER.runDelayedSetup();
+//
+//
+// // get first
+// CoreDhApiTestEvent afterRenderEvent = TEST_EVENT_HANDLER.get(CoreDhApiTestEvent.class);
+// Assert.assertNotNull("Event not bound.", afterRenderEvent);
+//
+//
+// // get list
+// ArrayList afterRenderEventList = TEST_EVENT_HANDLER.getAll(CoreDhApiTestEvent.class);
+// Assert.assertEquals("Bound list doesn't contain the correct number of items.", 2, afterRenderEventList.size());
+// // object one
+// Assert.assertNotNull("Event not bound.", afterRenderEventList.get(0));
+// Assert.assertEquals("First event object setup incorrectly.", null, afterRenderEventList.get(0).getTestValue());
+// // object two
+// Assert.assertNotNull("Event not bound.", afterRenderEventList.get(1));
+// Assert.assertEquals("First event object setup incorrectly.", null, afterRenderEventList.get(1).getTestValue());
+//
+//
+// // event firing
+// Assert.assertEquals("fireAllEvents canceled returned canceled incorrectly.", true, TEST_EVENT_HANDLER.fireAllEvents(CoreDhApiTestEvent.class, true));
+// // object one
+// Assert.assertEquals("Event not fired for first object.", true, afterRenderEventList.get(0).getTestValue());
+// // object two
+// Assert.assertEquals("Event not fired for second object.", true, afterRenderEventList.get(1).getTestValue());
+//
+//
+// // unbind
+// CoreDhApiTestEvent unboundEvent = afterRenderEventList.get(0);
+// Assert.assertTrue("Unbind should've removed item.", TEST_EVENT_HANDLER.unbind(CoreDhApiTestEvent.class, DhTestEvent.class));
+// Assert.assertFalse("Unbind should've already removed item.", TEST_EVENT_HANDLER.unbind(CoreDhApiTestEvent.class, DhTestEvent.class));
+//
+// // check unbinding
+// afterRenderEventList = TEST_EVENT_HANDLER.getAll(CoreDhApiTestEvent.class);
+// Assert.assertEquals("Unbound list doesn't contain the correct number of items.", 1, afterRenderEventList.size());
+// Assert.assertNotNull("Unbinding removed all items.", afterRenderEventList.get(0));
+//
+//
+// // check unbound event firing
+// Assert.assertEquals("fireAllEvents canceled returned canceled incorrectly.", false, TEST_EVENT_HANDLER.fireAllEvents(CoreDhApiTestEvent.class, false));
+// // remaining event
+// Assert.assertEquals("Event not fired for remaining object.", false, ((DhTestEventAlt) afterRenderEventList.get(0)).eventFiredValue);
+// // unbound event
+// Assert.assertEquals("Event fired for unbound object.", true, unboundEvent.getTestValue());
+//
+// }
}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/events/ICoreDhApiEvent.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/events/ICoreDhApiEvent.java
deleted file mode 100644
index 0280ec631..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/events/ICoreDhApiEvent.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.interfaces.events;
-
-import com.seibel.lod.core.dependencyInjection.IBindable;
-
-/**
- * A combination of all interfaces required by all
- * DH Api events.
- *
- * @param This is the datatype that will be passed in from Core
- * when the event is fired.
- *
- * @author James Seibel
- * @version 2022-9-6
- */
-public interface ICoreDhApiEvent extends IBindable
-{
- //==========//
- // internal //
- //==========//
-
- /** Returns true if the event can be canceled. */
- boolean getCancelable();
-
- /**
- * Called internally by Distant Horizons when the event happens.
- * This method shouldn't directly be overridden and
- * should call a more specific method instead.
- *
- * @param input the parameter object passed in from the event source. Can be null.
- * @return whether the event should be canceled or not.
- * A canceled event will still fire the other event handlers that are queued.
- */
- boolean fireEvent(CoreInputType input);
-
-
-
- //==========//
- // external //
- //==========//
-
- /**
- * Returns if the event should be automatically unbound
- * after firing.
- * Can be useful for one time setup events or waiting for a specific game state.
- *
- * Defaults to False (the event will not be removed after firing).
- */
- boolean removeAfterFiring();
-
-}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/override/ICoreDhApiOverrideable.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/override/ICoreDhApiOverrideable.java
deleted file mode 100644
index b135d7f85..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/override/ICoreDhApiOverrideable.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.interfaces.override;
-
-import com.seibel.lod.core.dependencyInjection.IBindable;
-import com.seibel.lod.core.dependencyInjection.OverrideInjector;
-
-/**
- * Implemented by all DhApi objects that can be overridden.
- *
- * @author James Seibel
- * @version 2022-9-5
- */
-public interface ICoreDhApiOverrideable extends IBindable
-{
- /**
- * Returns when this Override should be used.
- * For most developers this can be left at the default.
- */
- default int getPriority() { return OverrideInjector.DEFAULT_NON_CORE_OVERRIDE_PRIORITY; }
-
-}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/override/worldGenerator/ICoreDhApiWorldGenerator.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/override/worldGenerator/ICoreDhApiWorldGenerator.java
deleted file mode 100644
index 41cbc1d33..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/override/worldGenerator/ICoreDhApiWorldGenerator.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.interfaces.override.worldGenerator;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.override.ICoreDhApiOverrideable;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.world.ICoreDhApiLevelWrapper;
-import com.seibel.lod.core.enums.worldGeneration.EWorldGenThreadMode;
-import com.seibel.lod.core.enums.worldGeneration.EWorldGenerationStep;
-import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
-
-/**
- * @author James Seibel
- * @version 2022-9-8
- */
-public interface ICoreDhApiWorldGenerator extends ICoreDhApiOverrideable
-{
- /** Returns which thread chunk generation requests can be created on. */
- EWorldGenThreadMode getCoreThreadingMode();
-
- IChunkWrapper generateCoreChunk(int chunkPosX, int chunkPosZ, ICoreDhApiLevelWrapper serverLevelWrapper, EWorldGenerationStep maxStepToGenerate);
-
-}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/wrappers/ICoreDhApiUnsafeWrapper.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/wrappers/ICoreDhApiUnsafeWrapper.java
deleted file mode 100644
index 1590734fa..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/wrappers/ICoreDhApiUnsafeWrapper.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers;
-
-/**
- * The Distant Horizons' API objects can't cover
- * every potential use case. Sometimes developers just need
- * the base Minecraft Objects.
- *
- * @author James Seibel
- * @version 2022-7-14
- */
-public interface ICoreDhApiUnsafeWrapper
-{
- /**
- * Returns the Minecraft object this wrapper contains.
- * Warning: This object will be Minecraft
- * version dependent and may change without notice.
- *
- * In order to cast this object to something usable, you may want
- * to use obj.getClass() when in your IDE
- * in order to determine what object this method returns for
- * the specific version of Minecraft you are developing for.
- */
- public Object getWrappedMcObject_UNSAFE();
-
-}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/wrappers/world/ICoreDhApiDimensionTypeWrapper.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/wrappers/world/ICoreDhApiDimensionTypeWrapper.java
deleted file mode 100644
index 017ab88ff..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/wrappers/world/ICoreDhApiDimensionTypeWrapper.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.world;
-
-/**
- * @author James Seibel
- * @version 2022-7-14
- */
-public interface ICoreDhApiDimensionTypeWrapper
-{
- String getDimensionName();
-
- boolean hasCeiling();
-
- boolean hasSkyLight();
-}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/wrappers/world/ICoreDhApiLevelWrapper.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/wrappers/world/ICoreDhApiLevelWrapper.java
deleted file mode 100644
index edc261399..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/interfaces/wrappers/world/ICoreDhApiLevelWrapper.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.world;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.ICoreDhApiUnsafeWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
-
-/**
- * Can be either a Server or Client level.
- *
- * @author James Seibel
- * @version 2022-9-10
- */
-public interface ICoreDhApiLevelWrapper extends ICoreDhApiUnsafeWrapper
-{
- boolean hasCeiling();
-
- boolean hasSkyLight();
-
- int getHeight();
-
- default int getMinHeight() { return 0; }
-
-}
diff --git a/api/src/main/java/com/seibel/lod/api/methods/config/Readme.md b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/Readme.md
similarity index 100%
rename from api/src/main/java/com/seibel/lod/api/methods/config/Readme.md
rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/Readme.md
diff --git a/api/src/main/java/com/seibel/lod/api/methods/config/both/DhApiWorldGeneration.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/both/DhApiWorldGeneration.java
similarity index 61%
rename from api/src/main/java/com/seibel/lod/api/methods/config/both/DhApiWorldGeneration.java
rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/both/DhApiWorldGeneration.java
index 9af167821..49a9123e2 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/config/both/DhApiWorldGeneration.java
+++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/both/DhApiWorldGeneration.java
@@ -17,13 +17,9 @@
* along with this program. If not, see .
*/
-package com.seibel.lod.api.methods.config.both;
+package com.seibel.lod.core.api.external.coreImplementations.methods.config.both;
-import com.seibel.lod.api.items.enums.config.EDhApiDistanceGenerationMode;
-import com.seibel.lod.api.items.enums.config.EDhApiBlocksToAvoid;
-import com.seibel.lod.api.items.enums.config.EDhApiLightGenerationMode;
import com.seibel.lod.api.items.interfaces.config.IDhApiConfig;
-import com.seibel.lod.core.api.external.coreImplementations.objects.converters.GenericEnumConverter;
import com.seibel.lod.api.methods.config.DhApiConfig;
import com.seibel.lod.core.config.Config.Client.WorldGenerator;
import com.seibel.lod.core.enums.config.EBlocksToAvoid;
@@ -47,19 +43,19 @@ public class DhApiWorldGeneration
* outside Minecraft's vanilla render distance.
*/
public static IDhApiConfig getEnableDistantWorldGenerationConfig()
- { return new DhApiConfig(WorldGenerator.enableDistantGeneration); }
+ { return new DhApiConfig<>(WorldGenerator.enableDistantGeneration); }
/** Defines to what level fake chunks will be generated. */
- public static IDhApiConfig getDistantGeneratorDetailLevelConfig()
- { return new DhApiConfig(WorldGenerator.distanceGenerationMode, new GenericEnumConverter<>(EDistanceGenerationMode.class, EDhApiDistanceGenerationMode.class)); }
+ public static IDhApiConfig getDistantGeneratorDetailLevelConfig()
+ { return new DhApiConfig<>(WorldGenerator.distanceGenerationMode); }
/** Defines how generated fake chunks will be lit. */
- public static IDhApiConfig getLightingModeConfig()
- { return new DhApiConfig(WorldGenerator.lightGenerationMode, new GenericEnumConverter<>(ELightGenerationMode.class, EDhApiLightGenerationMode.class)); }
+ public static IDhApiConfig getLightingModeConfig()
+ { return new DhApiConfig<>(WorldGenerator.lightGenerationMode); }
/** Defines the order in which fake chunks will be generated. */
- public static IDhApiConfig getGenerationPriorityConfig()
- { return new DhApiConfig(WorldGenerator.generationPriority, new GenericEnumConverter<>(EGenerationPriority.class, EDhApiLightGenerationMode.class)); }
+ public static IDhApiConfig getGenerationPriorityConfig()
+ { return new DhApiConfig<>(WorldGenerator.generationPriority); }
/**
* Defines what blocks will be ignored when generating LODs.
@@ -69,8 +65,8 @@ public class DhApiWorldGeneration
* (vs the color based system we have currently)
*/
@Deprecated
- public static IDhApiConfig getBlocksToAvoidConfig()
- { return new DhApiConfig(WorldGenerator.blocksToAvoid, new GenericEnumConverter<>(EBlocksToAvoid.class, EDhApiBlocksToAvoid.class)); }
+ public static IDhApiConfig getBlocksToAvoidConfig()
+ { return new DhApiConfig<>(WorldGenerator.blocksToAvoid); }
/**
* Defines if the color of avoided blocks will color the block below them.
@@ -82,7 +78,7 @@ public class DhApiWorldGeneration
*/
@Deprecated
public static IDhApiConfig getTintWithAvoidedBlocksConfig()
- { return new DhApiConfig(WorldGenerator.tintWithAvoidedBlocks); }
+ { return new DhApiConfig<>(WorldGenerator.tintWithAvoidedBlocks); }
}
diff --git a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiBuffers.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiBuffers.java
similarity index 74%
rename from api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiBuffers.java
rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiBuffers.java
index 34d1fbecb..f5e4402bc 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiBuffers.java
+++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiBuffers.java
@@ -17,11 +17,9 @@
* along with this program. If not, see .
*/
-package com.seibel.lod.api.methods.config.client;
+package com.seibel.lod.core.api.external.coreImplementations.methods.config.client;
-import com.seibel.lod.api.items.enums.config.EDhApiGpuUploadMethod;
import com.seibel.lod.api.items.interfaces.config.IDhApiConfig;
-import com.seibel.lod.core.api.external.coreImplementations.objects.converters.GenericEnumConverter;
import com.seibel.lod.api.methods.config.DhApiConfig;
import com.seibel.lod.core.config.Config.Client.Advanced.Buffers;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
@@ -36,8 +34,8 @@ public class DhApiBuffers
{
/** Defines how geometry data is uploaded to the GPU. */
- public static IDhApiConfig getGpuUploadMethodConfig()
- { return new DhApiConfig(Buffers.gpuUploadMethod, new GenericEnumConverter<>(EGpuUploadMethod.class, EDhApiGpuUploadMethod.class)); }
+ public static IDhApiConfig getGpuUploadMethodConfig()
+ { return new DhApiConfig<>(Buffers.gpuUploadMethod); }
/**
* Defines how long we should wait after uploading one
@@ -47,6 +45,6 @@ public class DhApiBuffers
* uploading buffers to the GPU.
*/
public static IDhApiConfig getBufferUploadTimeoutPerMegabyteInMillisecondsConfig()
- { return new DhApiConfig(Buffers.gpuUploadPerMegabyteInMilliseconds); }
+ { return new DhApiConfig<>(Buffers.gpuUploadPerMegabyteInMilliseconds); }
}
diff --git a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiDebugging.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiDebugging.java
similarity index 72%
rename from api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiDebugging.java
rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiDebugging.java
index 929ead609..402ff1ff9 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiDebugging.java
+++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiDebugging.java
@@ -17,11 +17,9 @@
* along with this program. If not, see .
*/
-package com.seibel.lod.api.methods.config.client;
+package com.seibel.lod.core.api.external.coreImplementations.methods.config.client;
-import com.seibel.lod.api.items.enums.config.EDhApiDebugMode;
import com.seibel.lod.api.items.interfaces.config.IDhApiConfig;
-import com.seibel.lod.core.api.external.coreImplementations.objects.converters.GenericEnumConverter;
import com.seibel.lod.api.methods.config.DhApiConfig;
import com.seibel.lod.core.config.Config.Client.Advanced.Debugging;
import com.seibel.lod.core.enums.rendering.EDebugMode;
@@ -35,12 +33,12 @@ import com.seibel.lod.core.enums.rendering.EDebugMode;
public class DhApiDebugging
{
/** Can be used to debug the standard fake chunk rendering. */
- public static IDhApiConfig getDebugRenderModeConfig()
- { return new DhApiConfig(Debugging.debugMode, new GenericEnumConverter<>(EDebugMode.class, EDhApiDebugMode.class)); }
+ public static IDhApiConfig getDebugRenderModeConfig()
+ { return new DhApiConfig<>(Debugging.debugMode); }
/** If enabled debug keybindings can be used. */
public static IDhApiConfig getEnableDebugKeybindingsConfig()
- { return new DhApiConfig(Debugging.enableDebugKeybindings); }
+ { return new DhApiConfig<>(Debugging.enableDebugKeybindings); }
}
diff --git a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiGraphics.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphics.java
similarity index 63%
rename from api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiGraphics.java
rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphics.java
index 324091350..70b032ee4 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiGraphics.java
+++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphics.java
@@ -17,16 +17,14 @@
* along with this program. If not, see .
*/
-package com.seibel.lod.api.methods.config.client;
+package com.seibel.lod.core.api.external.coreImplementations.methods.config.client;
-import com.seibel.lod.api.items.enums.config.*;
import com.seibel.lod.api.items.interfaces.config.IDhApiConfig;
-import com.seibel.lod.core.api.external.coreImplementations.objects.converters.GenericEnumConverter;
-import com.seibel.lod.core.api.external.coreImplementations.objects.converters.RenderModeEnabledConverter;
import com.seibel.lod.api.methods.config.DhApiConfig;
+import com.seibel.lod.core.interfaces.config.converters.RenderModeEnabledConverter;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.enums.config.*;
-import com.seibel.lod.core.enums.rendering.ERendererMode;
+import com.seibel.lod.api.items.enums.rendering.ERendererMode;
import com.seibel.lod.core.config.Config.Client.Graphics.Quality;
import com.seibel.lod.core.config.Config.Client.Advanced.Debugging;
import com.seibel.lod.core.config.Config.Client.Graphics.AdvancedGraphics;
@@ -46,7 +44,7 @@ public class DhApiGraphics
/** The distance is the radius measured in chunks. */
public static IDhApiConfig getChunkRenderDistanceConfig()
- { return new DhApiConfig(Quality.lodChunkRenderDistance); }
+ { return new DhApiConfig<>(Quality.lodChunkRenderDistance); }
/**
* Simplified version of {@link DhApiGraphics#getRenderingModeConfig()}
@@ -65,8 +63,8 @@ public class DhApiGraphics
*
* Changing this config also changes {@link DhApiGraphics#getRenderingEnabledConfig()}'s value.
*/
- public static IDhApiConfig getRenderingModeConfig()
- { return new DhApiConfig(Debugging.rendererMode, new GenericEnumConverter<>(ERendererMode.class, EDhApiRendererMode.class)); }
+ public static IDhApiConfig getRenderingModeConfig()
+ { return new DhApiConfig<>(Debugging.rendererMode); }
@@ -75,16 +73,16 @@ public class DhApiGraphics
//==================//
/** Defines how detailed fake chunks are in the horizontal direction */
- public static IDhApiConfig getMaxDetailLevelConfig()
- { return new DhApiConfig(Quality.drawResolution, new GenericEnumConverter<>(EHorizontalResolution.class, EDhApiHorizontalResolution.class)); }
+ public static IDhApiConfig getMaxDetailLevelConfig()
+ { return new DhApiConfig<>(Quality.drawResolution); }
/** Defines how detailed fake chunks are in the vertical direction */
- public static IDhApiConfig getVerticalQualityConfig()
- { return new DhApiConfig(Quality.verticalQuality, new GenericEnumConverter<>(EVerticalQuality.class, EDhApiVerticalQuality.class)); }
+ public static IDhApiConfig getVerticalQualityConfig()
+ { return new DhApiConfig<>(Quality.verticalQuality); }
/** Modifies the quadratic function fake chunks use for horizontal quality drop-off. */
- public static IDhApiConfig getHorizontalQualityDropoffConfig()
- { return new DhApiConfig(Quality.horizontalQuality, new GenericEnumConverter<>(EHorizontalQuality.class, EDhApiHorizontalQuality.class)); }
+ public static IDhApiConfig getHorizontalQualityDropoffConfig()
+ { return new DhApiConfig<>(Quality.horizontalQuality); }
/**
* The same as vanilla Minecraft's biome blending.
@@ -95,7 +93,7 @@ public class DhApiGraphics
* ...
*/
public static IDhApiConfig getBiomeBlendingConfig()
- { return new DhApiConfig(Quality.lodBiomeBlending); }
+ { return new DhApiConfig<>(Quality.lodBiomeBlending); }
@@ -105,15 +103,15 @@ public class DhApiGraphics
/** If directional culling is disabled fake chunks will be rendered behind the camera. */
public static IDhApiConfig getDisableDirectionalCullingConfig()
- { return new DhApiConfig(AdvancedGraphics.disableDirectionalCulling); }
+ { return new DhApiConfig<>(AdvancedGraphics.disableDirectionalCulling); }
/** Determines how fake chunks are rendered in comparison to vanilla MC's chunks. */
- public static IDhApiConfig getVanillaOverdrawConfig()
- { return new DhApiConfig(AdvancedGraphics.vanillaOverdraw, new GenericEnumConverter<>(EVanillaOverdraw.class, EDhApiVanillaOverdraw.class)); }
+ public static IDhApiConfig getVanillaOverdrawConfig()
+ { return new DhApiConfig<>(AdvancedGraphics.vanillaOverdraw); }
/** Modifies how far the vanilla overdraw is rendered in chunks. */
public static IDhApiConfig getVanillaOverdrawOffsetConfig()
- { return new DhApiConfig(AdvancedGraphics.overdrawOffset); }
+ { return new DhApiConfig<>(AdvancedGraphics.overdrawOffset); }
/**
* If enabled the near clip plane is extended to reduce
@@ -122,41 +120,41 @@ public class DhApiGraphics
* being too close to the camera and the terrain not being covered by vanilla terrain.
*/
public static IDhApiConfig getUseExtendedNearClipPlaneConfig()
- { return new DhApiConfig(AdvancedGraphics.useExtendedNearClipPlane); }
+ { return new DhApiConfig<>(AdvancedGraphics.useExtendedNearClipPlane); }
/**
* Modifies how bright fake chunks are.
* This is done when generating the vertex data and is applied before any shaders.
*/
public static IDhApiConfig getBrightnessMultiplierConfig()
- { return new DhApiConfig(AdvancedGraphics.brightnessMultiplier); }
+ { return new DhApiConfig<>(AdvancedGraphics.brightnessMultiplier); }
/**
* Modifies how saturated fake chunks are.
* This is done when generating the vertex data and is applied before any shaders.
*/
public static IDhApiConfig getSaturationMultiplierConfig()
- { return new DhApiConfig(AdvancedGraphics.saturationMultiplier); }
+ { return new DhApiConfig<>(AdvancedGraphics.saturationMultiplier); }
/** Defines if Distant Horizons should attempt to cull fake chunk cave geometry. */
public static IDhApiConfig getCaveCullingEnabledConfig()
- { return new DhApiConfig(AdvancedGraphics.enableCaveCulling); }
+ { return new DhApiConfig<>(AdvancedGraphics.enableCaveCulling); }
/** Defines what height cave culling should be used below if enabled. */
public static IDhApiConfig getCaveCullingHeightConfig()
- { return new DhApiConfig(AdvancedGraphics.caveCullingHeight); }
+ { return new DhApiConfig<>(AdvancedGraphics.caveCullingHeight); }
/** This ratio is relative to Earth's real world curvature. */
public static IDhApiConfig getEarthCurvatureRatioConfig()
- { return new DhApiConfig(AdvancedGraphics.earthCurveRatio); }
+ { return new DhApiConfig<>(AdvancedGraphics.earthCurveRatio); }
/** If enabled vanilla chunk rendering is disabled and only fake chunks are rendered. */
public static IDhApiConfig getEnableLodOnlyModeConfig()
- { return new DhApiConfig(Config.Client.Advanced.lodOnlyMode); }
+ { return new DhApiConfig<>(Config.Client.Advanced.lodOnlyMode); }
/** Defines how often the geometry should be rebuilt when the player moves. */
- public static IDhApiConfig getGeometryRebuildFrequencyConfig()
- { return new DhApiConfig(Config.Client.Advanced.Buffers.rebuildTimes, new GenericEnumConverter<>(EBufferRebuildTimes.class, EDhApiBufferRebuildTimes.class)); }
+ public static IDhApiConfig getGeometryRebuildFrequencyConfig()
+ { return new DhApiConfig<>(Config.Client.Advanced.Buffers.rebuildTimes); }
diff --git a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiGraphicsFog.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsFog.java
similarity index 59%
rename from api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiGraphicsFog.java
rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsFog.java
index 40ff7725f..713f906ff 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiGraphicsFog.java
+++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsFog.java
@@ -17,11 +17,9 @@
* along with this program. If not, see .
*/
-package com.seibel.lod.api.methods.config.client;
+package com.seibel.lod.core.api.external.coreImplementations.methods.config.client;
-import com.seibel.lod.api.items.enums.config.*;
import com.seibel.lod.api.items.interfaces.config.IDhApiConfig;
-import com.seibel.lod.core.api.external.coreImplementations.objects.converters.GenericEnumConverter;
import com.seibel.lod.api.methods.config.DhApiConfig;
import com.seibel.lod.core.enums.rendering.*;
import com.seibel.lod.core.config.Config.Client.Graphics.FogQuality;
@@ -44,23 +42,23 @@ public class DhApiGraphicsFog
//====================//
/** Defines at what distance fog is rendered on fake chunks. */
- public static IDhApiConfig getFogDistanceConfig()
- { return new DhApiConfig(FogQuality.fogDistance, new GenericEnumConverter<>(EFogDistance.class, EDhApiFogDistance.class)); }
+ public static IDhApiConfig getFogDistanceConfig()
+ { return new DhApiConfig<>(FogQuality.fogDistance); }
/** Should be used to enable/disable fog rendering. */
- public static IDhApiConfig getFogRenderConfig()
- { return new DhApiConfig(FogQuality.fogDrawMode, new GenericEnumConverter<>(EFogDrawMode.class, EDhApiFogDrawMode.class)); }
+ public static IDhApiConfig getFogRenderConfig()
+ { return new DhApiConfig<>(FogQuality.fogDrawMode); }
/** Can be used to enable support with mods that change vanilla MC's fog color. */
- public static IDhApiConfig getFogColorConfig()
- { return new DhApiConfig(FogQuality.fogColorMode, new GenericEnumConverter<>(EFogColorMode.class, EDhApiFogColorMode.class)); }
+ public static IDhApiConfig getFogColorConfig()
+ { return new DhApiConfig<>(FogQuality.fogColorMode); }
/**
* If enabled attempts to disable vanilla MC's fog on real chunks.
* May not play nice with other fog editing mods.
*/
public static IDhApiConfig getDisableVanillaFogConfig()
- { return new DhApiConfig(FogQuality.disableVanillaFog); }
+ { return new DhApiConfig<>(FogQuality.disableVanillaFog); }
//=======================//
@@ -76,7 +74,7 @@ public class DhApiGraphicsFog
* 1.0 = fog starts at the edge of the fake chunk render distance
*/
public static IDhApiConfig getFogStartDistanceConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.farFogStart); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogStart); }
/**
* Defines where the fog ends as a percent of the radius
@@ -87,23 +85,23 @@ public class DhApiGraphicsFog
* 1.0 = fog ends at the edge of the fake chunk render distance
*/
public static IDhApiConfig getFogEndDistanceConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.farFogEnd); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogEnd); }
/** Defines how opaque the fog is at its thinnest point. */
public static IDhApiConfig getFogMinThicknessConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.farFogMin); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogMin); }
/** Defines how opaque the fog is at its thickest point. */
public static IDhApiConfig getFogMaxThicknessConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.farFogMax); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogMax); }
/** Defines how the fog changes in thickness. */
- public static IDhApiConfig getFogFalloffConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.farFogType, new GenericEnumConverter<>(EFogFalloff.class, EDhApiFogFalloff.class)); }
+ public static IDhApiConfig getFogFalloffConfig()
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogType); }
/** Defines the fog density. */
public static IDhApiConfig getFogDensityConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.farFogDensity); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogDensity); }
//=====================//
@@ -111,43 +109,43 @@ public class DhApiGraphicsFog
//=====================//
/** Defines how the height fog mixes. */
- public static IDhApiConfig getHeightFogMixModeConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.HeightFog.heightFogMixMode, new GenericEnumConverter<>(EHeightFogMixMode.class, EDhApiHeightFogMixMode.class)); }
+ public static IDhApiConfig getHeightFogMixModeConfig()
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMixMode); }
/** Defines how the height fog is drawn relative to the camera or world. */
- public static IDhApiConfig getHeightFogModeConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.HeightFog.heightFogMode, new GenericEnumConverter<>(EHeightFogMode.class, EDhApiHeightFogMode.class)); }
+ public static IDhApiConfig getHeightFogModeConfig()
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMode); }
/**
* Defines the height fog's base height if {@link DhApiGraphicsFog#getHeightFogModeConfig()}
* is set to use a specific height.
*/
public static IDhApiConfig getHeightFogBaseHeightConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.HeightFog.heightFogHeight); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogHeight); }
/** Defines the height fog's starting height as a percent of the world height. */
public static IDhApiConfig getHeightFogStartingHeightPercentConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.HeightFog.heightFogStart); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogStart); }
/** Defines the height fog's ending height as a percent of the world height. */
public static IDhApiConfig getHeightFogEndingHeightPercentConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.HeightFog.heightFogEnd); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogEnd); }
/** Defines how opaque the height fog is at its thinnest point. */
public static IDhApiConfig getHeightFogMinThicknessConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.HeightFog.heightFogMin); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMin); }
/** Defines how opaque the height fog is at its thickest point. */
public static IDhApiConfig getHeightFogMaxThicknessConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.HeightFog.heightFogMax); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMax); }
/** Defines how the height fog changes in thickness. */
- public static IDhApiConfig getHeightFogFalloffConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.HeightFog.heightFogType, new GenericEnumConverter<>(EFogFalloff.class, EDhApiFogFalloff.class)); }
+ public static IDhApiConfig getHeightFogFalloffConfig()
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogType); }
/** Defines the height fog's density. */
public static IDhApiConfig getHeightFogDensityConfig()
- { return new DhApiConfig(FogQuality.AdvancedFog.HeightFog.heightFogDensity); }
+ { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogDensity); }
}
diff --git a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiMultiplayer.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiMultiplayer.java
similarity index 75%
rename from api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiMultiplayer.java
rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiMultiplayer.java
index 71a5da008..9f17721da 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiMultiplayer.java
+++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiMultiplayer.java
@@ -17,11 +17,9 @@
* along with this program. If not, see .
*/
-package com.seibel.lod.api.methods.config.client;
+package com.seibel.lod.core.api.external.coreImplementations.methods.config.client;
-import com.seibel.lod.api.items.enums.config.EDhApiServerFolderNameMode;
import com.seibel.lod.api.items.interfaces.config.IDhApiConfig;
-import com.seibel.lod.core.api.external.coreImplementations.objects.converters.GenericEnumConverter;
import com.seibel.lod.api.methods.config.DhApiConfig;
import com.seibel.lod.core.config.Config.Client.Multiplayer;
import com.seibel.lod.core.enums.config.EServerFolderNameMode;
@@ -39,8 +37,8 @@ public class DhApiMultiplayer
* Defines how multiplayer server folders are named.
* Note: Changing this while connected to a multiplayer world will cause undefined behavior!
*/
- public static IDhApiConfig getFolderSavingModeConfig()
- { return new DhApiConfig(Multiplayer.serverFolderNameMode, new GenericEnumConverter<>(EServerFolderNameMode.class, EDhApiServerFolderNameMode.class)); }
+ public static IDhApiConfig getFolderSavingModeConfig()
+ { return new DhApiConfig<>(Multiplayer.serverFolderNameMode); }
/**
* Defines the necessary similarity (as a percent) that two potential levels
@@ -52,7 +50,7 @@ public class DhApiMultiplayer
* or similar mods.
*/
public static IDhApiConfig getMultiverseSimilarityRequirementConfig()
- { return new DhApiConfig(Multiplayer.multiDimensionRequiredSimilarity); }
+ { return new DhApiConfig<>(Multiplayer.multiDimensionRequiredSimilarity); }
}
diff --git a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiThreading.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiThreading.java
similarity index 96%
rename from api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiThreading.java
rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiThreading.java
index dea0b8349..190cd6d9e 100644
--- a/api/src/main/java/com/seibel/lod/api/methods/config/client/DhApiThreading.java
+++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiThreading.java
@@ -17,7 +17,7 @@
* along with this program. If not, see .
*/
-package com.seibel.lod.api.methods.config.client;
+package com.seibel.lod.core.api.external.coreImplementations.methods.config.client;
import com.seibel.lod.api.items.interfaces.config.IDhApiConfig;
import com.seibel.lod.api.methods.config.DhApiConfig;
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/converters/GenericEnumConverter.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/converters/GenericEnumConverter.java
deleted file mode 100644
index 5ace88ac0..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/converters/GenericEnumConverter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.converters;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.config.IConverter;
-
-/**
- * This assumes the two enums contain the same values.
- *
- * @author James Seibel
- * @version 2022-6-30
- */
-public class GenericEnumConverter, apiEnum extends Enum> implements IConverter
-{
- private final Class apiCoreType;
- private final Class apiEnumClass;
-
-
- public GenericEnumConverter(Class newCoreEnumClass, Class newApiEnumClass)
- {
- this.apiCoreType = newCoreEnumClass;
- this.apiEnumClass = newApiEnumClass;
- }
-
-
- @Override
- public coreEnum convertToCoreType(apiEnum apiObject)
- {
- return parseEnum(apiObject.name(), this.apiCoreType);
- }
-
- @Override
- public apiEnum convertToApiType(coreEnum coreObject)
- {
- return parseEnum(coreObject.name(), this.apiEnumClass);
- }
-
-
- /**
- * Since this does require string conversions it isn't the fastest option,
- * however it works and should be fast enough for most use cases.
- * If speed becomes an issue this can always be replaced with either individual
- * converters for each enum (using a switch statement) or a more exotic solution.
- *
- * Original source: https://stackoverflow.com/questions/25487619/java-generic-function-to-parse-enums-from-strings
- */
- private static > E parseEnum(String str, Class enumClass)
- {
- return Enum.valueOf(enumClass, str);
- }
-
-}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiAfterDhInitEvent.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiAfterDhInitEvent.java
deleted file mode 100644
index cce54aff9..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiAfterDhInitEvent.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
-
-/**
- * @author James Seibel
- * @version 2022-9-6
- */
-public abstract class CoreDhApiAfterDhInitEvent implements ICoreDhApiEvent
-{
-
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiAfterRenderEvent.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiAfterRenderEvent.java
deleted file mode 100644
index cc0decb5b..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiAfterRenderEvent.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents;
-
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.sharedParameterObjects.CoreDhApiRenderParam;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
-
-/**
- * @author James Seibel
- * @version 2022-9-6
- */
-public abstract class CoreDhApiAfterRenderEvent implements ICoreDhApiEvent
-{
-
- //==================//
- // parameter object //
- //==================//
-
- public static class CoreEventParam extends CoreDhApiRenderParam
- {
- public CoreEventParam(CoreDhApiRenderParam dhApiRenderParam)
- {
- super(dhApiRenderParam.mcProjectionMatrix, dhApiRenderParam.mcModelViewMatrix,
- dhApiRenderParam.dhProjectionMatrix, dhApiRenderParam.dhModelViewMatrix,
- dhApiRenderParam.partialTicks);
- }
- }
-
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiBeforeDhInitEvent.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiBeforeDhInitEvent.java
deleted file mode 100644
index 60d1b0410..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiBeforeDhInitEvent.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
-
-/**
- * @author James Seibel
- * @version 2022-9-6
- */
-public abstract class CoreDhApiBeforeDhInitEvent implements ICoreDhApiEvent
-{
-
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiBeforeRenderEvent.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiBeforeRenderEvent.java
deleted file mode 100644
index aa7d5295a..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiBeforeRenderEvent.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents;
-
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.sharedParameterObjects.CoreDhApiRenderParam;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
-
-/**
- * @author James Seibel
- * @version 2022-9-6
- */
-public abstract class CoreDhApiBeforeRenderEvent implements ICoreDhApiEvent
-{
-
- //==================//
- // parameter object //
- //==================//
-
- public static class CoreEventParam extends CoreDhApiRenderParam
- {
- public CoreEventParam(CoreDhApiRenderParam dhApiRenderParam)
- {
- super(dhApiRenderParam.mcProjectionMatrix, dhApiRenderParam.mcModelViewMatrix,
- dhApiRenderParam.dhProjectionMatrix, dhApiRenderParam.dhModelViewMatrix,
- dhApiRenderParam.partialTicks);
- }
- }
-
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiLevelLoadEvent.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiLevelLoadEvent.java
deleted file mode 100644
index 9d61dd2ca..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiLevelLoadEvent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
-
-/**
- * @author James Seibel
- * @version 2022-9-6
- */
-public abstract class CoreDhApiLevelLoadEvent implements ICoreDhApiEvent
-{
-
- //==================//
- // parameter object //
- //==================//
-
- public static class CoreEventParam
- {
- /** The newly loaded level. */
- public final ILevelWrapper levelWrapper;
-
-
- public CoreEventParam(ILevelWrapper newLevelWrapper)
- {
- this.levelWrapper = newLevelWrapper;
- }
- }
-
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiLevelSaveEvent.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiLevelSaveEvent.java
deleted file mode 100644
index cbcd11e61..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiLevelSaveEvent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
-
-/**
- * @author James Seibel
- * @version 2022-9-6
- */
-public abstract class CoreDhApiLevelSaveEvent implements ICoreDhApiEvent
-{
-
- //==================//
- // parameter object //
- //==================//
-
- public static class CoreEventParam
- {
- /** The newly loaded level. */
- public final ILevelWrapper levelWrapper;
-
-
- public CoreEventParam(ILevelWrapper newLevelWrapper)
- {
- this.levelWrapper = newLevelWrapper;
- }
- }
-
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiLevelUnloadEvent.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiLevelUnloadEvent.java
deleted file mode 100644
index 7eafb1a47..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiLevelUnloadEvent.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
-
-/**
- * @author James Seibel
- * @version 2022-9-6
- */
-public abstract class CoreDhApiLevelUnloadEvent implements ICoreDhApiEvent
-{
-
- //==================//
- // parameter object //
- //==================//
-
- public static class CoreEventParam
- {
- /** The recently unloaded level. */
- public final ILevelWrapper levelWrapper;
-
-
- public CoreEventParam(ILevelWrapper newLevelWrapper)
- {
- this.levelWrapper = newLevelWrapper;
- }
- }
-
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiTestEvent.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiTestEvent.java
deleted file mode 100644
index e7bd26342..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/abstractEvents/CoreDhApiTestEvent.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
-
-/**
- * Only used for unit testing
- *
- * @author James Seibel
- * @version 2022-9-11
- */
-public abstract class CoreDhApiTestEvent implements ICoreDhApiEvent
-{
- public abstract boolean getTestValue();
-
-}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/sharedParameterObjects/CoreDhApiRenderParam.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/sharedParameterObjects/CoreDhApiRenderParam.java
deleted file mode 100644
index 0ba4f337b..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/events/sharedParameterObjects/CoreDhApiRenderParam.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.seibel.lod.core.api.external.coreImplementations.objects.events.sharedParameterObjects;
-
-import com.seibel.lod.core.util.math.Mat4f;
-
-/**
- * Parameter passed into Render events.
- *
- * @author James Seibel
- * @version 2022-9-5
- */
-public class CoreDhApiRenderParam
-{
- /** The projection matrix Minecraft is using to render this frame. */
- public final Mat4f mcProjectionMatrix;
- /** The model view matrix Minecraft is using to render this frame. */
- public final Mat4f mcModelViewMatrix;
-
- /** The projection matrix Distant Horizons is using to render this frame. */
- public final Mat4f dhProjectionMatrix;
- /** The model view matrix Distant Horizons is using to render this frame. */
- public final Mat4f dhModelViewMatrix;
-
- /** Indicates how far into this tick the frame is. */
- public final float partialTicks;
-
-
-
- public CoreDhApiRenderParam(
- Mat4f newMcProjectionMatrix, Mat4f newMcModelViewMatrix,
- Mat4f newDhProjectionMatrix, Mat4f newDhModelViewMatrix,
- float newPartialTicks)
- {
- this.mcProjectionMatrix = newMcProjectionMatrix;
- this.mcModelViewMatrix = newMcModelViewMatrix;
-
- this.dhProjectionMatrix = newDhProjectionMatrix;
- this.dhModelViewMatrix = newDhModelViewMatrix;
-
- this.partialTicks = newPartialTicks;
- }
-
-}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/wrappers/CoreDhApiDimensionTypeWrapper.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/wrappers/CoreDhApiDimensionTypeWrapper.java
deleted file mode 100644
index 58cb5b387..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/wrappers/CoreDhApiDimensionTypeWrapper.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.core.api.external.coreImplementations.objects.wrappers;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.world.ICoreDhApiDimensionTypeWrapper;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.ICoreDhApiUnsafeWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.IDimensionTypeWrapper;
-
-/**
- * @author James Seibel
- * @version 2022-9-8
- */
-public class CoreDhApiDimensionTypeWrapper implements ICoreDhApiDimensionTypeWrapper, ICoreDhApiUnsafeWrapper
-{
- private final IDimensionTypeWrapper dimensionTypeWrapper;
-
-
- public CoreDhApiDimensionTypeWrapper(IDimensionTypeWrapper newDimensionTypeWrapper)
- {
- this.dimensionTypeWrapper = newDimensionTypeWrapper;
- }
-
-
-
- @Override
- public String getDimensionName() { return this.dimensionTypeWrapper.getDimensionName(); }
-
- @Override
- public boolean hasCeiling() { return this.dimensionTypeWrapper.hasCeiling(); }
-
- @Override
- public boolean hasSkyLight() { return this.dimensionTypeWrapper.hasSkyLight(); }
-
-
- @Override
- public Object getWrappedMcObject_UNSAFE() { return this.dimensionTypeWrapper.getWrappedMcObject(); }
-
-}
diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/wrappers/CoreDhApiLevelWrapper.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/wrappers/CoreDhApiLevelWrapper.java
deleted file mode 100644
index f2fa7d182..000000000
--- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/objects/wrappers/CoreDhApiLevelWrapper.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod (formerly the LOD Mod),
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2022 James Seibel
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-package com.seibel.lod.core.api.external.coreImplementations.objects.wrappers;
-
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.wrappers.world.ICoreDhApiLevelWrapper;
-import com.seibel.lod.core.enums.ELevelType;
-import com.seibel.lod.core.wrapperInterfaces.world.IClientLevelWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.IDimensionTypeWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
-import com.seibel.lod.core.wrapperInterfaces.world.IServerLevelWrapper;
-
-/**
- * Can be either a Server or Client level.
- *
- * @author James Seibel
- * @version 2022-9-8
- */
-public class CoreDhApiLevelWrapper implements ICoreDhApiLevelWrapper
-{
- private final ILevelWrapper levelWrapper;
- private final IDimensionTypeWrapper dimensionTypeWrapper;
-
-
- public CoreDhApiLevelWrapper(ILevelWrapper newLevelWrapper)
- {
- this.levelWrapper = newLevelWrapper;
- this.dimensionTypeWrapper = this.levelWrapper.getDimensionType();
- }
-
-
- public ELevelType getLevelType()
- {
- if (this.levelWrapper.getClass().isAssignableFrom(IClientLevelWrapper.class))
- {
- return ELevelType.CLIENT_LEVEL;
- }
- else if (this.levelWrapper.getClass().isAssignableFrom(IServerLevelWrapper.class))
- {
- return ELevelType.CLIENT_LEVEL;
- }
- else
- {
- // shouldn't normally happen, but just in case
- return ELevelType.UNKNOWN;
- }
- }
-
- public boolean hasCeiling() { return this.levelWrapper.hasCeiling(); }
-
- public boolean hasSkyLight() { return this.levelWrapper.hasSkyLight(); }
-
- public int getHeight() { return this.levelWrapper.getHeight(); }
-
- public int getMinHeight() { return this.levelWrapper.getMinHeight(); }
-
- @Override
- public Object getWrappedMcObject_UNSAFE() { return this.levelWrapper.unwrapLevel(); }
-
-}
diff --git a/core/src/main/java/com/seibel/lod/core/api/internal/ClientApi.java b/core/src/main/java/com/seibel/lod/core/api/internal/ClientApi.java
index 05eb7b578..b656c41ac 100644
--- a/core/src/main/java/com/seibel/lod/core/api/internal/ClientApi.java
+++ b/core/src/main/java/com/seibel/lod/core/api/internal/ClientApi.java
@@ -19,13 +19,13 @@
package com.seibel.lod.core.api.internal;
+import com.seibel.lod.api.methods.events.abstractEvents.*;
+import com.seibel.lod.api.methods.events.sharedParameterObjects.DhApiRenderParam;
import com.seibel.lod.core.level.IClientLevel;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.abstractEvents.*;
-import com.seibel.lod.core.api.external.coreImplementations.objects.events.sharedParameterObjects.CoreDhApiRenderParam;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.ModInfo;
import com.seibel.lod.core.enums.rendering.EDebugMode;
-import com.seibel.lod.core.enums.rendering.ERendererMode;
+import com.seibel.lod.api.items.enums.rendering.ERendererMode;
import com.seibel.lod.core.dependencyInjection.DhApiEventInjector;
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
import com.seibel.lod.core.logging.ConfigBasedLogger;
@@ -150,7 +150,7 @@ public class ClientApi
//TODO: Implement
// TODO: potentially add a list of chunks that were updated during the save
- DhApiEventInjector.INSTANCE.fireAllEvents(CoreDhApiLevelSaveEvent.class, new CoreDhApiLevelSaveEvent.CoreEventParam(level));
+// DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelSaveEvent.class, new DhApiLevelSaveEvent.EventParam(level));
}
}
@@ -161,7 +161,7 @@ public class ClientApi
if (SharedApi.currentWorld != null)
{
SharedApi.currentWorld.unloadLevel(level);
- DhApiEventInjector.INSTANCE.fireAllEvents(CoreDhApiLevelUnloadEvent.class, new CoreDhApiLevelUnloadEvent.CoreEventParam(level));
+// DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelUnloadEvent.class, new DhApiLevelUnloadEvent.EventParam(level));
}
}
@@ -172,7 +172,7 @@ public class ClientApi
if (SharedApi.currentWorld != null)
{
SharedApi.currentWorld.getOrLoadLevel(level);
- DhApiEventInjector.INSTANCE.fireAllEvents(CoreDhApiLevelLoadEvent.class, new CoreDhApiLevelLoadEvent.CoreEventParam(level));
+// DhApiEventInjector.INSTANCE.fireAllEvents(DhApiLevelLoadEvent.class, new DhApiLevelLoadEvent.EventParam(level));
}
}
@@ -260,16 +260,16 @@ public class ClientApi
{
if (Config.Client.Advanced.Debugging.rendererMode.get() == ERendererMode.DEFAULT)
{
- CoreDhApiRenderParam renderEventParam =
- new CoreDhApiRenderParam(mcProjectionMatrix, mcModelViewMatrix,
+ DhApiRenderParam renderEventParam =
+ new DhApiRenderParam(mcProjectionMatrix, mcModelViewMatrix,
RenderUtil.createLodProjectionMatrix(mcProjectionMatrix, partialTicks),
RenderUtil.createLodModelViewMatrix(mcModelViewMatrix), partialTicks);
- boolean renderingCanceled = DhApiEventInjector.INSTANCE.fireAllEvents(CoreDhApiBeforeRenderEvent.class, new CoreDhApiBeforeRenderEvent.CoreEventParam(renderEventParam));
- if (!rendererDisabledBecauseOfExceptions && !renderingCanceled)
+// boolean renderingCanceled = DhApiEventInjector.INSTANCE.fireAllEvents(DhApiBeforeRenderEvent.class, new DhApiBeforeRenderEvent.EventParam(renderEventParam));
+ if (!rendererDisabledBecauseOfExceptions)// && !renderingCanceled)
{
level.render(mcModelViewMatrix, mcProjectionMatrix, partialTicks, profiler);
- DhApiEventInjector.INSTANCE.fireAllEvents(CoreDhApiAfterRenderEvent.class, new CoreDhApiAfterRenderEvent.CoreEventParam(renderEventParam));
+// DhApiEventInjector.INSTANCE.fireAllEvents(DhApiAfterRenderEvent.class, new DhApiAfterRenderEvent.EventParam(renderEventParam));
}
}
else if (Config.Client.Advanced.Debugging.rendererMode.get() == ERendererMode.DEBUG)
diff --git a/core/src/main/java/com/seibel/lod/core/config/Config.java b/core/src/main/java/com/seibel/lod/core/config/Config.java
index d40d47b77..074c9b79a 100644
--- a/core/src/main/java/com/seibel/lod/core/config/Config.java
+++ b/core/src/main/java/com/seibel/lod/core/config/Config.java
@@ -23,7 +23,7 @@ package com.seibel.lod.core.config;
import com.seibel.lod.core.enums.rendering.EFogDrawMode;
import com.seibel.lod.core.enums.rendering.EFogColorMode;
import com.seibel.lod.core.enums.rendering.EFogDistance;
-import com.seibel.lod.core.enums.rendering.ERendererMode;
+import com.seibel.lod.api.items.enums.rendering.ERendererMode;
import com.seibel.lod.core.config.types.*;
import com.seibel.lod.core.enums.config.*;
diff --git a/core/src/main/java/com/seibel/lod/core/config/types/ConfigEntry.java b/core/src/main/java/com/seibel/lod/core/config/types/ConfigEntry.java
index aed8cadf5..9fd3464e6 100644
--- a/core/src/main/java/com/seibel/lod/core/config/types/ConfigEntry.java
+++ b/core/src/main/java/com/seibel/lod/core/config/types/ConfigEntry.java
@@ -1,13 +1,15 @@
package com.seibel.lod.core.config.types;
+import com.seibel.lod.core.interfaces.config.IConfigEntry;
+
/**
* Use for making the config variables
*
* @author coolGi
* @version 2022-5-26
*/
-public class ConfigEntry extends AbstractConfigType>
+public class ConfigEntry extends AbstractConfigType> implements IConfigEntry
{
private final T defaultValue;
private String comment;
@@ -40,16 +42,21 @@ public class ConfigEntry extends AbstractConfigType>
/** Gets the default value of the option */
- public T getDefaultValue() {
+ @Override
+ public T getDefaultValue() {
return this.defaultValue;
}
-
+
+ @Override
public void setApiValue(T newApiValue) {
this.apiValue = newApiValue;
}
- public T getApiValue() {
+ @Override
+ public T getApiValue() {
return this.apiValue;
}
+ @Override
+ public boolean getAllowApiOverride() { return this.allowApiOverride; }
@Override
public void set(T newValue) {
super.set(newValue);
@@ -61,42 +68,51 @@ public class ConfigEntry extends AbstractConfigType>
return apiValue;
return super.get();
}
+ @Override
public T getTrueValue() {
return super.get();
}
/** Sets the value without saving */
+ @Override
public void setWithoutSaving(T newValue) {
super.set(newValue);
}
/** Gets the min value */
+ @Override
public T getMin() {
return this.min;
}
/** Sets the min value */
+ @Override
public void setMin(T newMin) {
this.min = newMin;
}
/** Gets the max value */
+ @Override
public T getMax() {
return this.max;
}
/** Sets the max value */
+ @Override
public void setMax(T newMax) {
this.max = newMax;
}
/** Sets the min and max in 1 setter */
+ @Override
public void setMinMax(T newMin, T newMax) {
this.max = newMin;
this.min = newMax;
}
/** Gets the comment */
+ @Override
public String getComment() {
return this.comment;
}
/** Sets the comment */
+ @Override
public void setComment(String newComment) {
this.comment = newComment;
}
@@ -113,10 +129,12 @@ public class ConfigEntry extends AbstractConfigType>
* 1 == number too high
* -1 == number too low
*/
+ @Override
public byte isValid() {
return isValid(value);
}
/** Checks if a value is valid */
+ @Override
public byte isValid(T value) {
if (this.configBase.disableMinMax)
return 0;
@@ -139,7 +157,10 @@ public class ConfigEntry extends AbstractConfigType>
public void load() {
configBase.configFileINSTANCE.loadEntry(this);
}
-
+
+
+ @Override
+ public boolean equals(IConfigEntry> obj) { return obj.getClass() == ConfigEntry.class ? equals((ConfigEntry>)obj) : false; }
/** Is the value of this equal to another */
public boolean equals(ConfigEntry> obj) {
// Can all of this just be "return this.value.equals(obj.value)"?
diff --git a/core/src/main/java/com/seibel/lod/core/datatype/column/render/ColumnBox.java b/core/src/main/java/com/seibel/lod/core/datatype/column/render/ColumnBox.java
index f23f7e5b5..d8e58b4f7 100644
--- a/core/src/main/java/com/seibel/lod/core/datatype/column/render/ColumnBox.java
+++ b/core/src/main/java/com/seibel/lod/core/datatype/column/render/ColumnBox.java
@@ -26,6 +26,7 @@ import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
import com.seibel.lod.core.util.ColorUtil;
import com.seibel.lod.core.util.LodUtil;
+import com.seibel.lod.core.util.MathUtil;
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
public class ColumnBox
@@ -54,7 +55,7 @@ public class ColumnBox
boolean skipBot = ColumnFormat.doesItExist(botData) && (ColumnFormat.getHeight(botData) == y) && !isBotTransparent;
if(LodRenderer.transparencyEnabled && LodRenderer.fakeOceanFloor) {
if (!isTransparent && isTopTransparent && ColumnFormat.doesItExist(topData)) {
- skyLightTop = (byte) LodUtil.clamp(0, 15 - (ColumnFormat.getHeight(topData) - y), 15);
+ skyLightTop = (byte) MathUtil.clamp(0, 15 - (ColumnFormat.getHeight(topData) - y), 15);
ySize = (short) (ColumnFormat.getHeight(topData) - y - 1);
//y = (short) (DataPointUtil.getHeight(topData) - 2);
//ySize = 1;
diff --git a/core/src/main/java/com/seibel/lod/core/datatype/column/render/LodQuadBuilder.java b/core/src/main/java/com/seibel/lod/core/datatype/column/render/LodQuadBuilder.java
index c444d2e60..8cf243741 100644
--- a/core/src/main/java/com/seibel/lod/core/datatype/column/render/LodQuadBuilder.java
+++ b/core/src/main/java/com/seibel/lod/core/datatype/column/render/LodQuadBuilder.java
@@ -33,6 +33,7 @@ import com.seibel.lod.core.logging.DhLoggerBuilder;
import com.seibel.lod.core.render.glObject.buffer.GLVertexBuffer;
import com.seibel.lod.core.util.ColorUtil;
import com.seibel.lod.core.util.LodUtil;
+import com.seibel.lod.core.util.MathUtil;
import org.apache.logging.log4j.Logger;
//TODO: Recheck this class for refactoring
@@ -464,7 +465,7 @@ public class LodQuadBuilder
/** Returns how many Buffers will be needed to render everything in this builder. */
public int getCurrentNeededVertexBufferCount()
{
- return LodUtil.ceilDiv(getCurrentQuadsCount(), RenderBuffer.MAX_QUADS_PER_BUFFER);
+ return MathUtil.ceilDiv(getCurrentQuadsCount(), RenderBuffer.MAX_QUADS_PER_BUFFER);
}
}
diff --git a/core/src/main/java/com/seibel/lod/core/dependencyInjection/DependencyInjector.java b/core/src/main/java/com/seibel/lod/core/dependencyInjection/DependencyInjector.java
index ce8217da0..3f9656be6 100644
--- a/core/src/main/java/com/seibel/lod/core/dependencyInjection/DependencyInjector.java
+++ b/core/src/main/java/com/seibel/lod/core/dependencyInjection/DependencyInjector.java
@@ -30,7 +30,7 @@ import java.util.Map;
* @author James Seibel
* @version 2022-8-15
*/
-public class DependencyInjector
+public class DependencyInjector implements IDependencyInjector
{
protected final Map, ArrayList> dependencies = new HashMap<>();
@@ -55,14 +55,7 @@ public class DependencyInjector
- /**
- * Links the given implementation object to an interface, so it can be referenced later.
- *
- * @param dependencyInterface The interface (or parent class) the implementation object should implement.
- * @param dependencyImplementation An object that implements the dependencyInterface interface.
- * @throws IllegalStateException if the interface has already been bound and {@link DependencyInjector#allowDuplicateBindings} is false
- * @throws IllegalArgumentException if the implementation object doesn't implement the interface
- */
+ @Override
public void bind(Class extends BindableType> dependencyInterface, BindableType dependencyImplementation) throws IllegalStateException, IllegalArgumentException
{
// duplicate check if requested
@@ -97,11 +90,8 @@ public class DependencyInjector
// add the dependency
dependencies.get(dependencyInterface).add(dependencyImplementation);
}
- /**
- * Checks if classToTest (or one of its ancestors)
- * implements the given interface.
- */
- protected boolean checkIfClassImplements(Class> classToTest, Class> interfaceToLookFor)
+ @Override
+ public boolean checkIfClassImplements(Class> classToTest, Class> interfaceToLookFor)
{
// check the parent class (if applicable)
if (classToTest.getSuperclass() != Object.class && classToTest.getSuperclass() != null)
@@ -133,56 +123,28 @@ public class DependencyInjector
return false;
}
- /** Checks if classToTest extends the given class. */
- protected boolean checkIfClassExtends(Class> classToTest, Class> extensionToLookFor)
+ @Override
+ public boolean checkIfClassExtends(Class> classToTest, Class> extensionToLookFor)
{
return extensionToLookFor.isAssignableFrom(classToTest);
}
- /**
- * This does not return incomplete dependencies.
- * See {@link #get(Class, boolean) get(Class, boolean)} for full documentation.
- *
- * @see #get(Class, boolean)
- */
@SuppressWarnings("unchecked")
+ @Override
public T get(Class interfaceClass) throws ClassCastException
{
return (T) getInternalLogic(interfaceClass, false).get(0);
}
- /**
- * Returns all dependencies of type T that have been bound.
- * Returns an empty list if no dependencies have been bound.
- *
- * @param class of the dependency
- * (inferred from the objectClass parameter)
- * @param interfaceClass Interface of the dependency
- * @return the dependency of type T
- * @throws ClassCastException If the dependency isn't able to be cast to type T.
- * (this shouldn't normally happen, unless the bound object changed somehow)
- */
+ @Override
public ArrayList getAll(Class interfaceClass) throws ClassCastException
{
return getInternalLogic(interfaceClass, false);
}
- /**
- * Returns a dependency of type T if one has been bound.
- * Returns null if a dependency hasn't been bound.
- *
- * If the handler's {@link #allowDuplicateBindings} is true this returns the first bound dependency.
- *
- * @param class of the dependency
- * (inferred from the interfaceClass parameter)
- * @param interfaceClass Interface of the dependency
- * @param allowIncompleteDependencies If true this method will also return dependencies that haven't completed their delayed setup.
- * @return the dependency of type T
- * @throws ClassCastException If the dependency isn't able to be cast to type T.
- * (this shouldn't normally happen, unless the bound object changed somehow)
- */
@SuppressWarnings("unchecked")
+ @Override
public T get(Class interfaceClass, boolean allowIncompleteDependencies) throws ClassCastException
{
return (T) getInternalLogic(interfaceClass, allowIncompleteDependencies).get(0);
@@ -222,6 +184,7 @@ public class DependencyInjector
/** Removes all bound dependencies. */
+ @Override
public void clear()
{
this.dependencies.clear();
@@ -230,6 +193,7 @@ public class DependencyInjector
/** Runs delayed setup for any dependencies that require it. */
+ @Override
public void runDelayedSetup()
{
for (Class extends BindableType> interfaceKey : dependencies.keySet())
diff --git a/core/src/main/java/com/seibel/lod/core/dependencyInjection/DhApiEventInjector.java b/core/src/main/java/com/seibel/lod/core/dependencyInjection/DhApiEventInjector.java
index 6dd3de6f4..3127a1632 100644
--- a/core/src/main/java/com/seibel/lod/core/dependencyInjection/DhApiEventInjector.java
+++ b/core/src/main/java/com/seibel/lod/core/dependencyInjection/DhApiEventInjector.java
@@ -19,7 +19,7 @@
package com.seibel.lod.core.dependencyInjection;
-import com.seibel.lod.core.api.external.coreImplementations.interfaces.events.ICoreDhApiEvent;
+import com.seibel.lod.api.methods.events.interfaces.IDhApiEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -36,7 +36,7 @@ import java.util.ArrayList;
* @author Leetom
* @version 2022-8-15
*/
-public class DhApiEventInjector extends DependencyInjector // Note to self: Don't try adding a generic type to IDhApiEvent, the consturctor won't accept it
+public class DhApiEventInjector extends DependencyInjector // Note to self: Don't try adding a generic type to IDhApiEvent, the consturctor won't accept it
{
private static final Logger LOGGER = LogManager.getLogger(DhApiEventInjector.class.getSimpleName());
@@ -46,7 +46,7 @@ public class DhApiEventInjector extends DependencyInjector // N
public DhApiEventInjector()
{
- super(ICoreDhApiEvent.class, true);
+ super(IDhApiEvent.class, true);
}
@@ -56,7 +56,7 @@ public class DhApiEventInjector extends DependencyInjector // N
* @throws IllegalArgumentException if the implementation object doesn't implement the interface
* @return true if the handler was unbound, false if the handler wasn't bound.
*/
- public boolean unbind(Class extends ICoreDhApiEvent> dependencyInterface, Class extends ICoreDhApiEvent> dependencyClassToRemove) throws IllegalArgumentException
+ public boolean unbind(Class extends IDhApiEvent> dependencyInterface, Class extends IDhApiEvent> dependencyClassToRemove) throws IllegalArgumentException
{
// make sure the given dependency implements the necessary interfaces
boolean implementsInterface = checkIfClassImplements(dependencyClassToRemove, dependencyInterface)
@@ -77,7 +77,7 @@ public class DhApiEventInjector extends DependencyInjector // N
// actually remove the dependency
if (this.dependencies.containsKey(dependencyInterface))
{
- ArrayList dependencyList = this.dependencies.get(dependencyInterface);
+ ArrayList dependencyList = this.dependencies.get(dependencyInterface);
int indexToRemove = -1;
for(int i = 0; i < dependencyList.size(); i++)
{
@@ -107,12 +107,12 @@ public class DhApiEventInjector extends DependencyInjector // N
* @return if any of the events returned that this event should be canceled.
* @param the parameter type taken by the event handlers.
*/
- public > boolean fireAllEvents(Class