@@ -338,29 +338,30 @@ public void run() {
338338 }
339339
340340 if (
341+ Bukkit .getVersion ().contains ("1.16" ) ||
341342 Bukkit .getVersion ().contains ("1.17" ) ||
342343 Bukkit .getVersion ().contains ("1.18" ) ||
343344 Bukkit .getVersion ().contains ("1.19" ) ||
344345 Bukkit .getVersion ().contains ("1.20" ) ||
345346 Bukkit .getVersion ().contains ("1.21" )
346347 ) {
347- //deal with glow berries
348- if (e .getBlock ().getType () == Material .CAVE_VINES_PLANT || e .getBlock ().getRelative (BlockFace .DOWN ).getType () == Material .CAVE_VINES_PLANT ) {
348+ //deal with weeping vines
349+ if (e .getBlock ().getType () == Material .WEEPING_VINES_PLANT || e .getBlock ().getRelative (BlockFace .DOWN ).getType () == Material .WEEPING_VINES_PLANT ) {
349350 Location lnew = l .clone ();
350351 do {
351352 lnew .setY (lnew .getY () - 1 );
352- if (lnew .getBlock ().getType () == Material .CAVE_VINES_PLANT ) {
353+ if (lnew .getBlock ().getType () == Material .WEEPING_VINES_PLANT ) {
353354 addLocation (lnew , e .getPlayer ());
354355 } else {
355356 break ;
356357 }
357358 } while (true );
358359 addLocation (lnew , e .getPlayer ());
359- } else if (e .getBlock ().getType () == Material .CAVE_VINES || e .getBlock ().getRelative (BlockFace .DOWN ).getType () == Material .CAVE_VINES ) {
360+ } else if (e .getBlock ().getType () == Material .WEEPING_VINES || e .getBlock ().getRelative (BlockFace .DOWN ).getType () == Material .WEEPING_VINES ) {
360361 Location lnew = l .clone ();
361362 do {
362363 lnew .setY (lnew .getY () - 1 );
363- if (lnew .getBlock ().getType () == Material .CAVE_VINES ) {
364+ if (lnew .getBlock ().getType () == Material .WEEPING_VINES ) {
364365 addLocation (lnew , e .getPlayer ());
365366 } else {
366367 break ;
@@ -369,39 +370,91 @@ public void run() {
369370 addLocation (lnew , e .getPlayer ());
370371 }
371372
372- //deal with dripleafs
373- if (e .getBlock ().getType () == Material .BIG_DRIPLEAF_STEM || e .getBlock ().getRelative (BlockFace .UP ).getType () == Material .BIG_DRIPLEAF_STEM ) {
373+ //deal with twisting vines
374+ if (e .getBlock ().getType () == Material .TWISTING_VINES_PLANT || e .getBlock ().getRelative (BlockFace .UP ).getType () == Material .TWISTING_VINES_PLANT ) {
374375 Location lnew = l .clone ();
375- double y = lnew .getY ();
376376 do {
377377 lnew .setY (lnew .getY () + 1 );
378- if (lnew .getBlock ().getType () == Material .BIG_DRIPLEAF_STEM ) {
379- addLocation (lnew , e .getPlayer ());
380- } else if (lnew .getBlock ().getType () == Material .BIG_DRIPLEAF ) {
378+ if (lnew .getBlock ().getType () == Material .TWISTING_VINES_PLANT ) {
381379 addLocation (lnew , e .getPlayer ());
382380 } else {
383- y --;
384- lnew .setY (y );
385- if (lnew .getBlock ().getType () == Material .BIG_DRIPLEAF_STEM ) {
386- addLocation (lnew , e .getPlayer ());
387- } else {
388- break ;
389- }
381+ break ;
390382 }
391383 } while (true );
392384 addLocation (lnew , e .getPlayer ());
393- } else if (e .getBlock ().getType () == Material .BIG_DRIPLEAF || e .getBlock ().getRelative (BlockFace .UP ).getType () == Material .BIG_DRIPLEAF ) {
385+ } else if (e .getBlock ().getType () == Material .TWISTING_VINES || e .getBlock ().getRelative (BlockFace .UP ).getType () == Material .TWISTING_VINES ) {
394386 Location lnew = l .clone ();
395387 do {
396- lnew .setY (lnew .getY () - 1 );
397- if (lnew .getBlock ().getType () == Material .BIG_DRIPLEAF ) {
388+ lnew .setY (lnew .getY () + 1 );
389+ if (lnew .getBlock ().getType () == Material .TWISTING_VINES ) {
398390 addLocation (lnew , e .getPlayer ());
399391 } else {
400392 break ;
401393 }
402394 } while (true );
403395 addLocation (lnew , e .getPlayer ());
404396 }
397+
398+ if (!Bukkit .getVersion ().contains ("1.16" )) {
399+ //deal with glow berries
400+ if (e .getBlock ().getType () == Material .CAVE_VINES_PLANT || e .getBlock ().getRelative (BlockFace .DOWN ).getType () == Material .CAVE_VINES_PLANT ) {
401+ Location lnew = l .clone ();
402+ do {
403+ lnew .setY (lnew .getY () - 1 );
404+ if (lnew .getBlock ().getType () == Material .CAVE_VINES_PLANT ) {
405+ addLocation (lnew , e .getPlayer ());
406+ } else {
407+ break ;
408+ }
409+ } while (true );
410+ addLocation (lnew , e .getPlayer ());
411+ } else if (e .getBlock ().getType () == Material .CAVE_VINES || e .getBlock ().getRelative (BlockFace .DOWN ).getType () == Material .CAVE_VINES ) {
412+ Location lnew = l .clone ();
413+ do {
414+ lnew .setY (lnew .getY () - 1 );
415+ if (lnew .getBlock ().getType () == Material .CAVE_VINES ) {
416+ addLocation (lnew , e .getPlayer ());
417+ } else {
418+ break ;
419+ }
420+ } while (true );
421+ addLocation (lnew , e .getPlayer ());
422+ }
423+
424+ //deal with dripleafs
425+ if (e .getBlock ().getType () == Material .BIG_DRIPLEAF_STEM || e .getBlock ().getRelative (BlockFace .UP ).getType () == Material .BIG_DRIPLEAF_STEM ) {
426+ Location lnew = l .clone ();
427+ double y = lnew .getY ();
428+ do {
429+ lnew .setY (lnew .getY () + 1 );
430+ if (lnew .getBlock ().getType () == Material .BIG_DRIPLEAF_STEM ) {
431+ addLocation (lnew , e .getPlayer ());
432+ } else if (lnew .getBlock ().getType () == Material .BIG_DRIPLEAF ) {
433+ addLocation (lnew , e .getPlayer ());
434+ } else {
435+ y --;
436+ lnew .setY (y );
437+ if (lnew .getBlock ().getType () == Material .BIG_DRIPLEAF_STEM ) {
438+ addLocation (lnew , e .getPlayer ());
439+ } else {
440+ break ;
441+ }
442+ }
443+ } while (true );
444+ addLocation (lnew , e .getPlayer ());
445+ } else if (e .getBlock ().getType () == Material .BIG_DRIPLEAF || e .getBlock ().getRelative (BlockFace .UP ).getType () == Material .BIG_DRIPLEAF ) {
446+ Location lnew = l .clone ();
447+ do {
448+ lnew .setY (lnew .getY () - 1 );
449+ if (lnew .getBlock ().getType () == Material .BIG_DRIPLEAF ) {
450+ addLocation (lnew , e .getPlayer ());
451+ } else {
452+ break ;
453+ }
454+ } while (true );
455+ addLocation (lnew , e .getPlayer ());
456+ }
457+ }
405458 }
406459
407460 // TEST END
0 commit comments