diff --git a/src/main/java/me/Demon/BlockWars/Listener/GameListener.java b/src/main/java/me/Demon/BlockWars/Listener/GameListener.java index 89fb878..e4d417a 100644 --- a/src/main/java/me/Demon/BlockWars/Listener/GameListener.java +++ b/src/main/java/me/Demon/BlockWars/Listener/GameListener.java @@ -72,6 +72,9 @@ public class GameListener implements Listener { if(p.isSneaking()){ RepairGiftGui.OpenGui(p); } else { + if (p.getGameMode() == GameMode.CREATIVE) { + p.setGameMode(GameMode.SPECTATOR); + } Main.gameData.refreshTheNonBlankBlockOfMiningArea(); // 刷新矿区当前块数量 } e.setCancelled(true); diff --git a/src/main/java/me/Demon/BlockWars/LiveEvent/GiftListener.java b/src/main/java/me/Demon/BlockWars/LiveEvent/GiftListener.java index c5a8fcb..5005af9 100644 --- a/src/main/java/me/Demon/BlockWars/LiveEvent/GiftListener.java +++ b/src/main/java/me/Demon/BlockWars/LiveEvent/GiftListener.java @@ -18,7 +18,7 @@ public class GiftListener implements Listener { @EventHandler public void onGfit(LiveGiftEvents e) { Player zhubo = e.getPlayer(); - String userName = ""+ RandomUtil.getRandomInt(999,10000); + String userName = ""+ RandomUtil.getRandomInt(10000,90000); boolean butt = false; if(e.getUser().nickName() != null) { userName = e.getUser().nickName(); @@ -35,11 +35,8 @@ public class GiftListener implements Listener { } GiftData giftData = configYml.getGiftData(giftName); giftData.OutCompleEvent(amount); - String show_userName = GameUtil.HideName(userName); - for (Player player : Bukkit.getOnlinePlayers()){ - player.sendMessage("§a礼物: §e"+show_userName+" §d送来了 §e"+giftName+"x"+amount); - } String eventName = giftData.getEvent(); + String show_userName = GameUtil.HideName(userName); if(GameUtil.specialGiftEffectTriggers(zhubo,eventName,show_userName,amount)){ return; } @@ -65,5 +62,8 @@ public class GiftListener implements Listener { }, (long) i * dadey); } } + for (Player player : Bukkit.getOnlinePlayers()){ + player.sendMessage("§a礼物: §e"+ show_userName+" §d送来了 §e"+giftName+"x"+amount); + } } }