mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-09-28 15:47:28 +02:00
Move from deprecated BlockUtils#updateAdjacentComparators to WorldCore
Fixes `java.lang.NoSuchMethodException: org.bukkit.craftbukkit.v1_19_R3.CraftChunk.getHandle()` in a mid-version NMS change in Spigot 1.19.4
This commit is contained in:
parent
5940491279
commit
0b5d3481c9
@ -1,7 +1,7 @@
|
||||
package com.songoda.epichoppers.listeners;
|
||||
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.core.utils.BlockUtils;
|
||||
import com.songoda.core.nms.NmsManager;
|
||||
import com.songoda.epichoppers.EpicHoppers;
|
||||
import com.songoda.epichoppers.hopper.Hopper;
|
||||
import com.songoda.epichoppers.hopper.levels.modules.Module;
|
||||
@ -139,10 +139,14 @@ public class HopperListeners implements Listener {
|
||||
//event.setItem(moveInstead);
|
||||
// we need to instead cancel and manually remove the item to move
|
||||
source.removeItem(moveInstead);
|
||||
BlockUtils.updateAdjacentComparators(sourceLocation);
|
||||
if (sourceLocation != null) {
|
||||
NmsManager.getWorld().updateAdjacentComparators(sourceLocation.getBlock());
|
||||
}
|
||||
// now add it to the hopper
|
||||
destination.addItem(moveInstead);
|
||||
BlockUtils.updateAdjacentComparators(destinationLocation);
|
||||
if (destinationLocation != null) {
|
||||
NmsManager.getWorld().updateAdjacentComparators(destinationLocation.getBlock());
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.songoda.epichoppers.utils;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.core.utils.BlockUtils;
|
||||
import com.songoda.core.nms.NmsManager;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
@ -112,7 +112,8 @@ public class StorageContainerCache {
|
||||
inventory.setItem(i, cachedInventory[i]);
|
||||
}
|
||||
}
|
||||
BlockUtils.updateAdjacentComparators(e.getKey().getLocation());
|
||||
|
||||
NmsManager.getWorld().updateAdjacentComparators(e.getKey());
|
||||
});
|
||||
inventoryCache.clear();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user