Add IDhApiWrapperFactory

This commit is contained in:
James Seibel
2023-12-16 15:44:29 -06:00
parent 7c678a4a41
commit c1309eb4e8
5 changed files with 109 additions and 2 deletions
@@ -19,7 +19,9 @@
package com.seibel.distanthorizons.core;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.file.DataSourceReferenceTracker;
import com.seibel.distanthorizons.core.wrapperInterfaces.IWrapperFactory;
import com.seibel.distanthorizons.coreapi.ModInfo;
import com.seibel.distanthorizons.core.world.DhApiWorldProxy;
import com.seibel.distanthorizons.core.api.external.methods.config.DhApiConfig;
@@ -67,6 +69,11 @@ public class Initializer
DhApi.Delayed.terrainRepo = DhApiTerrainDataRepo.INSTANCE;
DhApi.Delayed.worldProxy = DhApiWorldProxy.INSTANCE;
DhApi.Delayed.renderProxy = DhApiRenderProxy.INSTANCE;
DhApi.Delayed.wrapperFactory = SingletonInjector.INSTANCE.get(IWrapperFactory.class);
if (DhApi.Delayed.wrapperFactory == null)
{
LOGGER.error("Programmer Error: No ["+IWrapperFactory.class.getSimpleName()+"] assigned to the DhApi.");
}
DataSourceReferenceTracker.startGarbageCollectorBackgroundThread();
@@ -19,6 +19,7 @@
package com.seibel.distanthorizons.core.wrapperInterfaces;
import com.seibel.distanthorizons.api.interfaces.factories.IDhApiWrapperFactory;
import com.seibel.distanthorizons.core.level.IDhLevel;
import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
@@ -36,7 +37,7 @@ import java.util.HashSet;
* @author James Seibel
* @version 2022-12-5
*/
public interface IWrapperFactory extends IBindable
public interface IWrapperFactory extends IDhApiWrapperFactory, IBindable
{
AbstractBatchGenerationEnvironmentWrapper createBatchGenerator(IDhLevel targetLevel);
IBiomeWrapper deserializeBiomeWrapper(String str, ILevelWrapper levelWrapper) throws IOException;