mirror of
https://github.com/Shiewk/SModeration.git
synced 2026-04-29 06:34:17 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4392456b15 | |||
| 0db57042af | |||
| 57b21c2e1f |
@@ -15,5 +15,7 @@
|
||||
- **smod.invsee.preventmodify**: When giving this permission to a player, prevents their inventory from being modified.
|
||||
- **smod.enderchestsee**: Allows the player to view other players ender chests.
|
||||
- **smod.enderchestsee.modify**: Allows the player to view and modify other players ender chests.
|
||||
- **smod.vanish**: Allows the player to enter and leave vanish mode.
|
||||
- **smod.vanish.see**: Allows the player to see vanished players
|
||||
|
||||
All of these permissions are granted by default if the player is a server operator.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
pluginVersion = 1.2.0
|
||||
pluginVersion = 1.2.1
|
||||
@@ -15,7 +15,7 @@ public class EnderchestSeeEvents implements Listener {
|
||||
final Inventory clicked = event.getView().getTopInventory();
|
||||
if (!(clicked instanceof PlayerInventory)){
|
||||
final InventoryHolder holder = clicked.getHolder();
|
||||
if (holder instanceof HumanEntity humanHolder){
|
||||
if (holder instanceof HumanEntity humanHolder && humanHolder.getEnderChest().equals(clicked)){
|
||||
if (!event.getWhoClicked().hasPermission("smod.enderchestsee.modify")){
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package de.shiewk.smoderation.listener;
|
||||
|
||||
import de.shiewk.smoderation.SModeration;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@@ -21,14 +22,16 @@ public class VanishListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST) public void onPlayerJoin(PlayerJoinEvent event){
|
||||
final Player player = event.getPlayer();
|
||||
if (player.hasPermission("smod.vanish.see")){
|
||||
for (Player vanishedPlayer : SModeration.getVanishedPlayers()) {
|
||||
// to show visible vanished players
|
||||
player.showEntity(SModeration.PLUGIN, vanishedPlayer);
|
||||
@EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event){
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SModeration.PLUGIN, () -> {
|
||||
final Player player = event.getPlayer();
|
||||
if (player.hasPermission("smod.vanish.see")){
|
||||
for (Player vanishedPlayer : SModeration.getVanishedPlayers()) {
|
||||
// to show visible vanished players
|
||||
player.showEntity(SModeration.PLUGIN, vanishedPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user