mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-23 00:28:02 +00:00
Fixes
This commit is contained in:
1 parent
e8dd4e1127
commit
0193f75daa
21 files changed
+272
-180
No files matched your search
-48
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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.structure;
|
||||
|
||||
import art.arcane.iris.engine.object.IrisImportedStructureControl;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class NativeStructureLocateCapabilityTest {
|
||||
@Test
|
||||
public void monumentLocateIsUnavailableWithoutChangingGenerationPolicy() {
|
||||
assertTrue(NativeStructureLocateCapability.isPaperUnavailable("minecraft:monument"));
|
||||
assertTrue(NativeStructureLocateCapability.isPaperUnavailable(" MINECRAFT:MONUMENT "));
|
||||
assertTrue(new IrisImportedStructureControl().shouldGenerate("minecraft:monument"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void otherStructuresRemainLocatable() {
|
||||
assertFalse(NativeStructureLocateCapability.isPaperUnavailable(null));
|
||||
assertFalse(NativeStructureLocateCapability.isPaperUnavailable(""));
|
||||
assertFalse(NativeStructureLocateCapability.isPaperUnavailable("minecraft:stronghold"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void messageStatesThatGenerationRemainsEnabled() {
|
||||
String message = NativeStructureLocateCapability.unavailableMessage().toLowerCase();
|
||||
assertTrue(message.contains("generation is enabled"));
|
||||
assertTrue(message.contains("locat"));
|
||||
}
|
||||
}
|
||||
+12
@@ -41,6 +41,18 @@ public class IrisStructureComponentMarkerTest {
|
||||
assertNotEquals(first, moved);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void treeCollisionUsesOnlyNonAirStructureBlocks() {
|
||||
PlatformBlockState solid = mock(PlatformBlockState.class);
|
||||
PlatformBlockState air = mock(PlatformBlockState.class);
|
||||
when(solid.isAir()).thenReturn(false);
|
||||
when(air.isAir()).thenReturn(true);
|
||||
|
||||
assertTrue(IrisStructureComponent.isOccupiedStructureState(solid));
|
||||
assertFalse(IrisStructureComponent.isOccupiedStructureState(air));
|
||||
assertFalse(IrisStructureComponent.isOccupiedStructureState(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void emptyResolvedPiecesRemainSkippableForNonReplacement() {
|
||||
IrisStructureLocator.ResolvedPlacement resolved = resolvedPlacement(
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class IrisBiomeStructureDerivativeTest {
|
||||
@Test
|
||||
public void seaBiomeRejectsLandOnlyVanillaDerivativeForStructures() {
|
||||
IrisBiome biome = new IrisBiome()
|
||||
.setDerivative("minecraft:warm_ocean")
|
||||
.setVanillaDerivative("minecraft:desert")
|
||||
.setInferredType(InferredType.SEA);
|
||||
|
||||
assertEquals("minecraft:desert", biome.getVanillaDerivativeKey());
|
||||
assertEquals("minecraft:the_void", biome.getStructureDerivativeKey());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shoreBiomeRejectsLandOnlyVanillaDerivativeForStructures() {
|
||||
IrisBiome biome = new IrisBiome()
|
||||
.setDerivative("minecraft:warm_ocean")
|
||||
.setVanillaDerivative("minecraft:savanna")
|
||||
.setInferredType(InferredType.SHORE);
|
||||
|
||||
assertEquals("minecraft:beach", biome.getStructureDerivativeKey());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void waterStructureDerivativesKeepTheirExactVariant() {
|
||||
IrisBiome deepOcean = new IrisBiome()
|
||||
.setVanillaDerivative("minecraft:deep_cold_ocean")
|
||||
.setInferredType(InferredType.SEA);
|
||||
IrisBiome snowyBeach = new IrisBiome()
|
||||
.setVanillaDerivative("minecraft:snowy_beach")
|
||||
.setInferredType(InferredType.SHORE);
|
||||
|
||||
assertEquals("minecraft:deep_cold_ocean", deepOcean.getStructureDerivativeKey());
|
||||
assertEquals("minecraft:snowy_beach", snowyBeach.getStructureDerivativeKey());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void seaAndShoreDoNotBorrowEachOthersStructureBiomes() {
|
||||
IrisBiome seaBeach = new IrisBiome()
|
||||
.setVanillaDerivative("minecraft:beach")
|
||||
.setInferredType(InferredType.SEA);
|
||||
IrisBiome shoreOcean = new IrisBiome()
|
||||
.setVanillaDerivative("minecraft:ocean")
|
||||
.setInferredType(InferredType.SHORE);
|
||||
|
||||
assertEquals("minecraft:the_void", seaBeach.getStructureDerivativeKey());
|
||||
assertEquals("minecraft:beach", shoreOcean.getStructureDerivativeKey());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void landAndModdedDerivativesRemainAuthoritative() {
|
||||
IrisBiome land = new IrisBiome()
|
||||
.setVanillaDerivative("minecraft:desert")
|
||||
.setInferredType(InferredType.LAND);
|
||||
IrisBiome moddedSea = new IrisBiome()
|
||||
.setVanillaDerivative("example:abyss")
|
||||
.setInferredType(InferredType.SEA);
|
||||
|
||||
assertEquals("minecraft:desert", land.getStructureDerivativeKey());
|
||||
assertEquals("example:abyss", moddedSea.getStructureDerivativeKey());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user