perms fix
This commit is contained in:
Brianna O'Keefe 2018-05-21 19:50:08 -04:00
parent a54ffeb98d
commit f80e666e70
2 changed files with 8 additions and 4 deletions

View File

@ -103,13 +103,13 @@ public class Farm {
inventory.setItem(nu, Methods.getGlass());
nu++;
}
if (instance.getConfig().getBoolean("Main.Upgrade With XP") && player != null && player.hasPermission("EpicDispensers.Upgrade.XP")) {
if (instance.getConfig().getBoolean("Main.Upgrade With XP") && player != null && player.hasPermission("EpicFarming.Upgrade.XP")) {
inventory.setItem(11, itemXP);
}
inventory.setItem(13, item);
if (instance.getConfig().getBoolean("Main.Upgrade With Economy") && player != null && player.hasPermission("EpicDispensers.Upgrade.ECO")) {
if (instance.getConfig().getBoolean("Main.Upgrade With Economy") && player != null && player.hasPermission("EpicFarming.Upgrade.ECO")) {
inventory.setItem(15, itemECO);
}

View File

@ -108,8 +108,12 @@ public class FarmingHandler {
private boolean doDrop(Farm farm, Material material) {
Random random = new Random();
ItemStack stack = new ItemStack(CropType.getCropType(material).getYieldMaterial());
ItemStack seedStack = new ItemStack(CropType.getCropType(material).getSeedMaterial(), random.nextInt(3) + 1);
CropType.CropTypeData cropTypeData = CropType.getCropType(material);
if (material == null || farm == null || cropTypeData == null) return false;
ItemStack stack = new ItemStack(cropTypeData.getYieldMaterial());
ItemStack seedStack = new ItemStack(cropTypeData.getSeedMaterial(), random.nextInt(3) + 1);
if (!canMove(farm.getInventory(), stack)) return false;
farm.getInventory().addItem(stack);