Solved [1.13] Crops

Discussion in 'Spigot Plugin Development' started by stijnb1234, Jul 24, 2018.

  1. Hello there!

    In 1.12 you can use this code for crops:
    Code (Java):
    MaterialData md = e.getBlock().getState().getData();
    Crops crop = null;
    if(md instanceof Crops) {
          crop = (Crops) md;
    } else {
          return;
    }
    if(crop.getState().equals(CropState.RIPE) {
         //Do things...
    }
    But how do I use this code so it's compatible with 1.12 and 1.13?

    Thanks!