Fixes to observer settings
This commit is contained in:
parent
4f5625d63e
commit
24254635a8
@ -608,7 +608,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
|||||||
player.getInventory().setHelmet(null);
|
player.getInventory().setHelmet(null);
|
||||||
runSyncLater(() -> {
|
runSyncLater(() -> {
|
||||||
player.getInventory().setHelmet(helmet);
|
player.getInventory().setHelmet(helmet);
|
||||||
}, 5L);
|
}, 20L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
@ -106,6 +107,17 @@ public class ObserverManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onBreak(BlockBreakEvent event)
|
||||||
|
{
|
||||||
|
ObserverData data = _observerMap.get(event.getPlayer());
|
||||||
|
|
||||||
|
if (data != null)
|
||||||
|
{
|
||||||
|
if (!data.getSettings().contains(ObserverSettings.CAN_BREAK_BLOCKS))
|
||||||
|
event.setCancelled(true);
|
||||||
|
} }
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInventoryClick(InventoryClickEvent event)
|
public void onInventoryClick(InventoryClickEvent event)
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ public enum ObserverSettings
|
|||||||
public static EnumSet<ObserverSettings> getSettings(Rank rank)
|
public static EnumSet<ObserverSettings> getSettings(Rank rank)
|
||||||
{
|
{
|
||||||
if (rank.has(Rank.DEVELOPER))
|
if (rank.has(Rank.DEVELOPER))
|
||||||
return EnumSet.of(CAN_OPEN_CHESTS);
|
return EnumSet.of(CAN_OPEN_CHESTS, CAN_BREAK_BLOCKS);
|
||||||
|
|
||||||
return EnumSet.noneOf(ObserverSettings.class);
|
return EnumSet.noneOf(ObserverSettings.class);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user