Commit 0ff59d8f authored by Linus K.'s avatar Linus K.
Browse files

Only allow farming with hoe

parent 240d1fe3
......@@ -143,11 +143,10 @@ class AutoFarmerListener: Listener {
if(e.action != Action.RIGHT_CLICK_BLOCK) return
val clickedBlock = e.clickedBlock ?: return
if(isIgnoreInteract(clickedBlock.location)) return
if(!e.player.inventory.itemInMainHand.type.toString().endsWith("_HOE") && !e.player.inventory.itemInOffHand.type.toString().endsWith("_HOE"))
return
if(isRipe(clickedBlock)) {
for(item in arrayOf(e.player.inventory.itemInMainHand, e.player.inventory.itemInOffHand)) {
if(item.type == Material.BONE_MEAL || item.type in CROPS || item.type in CROPS.values)
return
}
IGNORE_INTERACTS[clickedBlock.location] = System.currentTimeMillis() + IGNORE_DURATION_MILLIS
farmFrom(clickedBlock)
e.isCancelled = true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment