mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-09-17 18:41:03 +02:00
Removed the auto remove dead hopper feature.
This commit is contained in:
parent
8434a5f711
commit
1cf407026b
@ -58,8 +58,6 @@ public class HopTask extends BukkitRunnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Set<Location> toRemove = new HashSet<>();
|
|
||||||
|
|
||||||
for (final com.songoda.epichoppers.hopper.Hopper hopper : plugin.getHopperManager().getHoppers().values()) {
|
for (final com.songoda.epichoppers.hopper.Hopper hopper : plugin.getHopperManager().getHoppers().values()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -74,10 +72,8 @@ public class HopTask extends BukkitRunnable {
|
|||||||
Block block = location.getBlock();
|
Block block = location.getBlock();
|
||||||
|
|
||||||
// If block is not a hopper remove and continue.
|
// If block is not a hopper remove and continue.
|
||||||
if (block.getType() != Material.HOPPER) {
|
if (block.getType() != Material.HOPPER)
|
||||||
toRemove.add(location);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
// If hopper block is powered, update its redstone state and continue.
|
// If hopper block is powered, update its redstone state and continue.
|
||||||
if (block.getBlockPower() > 0) {
|
if (block.getBlockPower() > 0) {
|
||||||
@ -185,14 +181,6 @@ public class HopTask extends BukkitRunnable {
|
|||||||
|
|
||||||
// push out inventory changes
|
// push out inventory changes
|
||||||
StorageContainerCache.update();
|
StorageContainerCache.update();
|
||||||
|
|
||||||
// Clear out invalid hoppers
|
|
||||||
HopperManager hopperManager = plugin.getHopperManager();
|
|
||||||
toRemove.forEach(h -> {
|
|
||||||
com.songoda.epichoppers.hopper.Hopper
|
|
||||||
hopper = hopperManager.removeHopper(h);
|
|
||||||
plugin.getDataManager().deleteHopper(hopper);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void debt(ItemStack item, int amountToMove, InventoryHolder currentHolder) {
|
private void debt(ItemStack item, int amountToMove, InventoryHolder currentHolder) {
|
||||||
|
Loading…
Reference in New Issue
Block a user