Better compatibility with bone meal.

This commit is contained in:
Brianna 2019-10-03 08:45:22 -04:00
parent 26634f7e1c
commit 42f3b5aaa4
2 changed files with 4 additions and 3 deletions

View File

@ -81,9 +81,9 @@ public class FarmTask extends BukkitRunnable {
private boolean useBoneMeal(Farm farm) { private boolean useBoneMeal(Farm farm) {
for (ItemStack item : farm.getItems()) { for (ItemStack item : farm.getItems()) {
if (item.getType() != Material.BONE_MEAL) continue; if (item.getType() != CompatibleMaterial.BONE_MEAL.getMaterial()) continue;
farm.removeMaterial(Material.BONE_MEAL, 1); farm.removeMaterial(CompatibleMaterial.BONE_MEAL.getMaterial(), 1);
return true; return true;

View File

@ -1,5 +1,6 @@
package com.songoda.epicfarming.tasks; package com.songoda.epicfarming.tasks;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.epicfarming.EpicFarming; import com.songoda.epicfarming.EpicFarming;
import com.songoda.epicfarming.farming.Farm; import com.songoda.epicfarming.farming.Farm;
import com.songoda.epicfarming.farming.FarmManager; import com.songoda.epicfarming.farming.FarmManager;
@ -55,7 +56,7 @@ public class HopperTask extends BukkitRunnable {
Inventory hopperInventory = ((Hopper) block.getState()).getInventory(); Inventory hopperInventory = ((Hopper) block.getState()).getInventory();
for (ItemStack item : farm.getItems()) { for (ItemStack item : farm.getItems()) {
if (item.getType() == Material.BONE_MEAL) continue; if (item.getType() == CompatibleMaterial.BONE_MEAL.getMaterial()) continue;
ItemStack toMove = item.clone(); ItemStack toMove = item.clone();
toMove.setAmount(1); toMove.setAmount(1);