Update RandomListeners.java
This commit is contained in:
parent
a9007dcccb
commit
9b061317a7
@ -1,5 +1,6 @@
|
|||||||
package rip.tilly.bedwars.listeners;
|
package rip.tilly.bedwars.listeners;
|
||||||
|
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -90,6 +91,10 @@ public class RandomListeners implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInventoryClick(InventoryClickEvent event) {
|
public void onInventoryClick(InventoryClickEvent event) {
|
||||||
Player player = (Player) event.getWhoClicked();
|
Player player = (Player) event.getWhoClicked();
|
||||||
|
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(player.getUniqueId());
|
PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(player.getUniqueId());
|
||||||
if (playerData.getPlayerState() != PlayerState.PLAYING) {
|
if (playerData.getPlayerState() != PlayerState.PLAYING) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user