File tree Expand file tree Collapse file tree
src/main/js/modules/drone Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -345,11 +345,21 @@ function makeTypeIdAndDataSetter() {
345345 block . setTypeIdAndData ( typeId , data , applyPhysics ) ;
346346 } ;
347347 } else {
348- console . log ( 'Drone using CraftEvil.setTypeIdAndData method' ) ;
349- var CraftEvil = Java . type ( server . class . package . name + '.util.CraftEvil' ) ;
350- return function ( block , typeId , data , applyPhysics ) {
351- CraftEvil . setTypeIdAndData ( block , typeId , data , applyPhysics ) ;
352- } ;
348+ try {
349+ var CraftEvil = Java . type ( server . class . package . name + '.util.CraftEvil' ) ;
350+ console . log ( 'Drone using CraftEvil.setTypeIdAndData method' ) ;
351+ return function ( block , typeId , data , applyPhysics ) {
352+ CraftEvil . setTypeIdAndData ( block , typeId , data , applyPhysics ) ;
353+ } ;
354+ } catch ( e ) {
355+ console . log (
356+ 'Drone support is experimental on 1.15.2 and above, and may be broken...'
357+ ) ;
358+ return function ( block , typeId , data , applyPhysics ) {
359+ block . setBlockData ( data , applyPhysics ) ;
360+ block . setType ( typeId ) ;
361+ } ;
362+ }
353363 }
354364}
355365
You can’t perform that action at this time.
0 commit comments