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

View File

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