Added wheat to the crop upgrade

This commit is contained in:
BuildTools 2019-09-22 00:41:06 -06:00
parent 989778d114
commit 847e23bf0f
2 changed files with 8 additions and 6 deletions

View File

@ -587,8 +587,7 @@ public class Block implements Listener {
List<Upgrade> upgrades = skyblock.getUpgradeManager().getUpgrades(Upgrade.Type.Crop); List<Upgrade> upgrades = skyblock.getUpgradeManager().getUpgrades(Upgrade.Type.Crop);
if (upgrades != null && upgrades.size() > 0 && upgrades.get(0).isEnabled() if (upgrades != null && upgrades.size() > 0 && upgrades.get(0).isEnabled() && island.isUpgrade(Upgrade.Type.Crop)) {
&& island.isUpgrade(Upgrade.Type.Crop)) {
if (NMSUtil.getVersionNumber() > 12) { if (NMSUtil.getVersionNumber() > 12) {
try { try {
Object blockData = block.getClass().getMethod("getBlockData").invoke(block); Object blockData = block.getClass().getMethod("getBlockData").invoke(block);
@ -605,11 +604,13 @@ public class Block implements Listener {
e.printStackTrace(); e.printStackTrace();
} }
} else { } else {
Material type = block.getType();
if (block.getState().getData() instanceof Crops if (block.getState().getData() instanceof Crops
|| block.getType().name().equals("BEETROOT_BLOCK") || type.name().equals("BEETROOT_BLOCK")
|| block.getType().name().equals("CARROT") || type.name().equals("CARROT")
|| block.getType().name().equals("POTATO") || type.name().equals("POTATO")
|| block.getType().name().equals("CROPS")) { || type.name().equals("WHEAT")
|| type.name().equals("CROPS")) {
try { try {
block.getClass().getMethod("setData", byte.class).invoke(block, (byte) (block.getData() + 1)); block.getClass().getMethod("setData", byte.class).invoke(block, (byte) (block.getData() + 1));
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException

View File

@ -686,6 +686,7 @@ public class Entity implements Listener {
} }
} }
@SuppressWarnings("deprecation")
@EventHandler @EventHandler
public void onCreatureSpawn(CreatureSpawnEvent event) { public void onCreatureSpawn(CreatureSpawnEvent event) {
if (event.getEntity() instanceof ArmorStand if (event.getEntity() instanceof ArmorStand