Bugfixes for generation

This commit is contained in:
Daniel Mills
2020-12-20 21:04:11 -05:00
parent 70ae1cce4b
commit 1cf60544e1
11 changed files with 721 additions and 284 deletions

View File

@@ -19,6 +19,7 @@ public class IrisDataManager
private ResourceLoader<IrisDimension> dimensionLoader;
private ResourceLoader<IrisGenerator> generatorLoader;
private ResourceLoader<IrisStructure> structureLoader;
private ResourceLoader<IrisStructurePiece> structurePieceLoader;
private ResourceLoader<IrisEntity> entityLoader;
private ResourceLoader<IrisBlockData> blockLoader;
private ObjectResourceLoader objectLoader;
@@ -49,6 +50,7 @@ public class IrisDataManager
this.biomeLoader = null;
this.dimensionLoader = null;
this.structureLoader = null;
this.structurePieceLoader = null;
this.generatorLoader = null;
this.blockLoader = null;
this.objectLoader = null;
@@ -78,6 +80,7 @@ public class IrisDataManager
this.biomeLoader = new ResourceLoader<>(packs, this, "biomes", "Biome", IrisBiome.class);
this.dimensionLoader = new ResourceLoader<>(packs, this, "dimensions", "Dimension", IrisDimension.class);
this.structureLoader = new ResourceLoader<>(packs, this, "structures", "Structure", IrisStructure.class);
this.structurePieceLoader = new ResourceLoader<>(packs, this, "structure-pieces", "Structure Piece", IrisStructurePiece.class);
this.generatorLoader = new ResourceLoader<>(packs, this, "generators", "Generator", IrisGenerator.class);
this.blockLoader = new ResourceLoader<>(packs,this, "blocks", "Block", IrisBlockData.class);
this.objectLoader = new ObjectResourceLoader(packs, this, "objects", "Object");
@@ -93,6 +96,7 @@ public class IrisDataManager
blockLoader.clearCache();
lootLoader.clearCache();
objectLoader.clearCache();
structurePieceLoader.clearCache();
regionLoader.clearCache();
dimensionLoader.clearCache();
entityLoader.clearCache();
@@ -115,6 +119,7 @@ public class IrisDataManager
dimensionLoader.clearList();
generatorLoader.clearList();
structureLoader.clearList();
structurePieceLoader.clearList();
objectLoader.clearList();
}
@@ -133,6 +138,11 @@ public class IrisDataManager
return loadAny(key, (dm) -> dm.getStructureLoader().load(key, false));
}
public static IrisStructurePiece loadAnyStructurePiece(String key)
{
return loadAny(key, (dm) -> dm.getStructurePieceLoader().load(key, false));
}
public static IrisEntity loadAnyEntity(String key)
{
return loadAny(key, (dm) -> dm.getEntityLoader().load(key, false));