mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 10:43:14 +00:00
Fix jigsaw save locations
This commit is contained in:
parent
56ae387f7b
commit
3dc7bd74fe
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.volmit</groupId>
|
<groupId>com.volmit</groupId>
|
||||||
<artifactId>Iris</artifactId>
|
<artifactId>Iris</artifactId>
|
||||||
<version>1.1.9</version>
|
<version>1.1.10</version>
|
||||||
<name>Iris</name>
|
<name>Iris</name>
|
||||||
<properties>
|
<properties>
|
||||||
<skip.copy>false</skip.copy>
|
<skip.copy>false</skip.copy>
|
||||||
|
@ -19,8 +19,9 @@ public class IrisDataManager
|
|||||||
private ResourceLoader<IrisDimension> dimensionLoader;
|
private ResourceLoader<IrisDimension> dimensionLoader;
|
||||||
private ResourceLoader<IrisGenerator> generatorLoader;
|
private ResourceLoader<IrisGenerator> generatorLoader;
|
||||||
private ResourceLoader<IrisStructure> structureLoader;
|
private ResourceLoader<IrisStructure> structureLoader;
|
||||||
private ResourceLoader<IrisJigsawPiece> structurePieceLoader;
|
private ResourceLoader<IrisJigsawPiece> jigsawPieceLoader;
|
||||||
private ResourceLoader<IrisJigsawPool> structurePoolLoader;
|
private ResourceLoader<IrisJigsawPool> jigsawPoolLoader;
|
||||||
|
private ResourceLoader<IrisJigsawStructure> jigsawStructureLoader;
|
||||||
private ResourceLoader<IrisEntity> entityLoader;
|
private ResourceLoader<IrisEntity> entityLoader;
|
||||||
private ResourceLoader<IrisBlockData> blockLoader;
|
private ResourceLoader<IrisBlockData> blockLoader;
|
||||||
private ObjectResourceLoader objectLoader;
|
private ObjectResourceLoader objectLoader;
|
||||||
@ -51,9 +52,10 @@ 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.jigsawPoolLoader = null;
|
||||||
this.structurePieceLoader = null;
|
this.jigsawPieceLoader = null;
|
||||||
this.generatorLoader = null;
|
this.generatorLoader = null;
|
||||||
|
this.jigsawStructureLoader = null;
|
||||||
this.blockLoader = null;
|
this.blockLoader = null;
|
||||||
this.objectLoader = null;
|
this.objectLoader = null;
|
||||||
}
|
}
|
||||||
@ -82,8 +84,9 @@ 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.structurePoolLoader = new ResourceLoader<>(packs, this, "jigsaw-pools", "Jigsaw Pool", IrisJigsawPool.class);
|
this.jigsawPoolLoader = new ResourceLoader<>(packs, this, "jigsaw-pools", "Jigsaw Pool", IrisJigsawPool.class);
|
||||||
this.structurePieceLoader = new ResourceLoader<>(packs, this, "jigsaw-pieces", "Jigsaw Piece", IrisJigsawPiece.class);
|
this.jigsawStructureLoader = new ResourceLoader<>(packs, this, "jigsaw-structures", "Jigsaw Structure", IrisJigsawStructure.class);
|
||||||
|
this.jigsawPieceLoader = new ResourceLoader<>(packs, this, "jigsaw-pieces", "Jigsaw Piece", IrisJigsawPiece.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");
|
||||||
@ -99,8 +102,9 @@ public class IrisDataManager
|
|||||||
blockLoader.clearCache();
|
blockLoader.clearCache();
|
||||||
lootLoader.clearCache();
|
lootLoader.clearCache();
|
||||||
objectLoader.clearCache();
|
objectLoader.clearCache();
|
||||||
structurePieceLoader.clearCache();
|
jigsawPieceLoader.clearCache();
|
||||||
structurePoolLoader.clearCache();
|
jigsawPoolLoader.clearCache();
|
||||||
|
jigsawStructureLoader.clearCache();
|
||||||
regionLoader.clearCache();
|
regionLoader.clearCache();
|
||||||
dimensionLoader.clearCache();
|
dimensionLoader.clearCache();
|
||||||
entityLoader.clearCache();
|
entityLoader.clearCache();
|
||||||
@ -122,9 +126,10 @@ public class IrisDataManager
|
|||||||
regionLoader.clearList();
|
regionLoader.clearList();
|
||||||
dimensionLoader.clearList();
|
dimensionLoader.clearList();
|
||||||
generatorLoader.clearList();
|
generatorLoader.clearList();
|
||||||
|
jigsawStructureLoader.clearList();
|
||||||
structureLoader.clearList();
|
structureLoader.clearList();
|
||||||
structurePoolLoader.clearList();
|
jigsawPoolLoader.clearList();
|
||||||
structurePieceLoader.clearList();
|
jigsawPieceLoader.clearList();
|
||||||
objectLoader.clearList();
|
objectLoader.clearList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,14 +148,14 @@ public class IrisDataManager
|
|||||||
return loadAny(key, (dm) -> dm.getStructureLoader().load(key, false));
|
return loadAny(key, (dm) -> dm.getStructureLoader().load(key, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IrisJigsawPiece loadAnyStructurePiece(String key)
|
public static IrisJigsawPiece loadAnyJigsawPiece(String key)
|
||||||
{
|
{
|
||||||
return loadAny(key, (dm) -> dm.getStructurePieceLoader().load(key, false));
|
return loadAny(key, (dm) -> dm.getJigsawPieceLoader().load(key, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IrisJigsawPool loadAnyStructurePool(String key)
|
public static IrisJigsawPool loadAnyJigsawPool(String key)
|
||||||
{
|
{
|
||||||
return loadAny(key, (dm) -> dm.getStructurePoolLoader().load(key, false));
|
return loadAny(key, (dm) -> dm.getJigsawPoolLoader().load(key, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IrisEntity loadAnyEntity(String key)
|
public static IrisEntity loadAnyEntity(String key)
|
||||||
@ -178,6 +183,11 @@ public class IrisDataManager
|
|||||||
return loadAny(key, (dm) -> dm.getDimensionLoader().load(key, false));
|
return loadAny(key, (dm) -> dm.getDimensionLoader().load(key, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IrisJigsawStructure loadAnyJigsawStructure(String key)
|
||||||
|
{
|
||||||
|
return loadAny(key, (dm) -> dm.getJigsawStructureLoader().load(key, false));
|
||||||
|
}
|
||||||
|
|
||||||
public static IrisGenerator loadAnyGenerator(String key)
|
public static IrisGenerator loadAnyGenerator(String key)
|
||||||
{
|
{
|
||||||
return loadAny(key, (dm) -> dm.getGeneratorLoader().load(key, false));
|
return loadAny(key, (dm) -> dm.getGeneratorLoader().load(key, false));
|
||||||
|
@ -285,6 +285,7 @@ public class IrisProject
|
|||||||
schemas.put(getSchemaEntry(IrisStructure.class, dm, "/structures/*.json"));
|
schemas.put(getSchemaEntry(IrisStructure.class, dm, "/structures/*.json"));
|
||||||
schemas.put(getSchemaEntry(IrisJigsawPiece.class, dm, "/jigsaw-pieces/*.json"));
|
schemas.put(getSchemaEntry(IrisJigsawPiece.class, dm, "/jigsaw-pieces/*.json"));
|
||||||
schemas.put(getSchemaEntry(IrisJigsawPool.class, dm, "/jigsaw-pools/*.json"));
|
schemas.put(getSchemaEntry(IrisJigsawPool.class, dm, "/jigsaw-pools/*.json"));
|
||||||
|
schemas.put(getSchemaEntry(IrisJigsawStructure.class, dm, "/jigsaw-structures/*.json"));
|
||||||
schemas.put(getSchemaEntry(IrisBlockData.class, dm, "/blocks/*.json"));
|
schemas.put(getSchemaEntry(IrisBlockData.class, dm, "/blocks/*.json"));
|
||||||
schemas.put(getSchemaEntry(IrisLootTable.class, dm, "/loot/*.json"));
|
schemas.put(getSchemaEntry(IrisLootTable.class, dm, "/loot/*.json"));
|
||||||
settings.put("json.schemas", schemas);
|
settings.put("json.schemas", schemas);
|
||||||
@ -325,7 +326,7 @@ public class IrisProject
|
|||||||
blocks.add(dm.getBlockLoader().load(i));
|
blocks.add(dm.getBlockLoader().load(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: EXPORT STRUCTURE PIECES FROM STRUCTURES
|
//TODO: EXPORT JIGSAW PIECES FROM STRUCTURES
|
||||||
dimension.getRegions().forEach((i) -> regions.add(dm.getRegionLoader().load(i)));
|
dimension.getRegions().forEach((i) -> regions.add(dm.getRegionLoader().load(i)));
|
||||||
dimension.getLoot().getTables().forEach((i) -> loot.add(dm.getLootLoader().load(i)));
|
dimension.getLoot().getTables().forEach((i) -> loot.add(dm.getLootLoader().load(i)));
|
||||||
regions.forEach((i) -> biomes.addAll(i.getAllBiomes(null)));
|
regions.forEach((i) -> biomes.addAll(i.getAllBiomes(null)));
|
||||||
|
@ -382,14 +382,14 @@ public class SchemaBuilder
|
|||||||
description.add(SYMBOL_TYPE__N + " Must be a valid Structure Tileset (use ctrl+space for auto complete!)");
|
description.add(SYMBOL_TYPE__N + " Must be a valid Structure Tileset (use ctrl+space for auto complete!)");
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(k.isAnnotationPresent(RegistryListStructurePiece.class))
|
else if(k.isAnnotationPresent(RegistryListJigsawPiece.class))
|
||||||
{
|
{
|
||||||
String key = "enum-reg-structure-piece";
|
String key = "enum-reg-structure-piece";
|
||||||
|
|
||||||
if(!definitions.containsKey(key))
|
if(!definitions.containsKey(key))
|
||||||
{
|
{
|
||||||
JSONObject j = new JSONObject();
|
JSONObject j = new JSONObject();
|
||||||
j.put("enum", new JSONArray(data.getStructurePieceLoader().getPossibleKeys()));
|
j.put("enum", new JSONArray(data.getJigsawPieceLoader().getPossibleKeys()));
|
||||||
definitions.put(key, j);
|
definitions.put(key, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,14 +398,30 @@ public class SchemaBuilder
|
|||||||
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
|
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(k.isAnnotationPresent(RegistryListStructurePool.class))
|
else if(k.isAnnotationPresent(RegistryListJigsaw.class))
|
||||||
|
{
|
||||||
|
String key = "enum-reg-jigsaw";
|
||||||
|
|
||||||
|
if(!definitions.containsKey(key))
|
||||||
|
{
|
||||||
|
JSONObject j = new JSONObject();
|
||||||
|
j.put("enum", new JSONArray(data.getJigsawStructureLoader().getPossibleKeys()));
|
||||||
|
definitions.put(key, j);
|
||||||
|
}
|
||||||
|
|
||||||
|
fancyType = "Iris Jigsaw";
|
||||||
|
prop.put("$ref", "#/definitions/" + key);
|
||||||
|
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw (use ctrl+space for auto complete!)");
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(k.isAnnotationPresent(RegistryListJigsawPool.class))
|
||||||
{
|
{
|
||||||
String key = "enum-reg-structure-pool";
|
String key = "enum-reg-structure-pool";
|
||||||
|
|
||||||
if(!definitions.containsKey(key))
|
if(!definitions.containsKey(key))
|
||||||
{
|
{
|
||||||
JSONObject j = new JSONObject();
|
JSONObject j = new JSONObject();
|
||||||
j.put("enum", new JSONArray(data.getStructurePoolLoader().getPossibleKeys()));
|
j.put("enum", new JSONArray(data.getJigsawPoolLoader().getPossibleKeys()));
|
||||||
definitions.put(key, j);
|
definitions.put(key, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,7 +813,7 @@ public class SchemaBuilder
|
|||||||
description.add(SYMBOL_TYPE__N + " Must be a valid Structure Tileset (use ctrl+space for auto complete!)");
|
description.add(SYMBOL_TYPE__N + " Must be a valid Structure Tileset (use ctrl+space for auto complete!)");
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(k.isAnnotationPresent(RegistryListStructurePiece.class))
|
else if(k.isAnnotationPresent(RegistryListJigsawPiece.class))
|
||||||
{
|
{
|
||||||
fancyType = "List of Iris Jigsaw Pieces";
|
fancyType = "List of Iris Jigsaw Pieces";
|
||||||
String key = "enum-reg-structure-piece";
|
String key = "enum-reg-structure-piece";
|
||||||
@ -805,7 +821,7 @@ public class SchemaBuilder
|
|||||||
if(!definitions.containsKey(key))
|
if(!definitions.containsKey(key))
|
||||||
{
|
{
|
||||||
JSONObject j = new JSONObject();
|
JSONObject j = new JSONObject();
|
||||||
j.put("enum", new JSONArray(data.getStructurePieceLoader().getPossibleKeys()));
|
j.put("enum", new JSONArray(data.getJigsawPieceLoader().getPossibleKeys()));
|
||||||
definitions.put(key, j);
|
definitions.put(key, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -815,7 +831,7 @@ public class SchemaBuilder
|
|||||||
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
|
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(k.isAnnotationPresent(RegistryListStructurePool.class))
|
else if(k.isAnnotationPresent(RegistryListJigsawPool.class))
|
||||||
{
|
{
|
||||||
fancyType = "List of Iris Jigsaw Pools";
|
fancyType = "List of Iris Jigsaw Pools";
|
||||||
String key = "enum-reg-structure-pool";
|
String key = "enum-reg-structure-pool";
|
||||||
@ -823,7 +839,7 @@ public class SchemaBuilder
|
|||||||
if(!definitions.containsKey(key))
|
if(!definitions.containsKey(key))
|
||||||
{
|
{
|
||||||
JSONObject j = new JSONObject();
|
JSONObject j = new JSONObject();
|
||||||
j.put("enum", new JSONArray(data.getStructurePoolLoader().getPossibleKeys()));
|
j.put("enum", new JSONArray(data.getJigsawPoolLoader().getPossibleKeys()));
|
||||||
definitions.put(key, j);
|
definitions.put(key, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -833,6 +849,24 @@ public class SchemaBuilder
|
|||||||
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Pool (use ctrl+space for auto complete!)");
|
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Pool (use ctrl+space for auto complete!)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(k.isAnnotationPresent(RegistryListJigsaw.class))
|
||||||
|
{
|
||||||
|
fancyType = "List of Iris Jigsaw Structures";
|
||||||
|
String key = "enum-reg-jigsaw";
|
||||||
|
|
||||||
|
if(!definitions.containsKey(key))
|
||||||
|
{
|
||||||
|
JSONObject j = new JSONObject();
|
||||||
|
j.put("enum", new JSONArray(data.getJigsawStructureLoader().getPossibleKeys()));
|
||||||
|
definitions.put(key, j);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject items = new JSONObject();
|
||||||
|
items.put("$ref", "#/definitions/" + key);
|
||||||
|
prop.put("items", items);
|
||||||
|
description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw (use ctrl+space for auto complete!)");
|
||||||
|
}
|
||||||
|
|
||||||
else if(t.type().equals(Enchantment.class))
|
else if(t.type().equals(Enchantment.class))
|
||||||
{
|
{
|
||||||
fancyType = "List of Enchantment Types";
|
fancyType = "List of Enchantment Types";
|
||||||
|
@ -42,7 +42,7 @@ public class CommandIrisJigsawEdit extends MortarCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IrisJigsawPiece piece = IrisDataManager.loadAnyStructurePiece(args[0]);
|
IrisJigsawPiece piece = IrisDataManager.loadAnyJigsawPiece(args[0]);
|
||||||
|
|
||||||
if(piece != null)
|
if(piece != null)
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@ public class CommandIrisJigsawNew extends MortarCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
IrisObject object = IrisDataManager.loadAnyObject(args[2]);
|
IrisObject object = IrisDataManager.loadAnyObject(args[2]);
|
||||||
File dest = Iris.instance.getDataFile("packs", args[1], "structure-pieces", args[0] + ".json");
|
File dest = Iris.instance.getDataFile("packs", args[1], "jigsaw-pieces", args[0] + ".json");
|
||||||
new JigsawEditor(sender.player(), null, object, dest);
|
new JigsawEditor(sender.player(), null, object, dest);
|
||||||
sender.sendMessage("* Right Click blocks to make them connectors");
|
sender.sendMessage("* Right Click blocks to make them connectors");
|
||||||
sender.sendMessage("* Right Click connectors to orient them");
|
sender.sendMessage("* Right Click connectors to orient them");
|
||||||
|
@ -29,7 +29,7 @@ public class IrisJigsawPieceConnector
|
|||||||
@Desc("If set to true, this connector is allowed to place pieces inside of it's own piece. For example if you are adding a light post, or house on top of a path piece, you would set this to true to allow the piece to collide with the path bounding box.")
|
@Desc("If set to true, this connector is allowed to place pieces inside of it's own piece. For example if you are adding a light post, or house on top of a path piece, you would set this to true to allow the piece to collide with the path bounding box.")
|
||||||
private boolean innerConnector = false;
|
private boolean innerConnector = false;
|
||||||
|
|
||||||
@RegistryListStructurePool
|
@RegistryListJigsawPool
|
||||||
@Desc("Pick piece pools to place onto this connector")
|
@Desc("Pick piece pools to place onto this connector")
|
||||||
@ArrayType(type = String.class, min = 1)
|
@ArrayType(type = String.class, min = 1)
|
||||||
@Required
|
@Required
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.volmit.iris.object;
|
||||||
|
|
||||||
|
import com.volmit.iris.util.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Desc("Represents a jigsaw placement")
|
||||||
|
@Data
|
||||||
|
public class IrisJigsawPlacement
|
||||||
|
{
|
||||||
|
@RegistryListJigsaw
|
||||||
|
@Required
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The jigsaw structure to use")
|
||||||
|
private String structure = "";
|
||||||
|
|
||||||
|
@Required
|
||||||
|
@MinNumber(1)
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The rarity for this jigsaw structure to place on a per chunk basis")
|
||||||
|
private int rarity = 29;
|
||||||
|
}
|
@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class IrisJigsawPool extends IrisRegistrant
|
public class IrisJigsawPool extends IrisRegistrant
|
||||||
{
|
{
|
||||||
@RegistryListStructurePiece
|
@RegistryListJigsawPiece
|
||||||
@Required
|
@Required
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@ArrayType(min = 1,type = String.class)
|
@ArrayType(min = 1,type = String.class)
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
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 jigsaw structure")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class IrisJigsawStructure extends IrisRegistrant
|
||||||
|
{
|
||||||
|
@RegistryListJigsawPiece
|
||||||
|
@Required
|
||||||
|
@DontObfuscate
|
||||||
|
@ArrayType(min = 1,type = String.class)
|
||||||
|
@Desc("The starting pieces. Randomly chooses a starting piece, then connects pieces using the pools define in the starting piece.")
|
||||||
|
private KList<String> pieces = new KList<>();
|
||||||
|
|
||||||
|
@MaxNumber(32)
|
||||||
|
@MinNumber(1)
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The maximum pieces that can step out from the center piece")
|
||||||
|
private int maxDepth = 9;
|
||||||
|
}
|
@ -42,7 +42,7 @@ public class DirectWorldWriter {
|
|||||||
|
|
||||||
for(Long i : new KList<>(writeBuffer.keySet()))
|
for(Long i : new KList<>(writeBuffer.keySet()))
|
||||||
{
|
{
|
||||||
if(M.ms() - lastUse.get(i) < 5000)
|
if(M.ms() - lastUse.get(i) < 10000)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -239,6 +239,7 @@ public class DirectWorldWriter {
|
|||||||
if(f.exists())
|
if(f.exists())
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
Iris.warn("HAD TO LOAD MCA REGION FILE " + x + " " + z + " which is EXPENSIVE!");
|
||||||
mca = MCAUtil.read(f);
|
mca = MCAUtil.read(f);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -202,6 +202,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer
|
|||||||
RNG rng = new RNG(Cache.key(x, z)).nextParallelRNG(getEngine().getTarget().getWorld().getSeed());
|
RNG rng = new RNG(Cache.key(x, z)).nextParallelRNG(getEngine().getTarget().getWorld().getSeed());
|
||||||
IrisRegion region = getComplex().getRegionStream().get(x+8, z+8);
|
IrisRegion region = getComplex().getRegionStream().get(x+8, z+8);
|
||||||
IrisBiome biome = getComplex().getTrueBiomeStream().get(x+8, z+8);
|
IrisBiome biome = getComplex().getTrueBiomeStream().get(x+8, z+8);
|
||||||
|
// generateParallaxJigsaw(rng, x, z, biome, placedObjects);
|
||||||
generateParallaxSurface(rng, x, z, biome, placedObjects);
|
generateParallaxSurface(rng, x, z, biome, placedObjects);
|
||||||
generateParallaxMutations(rng, x, z, placedObjects);
|
generateParallaxMutations(rng, x, z, placedObjects);
|
||||||
generateStructures(rng, x>>4, z>>4, region, biome, placedObjects);
|
generateStructures(rng, x>>4, z>>4, region, biome, placedObjects);
|
||||||
@ -270,7 +271,6 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer
|
|||||||
default void generateParallaxSurface(RNG rng, int x, int z, IrisBiome biome, KList<PlacedObject> objects) {
|
default void generateParallaxSurface(RNG rng, int x, int z, IrisBiome biome, KList<PlacedObject> objects) {
|
||||||
for (IrisObjectPlacement i : biome.getSurfaceObjects())
|
for (IrisObjectPlacement i : biome.getSurfaceObjects())
|
||||||
{
|
{
|
||||||
Iris.info("Found Placement: " + i.getPlace());
|
|
||||||
if(rng.chance(i.getChance()))
|
if(rng.chance(i.getChance()))
|
||||||
{
|
{
|
||||||
place(rng, x, z, i, objects);
|
place(rng, x, z, i, objects);
|
||||||
|
@ -89,12 +89,12 @@ public class PregenJob implements Listener
|
|||||||
|
|
||||||
public PregenJob(World world, int size, MortarSender sender, Runnable onDone)
|
public PregenJob(World world, int size, MortarSender sender, Runnable onDone)
|
||||||
{
|
{
|
||||||
writer = new DirectWorldWriter(world.getWorldFolder());
|
|
||||||
gleaming = (IrisSettings.get().isUseGleamPregenerator());
|
gleaming = (IrisSettings.get().isUseGleamPregenerator());
|
||||||
g.set(0);
|
g.set(0);
|
||||||
burst = new MultiBurst(gleaming ? IrisSettings.get().getMaxAsyncChunkPregenThreads() : tc());
|
burst = new MultiBurst(gleaming ? IrisSettings.get().getMaxAsyncChunkPregenThreads() : tc());
|
||||||
instance = this;
|
instance = this;
|
||||||
working = new Semaphore(gleaming ? IrisSettings.get().getMaxAsyncChunkPregenThreads() : tc());
|
working = new Semaphore(gleaming ? IrisSettings.get().getMaxAsyncChunkPregenThreads() : tc());
|
||||||
|
writer =IrisSettings.get().isUseExperimentalGleamMCADirectWriteMode() ? new DirectWorldWriter(world.getWorldFolder()) : null;
|
||||||
this.s = PrecisionStopwatch.start();
|
this.s = PrecisionStopwatch.start();
|
||||||
Iris.instance.registerListener(this);
|
Iris.instance.registerListener(this);
|
||||||
this.world = world;
|
this.world = world;
|
||||||
@ -130,6 +130,10 @@ public class PregenJob implements Listener
|
|||||||
mcaX = x;
|
mcaX = x;
|
||||||
mcaZ = z;
|
mcaZ = z;
|
||||||
chunkSpiraler.retarget(cubeSize, cubeSize);
|
chunkSpiraler.retarget(cubeSize, cubeSize);
|
||||||
|
if(writer != null)
|
||||||
|
{
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
ticks++;
|
ticks++;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -168,8 +172,12 @@ public class PregenJob implements Listener
|
|||||||
public static void stop()
|
public static void stop()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
if(instance.writer != null)
|
||||||
{
|
{
|
||||||
instance.writer.flush();
|
instance.writer.flush();
|
||||||
|
}
|
||||||
|
|
||||||
Bukkit.getScheduler().cancelTask(task);
|
Bukkit.getScheduler().cancelTask(task);
|
||||||
|
|
||||||
if(consumer != null)
|
if(consumer != null)
|
||||||
@ -195,8 +203,12 @@ public class PregenJob implements Listener
|
|||||||
instance.pms = instance.s.getMilliseconds();
|
instance.pms = instance.s.getMilliseconds();
|
||||||
instance.paused = true;
|
instance.paused = true;
|
||||||
instance.pausedAt = M.ms();
|
instance.pausedAt = M.ms();
|
||||||
|
|
||||||
|
if(instance.writer != null)
|
||||||
|
{
|
||||||
instance.writer.flush();
|
instance.writer.flush();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void resume()
|
public static void resume()
|
||||||
{
|
{
|
||||||
@ -461,16 +473,24 @@ public class PregenJob implements Listener
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(IrisSettings.get().isUseExperimentalGleamMCADirectWriteMode())
|
||||||
|
{
|
||||||
e.execute(g);
|
e.execute(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
J.a(g);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{if(consumer != null)
|
{if(consumer != null)
|
||||||
{
|
{
|
||||||
consumer.accept(new ChunkPosition(chunkX, chunkZ), Color.magenta.darker().darker().darker());
|
consumer.accept(new ChunkPosition(chunkX, chunkZ), Color.magenta.darker().darker().darker());
|
||||||
}
|
}
|
||||||
e.execute(() ->
|
Runnable rr = () ->
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
working.acquire();
|
working.acquire();
|
||||||
@ -495,7 +515,16 @@ public class PregenJob implements Listener
|
|||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
if(IrisSettings.get().isUseExperimentalGleamMCADirectWriteMode())
|
||||||
|
{
|
||||||
|
e.execute(rr);
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
J.a(rr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -609,7 +638,10 @@ public class PregenJob implements Listener
|
|||||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "save-all");
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "save-all");
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.flush();
|
if(instance.writer != null)
|
||||||
|
{
|
||||||
|
instance.writer.flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int max()
|
public int max()
|
||||||
|
@ -8,7 +8,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||||||
|
|
||||||
@Retention(RUNTIME)
|
@Retention(RUNTIME)
|
||||||
@Target({PARAMETER, TYPE, FIELD})
|
@Target({PARAMETER, TYPE, FIELD})
|
||||||
public @interface RegistryListStructurePool
|
public @interface RegistryListJigsaw
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||||||
|
|
||||||
@Retention(RUNTIME)
|
@Retention(RUNTIME)
|
||||||
@Target({PARAMETER, TYPE, FIELD})
|
@Target({PARAMETER, TYPE, FIELD})
|
||||||
public @interface RegistryListStructurePiece
|
public @interface RegistryListJigsawPiece
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
@ -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 RegistryListJigsawPool
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user