mirror of
https://github.com/BG-Software-LLC/WildLoaders.git
synced 2024-11-25 12:25:18 +01:00
Fixed the ability to open containers of chunk loaders
This commit is contained in:
parent
4885ddc4f0
commit
c43b83a491
@ -11,8 +11,10 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@ -82,4 +84,13 @@ public final class BlocksListener implements Listener {
|
|||||||
plugin.getNMSAdapter().updateSpawner(e.getBlock().getLocation(), false);
|
plugin.getNMSAdapter().updateSpawner(e.getBlock().getLocation(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
|
public void onLoaderInteract(PlayerInteractEvent e){
|
||||||
|
if(e.getAction() != Action.RIGHT_CLICK_BLOCK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(plugin.getLoaders().getChunkLoader(e.getClickedBlock().getLocation()).isPresent())
|
||||||
|
e.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user