@@ -4,6 +4,46 @@ const expect = require('expect').default
4
4
5
5
// https://minecraft.gamepedia.com/Breaking#Blocks_by_hardness
6
6
describe ( 'Dig time' , ( ) => {
7
+ describe ( '1.20.5' , ( ) => {
8
+ const registry = require ( 'prismarine-registry' ) ( '1.20.5' )
9
+ const Block = require ( 'prismarine-block' ) ( registry )
10
+ it ( 'dig dirt (shovel faster than hand)' , ( ) => {
11
+ const dirt = Block . fromStateId ( registry . blocksByName . dirt . defaultState , 0 )
12
+ const shovel = registry . itemsByName . iron_shovel
13
+ const handTime = dirt . digTime ( null , false , false , false )
14
+ const shovelTime = dirt . digTime ( shovel . id , false , false , false )
15
+ expect ( shovelTime < handTime ) . toBeTruthy ( )
16
+ } )
17
+
18
+ it ( 'mine stone (pickaxe faster than hand)' , ( ) => {
19
+ const stone = Block . fromStateId ( registry . blocksByName . stone . defaultState , 0 )
20
+ const pickaxe = registry . itemsByName . iron_pickaxe
21
+ const handTime = stone . digTime ( null , false , false , false )
22
+ const pickaxeTime = stone . digTime ( pickaxe . id , false , false , false )
23
+ expect ( pickaxeTime < handTime ) . toBeTruthy ( )
24
+ } )
25
+ } )
26
+
27
+ describe ( '1.20.4' , ( ) => {
28
+ const registry = require ( 'prismarine-registry' ) ( '1.20.4' )
29
+ const Block = require ( 'prismarine-block' ) ( registry )
30
+ it ( 'dig dirt (shovel faster than hand)' , ( ) => {
31
+ const dirt = Block . fromStateId ( registry . blocksByName . dirt . defaultState , 0 )
32
+ const shovel = registry . itemsByName . iron_shovel
33
+ const handTime = dirt . digTime ( null , false , false , false )
34
+ const shovelTime = dirt . digTime ( shovel . id , false , false , false )
35
+ expect ( shovelTime < handTime ) . toBeTruthy ( )
36
+ } )
37
+
38
+ it ( 'mine stone (pickaxe faster than hand)' , ( ) => {
39
+ const stone = Block . fromStateId ( registry . blocksByName . stone . defaultState , 0 )
40
+ const pickaxe = registry . itemsByName . iron_pickaxe
41
+ const handTime = stone . digTime ( null , false , false , false )
42
+ const pickaxeTime = stone . digTime ( pickaxe . id , false , false , false )
43
+ expect ( pickaxeTime < handTime ) . toBeTruthy ( )
44
+ } )
45
+ } )
46
+
7
47
describe ( '1.15.2' , ( ) => {
8
48
const registry = require ( 'prismarine-registry' ) ( '1.15.2' )
9
49
const Block = require ( 'prismarine-block' ) ( registry )
0 commit comments