Skip to content

Commit

Permalink
Creative/Spectatorの時アイテムを配布しないようにする (Close #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mc-nekoneko committed Jun 16, 2020
1 parent d12e5b3 commit 7c1d518
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -61,6 +62,9 @@ public class InvisibleListener implements Listener {
@EventHandler
public void playerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
if (player.getGameMode() != GameMode.SURVIVAL && player.getGameMode() != GameMode.ADVENTURE) {
return;
}
if (player.hasMetadata(InvisiblePlugin.METADATA_KEY)) {
player.removeMetadata(InvisiblePlugin.METADATA_KEY, this.plugin);
}
Expand Down

0 comments on commit 7c1d518

Please sign in to comment.