Skip to content

Commit 77df4d0

Browse files
committed
Add test for Mana Pools in the Botania Mod Integration
1 parent 0b31b09 commit 77df4d0

File tree

3 files changed

+185
-0
lines changed

3 files changed

+185
-0
lines changed

src/testMod/kotlin/de/srendi/advancedperipherals/test/ModIntegrTest.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@ class ModIntegrTest {
1414
thenComputerOk();
1515
}
1616

17+
@GameTest
18+
fun botaniaManaPool(context: GameTestHelper) = context.sequence {
19+
thenComputerOk();
20+
}
21+
1722
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
--- Advanced Peripherals tests for the Botania integration on Mana Pools
3+
--- Covers `getMana`, `getMaxMana`, `getManaNeeded`,
4+
--- `isEmpty`, `isFull`
5+
---
6+
7+
-- TODO Add tests for canChargeItem, hasItems and getItems in 1.20.1 AP versions
8+
9+
-- Test Fabulous Mana Pool (should be empty)
10+
test.eq("manaPool", peripheral.getType("left"), "Peripheral should be manaPool")
11+
fabulous = peripheral.wrap("left")
12+
test.assert(fabulous, "Peripheral not found")
13+
14+
test.eq(0, fabulous.getMana(), "Mana should be 0")
15+
test.eq(1000000, fabulous.getMaxMana(), "Max mana should be 1000000")
16+
test.eq(1000000, fabulous.getManaNeeded(), "Mana needed should be 1000000")
17+
-- test.assert(fabulous.isEmpty(), "Mana pool should be empty") TODO method currently not implemented
18+
test.assert(not fabulous.isFull(), "Mana pool should not be full")
19+
20+
-- Test Mana Pool (should have 36000 mana)
21+
test.eq("manaPool", peripheral.getType("right"), "Peripheral should be manaPool")
22+
manaPool = peripheral.wrap("right")
23+
test.assert(manaPool, "Peripheral not found")
24+
25+
test.eq(36000, manaPool.getMana(), "Mana should be 36000")
26+
test.eq(1000000, manaPool.getMaxMana(), "Max mana should be 1000000")
27+
test.eq(964000, manaPool.getManaNeeded(), "Mana needed should be 964000")
28+
-- test.assert(not manaPool.isEmpty(), "Mana pool should not be empty") TODO method currently not implemented
29+
test.assert(not manaPool.isFull(), "Mana pool should not be full")
30+
31+
-- Test Creative Mana Pool (should have 1000000 mana)
32+
test.eq("manaPool", peripheral.getType("back"), "Peripheral should be manaPool")
33+
creative = peripheral.wrap("back")
34+
test.assert(creative, "Peripheral not found")
35+
36+
test.eq(1000000, creative.getMana(), "Mana should be 1000000")
37+
test.eq(1000000, creative.getMaxMana(), "Max mana should be 1000000")
38+
test.eq(0, creative.getManaNeeded(), "Mana needed should be 0")
39+
-- test.assert(not creative.isEmpty(), "Mana pool should not be empty") TODO method currently not implemented
40+
test.assert(creative.isFull(), "Mana pool should be full")
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
DataVersion: 3120,
3+
size: [5, 5, 5],
4+
data: [
5+
{pos: [0, 0, 0], state: "minecraft:polished_andesite"},
6+
{pos: [0, 0, 1], state: "minecraft:polished_andesite"},
7+
{pos: [0, 0, 2], state: "minecraft:polished_andesite"},
8+
{pos: [0, 0, 3], state: "minecraft:polished_andesite"},
9+
{pos: [0, 0, 4], state: "minecraft:polished_andesite"},
10+
{pos: [1, 0, 0], state: "minecraft:polished_andesite"},
11+
{pos: [1, 0, 1], state: "minecraft:polished_andesite"},
12+
{pos: [1, 0, 2], state: "minecraft:polished_andesite"},
13+
{pos: [1, 0, 3], state: "minecraft:polished_andesite"},
14+
{pos: [1, 0, 4], state: "minecraft:polished_andesite"},
15+
{pos: [2, 0, 0], state: "minecraft:polished_andesite"},
16+
{pos: [2, 0, 1], state: "minecraft:polished_andesite"},
17+
{pos: [2, 0, 2], state: "minecraft:polished_andesite"},
18+
{pos: [2, 0, 3], state: "minecraft:polished_andesite"},
19+
{pos: [2, 0, 4], state: "minecraft:polished_andesite"},
20+
{pos: [3, 0, 0], state: "minecraft:polished_andesite"},
21+
{pos: [3, 0, 1], state: "minecraft:polished_andesite"},
22+
{pos: [3, 0, 2], state: "minecraft:polished_andesite"},
23+
{pos: [3, 0, 3], state: "minecraft:polished_andesite"},
24+
{pos: [3, 0, 4], state: "minecraft:polished_andesite"},
25+
{pos: [4, 0, 0], state: "minecraft:polished_andesite"},
26+
{pos: [4, 0, 1], state: "minecraft:polished_andesite"},
27+
{pos: [4, 0, 2], state: "minecraft:polished_andesite"},
28+
{pos: [4, 0, 3], state: "minecraft:polished_andesite"},
29+
{pos: [4, 0, 4], state: "minecraft:polished_andesite"},
30+
{pos: [0, 1, 0], state: "minecraft:air"},
31+
{pos: [0, 1, 1], state: "minecraft:air"},
32+
{pos: [0, 1, 2], state: "minecraft:air"},
33+
{pos: [0, 1, 3], state: "minecraft:air"},
34+
{pos: [0, 1, 4], state: "minecraft:air"},
35+
{pos: [1, 1, 0], state: "minecraft:air"},
36+
{pos: [1, 1, 1], state: "minecraft:air"},
37+
{pos: [1, 1, 2], state: "minecraft:air"},
38+
{pos: [1, 1, 3], state: "minecraft:air"},
39+
{pos: [1, 1, 4], state: "minecraft:air"},
40+
{pos: [2, 1, 0], state: "minecraft:air"},
41+
{pos: [2, 1, 1], state: "botania:fabulous_pool{color:none,waterlogged:false}", nbt: {ForgeCaps: {}, canAccept: 1b, canSpare: 1b, id: "botania:mana_pool", inputKey: "", mana: 0, manaCap: 1000000, outputKey: "", outputting: 0b}},
42+
{pos: [2, 1, 2], state: "computercraft:computer_advanced{facing:west,state:blinking}", nbt: {ComputerId: 0, ForgeCaps: {}, Label: "modintegrtest.botaniamanapool", On: 1b, id: "computercraft:computer_advanced"}},
43+
{pos: [2, 1, 3], state: "botania:mana_pool{color:none,waterlogged:false}", nbt: {ForgeCaps: {}, canAccept: 1b, canSpare: 1b, id: "botania:mana_pool", inputKey: "", mana: 36000, manaCap: 1000000, outputKey: "", outputting: 0b}},
44+
{pos: [2, 1, 4], state: "minecraft:air"},
45+
{pos: [3, 1, 0], state: "minecraft:air"},
46+
{pos: [3, 1, 1], state: "minecraft:air"},
47+
{pos: [3, 1, 2], state: "botania:creative_pool{color:none,waterlogged:false}", nbt: {ForgeCaps: {}, canAccept: 1b, canSpare: 1b, id: "botania:mana_pool", inputKey: "", mana: 1000000, manaCap: 1000000, outputKey: "", outputting: 1b}},
48+
{pos: [3, 1, 3], state: "minecraft:air"},
49+
{pos: [3, 1, 4], state: "minecraft:air"},
50+
{pos: [4, 1, 0], state: "minecraft:air"},
51+
{pos: [4, 1, 1], state: "minecraft:air"},
52+
{pos: [4, 1, 2], state: "minecraft:air"},
53+
{pos: [4, 1, 3], state: "minecraft:air"},
54+
{pos: [4, 1, 4], state: "minecraft:air"},
55+
{pos: [0, 2, 0], state: "minecraft:air"},
56+
{pos: [0, 2, 1], state: "minecraft:air"},
57+
{pos: [0, 2, 2], state: "minecraft:air"},
58+
{pos: [0, 2, 3], state: "minecraft:air"},
59+
{pos: [0, 2, 4], state: "minecraft:air"},
60+
{pos: [1, 2, 0], state: "minecraft:air"},
61+
{pos: [1, 2, 1], state: "minecraft:air"},
62+
{pos: [1, 2, 2], state: "minecraft:air"},
63+
{pos: [1, 2, 3], state: "minecraft:air"},
64+
{pos: [1, 2, 4], state: "minecraft:air"},
65+
{pos: [2, 2, 0], state: "minecraft:air"},
66+
{pos: [2, 2, 1], state: "minecraft:air"},
67+
{pos: [2, 2, 2], state: "minecraft:air"},
68+
{pos: [2, 2, 3], state: "minecraft:air"},
69+
{pos: [2, 2, 4], state: "minecraft:air"},
70+
{pos: [3, 2, 0], state: "minecraft:air"},
71+
{pos: [3, 2, 1], state: "minecraft:air"},
72+
{pos: [3, 2, 2], state: "minecraft:air"},
73+
{pos: [3, 2, 3], state: "minecraft:air"},
74+
{pos: [3, 2, 4], state: "minecraft:air"},
75+
{pos: [4, 2, 0], state: "minecraft:air"},
76+
{pos: [4, 2, 1], state: "minecraft:air"},
77+
{pos: [4, 2, 2], state: "minecraft:air"},
78+
{pos: [4, 2, 3], state: "minecraft:air"},
79+
{pos: [4, 2, 4], state: "minecraft:air"},
80+
{pos: [0, 3, 0], state: "minecraft:air"},
81+
{pos: [0, 3, 1], state: "minecraft:air"},
82+
{pos: [0, 3, 2], state: "minecraft:air"},
83+
{pos: [0, 3, 3], state: "minecraft:air"},
84+
{pos: [0, 3, 4], state: "minecraft:air"},
85+
{pos: [1, 3, 0], state: "minecraft:air"},
86+
{pos: [1, 3, 1], state: "minecraft:air"},
87+
{pos: [1, 3, 2], state: "minecraft:air"},
88+
{pos: [1, 3, 3], state: "minecraft:air"},
89+
{pos: [1, 3, 4], state: "minecraft:air"},
90+
{pos: [2, 3, 0], state: "minecraft:air"},
91+
{pos: [2, 3, 1], state: "minecraft:air"},
92+
{pos: [2, 3, 2], state: "minecraft:air"},
93+
{pos: [2, 3, 3], state: "minecraft:air"},
94+
{pos: [2, 3, 4], state: "minecraft:air"},
95+
{pos: [3, 3, 0], state: "minecraft:air"},
96+
{pos: [3, 3, 1], state: "minecraft:air"},
97+
{pos: [3, 3, 2], state: "minecraft:air"},
98+
{pos: [3, 3, 3], state: "minecraft:air"},
99+
{pos: [3, 3, 4], state: "minecraft:air"},
100+
{pos: [4, 3, 0], state: "minecraft:air"},
101+
{pos: [4, 3, 1], state: "minecraft:air"},
102+
{pos: [4, 3, 2], state: "minecraft:air"},
103+
{pos: [4, 3, 3], state: "minecraft:air"},
104+
{pos: [4, 3, 4], state: "minecraft:air"},
105+
{pos: [0, 4, 0], state: "minecraft:air"},
106+
{pos: [0, 4, 1], state: "minecraft:air"},
107+
{pos: [0, 4, 2], state: "minecraft:air"},
108+
{pos: [0, 4, 3], state: "minecraft:air"},
109+
{pos: [0, 4, 4], state: "minecraft:air"},
110+
{pos: [1, 4, 0], state: "minecraft:air"},
111+
{pos: [1, 4, 1], state: "minecraft:air"},
112+
{pos: [1, 4, 2], state: "minecraft:air"},
113+
{pos: [1, 4, 3], state: "minecraft:air"},
114+
{pos: [1, 4, 4], state: "minecraft:air"},
115+
{pos: [2, 4, 0], state: "minecraft:air"},
116+
{pos: [2, 4, 1], state: "minecraft:air"},
117+
{pos: [2, 4, 2], state: "minecraft:air"},
118+
{pos: [2, 4, 3], state: "minecraft:air"},
119+
{pos: [2, 4, 4], state: "minecraft:air"},
120+
{pos: [3, 4, 0], state: "minecraft:air"},
121+
{pos: [3, 4, 1], state: "minecraft:air"},
122+
{pos: [3, 4, 2], state: "minecraft:air"},
123+
{pos: [3, 4, 3], state: "minecraft:air"},
124+
{pos: [3, 4, 4], state: "minecraft:air"},
125+
{pos: [4, 4, 0], state: "minecraft:air"},
126+
{pos: [4, 4, 1], state: "minecraft:air"},
127+
{pos: [4, 4, 2], state: "minecraft:air"},
128+
{pos: [4, 4, 3], state: "minecraft:air"},
129+
{pos: [4, 4, 4], state: "minecraft:air"}
130+
],
131+
entities: [],
132+
palette: [
133+
"minecraft:polished_andesite",
134+
"minecraft:air",
135+
"botania:fabulous_pool{color:none,waterlogged:false}",
136+
"computercraft:computer_advanced{facing:west,state:blinking}",
137+
"botania:mana_pool{color:none,waterlogged:false}",
138+
"botania:creative_pool{color:none,waterlogged:false}"
139+
]
140+
}

0 commit comments

Comments
 (0)