mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
Core stops reading loot, spawn and effect classes: services, resource closure for exports, key handler for entities
This commit is contained in:
1 parent
ee2818514f
commit
f404dec7d7
50 files changed
+2916
-616
No files matched your search
@@ -137,7 +137,8 @@ public class DecorantSettingsDecodingTest {
|
||||
JSONObject byId = new JSONObject("{\"iris:decorant\": [{\"chance\": 1}]}");
|
||||
|
||||
assertSame(ModuleSettings.NONE, decoder.decode(Target.BIOME, byId, "biome meadow"));
|
||||
assertEquals(Set.of("decorators", "deposits"), decoder.keys(Target.BIOME));
|
||||
assertTrue(decoder.keys(Target.BIOME).containsAll(Set.of("decorators", "deposits")));
|
||||
assertFalse(decoder.keys(Target.BIOME).contains("iris:decorant"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -147,7 +147,8 @@ public class DepositSettingsDecodingTest {
|
||||
JSONObject byId = new JSONObject("{\"iris:deposit\": [{\"maxHeight\": 16}]}");
|
||||
|
||||
assertSame(ModuleSettings.NONE, decoder.decode(Target.REGION, byId, "region forests"));
|
||||
assertEquals(Set.of("deposits"), decoder.keys(Target.REGION));
|
||||
assertTrue(decoder.keys(Target.REGION).contains("deposits"));
|
||||
assertFalse(decoder.keys(Target.REGION).contains("iris:deposit"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.core.modules;
|
||||
|
||||
import art.arcane.iris.builtin.loot.BlockDrop;
|
||||
import art.arcane.iris.builtin.loot.BlockDropSettings;
|
||||
import art.arcane.iris.builtin.loot.LootMode;
|
||||
import art.arcane.iris.builtin.loot.LootSettings;
|
||||
import art.arcane.iris.builtin.loot.LootSlot;
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
import art.arcane.iris.builtin.spawn.AmbientEffect;
|
||||
import art.arcane.iris.builtin.spawn.EffectSettings;
|
||||
import art.arcane.iris.builtin.spawn.EntityDefinition;
|
||||
import art.arcane.iris.builtin.spawn.SpawnGroup;
|
||||
import art.arcane.iris.builtin.spawn.SpawnWeather;
|
||||
import art.arcane.iris.builtin.spawn.Spawner;
|
||||
import art.arcane.iris.builtin.spawn.SpawnerSettings;
|
||||
import art.arcane.volmlib.util.json.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.block.BlockSpec;
|
||||
import com.volmit.host.LoadedPack;
|
||||
import com.volmit.host.ModuleHost;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertThrows;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Files of the overworld pack exactly as they were before the loot and spawn fields became module settings (copied from
|
||||
* the pack backup), decoded by the built-in modules: {@code loot} is an object, {@code blockDrops}, {@code entitySpawners}
|
||||
* and {@code effects} are lists, the loot tables, spawners and entities are the pack's own files.
|
||||
*/
|
||||
public class LootAndSpawnPackDecodingTest {
|
||||
private static final String PACK = "/art/arcane/iris/core/modules/pack-before-loot-and-spawn";
|
||||
|
||||
@Rule
|
||||
public TemporaryFolder folder = new TemporaryFolder();
|
||||
|
||||
private Path packFolder;
|
||||
private LoadedPack pack;
|
||||
private ModuleSettingsDecoder decoder;
|
||||
|
||||
@Before
|
||||
public void loadBuiltIns() throws IOException, URISyntaxException {
|
||||
packFolder = Path.of(LootAndSpawnPackDecodingTest.class.getResource(PACK).toURI());
|
||||
pack = LoadedPack.load(packFolder, ModuleHost.of(IrisModuleHost.builtInModules())
|
||||
.reservingFields(ModuleTargets.reservedFields())
|
||||
.describingHostTypesIn(IrisModuleHost.HOST_TYPE_PACKAGE).copyingJarsTo(folder.newFolder("copies").toPath()));
|
||||
decoder = new ModuleSettingsDecoder(pack.catalog(), packFolder, Gson::new);
|
||||
}
|
||||
|
||||
@After
|
||||
public void closePack() {
|
||||
pack.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void theDimensionReadsItsLootReference() throws IOException {
|
||||
ModuleSettings settings = decoder.decode(Target.DIMENSION, file("dimensions/overworld.json"), "dimension overworld");
|
||||
|
||||
LootSettings loot = settings.find(LootSettings.class).orElseThrow();
|
||||
assertEquals(LootMode.FALLBACK, loot.mode());
|
||||
assertEquals(List.of("global-clutter"), loot.tables());
|
||||
assertEquals(1D, loot.multiplier(), 0);
|
||||
assertTrue(settings.find(BlockDropSettings.class).isEmpty());
|
||||
assertTrue(settings.find(SpawnerSettings.class).isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aRegionReadsItsLootAndItsSpawners() throws IOException {
|
||||
ModuleSettings settings = decoder.decode(Target.REGION, file("regions/terralost.json"), "region terralost");
|
||||
|
||||
LootSettings loot = settings.find(LootSettings.class).orElseThrow();
|
||||
assertEquals(LootMode.FALLBACK, loot.mode());
|
||||
assertEquals(0.5, loot.multiplier(), 0);
|
||||
assertEquals(List.of("tropical/food", "cave/clutter"), loot.tables());
|
||||
assertEquals(List.of("temperate/cave", "temperate/hostile", "temperate/passive", "temperate/water"),
|
||||
settings.find(SpawnerSettings.class).orElseThrow().spawners());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aRegionReadsItsBlockDrops() throws IOException {
|
||||
ModuleSettings settings = decoder.decode(Target.REGION, file("regions/swamp.json"), "region swamp");
|
||||
|
||||
List<BlockDrop> drops = settings.find(BlockDropSettings.class).orElseThrow().drops();
|
||||
assertEquals(1, drops.size());
|
||||
assertEquals(List.of(BlockSpec.of("minecraft:grass_block"), BlockSpec.of("minecraft:dark_oak_leaves"),
|
||||
BlockSpec.of("minecraft:short_grass"), BlockSpec.of("minecraft:tall_grass")), drops.getFirst().blocks());
|
||||
assertEquals("slime_ball", drops.getFirst().drops().getFirst().type());
|
||||
assertEquals(24, drops.getFirst().drops().getFirst().rarity());
|
||||
assertFalse(drops.getFirst().exactBlocks());
|
||||
assertFalse(drops.getFirst().skipParents());
|
||||
assertFalse(drops.getFirst().replaceVanillaDrops());
|
||||
assertEquals(LootSlot.STORAGE, drops.getFirst().drops().getFirst().slotTypes());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aRegionReadsItsEffectsLootAndBlockDropsTogether() throws IOException {
|
||||
JSONObject region = file("regions/mushroom.json");
|
||||
|
||||
ModuleSettings settings = decoder.decode(Target.REGION, region, "region mushroom");
|
||||
|
||||
List<AmbientEffect> effects = settings.find(EffectSettings.class).orElseThrow().effects();
|
||||
assertEquals(region.getJSONArray("effects").length(), effects.size());
|
||||
assertEquals("CRIMSON_SPORE", effects.getFirst().particleEffect());
|
||||
assertEquals(1e-05, effects.getFirst().particleAltX(), 0);
|
||||
assertEquals(1, effects.getFirst().particleAway());
|
||||
assertEquals(5, effects.getFirst().particleDistance());
|
||||
assertEquals(2, effects.getFirst().particleOffset());
|
||||
assertEquals(50, effects.getFirst().interval());
|
||||
assertEquals(3, effects.getFirst().chance());
|
||||
assertNull(effects.getFirst().sound());
|
||||
AmbientEffect sound = effects.get(1);
|
||||
assertEquals("AMBIENT.WARPED_FOREST.ADDITIONS", sound.sound());
|
||||
assertEquals(6.2, sound.volume(), 0);
|
||||
assertEquals(0.2, sound.minPitch(), 0);
|
||||
assertEquals(0.3, sound.maxPitch(), 0);
|
||||
assertEquals(3, sound.soundDistance());
|
||||
assertEquals(60000, sound.interval());
|
||||
assertEquals(8, sound.chance());
|
||||
assertEquals(2, settings.find(BlockDropSettings.class).orElseThrow().drops().getFirst().drops().size());
|
||||
assertEquals(List.of("mushroom/clutter", "mushroom/food"), settings.find(LootSettings.class).orElseThrow().tables());
|
||||
assertEquals(4, settings.find(SpawnerSettings.class).orElseThrow().spawners().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aRegionsPotionEffectKeepsItsStrengthAndTicks() throws IOException {
|
||||
ModuleSettings settings = decoder.decode(Target.REGION, file("regions/hot.json"), "region hot");
|
||||
|
||||
AmbientEffect potion = settings.find(EffectSettings.class).orElseThrow().effects().getFirst();
|
||||
assertEquals("CONFUSION", potion.potionEffect());
|
||||
assertEquals(0, potion.potionStrength());
|
||||
assertEquals(87, potion.potionTicksMin());
|
||||
assertEquals(67, potion.potionTicksMax());
|
||||
assertEquals(1200, potion.chance());
|
||||
assertEquals(500, potion.interval());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aBiomeReadsItsEffects() throws IOException {
|
||||
ModuleSettings settings = decoder.decode(Target.BIOME, file("biomes/tropical/volcanoes.json"), "biome tropical/volcanoes");
|
||||
|
||||
AmbientEffect smoke = settings.find(EffectSettings.class).orElseThrow().effects().getFirst();
|
||||
assertEquals("CAMPFIRE_SIGNAL_SMOKE", smoke.particleEffect());
|
||||
assertEquals(0.13885, smoke.particleAltY(), 0);
|
||||
assertEquals(300, smoke.interval());
|
||||
assertEquals(1, smoke.chance());
|
||||
assertEquals(0, smoke.particleCount());
|
||||
assertTrue(smoke.randomAltX());
|
||||
assertFalse(smoke.randomAltY());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aDimensionHasNoEffects() throws IOException {
|
||||
JSONObject dimension = new JSONObject("{\"effects\": [{\"chance\": 1}], \"loot\": {}}");
|
||||
|
||||
ModuleSettings settings = decoder.decode(Target.DIMENSION, dimension, "dimension overworld");
|
||||
|
||||
assertTrue(settings.find(EffectSettings.class).isEmpty());
|
||||
assertFalse(decoder.keys(Target.DIMENSION).contains("effects"));
|
||||
assertTrue(decoder.keys(Target.REGION).contains("effects"));
|
||||
assertTrue(decoder.keys(Target.BIOME).containsAll(Set.of("loot", "blockDrops", "entitySpawners", "effects")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void thePacksSpawnersLootTablesAndEntitiesReadTheirOwnFiles() throws IOException {
|
||||
Spawner spawner = decoder.decodeResource(Spawner.class, Files.readString(packFolder.resolve("spawners/mushroom/passive.json")));
|
||||
|
||||
assertEquals(SpawnGroup.NORMAL, spawner.group());
|
||||
assertEquals(2, spawner.maxEntitiesPerChunk());
|
||||
assertEquals(SpawnWeather.NONE, spawner.weather());
|
||||
assertEquals(2_000L, spawner.maximumRate().interval());
|
||||
assertFalse(spawner.maximumRate().isInfinite());
|
||||
assertTrue(spawner.maximumRatePerChunk().isInfinite());
|
||||
assertTrue(spawner.timeBlock().contains(12));
|
||||
assertFalse(spawner.timeBlock().contains(2));
|
||||
assertEquals(0, spawner.allowedLightLevels().min(), 0);
|
||||
assertEquals(15, spawner.allowedLightLevels().max(), 0);
|
||||
assertEquals(3, spawner.spawns().size());
|
||||
assertEquals("standard/passive/mooshroom", spawner.spawns().getFirst().entity());
|
||||
assertEquals(3, spawner.spawns().getFirst().maxSpawns());
|
||||
assertEquals(3, spawner.spawns().get(1).rarity());
|
||||
assertEquals(1, spawner.spawns().get(1).minSpawns());
|
||||
assertTrue(spawner.initialSpawns().isEmpty());
|
||||
|
||||
LootTable table = decoder.decodeResource(LootTable.class, Files.readString(packFolder.resolve("loot/global-clutter.json")));
|
||||
assertEquals("Global Clutter", table.name());
|
||||
assertEquals(20, table.maxTries());
|
||||
assertEquals(2, table.maxPicked());
|
||||
assertEquals("stone", table.loot().getFirst().type());
|
||||
assertEquals(8, table.loot().getFirst().maxAmount());
|
||||
assertEquals(LootSlot.STORAGE, table.loot().getFirst().slotTypes());
|
||||
|
||||
EntityDefinition entity = decoder.decodeResource(EntityDefinition.class, Files.readString(packFolder.resolve("entities/standard/passive/mooshroom.json")));
|
||||
assertEquals("MOOSHROOM", entity.type());
|
||||
assertTrue(entity.aware());
|
||||
assertTrue(entity.ai());
|
||||
assertTrue(entity.gravity());
|
||||
assertTrue(entity.loot().tables().isEmpty());
|
||||
assertEquals(LootMode.ADD, entity.loot().mode());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void theFeatureIdsAreNotKeys() {
|
||||
JSONObject byId = new JSONObject("{\"iris:loot\": {\"tables\": [\"a\"]}, \"iris:spawn\": [\"a\"]}");
|
||||
|
||||
assertSame(ModuleSettings.NONE, decoder.decode(Target.REGION, byId, "region forests"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aWrongShapeNamesTheKeyAndTheFile() {
|
||||
IllegalArgumentException list = assertThrows(IllegalArgumentException.class,
|
||||
() -> decoder.decode(Target.REGION, new JSONObject("{\"entitySpawners\": {\"spawners\": [\"a\"]}}"), "region forests"));
|
||||
IllegalArgumentException object = assertThrows(IllegalArgumentException.class,
|
||||
() -> decoder.decode(Target.REGION, new JSONObject("{\"loot\": [\"a\"]}"), "region forests"));
|
||||
|
||||
assertTrue(list.getMessage(), list.getMessage().contains("under \"entitySpawners\" in region forests"));
|
||||
assertTrue(object.getMessage(), object.getMessage().contains("under \"loot\" in region forests"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void settingsEncodeBackToTheJsonThePackWrote() throws IOException {
|
||||
for (String file : List.of("regions/terralost.json", "regions/swamp.json", "regions/mushroom.json", "regions/hot.json")) {
|
||||
JSONObject region = this.file(file);
|
||||
ModuleSettings settings = decoder.decode(Target.REGION, region, "region " + file);
|
||||
|
||||
JSONObject written = decoder.encode(Target.REGION, settings);
|
||||
|
||||
for (String key : List.of("loot", "blockDrops", "entitySpawners", "effects")) {
|
||||
assertEquals(file + " " + key, region.has(key), written.has(key));
|
||||
}
|
||||
if (region.has("entitySpawners")) {
|
||||
assertEquals(region.getJSONArray("entitySpawners").toString(), written.getJSONArray("entitySpawners").toString());
|
||||
}
|
||||
if (region.has("effects")) {
|
||||
assertEquals(region.getJSONArray("effects").length(), written.getJSONArray("effects").length());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private JSONObject file(String relative) throws IOException {
|
||||
return new JSONObject(Files.readString(packFolder.resolve(relative)));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package art.arcane.iris.core.pack;
|
||||
|
||||
import art.arcane.iris.engine.object.marker.IrisObjectMarker;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import org.junit.Test;
|
||||
@@ -13,28 +12,19 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class PackExportClosureTest {
|
||||
private static IrisObjectPlacement placement(String objectKey, String... markerKeys) {
|
||||
private static IrisObjectPlacement placement(String objectKey) {
|
||||
IrisObjectPlacement placement = new IrisObjectPlacement();
|
||||
placement.setPlace(new KList<>(objectKey));
|
||||
KList<IrisObjectMarker> markers = new KList<>();
|
||||
for (String markerKey : markerKeys) {
|
||||
IrisObjectMarker marker = new IrisObjectMarker();
|
||||
marker.setMarker(markerKey);
|
||||
markers.add(marker);
|
||||
}
|
||||
placement.setMarkers(markers);
|
||||
return placement;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void collectsMarkerAndObjectKeysFromPlacements() {
|
||||
public void collectsObjectKeysFromPlacements() {
|
||||
List<IrisObjectPlacement> placements = List.of(
|
||||
placement("houses/hut", "spawn-point", "loot-marker"),
|
||||
placement("houses/hut"),
|
||||
placement("trees/oak"),
|
||||
placement("houses/hut", "spawn-point"));
|
||||
placement("houses/hut"));
|
||||
|
||||
assertEquals(List.of("loot-marker", "spawn-point"),
|
||||
PackExportClosure.collectMarkerKeys(placements).stream().sorted().toList());
|
||||
assertEquals(List.of("houses/hut", "trees/oak"),
|
||||
PackExportClosure.collectObjectKeys(placements).stream().sorted().toList());
|
||||
}
|
||||
@@ -42,10 +32,9 @@ public class PackExportClosureTest {
|
||||
@Test
|
||||
public void toleratesNullPlacementsAndBlankKeys() {
|
||||
KList<IrisObjectPlacement> placements = new KList<>();
|
||||
placements.add(placement("", ""));
|
||||
placements.add(placement(""));
|
||||
placements.add((IrisObjectPlacement) null);
|
||||
|
||||
assertTrue(PackExportClosure.collectMarkerKeys(placements).isEmpty());
|
||||
assertTrue(PackExportClosure.collectObjectKeys(placements).isEmpty());
|
||||
}
|
||||
|
||||
@@ -57,11 +46,11 @@ public class PackExportClosureTest {
|
||||
public void bothPackagersExportSpawnersMarkersAndTheFullEntityGraph() throws Exception {
|
||||
String bukkit = Files.readString(Path.of(
|
||||
"src/main/java/art/arcane/iris/core/project/IrisPackageCompiler.java")).replace("\r\n", "\n");
|
||||
assertTrue("Bukkit packager must write spawners/", bukkit.contains("\"spawners/\""));
|
||||
assertTrue("Bukkit packager must write markers/", bukkit.contains("\"markers/\""));
|
||||
assertTrue("Bukkit packager must export region objects alongside biome objects",
|
||||
bukkit.contains("regions.forEach((r) -> allPlacements.addAll(r.getObjects()))"));
|
||||
assertTrue("Bukkit packager must export entity loot tables", bukkit.contains("getLoot().getTables()"));
|
||||
assertTrue("Bukkit packager must export the spawn and loot resources the settings reference",
|
||||
bukkit.contains("moduleResources.writeTo(folder, minify)"));
|
||||
assertTrue("Bukkit packager must export the placements' references", bukkit.contains("moduleResources.follow(allPlacements)"));
|
||||
int bukkitValidation = bukkit.indexOf("PackValidator.validateForPackaging(project.getPath())");
|
||||
assertTrue("Bukkit packager must validate before opening or mutating package state",
|
||||
bukkitValidation >= 0
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package art.arcane.iris.core.project;
|
||||
|
||||
import art.arcane.iris.engine.object.entity.IrisEntitySpawn;
|
||||
import art.arcane.iris.engine.object.entity.spawn.IrisSpawner;
|
||||
import art.arcane.volmlib.util.collection.KSet;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class IrisProjectEntityDependencyTest {
|
||||
@Test
|
||||
public void collectsInitialOnlyEntityAlongsideNormalSpawnEntityForExport() {
|
||||
IrisSpawner spawner = new IrisSpawner();
|
||||
spawner.getSpawns().add(new IrisEntitySpawn().setEntity("standard/passive/cow"));
|
||||
spawner.getInitialSpawns().add(new IrisEntitySpawn().setEntity("beta/sentinel"));
|
||||
KSet<IrisSpawner> spawners = new KSet<>();
|
||||
spawners.add(spawner);
|
||||
|
||||
KSet<String> entityKeys = IrisPackageCompiler.collectSpawnerEntityKeys(spawners);
|
||||
|
||||
assertEquals(2, entityKeys.size());
|
||||
assertTrue(entityKeys.contains("standard/passive/cow"));
|
||||
assertTrue(entityKeys.contains("beta/sentinel"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void returnsNoEntityDependenciesForEmptySpawnerSet() {
|
||||
KSet<String> entityKeys = IrisPackageCompiler.collectSpawnerEntityKeys(new KSet<>());
|
||||
|
||||
assertTrue(entityKeys.isEmpty());
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine.loot;
|
||||
|
||||
import art.arcane.iris.engine.object.loot.IrisLootTable;
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.item.ItemDrop;
|
||||
import com.volmit.item.ItemRegistry;
|
||||
@@ -69,12 +69,12 @@ public class LootDrawPinTest {
|
||||
|
||||
@Test
|
||||
public void aTableGivesThePinnedItemsAtEachSpot() {
|
||||
IrisLootTable table = new Gson().fromJson(TABLE, IrisLootTable.class);
|
||||
LootTable table = new Gson().fromJson(TABLE, LootTable.class);
|
||||
LootItems items = new LootItems(registry, false);
|
||||
|
||||
List<Integer> hashes = new ArrayList<>();
|
||||
for (int[] spot : SPOTS) {
|
||||
List<ItemDrop> drops = items.draw(table, LOOT_SEED, spot[0], spot[1], spot[2]);
|
||||
List<ItemDrop> drops = items.draw("Pin table", table, LOOT_SEED, spot[0], spot[1], spot[2]);
|
||||
hashes.add(drops.toString().hashCode());
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,12 @@
|
||||
package art.arcane.iris.engine.loot;
|
||||
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.modules.BuiltInPack;
|
||||
import art.arcane.iris.core.modules.ModuleResourceFixture;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootReference;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootTable;
|
||||
import art.arcane.iris.builtin.loot.LootSettings;
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.engine.object.world.region.IrisRegion;
|
||||
@@ -65,7 +66,7 @@ public class LootEnvironmentPinTest {
|
||||
fixture.resource(LootResources.TABLES, key, table(key));
|
||||
}
|
||||
IrisComplex complex = engine.getComplex();
|
||||
when(complex.getData()).thenReturn(data);
|
||||
when(engine.getData()).thenReturn(data);
|
||||
dimension = mock(IrisDimension.class);
|
||||
region = mock(IrisRegion.class);
|
||||
surface = biome("surface");
|
||||
@@ -111,19 +112,19 @@ public class LootEnvironmentPinTest {
|
||||
|
||||
private List<String> identities(boolean objectLootDefined, int y) {
|
||||
List<String> sources = new ArrayList<>();
|
||||
LootTables.resolveEnvironmentSources(sources, engine, new RNG(19L), X, y, Z, objectLootDefined, LootTables::identity);
|
||||
LootTables.resolveEnvironmentSources(sources, engine, new RNG(19L), X, y, Z, objectLootDefined, key -> key);
|
||||
return sources;
|
||||
}
|
||||
|
||||
private void references(String dimensionJson, String regionJson, String surfaceJson, String caveJson) {
|
||||
when(dimension.getLoot()).thenReturn(reference(dimensionJson));
|
||||
when(region.getLoot()).thenReturn(reference(regionJson));
|
||||
when(surface.getLoot()).thenReturn(reference(surfaceJson));
|
||||
when(cave.getLoot()).thenReturn(reference(caveJson));
|
||||
when(dimension.getModuleSettings()).thenReturn(BuiltInPack.settings(loot(dimensionJson)));
|
||||
when(region.getModuleSettings()).thenReturn(BuiltInPack.settings(loot(regionJson)));
|
||||
when(surface.getModuleSettings()).thenReturn(BuiltInPack.settings(loot(surfaceJson)));
|
||||
when(cave.getModuleSettings()).thenReturn(BuiltInPack.settings(loot(caveJson)));
|
||||
}
|
||||
|
||||
private static IrisLootReference reference(String json) {
|
||||
return new Gson().fromJson(json, IrisLootReference.class);
|
||||
private static LootSettings loot(String json) {
|
||||
return new Gson().fromJson(json, LootSettings.class);
|
||||
}
|
||||
|
||||
private static IrisBiome biome(String key) {
|
||||
@@ -132,9 +133,7 @@ public class LootEnvironmentPinTest {
|
||||
return biome;
|
||||
}
|
||||
|
||||
private static IrisLootTable table(String key) {
|
||||
IrisLootTable table = new IrisLootTable().setName(key);
|
||||
table.setLoadKey(key);
|
||||
return table;
|
||||
private static LootTable table(String key) {
|
||||
return new Gson().fromJson("{\"name\": \"" + key + "\"}", LootTable.class);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
package art.arcane.iris.engine.loot;
|
||||
|
||||
import art.arcane.iris.engine.object.entity.IrisAttributeModifier;
|
||||
import art.arcane.iris.engine.object.loot.IrisEnchantment;
|
||||
import art.arcane.iris.engine.object.loot.IrisLoot;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootTable;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.iris.builtin.loot.LootEntry;
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
import art.arcane.iris.engine.object.TestSettings;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.item.ItemDrop;
|
||||
import com.volmit.item.ItemRegistry;
|
||||
@@ -37,10 +35,10 @@ public class LootItemsTest {
|
||||
|
||||
@Test
|
||||
public void anEntryDrawsAmountEnchantmentsAttributesAndDamageFromOneStreamInThatOrder() {
|
||||
IrisLoot entry = new IrisLoot().setType("diamond_sword").setMinAmount(1).setMaxAmount(3)
|
||||
.setMinDurability(0.25).setMaxDurability(0.75)
|
||||
.setEnchantments(new KList<>(new IrisEnchantment("sharpness", 1, 5, 1D)))
|
||||
.setAttributes(new KList<>(new IrisAttributeModifier("max_health", "bonus", "ADD_NUMBER", 2, 6, 1D)));
|
||||
LootEntry entry = entry("""
|
||||
{"type": "diamond_sword", "minAmount": 1, "maxAmount": 3, "minDurability": 0.25, "maxDurability": 0.75,
|
||||
"enchantments": [{"enchantment": "sharpness", "minLevel": 1, "maxLevel": 5, "chance": 1}],
|
||||
"attributes": [{"attribute": "max_health", "name": "bonus", "operation": "ADD_NUMBER", "minAmount": 2, "maxAmount": 6, "chance": 1}]}""");
|
||||
RNG expected = new RNG(5L);
|
||||
int amount = (int) (1 + expected.nextLong(3));
|
||||
expected.nextDouble();
|
||||
@@ -59,7 +57,7 @@ public class LootItemsTest {
|
||||
|
||||
@Test
|
||||
public void anItemThatCannotBeDamagedDrawsNoDamageAndKeepsTheStreamAligned() {
|
||||
IrisLoot entry = new IrisLoot().setType("diamond").setMinAmount(2).setMaxAmount(2);
|
||||
LootEntry entry = entry("{\"type\": \"diamond\", \"minAmount\": 2, \"maxAmount\": 2}");
|
||||
RNG rng = new RNG(9L);
|
||||
RNG untouched = new RNG(9L);
|
||||
|
||||
@@ -75,32 +73,37 @@ public class LootItemsTest {
|
||||
RNG rng = new RNG(9L);
|
||||
RNG untouched = new RNG(9L);
|
||||
|
||||
assertNull(new LootItems(registry, false).give(new IrisLoot().setType("not_an_item"), rng));
|
||||
assertNull(new LootItems(registry, false).give(new IrisLoot().setType("air"), rng));
|
||||
assertNull(new LootItems(registry, false).give(entry("{\"type\": \"not_an_item\"}"), rng));
|
||||
assertNull(new LootItems(registry, false).give(entry("{\"type\": \"air\"}"), rng));
|
||||
assertEquals(untouched.nextLong(), rng.nextLong());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void debugItemsSayWhereTheyCameFrom() {
|
||||
IrisLootTable table = new IrisLootTable().setName("dungeon").setRarity(4);
|
||||
table.setLoot(new KList<>(new IrisLoot().setType("diamond").setRarity(3)));
|
||||
table.setMinPicked(1).setMaxPicked(1);
|
||||
LootTable table = table("{\"name\": \"dungeon\", \"rarity\": 4, \"minPicked\": 1, \"maxPicked\": 1, \"loot\": [{\"type\": \"diamond\", \"rarity\": 3}]}");
|
||||
|
||||
List<ItemDrop> drops = new LootItems(registry, true).draw(table, LOOT_SEED, 0, 64, 0);
|
||||
List<ItemDrop> drops = new LootItems(registry, true).draw("dungeon", table, LOOT_SEED, 0, 64, 0);
|
||||
|
||||
for (ItemDrop drop : drops) {
|
||||
assertEquals(new ItemDrop.Source("dungeon", 4, 3), drop.source());
|
||||
}
|
||||
assertTrue(new LootItems(registry, false).draw(table, LOOT_SEED, 0, 64, 0).stream().allMatch(drop -> drop.source() == null));
|
||||
assertTrue(new LootItems(registry, false).draw("dungeon", table, LOOT_SEED, 0, 64, 0).stream().allMatch(drop -> drop.source() == null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aTableGivesTheSameItemsAtTheSameSpotAndSeed() {
|
||||
IrisLootTable table = new IrisLootTable().setName("tools").setMinPicked(2).setMaxPicked(4);
|
||||
table.setLoot(new KList<>(new IrisLoot().setType("diamond").setMaxAmount(5), new IrisLoot().setType("diamond_sword")));
|
||||
LootTable table = table("{\"name\": \"tools\", \"minPicked\": 2, \"maxPicked\": 4, \"loot\": [{\"type\": \"diamond\", \"maxAmount\": 5}, {\"type\": \"diamond_sword\"}]}");
|
||||
|
||||
LootItems items = new LootItems(registry, false);
|
||||
|
||||
assertEquals(items.draw(table, LOOT_SEED, 10, 64, -30), items.draw(table, LOOT_SEED, 10, 64, -30));
|
||||
assertEquals(items.draw("tools", table, LOOT_SEED, 10, 64, -30), items.draw("tools", table, LOOT_SEED, 10, 64, -30));
|
||||
}
|
||||
|
||||
private static LootEntry entry(String json) {
|
||||
return TestSettings.of(LootEntry.class, json);
|
||||
}
|
||||
|
||||
private static LootTable table(String json) {
|
||||
return TestSettings.of(LootTable.class, json);
|
||||
}
|
||||
}
|
||||
@@ -6,13 +6,16 @@ import art.arcane.iris.engine.framework.LootResolver;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootMode;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootReference;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootTable;
|
||||
import art.arcane.iris.builtin.loot.LootSettings;
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.modules.BuiltInPack;
|
||||
import art.arcane.iris.core.modules.ModuleResourceFixture;
|
||||
import art.arcane.iris.core.modules.ModuleSettings;
|
||||
import art.arcane.iris.engine.object.TestSettings;
|
||||
import art.arcane.iris.engine.object.world.region.IrisRegion;
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.MaxNumber;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.item.ItemRegistry;
|
||||
import org.junit.Test;
|
||||
@@ -70,20 +73,17 @@ public class LootResolverTest {
|
||||
|
||||
@Test
|
||||
public void spatialSeedsIncludeWorldTableAndAbsolutePosition() {
|
||||
IrisLootTable first = new IrisLootTable().setName("first");
|
||||
IrisLootTable second = new IrisLootTable().setName("second");
|
||||
long baseline = LootTables.seed(41L, "first", 0, 64, 0);
|
||||
|
||||
long baseline = LootTables.seed(41L, first, 0, 64, 0);
|
||||
|
||||
assertEquals(baseline, LootTables.seed(41L, first, 0, 64, 0));
|
||||
assertNotEquals(baseline, LootTables.seed(42L, first, 0, 64, 0));
|
||||
assertNotEquals(baseline, LootTables.seed(41L, second, 0, 64, 0));
|
||||
assertNotEquals(baseline, LootTables.seed(41L, first, 16, 64, 0));
|
||||
assertEquals(baseline, LootTables.seed(41L, "first", 0, 64, 0));
|
||||
assertNotEquals(baseline, LootTables.seed(42L, "first", 0, 64, 0));
|
||||
assertNotEquals(baseline, LootTables.seed(41L, "second", 0, 64, 0));
|
||||
assertNotEquals(baseline, LootTables.seed(41L, "first", 16, 64, 0));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void spatialRarityIsStableAndDistributed() {
|
||||
IrisLootTable table = new IrisLootTable().setName("distribution");
|
||||
String table = "distribution";
|
||||
int successes = 0;
|
||||
|
||||
for (int x = 0; x < 65_536; x++) {
|
||||
@@ -103,7 +103,7 @@ public class LootResolverTest {
|
||||
@Test
|
||||
public void nativeOrObjectLootSuppressesFallbackReferences() {
|
||||
ResolutionFixture fixture = new ResolutionFixture();
|
||||
List<IrisLootTable> sources = new ArrayList<>();
|
||||
List<String> sources = new ArrayList<>();
|
||||
|
||||
LootTables.resolveEnvironmentSources(
|
||||
sources,
|
||||
@@ -113,7 +113,7 @@ public class LootResolverTest {
|
||||
70,
|
||||
20,
|
||||
true,
|
||||
table -> table
|
||||
key -> key
|
||||
);
|
||||
|
||||
assertTrue(sources.isEmpty());
|
||||
@@ -122,7 +122,7 @@ public class LootResolverTest {
|
||||
@Test
|
||||
public void emptyPlacementUsesEachFallbackScopeOnce() {
|
||||
ResolutionFixture fixture = new ResolutionFixture();
|
||||
List<IrisLootTable> sources = new ArrayList<>();
|
||||
List<String> sources = new ArrayList<>();
|
||||
|
||||
LootTables.resolveEnvironmentSources(
|
||||
sources,
|
||||
@@ -132,10 +132,10 @@ public class LootResolverTest {
|
||||
70,
|
||||
20,
|
||||
false,
|
||||
table -> table
|
||||
key -> key
|
||||
);
|
||||
|
||||
assertEquals(List.of(fixture.dimensionTable, fixture.regionTable, fixture.surfaceTable), sources);
|
||||
assertEquals(List.of("dimension", "region", "surface"), sources);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -170,7 +170,7 @@ public class LootResolverTest {
|
||||
}
|
||||
|
||||
IllegalArgumentException failure = assertThrows(IllegalArgumentException.class,
|
||||
() -> LootResolver.scaleSources(sources, IrisLootReference.MAX_MULTIPLIER, new RNG(17L)));
|
||||
() -> LootResolver.scaleSources(sources, LootSettings.MAX_MULTIPLIER, new RNG(17L)));
|
||||
|
||||
assertTrue(failure.getMessage().contains("maximum of 256 sources"));
|
||||
assertEquals(17, sources.size());
|
||||
@@ -183,7 +183,7 @@ public class LootResolverTest {
|
||||
sources.add("table-" + index);
|
||||
}
|
||||
|
||||
LootResolver.scaleSources(sources, IrisLootReference.MAX_MULTIPLIER, new RNG(17L));
|
||||
LootResolver.scaleSources(sources, LootSettings.MAX_MULTIPLIER, new RNG(17L));
|
||||
|
||||
assertEquals(256, sources.size());
|
||||
}
|
||||
@@ -231,26 +231,26 @@ public class LootResolverTest {
|
||||
public void combinedMultiplierAboveReferenceCapRemainsUsableUnderResolvedSourceCap() {
|
||||
List<String> sources = new ArrayList<>(List.of("table"));
|
||||
|
||||
LootResolver.scaleSources(sources, IrisLootReference.MAX_MULTIPLIER * 2D, new RNG(17L));
|
||||
LootResolver.scaleSources(sources, LootSettings.MAX_MULTIPLIER * 2D, new RNG(17L));
|
||||
|
||||
assertEquals(32, sources.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lootMultiplierCapIsPublishedInSchemaMetadata() throws Exception {
|
||||
Field multiplier = IrisLootReference.class.getDeclaredField("multiplier");
|
||||
Field multiplier = LootSettings.class.getDeclaredField("multiplier");
|
||||
MaxNumber maximum = multiplier.getAnnotation(MaxNumber.class);
|
||||
Desc description = multiplier.getAnnotation(Desc.class);
|
||||
|
||||
assertEquals(IrisLootReference.MAX_MULTIPLIER, maximum.value(), 0D);
|
||||
assertEquals(LootSettings.MAX_MULTIPLIER, maximum.value(), 0D);
|
||||
assertTrue(description.value().contains("0 to 16"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void emptyLootTableReturnsNoItems() {
|
||||
IrisLootTable table = new IrisLootTable().setName("empty");
|
||||
LootTable table = TestSettings.of(LootTable.class, "{\"name\": \"empty\"}");
|
||||
|
||||
assertTrue(new LootItems(mock(ItemRegistry.class), false).draw(table, 7L, 0, 64, 0).isEmpty());
|
||||
assertTrue(new LootItems(mock(ItemRegistry.class), false).draw("empty", table, 7L, 0, 64, 0).isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -264,23 +264,23 @@ public class LootResolverTest {
|
||||
|
||||
private static final class ResolutionFixture {
|
||||
private final Engine engine = mock(Engine.class, RETURNS_DEEP_STUBS);
|
||||
private final IrisLootTable dimensionTable = new IrisLootTable().setName("dimension");
|
||||
private final IrisLootTable regionTable = new IrisLootTable().setName("region");
|
||||
private final IrisLootTable surfaceTable = new IrisLootTable().setName("surface");
|
||||
|
||||
private ResolutionFixture() {
|
||||
IrisDimension dimension = mock(IrisDimension.class);
|
||||
IrisRegion region = mock(IrisRegion.class);
|
||||
IrisBiome surface = mock(IrisBiome.class);
|
||||
IrisComplex complex = engine.getComplex();
|
||||
IrisLootReference dimensionReference = reference(dimensionTable);
|
||||
IrisLootReference regionReference = reference(regionTable);
|
||||
IrisLootReference surfaceReference = reference(surfaceTable);
|
||||
IrisData data = mock(IrisData.class);
|
||||
ModuleResourceFixture tables = ModuleResourceFixture.serve(data);
|
||||
for (String key : List.of("dimension", "region", "surface")) {
|
||||
tables.resource(LootResources.TABLES, key, TestSettings.of(LootTable.class, "{\"name\": \"" + key + "\"}"));
|
||||
}
|
||||
|
||||
when(engine.getData()).thenReturn(data);
|
||||
when(engine.getDimension()).thenReturn(dimension);
|
||||
when(dimension.getLoot()).thenReturn(dimensionReference);
|
||||
when(region.getLoot()).thenReturn(regionReference);
|
||||
when(surface.getLoot()).thenReturn(surfaceReference);
|
||||
when(dimension.getModuleSettings()).thenReturn(fallbackTo("dimension"));
|
||||
when(region.getModuleSettings()).thenReturn(fallbackTo("region"));
|
||||
when(surface.getModuleSettings()).thenReturn(fallbackTo("surface"));
|
||||
when(surface.getLoadKey()).thenReturn("surface");
|
||||
when(complex.getRegionStream().get(10, 20)).thenReturn(region);
|
||||
when(complex.getTrueBiomeStream().get(10, 20)).thenReturn(surface);
|
||||
@@ -288,12 +288,8 @@ public class LootResolverTest {
|
||||
when(engine.getCaveBiome(10, 70, 20)).thenReturn(surface);
|
||||
}
|
||||
|
||||
private IrisLootReference reference(IrisLootTable table) {
|
||||
IrisLootReference reference = mock(IrisLootReference.class);
|
||||
when(reference.getMode()).thenReturn(IrisLootMode.FALLBACK);
|
||||
when(reference.getMultiplier()).thenReturn(1D);
|
||||
when(reference.getLootTables(any())).thenReturn(new KList<>(table));
|
||||
return reference;
|
||||
private static ModuleSettings fallbackTo(String table) {
|
||||
return BuiltInPack.settings(TestSettings.of(LootSettings.class, "{\"mode\": \"FALLBACK\", \"tables\": [\"" + table + "\"]}"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ package art.arcane.iris.engine.loot;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.project.ModuleResourceSchemas;
|
||||
import art.arcane.iris.core.project.SchemaTestPlatform;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootTable;
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
import art.arcane.volmlib.util.json.JSONObject;
|
||||
import com.volmit.host.ValidatorRegistration;
|
||||
import org.junit.Rule;
|
||||
@@ -53,7 +53,7 @@ public class LootResourcesTest {
|
||||
assertEquals(List.of("iris:loot/table"), catalog.resourceKinds().stream().map(registration -> registration.kind().id().toString())
|
||||
.filter(id -> id.startsWith("iris:loot/")).toList());
|
||||
assertTrue(catalog.validators().stream().map(ValidatorRegistration::validator).anyMatch(LootValidator.class::isInstance));
|
||||
assertFalse(data.getLoaders().containsKey(IrisLootTable.class));
|
||||
assertFalse(data.getLoaders().containsKey(LootTable.class));
|
||||
} finally {
|
||||
data.close();
|
||||
}
|
||||
@@ -64,19 +64,18 @@ public class LootResourcesTest {
|
||||
Path pack = lootPack("tables");
|
||||
IrisData data = IrisData.openValidation(pack.toFile());
|
||||
try {
|
||||
IrisLootTable table = LootResources.table(data, "dungeon/chest");
|
||||
LootTable table = LootResources.table(data, "dungeon/chest");
|
||||
|
||||
assertEquals("Chest", table.getName());
|
||||
assertEquals("dungeon/chest", table.getLoadKey());
|
||||
assertEquals(pack.resolve("loot/dungeon/chest.json").toFile(), table.getLoadFile());
|
||||
assertEquals("Chest", table.name());
|
||||
assertEquals(1, table.loot().size());
|
||||
assertEquals("stick", table.loot().getFirst().type());
|
||||
assertEquals(List.of("dungeon/chest"), LootResources.tableKeys(data));
|
||||
assertEquals(List.of(table), LootResources.tables(data, List.of("dungeon/chest", "missing")));
|
||||
assertNull(LootResources.table(data, "missing"));
|
||||
assertNull(LootResources.table(data, " "));
|
||||
|
||||
write(pack, "loot/dungeon/chest.json", "{\"name\":\"Renamed\"}");
|
||||
data.dump();
|
||||
assertEquals("Renamed", LootResources.table(data, "dungeon/chest").getName());
|
||||
assertEquals("Renamed", LootResources.table(data, "dungeon/chest").name());
|
||||
} finally {
|
||||
data.close();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package art.arcane.iris.engine.loot;
|
||||
|
||||
import art.arcane.iris.engine.object.loot.IrisLootMode;
|
||||
import art.arcane.iris.builtin.loot.LootMode;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -13,18 +13,18 @@ public class LootTablesClearModeTest {
|
||||
@Test
|
||||
public void clearSuppressesItsOwnTablesAndReplaceDoesNot() {
|
||||
List<String> cleared = new ArrayList<>(List.of("placement", "dimension"));
|
||||
LootTables.injectSources(cleared, List.of("biome"), IrisLootMode.CLEAR, false);
|
||||
LootTables.injectSources(cleared, List.of("biome"), LootMode.CLEAR, false);
|
||||
assertTrue("CLEAR must clear parents and contribute nothing", cleared.isEmpty());
|
||||
|
||||
List<String> replaced = new ArrayList<>(List.of("placement", "dimension"));
|
||||
LootTables.injectSources(replaced, List.of("biome"), IrisLootMode.REPLACE, false);
|
||||
LootTables.injectSources(replaced, List.of("biome"), LootMode.REPLACE, false);
|
||||
assertEquals(List.of("biome"), replaced);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clearIgnoresTheFallbackFlag() {
|
||||
List<String> sources = new ArrayList<>(List.of("placement"));
|
||||
LootTables.injectSources(sources, List.of("biome"), IrisLootMode.CLEAR, true);
|
||||
LootTables.injectSources(sources, List.of("biome"), LootMode.CLEAR, true);
|
||||
assertTrue(sources.isEmpty());
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package art.arcane.iris.engine.loot;
|
||||
|
||||
import art.arcane.iris.engine.object.loot.IrisLoot;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootTable;
|
||||
import art.arcane.iris.engine.object.annotations.MaxNumber;
|
||||
import art.arcane.iris.builtin.loot.LootEntry;
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
import com.volmit.config.MaxNumber;
|
||||
import com.volmit.validation.Problem;
|
||||
import com.volmit.validation.Severity;
|
||||
import org.junit.Rule;
|
||||
@@ -110,11 +110,11 @@ public class LootValidatorTest {
|
||||
|
||||
@Test
|
||||
public void lootWorkCapsArePublishedInSchemaMetadata() throws Exception {
|
||||
assertSchemaMaximum(IrisLootTable.class, "minPicked", IrisLootTable.MAX_PICKED);
|
||||
assertSchemaMaximum(IrisLootTable.class, "maxPicked", IrisLootTable.MAX_PICKED);
|
||||
assertSchemaMaximum(IrisLootTable.class, "maxTries", IrisLootTable.MAX_TRIES);
|
||||
assertSchemaMaximum(IrisLoot.class, "minAmount", IrisLoot.MAX_AMOUNT);
|
||||
assertSchemaMaximum(IrisLoot.class, "maxAmount", IrisLoot.MAX_AMOUNT);
|
||||
assertSchemaMaximum(LootTable.class, "minPicked", LootTable.MAX_PICKED);
|
||||
assertSchemaMaximum(LootTable.class, "maxPicked", LootTable.MAX_PICKED);
|
||||
assertSchemaMaximum(LootTable.class, "maxTries", LootTable.MAX_TRIES);
|
||||
assertSchemaMaximum(LootEntry.class, "minAmount", LootEntry.MAX_AMOUNT);
|
||||
assertSchemaMaximum(LootEntry.class, "maxAmount", LootEntry.MAX_AMOUNT);
|
||||
}
|
||||
|
||||
private void assertSchemaMaximum(Class<?> type, String fieldName, int expected) throws Exception {
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.object.loot;
|
||||
|
||||
import art.arcane.iris.engine.object.loot.IrisLoot;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
/**
|
||||
* The modded item translator reads loot keys through these accessors instead of reflecting on IrisLoot fields, so
|
||||
* they are part of the platform-neutral contract.
|
||||
*/
|
||||
public class IrisLootKeyAccessorTest {
|
||||
@Test
|
||||
public void typeKeyReturnsAuthoredKeyVerbatim() {
|
||||
IrisLoot loot = new IrisLoot();
|
||||
loot.setType("mymod:ruby_sword");
|
||||
assertEquals("mymod:ruby_sword", loot.getTypeKey());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void typeKeyDefaultsToEmptyString() {
|
||||
assertEquals("", new IrisLoot().getTypeKey());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dyeColorKeyReturnsAuthoredValueAndNullWhenUnset() {
|
||||
IrisLoot loot = new IrisLoot();
|
||||
assertNull(loot.getDyeColorKey());
|
||||
loot.setDyeColor("LIGHT_BLUE");
|
||||
assertEquals("LIGHT_BLUE", loot.getDyeColorKey());
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package art.arcane.iris.engine.object.value;
|
||||
|
||||
import art.arcane.iris.engine.object.value.IrisDuration;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class IrisDurationTest {
|
||||
@Test
|
||||
public void convertsRealAndMinecraftUnitsToMilliseconds() {
|
||||
IrisDuration duration = new IrisDuration();
|
||||
duration.setMilliseconds(1);
|
||||
duration.setMinecraftTicks(1);
|
||||
duration.setSeconds(1);
|
||||
duration.setMinutes(1);
|
||||
duration.setMinecraftHours(1);
|
||||
duration.setHours(1);
|
||||
duration.setMinecraftDays(1);
|
||||
duration.setMinecraftWeeks(1);
|
||||
duration.setMinecraftLunarCycles(1);
|
||||
duration.setDays(1);
|
||||
|
||||
assertEquals(109_311_051L, duration.toMilliseconds());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void convertsMinecraftCalendarUnitsUsingTwentyMinuteDays() {
|
||||
IrisDuration day = new IrisDuration();
|
||||
IrisDuration week = new IrisDuration();
|
||||
IrisDuration lunarCycle = new IrisDuration();
|
||||
day.setMinecraftDays(1);
|
||||
week.setMinecraftWeeks(1);
|
||||
lunarCycle.setMinecraftLunarCycles(1);
|
||||
|
||||
assertEquals(1_200_000L, day.toMilliseconds());
|
||||
assertEquals(8_400_000L, week.toMilliseconds());
|
||||
assertEquals(9_600_000L, lunarCycle.toMilliseconds());
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
package art.arcane.iris.engine.spawn;
|
||||
|
||||
import art.arcane.iris.engine.loot.LootItems;
|
||||
import art.arcane.iris.engine.object.entity.IrisEntity;
|
||||
import art.arcane.iris.builtin.spawn.EntityDefinition;
|
||||
import art.arcane.iris.spi.PlatformWorld;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.google.gson.Gson;
|
||||
@@ -64,9 +64,9 @@ public class EntityResolutionPinTest {
|
||||
when(registry.maxDurability("iron_helmet")).thenReturn(OptionalInt.of(165));
|
||||
when(registry.maxDurability("diamond_sword")).thenReturn(OptionalInt.of(1561));
|
||||
PlatformWorld world = mock(PlatformWorld.class);
|
||||
IrisEntity entity = new Gson().fromJson(ENTITY, IrisEntity.class);
|
||||
EntityDefinition entity = new Gson().fromJson(ENTITY, EntityDefinition.class);
|
||||
|
||||
EntitySpec spec = new EntityResolution(new LootItems(registry, false), world).resolve(entity, new RNG(STREAM_SEED));
|
||||
EntitySpec spec = new EntityResolution(new LootItems(registry, false), world, new EffectTimers()).resolve(entity, new RNG(STREAM_SEED));
|
||||
|
||||
assertEquals(-819231818, spec.toString().hashCode());
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.EngineGeneration;
|
||||
import art.arcane.iris.engine.framework.SeedManager;
|
||||
import art.arcane.iris.engine.mantle.EngineMantle;
|
||||
import art.arcane.iris.engine.object.entity.IrisEntity;
|
||||
import art.arcane.iris.engine.object.entity.IrisEntitySpawn;
|
||||
import art.arcane.iris.engine.object.entity.spawn.IrisSpawner;
|
||||
import art.arcane.iris.engine.object.marker.IrisMarker;
|
||||
import art.arcane.iris.builtin.spawn.EntityDefinition;
|
||||
import art.arcane.iris.builtin.spawn.SpawnMarker;
|
||||
import art.arcane.iris.builtin.spawn.Spawner;
|
||||
import art.arcane.iris.engine.object.TestSettings;
|
||||
import art.arcane.iris.engine.object.world.IrisWorld;
|
||||
import art.arcane.iris.spi.PlatformWorld;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
@@ -97,10 +97,9 @@ public class EntitySpawningTest {
|
||||
|
||||
@Test
|
||||
public void aMarkerMeansItsSpawnersAndWhetherItGoesAwayWhenItsBlockChanges() {
|
||||
IrisMarker marker = new IrisMarker();
|
||||
marker.setSpawners(new KList<>("zombies", "missing")).setEmptyAbove(true).setRemoveOnChange(false);
|
||||
SpawnMarker marker = TestSettings.of(SpawnMarker.class, "{\"spawners\": [\"zombies\", \"missing\"], \"emptyAbove\": true, \"removeOnChange\": false}");
|
||||
fixture.resource(SpawnResources.MARKERS, "camp", marker);
|
||||
fixture.resource(SpawnResources.SPAWNERS, "zombies", new IrisSpawner());
|
||||
fixture.resource(SpawnResources.SPAWNERS, "zombies", new Spawner());
|
||||
|
||||
EntitySpawns.MarkerRule rule = new EntitySpawning().marker(world, "camp").orElseThrow();
|
||||
|
||||
@@ -117,16 +116,10 @@ public class EntitySpawningTest {
|
||||
|
||||
@Test
|
||||
public void aMarkerSpawnPlansEntitiesOneBlockAboveTheMarkerWithoutSurfaceChecks() {
|
||||
IrisSpawner spawner = new IrisSpawner();
|
||||
spawner.setLoadKey("camp/zombies");
|
||||
spawner.getSpawns().add(new IrisEntitySpawn().setEntity("zombie").setMinSpawns(2).setMaxSpawns(2));
|
||||
Spawner spawner = TestSettings.of(Spawner.class, "{\"spawns\": [{\"entity\": \"zombie\", \"minSpawns\": 2, \"maxSpawns\": 2}]}");
|
||||
fixture.resource(SpawnResources.SPAWNERS, "camp/zombies", spawner);
|
||||
IrisMarker marker = new IrisMarker();
|
||||
marker.setExhaustionChance(2);
|
||||
fixture.resource(SpawnResources.MARKERS, "camp", marker);
|
||||
IrisEntity zombie = new IrisEntity();
|
||||
zombie.setType("minecraft:zombie");
|
||||
fixture.resource(SpawnResources.ENTITIES, "zombie", zombie);
|
||||
fixture.resource(SpawnResources.MARKERS, "camp", TestSettings.of(SpawnMarker.class, "{\"exhaustionChance\": 2}"));
|
||||
fixture.resource(SpawnResources.ENTITIES, "zombie", TestSettings.of(EntityDefinition.class, "{\"type\": \"minecraft:zombie\"}"));
|
||||
when(engine.getMinHeight()).thenReturn(-64);
|
||||
|
||||
EntitySpawns.Plan plan = new EntitySpawning()
|
||||
@@ -145,8 +138,7 @@ public class EntitySpawningTest {
|
||||
|
||||
@Test
|
||||
public void aSpawnerThatCannotFireOrHasNoEntitiesPlansNothing() {
|
||||
IrisSpawner empty = new IrisSpawner();
|
||||
fixture.resource(SpawnResources.SPAWNERS, "empty", empty);
|
||||
fixture.resource(SpawnResources.SPAWNERS, "empty", new Spawner());
|
||||
|
||||
Optional<EntitySpawns.Plan> plan = new EntitySpawning().plan(world, new EntitySpawns.Marker(MARKER_BLOCK, "camp", "empty", false));
|
||||
|
||||
@@ -155,9 +147,8 @@ public class EntitySpawningTest {
|
||||
|
||||
@Test
|
||||
public void anEntityOfThePackResolvesToTheSpecTheHostSpawns() {
|
||||
IrisEntity entity = new IrisEntity();
|
||||
entity.setType("minecraft:cow").setCustomName("&6Bessie").setBaby(true);
|
||||
fixture.resource(SpawnResources.ENTITIES, "cow", entity);
|
||||
fixture.resource(SpawnResources.ENTITIES, "cow", TestSettings.of(EntityDefinition.class,
|
||||
"{\"type\": \"minecraft:cow\", \"customName\": \"&6Bessie\", \"baby\": true}"));
|
||||
|
||||
EntitySpec spec = new EntitySpawning().entity(world, "cow").orElseThrow();
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package art.arcane.iris.engine.spawn;
|
||||
|
||||
import art.arcane.iris.engine.object.TestSettings;
|
||||
import art.arcane.iris.builtin.spawn.SpawnDuration;
|
||||
import art.arcane.iris.builtin.spawn.SpawnRate;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SpawnDurationTest {
|
||||
@Test
|
||||
public void convertsRealAndMinecraftUnitsToMilliseconds() {
|
||||
SpawnDuration duration = TestSettings.of(SpawnDuration.class, """
|
||||
{"milliseconds": 1, "minecraftTicks": 1, "seconds": 1, "minutes": 1, "minecraftHours": 1, "hours": 1,
|
||||
"minecraftDays": 1, "minecraftWeeks": 1, "minecraftLunarCycles": 1, "days": 1}""");
|
||||
|
||||
assertEquals(109_311_051L, duration.toMilliseconds());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void convertsMinecraftCalendarUnitsUsingTwentyMinuteDays() {
|
||||
assertEquals(1_200_000L, TestSettings.of(SpawnDuration.class, "{\"minecraftDays\": 1}").toMilliseconds());
|
||||
assertEquals(8_400_000L, TestSettings.of(SpawnDuration.class, "{\"minecraftWeeks\": 1}").toMilliseconds());
|
||||
assertEquals(9_600_000L, TestSettings.of(SpawnDuration.class, "{\"minecraftLunarCycles\": 1}").toMilliseconds());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aRateSpreadsItsAmountOverItsDurationAndHasNoLimitWithoutOne() {
|
||||
SpawnRate rate = TestSettings.of(SpawnRate.class, "{\"amount\": 4, \"per\": {\"seconds\": 2}}");
|
||||
|
||||
assertEquals(500L, rate.interval());
|
||||
assertFalse(rate.isInfinite());
|
||||
assertTrue(TestSettings.of(SpawnRate.class, "{\"amount\": 4}").isInfinite());
|
||||
assertEquals(1L, new SpawnRate().interval());
|
||||
}
|
||||
}
|
||||
@@ -19,9 +19,9 @@
|
||||
package art.arcane.iris.engine.spawn;
|
||||
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.object.entity.IrisEntity;
|
||||
import art.arcane.iris.engine.object.entity.spawn.IrisSpawner;
|
||||
import art.arcane.iris.engine.object.marker.IrisMarker;
|
||||
import art.arcane.iris.builtin.spawn.EntityDefinition;
|
||||
import art.arcane.iris.builtin.spawn.SpawnMarker;
|
||||
import art.arcane.iris.builtin.spawn.Spawner;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
@@ -51,9 +51,9 @@ public class SpawnResourcesTest {
|
||||
.filter(kind -> kind.id().toString().startsWith("iris:spawn/")).toList();
|
||||
assertEquals(List.of("iris:spawn/entity", "iris:spawn/marker", "iris:spawn/spawner"), kinds.stream().map(kind -> kind.id().toString()).toList());
|
||||
assertEquals(List.of("entities", "markers", "spawners"), kinds.stream().map(kind -> kind.folder()).toList());
|
||||
assertFalse(data.getLoaders().containsKey(IrisSpawner.class));
|
||||
assertFalse(data.getLoaders().containsKey(IrisEntity.class));
|
||||
assertFalse(data.getLoaders().containsKey(IrisMarker.class));
|
||||
assertFalse(data.getLoaders().containsKey(Spawner.class));
|
||||
assertFalse(data.getLoaders().containsKey(EntityDefinition.class));
|
||||
assertFalse(data.getLoaders().containsKey(SpawnMarker.class));
|
||||
} finally {
|
||||
data.close();
|
||||
}
|
||||
@@ -64,13 +64,12 @@ public class SpawnResourcesTest {
|
||||
Path pack = spawnPack("spawns");
|
||||
IrisData data = IrisData.openValidation(pack.toFile());
|
||||
try {
|
||||
IrisSpawner spawner = SpawnResources.spawner(data, "camp/zombies");
|
||||
Spawner spawner = SpawnResources.spawner(data, "camp/zombies");
|
||||
|
||||
assertEquals("camp/zombies", spawner.getLoadKey());
|
||||
assertEquals(pack.resolve("spawners/camp/zombies.json").toFile(), spawner.getLoadFile());
|
||||
assertEquals("minecraft:zombie", SpawnResources.entity(data, "zombie").getType());
|
||||
assertEquals(List.of("camp/zombies"), SpawnResources.marker(data, "camp").getSpawners());
|
||||
assertEquals(List.of(spawner), SpawnResources.spawners(data, List.of("camp/zombies", "missing")));
|
||||
assertEquals("zombie", spawner.spawns().getFirst().entity());
|
||||
assertEquals("minecraft:zombie", SpawnResources.entity(data, "zombie").type());
|
||||
assertEquals(List.of("camp/zombies"), SpawnResources.marker(data, "camp").spawners());
|
||||
assertEquals(List.of(new SpawnResources.KeyedSpawner("camp/zombies", spawner)), SpawnResources.spawners(data, List.of("camp/zombies", "missing")));
|
||||
assertEquals(List.of("zombie"), SpawnResources.entityKeys(data));
|
||||
assertEquals(List.of("camp"), SpawnResources.markerKeys(data));
|
||||
assertEquals(List.of("camp/zombies"), SpawnResources.spawnerKeys(data));
|
||||
@@ -79,7 +78,7 @@ public class SpawnResourcesTest {
|
||||
|
||||
write(pack, "entities/zombie.json", "{\"type\":\"minecraft:husk\"}");
|
||||
data.dump();
|
||||
assertEquals("minecraft:husk", SpawnResources.entity(data, "zombie").getType());
|
||||
assertEquals("minecraft:husk", SpawnResources.entity(data, "zombie").type());
|
||||
} finally {
|
||||
data.close();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
package art.arcane.iris.purity;
|
||||
|
||||
import art.arcane.iris.engine.object.entity.IrisEffect;
|
||||
import art.arcane.iris.engine.object.entity.IrisEntity;
|
||||
import art.arcane.iris.engine.object.entity.spawn.IrisSpawner;
|
||||
import art.arcane.iris.engine.object.image.IrisImage;
|
||||
import art.arcane.iris.engine.object.image.IrisImageMap;
|
||||
import art.arcane.iris.engine.object.loot.IrisLoot;
|
||||
import art.arcane.iris.engine.object.loot.IrisLootTable;
|
||||
import art.arcane.iris.engine.object.loot.IrisVanillaLootTable;
|
||||
import art.arcane.iris.engine.object.marker.IrisMarker;
|
||||
import art.arcane.iris.engine.object.material.IrisBlockData;
|
||||
import art.arcane.iris.engine.object.mod.IrisMod;
|
||||
import art.arcane.iris.engine.object.noise.expression.IrisExpression;
|
||||
@@ -128,11 +121,7 @@ public class PackTypeBukkitPurityGateTest {
|
||||
private static final List<String> MODULE_RESOURCE_ROOTS = List.of(
|
||||
"art.arcane.iris.engine.object.structure.IrisStructure",
|
||||
"art.arcane.iris.engine.object.structure.jigsaw.IrisJigsawPool",
|
||||
"art.arcane.iris.engine.object.structure.jigsaw.IrisJigsawPiece",
|
||||
"art.arcane.iris.engine.object.loot.IrisLootTable",
|
||||
"art.arcane.iris.engine.object.entity.spawn.IrisSpawner",
|
||||
"art.arcane.iris.engine.object.entity.IrisEntity",
|
||||
"art.arcane.iris.engine.object.marker.IrisMarker");
|
||||
"art.arcane.iris.engine.object.structure.jigsaw.IrisJigsawPiece");
|
||||
|
||||
/**
|
||||
* Types reachable from a pack that are not roots and carry no {@code @Snippet}, but are
|
||||
@@ -140,8 +129,7 @@ public class PackTypeBukkitPurityGateTest {
|
||||
*/
|
||||
private static final List<String> ADDITIONAL_PACK_TYPES = List.of(
|
||||
"art.arcane.iris.engine.object.prefab.TileData",
|
||||
"art.arcane.iris.engine.object.prefab.LegacyTileData",
|
||||
"art.arcane.iris.engine.object.loot.IrisVanillaLootTable");
|
||||
"art.arcane.iris.engine.object.prefab.LegacyTileData");
|
||||
|
||||
/**
|
||||
* Bukkit-registry constant holders that a core pack type may reference, so their class initializer
|
||||
@@ -211,7 +199,7 @@ public class PackTypeBukkitPurityGateTest {
|
||||
BukkitHidingClassLoader hiding = new BukkitHidingClassLoader(getClass().getClassLoader());
|
||||
List<String> gateTypes = gateTypes();
|
||||
assertTrue("expected the @Snippet scan to find the pack snippet types, found only "
|
||||
+ gateTypes.size(), gateTypes.size() > 60);
|
||||
+ gateTypes.size(), gateTypes.size() > 40);
|
||||
|
||||
List<String> failures = new ArrayList<>();
|
||||
List<String> skipped = new ArrayList<>();
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package art.arcane.iris.util.project.matter;
|
||||
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.modules.ModuleResourceFixture;
|
||||
import art.arcane.iris.engine.spawn.SpawnResources;
|
||||
import art.arcane.iris.engine.object.entity.spawn.IrisSpawner;
|
||||
import art.arcane.iris.util.project.matter.slices.SpawnerMatter;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
public class RegistryMatterContextTest {
|
||||
@Test
|
||||
public void registrySliceResolvesThroughExplicitDataOnIoWorker() throws Exception {
|
||||
IrisSpawner firstResolved = new IrisSpawner();
|
||||
IrisSpawner secondResolved = new IrisSpawner();
|
||||
IrisData firstData = dataReturning(firstResolved);
|
||||
IrisData secondData = dataReturning(secondResolved);
|
||||
ExecutorService executor = Executors.newSingleThreadExecutor();
|
||||
try {
|
||||
Future<IrisSpawner> firstRead = executor.submit(() -> readSpawner(firstData));
|
||||
Future<IrisSpawner> secondRead = executor.submit(() -> readSpawner(secondData));
|
||||
assertSame(firstResolved, firstRead.get());
|
||||
assertSame(secondResolved, secondRead.get());
|
||||
} finally {
|
||||
executor.shutdownNow();
|
||||
}
|
||||
}
|
||||
|
||||
private IrisSpawner readSpawner(IrisData data) throws Exception {
|
||||
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
||||
try (DataOutputStream output = new DataOutputStream(bytes)) {
|
||||
output.writeUTF("test-spawner");
|
||||
}
|
||||
try (IrisMatterContext.Scope scope = IrisMatterContext.open(data);
|
||||
DataInputStream input = new DataInputStream(new ByteArrayInputStream(bytes.toByteArray()))) {
|
||||
return new SpawnerMatter().readNode(input);
|
||||
}
|
||||
}
|
||||
|
||||
private IrisData dataReturning(IrisSpawner resolved) {
|
||||
IrisData data = mock(IrisData.class);
|
||||
ModuleResourceFixture.serve(data).resource(SpawnResources.SPAWNERS, "test-spawner", resolved);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"name": "Tropical Volcanoes",
|
||||
"color": "#8C1E1E",
|
||||
"rarity": 1,
|
||||
"derivative": "minecraft:the_void",
|
||||
"vanillaDerivative": "minecraft:the_void",
|
||||
"customDerivitives": [{
|
||||
"category": "jungle",
|
||||
"id": "tropical_volcano",
|
||||
"grassColor": "#BDBF0B",
|
||||
"foliageColor": "#BDBF0B",
|
||||
"fogColor": "#DD793C",
|
||||
"downfallType": "none"
|
||||
}],
|
||||
"children": ["tropical/volcanoes-lava"],
|
||||
"generators": [{
|
||||
"generator": "mountain",
|
||||
"max": 180,
|
||||
"min": 30
|
||||
}],
|
||||
"layers": [
|
||||
{
|
||||
"minHeight": 1,
|
||||
"maxHeight": 1,
|
||||
"palette": [{"block": "minecraft:basalt"}]
|
||||
},
|
||||
{
|
||||
"minHeight": 2,
|
||||
"maxHeight": 2,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:basalt",
|
||||
"data": {"axis": "x"}
|
||||
},
|
||||
{
|
||||
"block": "minecraft:basalt",
|
||||
"data": {"axis": "y"}
|
||||
},
|
||||
{
|
||||
"block": "minecraft:basalt",
|
||||
"data": {"axis": "z"}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 3,
|
||||
"maxHeight": 10,
|
||||
"palette": [{"block": "minecraft:blackstone"}]
|
||||
},
|
||||
{
|
||||
"minHeight": 1,
|
||||
"maxHeight": 2,
|
||||
"palette": [{"block": "minecraft:tuff"}]
|
||||
}
|
||||
],
|
||||
"effects": [{
|
||||
"particleAltX": 0.001,
|
||||
"particleAltY": 0.13885,
|
||||
"particleAltZ": 0.001,
|
||||
"chance": 1,
|
||||
"particleEffect": "CAMPFIRE_SIGNAL_SMOKE",
|
||||
"particleOffset": 0,
|
||||
"interval": 300,
|
||||
"particleCount": 0
|
||||
}],
|
||||
"childStyle": {
|
||||
"style": "GLOB",
|
||||
"zoom": 0.2,
|
||||
"exponent": 4
|
||||
},
|
||||
"childShrinkFactor": 1
|
||||
}
|
||||
+946
@@ -0,0 +1,946 @@
|
||||
{
|
||||
"version": 4002,
|
||||
"name": "Overworld",
|
||||
"importedStructures": {
|
||||
"datapackOverrides": true,
|
||||
"adjustments": [
|
||||
{
|
||||
"match": [
|
||||
"minecraft:stronghold"
|
||||
],
|
||||
"yBand": {
|
||||
"min": -120,
|
||||
"max": -20
|
||||
},
|
||||
"terrain": {
|
||||
"mode": "ENCASE",
|
||||
"horizontalPadding": 4,
|
||||
"ceilingPadding": 4,
|
||||
"floorPadding": 4,
|
||||
"encasePalette": {
|
||||
"zoom": 1,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:stone_bricks",
|
||||
"weight": 6
|
||||
},
|
||||
{
|
||||
"block": "minecraft:mossy_stone_bricks",
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"block": "minecraft:cracked_stone_bricks",
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"block": "minecraft:cobblestone",
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"match": [
|
||||
"minecraft:trial_chambers"
|
||||
],
|
||||
"yShift": -64
|
||||
},
|
||||
{
|
||||
"match": [
|
||||
"minecraft:mineshaft"
|
||||
],
|
||||
"preserveSourceY": true
|
||||
},
|
||||
{
|
||||
"match": [
|
||||
"minecraft:village"
|
||||
],
|
||||
"stilt": {
|
||||
"maxDepth": 2,
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:dirt"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"structures": [
|
||||
{
|
||||
"nativeStructures": [
|
||||
{
|
||||
"structure": "minecraft:ancient_city"
|
||||
}
|
||||
],
|
||||
"placementId": "ancient-city-native",
|
||||
"nativeSuppression": "REPLACE_SOURCE",
|
||||
"underground": true,
|
||||
"terrain": {
|
||||
"mode": "FORCE_CARVE",
|
||||
"horizontalPadding": 14,
|
||||
"ceilingPadding": 12,
|
||||
"floorPadding": 0,
|
||||
"shape": "ERODED",
|
||||
"erosionStrength": 1.0,
|
||||
"erosionFrequency": 0.05
|
||||
},
|
||||
"stilt": {
|
||||
"maxDepth": 768,
|
||||
"spacing": 1,
|
||||
"palette": {
|
||||
"style": {
|
||||
"style": "STATIC"
|
||||
},
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:deepslate_bricks",
|
||||
"weight": 6
|
||||
},
|
||||
{
|
||||
"block": "minecraft:cracked_deepslate_bricks",
|
||||
"weight": 1
|
||||
},
|
||||
{
|
||||
"block": "minecraft:deepslate_tiles",
|
||||
"weight": 2
|
||||
},
|
||||
{
|
||||
"block": "minecraft:cracked_deepslate_tiles",
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"minHeight": -220,
|
||||
"maxHeight": -220,
|
||||
"distribution": "RANDOM_SPREAD",
|
||||
"spacing": 64,
|
||||
"separation": 5,
|
||||
"salt": 42069
|
||||
}
|
||||
],
|
||||
"fullbright": false,
|
||||
"upperDimension": "",
|
||||
"upperDimensionGap": 32,
|
||||
"upperDimensionCarving": false,
|
||||
"upperDimensionObjects": false,
|
||||
"environment": "NORMAL",
|
||||
"dimensionAngleDeg": 69,
|
||||
"fluidHeight": 50,
|
||||
"continentZoom": 1,
|
||||
"continentalStyle": {
|
||||
"style": "NOWHERE_CELLULAR",
|
||||
"fracture": {
|
||||
"style": "FRACTAL_SMOKE",
|
||||
"axialFracturing": true,
|
||||
"multiplier": 1,
|
||||
"fracture": {
|
||||
"style": "STATIC",
|
||||
"multiplier": 1,
|
||||
"axialFracturing": true
|
||||
}
|
||||
},
|
||||
"axialFracturing": true,
|
||||
"zoom": 6
|
||||
},
|
||||
"logicalHeight": 512,
|
||||
"dimensionHeight": {
|
||||
"max": 512,
|
||||
"min": -256
|
||||
},
|
||||
"landChance": 0.69,
|
||||
"regionStyle": {
|
||||
"style": "CELLULAR_IRIS_DOUBLE",
|
||||
"axialFracturing": true,
|
||||
"fracture": {
|
||||
"axialFracturing": true,
|
||||
"multiplier": 9,
|
||||
"style": "FRACTAL_WATER",
|
||||
"zoom": 0.15,
|
||||
"fracture": {
|
||||
"style": "STATIC",
|
||||
"multiplier": 1,
|
||||
"axialFracturing": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"regionZoom": 16.15,
|
||||
"regions": [
|
||||
"frozen",
|
||||
"hot",
|
||||
"terralost",
|
||||
"mushroom",
|
||||
"forests",
|
||||
"tundra",
|
||||
"magnetics",
|
||||
"temperate",
|
||||
"estranged",
|
||||
"tropical",
|
||||
"swamp",
|
||||
"prismatics"
|
||||
],
|
||||
"seaBiomeStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"axialFracturing": true
|
||||
},
|
||||
"landBiomeStyle": {
|
||||
"style": "NOWHERE_CELLULAR",
|
||||
"axialFracturing": true,
|
||||
"fracture": {
|
||||
"multiplier": 55,
|
||||
"axialFracturing": true,
|
||||
"style": "NOWHERE",
|
||||
"zoom": 0.15,
|
||||
"fracture": {
|
||||
"axialFracturing": true,
|
||||
"style": "STATIC",
|
||||
"multiplier": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
"ores": [
|
||||
{
|
||||
"threshold": 1,
|
||||
"range": {
|
||||
"min": 0,
|
||||
"max": 0
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:bedrock"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": {
|
||||
"style": "FLAT"
|
||||
}
|
||||
},
|
||||
{
|
||||
"threshold": 0.625,
|
||||
"range": {
|
||||
"min": 1,
|
||||
"max": 1
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:bedrock"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": "snippet/style/bedrock"
|
||||
},
|
||||
{
|
||||
"threshold": 0.35,
|
||||
"range": {
|
||||
"min": 2,
|
||||
"max": 4
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:bedrock"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": "snippet/style/bedrock"
|
||||
},
|
||||
{
|
||||
"threshold": 1,
|
||||
"range": {
|
||||
"min": 1,
|
||||
"max": 57
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:deepslate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": {
|
||||
"style": "FLAT"
|
||||
}
|
||||
},
|
||||
{
|
||||
"threshold": 0.874,
|
||||
"range": {
|
||||
"min": 58,
|
||||
"max": 58
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:deepslate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": "snippet/style/deepslate"
|
||||
},
|
||||
{
|
||||
"threshold": 0.75,
|
||||
"range": {
|
||||
"min": 59,
|
||||
"max": 59
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:deepslate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": "snippet/style/deepslate"
|
||||
},
|
||||
{
|
||||
"threshold": 0.625,
|
||||
"range": {
|
||||
"min": 60,
|
||||
"max": 60
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:deepslate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": "snippet/style/deepslate"
|
||||
},
|
||||
{
|
||||
"threshold": 0.5,
|
||||
"range": {
|
||||
"min": 61,
|
||||
"max": 61
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:deepslate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": "snippet/style/deepslate"
|
||||
},
|
||||
{
|
||||
"threshold": 0.375,
|
||||
"range": {
|
||||
"min": 62,
|
||||
"max": 62
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:deepslate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": "snippet/style/deepslate"
|
||||
},
|
||||
{
|
||||
"threshold": 0.25,
|
||||
"range": {
|
||||
"min": 63,
|
||||
"max": 63
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:deepslate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": "snippet/style/deepslate"
|
||||
},
|
||||
{
|
||||
"threshold": 0.125,
|
||||
"range": {
|
||||
"min": 64,
|
||||
"max": 64
|
||||
},
|
||||
"palette": {
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:deepslate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"chanceStyle": "snippet/style/deepslate"
|
||||
}
|
||||
],
|
||||
"shoreBiomeStyle": {
|
||||
"style": "NOWHERE_CELLULAR"
|
||||
},
|
||||
"deposits": [
|
||||
{
|
||||
"minHeight": 19,
|
||||
"maxPerChunk": 8,
|
||||
"maxHeight": 390,
|
||||
"minPerChunk": 1,
|
||||
"minSize": 25,
|
||||
"maxSize": 25,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:granite"
|
||||
}
|
||||
],
|
||||
"varience": 2
|
||||
},
|
||||
{
|
||||
"minHeight": 19,
|
||||
"maxPerChunk": 8,
|
||||
"maxHeight": 310,
|
||||
"minPerChunk": 1,
|
||||
"minSize": 25,
|
||||
"maxSize": 25,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:andesite"
|
||||
}
|
||||
],
|
||||
"varience": 2
|
||||
},
|
||||
{
|
||||
"minHeight": 19,
|
||||
"maxPerChunk": 8,
|
||||
"maxHeight": 309,
|
||||
"minPerChunk": 1,
|
||||
"minSize": 25,
|
||||
"maxSize": 25,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:diorite"
|
||||
}
|
||||
],
|
||||
"varience": 2
|
||||
},
|
||||
{
|
||||
"minHeight": 19,
|
||||
"maxPerChunk": 8,
|
||||
"maxHeight": 389,
|
||||
"minPerChunk": 1,
|
||||
"minSize": 25,
|
||||
"maxSize": 25,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:gravel"
|
||||
}
|
||||
],
|
||||
"varience": 2
|
||||
},
|
||||
{
|
||||
"minHeight": 400,
|
||||
"maxHeight": 767,
|
||||
"heightDistribution": "UNIFORM",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 60,
|
||||
"maxPerChunk": 60,
|
||||
"minSize": 17,
|
||||
"maxSize": 17,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"discardChanceOnAirExposure": 0.3,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:coal_ore"
|
||||
}
|
||||
],
|
||||
"replaceableBlocks": [
|
||||
"minecraft:stone",
|
||||
"minecraft:granite",
|
||||
"minecraft:diorite",
|
||||
"minecraft:andesite",
|
||||
"minecraft:deepslate",
|
||||
"minecraft:tuff"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 128,
|
||||
"maxHeight": 512,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 1,
|
||||
"minPerChunk": 80,
|
||||
"maxPerChunk": 80,
|
||||
"minSize": 17,
|
||||
"maxSize": 17,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"discardChanceOnAirExposure": 0.65,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:coal_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 288,
|
||||
"maxHeight": 896,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 180,
|
||||
"maxPerChunk": 180,
|
||||
"minSize": 9,
|
||||
"maxSize": 9,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:iron_ore"
|
||||
}
|
||||
],
|
||||
"replaceableBlocks": [
|
||||
"minecraft:stone",
|
||||
"minecraft:granite",
|
||||
"minecraft:diorite",
|
||||
"minecraft:andesite",
|
||||
"minecraft:deepslate",
|
||||
"minecraft:tuff"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 80,
|
||||
"maxHeight": 240,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 40,
|
||||
"maxPerChunk": 40,
|
||||
"minSize": 9,
|
||||
"maxSize": 9,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:iron_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 0,
|
||||
"maxHeight": 272,
|
||||
"heightDistribution": "UNIFORM",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 40,
|
||||
"maxPerChunk": 40,
|
||||
"minSize": 4,
|
||||
"maxSize": 4,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:iron_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 96,
|
||||
"maxHeight": 352,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 64,
|
||||
"maxPerChunk": 64,
|
||||
"minSize": 10,
|
||||
"maxSize": 10,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"biomeScope": "CAVE",
|
||||
"excludedBiomes": [
|
||||
"carving/drip",
|
||||
"carving/drip-child",
|
||||
"carving/drip-lite",
|
||||
"carving/drip-lite-child"
|
||||
],
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:copper_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 96,
|
||||
"maxHeight": 352,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 64,
|
||||
"maxPerChunk": 64,
|
||||
"minSize": 20,
|
||||
"maxSize": 20,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"biomeScope": "CAVE",
|
||||
"includedBiomes": [
|
||||
"carving/drip",
|
||||
"carving/drip-child",
|
||||
"carving/drip-lite",
|
||||
"carving/drip-lite-child"
|
||||
],
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:copper_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 0,
|
||||
"maxHeight": 192,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 16,
|
||||
"maxPerChunk": 16,
|
||||
"minSize": 9,
|
||||
"maxSize": 9,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"discardChanceOnAirExposure": 0.5,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:gold_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 0,
|
||||
"maxHeight": 32,
|
||||
"heightDistribution": "UNIFORM",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 0,
|
||||
"maxPerChunk": 2,
|
||||
"minSize": 9,
|
||||
"maxSize": 9,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"discardChanceOnAirExposure": 0.5,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:gold_ore"
|
||||
}
|
||||
],
|
||||
"replaceableBlocks": [
|
||||
"minecraft:stone",
|
||||
"minecraft:granite",
|
||||
"minecraft:diorite",
|
||||
"minecraft:andesite",
|
||||
"minecraft:deepslate",
|
||||
"minecraft:tuff"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 192,
|
||||
"maxHeight": 640,
|
||||
"heightDistribution": "UNIFORM",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 100,
|
||||
"maxPerChunk": 100,
|
||||
"minSize": 9,
|
||||
"maxSize": 9,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"biomeScope": "SURFACE",
|
||||
"includedBiomes": [
|
||||
"minecraft:badlands",
|
||||
"minecraft:eroded_badlands",
|
||||
"minecraft:wooded_badlands"
|
||||
],
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:gold_ore"
|
||||
}
|
||||
],
|
||||
"replaceableBlocks": [
|
||||
"minecraft:stone",
|
||||
"minecraft:granite",
|
||||
"minecraft:diorite",
|
||||
"minecraft:andesite",
|
||||
"minecraft:deepslate",
|
||||
"minecraft:tuff"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 0,
|
||||
"maxHeight": 158,
|
||||
"heightDistribution": "UNIFORM",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 16,
|
||||
"maxPerChunk": 16,
|
||||
"minSize": 8,
|
||||
"maxSize": 8,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"palette": [
|
||||
{
|
||||
"data": {
|
||||
"lit": false
|
||||
},
|
||||
"block": "minecraft:redstone_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": -64,
|
||||
"maxHeight": 64,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 16,
|
||||
"maxPerChunk": 16,
|
||||
"minSize": 8,
|
||||
"maxSize": 8,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"palette": [
|
||||
{
|
||||
"data": {
|
||||
"lit": false
|
||||
},
|
||||
"block": "minecraft:redstone_ore"
|
||||
}
|
||||
],
|
||||
"replaceableBlocks": [
|
||||
"minecraft:stone",
|
||||
"minecraft:granite",
|
||||
"minecraft:diorite",
|
||||
"minecraft:andesite",
|
||||
"minecraft:deepslate",
|
||||
"minecraft:tuff"
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": -160,
|
||||
"maxHeight": 160,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 28,
|
||||
"maxPerChunk": 28,
|
||||
"minSize": 4,
|
||||
"maxSize": 4,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"discardChanceOnAirExposure": 0.5,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:diamond_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 0,
|
||||
"maxHeight": 120,
|
||||
"heightDistribution": "UNIFORM",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 8,
|
||||
"maxPerChunk": 8,
|
||||
"minSize": 8,
|
||||
"maxSize": 8,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"discardChanceOnAirExposure": 0.5,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:diamond_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": -160,
|
||||
"maxHeight": 160,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 4,
|
||||
"maxPerChunk": 4,
|
||||
"spawnChance": 0.1111111111111111,
|
||||
"minSize": 12,
|
||||
"maxSize": 12,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"discardChanceOnAirExposure": 0.7,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:diamond_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": -160,
|
||||
"maxHeight": 160,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 16,
|
||||
"maxPerChunk": 16,
|
||||
"minSize": 8,
|
||||
"maxSize": 8,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"discardChanceOnAirExposure": 1.0,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:diamond_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 64,
|
||||
"maxHeight": 192,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 8,
|
||||
"maxPerChunk": 8,
|
||||
"minSize": 7,
|
||||
"maxSize": 7,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:lapis_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 0,
|
||||
"maxHeight": 256,
|
||||
"heightDistribution": "UNIFORM",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 16,
|
||||
"maxPerChunk": 16,
|
||||
"minSize": 7,
|
||||
"maxSize": 7,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"discardChanceOnAirExposure": 1.0,
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:lapis_ore"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"minHeight": 96,
|
||||
"maxHeight": 1088,
|
||||
"heightDistribution": "TRIANGLE",
|
||||
"surfaceClearance": 0,
|
||||
"minPerChunk": 200,
|
||||
"maxPerChunk": 200,
|
||||
"minSize": 3,
|
||||
"maxSize": 3,
|
||||
"shape": "VANILLA_ELLIPSOID",
|
||||
"biomeScope": "SURFACE",
|
||||
"includedBiomes": [
|
||||
"minecraft:cherry_grove",
|
||||
"minecraft:frozen_peaks",
|
||||
"minecraft:grove",
|
||||
"minecraft:jagged_peaks",
|
||||
"minecraft:meadow",
|
||||
"minecraft:snowy_slopes",
|
||||
"minecraft:stony_peaks",
|
||||
"minecraft:windswept_forest",
|
||||
"minecraft:windswept_gravelly_hills",
|
||||
"minecraft:windswept_hills"
|
||||
],
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:emerald_ore"
|
||||
}
|
||||
],
|
||||
"replaceableBlocks": [
|
||||
"minecraft:stone",
|
||||
"minecraft:granite",
|
||||
"minecraft:diorite",
|
||||
"minecraft:andesite",
|
||||
"minecraft:deepslate",
|
||||
"minecraft:tuff"
|
||||
]
|
||||
}
|
||||
],
|
||||
"caveBiomeStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 2.6
|
||||
},
|
||||
"coordFractureZoom": 0.15,
|
||||
"preventLeafDecay": true,
|
||||
"useMantle": true,
|
||||
"carvingEnabled": true,
|
||||
"decorate": true,
|
||||
"loot": {
|
||||
"mode": "FALLBACK",
|
||||
"tables": [
|
||||
"global-clutter"
|
||||
]
|
||||
},
|
||||
"caveProfile": {
|
||||
"enabled": true,
|
||||
"verticalRange": {
|
||||
"min": 6,
|
||||
"max": 700
|
||||
},
|
||||
"baseDensityStyle": {
|
||||
"style": "PERLIN_IRIS",
|
||||
"zoom": 0.72
|
||||
},
|
||||
"detailDensityStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.54
|
||||
},
|
||||
"warpStyle": {
|
||||
"style": "FRACTAL_WATER",
|
||||
"zoom": 0.5
|
||||
},
|
||||
"baseWeight": 0.9,
|
||||
"detailWeight": 0.11,
|
||||
"warpStrength": 0.24,
|
||||
"densityThreshold": {
|
||||
"min": -0.14,
|
||||
"max": -0.06,
|
||||
"style": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.74
|
||||
}
|
||||
},
|
||||
"thresholdBias": 0.14,
|
||||
"sampleStep": 3,
|
||||
"surfaceClearance": 5,
|
||||
"allowSurfaceBreak": true,
|
||||
"surfaceBreakStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.88
|
||||
},
|
||||
"surfaceBreakNoiseThreshold": 0.6,
|
||||
"surfaceBreakDepth": 16,
|
||||
"surfaceBreakThresholdBoost": 0.1,
|
||||
"objectMinDepthBelowSurface": 14,
|
||||
"defaultObjectAnchor": "FLOOR",
|
||||
"defaultObjectPlaceMode": "ORGANIC_STILT",
|
||||
"anchorScanStep": 1,
|
||||
"anchorSearchAttempts": 12,
|
||||
"allowFluid": true,
|
||||
"fluidMinDepthBelowSurface": 20,
|
||||
"fluidRequiresFloor": true,
|
||||
"allowLava": true,
|
||||
"modules": [
|
||||
{
|
||||
"style": {
|
||||
"style": "SIMPLEX_VASCULAR",
|
||||
"zoom": 1.08
|
||||
},
|
||||
"weight": 0.08,
|
||||
"threshold": 0.03,
|
||||
"verticalRange": {
|
||||
"min": 24,
|
||||
"max": 660
|
||||
},
|
||||
"invert": false
|
||||
},
|
||||
{
|
||||
"style": {
|
||||
"style": "FRACTAL_FBM_SIMPLEX",
|
||||
"zoom": 0.24
|
||||
},
|
||||
"weight": 0.04,
|
||||
"threshold": 0.08,
|
||||
"verticalRange": {
|
||||
"min": 6,
|
||||
"max": 240
|
||||
},
|
||||
"invert": true
|
||||
}
|
||||
],
|
||||
"verticalEdgeFade": 24,
|
||||
"verticalEdgeFadeStrength": 0.18,
|
||||
"minCarveCells": 24,
|
||||
"recoveryThresholdBoost": 0.07
|
||||
},
|
||||
"carving": [
|
||||
{
|
||||
"id": "global-deepdark-band",
|
||||
"enabled": true,
|
||||
"biome": "carving/standard-deepdark",
|
||||
"worldYRange": {
|
||||
"min": -250,
|
||||
"max": -175
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"type": "ZOMBIE"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"type": "MOOSHROOM"}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
{
|
||||
"name": "Global Clutter",
|
||||
"rarity": 1,
|
||||
"maxPicked": 2,
|
||||
"minPicked": 1,
|
||||
"maxTries": 20,
|
||||
"loot": [
|
||||
{
|
||||
"type": "stone",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 8,
|
||||
"rarity": 1,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "stick",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 6,
|
||||
"rarity": 1,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "flint",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 4,
|
||||
"rarity": 2,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 4,
|
||||
"rarity": 2,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "leather",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 3,
|
||||
"rarity": 3,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "paper",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 5,
|
||||
"rarity": 3,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "torch",
|
||||
"minAmount": 2,
|
||||
"maxAmount": 8,
|
||||
"rarity": 2,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "ladder",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 6,
|
||||
"rarity": 4,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "bucket",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 1,
|
||||
"rarity": 9,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "arrow",
|
||||
"minAmount": 2,
|
||||
"maxAmount": 10,
|
||||
"rarity": 4,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "glass_bottle",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 4,
|
||||
"rarity": 4,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "copper_ingot",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 5,
|
||||
"rarity": 6,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "amethyst_shard",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 4,
|
||||
"rarity": 7,
|
||||
"slotTypes": "STORAGE"
|
||||
},
|
||||
{
|
||||
"type": "enchanted_book",
|
||||
"minAmount": 1,
|
||||
"maxAmount": 1,
|
||||
"rarity": 28,
|
||||
"slotTypes": "STORAGE",
|
||||
"enchantments": [
|
||||
{
|
||||
"enchantment": "unbreaking",
|
||||
"minLevel": 2,
|
||||
"maxLevel": 3,
|
||||
"chance": 1.0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
{
|
||||
"name": "Hot",
|
||||
"color": "#D1CD44",
|
||||
"rarity": 3,
|
||||
"seaBiomeZoom": 3.5,
|
||||
"landBiomes": [
|
||||
"hot/desert-dunes",
|
||||
"hot/small-valley",
|
||||
"hot/desert-dunes-red",
|
||||
"savanna/savanna",
|
||||
"mesa/dark",
|
||||
"savanna/plateau",
|
||||
"savanna/forest",
|
||||
"savanna/acacia-denmyre",
|
||||
"mesa/plateau",
|
||||
"mesa/valleys",
|
||||
"mesa/plateau-high",
|
||||
"mesa/valleys",
|
||||
"mesa/mesa",
|
||||
"hot/mountain-middle",
|
||||
"hot/mountain-plains",
|
||||
"hot/oasis",
|
||||
"vanilla/savanna_plateau",
|
||||
"vanilla/windswept_savanna",
|
||||
"vanilla/wooded_badlands"
|
||||
],
|
||||
"caveBiomes": [
|
||||
"carving/sandstone",
|
||||
"carving/sand-hollows",
|
||||
"carving/red-sandstone",
|
||||
"carving/mixed-sandstone",
|
||||
"carving/volcanic",
|
||||
"carving/ember-rifts"
|
||||
],
|
||||
"shoreBiomes": [
|
||||
"hot/shore/beach",
|
||||
"hot/shore/beach-grass",
|
||||
"mesa/shore/beach",
|
||||
"savanna/shore/beach"
|
||||
],
|
||||
"seaBiomes": [
|
||||
"hot/sea/ocean",
|
||||
"ocean/rich-oceans",
|
||||
"hot/sea/river",
|
||||
"mesa/sea/river"
|
||||
],
|
||||
"landBiomeZoom": 7,
|
||||
"effects": [
|
||||
{
|
||||
"potionTicksMin": 87,
|
||||
"potionEffect": "CONFUSION",
|
||||
"chance": 1200,
|
||||
"potionStrength": 0,
|
||||
"potionTicksMax": 67,
|
||||
"interval": 500
|
||||
},
|
||||
{
|
||||
"particleAltX": 0.001,
|
||||
"particleAltY": 0.00885,
|
||||
"particleAltZ": 0.001,
|
||||
"chance": 2,
|
||||
"particleEffect": "CAMPFIRE_SIGNAL_SMOKE",
|
||||
"particleOffset": 0,
|
||||
"interval": 1350,
|
||||
"particleCount": 0
|
||||
}
|
||||
],
|
||||
"shoreHeightMin": 3.2,
|
||||
"shoreHeightMax": 6.2,
|
||||
"shoreHeightZoom": 1.14,
|
||||
"loot": {
|
||||
"mode": "FALLBACK",
|
||||
"multiplier": 0.5,
|
||||
"tables": [
|
||||
"hot/food",
|
||||
"cactus/clutter",
|
||||
"beach/clutter"
|
||||
]
|
||||
},
|
||||
"caveProfile": {
|
||||
"enabled": true,
|
||||
"verticalRange": {
|
||||
"min": 6,
|
||||
"max": 90
|
||||
},
|
||||
"baseDensityStyle": {
|
||||
"style": "IRIS_DOUBLE",
|
||||
"zoom": 0.8
|
||||
},
|
||||
"detailDensityStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
},
|
||||
"warpStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
},
|
||||
"baseWeight": 1,
|
||||
"detailWeight": 0,
|
||||
"warpStrength": 0,
|
||||
"densityThreshold": {
|
||||
"min": -0.1,
|
||||
"max": -0.04,
|
||||
"style": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
}
|
||||
},
|
||||
"thresholdBias": 0.14,
|
||||
"sampleStep": 3,
|
||||
"surfaceClearance": 12,
|
||||
"allowSurfaceBreak": false,
|
||||
"surfaceBreakStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.88
|
||||
},
|
||||
"surfaceBreakNoiseThreshold": 0.99,
|
||||
"surfaceBreakDepth": 4,
|
||||
"surfaceBreakThresholdBoost": 0.02,
|
||||
"objectMinDepthBelowSurface": 14,
|
||||
"defaultObjectAnchor": "FLOOR",
|
||||
"defaultObjectPlaceMode": "ORGANIC_STILT",
|
||||
"anchorScanStep": 1,
|
||||
"anchorSearchAttempts": 12,
|
||||
"allowFluid": true,
|
||||
"fluidMinDepthBelowSurface": 20,
|
||||
"fluidRequiresFloor": true,
|
||||
"allowLava": true,
|
||||
"modules": []
|
||||
},
|
||||
"caveBiomeZoom": 3.6,
|
||||
"entitySpawners": [
|
||||
"hot/cave",
|
||||
"hot/hostile",
|
||||
"hot/passive",
|
||||
"hot/water"
|
||||
]
|
||||
}
|
||||
+266
@@ -0,0 +1,266 @@
|
||||
{
|
||||
"name": "Mushroom",
|
||||
"color": "#F1C3EF",
|
||||
"rarity": 15,
|
||||
"proceduralObjects": {
|
||||
"fungi": [
|
||||
{
|
||||
"name": "red-cap",
|
||||
"chance": 0.05,
|
||||
"density": 2,
|
||||
"variants": 6,
|
||||
"seed": 9301,
|
||||
"stem": "minecraft:mushroom_stem",
|
||||
"cap": "minecraft:red_mushroom_block",
|
||||
"capShape": "DOME",
|
||||
"stemHeightMin": 4,
|
||||
"stemHeightMax": 9,
|
||||
"stemWidth": 2,
|
||||
"stemCurve": 6,
|
||||
"stemWaveAmplitude": 0.4,
|
||||
"stemWavePeriods": 1.5,
|
||||
"capRadiusMin": 3,
|
||||
"capRadiusMax": 5,
|
||||
"capThickness": 2,
|
||||
"capSquish": 0.7,
|
||||
"capDroop": 18,
|
||||
"capOverhang": 2,
|
||||
"gillBlock": "minecraft:mushroom_stem",
|
||||
"gillChance": 0.7,
|
||||
"rotation": {
|
||||
"enabled": true,
|
||||
"yAxis": {
|
||||
"enabled": true,
|
||||
"min": 0,
|
||||
"max": 360,
|
||||
"interval": 90
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "brown-table",
|
||||
"chance": 0.05,
|
||||
"density": 2,
|
||||
"variants": 6,
|
||||
"seed": 9302,
|
||||
"stem": "minecraft:mushroom_stem",
|
||||
"cap": "minecraft:brown_mushroom_block",
|
||||
"capShape": "FLAT_WIDE",
|
||||
"stemHeightMin": 5,
|
||||
"stemHeightMax": 11,
|
||||
"stemWidth": 2,
|
||||
"stemCurve": 4,
|
||||
"capRadiusMin": 4,
|
||||
"capRadiusMax": 7,
|
||||
"capThickness": 1,
|
||||
"capSquish": 0.35,
|
||||
"capDroop": 8,
|
||||
"capOverhang": 3,
|
||||
"gillBlock": "minecraft:shroomlight",
|
||||
"gillChance": 0.5,
|
||||
"rotation": {
|
||||
"enabled": true,
|
||||
"yAxis": {
|
||||
"enabled": true,
|
||||
"min": 0,
|
||||
"max": 360,
|
||||
"interval": 90
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "spindle-toadstool",
|
||||
"chance": 0.35,
|
||||
"density": 3,
|
||||
"variants": 6,
|
||||
"seed": 9303,
|
||||
"stem": "minecraft:mushroom_stem",
|
||||
"stemPalette": {
|
||||
"style": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.6
|
||||
},
|
||||
"palette": [
|
||||
{
|
||||
"block": "minecraft:mushroom_stem",
|
||||
"weight": 5
|
||||
},
|
||||
{
|
||||
"block": "minecraft:pale_oak_wood",
|
||||
"weight": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"cap": "minecraft:red_mushroom_block",
|
||||
"capShape": "CONICAL",
|
||||
"stemHeightMin": 6,
|
||||
"stemHeightMax": 12,
|
||||
"stemWidth": 1,
|
||||
"stemCurve": 10,
|
||||
"stemWaveAmplitude": 0.6,
|
||||
"stemWavePeriods": 2,
|
||||
"capRadiusMin": 2,
|
||||
"capRadiusMax": 4,
|
||||
"capThickness": 2,
|
||||
"capSquish": 0.9,
|
||||
"capDroop": 22,
|
||||
"capOverhang": 1,
|
||||
"spotBlock": "minecraft:brown_mushroom_block",
|
||||
"spotChance": 0.25,
|
||||
"gillBlock": "minecraft:shroomlight",
|
||||
"gillChance": 0.6,
|
||||
"rotation": {
|
||||
"enabled": true,
|
||||
"yAxis": {
|
||||
"enabled": true,
|
||||
"min": 0,
|
||||
"max": 360,
|
||||
"interval": 90
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"landBiomes": [
|
||||
"mushroom/forest",
|
||||
"mushroom/crimson-forest",
|
||||
"mushroom/forest-extended",
|
||||
"mushroom/plains",
|
||||
"mushroom/warped-forest"
|
||||
],
|
||||
"caveBiomes": [
|
||||
"carving/mushroom",
|
||||
"carving/rocky-cavebiome",
|
||||
"carving/drip-lite",
|
||||
"carving/moss-pillars",
|
||||
"carving/crystalized-overgrown"
|
||||
],
|
||||
"shoreBiomes": [
|
||||
"mushroom/shore/beach"
|
||||
],
|
||||
"seaBiomes": [
|
||||
"mushroom/sea/ocean",
|
||||
"mushroom/sea/lake"
|
||||
],
|
||||
"blockDrops": [
|
||||
{
|
||||
"drops": [
|
||||
{
|
||||
"type": "red_mushroom",
|
||||
"rarity": 8
|
||||
},
|
||||
{
|
||||
"type": "brown_mushroom",
|
||||
"rarity": 8
|
||||
}
|
||||
],
|
||||
"blocks": [
|
||||
{
|
||||
"block": "minecraft:mycelium"
|
||||
},
|
||||
{
|
||||
"block": "minecraft:mushroom_stem"
|
||||
},
|
||||
{
|
||||
"block": "minecraft:red_mushroom_block"
|
||||
},
|
||||
{
|
||||
"block": "minecraft:brown_mushroom_block"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"landBiomeZoom": 1.8,
|
||||
"effects": [
|
||||
{
|
||||
"particleAltX": 1e-05,
|
||||
"particleAway": 1,
|
||||
"particleAltY": 0.01885,
|
||||
"particleAltZ": 1e-05,
|
||||
"chance": 3,
|
||||
"particleEffect": "CRIMSON_SPORE",
|
||||
"particleDistance": 5,
|
||||
"particleOffset": 2,
|
||||
"interval": 50,
|
||||
"particleCount": 0
|
||||
},
|
||||
{
|
||||
"volume": 6.2,
|
||||
"minPitch": 0.2,
|
||||
"chance": 8,
|
||||
"maxPitch": 0.3,
|
||||
"sound": "AMBIENT.WARPED_FOREST.ADDITIONS",
|
||||
"interval": 60000,
|
||||
"soundDistance": 3
|
||||
}
|
||||
],
|
||||
"shoreHeightMin": 3.2,
|
||||
"shoreHeightMax": 6.2,
|
||||
"shoreHeightZoom": 1.14,
|
||||
"loot": {
|
||||
"mode": "FALLBACK",
|
||||
"multiplier": 0.5,
|
||||
"tables": [
|
||||
"mushroom/clutter",
|
||||
"mushroom/food"
|
||||
]
|
||||
},
|
||||
"caveProfile": {
|
||||
"enabled": true,
|
||||
"verticalRange": {
|
||||
"min": 6,
|
||||
"max": 100
|
||||
},
|
||||
"baseDensityStyle": {
|
||||
"style": "CELLULAR",
|
||||
"zoom": 0.9
|
||||
},
|
||||
"detailDensityStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
},
|
||||
"warpStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
},
|
||||
"baseWeight": 1.0,
|
||||
"detailWeight": 0.0,
|
||||
"warpStrength": 0.0,
|
||||
"densityThreshold": {
|
||||
"min": -0.12,
|
||||
"max": -0.06,
|
||||
"style": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
}
|
||||
},
|
||||
"thresholdBias": 0.1,
|
||||
"sampleStep": 3,
|
||||
"surfaceClearance": 12,
|
||||
"allowSurfaceBreak": false,
|
||||
"surfaceBreakStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.88
|
||||
},
|
||||
"surfaceBreakNoiseThreshold": 0.99,
|
||||
"surfaceBreakDepth": 4,
|
||||
"surfaceBreakThresholdBoost": 0.02,
|
||||
"objectMinDepthBelowSurface": 14,
|
||||
"defaultObjectAnchor": "FLOOR",
|
||||
"defaultObjectPlaceMode": "ORGANIC_STILT",
|
||||
"anchorScanStep": 1,
|
||||
"anchorSearchAttempts": 12,
|
||||
"allowFluid": true,
|
||||
"fluidMinDepthBelowSurface": 20,
|
||||
"fluidRequiresFloor": true,
|
||||
"allowLava": true,
|
||||
"modules": []
|
||||
},
|
||||
"caveBiomeZoom": 3.2,
|
||||
"entitySpawners": [
|
||||
"mushroom/cave",
|
||||
"mushroom/hostile",
|
||||
"mushroom/passive",
|
||||
"mushroom/water"
|
||||
]
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"name": "Swamp",
|
||||
"color": "#69943C",
|
||||
"rarity": 2,
|
||||
"landBiomes": [
|
||||
"swamp/roofed-forest",
|
||||
"swamp/sea/lake",
|
||||
"swamp/roofed-wayward",
|
||||
"swamp/marsh",
|
||||
"swamp/handy-willow-forest",
|
||||
"swamp/cambian-drift",
|
||||
"swamp/swamp-forest",
|
||||
"swamp/willow-forest",
|
||||
"swamp/creaks",
|
||||
"vanilla/mangrove_swamp"
|
||||
],
|
||||
"caveBiomes": [
|
||||
"carving/swamp",
|
||||
"carving/lush",
|
||||
"carving/drip-lite",
|
||||
"carving/drip",
|
||||
"carving/moss-pillars"
|
||||
],
|
||||
"shoreBiomes": [
|
||||
"swamp/shore/beach"
|
||||
],
|
||||
"seaBiomes": [
|
||||
"swamp/sea/ocean",
|
||||
"swamp/swamp-mangrove-lake",
|
||||
"swamp/sea/ocean-tree"
|
||||
],
|
||||
"landBiomeZoom": 2,
|
||||
"shoreHeightMin": 1.2,
|
||||
"shoreHeightMax": 3,
|
||||
"shoreHeightZoom": 3.14,
|
||||
"blockDrops": [
|
||||
{
|
||||
"drops": [
|
||||
{
|
||||
"type": "slime_ball",
|
||||
"rarity": 24
|
||||
}
|
||||
],
|
||||
"blocks": [
|
||||
{
|
||||
"block": "minecraft:grass_block"
|
||||
},
|
||||
{
|
||||
"block": "minecraft:dark_oak_leaves"
|
||||
},
|
||||
{
|
||||
"block": "minecraft:short_grass"
|
||||
},
|
||||
{
|
||||
"block": "minecraft:tall_grass"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"loot": {
|
||||
"mode": "FALLBACK",
|
||||
"multiplier": 0.5,
|
||||
"tables": [
|
||||
"swamp/clutter",
|
||||
"swamp/food"
|
||||
]
|
||||
},
|
||||
"caveProfile": {
|
||||
"enabled": true,
|
||||
"verticalRange": {
|
||||
"min": 6,
|
||||
"max": 80
|
||||
},
|
||||
"baseDensityStyle": {
|
||||
"style": "FRACTAL_SMOKE",
|
||||
"zoom": 0.45
|
||||
},
|
||||
"detailDensityStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
},
|
||||
"warpStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
},
|
||||
"baseWeight": 1,
|
||||
"detailWeight": 0,
|
||||
"warpStrength": 0,
|
||||
"densityThreshold": {
|
||||
"min": -0.14,
|
||||
"max": -0.06,
|
||||
"style": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
}
|
||||
},
|
||||
"thresholdBias": 0.06,
|
||||
"sampleStep": 3,
|
||||
"surfaceClearance": 12,
|
||||
"allowSurfaceBreak": false,
|
||||
"surfaceBreakStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.88
|
||||
},
|
||||
"surfaceBreakNoiseThreshold": 0.99,
|
||||
"surfaceBreakDepth": 4,
|
||||
"surfaceBreakThresholdBoost": 0.02,
|
||||
"objectMinDepthBelowSurface": 14,
|
||||
"defaultObjectAnchor": "FLOOR",
|
||||
"defaultObjectPlaceMode": "ORGANIC_STILT",
|
||||
"anchorScanStep": 1,
|
||||
"anchorSearchAttempts": 12,
|
||||
"allowFluid": true,
|
||||
"fluidMinDepthBelowSurface": 20,
|
||||
"fluidRequiresFloor": true,
|
||||
"allowLava": true,
|
||||
"modules": []
|
||||
},
|
||||
"caveBiomeZoom": 3.2,
|
||||
"entitySpawners": [
|
||||
"swamp/cave",
|
||||
"swamp/hostile",
|
||||
"swamp/passive",
|
||||
"swamp/water"
|
||||
]
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"name": "Terralost",
|
||||
"color": "#446600",
|
||||
"rarity": 5,
|
||||
"landBiomes": [
|
||||
"terralost/amethyst-rainforest",
|
||||
"terralost/ancient-sands",
|
||||
"terralost/amethyst-canyon",
|
||||
"terralost/alpine-grove",
|
||||
"terralost/alpine-highlands",
|
||||
"dev"
|
||||
],
|
||||
"landBiomeZoom": 3,
|
||||
"shoreBiomes": [
|
||||
"tundra/shore/beach"
|
||||
],
|
||||
"seaBiomes": [
|
||||
"mountain/sea/river"
|
||||
],
|
||||
"shoreHeightMin": 2.2,
|
||||
"shoreHeightMax": 5.2,
|
||||
"shoreHeightZoom": 1.14,
|
||||
"loot": {
|
||||
"mode": "FALLBACK",
|
||||
"multiplier": 0.5,
|
||||
"tables": [
|
||||
"tropical/food",
|
||||
"cave/clutter"
|
||||
]
|
||||
},
|
||||
"caveBiomes": [
|
||||
"carving/amethyst",
|
||||
"carving/calcite",
|
||||
"carving/deepslate",
|
||||
"carving/deepravine",
|
||||
"carving/chalk-gardens"
|
||||
],
|
||||
"caveProfile": {
|
||||
"enabled": true,
|
||||
"verticalRange": {
|
||||
"min": 6,
|
||||
"max": 60
|
||||
},
|
||||
"baseDensityStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.4
|
||||
},
|
||||
"detailDensityStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
},
|
||||
"warpStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
},
|
||||
"baseWeight": 1.0,
|
||||
"detailWeight": 0.0,
|
||||
"warpStrength": 0.0,
|
||||
"densityThreshold": {
|
||||
"min": -0.16,
|
||||
"max": -0.08,
|
||||
"style": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.5
|
||||
}
|
||||
},
|
||||
"thresholdBias": 0.12,
|
||||
"sampleStep": 3,
|
||||
"surfaceClearance": 12,
|
||||
"allowSurfaceBreak": false,
|
||||
"surfaceBreakStyle": {
|
||||
"style": "SIMPLEX",
|
||||
"zoom": 0.88
|
||||
},
|
||||
"surfaceBreakNoiseThreshold": 0.99,
|
||||
"surfaceBreakDepth": 4,
|
||||
"surfaceBreakThresholdBoost": 0.02,
|
||||
"objectMinDepthBelowSurface": 14,
|
||||
"defaultObjectAnchor": "FLOOR",
|
||||
"defaultObjectPlaceMode": "ORGANIC_STILT",
|
||||
"anchorScanStep": 1,
|
||||
"anchorSearchAttempts": 12,
|
||||
"allowFluid": true,
|
||||
"fluidMinDepthBelowSurface": 20,
|
||||
"fluidRequiresFloor": true,
|
||||
"allowLava": true,
|
||||
"modules": []
|
||||
},
|
||||
"caveBiomeZoom": 3.1,
|
||||
"entitySpawners": [
|
||||
"temperate/cave",
|
||||
"temperate/hostile",
|
||||
"temperate/passive",
|
||||
"temperate/water"
|
||||
]
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"group": "NORMAL",
|
||||
"maximumRate": {
|
||||
"amount": 15,
|
||||
"per": {"seconds": 30}
|
||||
},
|
||||
"timeBlock": {
|
||||
"startHour": 6,
|
||||
"endHour": 18
|
||||
},
|
||||
"maxEntitiesPerChunk": 2,
|
||||
"weather": "NONE",
|
||||
"spawns": [
|
||||
{
|
||||
"entity": "standard/passive/mooshroom",
|
||||
"maxSpawns": 3,
|
||||
"minSpawns": 1,
|
||||
"rarity": 1
|
||||
},
|
||||
{
|
||||
"entity": "standard/passive/cow",
|
||||
"maxSpawns": 2,
|
||||
"rarity": 3
|
||||
},
|
||||
{
|
||||
"entity": "standard/passive/pig",
|
||||
"maxSpawns": 2,
|
||||
"minSpawns": 1,
|
||||
"rarity": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"group": "NORMAL",
|
||||
"maximumRate": {
|
||||
"amount": 8,
|
||||
"per": { "seconds": 30 }
|
||||
},
|
||||
"maxEntitiesPerChunk": 5,
|
||||
"spawns": [
|
||||
{
|
||||
"entity": "standard/passive/frog",
|
||||
"maxSpawns": 3,
|
||||
"minSpawns": 1
|
||||
},
|
||||
{
|
||||
"entity": "standard/passive/tadpole",
|
||||
"maxSpawns": 3,
|
||||
"minSpawns": 1,
|
||||
"rarity": 2
|
||||
},
|
||||
{
|
||||
"entity": "standard/passive/tropicalfish",
|
||||
"maxSpawns": 3,
|
||||
"minSpawns": 1,
|
||||
"rarity": 2
|
||||
},
|
||||
{
|
||||
"entity": "standard/passive/turtle",
|
||||
"maxSpawns": 3,
|
||||
"minSpawns": 1,
|
||||
"rarity": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user