mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-05 15:26:28 +00:00
Fix data managers
This commit is contained in:
@@ -40,35 +40,10 @@ public class IrisDataManager
|
||||
private ResourceLoader<IrisBlockData> blockLoader;
|
||||
private ObjectResourceLoader objectLoader;
|
||||
|
||||
public void hotloaded()
|
||||
{
|
||||
if(prod)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
File packs = this.packs.getName().equals("packs") ? this.packs : dataFolder;
|
||||
packs.mkdirs();
|
||||
this.lootLoader = new ResourceLoader<>(packs, "loot", "Loot", IrisLootTable.class);
|
||||
this.entityLoader = new ResourceLoader<>(packs, "entities", "Entity", IrisEntity.class);
|
||||
this.regionLoader = new ResourceLoader<>(packs, "regions", "Region", IrisRegion.class);
|
||||
this.biomeLoader = new ResourceLoader<>(packs, "biomes", "Biome", IrisBiome.class);
|
||||
this.dimensionLoader = new ResourceLoader<>(packs, "dimensions", "Dimension", IrisDimension.class);
|
||||
this.structureLoader = new ResourceLoader<>(packs, "structures", "Structure", IrisStructure.class);
|
||||
this.generatorLoader = new ResourceLoader<>(packs, "generators", "Generator", IrisGenerator.class);
|
||||
this.blockLoader = new ResourceLoader<>(packs, "blocks", "Block", IrisBlockData.class);
|
||||
this.objectLoader = new ObjectResourceLoader(packs, "objects", "Object");
|
||||
|
||||
if(packs.getName().equals("packs"))
|
||||
{
|
||||
writeExamples();
|
||||
}
|
||||
}
|
||||
|
||||
public IrisDataManager(File dataFolder)
|
||||
{
|
||||
this.dataFolder = dataFolder;
|
||||
this.packs = new File(dataFolder, "packs");
|
||||
this.packs = new File(dataFolder, ProjectManager.workspaceName);
|
||||
boolean pr = false;
|
||||
if(!packs.exists())
|
||||
{
|
||||
@@ -83,6 +58,31 @@ public class IrisDataManager
|
||||
prod = pr;
|
||||
}
|
||||
|
||||
public void hotloaded()
|
||||
{
|
||||
if(prod)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
File packs = this.packs.getName().equals(ProjectManager.workspaceName) ? this.packs : dataFolder;
|
||||
packs.mkdirs();
|
||||
this.lootLoader = new ResourceLoader<>(packs, "loot", "Loot", IrisLootTable.class);
|
||||
this.entityLoader = new ResourceLoader<>(packs, "entities", "Entity", IrisEntity.class);
|
||||
this.regionLoader = new ResourceLoader<>(packs, "regions", "Region", IrisRegion.class);
|
||||
this.biomeLoader = new ResourceLoader<>(packs, "biomes", "Biome", IrisBiome.class);
|
||||
this.dimensionLoader = new ResourceLoader<>(packs, "dimensions", "Dimension", IrisDimension.class);
|
||||
this.structureLoader = new ResourceLoader<>(packs, "structures", "Structure", IrisStructure.class);
|
||||
this.generatorLoader = new ResourceLoader<>(packs, "generators", "Generator", IrisGenerator.class);
|
||||
this.blockLoader = new ResourceLoader<>(packs, "blocks", "Block", IrisBlockData.class);
|
||||
this.objectLoader = new ObjectResourceLoader(packs, "objects", "Object");
|
||||
|
||||
if(packs.getName().equals(ProjectManager.workspaceName))
|
||||
{
|
||||
writeExamples();
|
||||
}
|
||||
}
|
||||
|
||||
public void dump()
|
||||
{
|
||||
biomeLoader.clearCache();
|
||||
|
||||
Reference in New Issue
Block a user