Move API Interfaces into the API sub-project
This commit is contained in:
Vendored
-25
@@ -1,25 +0,0 @@
|
||||
package com.seibel.lod.core.api.external.items.interfaces;
|
||||
|
||||
/**
|
||||
* 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 IDhApiUnsafeWrapper
|
||||
{
|
||||
/**
|
||||
* Teturns the Minecraft object this wrapper contains. <br>
|
||||
* <strong>Warning</strong>: This object will be Minecraft
|
||||
* version dependent and may change without notice. <br> <br>
|
||||
*
|
||||
* In order to cast this object to something usable, you may want
|
||||
* to use <code>obj.getClass()</code> 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();
|
||||
|
||||
}
|
||||
Vendored
-49
@@ -1,49 +0,0 @@
|
||||
package com.seibel.lod.core.api.external.items.interfaces.config;
|
||||
|
||||
/**
|
||||
* An interface for Distant Horizon's Config.
|
||||
*
|
||||
* @param <T> The internal data type of this config.
|
||||
* @author James Seibel
|
||||
* @version 2022-6-13
|
||||
*/
|
||||
public interface IDhApiConfig<T>
|
||||
{
|
||||
/**
|
||||
* Returns the active value for this config. <br>
|
||||
* Returns the True value if either the config cannot be overridden by
|
||||
* the API or if it hasn't been set by the API.
|
||||
*/
|
||||
public T getValue();
|
||||
/**
|
||||
* Returns the value held by this config. <br>
|
||||
* This is the value stored in the config file.
|
||||
*/
|
||||
public T getTrueValue();
|
||||
/**
|
||||
* Returns the value of the config if it was set by the API.
|
||||
* Returns null if the config wasn't set by the API.
|
||||
*/
|
||||
public T getApiValue();
|
||||
|
||||
/**
|
||||
* Sets the config's value. <br>
|
||||
* If the newValue is set to null then the config
|
||||
* will revert to using the True Value.<br>
|
||||
* If the config cannot be set via the API this method will return false.
|
||||
*
|
||||
* @return true if the value was set, false otherwise.
|
||||
*/
|
||||
public boolean setValue(T newValue);
|
||||
|
||||
/** Returns true if this config can be set via the API, false otherwise. */
|
||||
public boolean getCanBeOverrodeByApi();
|
||||
|
||||
/** Returns the default value for this config. */
|
||||
public T getDefaultValue();
|
||||
/** Returns the max value for this config, null if there is no max. */
|
||||
public T getMaxValue();
|
||||
/** Returns the min value for this config, null if there is no min. */
|
||||
public T getMinValue();
|
||||
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package com.seibel.lod.core.api.external.items.interfaces.override;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.enums.override.EDhApiOverridePriority;
|
||||
import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
|
||||
|
||||
/**
|
||||
* Implemented by all DhApi objects that can be overridden.
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 2022-7-18
|
||||
*/
|
||||
public interface IDhApiOverrideable extends IBindable
|
||||
{
|
||||
/**
|
||||
* Returns when this Override should be used. <br>
|
||||
* For most developers this can be left at the default.
|
||||
*/
|
||||
default EDhApiOverridePriority getOverrideType() { return EDhApiOverridePriority.PRIMARY; }
|
||||
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package com.seibel.lod.core.api.external.items.interfaces.override;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiWorldGenerationStep;
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiWorldGenThreadMode;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiChunkWrapper;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
* @version 2022-7-26
|
||||
*/
|
||||
public interface IDhApiWorldGenerator extends IDhApiOverrideable
|
||||
{
|
||||
/** Returns which thread chunk generation requests can be created on. */
|
||||
EDhApiWorldGenThreadMode getThreadingMode();
|
||||
|
||||
IDhApiChunkWrapper generateChunk(int chunkPosX, int chunkPosZ, IDhApiLevelWrapper serverLevelWrapper, EDhApiWorldGenerationStep maxStepToGenerate);
|
||||
|
||||
}
|
||||
Vendored
-68
@@ -1,68 +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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.seibel.lod.core.api.external.items.interfaces.world;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.interfaces.IDhApiUnsafeWrapper;
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
* @version 2022-7-14
|
||||
*/
|
||||
public interface IDhApiChunkWrapper extends IDhApiUnsafeWrapper
|
||||
{
|
||||
/** Returns the absolute Y coordinate of the highest block for the given relative X and Z coordinates. */
|
||||
int getMaxY(int relativeX, int relativeZ);
|
||||
/** Returns the maximum absolute block position in the X direction. */
|
||||
int getMaxX();
|
||||
/** Returns the maximum absolute block position in the Z direction. */
|
||||
int getMaxZ();
|
||||
|
||||
/** Returns the absolute Y coordinate of the lowest block for the given relative X and Z coordinates. */
|
||||
int getMinY(int relativeX, int relativeZ);
|
||||
/** Returns the minimum absolute block position in the X direction. */
|
||||
int getMinX();
|
||||
/** Returns the minimum absolute block position in the Z direction. */
|
||||
int getMinZ();
|
||||
|
||||
/**
|
||||
* Returns true if this chunk's lighting has been built. <br>
|
||||
* Note: for some versions of Minecraft this value may be unreliable.
|
||||
*/
|
||||
boolean isLightCorrect();
|
||||
|
||||
/** TODO what side of the block should this return the light for? */
|
||||
default int getBlockLight(int x, int y, int z) {return -1;}
|
||||
/** TODO what side of the block should this return the light for? */
|
||||
default int getSkyLight(int x, int y, int z) {return -1;}
|
||||
|
||||
/**
|
||||
* Returns true if chunks exist in all 4 cardinal and 4 ordinal directions
|
||||
* relative to this chunk. <br>
|
||||
* IE: returns true if there are chunks to the North, South, East, West, NE, SE, SW, and NW
|
||||
* of this chunk.
|
||||
*/
|
||||
boolean doNearbyChunksExist();
|
||||
|
||||
|
||||
// TODO these will probably need replacing once 1.7's ID system is done
|
||||
//IBlockStateWrapper getBlockState(int x, int y, int z);
|
||||
//IBiomeWrapper getBiome(int x, int y, int z);
|
||||
|
||||
}
|
||||
-35
@@ -1,35 +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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.seibel.lod.core.api.external.items.interfaces.world;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.interfaces.IDhApiUnsafeWrapper;
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
* @version 2022-7-14
|
||||
*/
|
||||
public interface IDhApiDimensionTypeWrapper extends IDhApiUnsafeWrapper
|
||||
{
|
||||
String getDimensionName();
|
||||
|
||||
boolean hasCeiling();
|
||||
|
||||
boolean hasSkyLight();
|
||||
}
|
||||
Vendored
-48
@@ -1,48 +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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.seibel.lod.core.api.external.items.interfaces.world;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.interfaces.IDhApiUnsafeWrapper;
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiLevelType;
|
||||
|
||||
/**
|
||||
* Can be either a Server or Client level.
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 2022-7-14
|
||||
*/
|
||||
public interface IDhApiLevelWrapper extends IDhApiUnsafeWrapper
|
||||
{
|
||||
IDhApiDimensionTypeWrapper getDimensionType();
|
||||
|
||||
EDhApiLevelType getLevelType();
|
||||
|
||||
boolean hasCeiling();
|
||||
|
||||
boolean hasSkyLight();
|
||||
|
||||
int getHeight();
|
||||
|
||||
default int getMinHeight()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.api.external.methods.events.abstractEvents;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.core.api.implementation.interfaces.events.IDhApiEvent;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.api.external.methods.events.abstractEvents;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.core.api.implementation.interfaces.events.IDhApiEvent;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.api.external.methods.events.abstractEvents;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.core.api.implementation.interfaces.events.IDhApiEvent;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.seibel.lod.core.api.implementation.wrappers;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.interfaces.config.IDhApiConfig;
|
||||
import com.seibel.lod.api.items.interfaces.config.IDhApiConfig;
|
||||
import com.seibel.lod.core.api.implementation.interfaces.config.IConverter;
|
||||
import com.seibel.lod.core.api.implementation.objects.DefaultConverter;
|
||||
import com.seibel.lod.core.config.types.ConfigEntry;
|
||||
|
||||
+2
-6
@@ -19,13 +19,9 @@
|
||||
|
||||
package com.seibel.lod.core.api.implementation.wrappers;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiLevelType;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiDimensionTypeWrapper;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IClientLevelWrapper;
|
||||
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.IDimensionTypeWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.ILevelWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IServerLevelWrapper;
|
||||
|
||||
/**
|
||||
* @author James Seibel
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ package com.seibel.lod.core.api.implementation.wrappers;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiLevelType;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.IDhApiUnsafeWrapper;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiDimensionTypeWrapper;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
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.ILevelWrapper;
|
||||
import com.seibel.lod.core.wrapperInterfaces.world.IServerLevelWrapper;
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
package com.seibel.lod.core.handlers.dependencyInjection;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.enums.override.EDhApiOverridePriority;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.override.IDhApiOverrideable;
|
||||
import com.seibel.lod.api.items.interfaces.override.IDhApiOverrideable;
|
||||
import com.seibel.lod.core.api.implementation.objects.GenericEnumConverter;
|
||||
import com.seibel.lod.core.enums.override.EOverridePriority;
|
||||
import com.seibel.lod.core.util.StringUtil;
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@
|
||||
|
||||
package com.seibel.lod.core.handlers.dependencyInjection;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.core.util.StringUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package testItems.overrideInjection.interfaces;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.interfaces.override.IDhApiOverrideable;
|
||||
import com.seibel.lod.api.items.interfaces.override.IDhApiOverrideable;
|
||||
|
||||
/**
|
||||
* Dummy override test interface for dependency unit tests.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package testItems.worldGeneratorInjection.objects;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiLevelType;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiDimensionTypeWrapper;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiDimensionTypeWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
|
||||
|
||||
/**
|
||||
* Stub implementation of a Level wrapper for basic unit testing.
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@ package testItems.worldGeneratorInjection.objects;
|
||||
import com.seibel.lod.core.api.external.items.enums.override.EDhApiOverridePriority;
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiWorldGenThreadMode;
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiWorldGenerationStep;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiChunkWrapper;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiChunkWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
|
||||
|
||||
/**
|
||||
* Dummy test implementation object for world generator injection unit tests.
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@ package testItems.worldGeneratorInjection.objects;
|
||||
import com.seibel.lod.core.api.external.items.enums.override.EDhApiOverridePriority;
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiWorldGenThreadMode;
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiWorldGenerationStep;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiChunkWrapper;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiChunkWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
|
||||
|
||||
/**
|
||||
* Dummy test implementation object for world generator injection unit tests.
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@ package testItems.worldGeneratorInjection.objects;
|
||||
import com.seibel.lod.core.api.external.items.enums.override.EDhApiOverridePriority;
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiWorldGenThreadMode;
|
||||
import com.seibel.lod.core.api.external.items.enums.worldGeneration.EDhApiWorldGenerationStep;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiChunkWrapper;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiChunkWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
|
||||
|
||||
/**
|
||||
* Dummy test implementation object for world generator injection unit tests.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package tests;
|
||||
|
||||
import com.seibel.lod.core.api.external.items.enums.override.EDhApiOverridePriority;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.override.IDhApiOverrideable;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.core.api.external.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.api.items.interfaces.override.IDhApiOverrideable;
|
||||
import com.seibel.lod.api.items.interfaces.override.IDhApiWorldGenerator;
|
||||
import com.seibel.lod.api.items.interfaces.world.IDhApiLevelWrapper;
|
||||
import com.seibel.lod.core.enums.override.EOverridePriority;
|
||||
import com.seibel.lod.core.handlers.dependencyInjection.*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user