@@ -407,13 +407,27 @@ var WorldRegion = /** @class */ (function () {
407407 }
408408 } ;
409409 WorldRegion . prototype . breakBlockForResult = function ( x , y , z , player , item ) {
410- if ( typeof x === "number" ) {
410+ if ( typeof x === "object" ) {
411+ var pos = x ;
412+ player = y ;
413+ item = z ;
414+ return this . breakBlockForResult ( pos . x , pos . y , pos . z , player , item ) ;
415+ }
416+ if ( BlockEngine . getMainGameVersion ( ) >= 16 ) {
411417 return this . blockSource . breakBlockForJsResult ( x , y , z , player , item ) ;
412418 }
413- var pos = x ;
414- player = y ;
415- item = z ;
416- return this . blockSource . breakBlockForJsResult ( pos . x , pos . y , pos . z , player , item ) ;
419+ var block = this . blockSource . getBlock ( x , y , z ) ;
420+ this . blockSource . setBlock ( x , y , z , 0 , 0 ) ;
421+ var level = ToolAPI . getToolLevelViaBlock ( item . id , block . id ) ;
422+ var drop = BlockRegistry . getBlockDrop ( x , y , z , block , level , item , this . blockSource ) ;
423+ var items = [ ] ;
424+ if ( drop ) {
425+ for ( var _i = 0 , drop_2 = drop ; _i < drop_2 . length ; _i ++ ) {
426+ var item_1 = drop_2 [ _i ] ;
427+ items . push ( new ItemStack ( item_1 [ 0 ] , item_1 [ 1 ] , item_1 [ 2 ] , item_1 [ 3 ] ) ) ;
428+ }
429+ }
430+ return { items : items , experience : 0 } ;
417431 } ;
418432 WorldRegion . prototype . getNativeTileEntity = function ( x , y , z ) {
419433 if ( typeof x === "number" ) {
@@ -1082,9 +1096,9 @@ var BlockRegistry;
10821096 var item = new ItemStack ( ) ;
10831097 //@ts -ignore
10841098 var drop = dropFunc ( coords , block . id , block . data , 127 , enchant , item , region ) ;
1085- for ( var _i = 0 , drop_2 = drop ; _i < drop_2 . length ; _i ++ ) {
1086- var item_1 = drop_2 [ _i ] ;
1087- region . spawnDroppedItem ( coords . x + .5 , coords . y + .5 , coords . z + .5 , item_1 [ 0 ] , item_1 [ 1 ] , item_1 [ 2 ] , item_1 [ 3 ] || null ) ;
1099+ for ( var _i = 0 , drop_3 = drop ; _i < drop_3 . length ; _i ++ ) {
1100+ var item_2 = drop_3 [ _i ] ;
1101+ region . spawnDroppedItem ( coords . x + .5 , coords . y + .5 , coords . z + .5 , item_2 [ 0 ] , item_2 [ 1 ] , item_2 [ 2 ] , item_2 [ 3 ] || null ) ;
10881102 }
10891103 } ) ;
10901104 }
@@ -1160,8 +1174,8 @@ var BlockRegistry;
11601174 if ( id == VanillaTileID . campfire ) {
11611175 if ( enchant . silk )
11621176 return [ [ id , 1 , 0 ] ] ;
1163- var item_2 = IDConverter . getIDData ( "charcoal" ) ;
1164- return [ [ item_2 . id , 1 , item_2 . data ] ] ;
1177+ var item_3 = IDConverter . getIDData ( "charcoal" ) ;
1178+ return [ [ item_3 . id , 1 , item_3 . data ] ] ;
11651179 }
11661180 if ( id == VanillaTileID . soul_campfire ) {
11671181 if ( enchant . silk )
@@ -1482,7 +1496,7 @@ var ItemArmor = /** @class */ (function (_super) {
14821496 texture : _this . texture ,
14831497 isTech : true
14841498 } ) ;
1485- _this . inCreative = inCreative ;
1499+ _this . setCategory ( ItemCategory . EQUIPMENT ) ;
14861500 if ( params . material )
14871501 _this . setMaterial ( params . material ) ;
14881502 if ( inCreative )
@@ -1826,7 +1840,7 @@ var ItemRegistry;
18261840 }
18271841 ItemRegistry . registerItemFuncs = registerItemFuncs ;
18281842 function createItem ( stringID , params ) {
1829- var item = getInstanceOf ( stringID ) ;
1843+ var item ;
18301844 if ( params . type == "food" ) {
18311845 item = new ItemFood ( stringID , params . name , params . icon , params . food , params . inCreative ) ;
18321846 }
0 commit comments