|
| 1 | +test "dusting progress" when running minecraft "1.20": |
| 2 | + set {_old} to block data of test-block |
| 3 | + set block at test-block to suspicious gravel |
| 4 | + set {_block} to block at test-block |
| 5 | + set {_blockdata} to block data of {_block} |
| 6 | + |
| 7 | + # test getting initial value |
| 8 | + assert dusting progress of {_block} is 0 with "Initial dusting progress should be 0" |
| 9 | + |
| 10 | + # test setting |
| 11 | + set dusting progress of {_block} to 2 |
| 12 | + assert dusting progress of {_block} is 2 with "Failed to set dusting progress to 2" |
| 13 | + |
| 14 | + # test max dusting progress |
| 15 | + assert max dusting progress of {_block} is 3 with "Max dusting progress should be 3" |
| 16 | + assert maximum dusting progress of {_block} is 3 with "Maximum dusting progress should be 3" |
| 17 | + |
| 18 | + # test adding |
| 19 | + set dusting progress of {_block} to 1 |
| 20 | + add 1 to dusting progress of {_block} |
| 21 | + assert dusting progress of {_block} is 2 with "Failed to add 1 to dusting progress" |
| 22 | + |
| 23 | + # test clamping at max |
| 24 | + add 99 to dusting progress of {_block} |
| 25 | + assert dusting progress of {_block} is 3 with "Dusting progress should be clamped at max" |
| 26 | + |
| 27 | + # test removing |
| 28 | + set dusting progress of {_block} to 2 |
| 29 | + remove 1 from dusting progress of {_block} |
| 30 | + assert dusting progress of {_block} is 1 with "Failed to remove 1 from dusting progress" |
| 31 | + |
| 32 | + # test clamping at min |
| 33 | + remove 99 from dusting progress of {_block} |
| 34 | + assert dusting progress of {_block} is 0 with "Dusting progress should be clamped at 0" |
| 35 | + |
| 36 | + # test reset |
| 37 | + set dusting progress of {_block} to 2 |
| 38 | + assert dusting progress of {_block} is 2 with "Failed to set dusting progress" |
| 39 | + reset dusting progress of {_block} |
| 40 | + assert dusting progress of {_block} is 0 with "Failed to reset dusting progress" |
| 41 | + |
| 42 | + # test with blockdata |
| 43 | + set dusting progress of {_blockdata} to 2 |
| 44 | + assert dusting progress of {_blockdata} is 2 with "Failed to set dusting progress on blockdata" |
| 45 | + |
| 46 | + # test alternative syntax (excavation) |
| 47 | + set block at test-block to suspicious sand |
| 48 | + set {_sand} to block at test-block |
| 49 | + set excavation progress of {_sand} to 1 |
| 50 | + assert excavation progress of {_sand} is 1 with "Failed to set excavation progress" |
| 51 | + assert max excavation progress of {_sand} is 3 with "Max excavation progress should be 3" |
| 52 | + |
| 53 | + set block data of test-block to {_old} |
0 commit comments