diff --git a/lib/API-1.0.jar b/lib/API-1.0.jar new file mode 100644 index 0000000..9873c9b Binary files /dev/null and b/lib/API-1.0.jar differ diff --git a/lib/PixelLiveAPI-1.0.jar b/lib/PixelLiveAPI-1.0.jar deleted file mode 100644 index bcc7471..0000000 Binary files a/lib/PixelLiveAPI-1.0.jar and /dev/null differ diff --git a/src/main/java/com/yaohun/enderdragonwars/Main.java b/src/main/java/com/yaohun/enderdragonwar/EnderDragonWar.java similarity index 59% rename from src/main/java/com/yaohun/enderdragonwars/Main.java rename to src/main/java/com/yaohun/enderdragonwar/EnderDragonWar.java index 35743ca..344eda8 100644 --- a/src/main/java/com/yaohun/enderdragonwars/Main.java +++ b/src/main/java/com/yaohun/enderdragonwar/EnderDragonWar.java @@ -1,25 +1,32 @@ -package com.yaohun.enderdragonwars; +package com.yaohun.enderdragonwar; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.game.GameSetting; -import com.yaohun.enderdragonwars.listener.GameListener; -import com.yaohun.enderdragonwars.listener.LiveListener; -import com.yaohun.enderdragonwars.listener.PlayerListener; -import com.yaohun.enderdragonwars.manager.GiftEffectManager; +import com.io.yutian.pixelliveapi.api.PixelLiveAPI; +import com.yaohun.enderdragonwar.game.Game; +import com.yaohun.enderdragonwar.game.GameSetting; +import com.yaohun.enderdragonwar.listener.GameListener; +import com.yaohun.enderdragonwar.listener.LiveListener; +import com.yaohun.enderdragonwar.listener.PlayerListener; +import com.yaohun.enderdragonwar.manager.GiftEffectManager; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -public class Main extends JavaPlugin { +public class EnderDragonWar extends JavaPlugin { - public static Main plugin; + public static EnderDragonWar plugin; public static Game game; @Override public void onEnable() { plugin = this; + + if (!PixelLiveAPI.isInitialized()) { + Bukkit.getPluginManager().disablePlugin(this); + return; + } + GiftEffectManager.registerAll(); GameSetting.load(); game = new Game(); diff --git a/src/main/java/com/yaohun/enderdragonwars/data/DirectionPoint.java b/src/main/java/com/yaohun/enderdragonwar/data/DirectionPoint.java similarity index 98% rename from src/main/java/com/yaohun/enderdragonwars/data/DirectionPoint.java rename to src/main/java/com/yaohun/enderdragonwar/data/DirectionPoint.java index 8d76161..5c4ce56 100644 --- a/src/main/java/com/yaohun/enderdragonwars/data/DirectionPoint.java +++ b/src/main/java/com/yaohun/enderdragonwar/data/DirectionPoint.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.data; +package com.yaohun.enderdragonwar.data; import org.bukkit.Location; import org.bukkit.World; diff --git a/src/main/java/com/yaohun/enderdragonwars/data/Point.java b/src/main/java/com/yaohun/enderdragonwar/data/Point.java similarity index 98% rename from src/main/java/com/yaohun/enderdragonwars/data/Point.java rename to src/main/java/com/yaohun/enderdragonwar/data/Point.java index 2d66b5a..d273dda 100644 --- a/src/main/java/com/yaohun/enderdragonwars/data/Point.java +++ b/src/main/java/com/yaohun/enderdragonwar/data/Point.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.data; +package com.yaohun.enderdragonwar.data; import org.bukkit.Location; import org.bukkit.World; diff --git a/src/main/java/com/yaohun/enderdragonwars/data/Region.java b/src/main/java/com/yaohun/enderdragonwar/data/Region.java similarity index 97% rename from src/main/java/com/yaohun/enderdragonwars/data/Region.java rename to src/main/java/com/yaohun/enderdragonwar/data/Region.java index 81ac181..5da14d5 100644 --- a/src/main/java/com/yaohun/enderdragonwars/data/Region.java +++ b/src/main/java/com/yaohun/enderdragonwar/data/Region.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.data; +package com.yaohun.enderdragonwar.data; import org.bukkit.Bukkit; import org.bukkit.Location; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/GameGiftEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/GameGiftEffect.java similarity index 50% rename from src/main/java/com/yaohun/enderdragonwars/effect/GameGiftEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/GameGiftEffect.java index e29cb7e..99aef88 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/GameGiftEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/GameGiftEffect.java @@ -1,8 +1,8 @@ -package com.yaohun.enderdragonwars.effect; +package com.yaohun.enderdragonwar.effect; -import com.io.yutian.pixelliveapi.effect.GiftEffect; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.game.Game; +import com.io.yutian.pixelliveapi.api.effect.GiftEffect; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.game.Game; public abstract class GameGiftEffect extends GiftEffect { @@ -14,7 +14,7 @@ public abstract class GameGiftEffect extends GiftEffect { @Override public void apply() { - apply(Main.game); + apply(EnderDragonWar.game); } } diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/AddMaxHealthEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/AddMaxHealthEffect.java similarity index 83% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/AddMaxHealthEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/AddMaxHealthEffect.java index 0b146b4..9db798a 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/AddMaxHealthEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/AddMaxHealthEffect.java @@ -1,8 +1,8 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.Particle; import org.bukkit.attribute.Attribute; import org.bukkit.entity.Player; @@ -37,7 +37,7 @@ public class AddMaxHealthEffect extends GameGiftEffect { } count++; } - }.runTaskTimer(Main.plugin, 0L, 1L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 1L); } @Override diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/BlackHoleEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/BlackHoleEffect.java similarity index 94% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/BlackHoleEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/BlackHoleEffect.java index 28dafaa..f550fe5 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/BlackHoleEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/BlackHoleEffect.java @@ -1,9 +1,9 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.util.RandomUtil; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; +import com.yaohun.enderdragonwar.util.RandomUtil; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Particle; @@ -55,7 +55,7 @@ public class BlackHoleEffect extends GameGiftEffect { } i++; } - }.runTaskTimer(Main.plugin, 0L, 10L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 10L); new BukkitRunnable() { private Set uuids = new HashSet<>(); @@ -101,7 +101,7 @@ public class BlackHoleEffect extends GameGiftEffect { } } } - }.runTaskTimer(Main.plugin, 0L, 5L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 5L); new BukkitRunnable() { private Set uuids = new HashSet<>(); @@ -134,7 +134,7 @@ public class BlackHoleEffect extends GameGiftEffect { } } } - }.runTaskTimer(Main.plugin, 0L, 1L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 1L); } private Set getRandomUpBlocks(Location location, int size, int amount) { diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/BomBomEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/BomBomEffect.java similarity index 95% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/BomBomEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/BomBomEffect.java index 3f95c47..dec2e3b 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/BomBomEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/BomBomEffect.java @@ -1,9 +1,9 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.util.EntityUtil; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; +import com.yaohun.enderdragonwar.util.EntityUtil; import net.kyori.adventure.text.Component; import org.bukkit.*; import org.bukkit.attribute.Attribute; @@ -153,7 +153,7 @@ public class BomBomEffect extends GameGiftEffect { } count++; } - }.runTaskTimer(Main.plugin, 0L, 15L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 15L); new BukkitRunnable() { private int count = 0; @@ -171,7 +171,7 @@ public class BomBomEffect extends GameGiftEffect { bossBar.setTitle(flag ? "§4§l毁天灭地" : "§c§l毁天灭地"); count++; } - }.runTaskTimer(Main.plugin, 0L, 5L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 5L); new BukkitRunnable() { private int count = 0; @@ -188,7 +188,7 @@ public class BomBomEffect extends GameGiftEffect { armorStand.getWorld().spawnParticle(Particle.FLAME, location1, 5, 0.2, 1, 0.2, 0.01); count++; } - }.runTaskTimer(Main.plugin, 0L, 2L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 2L); new BukkitRunnable() { @Override public void run() { @@ -211,7 +211,7 @@ public class BomBomEffect extends GameGiftEffect { } } } - }.runTaskTimer(Main.plugin, 0L, 1L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 1L); } } diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/ClearInventoryEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/ClearInventoryEffect.java similarity index 90% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/ClearInventoryEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/ClearInventoryEffect.java index dc3b4be..25bb04e 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/ClearInventoryEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/ClearInventoryEffect.java @@ -1,10 +1,9 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.io.yutian.pixelliveapi.effect.GiftEffect; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.util.RandomUtil; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; +import com.yaohun.enderdragonwar.util.RandomUtil; import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.Sound; @@ -65,7 +64,7 @@ public class ClearInventoryEffect extends GameGiftEffect { allays.add(allay); count++; } - }.runTaskTimer(Main.plugin, 10L, 4L); + }.runTaskTimer(EnderDragonWar.plugin, 10L, 4L); } private List getUseableItemCount(Player player) { diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/FiveLightningEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/FiveLightningEffect.java similarity index 72% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/FiveLightningEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/FiveLightningEffect.java index 2d742ef..61e0067 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/FiveLightningEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/FiveLightningEffect.java @@ -1,8 +1,8 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; @@ -27,7 +27,7 @@ public class FiveLightningEffect extends GameGiftEffect { player.getWorld().strikeLightning(player.getLocation()); count++; } - }.runTaskTimer(Main.plugin, 0, 10L); + }.runTaskTimer(EnderDragonWar.plugin, 0, 10L); } } diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/GiveTotemEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/GiveTotemEffect.java similarity index 73% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/GiveTotemEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/GiveTotemEffect.java index 4c51716..f3251ce 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/GiveTotemEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/GiveTotemEffect.java @@ -1,7 +1,7 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/LavaPoolEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/LavaPoolEffect.java similarity index 92% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/LavaPoolEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/LavaPoolEffect.java index e6156aa..7ae26e0 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/LavaPoolEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/LavaPoolEffect.java @@ -1,8 +1,8 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.util.RandomUtil; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; +import com.yaohun.enderdragonwar.util.RandomUtil; import net.kyori.adventure.text.Component; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/LuckyBlockEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/LuckyBlockEffect.java similarity index 95% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/LuckyBlockEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/LuckyBlockEffect.java index 292ae4e..eea6fda 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/LuckyBlockEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/LuckyBlockEffect.java @@ -1,9 +1,9 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.util.ItemStackBuilder; -import com.yaohun.enderdragonwars.util.RandomUtil; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; +import com.yaohun.enderdragonwar.util.ItemStackBuilder; +import com.yaohun.enderdragonwar.util.RandomUtil; import org.bukkit.*; import org.bukkit.block.Block; import org.bukkit.enchantments.Enchantment; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/PlayerBigEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/PlayerBigEffect.java similarity index 87% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/PlayerBigEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/PlayerBigEffect.java index 272250f..3f9dc33 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/PlayerBigEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/PlayerBigEffect.java @@ -1,7 +1,7 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.attribute.Attribute; import org.bukkit.entity.Player; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/PlayerResetEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/PlayerResetEffect.java similarity index 78% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/PlayerResetEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/PlayerResetEffect.java index 40e24ad..18998ab 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/PlayerResetEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/PlayerResetEffect.java @@ -1,7 +1,7 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.attribute.Attribute; import org.bukkit.entity.Player; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/PlayerSmallEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/PlayerSmallEffect.java similarity index 87% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/PlayerSmallEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/PlayerSmallEffect.java index ad26696..19c899b 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/PlayerSmallEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/PlayerSmallEffect.java @@ -1,7 +1,7 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.attribute.Attribute; import org.bukkit.entity.Player; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/RandomBoxEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/RandomBoxEffect.java similarity index 76% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/RandomBoxEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/RandomBoxEffect.java index 5008308..dff3b06 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/RandomBoxEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/RandomBoxEffect.java @@ -1,14 +1,9 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.io.yutian.pixelliveapi.api.Anchor; -import com.io.yutian.pixelliveapi.effect.GiftEffect; -import com.io.yutian.pixelliveapi.effect.GiftEffectData; -import com.io.yutian.pixelliveapi.manager.*; -import com.io.yutian.pixelliveapi.util.ToolUtil; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.manager.GiftEffectManager; +import com.io.yutian.pixelliveapi.api.PixelLiveAPI; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.Bukkit; import org.bukkit.Sound; import org.bukkit.entity.Player; @@ -40,7 +35,7 @@ public class RandomBoxEffect extends GameGiftEffect { if (i >= 12) { player.sendTitle("§6随机盲盒", "§9整蛊效果: §e" + eventName); player.playSound(player.getLocation(), Sound.BLOCK_COMPARATOR_CLICK, 1, 1); - EffectQueueManager.addGiftEffect(getAudience(), eventName, 1); + PixelLiveAPI.getEffectQueueManager().addEffect(getAudience(), eventName, 1); Bukkit.broadcastMessage("§c[消息]§a随机盲盒抽中了 §e" + eventName); cancel(); return; @@ -49,8 +44,8 @@ public class RandomBoxEffect extends GameGiftEffect { player.playSound(player.getLocation(), Sound.BLOCK_COMPARATOR_CLICK, 1, 1); i++; } - }.runTaskTimer(Main.plugin, 0L, 5L); - Main.game.addTasks(task); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 5L); + EnderDragonWar.game.addTasks(task); } private List getEffects() { diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/SpawnBuildEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/SpawnBuildEffect.java similarity index 62% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/SpawnBuildEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/SpawnBuildEffect.java index b0d1aea..9ad350b 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/SpawnBuildEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/SpawnBuildEffect.java @@ -1,8 +1,8 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.util.WEUtil; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; +import com.yaohun.enderdragonwar.util.WEUtil; import org.bukkit.entity.Player; public class SpawnBuildEffect extends GameGiftEffect { diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/SpawnEnderPortalEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/SpawnEnderPortalEffect.java similarity index 91% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/SpawnEnderPortalEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/SpawnEnderPortalEffect.java index 657aabe..ee32761 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/SpawnEnderPortalEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/SpawnEnderPortalEffect.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.WorldEdit; @@ -6,11 +6,11 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.data.Region; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.util.BuildSpawner; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.data.Region; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; +import com.yaohun.enderdragonwar.util.BuildSpawner; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; @@ -59,7 +59,7 @@ public class SpawnEnderPortalEffect extends GameGiftEffect { int platformWidth = 3; int platformLength = 7; int levelAmount = 15; - Main.game.takeLiveTime(60 * 6); + EnderDragonWar.game.takeLiveTime(60 * 6); World world = game.getWorld(); Player player = game.getPlayer(); Location location = player.getLocation(); diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/SummonIronGolem.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/SummonIronGolem.java similarity index 78% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/SummonIronGolem.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/SummonIronGolem.java index 2219d14..8964de2 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/SummonIronGolem.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/SummonIronGolem.java @@ -1,7 +1,7 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/SummonMobsEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/SummonMobsEffect.java similarity index 83% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/SummonMobsEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/SummonMobsEffect.java index b26a572..100764b 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/SummonMobsEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/SummonMobsEffect.java @@ -1,8 +1,8 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; -import com.yaohun.enderdragonwars.util.RandomUtil; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; +import com.yaohun.enderdragonwar.util.RandomUtil; import org.bukkit.entity.Creeper; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/TakeMaxHealthEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/TakeMaxHealthEffect.java similarity index 81% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/TakeMaxHealthEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/TakeMaxHealthEffect.java index f798b42..1059155 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/TakeMaxHealthEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/TakeMaxHealthEffect.java @@ -1,7 +1,7 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.Particle; import org.bukkit.attribute.Attribute; import org.bukkit.entity.Player; diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/ToHeavenEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/ToHeavenEffect.java similarity index 79% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/ToHeavenEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/ToHeavenEffect.java index 44c40ed..a9e4f67 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/ToHeavenEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/ToHeavenEffect.java @@ -1,8 +1,8 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.Vector; @@ -17,7 +17,7 @@ public class ToHeavenEffect extends GameGiftEffect { public void apply(Game game) { Player player = game.getPlayer(); double radius = 1.5D; - Main.game.takeLiveTime(60); + EnderDragonWar.game.takeLiveTime(60); new BukkitRunnable() { private int count = 0; private double angle = 0; @@ -41,7 +41,7 @@ public class ToHeavenEffect extends GameGiftEffect { } count++; } - }.runTaskTimer(Main.plugin, 0L, 1L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 1L); } } diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/WorldDestroyEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/WorldDestroyEffect.java similarity index 56% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/WorldDestroyEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/WorldDestroyEffect.java index 5ac45b7..5d3cbe0 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/WorldDestroyEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/WorldDestroyEffect.java @@ -1,7 +1,7 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; public class WorldDestroyEffect extends GameGiftEffect { diff --git a/src/main/java/com/yaohun/enderdragonwars/effect/types/WuHuJumpEffect.java b/src/main/java/com/yaohun/enderdragonwar/effect/types/WuHuJumpEffect.java similarity index 84% rename from src/main/java/com/yaohun/enderdragonwars/effect/types/WuHuJumpEffect.java rename to src/main/java/com/yaohun/enderdragonwar/effect/types/WuHuJumpEffect.java index cca65b1..c499505 100644 --- a/src/main/java/com/yaohun/enderdragonwars/effect/types/WuHuJumpEffect.java +++ b/src/main/java/com/yaohun/enderdragonwar/effect/types/WuHuJumpEffect.java @@ -1,8 +1,8 @@ -package com.yaohun.enderdragonwars.effect.types; +package com.yaohun.enderdragonwar.effect.types; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.effect.GameGiftEffect; -import com.yaohun.enderdragonwars.game.Game; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.effect.GameGiftEffect; +import com.yaohun.enderdragonwar.game.Game; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Sound; @@ -39,7 +39,7 @@ public class WuHuJumpEffect extends GameGiftEffect { location.getWorld().playSound(location, Sound.ENTITY_CREEPER_PRIMED, 1.0f, 1.0f); i++; } - }.runTaskTimer(Main.plugin, 2L, 1L); + }.runTaskTimer(EnderDragonWar.plugin, 2L, 1L); game.addTasks(task); } diff --git a/src/main/java/com/yaohun/enderdragonwars/game/Game.java b/src/main/java/com/yaohun/enderdragonwar/game/Game.java similarity index 96% rename from src/main/java/com/yaohun/enderdragonwars/game/Game.java rename to src/main/java/com/yaohun/enderdragonwar/game/Game.java index 574ed74..b207301 100644 --- a/src/main/java/com/yaohun/enderdragonwars/game/Game.java +++ b/src/main/java/com/yaohun/enderdragonwar/game/Game.java @@ -1,7 +1,7 @@ -package com.yaohun.enderdragonwars.game; +package com.yaohun.enderdragonwar.game; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.util.BossBarUtil; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.util.BossBarUtil; import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.World; @@ -98,7 +98,7 @@ public class Game { liveTime = liveTime - 500; updateBossBar(); } - }.runTaskTimer(Main.plugin, 0L, 10L)); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 10L)); } public void rejoinGame(Player player) { diff --git a/src/main/java/com/yaohun/enderdragonwar/game/GameSetting.java b/src/main/java/com/yaohun/enderdragonwar/game/GameSetting.java new file mode 100644 index 0000000..fd536f0 --- /dev/null +++ b/src/main/java/com/yaohun/enderdragonwar/game/GameSetting.java @@ -0,0 +1,23 @@ +package com.yaohun.enderdragonwar.game; + +import com.io.yutian.pixelliveapi.api.PixelLiveAPI; + +public class GameSetting { + + private static int dianzanAmount; + private static String dianzanEffect; + + public static void load() { + dianzanAmount = Integer.parseInt(PixelLiveAPI.getExtraDataManager().getConfigValue("点赞数量", "100")); + dianzanEffect = PixelLiveAPI.getExtraDataManager().getConfigValue("点赞效果", "幸运方块"); + } + + public static int getDianzanAmount() { + return dianzanAmount; + } + + public static String getDianzanEffect() { + return dianzanEffect; + } + +} diff --git a/src/main/java/com/yaohun/enderdragonwars/listener/GameListener.java b/src/main/java/com/yaohun/enderdragonwar/listener/GameListener.java similarity index 80% rename from src/main/java/com/yaohun/enderdragonwars/listener/GameListener.java rename to src/main/java/com/yaohun/enderdragonwar/listener/GameListener.java index 5ec308e..692ba2c 100644 --- a/src/main/java/com/yaohun/enderdragonwars/listener/GameListener.java +++ b/src/main/java/com/yaohun/enderdragonwar/listener/GameListener.java @@ -1,15 +1,13 @@ -package com.yaohun.enderdragonwars.listener; +package com.yaohun.enderdragonwar.listener; -import com.yaohun.enderdragonwars.Main; +import com.yaohun.enderdragonwar.EnderDragonWar; import org.bukkit.entity.EnderDragon; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent; -import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerKickEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.server.ServerListPingEvent; import org.bukkit.scheduler.BukkitRunnable; @@ -24,12 +22,12 @@ public class GameListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); - Main.game.startGame(player); + EnderDragonWar.game.startGame(player); } @EventHandler public void onPlayerQuit(PlayerQuitEvent event) { - Main.game.quitGame(event.getPlayer()); + EnderDragonWar.game.quitGame(event.getPlayer()); } /* @@ -48,19 +46,19 @@ public class GameListener implements Listener { } // 增加游戏时间5分钟 if (i == 3) { - Main.game.addLiveTime(5); + EnderDragonWar.game.addLiveTime(5); p.sendTitle("§4你嘎了", "§e加播5分钟!"); cancel(); } i++; } - }.runTaskTimer(Main.plugin, 0L, 2L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 2L); } @EventHandler public void onEntityDeath(EntityDeathEvent event) { if (event.getEntity() instanceof EnderDragon) { - Main.game.takeLiveTime(60); + EnderDragonWar.game.takeLiveTime(60); } } diff --git a/src/main/java/com/yaohun/enderdragonwars/listener/LiveListener.java b/src/main/java/com/yaohun/enderdragonwar/listener/LiveListener.java similarity index 70% rename from src/main/java/com/yaohun/enderdragonwars/listener/LiveListener.java rename to src/main/java/com/yaohun/enderdragonwar/listener/LiveListener.java index 943abb9..d97b5d7 100644 --- a/src/main/java/com/yaohun/enderdragonwars/listener/LiveListener.java +++ b/src/main/java/com/yaohun/enderdragonwar/listener/LiveListener.java @@ -1,17 +1,17 @@ -package com.yaohun.enderdragonwars.listener; +package com.yaohun.enderdragonwar.listener; -import com.io.yutian.pixelliveapi.api.Anchor; -import com.io.yutian.pixelliveapi.api.Audience; -import com.io.yutian.pixelliveapi.api.Gift; +import com.io.yutian.pixelliveapi.api.PixelLiveAPI; +import com.io.yutian.pixelliveapi.api.data.Anchor; +import com.io.yutian.pixelliveapi.api.data.Audience; +import com.io.yutian.pixelliveapi.api.data.Gift; +import com.io.yutian.pixelliveapi.api.effect.GiftEffectData; import com.io.yutian.pixelliveapi.api.event.AnchorInitializedEvent; import com.io.yutian.pixelliveapi.api.event.LiveGiftEvent; import com.io.yutian.pixelliveapi.api.event.LiveLikeEvent; -import com.io.yutian.pixelliveapi.effect.GiftEffectData; -import com.io.yutian.pixelliveapi.manager.*; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.game.GameSetting; -import com.yaohun.enderdragonwars.util.GameUtil; -import com.yaohun.enderdragonwars.util.RandomUtil; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.game.GameSetting; +import com.yaohun.enderdragonwar.util.GameUtil; +import com.yaohun.enderdragonwar.util.RandomUtil; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -34,14 +34,14 @@ public class LiveListener implements Listener { userName = audience.getNickName(); } int count = event.getClickCount(); - Main.game.addDianZan(count); - if (Main.game.getDianzan() >= GameSetting.getDianzanAmount()) { + EnderDragonWar.game.addDianZan(count); + if (EnderDragonWar.game.getDianzan() >= GameSetting.getDianzanAmount()) { String event1 = GameSetting.getDianzanEffect(); String title = "§c" + event1; String subtitle = "§9双击屏幕x" + GameSetting.getDianzanAmount(); zhubo.sendTitle(title, subtitle, 10, 30, 10); - EffectQueueManager.addGiftEffect(userName, event1, 1); - Main.game.setDianzan(0); + PixelLiveAPI.getEffectQueueManager().addEffect(userName, event1, 1); + EnderDragonWar.game.setDianzan(0); } } @@ -55,10 +55,10 @@ public class LiveListener implements Listener { String giftName = gift.getName(); int giftAmount = event.getCount(); String hideUserName = GameUtil.hideName(userName); - if (!GiftManager.hasGiftData(giftName)) { + if (!PixelLiveAPI.getGiftManager().hasGiftData(giftName)) { return; } - GiftEffectData giftEffectData = GiftManager.getGiftData(giftName); + GiftEffectData giftEffectData = PixelLiveAPI.getGiftManager().getGiftData(giftName); String effect = giftEffectData.getEffect(); String title = "§c" + effect; if (giftAmount >= 2) { diff --git a/src/main/java/com/yaohun/enderdragonwars/listener/PlayerListener.java b/src/main/java/com/yaohun/enderdragonwar/listener/PlayerListener.java similarity index 96% rename from src/main/java/com/yaohun/enderdragonwars/listener/PlayerListener.java rename to src/main/java/com/yaohun/enderdragonwar/listener/PlayerListener.java index bd6a2fa..09afefa 100644 --- a/src/main/java/com/yaohun/enderdragonwars/listener/PlayerListener.java +++ b/src/main/java/com/yaohun/enderdragonwar/listener/PlayerListener.java @@ -1,7 +1,7 @@ -package com.yaohun.enderdragonwars.listener; +package com.yaohun.enderdragonwar.listener; -import com.yaohun.enderdragonwars.effect.types.LuckyBlockEffect; -import com.yaohun.enderdragonwars.effect.types.SpawnEnderPortalEffect; +import com.yaohun.enderdragonwar.effect.types.LuckyBlockEffect; +import com.yaohun.enderdragonwar.effect.types.SpawnEnderPortalEffect; import org.bukkit.*; import org.bukkit.block.Block; import org.bukkit.entity.*; diff --git a/src/main/java/com/yaohun/enderdragonwar/manager/GiftEffectManager.java b/src/main/java/com/yaohun/enderdragonwar/manager/GiftEffectManager.java new file mode 100644 index 0000000..6782f72 --- /dev/null +++ b/src/main/java/com/yaohun/enderdragonwar/manager/GiftEffectManager.java @@ -0,0 +1,30 @@ +package com.yaohun.enderdragonwar.manager; + +import com.io.yutian.pixelliveapi.api.PixelLiveAPI; +import com.yaohun.enderdragonwar.effect.types.*; + +public class GiftEffectManager { + + public static void registerAll() { + PixelLiveAPI.getEffectManager().registerGiftEffect("清理背包", ClearInventoryEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("火山喷发", BomBomEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("幸运方块", LuckyBlockEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("黑洞", BlackHoleEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("五雷轰顶", FiveLightningEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("装备清空", ClearInventoryEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("岩浆泡澡", LavaPoolEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("钢铁保安", SummonIronGolem::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("6倍血量", AddMaxHealthEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("原地复活", GiveTotemEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("魔豆天梯", SpawnEnderPortalEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("世界毁灭", WorldDestroyEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("变大", PlayerBigEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("变小", PlayerSmallEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("安全庇护所", SpawnBuildEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("螺旋升天", ToHeavenEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("怪物军团", SummonMobsEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("芜湖起飞", WuHuJumpEffect::new); + PixelLiveAPI.getEffectManager().registerGiftEffect("随机盲盒", RandomBoxEffect::new); + } + +} diff --git a/src/main/java/com/yaohun/enderdragonwars/util/BossBarUtil.java b/src/main/java/com/yaohun/enderdragonwar/util/BossBarUtil.java similarity index 97% rename from src/main/java/com/yaohun/enderdragonwars/util/BossBarUtil.java rename to src/main/java/com/yaohun/enderdragonwar/util/BossBarUtil.java index 068a641..4f43bf5 100644 --- a/src/main/java/com/yaohun/enderdragonwars/util/BossBarUtil.java +++ b/src/main/java/com/yaohun/enderdragonwar/util/BossBarUtil.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.util; +package com.yaohun.enderdragonwar.util; import org.bukkit.boss.BarColor; import org.bukkit.boss.BossBar; diff --git a/src/main/java/com/yaohun/enderdragonwars/util/BuildSpawner.java b/src/main/java/com/yaohun/enderdragonwar/util/BuildSpawner.java similarity index 98% rename from src/main/java/com/yaohun/enderdragonwars/util/BuildSpawner.java rename to src/main/java/com/yaohun/enderdragonwar/util/BuildSpawner.java index 44973e9..e8eccc4 100644 --- a/src/main/java/com/yaohun/enderdragonwars/util/BuildSpawner.java +++ b/src/main/java/com/yaohun/enderdragonwar/util/BuildSpawner.java @@ -1,8 +1,8 @@ -package com.yaohun.enderdragonwars.util; +package com.yaohun.enderdragonwar.util; -import com.yaohun.enderdragonwars.Main; -import com.yaohun.enderdragonwars.data.Point; -import com.yaohun.enderdragonwars.data.Region; +import com.yaohun.enderdragonwar.EnderDragonWar; +import com.yaohun.enderdragonwar.data.Point; +import com.yaohun.enderdragonwar.data.Region; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.World; @@ -274,7 +274,7 @@ public class BuildSpawner { transformDirection(); count++; } - }.runTaskTimer(Main.plugin, 0L, 3L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 3L); } @Override @@ -380,7 +380,7 @@ public class BuildSpawner { transformDirection(); count++; } - }.runTaskTimer(Main.plugin, 0L, 3L); + }.runTaskTimer(EnderDragonWar.plugin, 0L, 3L); } @Override diff --git a/src/main/java/com/yaohun/enderdragonwars/util/EntityUtil.java b/src/main/java/com/yaohun/enderdragonwar/util/EntityUtil.java similarity index 93% rename from src/main/java/com/yaohun/enderdragonwars/util/EntityUtil.java rename to src/main/java/com/yaohun/enderdragonwar/util/EntityUtil.java index 5637c0b..ca4b5f9 100644 --- a/src/main/java/com/yaohun/enderdragonwars/util/EntityUtil.java +++ b/src/main/java/com/yaohun/enderdragonwar/util/EntityUtil.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.util; +package com.yaohun.enderdragonwar.util; import org.bukkit.entity.Entity; import org.bukkit.util.Vector; diff --git a/src/main/java/com/yaohun/enderdragonwars/util/GameUtil.java b/src/main/java/com/yaohun/enderdragonwar/util/GameUtil.java similarity index 97% rename from src/main/java/com/yaohun/enderdragonwars/util/GameUtil.java rename to src/main/java/com/yaohun/enderdragonwar/util/GameUtil.java index 8e0dd0e..b7241ba 100644 --- a/src/main/java/com/yaohun/enderdragonwars/util/GameUtil.java +++ b/src/main/java/com/yaohun/enderdragonwar/util/GameUtil.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.util; +package com.yaohun.enderdragonwar.util; import org.bukkit.Bukkit; import org.bukkit.entity.Player; diff --git a/src/main/java/com/yaohun/enderdragonwars/util/ItemStackBuilder.java b/src/main/java/com/yaohun/enderdragonwar/util/ItemStackBuilder.java similarity index 99% rename from src/main/java/com/yaohun/enderdragonwars/util/ItemStackBuilder.java rename to src/main/java/com/yaohun/enderdragonwar/util/ItemStackBuilder.java index 5aca7fb..84a1984 100644 --- a/src/main/java/com/yaohun/enderdragonwars/util/ItemStackBuilder.java +++ b/src/main/java/com/yaohun/enderdragonwar/util/ItemStackBuilder.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.util; +package com.yaohun.enderdragonwar.util; import org.bukkit.ChatColor; import org.bukkit.FireworkEffect; diff --git a/src/main/java/com/yaohun/enderdragonwars/util/RandomUtil.java b/src/main/java/com/yaohun/enderdragonwar/util/RandomUtil.java similarity index 95% rename from src/main/java/com/yaohun/enderdragonwars/util/RandomUtil.java rename to src/main/java/com/yaohun/enderdragonwar/util/RandomUtil.java index d578ebe..9628ff1 100644 --- a/src/main/java/com/yaohun/enderdragonwars/util/RandomUtil.java +++ b/src/main/java/com/yaohun/enderdragonwar/util/RandomUtil.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.util; +package com.yaohun.enderdragonwar.util; import java.util.Random; diff --git a/src/main/java/com/yaohun/enderdragonwars/util/WEUtil.java b/src/main/java/com/yaohun/enderdragonwar/util/WEUtil.java similarity index 79% rename from src/main/java/com/yaohun/enderdragonwars/util/WEUtil.java rename to src/main/java/com/yaohun/enderdragonwar/util/WEUtil.java index d6a9a3c..422a817 100644 --- a/src/main/java/com/yaohun/enderdragonwars/util/WEUtil.java +++ b/src/main/java/com/yaohun/enderdragonwar/util/WEUtil.java @@ -1,4 +1,4 @@ -package com.yaohun.enderdragonwars.util; +package com.yaohun.enderdragonwar.util; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.WorldEdit; @@ -6,7 +6,7 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.math.BlockVector3; -import com.yaohun.enderdragonwars.Main; +import com.yaohun.enderdragonwar.EnderDragonWar; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; @@ -16,17 +16,17 @@ import java.io.File; public class WEUtil { public static void loadSchematics(Location location, String fileName) { - File path = new File(Main.plugin.getDataFolder(), "schematics"); + File path = new File(EnderDragonWar.plugin.getDataFolder(), "schematics"); if (!path.exists()) { path.mkdirs(); } File schematicFile = new File(path, fileName + ".schem"); if (!schematicFile.exists()) { - Main.plugin.saveResource("schematics/" + fileName + ".schem", false); + EnderDragonWar.plugin.saveResource("schematics/" + fileName + ".schem", false); } World world = location.getWorld(); EditSession editSession = WorldEdit.getInstance().newEditSession(BukkitAdapter.adapt(world)); - Bukkit.getScheduler().runTaskAsynchronously(Main.plugin, () -> { + Bukkit.getScheduler().runTaskAsynchronously(EnderDragonWar.plugin, () -> { try { Clipboard clipboard = ClipboardFormats.findByFile(schematicFile).load(schematicFile); clipboard.paste(BukkitAdapter.adapt(world), BlockVector3.at(location.getBlockX(), location.getBlockY(), location.getBlockZ())); diff --git a/src/main/java/com/yaohun/enderdragonwars/game/GameSetting.java b/src/main/java/com/yaohun/enderdragonwars/game/GameSetting.java deleted file mode 100644 index 5f9112b..0000000 --- a/src/main/java/com/yaohun/enderdragonwars/game/GameSetting.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yaohun.enderdragonwars.game; - -import com.io.yutian.pixelliveapi.manager.ExtraDataManager; - -public class GameSetting { - - private static int dianzanAmount; - private static String dianzanEffect; - - public static void load() { - dianzanAmount = Integer.parseInt(String.valueOf(ExtraDataManager.getConfigValues().getOrDefault("点赞数量", 100))); - dianzanEffect = String.valueOf(ExtraDataManager.getConfigValues().getOrDefault("点赞效果", "幸运方块")); - } - - public static int getDianzanAmount() { - return dianzanAmount; - } - - public static String getDianzanEffect() { - return dianzanEffect; - } - -} diff --git a/src/main/java/com/yaohun/enderdragonwars/manager/GiftEffectManager.java b/src/main/java/com/yaohun/enderdragonwars/manager/GiftEffectManager.java deleted file mode 100644 index 1e79963..0000000 --- a/src/main/java/com/yaohun/enderdragonwars/manager/GiftEffectManager.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.yaohun.enderdragonwars.manager; - -import com.io.yutian.pixelliveapi.manager.EffectManager; -import com.yaohun.enderdragonwars.effect.types.*; - -public class GiftEffectManager { - - public static void registerAll() { - EffectManager.registerGiftEffect("清理背包", ClearInventoryEffect::new); - EffectManager.registerGiftEffect("火山喷发", BomBomEffect::new); - EffectManager.registerGiftEffect("幸运方块", LuckyBlockEffect::new); - EffectManager.registerGiftEffect("黑洞", BlackHoleEffect::new); - EffectManager.registerGiftEffect("五雷轰顶", FiveLightningEffect::new); - EffectManager.registerGiftEffect("装备清空", ClearInventoryEffect::new); - EffectManager.registerGiftEffect("岩浆泡澡", LavaPoolEffect::new); - EffectManager.registerGiftEffect("钢铁保安", SummonIronGolem::new); - EffectManager.registerGiftEffect("6倍血量", AddMaxHealthEffect::new); - EffectManager.registerGiftEffect("原地复活", GiveTotemEffect::new); - EffectManager.registerGiftEffect("魔豆天梯", SpawnEnderPortalEffect::new); - EffectManager.registerGiftEffect("世界毁灭", WorldDestroyEffect::new); - EffectManager.registerGiftEffect("变大", PlayerBigEffect::new); - EffectManager.registerGiftEffect("变小", PlayerSmallEffect::new); - EffectManager.registerGiftEffect("安全庇护所", SpawnBuildEffect::new); - EffectManager.registerGiftEffect("螺旋升天", ToHeavenEffect::new); - EffectManager.registerGiftEffect("怪物军团", SummonMobsEffect::new); - EffectManager.registerGiftEffect("芜湖起飞", WuHuJumpEffect::new); - EffectManager.registerGiftEffect("随机盲盒", RandomBoxEffect::new); - } - -} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 04c68e3..317f737 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: EnderDragonWar version: 1.0 api-version: 1.20 -main: com.yaohun.enderdragonwars.Main +main: com.yaohun.enderdragonwar.Main depend: [PixelLiveAPI] commands: enderdragonwar: diff --git a/src/main/resources/schematics/anquanwu.schem b/src/main/resources/schematics/anquanwu.schem index 00011bb..11aebe9 100644 Binary files a/src/main/resources/schematics/anquanwu.schem and b/src/main/resources/schematics/anquanwu.schem differ