Added comparator update for the suction module.

This commit is contained in:
Brianna 2019-05-26 21:22:55 -04:00
parent fdb3c0a8d0
commit f08a3be0ee
2 changed files with 5 additions and 6 deletions

View File

@ -3,6 +3,7 @@ package com.songoda.epichoppers.hopper.levels.modules;
import com.bgsoftware.wildstacker.api.WildStackerAPI;
import com.songoda.epichoppers.EpicHoppers;
import com.songoda.epichoppers.hopper.Hopper;
import com.songoda.epichoppers.tasks.HopTask;
import com.songoda.epichoppers.utils.ServerVersion;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
@ -97,6 +98,7 @@ public class ModuleSuction implements Module {
for (ItemStack is : hopperInventory.addItem(itemStack).values()) {
entity.getWorld().dropItemNaturally(entity.getLocation(), is);
}
HopTask.updateAdjacentComparators(hopper.getLocation());
entity.remove();
});
}
@ -105,17 +107,14 @@ public class ModuleSuction implements Module {
return blacklist.contains(uuid);
}
public ItemStack getGUIButton(Hopper hopper) {
return null;
}
public void runButtonPress(Player player, Hopper hopper) {
}
public List<Material> getBlockedItems(Hopper hopper) {
return null;
}

View File

@ -308,10 +308,10 @@ public class HopTask extends BukkitRunnable {
return (InventoryHolder) state;
}
private Class<?> clazzCraftWorld, clazzCraftBlock, clazzBlockPosition;
private Method getHandle, updateAdjacentComparators, getNMSBlock;
private static Class<?> clazzCraftWorld, clazzCraftBlock, clazzBlockPosition;
private static Method getHandle, updateAdjacentComparators, getNMSBlock;
private void updateAdjacentComparators(Location location) {
public static void updateAdjacentComparators(Location location) {
try {
// Cache reflection.
if (clazzCraftWorld == null) {