mirror of
https://github.com/SPAWNRYS-ban/FUCK-CustomDiscs.git
synced 2025-12-10 05:19:43 +05:00
Bugfix ( Issue #4 )
This commit is contained in:
@@ -11,6 +11,6 @@ mod_id=customdiscsplugin
|
||||
# Target an older API to make it compatible with older versions of Simple Voice Chat
|
||||
voicechat_api_version=2.3.3
|
||||
|
||||
plugin_version=2.1
|
||||
plugin_version=2.1.1
|
||||
maven_group=me.Navoei.customdiscsplugin
|
||||
archives_base_name=custom-discs
|
||||
@@ -28,7 +28,8 @@ public class HopperManager implements Listener {
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onHopperPickupFromOtherSource(InventoryMoveItemEvent event) {
|
||||
|
||||
if (!Objects.requireNonNull(event.getDestination().getLocation()).getChunk().isLoaded()) return;
|
||||
if (event.getDestination().getLocation() == null) return;
|
||||
if (!event.getDestination().getLocation().getChunk().isLoaded()) return;
|
||||
if (!event.getDestination().getLocation().getBlock().getType().equals(Material.HOPPER)) return;
|
||||
if (!isCustomMusicDisc(event.getItem())) return;
|
||||
|
||||
@@ -225,7 +226,8 @@ public class HopperManager implements Listener {
|
||||
|
||||
public void itemJukeboxToHopper (Block block) {
|
||||
|
||||
if (!Objects.requireNonNull(block.getLocation()).getChunk().isLoaded()) return;
|
||||
if (block == null) return;
|
||||
if (!block.getLocation().getChunk().isLoaded()) return;
|
||||
if (!block.getType().equals(Material.JUKEBOX)) return;
|
||||
if (!block.getRelative(BlockFace.DOWN).getType().equals(Material.HOPPER)) return;
|
||||
|
||||
|
||||
@@ -79,10 +79,9 @@ public class JukeBox implements Listener{
|
||||
|
||||
if (jukeboxContainsDisc(block)) {
|
||||
stopDisc(block, player);
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(CustomDiscs.getInstance(), () -> HopperManager.instance().getNextDiscFromHopperIntoJukebox(block), 1L);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
|
||||
Reference in New Issue
Block a user