测试版

This commit is contained in:
yaohunya 2024-08-01 00:37:50 +08:00
parent 9389a76b0a
commit e507cb033d
2 changed files with 8 additions and 5 deletions

View File

@ -72,6 +72,9 @@ public class GameListener implements Listener {
if(p.isSneaking()){ if(p.isSneaking()){
RepairGiftGui.OpenGui(p); RepairGiftGui.OpenGui(p);
} else { } else {
if (p.getGameMode() == GameMode.CREATIVE) {
p.setGameMode(GameMode.SPECTATOR);
}
Main.gameData.refreshTheNonBlankBlockOfMiningArea(); // 刷新矿区当前块数量 Main.gameData.refreshTheNonBlankBlockOfMiningArea(); // 刷新矿区当前块数量
} }
e.setCancelled(true); e.setCancelled(true);

View File

@ -18,7 +18,7 @@ public class GiftListener implements Listener {
@EventHandler @EventHandler
public void onGfit(LiveGiftEvents e) { public void onGfit(LiveGiftEvents e) {
Player zhubo = e.getPlayer(); Player zhubo = e.getPlayer();
String userName = ""+ RandomUtil.getRandomInt(999,10000); String userName = ""+ RandomUtil.getRandomInt(10000,90000);
boolean butt = false; boolean butt = false;
if(e.getUser().nickName() != null) { if(e.getUser().nickName() != null) {
userName = e.getUser().nickName(); userName = e.getUser().nickName();
@ -35,11 +35,8 @@ public class GiftListener implements Listener {
} }
GiftData giftData = configYml.getGiftData(giftName); GiftData giftData = configYml.getGiftData(giftName);
giftData.OutCompleEvent(amount); 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 eventName = giftData.getEvent();
String show_userName = GameUtil.HideName(userName);
if(GameUtil.specialGiftEffectTriggers(zhubo,eventName,show_userName,amount)){ if(GameUtil.specialGiftEffectTriggers(zhubo,eventName,show_userName,amount)){
return; return;
} }
@ -65,5 +62,8 @@ public class GiftListener implements Listener {
}, (long) i * dadey); }, (long) i * dadey);
} }
} }
for (Player player : Bukkit.getOnlinePlayers()){
player.sendMessage("§a礼物: §e"+ show_userName+" §d送来了 §e"+giftName+"x"+amount);
}
} }
} }