mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-07 03:00:29 +01:00
Added wheat to the crop upgrade
This commit is contained in:
parent
989778d114
commit
847e23bf0f
@ -587,8 +587,7 @@ public class Block implements Listener {
|
||||
|
||||
List<Upgrade> upgrades = skyblock.getUpgradeManager().getUpgrades(Upgrade.Type.Crop);
|
||||
|
||||
if (upgrades != null && upgrades.size() > 0 && upgrades.get(0).isEnabled()
|
||||
&& island.isUpgrade(Upgrade.Type.Crop)) {
|
||||
if (upgrades != null && upgrades.size() > 0 && upgrades.get(0).isEnabled() && island.isUpgrade(Upgrade.Type.Crop)) {
|
||||
if (NMSUtil.getVersionNumber() > 12) {
|
||||
try {
|
||||
Object blockData = block.getClass().getMethod("getBlockData").invoke(block);
|
||||
@ -605,11 +604,13 @@ public class Block implements Listener {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
Material type = block.getType();
|
||||
if (block.getState().getData() instanceof Crops
|
||||
|| block.getType().name().equals("BEETROOT_BLOCK")
|
||||
|| block.getType().name().equals("CARROT")
|
||||
|| block.getType().name().equals("POTATO")
|
||||
|| block.getType().name().equals("CROPS")) {
|
||||
|| type.name().equals("BEETROOT_BLOCK")
|
||||
|| type.name().equals("CARROT")
|
||||
|| type.name().equals("POTATO")
|
||||
|| type.name().equals("WHEAT")
|
||||
|| type.name().equals("CROPS")) {
|
||||
try {
|
||||
block.getClass().getMethod("setData", byte.class).invoke(block, (byte) (block.getData() + 1));
|
||||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
|
||||
|
@ -686,6 +686,7 @@ public class Entity implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||
if (event.getEntity() instanceof ArmorStand
|
||||
|
Loading…
Reference in New Issue
Block a user