Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
fix: #822 gamemodeコマンドでのスペクテイター切り替え時に警告表示 (#833)
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 authored May 21, 2022
1 parent 7998c74 commit 230978d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* jaoLicense
*
* Copyright (c) 2021 jao Minecraft Server
* Copyright (c) 2022 jao Minecraft Server
*
* The following license applies to this project: jaoLicense
*
Expand All @@ -13,6 +13,9 @@

import com.jaoafa.mymaid4.lib.EventPremise;
import com.jaoafa.mymaid4.lib.MyMaidLibrary;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.JoinConfiguration;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand All @@ -35,6 +38,9 @@ public void onChangeGameMode(PlayerGameModeChangeEvent event) {
if (isAMR(player)) {
return;
}
player.sendMessage(Component.join(JoinConfiguration.noSeparators(),
Component.text("[GAMEMODE] "),
Component.text("あなたはゲームモードをスペクテイターに切り替えることができません。", NamedTextColor.GREEN)));
event.setCancelled(true);
}
}

0 comments on commit 230978d

Please sign in to comment.