diff --git a/src/main/java/com/yaohun/enderdragonwars/listener/GameListener.java b/src/main/java/com/yaohun/enderdragonwars/listener/GameListener.java index 840e151..f4ec9e0 100644 --- a/src/main/java/com/yaohun/enderdragonwars/listener/GameListener.java +++ b/src/main/java/com/yaohun/enderdragonwars/listener/GameListener.java @@ -48,7 +48,7 @@ public class GameListener implements Listener { * 死亡后游戏时间 +5分钟 * */ @EventHandler - public void onDeath(PlayerDeathEvent e){ + public void onDeath(PlayerDeathEvent e) { e.setDeathMessage(null); Player p = e.getEntity(); new BukkitRunnable() { diff --git a/src/main/java/com/yaohun/enderdragonwars/liveevent/LiveEvent.java b/src/main/java/com/yaohun/enderdragonwars/listener/LikeListener.java similarity index 68% rename from src/main/java/com/yaohun/enderdragonwars/liveevent/LiveEvent.java rename to src/main/java/com/yaohun/enderdragonwars/listener/LikeListener.java index 5aaa71c..48e2739 100644 --- a/src/main/java/com/yaohun/enderdragonwars/liveevent/LiveEvent.java +++ b/src/main/java/com/yaohun/enderdragonwars/listener/LikeListener.java @@ -1,17 +1,39 @@ -package com.yaohun.enderdragonwars.liveevent; +package com.yaohun.enderdragonwars.listener; import com.io.yutian.mclive.event.LiveGiftEvents; +import com.io.yutian.mclive.event.LiveLikeEvents; import com.yaohun.enderdragonwars.Main; import com.yaohun.enderdragonwars.data.GiftData; import com.yaohun.enderdragonwars.manager.GameManager; import com.yaohun.enderdragonwars.manager.GiftEffectManager; import com.yaohun.enderdragonwars.util.GameUtil; +import com.yaohun.enderdragonwars.util.RandomUtil; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -public class LiveEvent implements Listener { +public class LikeListener implements Listener { + + @EventHandler + public void onDianZan(LiveLikeEvents e) { + Player zhubo = e.getPlayer(); + String userName = "" + RandomUtil.getRandomInt(999, 10000); + if (e.getUser().nickName() != null) { + userName = e.getUser().nickName(); + } + long add_amount = e.getCount(); + GameManager gameManager = Main.gameManager; + gameManager.addDianzan_amount((int) add_amount); + if (gameManager.getDianzan_amount() >= gameManager.getDianzan_need()) { + String eventName_Show = gameManager.getDianzan_event(); + String title = "§c" + eventName_Show; + String subtitle = "§9双击屏幕x" + gameManager.getDianzan_need(); + zhubo.sendTitle(title, subtitle, 10, 30, 10); + GiftEffectManager.addGiftEffect(userName, eventName_Show); + gameManager.setDianzan_amount(0); + } + } @EventHandler public void onLive(LiveGiftEvents e) { @@ -62,4 +84,5 @@ public class LiveEvent implements Listener { player.sendMessage("§a礼物: §e" + hideUserName + " §d送来了 §e" + giftName + "x" + giftAmount); } } + } diff --git a/src/main/java/com/yaohun/enderdragonwars/liveevent/LikeListener.java b/src/main/java/com/yaohun/enderdragonwars/liveevent/LikeListener.java deleted file mode 100644 index c38f9d8..0000000 --- a/src/main/java/com/yaohun/enderdragonwars/liveevent/LikeListener.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.yaohun.enderdragonwars.liveevent; - -import com.io.yutian.mclive.event.LiveLikeEvents; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.manager.GameManager; -import com.yaohun.enderdragonwars.manager.GiftEffectManager; -import com.yaohun.enderdragonwars.util.RandomUtil; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; - -public class LikeListener implements Listener { - - @EventHandler - public void onDianZan(LiveLikeEvents e) { - Player zhubo = e.getPlayer(); - String userName = "" + RandomUtil.getRandomInt(999, 10000); - if (e.getUser().nickName() != null) { - userName = e.getUser().nickName(); - } - long add_amount = e.getCount(); - GameManager gameManager = Main.gameManager; - gameManager.addDianzan_amount((int) add_amount); - if (gameManager.getDianzan_amount() >= gameManager.getDianzan_need()) { - String eventName_Show = gameManager.getDianzan_event(); - String title = "§c" + eventName_Show; - String subtitle = "§9双击屏幕x" + gameManager.getDianzan_need(); - zhubo.sendTitle(title, subtitle, 10, 30, 10); - GiftEffectManager.addGiftEffect(userName, eventName_Show); - gameManager.setDianzan_amount(0); - } - } - -}