mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-07 11:10:04 +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);
|
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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user