general fixes.

This commit is contained in:
Brianna 2019-07-02 22:56:00 -04:00
parent 719ce4286c
commit 8a654caac5
2 changed files with 6 additions and 5 deletions

View File

@ -33,17 +33,18 @@ public class HopperTask extends BukkitRunnable {
@Override
public void run() {
for (Farm farm : manager.getFarms().values()) {
if (farm.getLocation() == null || farm.getLocation().getBlock() == null) {
if (farm.getLocation() == null) {
manager.removeFarm(farm.getLocation());
continue;
}
Block block = farm.getLocation().getBlock();
if (block.getRelative(BlockFace.DOWN).getType() != Material.HOPPER)
Block block = farm.getLocation().getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN);
if (block.getType() != Material.HOPPER)
continue;
Inventory inventory = farm.getInventory();
Inventory hopperInventory = ((Hopper) block.getRelative(BlockFace.DOWN).getState()).getInventory();
Inventory hopperInventory = ((Hopper) block.getState()).getInventory();
for (int i = 27; i < inventory.getSize(); i++) {
if (inventory.getItem(i) == null || inventory.getItem(i).getType() == Material.AIR) continue;

View File

@ -1,4 +1,4 @@
n ame: EpicFarming
name: EpicFarming
description: EpicFarming
main: com.songoda.epicfarming.EpicFarmingPlugin
version: maven-version-number