mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-29 09:15:27 +00:00
Write typed markers with an exhaustive switch; drop MantleMarkerTypes
The marker ids no longer need a copy in core or a test keeping it equal to the module's.
This commit is contained in:
1 parent
0c2aefef20
commit
7bc9f21f50
3 files changed
+4
-89
No files matched your search
@@ -1,31 +0,0 @@
|
||||
package art.arcane.iris.core.modules;
|
||||
|
||||
import art.arcane.iris.builtin.blocks.ObjectMarkers;
|
||||
import com.volmit.geometry.BlockPosition;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThrows;
|
||||
|
||||
/** Iris keeps the marker ids the built-in modules mark with, without reading their classes. */
|
||||
public class MantleMarkerTypesTest {
|
||||
private static final BlockPosition SPOT = new BlockPosition(1, 2, 3);
|
||||
|
||||
@Test
|
||||
public void theTypesAreTheOnesTheBuiltInModulesMarkWith() {
|
||||
assertEquals(ObjectMarkers.TYPE, MantleMarkerTypes.PACK_MARKER);
|
||||
assertEquals(ObjectMarkers.MARKER_ATTRIBUTE, MantleMarkerTypes.PACK_MARKER_NAME);
|
||||
assertEquals(ObjectMarkers.TREE_MATERIAL, MantleMarkerTypes.TREE_MATERIAL);
|
||||
assertEquals(ObjectMarkers.BURIED_TREASURE, MantleMarkerTypes.BURIED_TREASURE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aPackMarkerGivesItsName() {
|
||||
assertEquals("spawn/zombie", MantleMarkerTypes.packMarkerName(ObjectMarkers.of(SPOT, "spawn/zombie")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aMarkerOfAnotherTypeIsRejected() {
|
||||
assertThrows(IllegalArgumentException.class, () -> MantleMarkerTypes.packMarkerName(ObjectMarkers.treeMaterial(SPOT)));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user