mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
Modded loot, drops, spawns, mobs and effects ask the modules through host-typed content services
This commit is contained in:
1 parent
f404dec7d7
commit
fbbc9ce4ac
24 files changed
+1178
-944
No files matched your search
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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.content;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* An ambient effect that plays now, in host terms: what {@code com.volmit.service.AmbientEffects.Effect} says. The
|
||||
* adapter carries out the parts it has, in the order sound, particles, commands, potion.
|
||||
*/
|
||||
public record ContentEffect(Sound sound, Particles particles, List<Command> commands, Potion potion) {
|
||||
/** A sound, with blocks offset from the player and the volume and pitch decided. */
|
||||
public record Sound(String key, int offsetX, int offsetY, int offsetZ, float volume, float pitch) {
|
||||
}
|
||||
|
||||
/** Particles {@code forward} blocks ahead of the player and {@code sideways} to the right, on the surface there. */
|
||||
public record Particles(String key, double forward, double sideways, double jitterX, double jitterZ, int lift, int count,
|
||||
double altX, double altY, double altZ, double extra) {
|
||||
}
|
||||
|
||||
/** Commands run offset from the player. */
|
||||
public record Command(ContentEntity.Command command, double offsetX, double offsetY, double offsetZ) {
|
||||
}
|
||||
|
||||
/** A potion effect for the player; one with a stronger amplifier already on the player stays. */
|
||||
public record Potion(String key, int strength, int ticks) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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.content;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* An entity a module decided on, in host terms: what {@code com.volmit.entity.EntitySpec} says, for adapters that cannot
|
||||
* name IrisApi types. Everything random was decided by the module; the adapter creates and configures the entity.
|
||||
*/
|
||||
public record ContentEntity(String type, String specialType, String reason, String customName, Flags flags, Equipment equipment,
|
||||
List<ContentEntity> passengers, List<ContentItem.Attribute> attributes, List<String> lootTables,
|
||||
long lootShuffleSeed, ContentEntity leashHolder, SpawnEffect spawnEffect, boolean riseOutOfGround,
|
||||
String pandaMainGene, String pandaHiddenGene, boolean applySettingsToSpecial,
|
||||
List<Command> commands) {
|
||||
/** Whether the entity is a mob of another plugin. */
|
||||
public boolean isSpecial() {
|
||||
return !specialType.isEmpty();
|
||||
}
|
||||
|
||||
/** What an entity can be set to be, whatever its kind. */
|
||||
public record Flags(boolean customNameVisible, boolean aware, boolean ai, boolean glowing, boolean gravity,
|
||||
boolean invulnerable, boolean silent, boolean pickupItems, boolean removable,
|
||||
boolean keepEntity, boolean baby) {
|
||||
}
|
||||
|
||||
/** The items an entity wears and holds; null for an empty slot. */
|
||||
public record Equipment(ContentItem helmet, ContentItem chestplate, ContentItem leggings, ContentItem boots,
|
||||
ContentItem mainHand, ContentItem offHand) {
|
||||
}
|
||||
|
||||
/** Sound and particles shown around an entity that appears; the adapter makes the random choices of the particle motion. */
|
||||
public record SpawnEffect(String sound, int soundDistance, double minPitch, double maxPitch, double volume,
|
||||
String particle, int particleOffset, int particleCount, double altX, double altY,
|
||||
double altZ, boolean randomAltX, boolean randomAltY, boolean randomAltZ, double extra) {
|
||||
}
|
||||
|
||||
/** Console commands run when an entity appears; {@code {x}}, {@code {y}} and {@code {z}} stand for its block position. */
|
||||
public record Command(List<String> commands, long delay, boolean repeat, long repeatDelay) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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.content;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* An item a module decided on, in host terms: what {@code com.volmit.item.ItemDrop} says, for adapters that cannot name
|
||||
* IrisApi types. The module made every random choice; the adapter only creates the item on its platform.
|
||||
*
|
||||
* @param damage the fraction of the item's durability already used, or null to leave it undamaged
|
||||
*/
|
||||
public record ContentItem(String item, int amount, String displayName, List<String> lore, List<Enchantment> enchantments,
|
||||
List<Attribute> attributes, boolean unbreakable, List<String> flags, Integer customModel,
|
||||
Double damage, String leatherColor, String dyeColor, Map<String, Object> customNbt) {
|
||||
/** An enchantment at the level the module decided. */
|
||||
public record Enchantment(String key, int level) {
|
||||
}
|
||||
|
||||
/** An attribute modifier with the amount the module decided. */
|
||||
public record Attribute(String attribute, String name, String operation, double amount) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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.content;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Where a container's items come from and what a broken block drops, in host terms. */
|
||||
public final class ContentLoot {
|
||||
private ContentLoot() {
|
||||
}
|
||||
|
||||
/** One source of a container's items, in the order their items are added. */
|
||||
public sealed interface Part permits Items, PlatformTable {
|
||||
}
|
||||
|
||||
/** Items a module drew from one of the pack's loot tables. */
|
||||
public record Items(List<ContentItem> items) implements Part {
|
||||
}
|
||||
|
||||
/** A loot table of the platform, which the adapter draws with {@code seed} so the same container always gets the same items. */
|
||||
public record PlatformTable(String key, long seed) implements Part {
|
||||
}
|
||||
|
||||
/**
|
||||
* What the modules drop for a broken block.
|
||||
*
|
||||
* @param replacesVanillaDrops whether the platform's own drops of the block are not dropped
|
||||
*/
|
||||
public record BlockDrops(List<ContentItem> drops, boolean replacesVanillaDrops) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* 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.content;
|
||||
|
||||
import art.arcane.iris.core.modules.ModuleServices;
|
||||
import art.arcane.iris.core.modules.PlatformBlockStates;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.entity.EntitySpec;
|
||||
import com.volmit.item.ItemAttribute;
|
||||
import com.volmit.item.ItemDrop;
|
||||
import com.volmit.item.ItemEnchantment;
|
||||
import com.volmit.service.AmbientEffects;
|
||||
import com.volmit.service.BlockDrops;
|
||||
import com.volmit.service.EntitySpawns;
|
||||
import com.volmit.service.Loot;
|
||||
import com.volmit.world.BlockPosition;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* What the pack's modules say about loot, block drops, spawns and ambient effects, for adapters that cannot name IrisApi
|
||||
* types: the questions take plain values and the answers are the host types of this package. The modded adapters, which
|
||||
* fill containers, drop blocks, spawn mobs and play effects themselves, ask here instead of reading the pack's classes.
|
||||
*/
|
||||
public final class ContentServices {
|
||||
private ContentServices() {
|
||||
}
|
||||
|
||||
/**
|
||||
* The sources of the loot of the container at {@code x}, {@code worldY}, {@code z}, in the order their items are added.
|
||||
*
|
||||
* @param containerKey the platform's key for the block when it is a storage chest an object may have given loot, else null
|
||||
*/
|
||||
public static List<ContentLoot.Part> containerLoot(Engine engine, int x, int worldY, int z, String containerKey, boolean nativeLootDefined) {
|
||||
BlockState container = containerKey == null ? null : BlockState.parse(PlatformBlockStates.namespaced(containerKey));
|
||||
Loot.Site site = new Loot.Site(position(engine, x, worldY, z), container, nativeLootDefined, false);
|
||||
List<ContentLoot.Part> parts = new ArrayList<>();
|
||||
for (Loot.Source source : ModuleServices.lootTables(engine, site)) {
|
||||
switch (source) {
|
||||
case Loot.Table table -> parts.add(new ContentLoot.Items(tableItems(engine, x, worldY, z, table.key())));
|
||||
case Loot.PlatformTable table -> parts.add(new ContentLoot.PlatformTable(table.key(), table.seed()));
|
||||
}
|
||||
}
|
||||
return parts;
|
||||
}
|
||||
|
||||
/** The items the pack's loot table {@code tableKey} gives at the spot. */
|
||||
public static List<ContentItem> tableItems(Engine engine, int x, int worldY, int z, String tableKey) {
|
||||
Loot.Site site = new Loot.Site(position(engine, x, worldY, z), null, false, false);
|
||||
return ModuleServices.lootItems(engine, site, tableKey).stream().map(ContentServices::itemOf).toList();
|
||||
}
|
||||
|
||||
/** What the modules drop for the block with the platform's key {@code blockKey} broken at the spot. */
|
||||
public static ContentLoot.BlockDrops blockDrops(Engine engine, int x, int worldY, int z, String blockKey) {
|
||||
BlockDrops.Result result = ModuleServices.blockDrops(engine, new BlockDrops.Broken(position(engine, x, worldY, z),
|
||||
BlockState.parse(PlatformBlockStates.namespaced(blockKey))));
|
||||
return new ContentLoot.BlockDrops(result.drops().stream().map(ContentServices::itemOf).toList(), result.replacesVanillaDrops());
|
||||
}
|
||||
|
||||
/** What the first module with something to spawn in the chunk plans. */
|
||||
public static Optional<ContentSpawns.Plan> planChunkSpawn(Engine engine, int chunkX, int chunkZ, int livingEntities, boolean initial) {
|
||||
return planned(engine, new EntitySpawns.Chunk(chunkX, chunkZ, livingEntities, initial));
|
||||
}
|
||||
|
||||
/** What the first module that knows the spawner plans at the marker block. */
|
||||
public static Optional<ContentSpawns.Plan> planMarkerSpawn(Engine engine, int x, int worldY, int z, String marker, String spawner, boolean initial) {
|
||||
return planned(engine, new EntitySpawns.Marker(position(engine, x, worldY, z), marker, spawner, initial));
|
||||
}
|
||||
|
||||
/** What the marker with the tag {@code tag} does; empty for a tag no module knows. */
|
||||
public static Optional<ContentSpawns.MarkerRule> markerRule(Engine engine, String tag) {
|
||||
return ModuleServices.markerRule(engine, tag)
|
||||
.map(rule -> new ContentSpawns.MarkerRule(rule.spawners(), rule.emptyAbove(), rule.removeOnChange()));
|
||||
}
|
||||
|
||||
/** The entity of the pack named {@code key} as a module would spawn it; empty for an unknown key. */
|
||||
public static Optional<ContentEntity> entity(Engine engine, String key) {
|
||||
return ModuleServices.entity(engine, key).map(ContentServices::entityOf);
|
||||
}
|
||||
|
||||
/** The ambient effects due for a player standing at the spot. */
|
||||
public static List<ContentEffect> ambientEffects(Engine engine, int x, int worldY, int z) {
|
||||
return ModuleServices.ambientEffects(engine, position(engine, x, worldY, z)).stream().map(ContentServices::effectOf).toList();
|
||||
}
|
||||
|
||||
private static Optional<ContentSpawns.Plan> planned(Engine engine, EntitySpawns.Site site) {
|
||||
return ModuleServices.planSpawn(engine, site).map(planned -> new ContentSpawns.Plan(planned, attemptsOf(engine, planned.plan())));
|
||||
}
|
||||
|
||||
private static List<ContentSpawns.Attempt> attemptsOf(Engine engine, EntitySpawns.Plan plan) {
|
||||
List<ContentSpawns.Attempt> attempts = new ArrayList<>();
|
||||
for (EntitySpawns.Attempt attempt : plan.attempts()) {
|
||||
attempts.add(new ContentSpawns.Attempt(attempt.at().x(), attempt.at().y() + engine.getMinHeight(), attempt.at().z(),
|
||||
entityOf(attempt.entity()), ContentSpawns.surfaceOf(attempt.surface()), attempt.minLight(), attempt.maxLight(),
|
||||
attempt.checkSurface()));
|
||||
}
|
||||
return attempts;
|
||||
}
|
||||
|
||||
private static BlockPosition position(Engine engine, int x, int worldY, int z) {
|
||||
return new BlockPosition(x, worldY - engine.getMinHeight(), z);
|
||||
}
|
||||
|
||||
private static ContentItem itemOf(ItemDrop drop) {
|
||||
return new ContentItem(drop.item(), drop.amount(), drop.displayName(), drop.lore(),
|
||||
drop.enchantments().stream().map(ContentServices::enchantmentOf).toList(),
|
||||
drop.attributes().stream().map(ContentServices::attributeOf).toList(), drop.unbreakable(), drop.flags(),
|
||||
drop.customModel(), drop.damage(), drop.leatherColor(), drop.dyeColor(), drop.customNbt());
|
||||
}
|
||||
|
||||
private static ContentItem.Enchantment enchantmentOf(ItemEnchantment enchantment) {
|
||||
return new ContentItem.Enchantment(enchantment.key(), enchantment.level());
|
||||
}
|
||||
|
||||
private static ContentItem.Attribute attributeOf(ItemAttribute attribute) {
|
||||
return new ContentItem.Attribute(attribute.attribute(), attribute.name(), attribute.operation(), attribute.amount());
|
||||
}
|
||||
|
||||
private static ContentEntity entityOf(EntitySpec spec) {
|
||||
return new ContentEntity(spec.type(), spec.specialType(), spec.reason(), spec.customName(), flagsOf(spec.flags()),
|
||||
equipmentOf(spec.equipment()), spec.passengers().stream().map(ContentServices::entityOf).toList(),
|
||||
spec.attributes().stream().map(ContentServices::attributeOf).toList(), spec.lootTables(), spec.lootShuffleSeed(),
|
||||
spec.leashHolder() == null ? null : entityOf(spec.leashHolder()), spawnEffectOf(spec.spawnEffect()),
|
||||
spec.riseOutOfGround(), spec.pandaMainGene(), spec.pandaHiddenGene(), spec.applySettingsToSpecial(),
|
||||
spec.commands().stream().map(ContentServices::commandOf).toList());
|
||||
}
|
||||
|
||||
private static ContentEntity.Flags flagsOf(EntitySpec.Flags flags) {
|
||||
return new ContentEntity.Flags(flags.customNameVisible(), flags.aware(), flags.ai(), flags.glowing(), flags.gravity(),
|
||||
flags.invulnerable(), flags.silent(), flags.pickupItems(), flags.removable(), flags.keepEntity(), flags.baby());
|
||||
}
|
||||
|
||||
private static ContentEntity.Equipment equipmentOf(EntitySpec.Equipment equipment) {
|
||||
return new ContentEntity.Equipment(optionalItem(equipment.helmet()), optionalItem(equipment.chestplate()),
|
||||
optionalItem(equipment.leggings()), optionalItem(equipment.boots()), optionalItem(equipment.mainHand()),
|
||||
optionalItem(equipment.offHand()));
|
||||
}
|
||||
|
||||
private static ContentItem optionalItem(ItemDrop drop) {
|
||||
return drop == null ? null : itemOf(drop);
|
||||
}
|
||||
|
||||
private static ContentEntity.SpawnEffect spawnEffectOf(EntitySpec.SpawnEffect effect) {
|
||||
if (effect == null) {
|
||||
return null;
|
||||
}
|
||||
return new ContentEntity.SpawnEffect(effect.sound(), effect.soundDistance(), effect.minPitch(), effect.maxPitch(),
|
||||
effect.volume(), effect.particle(), effect.particleOffset(), effect.particleCount(), effect.altX(), effect.altY(),
|
||||
effect.altZ(), effect.randomAltX(), effect.randomAltY(), effect.randomAltZ(), effect.extra());
|
||||
}
|
||||
|
||||
private static ContentEntity.Command commandOf(EntitySpec.Command command) {
|
||||
return new ContentEntity.Command(command.commands(), command.delay(), command.repeat(), command.repeatDelay());
|
||||
}
|
||||
|
||||
private static ContentEffect effectOf(AmbientEffects.Effect effect) {
|
||||
return new ContentEffect(soundOf(effect.sound()), particlesOf(effect.particles()),
|
||||
effect.commands().stream().map(command -> new ContentEffect.Command(commandOf(command.command()),
|
||||
command.offsetX(), command.offsetY(), command.offsetZ())).toList(),
|
||||
effect.potion() == null ? null : new ContentEffect.Potion(effect.potion().key(), effect.potion().strength(), effect.potion().ticks()));
|
||||
}
|
||||
|
||||
private static ContentEffect.Sound soundOf(AmbientEffects.Sound sound) {
|
||||
return sound == null ? null : new ContentEffect.Sound(sound.key(), sound.offsetX(), sound.offsetY(), sound.offsetZ(),
|
||||
sound.volume(), sound.pitch());
|
||||
}
|
||||
|
||||
private static ContentEffect.Particles particlesOf(AmbientEffects.Particles particles) {
|
||||
return particles == null ? null : new ContentEffect.Particles(particles.key(), particles.forward(), particles.sideways(),
|
||||
particles.jitterX(), particles.jitterZ(), particles.lift(), particles.count(), particles.altX(), particles.altY(),
|
||||
particles.altZ(), particles.extra());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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.content;
|
||||
|
||||
import art.arcane.iris.core.modules.ModuleServices;
|
||||
import com.volmit.service.EntitySpawns;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** What the modules plan to spawn, in host terms. */
|
||||
public final class ContentSpawns {
|
||||
private ContentSpawns() {
|
||||
}
|
||||
|
||||
/** The ground or fluid an entity spawns on. */
|
||||
public enum Surface {
|
||||
LAND, ANIMAL, WATER, OVERWORLD, LAVA
|
||||
}
|
||||
|
||||
/**
|
||||
* One entity to spawn at a block, if the light there lies in the range (when {@link #restrictsLight()}) and, when
|
||||
* {@code checkSurface}, the block below suits the entity's surface and the space it needs is free.
|
||||
*
|
||||
* @param x world X
|
||||
* @param worldY world Y
|
||||
* @param z world Z
|
||||
* @param checkSurface whether to check the surface and the free space
|
||||
*/
|
||||
public record Attempt(int x, int worldY, int z, ContentEntity entity, Surface surface, int minLight, int maxLight,
|
||||
boolean checkSurface) {
|
||||
/** Whether the light level matters. */
|
||||
public boolean restrictsLight() {
|
||||
return minLight > 0 || maxLight < 15;
|
||||
}
|
||||
}
|
||||
|
||||
/** What a marker does: the keys of its spawners, whether it needs free space above it and whether it goes away when its block changes. */
|
||||
public record MarkerRule(List<String> spawners, boolean emptyAbove, boolean removeOnChange) {
|
||||
}
|
||||
|
||||
/** Entities to spawn, tried one after the other; tell the plan how many appeared, so the spawner's rate limits count them. */
|
||||
public static final class Plan {
|
||||
private final ModuleServices.PlannedSpawn planned;
|
||||
private final List<Attempt> attempts;
|
||||
|
||||
Plan(ModuleServices.PlannedSpawn planned, List<Attempt> attempts) {
|
||||
this.planned = planned;
|
||||
this.attempts = List.copyOf(attempts);
|
||||
}
|
||||
|
||||
public List<Attempt> attempts() {
|
||||
return attempts;
|
||||
}
|
||||
|
||||
/** Whether the marker that led here is used up and should be removed. */
|
||||
public boolean exhaustsMarker() {
|
||||
return planned.plan().exhaustsMarker();
|
||||
}
|
||||
|
||||
/** Reports how many of the planned entities appeared. */
|
||||
public void spawned(int count) {
|
||||
planned.spawned(count);
|
||||
}
|
||||
}
|
||||
|
||||
static Surface surfaceOf(EntitySpawns.Surface surface) {
|
||||
return Surface.valueOf(surface.name());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* 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.pack;
|
||||
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
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.core.loader.IrisData;
|
||||
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;
|
||||
import art.arcane.volmlib.util.json.JSONObject;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/** An export carries the loot tables, spawners, entities and markers that the pack's settings and placements reference, and what those reference. */
|
||||
public class ModuleResourceClosureTest {
|
||||
@Rule
|
||||
public TemporaryFolder temporaryFolder = new TemporaryFolder();
|
||||
|
||||
@Test
|
||||
public void followsEveryLevelsSettingsAndThePlacementsThroughSpawnersEntitiesAndMarkers() throws Exception {
|
||||
IrisData data = IrisData.openValidation(pack().toFile());
|
||||
try {
|
||||
ModuleResourceClosure closure = new ModuleResourceClosure(data);
|
||||
IrisDimension dimension = data.getDimensionLoader().load("main");
|
||||
IrisRegion region = data.getRegionLoader().load("region");
|
||||
IrisBiome biome = data.getBiomeLoader().load("biome");
|
||||
|
||||
closure.followSettingsOf(dimension);
|
||||
closure.followSettingsOf(region);
|
||||
closure.followSettingsOf(biome);
|
||||
closure.follow(biome.getObjects());
|
||||
|
||||
assertEquals(List.of("drops", "global", "regional"), closure.keysOf(LootTable.class));
|
||||
assertEquals(List.of("camp/zombies", "cave", "marker/spawner"), closure.keysOf(Spawner.class));
|
||||
assertEquals(List.of("beta/sentinel", "cow", "zombie"), closure.keysOf(EntityDefinition.class));
|
||||
assertEquals(List.of("camp"), closure.keysOf(SpawnMarker.class));
|
||||
} finally {
|
||||
data.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whatIsNotReferencedIsNotExportedAndMissingKeysAreSkipped() throws Exception {
|
||||
IrisData data = IrisData.openValidation(pack().toFile());
|
||||
try {
|
||||
ModuleResourceClosure closure = new ModuleResourceClosure(data);
|
||||
|
||||
closure.followSettingsOf(data.getRegionLoader().load("region"));
|
||||
|
||||
assertEquals(List.of("regional"), closure.keysOf(LootTable.class));
|
||||
assertEquals(List.of(), closure.keysOf(Spawner.class));
|
||||
assertFalse(closure.keysOf(LootTable.class).contains("unused"));
|
||||
assertTrue(new ModuleResourceClosure(data).isEmpty());
|
||||
} finally {
|
||||
data.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void writesEachResourceUnderTheFolderOfItsKind() throws Exception {
|
||||
IrisData data = IrisData.openValidation(pack().toFile());
|
||||
try {
|
||||
ModuleResourceClosure closure = new ModuleResourceClosure(data);
|
||||
closure.followSettingsOf(data.getDimensionLoader().load("main"));
|
||||
File target = temporaryFolder.newFolder("export");
|
||||
|
||||
String hashes = closure.writeTo(target, true);
|
||||
|
||||
assertFalse(hashes.isEmpty());
|
||||
assertEquals("Global", new JSONObject(Files.readString(target.toPath().resolve("loot/global.json"))).getString("name"));
|
||||
assertTrue(Files.isRegularFile(target.toPath().resolve("spawners/camp/zombies.json")));
|
||||
assertTrue(Files.isRegularFile(target.toPath().resolve("entities/zombie.json")));
|
||||
assertFalse(Files.exists(target.toPath().resolve("loot/unused.json")));
|
||||
} finally {
|
||||
data.close();
|
||||
}
|
||||
}
|
||||
|
||||
private Path pack() throws Exception {
|
||||
File pack = temporaryFolder.newFolder("pack");
|
||||
write(pack, "dimensions/main.json", "{\"regions\":[\"region\"],\"loot\":{\"tables\":[\"global\"]},\"entitySpawners\":[\"camp/zombies\"]}");
|
||||
write(pack, "regions/region.json", "{\"landBiomes\":[\"biome\"],\"loot\":{\"tables\":[\"regional\"]}}");
|
||||
write(pack, "biomes/biome.json", "{\"name\":\"Biome\",\"entitySpawners\":[\"cave\"],\"blockDrops\":[{\"blocks\":[{\"block\":\"stone\"}],\"drops\":[{\"type\":\"gravel\"}]}],"
|
||||
+ "\"objects\":[{\"place\":[\"hut\"],\"loot\":[{\"name\":\"drops\"}],\"markers\":[{\"marker\":\"camp\",\"mark\":[{\"block\":\"stone\"}]}]}]}");
|
||||
write(pack, "loot/global.json", "{\"name\":\"Global\",\"loot\":[{\"type\":\"stick\"}]}");
|
||||
write(pack, "loot/regional.json", "{\"name\":\"Regional\",\"loot\":[{\"type\":\"stick\"}]}");
|
||||
write(pack, "loot/drops.json", "{\"name\":\"Drops\",\"loot\":[{\"type\":\"stick\"}]}");
|
||||
write(pack, "loot/unused.json", "{\"name\":\"Unused\",\"loot\":[{\"type\":\"stick\"}]}");
|
||||
write(pack, "spawners/camp/zombies.json", "{\"spawns\":[{\"entity\":\"zombie\"}],\"initialSpawns\":[{\"entity\":\"beta/sentinel\"}]}");
|
||||
write(pack, "spawners/cave.json", "{\"spawns\":[{\"entity\":\"cow\"}]}");
|
||||
write(pack, "spawners/marker/spawner.json", "{\"spawns\":[{\"entity\":\"cow\"}]}");
|
||||
write(pack, "entities/zombie.json", "{\"type\":\"minecraft:zombie\",\"loot\":{\"tables\":[\"drops\"]}}");
|
||||
write(pack, "entities/beta/sentinel.json", "{\"type\":\"minecraft:skeleton\"}");
|
||||
write(pack, "entities/cow.json", "{\"type\":\"minecraft:cow\"}");
|
||||
write(pack, "markers/camp.json", "{\"spawners\":[\"marker/spawner\"]}");
|
||||
return pack.toPath();
|
||||
}
|
||||
|
||||
private static void write(File root, String relative, String content) throws Exception {
|
||||
Path path = root.toPath().resolve(relative);
|
||||
Files.createDirectories(path.getParent());
|
||||
Files.writeString(path, content, StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
@@ -59,9 +59,9 @@ public class PackExportClosureTest {
|
||||
|
||||
String modded = Files.readString(Path.of(
|
||||
"../adapters/modded-common/src/main/java/art/arcane/iris/modded/command/ModdedStudioCommands.java")).replace("\r\n", "\n");
|
||||
assertTrue("modded packager must write spawners/", modded.contains("\"spawners\""));
|
||||
assertTrue("modded packager must write markers/", modded.contains("\"markers\""));
|
||||
assertTrue("modded packager must include initial spawns", modded.contains("getInitialSpawns"));
|
||||
assertTrue("modded packager must write the spawn and loot resources the settings reference",
|
||||
modded.contains("moduleResources.writeTo(folder, true)"));
|
||||
assertTrue("modded packager must export the placements' references", modded.contains("moduleResources.follow(region.getObjects())"));
|
||||
assertTrue("modded packager must export region objects", modded.contains("region.getObjects()"));
|
||||
int moddedValidation = modded.indexOf("PackValidator.validateForPackaging(packFolder)");
|
||||
assertTrue("modded packager must validate before mutating package state",
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* 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.engine.loot;
|
||||
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.modules.ModuleResourceFixture;
|
||||
import art.arcane.iris.engine.UsableBlockPlatform;
|
||||
import art.arcane.iris.engine.object.TestSettings;
|
||||
import art.arcane.iris.engine.object.loot.IObjectLoot;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.service.Loot;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* The loot table an object placement gives a chest: a table naming the chest's exact state beats one naming its kind of
|
||||
* block, which beats one naming no block; the weights pick among equals; platform tables count when the platform has them.
|
||||
*/
|
||||
public class PlacementLootTest {
|
||||
private static final String CHEST = "minecraft:chest[facing=north]";
|
||||
private static final String EAST_CHEST = "minecraft:chest[facing=east]";
|
||||
private static final long LOOT_SEED = 99L;
|
||||
|
||||
private PlacementLoot placement;
|
||||
|
||||
@BeforeClass
|
||||
public static void bindPlatform() {
|
||||
UsableBlockPlatform.bind();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void unbindPlatform() {
|
||||
UsableBlockPlatform.unbind();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void servePackTables() {
|
||||
IrisData data = mock(IrisData.class);
|
||||
ModuleResourceFixture fixture = ModuleResourceFixture.serve(data);
|
||||
for (String key : List.of("everywhere", "chests", "this-chest", "other")) {
|
||||
fixture.resource(LootResources.TABLES, key, TestSettings.of(LootTable.class, "{\"name\": \"" + key + "\"}"));
|
||||
}
|
||||
placement = new PlacementLoot(data, () -> Set.of("minecraft:chests/simple_dungeon"), LOOT_SEED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aTableThatNamesTheExactStateBeatsOneThatNamesTheKindOfBlock() {
|
||||
List<IObjectLoot> pack = List.of(entry("everywhere", 1, false), entry("chests", 1, false, CHEST), entry("this-chest", 1, true, CHEST));
|
||||
|
||||
assertEquals(new Loot.Table("this-chest"), pick(List.of(), pack, CHEST));
|
||||
assertEquals(new Loot.Table("chests"), pick(List.of(), pack, EAST_CHEST));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aTableThatNamesNoBlockServesChestsNothingElseNames() {
|
||||
List<IObjectLoot> pack = List.of(entry("everywhere", 1, false), entry("other", 1, false, "minecraft:barrel"));
|
||||
|
||||
assertEquals(new Loot.Table("everywhere"), pick(List.of(), pack, CHEST));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void exactEntriesDoNotApplyToOtherStatesAndNothingMatchingGivesNothing() {
|
||||
List<IObjectLoot> pack = List.of(entry("this-chest", 1, true, CHEST), entry("other", 1, false, "minecraft:barrel"));
|
||||
|
||||
assertNull(pick(List.of(), pack, EAST_CHEST));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void weightsPickAmongEqualsAndZeroWeightsAreIgnored() {
|
||||
List<IObjectLoot> pack = List.of(entry("everywhere", 3, false), entry("chests", 1, false), entry("other", 0, false));
|
||||
int everywhere = 0;
|
||||
RNG rng = new RNG(5L);
|
||||
|
||||
for (int i = 0; i < 4000; i++) {
|
||||
Loot.Source picked = placement.pick(List.of(), pack, block(CHEST), rng, 0, 64, 0);
|
||||
if (picked.equals(new Loot.Table("everywhere"))) {
|
||||
everywhere++;
|
||||
} else {
|
||||
assertEquals(new Loot.Table("chests"), picked);
|
||||
}
|
||||
}
|
||||
|
||||
assertEquals(3000, everywhere, 150);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aPlatformTableWithAnythingThePlatformHasIsASourceWithTheSeedOfItsIdentity() {
|
||||
List<IObjectLoot> platform = List.of(entry("chests/simple_dungeon", 1, false), entry("chests/missing", 1, false));
|
||||
|
||||
Loot.Source picked = pick(platform, List.of(), CHEST);
|
||||
|
||||
assertEquals(new Loot.PlatformTable("minecraft:chests/simple_dungeon",
|
||||
LootTables.seed(LOOT_SEED, "Vanilla minecraft:chests/simple_dungeon", 0, 64, 0)), picked);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tablesTheWorldLacksAreSkipped() {
|
||||
assertNull(pick(List.of(entry("chests/missing", 1, false)), List.of(entry("not-a-table", 1, false)), CHEST));
|
||||
}
|
||||
|
||||
private Loot.Source pick(List<IObjectLoot> platform, List<IObjectLoot> pack, String container) {
|
||||
return placement.pick(platform, pack, block(container), new RNG(1L), 0, 64, 0);
|
||||
}
|
||||
|
||||
private static PlatformBlockState block(String key) {
|
||||
return UsableBlockPlatform.block(key);
|
||||
}
|
||||
|
||||
private static IObjectLoot entry(String name, int weight, boolean exact, String... filter) {
|
||||
IObjectLoot loot = mock(IObjectLoot.class);
|
||||
when(loot.getName()).thenReturn(name);
|
||||
when(loot.getWeight()).thenReturn(weight);
|
||||
when(loot.isExact()).thenReturn(exact);
|
||||
KList<PlatformBlockState> filterStates = new KList<>();
|
||||
for (String key : filter) {
|
||||
filterStates.add(block(key));
|
||||
}
|
||||
when(loot.getFilter(org.mockito.ArgumentMatchers.any())).thenReturn(filterStates);
|
||||
return loot;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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.engine.loot;
|
||||
|
||||
import art.arcane.iris.builtin.loot.BlockDrop;
|
||||
import art.arcane.iris.engine.UsableBlockPlatform;
|
||||
import art.arcane.iris.engine.object.TestSettings;
|
||||
import com.volmit.block.BlockRegistry;
|
||||
import com.volmit.block.BlockSpec;
|
||||
import com.volmit.block.BlockState;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/** Which broken blocks a block drop applies to: the exact state it names, or any state of that block. */
|
||||
public class ResolvedBlockDropTest {
|
||||
private static final String NORTH_STAIRS = "minecraft:oak_stairs[facing=north]";
|
||||
private static final String EAST_STAIRS = "minecraft:oak_stairs[facing=east]";
|
||||
private static final String COBBLESTONE = "minecraft:cobblestone";
|
||||
|
||||
@BeforeClass
|
||||
public static void bindPlatform() {
|
||||
UsableBlockPlatform.bind();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void unbindPlatform() {
|
||||
UsableBlockPlatform.unbind();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void exactMatchingIncludesPropertiesWhileTypeMatchingDoesNot() {
|
||||
ResolvedBlockDrop exact = resolved(true);
|
||||
ResolvedBlockDrop byType = resolved(false);
|
||||
|
||||
assertTrue(exact.dropsFor(NORTH_STAIRS));
|
||||
assertFalse(exact.dropsFor(EAST_STAIRS));
|
||||
assertTrue(byType.dropsFor(NORTH_STAIRS));
|
||||
assertTrue(byType.dropsFor(EAST_STAIRS));
|
||||
assertFalse(byType.dropsFor(COBBLESTONE));
|
||||
assertFalse(exact.dropsFor(COBBLESTONE));
|
||||
}
|
||||
|
||||
private static ResolvedBlockDrop resolved(boolean exactBlocks) {
|
||||
BlockDrop drop = TestSettings.of(BlockDrop.class, "{\"exactBlocks\": " + exactBlocks + ", \"blocks\": [{\"block\": \"oak_stairs\"}]}");
|
||||
BlockRegistry blocks = mock(BlockRegistry.class);
|
||||
when(blocks.resolve(any(BlockSpec.class))).thenReturn(BlockState.parse(NORTH_STAIRS));
|
||||
return ResolvedBlockDrop.of(drop, blocks);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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.engine.object.value;
|
||||
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/** Rarity weights a pool exactly once: the entity spawners of both platforms pick a spawn from the expanded pool. */
|
||||
public class IRareWeightingTest {
|
||||
private record Spawn(int rarity) implements IRare {
|
||||
@Override
|
||||
public int getRarity() {
|
||||
return rarity;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rarityIsAppliedOnceAsPoolWeightOnly() {
|
||||
Spawn common = new Spawn(1);
|
||||
Spawn rare = new Spawn(4);
|
||||
|
||||
KList<Spawn> expanded = IRare.expandWeighted(List.of(common, rare));
|
||||
|
||||
// totalRarity 5 -> common appears 5/1 = 5 times, rare 5/4 = 1 time.
|
||||
assertEquals(6, expanded.size());
|
||||
assertEquals(5, expanded.stream().filter(entry -> entry == common).count());
|
||||
assertEquals(1, expanded.stream().filter(entry -> entry == rare).count());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rarityZeroAndNegativeAreClampedToOne() {
|
||||
assertEquals(1, IRare.get(new Spawn(0)));
|
||||
assertEquals(1, IRare.get(new Spawn(-5)));
|
||||
assertEquals(3, IRare.get(new Spawn(3)));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user