From 9216bdbb48f4f9e4b8dd9b0d6b1fd9e868d7becb Mon Sep 17 00:00:00 2001 From: ProSavage Date: Mon, 13 Aug 2018 00:02:03 -0500 Subject: [PATCH] Crop growth material fixes for 1.13! --- .../zcore/fupgrades/CropUpgrades.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/fupgrades/CropUpgrades.java b/src/main/java/com/massivecraft/factions/zcore/fupgrades/CropUpgrades.java index dafeb15f..47864424 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fupgrades/CropUpgrades.java +++ b/src/main/java/com/massivecraft/factions/zcore/fupgrades/CropUpgrades.java @@ -46,7 +46,14 @@ public class CropUpgrades implements Listener { private void growCrop(BlockGrowEvent e) { - if (e.getBlock().getType().equals(Material.LEGACY_CROPS)) { + Material CROPS; + if (P.p.mc113) { + CROPS = Material.valueOf("LEGACY_CROPS"); + } else { + CROPS = Material.valueOf("CROPS"); + } + + if (e.getBlock().getType().equals(CROPS)) { e.setCancelled(true); Crops c = new Crops(CropState.RIPE); org.bukkit.block.BlockState bs = e.getBlock().getState(); @@ -54,11 +61,19 @@ public class CropUpgrades implements Listener { bs.update(); } org.bukkit.block.Block below = e.getBlock().getLocation().subtract(0, 1, 0).getBlock(); - if (below.getType() == Material.LEGACY_SUGAR_CANE_BLOCK) { + Material SUGARCANEBLOCK; + if (P.p.mc113) { + SUGARCANEBLOCK = Material.valueOf("LEGACY_SUGAR_CANE_BLOCK"); + } else { + SUGARCANEBLOCK = Material.valueOf("SUGAR_CANE_BLOCK"); + } + + + if (below.getType() == SUGARCANEBLOCK) { org.bukkit.block.Block above = e.getBlock().getLocation().add(0, 1, 0).getBlock(); if (above.getType() == Material.AIR && above.getLocation().add(0, -2, 0).getBlock().getType() != Material.AIR) { - above.setType(Material.LEGACY_SUGAR_CANE_BLOCK); + above.setType(SUGARCANEBLOCK); } }