Skip to content

Commit

Permalink
Remove LavaPlayerManager initialization on plugin start
Browse files Browse the repository at this point in the history
  • Loading branch information
sub-kek committed Oct 22, 2024
1 parent daebb2a commit 65a9ffb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

public class HopperHandler implements Listener {
private static HopperHandler instance;
private final PlayerManager playerManager = PlayerManager.getInstance();
private final LavaPlayerManager lavaPlayerManager = LavaPlayerManager.getInstance();

public static HopperHandler getInstance() {
if (instance == null) {
Expand Down Expand Up @@ -55,8 +53,8 @@ public void onJukeboxEjectToHopper(InventoryMoveItemEvent event) {
if (!event.getItem().hasItemMeta()) return;
if (!LegacyUtil.isCustomDisc(event.getItem()) && !LegacyUtil.isCustomYouTubeDisc(event.getItem())) return;

event.setCancelled(playerManager.isPlaying(block) ||
lavaPlayerManager.isPlaying(block));
event.setCancelled(PlayerManager.getInstance().isPlaying(block) ||
LavaPlayerManager.getInstance().isPlaying(block));

if (!event.isCancelled()) CustomDiscs.debug("Jukebox eject by hopper event");
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/io/github/subkek/customdiscs/util/PlayUtil.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package io.github.subkek.customdiscs.util;

import io.github.subkek.customdiscs.*;
import io.github.subkek.customdiscs.CustomDiscs;
import io.github.subkek.customdiscs.Keys;
import io.github.subkek.customdiscs.LavaPlayerManager;
import io.github.subkek.customdiscs.PlayerManager;
import net.kyori.adventure.text.Component;
import org.bukkit.block.Block;
import org.bukkit.block.Jukebox;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

Expand Down

0 comments on commit 65a9ffb

Please sign in to comment.