|
| 1 | +--- |
| 2 | +--- Advanced Peripherals tests for the Minecraft integration on Beacons |
| 3 | +--- Covers `getLevel`, `getPrimaryEffect`, `getSecondaryEffect` |
| 4 | +--- |
| 5 | + |
| 6 | +-- Wait until the beacon structure is formed |
| 7 | +sleep(4) |
| 8 | + |
| 9 | +-- Test left beacon, level 4, primary and secondary effect set to haste |
| 10 | +test.eq("beacon", peripheral.getType("left"), "Peripheral should be beacon") |
| 11 | +beacon = peripheral.wrap("left") |
| 12 | +test.assert(beacon, "Peripheral not found") |
| 13 | + |
| 14 | +test.eq(4, beacon.getLevel(), "Level should be 4") |
| 15 | +test.eq("effect.minecraft.haste", beacon.getPrimaryEffect(), "Primary effect should be haste") |
| 16 | +test.eq("effect.minecraft.haste", beacon.getSecondaryEffect(), "Secondary effect should be haste") |
| 17 | + |
| 18 | +-- Test right beacon, level 4, primary effect set to speed, secondary effect not set |
| 19 | +test.eq("beacon", peripheral.getType("right"), "Peripheral should be beacon") |
| 20 | +beacon = peripheral.wrap("right") |
| 21 | +test.assert(beacon, "Peripheral not found") |
| 22 | + |
| 23 | +test.eq(4, beacon.getLevel(), "Level should be 4") |
| 24 | +test.eq("effect.minecraft.speed", beacon.getPrimaryEffect(), "Primary effect should be haste") |
| 25 | +test.eq("none", beacon.getSecondaryEffect(), "Secondary effect should be none") |
| 26 | + |
| 27 | +-- Test top beacon, level 0, primary and secondary effect not set |
| 28 | +test.eq("beacon", peripheral.getType("top"), "Peripheral should be beacon") |
| 29 | +beacon = peripheral.wrap("top") |
| 30 | +test.assert(beacon, "Peripheral not found") |
| 31 | + |
| 32 | +test.eq(0, beacon.getLevel(), "Level should be 0") |
| 33 | +test.eq("none", beacon.getPrimaryEffect(), "Primary effect should be none") |
| 34 | +test.eq("none", beacon.getSecondaryEffect(), "Secondary effect should be none") |
0 commit comments