mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Registry for jigsaw
This commit is contained in:
parent
5487cd7858
commit
5f50fa4202
@ -20,6 +20,7 @@ public class IrisDataManager
|
|||||||
private ResourceLoader<IrisGenerator> generatorLoader;
|
private ResourceLoader<IrisGenerator> generatorLoader;
|
||||||
private ResourceLoader<IrisStructure> structureLoader;
|
private ResourceLoader<IrisStructure> structureLoader;
|
||||||
private ResourceLoader<IrisStructurePiece> structurePieceLoader;
|
private ResourceLoader<IrisStructurePiece> structurePieceLoader;
|
||||||
|
private ResourceLoader<IrisStructurePool> structurePoolLoader;
|
||||||
private ResourceLoader<IrisEntity> entityLoader;
|
private ResourceLoader<IrisEntity> entityLoader;
|
||||||
private ResourceLoader<IrisBlockData> blockLoader;
|
private ResourceLoader<IrisBlockData> blockLoader;
|
||||||
private ObjectResourceLoader objectLoader;
|
private ObjectResourceLoader objectLoader;
|
||||||
@ -50,6 +51,7 @@ public class IrisDataManager
|
|||||||
this.biomeLoader = null;
|
this.biomeLoader = null;
|
||||||
this.dimensionLoader = null;
|
this.dimensionLoader = null;
|
||||||
this.structureLoader = null;
|
this.structureLoader = null;
|
||||||
|
this.structurePoolLoader = null;
|
||||||
this.structurePieceLoader = null;
|
this.structurePieceLoader = null;
|
||||||
this.generatorLoader = null;
|
this.generatorLoader = null;
|
||||||
this.blockLoader = null;
|
this.blockLoader = null;
|
||||||
@ -80,7 +82,8 @@ public class IrisDataManager
|
|||||||
this.biomeLoader = new ResourceLoader<>(packs, this, "biomes", "Biome", IrisBiome.class);
|
this.biomeLoader = new ResourceLoader<>(packs, this, "biomes", "Biome", IrisBiome.class);
|
||||||
this.dimensionLoader = new ResourceLoader<>(packs, this, "dimensions", "Dimension", IrisDimension.class);
|
this.dimensionLoader = new ResourceLoader<>(packs, this, "dimensions", "Dimension", IrisDimension.class);
|
||||||
this.structureLoader = new ResourceLoader<>(packs, this, "structures", "Structure", IrisStructure.class);
|
this.structureLoader = new ResourceLoader<>(packs, this, "structures", "Structure", IrisStructure.class);
|
||||||
this.structurePieceLoader = new ResourceLoader<>(packs, this, "structure-pieces", "Structure Piece", IrisStructurePiece.class);
|
this.structurePoolLoader = new ResourceLoader<>(packs, this, "jigsaw-pools", "Jigsaw Pool", IrisStructurePool.class);
|
||||||
|
this.structurePieceLoader = new ResourceLoader<>(packs, this, "jigsaw-pieces", "Jigsaw Piece", IrisStructurePiece.class);
|
||||||
this.generatorLoader = new ResourceLoader<>(packs, this, "generators", "Generator", IrisGenerator.class);
|
this.generatorLoader = new ResourceLoader<>(packs, this, "generators", "Generator", IrisGenerator.class);
|
||||||
this.blockLoader = new ResourceLoader<>(packs,this, "blocks", "Block", IrisBlockData.class);
|
this.blockLoader = new ResourceLoader<>(packs,this, "blocks", "Block", IrisBlockData.class);
|
||||||
this.objectLoader = new ObjectResourceLoader(packs, this, "objects", "Object");
|
this.objectLoader = new ObjectResourceLoader(packs, this, "objects", "Object");
|
||||||
@ -97,6 +100,7 @@ public class IrisDataManager
|
|||||||
lootLoader.clearCache();
|
lootLoader.clearCache();
|
||||||
objectLoader.clearCache();
|
objectLoader.clearCache();
|
||||||
structurePieceLoader.clearCache();
|
structurePieceLoader.clearCache();
|
||||||
|
structurePoolLoader.clearCache();
|
||||||
regionLoader.clearCache();
|
regionLoader.clearCache();
|
||||||
dimensionLoader.clearCache();
|
dimensionLoader.clearCache();
|
||||||
entityLoader.clearCache();
|
entityLoader.clearCache();
|
||||||
@ -119,6 +123,7 @@ public class IrisDataManager
|
|||||||
dimensionLoader.clearList();
|
dimensionLoader.clearList();
|
||||||
generatorLoader.clearList();
|
generatorLoader.clearList();
|
||||||
structureLoader.clearList();
|
structureLoader.clearList();
|
||||||
|
structurePoolLoader.clearList();
|
||||||
structurePieceLoader.clearList();
|
structurePieceLoader.clearList();
|
||||||
objectLoader.clearList();
|
objectLoader.clearList();
|
||||||
}
|
}
|
||||||
@ -143,6 +148,11 @@ public class IrisDataManager
|
|||||||
return loadAny(key, (dm) -> dm.getStructurePieceLoader().load(key, false));
|
return loadAny(key, (dm) -> dm.getStructurePieceLoader().load(key, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IrisStructurePool loadAnyStructurePool(String key)
|
||||||
|
{
|
||||||
|
return loadAny(key, (dm) -> dm.getStructurePoolLoader().load(key, false));
|
||||||
|
}
|
||||||
|
|
||||||
public static IrisEntity loadAnyEntity(String key)
|
public static IrisEntity loadAnyEntity(String key)
|
||||||
{
|
{
|
||||||
return loadAny(key, (dm) -> dm.getEntityLoader().load(key, false));
|
return loadAny(key, (dm) -> dm.getEntityLoader().load(key, false));
|
||||||
|
25
src/main/java/com/volmit/iris/object/IrisStructurePool.java
Normal file
25
src/main/java/com/volmit/iris/object/IrisStructurePool.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package com.volmit.iris.object;
|
||||||
|
|
||||||
|
import com.volmit.iris.util.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("Represents a structure piece pool")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class IrisStructurePool extends IrisRegistrant
|
||||||
|
{
|
||||||
|
@RegistryListStructurePiece
|
||||||
|
@Required
|
||||||
|
@DontObfuscate
|
||||||
|
@ArrayType(min = 1,type = String.class)
|
||||||
|
@Desc("A list of structure piece pools")
|
||||||
|
private KList<String> pieces = new KList<>();
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.volmit.iris.util;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
import static java.lang.annotation.ElementType.*;
|
||||||
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
|
@Retention(RUNTIME)
|
||||||
|
@Target({PARAMETER, TYPE, FIELD})
|
||||||
|
public @interface RegistryListStructurePool
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user