From 26fcbeb44a99708d34b25b5556382bf3a014f72f Mon Sep 17 00:00:00 2001 From: Klnsyf-Sun Date: Thu, 17 May 2018 19:20:52 +0900 Subject: [PATCH] Update v1.1.0-SNAPSHOT.5 --- .../battleroyale/commands/Commands.java | 11 +- .../configuration/ConfigurationKey.java | 60 ++++++- .../events/EntityGlowingEvent.java | 47 ++++++ .../events/PlayerOpenBattlefieldGUIEvent.java | 40 +++++ .../PlayerRequestBattlefieldBookEvent.java | 40 +++++ .../initialization/Listeners.java | 24 ++- .../battleroyale/listeners/EntityGlowing.java | 90 +++++++++++ .../battleroyale/listeners/OreAutoMelt.java | 18 ++- .../PlayerAccelerateWorldBorderShrinking.java | 8 +- .../listeners/PlayerBreakBlock.java | 50 ++++++ .../listeners/PlayerSummonBlaze.java | 6 +- .../listeners/PlayerUseCompass.java | 6 +- .../PlayerOpenBattlefieldGUI.java | 147 ++++++++++++++++++ .../PlayerRequestBattlefieldBook.java | 49 ++++++ .../listeners/{ => system}/BattleEnd.java | 2 +- .../listeners/{ => system}/BattleLoad.java | 12 +- .../listeners/{ => system}/BattleStart.java | 2 +- .../{ => system}/BattlefieldPreset.java | 2 +- .../{ => system}/BattlefieldProtect.java | 2 +- .../{ => system}/PlayerJoinBattlefield.java | 2 +- .../listeners/{ => system}/PlayerQuit.java | 2 +- .../{ => system}/PlayerQuitBattlefield.java | 2 +- .../utils/WorldBorderHandler.java | 1 - src/main/resources/configuration/default.yml | 26 ++-- src/main/resources/plugin.yml | 2 +- 25 files changed, 598 insertions(+), 53 deletions(-) create mode 100644 src/main/java/com/klnsyf/battleroyale/events/EntityGlowingEvent.java create mode 100644 src/main/java/com/klnsyf/battleroyale/events/PlayerOpenBattlefieldGUIEvent.java create mode 100644 src/main/java/com/klnsyf/battleroyale/events/PlayerRequestBattlefieldBookEvent.java create mode 100644 src/main/java/com/klnsyf/battleroyale/listeners/EntityGlowing.java create mode 100644 src/main/java/com/klnsyf/battleroyale/listeners/PlayerBreakBlock.java create mode 100644 src/main/java/com/klnsyf/battleroyale/listeners/battlefieldGUI/PlayerOpenBattlefieldGUI.java create mode 100644 src/main/java/com/klnsyf/battleroyale/listeners/battlefieldGUI/PlayerRequestBattlefieldBook.java rename src/main/java/com/klnsyf/battleroyale/listeners/{ => system}/BattleEnd.java (96%) rename src/main/java/com/klnsyf/battleroyale/listeners/{ => system}/BattleLoad.java (95%) rename src/main/java/com/klnsyf/battleroyale/listeners/{ => system}/BattleStart.java (98%) rename src/main/java/com/klnsyf/battleroyale/listeners/{ => system}/BattlefieldPreset.java (99%) rename src/main/java/com/klnsyf/battleroyale/listeners/{ => system}/BattlefieldProtect.java (97%) rename src/main/java/com/klnsyf/battleroyale/listeners/{ => system}/PlayerJoinBattlefield.java (98%) rename src/main/java/com/klnsyf/battleroyale/listeners/{ => system}/PlayerQuit.java (93%) rename src/main/java/com/klnsyf/battleroyale/listeners/{ => system}/PlayerQuitBattlefield.java (97%) diff --git a/src/main/java/com/klnsyf/battleroyale/commands/Commands.java b/src/main/java/com/klnsyf/battleroyale/commands/Commands.java index c329d04..97d3ba7 100644 --- a/src/main/java/com/klnsyf/battleroyale/commands/Commands.java +++ b/src/main/java/com/klnsyf/battleroyale/commands/Commands.java @@ -14,6 +14,7 @@ import com.klnsyf.battleroyale.events.BattlefieldPresetEvent; import com.klnsyf.battleroyale.events.PlayerJoinBattlefieldEvent; import com.klnsyf.battleroyale.events.PlayerQuitBattlefieldEvent; +import com.klnsyf.battleroyale.events.PlayerRequestBattlefieldBookEvent; import com.klnsyf.battleroyale.messages.MessageKey; import com.klnsyf.battleroyale.messages.Messages; @@ -109,15 +110,17 @@ public void preset(CommandSender sender, String[] args) { @SubCommand(command = "join", premission = "battleroyale.join", arg = "[worldName]", des = "Join into preseted battlefield") public void join(CommandSender sender, String[] args) { if (sender.hasPermission("battleroyale.join")) { - if (args.length == 2) { - if (sender instanceof Player) { + if (sender instanceof Player) { + if (args.length == 1) { + server.getPluginManager().callEvent(new PlayerRequestBattlefieldBookEvent((Player) sender)); + } else if (args.length == 2) { server.getPluginManager() .callEvent(new PlayerJoinBattlefieldEvent((Player) sender, args[1])); } else { - sender.sendMessage("[¡ì6Battle Royale¡ìr] ¡ìcOnly Player can use this command"); + sender.sendMessage("[¡ì6Battle Royale¡ìr] ¡ìcInvaild amount of arguments"); } } else { - sender.sendMessage("[¡ì6Battle Royale¡ìr] ¡ìcInvaild amount of arguments"); + sender.sendMessage("[¡ì6Battle Royale¡ìr] ¡ìcOnly Player can use this command"); } } else { sender.sendMessage("[¡ì6Battle Royale¡ìr] ¡ìcYou do not have permission to use this command"); diff --git a/src/main/java/com/klnsyf/battleroyale/configuration/ConfigurationKey.java b/src/main/java/com/klnsyf/battleroyale/configuration/ConfigurationKey.java index 7faeddd..826cf43 100644 --- a/src/main/java/com/klnsyf/battleroyale/configuration/ConfigurationKey.java +++ b/src/main/java/com/klnsyf/battleroyale/configuration/ConfigurationKey.java @@ -26,6 +26,7 @@ public enum ConfigurationKey { BATTLE_MISC_COMPASS_ENABLED("battle-misc-option.compass-option.enabled", boolean.class, true), BATTLE_MISC_COMPASS_MODE("battle-misc-option.compass-option.mode", boolean.class, true), BATTLE_MISC_COMPASS_COOLDOWN("battle-misc-option.compass-option.cooldown", int.class, 100), + BATTLE_MISC_COMPASS_IGNORE_INVISIBLE("battle-misc-option.compass-option.ignore-invisible", boolean.class, true), BATTLE_MISC_COMPASS_MAX_SHOWN_PLAYER("battle-misc-option.compass-option.max-shown-player", int.class, 4), BATTLE_MISC_SHRINK_ACCELERATING_ENABLED("battle-misc-option.shrink-accelerating-option.enabled", boolean.class, true), BATTLE_MISC_SHRINK_ACCELERATING_ITEM("battle-misc-option.shrink-accelerating-option.active-item", String.class, @@ -37,7 +38,15 @@ public enum ConfigurationKey { BATTLE_MISC_SUMMON_BLAZE_ENABLED("battle-misc-option.summon-blaze.enabled", boolean.class, true), BATTLE_MISC_DEATHMATCH_ENABLED("battle-misc-option.deathmatch.enabled", boolean.class, true), BATTLE_MISC_KILLER_BONUS_HEALTH("battle-misc-option.killer-bonus.health", int.class, 5), - BATTLE_MISC_KILLER_BONUS_SATURATION("battle-misc-option.killer-bonus.saturation", int.class, 5); + BATTLE_MISC_KILLER_BONUS_SATURATION("battle-misc-option.killer-bonus.saturation", int.class, 5), + BATTLE_MISC_DROP_LIST("battle-misc-option.drop-list", ArrayList.class, ConfigurationKey.DEFAULT_DROP_LIST), + BATTLE_MISC_PLAYER_GLOWING_ENABLED("battle-misc-option.player-glowing-option.enabled", boolean.class, true), + BATTLE_MISC_PLAYER_GLOWING_ITEM("battle-misc-option.player-glowing-option.activate-item", String.class, "GLOWSTONE"), + BATTLE_MISC_PLAYER_GLOWING_DURATION("battle-misc-option.player-glowing-option.duration", int.class, 20), + BATTLE_MISC_PLAYER_GLOWING_RADIUS("battle-misc-option.player-glowing-option.radius", int.class, 32), + BATTLE_MISC_PLAYER_GLOWING_IGNORE_INVISIBLE("battle-misc-option.player-glowing-option.ignore-invisible", boolean.class, + true), + ; private String path; private Class clazz; @@ -48,19 +57,60 @@ public enum ConfigurationKey { add(new HashMap() { private static final long serialVersionUID = 1L; { - put("REDSTONE", 1); + put("BREAD", 4); } }); add(new HashMap() { private static final long serialVersionUID = 1L; { - put("BREAD", 4); + put("BOAT", 1); } }); - add(new HashMap() { + } + }; + + private final static ArrayList>>> DEFAULT_DROP_LIST = new ArrayList>>>() { + private static final long serialVersionUID = 1L; + { + add(new HashMap>>() { private static final long serialVersionUID = 1L; { - put("BOAT", 1); + put("STONE", + new ArrayList>() { + private static final long serialVersionUID = 1L; + { + add(new HashMap() { + private static final long serialVersionUID = 1L; + { + put("REDSTONE", 1000); + } + }); + add(new HashMap() { + private static final long serialVersionUID = 1L; + { + put("GLOWSTONE_DUST", 1000); + } + }); + add(new HashMap() { + private static final long serialVersionUID = 1L; + { + put("GLOWSTONE_DUST", 1000); + } + }); + add(new HashMap() { + private static final long serialVersionUID = 1L; + { + put("GLOWSTONE_DUST", 1000); + } + }); + add(new HashMap() { + private static final long serialVersionUID = 1L; + { + put("GLOWSTONE_DUST", 1000); + } + }); + } + }); } }); } diff --git a/src/main/java/com/klnsyf/battleroyale/events/EntityGlowingEvent.java b/src/main/java/com/klnsyf/battleroyale/events/EntityGlowingEvent.java new file mode 100644 index 0000000..6c24fbb --- /dev/null +++ b/src/main/java/com/klnsyf/battleroyale/events/EntityGlowingEvent.java @@ -0,0 +1,47 @@ +package com.klnsyf.battleroyale.events; + +import org.bukkit.World; +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class EntityGlowingEvent extends Event implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private final World world; + private final Player player; + + public EntityGlowingEvent(World world, Player player) { + super(false); + this.world = world; + this.player = player; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancel) { + this.cancelled = cancel; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } + + public World getWorld() { + return world; + } + + public Player getPlayer() { + return player; + } +} diff --git a/src/main/java/com/klnsyf/battleroyale/events/PlayerOpenBattlefieldGUIEvent.java b/src/main/java/com/klnsyf/battleroyale/events/PlayerOpenBattlefieldGUIEvent.java new file mode 100644 index 0000000..c52fc89 --- /dev/null +++ b/src/main/java/com/klnsyf/battleroyale/events/PlayerOpenBattlefieldGUIEvent.java @@ -0,0 +1,40 @@ +package com.klnsyf.battleroyale.events; + +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class PlayerOpenBattlefieldGUIEvent extends Event implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private final Player player; + + public PlayerOpenBattlefieldGUIEvent(Player player) { + super(false); + this.player = player; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancel) { + this.cancelled = cancel; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } + + public Player getPlayer() { + return player; + } +} diff --git a/src/main/java/com/klnsyf/battleroyale/events/PlayerRequestBattlefieldBookEvent.java b/src/main/java/com/klnsyf/battleroyale/events/PlayerRequestBattlefieldBookEvent.java new file mode 100644 index 0000000..c865430 --- /dev/null +++ b/src/main/java/com/klnsyf/battleroyale/events/PlayerRequestBattlefieldBookEvent.java @@ -0,0 +1,40 @@ +package com.klnsyf.battleroyale.events; + +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class PlayerRequestBattlefieldBookEvent extends Event implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private final Player player; + + public PlayerRequestBattlefieldBookEvent(Player player) { + super(false); + this.player = player; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancel) { + this.cancelled = cancel; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } + + public Player getPlayer() { + return player; + } +} diff --git a/src/main/java/com/klnsyf/battleroyale/initialization/Listeners.java b/src/main/java/com/klnsyf/battleroyale/initialization/Listeners.java index f65a615..422377a 100644 --- a/src/main/java/com/klnsyf/battleroyale/initialization/Listeners.java +++ b/src/main/java/com/klnsyf/battleroyale/initialization/Listeners.java @@ -2,21 +2,25 @@ import com.klnsyf.battleroyale.listeners.AnimalProtection; import com.klnsyf.battleroyale.listeners.AutoLapis; -import com.klnsyf.battleroyale.listeners.BattleEnd; -import com.klnsyf.battleroyale.listeners.BattleLoad; -import com.klnsyf.battleroyale.listeners.BattleStart; -import com.klnsyf.battleroyale.listeners.BattlefieldPreset; -import com.klnsyf.battleroyale.listeners.BattlefieldProtect; import com.klnsyf.battleroyale.listeners.DeathMatch; import com.klnsyf.battleroyale.listeners.OreAutoMelt; import com.klnsyf.battleroyale.listeners.PlayerAccelerateWorldBorderShrinking; +import com.klnsyf.battleroyale.listeners.PlayerBreakBlock; import com.klnsyf.battleroyale.listeners.PlayerDeath; -import com.klnsyf.battleroyale.listeners.PlayerJoinBattlefield; -import com.klnsyf.battleroyale.listeners.PlayerQuit; -import com.klnsyf.battleroyale.listeners.PlayerQuitBattlefield; +import com.klnsyf.battleroyale.listeners.EntityGlowing; import com.klnsyf.battleroyale.listeners.PlayerSummonBlaze; import com.klnsyf.battleroyale.listeners.PlayerThrowPrimedTnt; import com.klnsyf.battleroyale.listeners.PlayerUseCompass; +import com.klnsyf.battleroyale.listeners.battlefieldGUI.PlayerOpenBattlefieldGUI; +import com.klnsyf.battleroyale.listeners.battlefieldGUI.PlayerRequestBattlefieldBook; +import com.klnsyf.battleroyale.listeners.system.BattleEnd; +import com.klnsyf.battleroyale.listeners.system.BattleLoad; +import com.klnsyf.battleroyale.listeners.system.BattleStart; +import com.klnsyf.battleroyale.listeners.system.BattlefieldPreset; +import com.klnsyf.battleroyale.listeners.system.BattlefieldProtect; +import com.klnsyf.battleroyale.listeners.system.PlayerJoinBattlefield; +import com.klnsyf.battleroyale.listeners.system.PlayerQuit; +import com.klnsyf.battleroyale.listeners.system.PlayerQuitBattlefield; public class Listeners { @@ -31,10 +35,14 @@ public void initListeners() { new DeathMatch(); new OreAutoMelt(); new PlayerAccelerateWorldBorderShrinking(); + new PlayerBreakBlock(); new PlayerDeath(); + new EntityGlowing(); new PlayerJoinBattlefield(); + new PlayerOpenBattlefieldGUI(); new PlayerQuit(); new PlayerQuitBattlefield(); + new PlayerRequestBattlefieldBook(); new PlayerSummonBlaze(); new PlayerThrowPrimedTnt(); new PlayerUseCompass(); diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/EntityGlowing.java b/src/main/java/com/klnsyf/battleroyale/listeners/EntityGlowing.java new file mode 100644 index 0000000..1f0389f --- /dev/null +++ b/src/main/java/com/klnsyf/battleroyale/listeners/EntityGlowing.java @@ -0,0 +1,90 @@ +package com.klnsyf.battleroyale.listeners; + +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.Server; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerToggleSneakEvent; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +import com.klnsyf.battleroyale.BattleRoyale; +import com.klnsyf.battleroyale.battlefield.BattlefieldHandler; +import com.klnsyf.battleroyale.configuration.Configuration; +import com.klnsyf.battleroyale.configuration.ConfigurationKey; +import com.klnsyf.battleroyale.events.EntityGlowingEvent; + +public class EntityGlowing implements Listener { + private final BattleRoyale plugin = BattleRoyale.plugin; + private final Server server = BattleRoyale.server; + private final Configuration configuration = new Configuration(); + + public EntityGlowing() { + server.getPluginManager().registerEvents(this, plugin); + } + + @EventHandler + public void onPlayerGlowing(PlayerToggleSneakEvent event) { + if (BattlefieldHandler.battlefields.get(event.getPlayer().getWorld()) != null) { + if (BattlefieldHandler.battlefields.get(event.getPlayer().getWorld()).getStatue() == 2) { + if ((boolean) configuration.getValue(event.getPlayer().getWorld(), + ConfigurationKey.BATTLE_MISC_PLAYER_GLOWING_ENABLED)) { + if (event.getPlayer().getInventory().getItemInOffHand().getType() == Material + .getMaterial((String) configuration.getValue(event.getPlayer().getWorld(), + ConfigurationKey.BATTLE_MISC_PLAYER_GLOWING_ITEM))) { + if (!event.getPlayer().isSneaking()) { + new BukkitRunnable() { + @Override + public void run() { + if (!(event.getPlayer().getInventory().getItemInOffHand().getType() == Material + .getMaterial((String) configuration.getValue(event.getPlayer().getWorld(), + ConfigurationKey.BATTLE_MISC_PLAYER_GLOWING_ITEM)) + && + event.getPlayer().isSneaking())) { + this.cancel(); + } else { + event.getPlayer().getInventory().getItemInOffHand() + .setAmount(event.getPlayer().getInventory().getItemInOffHand().getAmount() - 1); + server.getPluginManager().callEvent( + new EntityGlowingEvent(event.getPlayer().getWorld(), event.getPlayer())); + } + } + }.runTaskTimer(plugin, 0, + (int) configuration.getValue(event.getPlayer().getWorld(), + ConfigurationKey.BATTLE_MISC_PLAYER_GLOWING_DURATION)); + } + } + } + } + } + } + + @EventHandler + public void onEntityGlowing(EntityGlowingEvent event) { + event.getPlayer().getWorld().spawnParticle(Particle.SPELL_WITCH, + event.getPlayer().getLocation(), 255, 0, + event.getPlayer().getWorld().getMaxHeight() + - event.getPlayer().getLocation().getY(), + 0); + for (Entity entity : event.getPlayer().getNearbyEntities( + configuration.getValue(event.getPlayer().getWorld(), + ConfigurationKey.BATTLE_MISC_PLAYER_GLOWING_RADIUS), + configuration.getValue(event.getPlayer().getWorld(), + ConfigurationKey.BATTLE_MISC_PLAYER_GLOWING_RADIUS), + configuration.getValue(event.getPlayer().getWorld(), + ConfigurationKey.BATTLE_MISC_PLAYER_GLOWING_RADIUS))) { + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).removePotionEffect(PotionEffectType.GLOWING); + ((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.GLOWING, + (int) configuration.getValue(event.getPlayer().getWorld(), + ConfigurationKey.BATTLE_MISC_PLAYER_GLOWING_DURATION) + 1, + 0, false, false)); + } + } + } + +} diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/OreAutoMelt.java b/src/main/java/com/klnsyf/battleroyale/listeners/OreAutoMelt.java index 2a17d71..b1ee1ab 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/OreAutoMelt.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/OreAutoMelt.java @@ -29,14 +29,16 @@ public void onOreBlockBreak(BlockBreakEvent event) { if ((boolean) configuation.getValue(event.getBlock().getWorld(), ConfigurationKey.BATTLE_MISC_ORE_AUTO_MELT)) { if (event.getBlock().getType() == Material.IRON_ORE || event.getBlock().getType() == Material.GOLD_ORE) { - event.setCancelled(true); - Location l = event.getBlock().getLocation(); - Material m = event.getBlock().getType(); - event.getBlock().setType(Material.AIR); - if (m == Material.IRON_ORE) { - event.getBlock().getWorld().dropItemNaturally(l, new ItemStack(Material.IRON_INGOT, 1)); - } else if (m == Material.GOLD_ORE) { - event.getBlock().getWorld().dropItemNaturally(l, new ItemStack(Material.GOLD_INGOT, 1)); + if (event.getBlock().getDrops(event.getPlayer().getInventory().getItemInMainHand()).size() > 0) { + event.setCancelled(true); + Location l = event.getBlock().getLocation(); + Material m = event.getBlock().getType(); + event.getBlock().setType(Material.AIR); + if (m == Material.IRON_ORE) { + event.getBlock().getWorld().dropItemNaturally(l, new ItemStack(Material.IRON_INGOT, 1)); + } else if (m == Material.GOLD_ORE) { + event.getBlock().getWorld().dropItemNaturally(l, new ItemStack(Material.GOLD_INGOT, 1)); + } } } } diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerAccelerateWorldBorderShrinking.java b/src/main/java/com/klnsyf/battleroyale/listeners/PlayerAccelerateWorldBorderShrinking.java index 6e62b59..831d7ad 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerAccelerateWorldBorderShrinking.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/PlayerAccelerateWorldBorderShrinking.java @@ -49,8 +49,12 @@ public void onPlayerAccelerateWorldBorderShrinking(PlayerAccelerateWorldBorderSh event.setCancelled(true); } else { if (BattlefieldHandler.battlefields.get(event.getWorld()).isWorldBorderShrinking()) { - event.getPlayer().getInventory().getItemInMainHand() - .setAmount(event.getPlayer().getInventory().getItemInMainHand().getAmount() - 1); + if (event.getPlayer().getInventory().getItemInMainHand().getAmount() > 1) { + event.getPlayer().getInventory().getItemInMainHand() + .setAmount(event.getPlayer().getInventory().getItemInMainHand().getAmount() - 1); + } else { + event.getPlayer().getInventory().removeItem(event.getPlayer().getInventory().getItemInMainHand()); + } new WorldBorderHandler(event.getWorld()).accerateShrink( configuation.getValue(event.getWorld(), ConfigurationKey.WORLD_BORDER_MIN_RADIUS), configuation.getValue(event.getWorld(), ConfigurationKey.BATTLE_MISC_SHRINK_ACCELERATING_SPEED), diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerBreakBlock.java b/src/main/java/com/klnsyf/battleroyale/listeners/PlayerBreakBlock.java new file mode 100644 index 0000000..03c599e --- /dev/null +++ b/src/main/java/com/klnsyf/battleroyale/listeners/PlayerBreakBlock.java @@ -0,0 +1,50 @@ +package com.klnsyf.battleroyale.listeners; + +import java.util.ArrayList; +import java.util.Map; +import org.bukkit.Material; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.inventory.ItemStack; + +import com.klnsyf.battleroyale.BattleRoyale; +import com.klnsyf.battleroyale.battlefield.BattlefieldHandler; +import com.klnsyf.battleroyale.configuration.Configuration; +import com.klnsyf.battleroyale.configuration.ConfigurationKey; + +public class PlayerBreakBlock implements Listener { + private final BattleRoyale plugin = BattleRoyale.plugin; + private final Configuration configuration = new Configuration(); + + public PlayerBreakBlock() { + plugin.getServer().getPluginManager().registerEvents(this, plugin); + } + + @SuppressWarnings("unchecked") + @EventHandler + public void onPlayerBreakStone(BlockBreakEvent event) { + if (BattlefieldHandler.battlefields.get(event.getPlayer().getWorld()) != null) { + if (BattlefieldHandler.battlefields.get(event.getPlayer().getWorld()).getStatue() == 2) { + ArrayList>>> dropList = configuration.getValue( + event.getPlayer().getWorld(), + ConfigurationKey.BATTLE_MISC_DROP_LIST); + for (Map>> blockDropList : dropList) { + if (event.getBlock().getType() == Material.getMaterial((String) blockDropList.keySet().toArray()[0])) { + if (event.getBlock().getDrops().size() == 0 + || event.getBlock().getDrops(event.getPlayer().getInventory().getItemInMainHand()).size() > 0) { + for (Map item : (ArrayList>) blockDropList.values() + .toArray()[0]) { + if (Math.random() * 10000 < (int) item.values().toArray()[0]) { + event.getPlayer().getWorld().dropItem(event.getBlock().getLocation(), + new ItemStack(Material.getMaterial((String) item.keySet().toArray()[0]))); + } + } + } + } + } + } + } + } + +} diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerSummonBlaze.java b/src/main/java/com/klnsyf/battleroyale/listeners/PlayerSummonBlaze.java index 32db74c..8718d3c 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerSummonBlaze.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/PlayerSummonBlaze.java @@ -1,6 +1,7 @@ package com.klnsyf.battleroyale.listeners; import java.util.List; +import java.util.Random; import org.bukkit.Material; import org.bukkit.Server; @@ -69,7 +70,9 @@ public void onBlazeSummoned(PlayerSummonBlazeEvent event) { blaze.setGlowing(true); blaze.setTarget(event.getPlayer()); blaze.setMaximumAir(11037); - blaze.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 110370, 0, false, false)); + blaze.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 110370, 1, false, false)); + blaze.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 110370, 0, false, false)); + blaze.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 110370, 4, false, false)); } } } @@ -88,6 +91,7 @@ public void onKillBlaze(EntityDeathEvent event) { drops.clear(); drops.add(new ItemStack(Material.BLAZE_ROD)); drops.add(new ItemStack(Material.NETHER_STALK)); + drops.add(new ItemStack(Material.GLOWSTONE_DUST, new Random().nextInt(4) + 1)); } } } diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerUseCompass.java b/src/main/java/com/klnsyf/battleroyale/listeners/PlayerUseCompass.java index 18e5aa5..110a559 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerUseCompass.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/PlayerUseCompass.java @@ -14,6 +14,7 @@ import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.potion.PotionEffectType; import com.klnsyf.battleroyale.BattleRoyale; import com.klnsyf.battleroyale.battlefield.BattlefieldHandler; @@ -123,7 +124,10 @@ private void sendPlayerLocation(Player player) { public void playerLocate(Player sender) { TreeMap players = new TreeMap(); for (Player player : BattlefieldHandler.battlefields.get(sender.getWorld()).players) { - if (sender == player) { + if (sender == player + || ((boolean) configuation.getValue(sender.getWorld(), + ConfigurationKey.BATTLE_MISC_COMPASS_IGNORE_INVISIBLE) + && player.getPotionEffect(PotionEffectType.INVISIBILITY) != null)) { continue; } double dis = sender.getLocation().distance(player.getLocation()); diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/battlefieldGUI/PlayerOpenBattlefieldGUI.java b/src/main/java/com/klnsyf/battleroyale/listeners/battlefieldGUI/PlayerOpenBattlefieldGUI.java new file mode 100644 index 0000000..e362784 --- /dev/null +++ b/src/main/java/com/klnsyf/battleroyale/listeners/battlefieldGUI/PlayerOpenBattlefieldGUI.java @@ -0,0 +1,147 @@ +package com.klnsyf.battleroyale.listeners.battlefieldGUI; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import org.bukkit.Bukkit; +import org.bukkit.DyeColor; +import org.bukkit.Material; +import org.bukkit.Server; +import org.bukkit.World; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.inventory.InventoryOpenEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.event.inventory.InventoryType.SlotType; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.material.Wool; + +import com.klnsyf.battleroyale.BattleRoyale; +import com.klnsyf.battleroyale.battlefield.BattlefieldConfiguration; +import com.klnsyf.battleroyale.battlefield.BattlefieldHandler; +import com.klnsyf.battleroyale.configuration.Configuration; +import com.klnsyf.battleroyale.events.PlayerJoinBattlefieldEvent; +import com.klnsyf.battleroyale.events.PlayerOpenBattlefieldGUIEvent; + +public class PlayerOpenBattlefieldGUI implements Listener { + private final BattleRoyale plugin = BattleRoyale.plugin; + private final Server server = BattleRoyale.server; + private final String prefix = BattleRoyale.prefix; + private final Configuration configuation = new Configuration(); + + public PlayerOpenBattlefieldGUI() { + server.getPluginManager().registerEvents(this, plugin); + } + + @EventHandler + public void onPlayerUseBattlefieldBook(PlayerInteractEvent event) { + if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) { + Bukkit.broadcastMessage("Check Point 01"); + ItemStack itemStack = event.getItem(); + Bukkit.broadcastMessage("Check Point 02"); + if (itemStack != null) { + if (itemStack.getType() == Material.BOOK) { + Bukkit.broadcastMessage("Check Point 03"); + if (itemStack.hasItemMeta()) { + Bukkit.broadcastMessage("Check Point 04"); + ItemMeta itemMeta = itemStack.getItemMeta(); + Bukkit.broadcastMessage("Check Point 05"); + if (itemMeta.getDisplayName().equalsIgnoreCase("¡ìr¡ì6Battlefield Book") + && itemMeta.getLore().equals(Arrays.asList("¡ìrRight Click to Open Battlefield GUI"))) { + Bukkit.broadcastMessage("Check Point 06"); + server.getPluginManager().callEvent(new PlayerOpenBattlefieldGUIEvent(event.getPlayer())); + } + } + } + } + } + } + + @EventHandler + public void onPlayerOpenBattlefieldGUI(PlayerOpenBattlefieldGUIEvent event) { + Bukkit.broadcastMessage("Check Point 07"); + Inventory inventory = Bukkit.createInventory(null, InventoryType.CHEST, "-= Battlefield GUI =-"); + HashMap currentBattlefield = BattlefieldHandler.battlefields; + Bukkit.broadcastMessage("Check Point 08"); + for (int index = 0; index < Math.min(currentBattlefield.size(), 27); index++) { + if (index > currentBattlefield.size() - 1) { + break; + } else { + ItemStack battlefieldItem; + String statue; + switch (currentBattlefield.get(currentBattlefield.keySet().toArray()[index]).getStatue()) { + case 0: + battlefieldItem = new Wool(DyeColor.GREEN).toItemStack(1); + statue = "Preseted"; + break; + case 1: + battlefieldItem = new Wool(DyeColor.YELLOW).toItemStack(1); + statue = "Loading"; + break; + case 2: + battlefieldItem = new Wool(DyeColor.RED).toItemStack(1); + statue = "Running"; + break; + default: + battlefieldItem = new Wool(DyeColor.BLACK).toItemStack(1); + statue = "ERROR"; + break; + } + ItemMeta battlefieldItemMeta = battlefieldItem.getItemMeta(); + battlefieldItemMeta.setDisplayName( + "¡ìrBattlefield: ¡ìb" + ((World) (currentBattlefield.keySet().toArray()[index])).getName()); + battlefieldItemMeta.setLore(Arrays.asList( + "¡ìrPlayer: ¡ìd" + currentBattlefield.get(currentBattlefield.keySet().toArray()[index]).players.size() + + "/" + + currentBattlefield.get(currentBattlefield.keySet().toArray()[index]).getMaxPlayer(), + "¡ìrStatue: ¡ìb" + statue)); + if (currentBattlefield.get(currentBattlefield.keySet().toArray()[index]).getStatue() == 0) { + List lore = battlefieldItemMeta.getLore(); + lore.add("¡ìr¡ìaClick to join"); + battlefieldItemMeta.setLore(lore); + } + battlefieldItem.setItemMeta(battlefieldItemMeta); + inventory.setItem(index, battlefieldItem); + } + } + Bukkit.broadcastMessage("Check Point 09"); + event.getPlayer().openInventory(inventory); + } + + @EventHandler + public void onInventoryClose(InventoryCloseEvent event) { + if (event.getInventory().getName() == "-= Battlefield GUI =-") { + event.getInventory().clear(); + } + } + + @EventHandler + public void onInventoryClick(InventoryClickEvent event) { + if (event.getInventory().getName() == "-= Battlefield GUI =-") { + event.setCancelled(true); + if (event.getCurrentItem() != null && event.getCurrentItem().getItemMeta() != null + && event.getCurrentItem().getItemMeta().hasLore()) { + if (event.getCurrentItem().getItemMeta().getLore().contains("¡ìr¡ìaClick to join")) { + server.getPluginManager().callEvent(new PlayerJoinBattlefieldEvent((Player) event.getWhoClicked(), + event.getCurrentItem().getItemMeta().getDisplayName().replaceAll("¡ìrBattlefield: ¡ìb", ""))); + ItemStack battlefieldBook = new ItemStack(Material.BOOK); + ItemMeta battlefieldBookMeta = battlefieldBook.getItemMeta(); + battlefieldBookMeta.setDisplayName("¡ìr¡ì6Battlefield Book"); + battlefieldBookMeta.setLore(Arrays.asList("¡ìrRight Click to Open Battlefield GUI")); + battlefieldBook.setItemMeta(battlefieldBookMeta); + event.getWhoClicked().getInventory().remove(battlefieldBook); + } + } + } + } +} diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/battlefieldGUI/PlayerRequestBattlefieldBook.java b/src/main/java/com/klnsyf/battleroyale/listeners/battlefieldGUI/PlayerRequestBattlefieldBook.java new file mode 100644 index 0000000..8cc7b5a --- /dev/null +++ b/src/main/java/com/klnsyf/battleroyale/listeners/battlefieldGUI/PlayerRequestBattlefieldBook.java @@ -0,0 +1,49 @@ +package com.klnsyf.battleroyale.listeners.battlefieldGUI; + +import java.util.Arrays; + +import org.bukkit.Material; +import org.bukkit.Server; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import com.klnsyf.battleroyale.BattleRoyale; +import com.klnsyf.battleroyale.battlefield.BattlefieldHandler; +import com.klnsyf.battleroyale.configuration.Configuration; +import com.klnsyf.battleroyale.events.PlayerRequestBattlefieldBookEvent; + +public class PlayerRequestBattlefieldBook implements Listener { + private final BattleRoyale plugin = BattleRoyale.plugin; + private final Server server = BattleRoyale.server; + private final String prefix = BattleRoyale.prefix; + private final Configuration configuation = new Configuration(); + + public PlayerRequestBattlefieldBook() { + server.getPluginManager().registerEvents(this, plugin); + } + + @EventHandler + public void onPlayerRequestBattlefield(PlayerRequestBattlefieldBookEvent event) { + if (BattlefieldHandler.battlefields.containsKey(event.getPlayer().getWorld())) { + if (BattlefieldHandler.battlefields.get(event.getPlayer().getWorld()).players.contains(event.getPlayer())) { + if (BattlefieldHandler.battlefields.get(event.getPlayer().getWorld()).getStatue() != 0) { + // TODO: sendMessage + event.setCancelled(true); + return; + } + } + } + ItemStack battlefieldBook = new ItemStack(Material.BOOK); + ItemMeta battlefieldBookMeta = battlefieldBook.getItemMeta(); + battlefieldBookMeta.setDisplayName("¡ìr¡ì6Battlefield Book"); + battlefieldBookMeta.setLore(Arrays.asList("¡ìrRight Click to Open Battlefield GUI")); + battlefieldBook.setItemMeta(battlefieldBookMeta); + if (event.getPlayer().getInventory().contains(battlefieldBook)) { + // TODO + } else { + event.getPlayer().getInventory().addItem(battlefieldBook); + } + } +} diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/BattleEnd.java b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattleEnd.java similarity index 96% rename from src/main/java/com/klnsyf/battleroyale/listeners/BattleEnd.java rename to src/main/java/com/klnsyf/battleroyale/listeners/system/BattleEnd.java index c64568c..c2dc690 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/BattleEnd.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattleEnd.java @@ -1,4 +1,4 @@ -package com.klnsyf.battleroyale.listeners; +package com.klnsyf.battleroyale.listeners.system; import org.bukkit.Difficulty; import org.bukkit.Server; diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/BattleLoad.java b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattleLoad.java similarity index 95% rename from src/main/java/com/klnsyf/battleroyale/listeners/BattleLoad.java rename to src/main/java/com/klnsyf/battleroyale/listeners/system/BattleLoad.java index 3e5fb1b..94e2b12 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/BattleLoad.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattleLoad.java @@ -1,4 +1,4 @@ -package com.klnsyf.battleroyale.listeners; +package com.klnsyf.battleroyale.listeners.system; import java.text.DecimalFormat; import java.util.ArrayList; @@ -100,10 +100,10 @@ private void playersSpread(World world) { .getLocation(); location.setY(location.getY() - 1); location.getBlock().setType(Material.BEDROCK); - location.setY(location.getY() + 1); + location.setY(location.getY() + 2); player.teleport(location); player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 1103700, 127, false, false)); - player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1103700, 128, false, false)); + player.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 1103700, 255, false, false)); } } @@ -120,14 +120,14 @@ public void run() { if (BattlefieldHandler.battlefields.get(world) == null) { this.cancel(); } - String s = Messages.getMessage(MessageKey.EVENTS_BATTLE_START)+" "; + String s = Messages.getMessage(MessageKey.EVENTS_BATTLE_START) + " "; double i = block; for (; i > Math.round(block * tick / totalTick); i--) { - s = s + "§4§l│"; + s = s + "§4§l|"; } for (i = Math.round(block * tick / totalTick); i > 0; i--) { - s = s + "§a§l│"; + s = s + "§a§l|"; } s = s + " §r" + new DecimalFormat("0.0").format(tick * totalTime / totalTick) + " " + Messages.getMessage(MessageKey.EVENTS_SECOND); diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/BattleStart.java b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattleStart.java similarity index 98% rename from src/main/java/com/klnsyf/battleroyale/listeners/BattleStart.java rename to src/main/java/com/klnsyf/battleroyale/listeners/system/BattleStart.java index bed28ff..838bdec 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/BattleStart.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattleStart.java @@ -1,4 +1,4 @@ -package com.klnsyf.battleroyale.listeners; +package com.klnsyf.battleroyale.listeners.system; import java.util.ArrayList; import java.util.Map; diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/BattlefieldPreset.java b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattlefieldPreset.java similarity index 99% rename from src/main/java/com/klnsyf/battleroyale/listeners/BattlefieldPreset.java rename to src/main/java/com/klnsyf/battleroyale/listeners/system/BattlefieldPreset.java index 18019fc..ec78ca0 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/BattlefieldPreset.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattlefieldPreset.java @@ -1,4 +1,4 @@ -package com.klnsyf.battleroyale.listeners; +package com.klnsyf.battleroyale.listeners.system; import java.io.File; import java.util.ArrayList; diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/BattlefieldProtect.java b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattlefieldProtect.java similarity index 97% rename from src/main/java/com/klnsyf/battleroyale/listeners/BattlefieldProtect.java rename to src/main/java/com/klnsyf/battleroyale/listeners/system/BattlefieldProtect.java index 6aebe3f..9058a14 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/BattlefieldProtect.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/system/BattlefieldProtect.java @@ -1,4 +1,4 @@ -package com.klnsyf.battleroyale.listeners; +package com.klnsyf.battleroyale.listeners.system; import org.bukkit.Server; import org.bukkit.event.EventHandler; diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerJoinBattlefield.java b/src/main/java/com/klnsyf/battleroyale/listeners/system/PlayerJoinBattlefield.java similarity index 98% rename from src/main/java/com/klnsyf/battleroyale/listeners/PlayerJoinBattlefield.java rename to src/main/java/com/klnsyf/battleroyale/listeners/system/PlayerJoinBattlefield.java index 3a2e125..d22e8da 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerJoinBattlefield.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/system/PlayerJoinBattlefield.java @@ -1,4 +1,4 @@ -package com.klnsyf.battleroyale.listeners; +package com.klnsyf.battleroyale.listeners.system; import org.bukkit.Server; import org.bukkit.World; diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerQuit.java b/src/main/java/com/klnsyf/battleroyale/listeners/system/PlayerQuit.java similarity index 93% rename from src/main/java/com/klnsyf/battleroyale/listeners/PlayerQuit.java rename to src/main/java/com/klnsyf/battleroyale/listeners/system/PlayerQuit.java index 1e332f2..907fc4a 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerQuit.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/system/PlayerQuit.java @@ -1,4 +1,4 @@ -package com.klnsyf.battleroyale.listeners; +package com.klnsyf.battleroyale.listeners.system; import org.bukkit.Server; import org.bukkit.event.EventHandler; diff --git a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerQuitBattlefield.java b/src/main/java/com/klnsyf/battleroyale/listeners/system/PlayerQuitBattlefield.java similarity index 97% rename from src/main/java/com/klnsyf/battleroyale/listeners/PlayerQuitBattlefield.java rename to src/main/java/com/klnsyf/battleroyale/listeners/system/PlayerQuitBattlefield.java index 925a5a6..ea6fa13 100644 --- a/src/main/java/com/klnsyf/battleroyale/listeners/PlayerQuitBattlefield.java +++ b/src/main/java/com/klnsyf/battleroyale/listeners/system/PlayerQuitBattlefield.java @@ -1,4 +1,4 @@ -package com.klnsyf.battleroyale.listeners; +package com.klnsyf.battleroyale.listeners.system; import org.bukkit.Server; import org.bukkit.entity.Player; diff --git a/src/main/java/com/klnsyf/battleroyale/utils/WorldBorderHandler.java b/src/main/java/com/klnsyf/battleroyale/utils/WorldBorderHandler.java index 966aabf..9432fef 100644 --- a/src/main/java/com/klnsyf/battleroyale/utils/WorldBorderHandler.java +++ b/src/main/java/com/klnsyf/battleroyale/utils/WorldBorderHandler.java @@ -52,7 +52,6 @@ public void accerateShrink(final int minRadius, final double accelerateSpeed, in isWorldBorderShrinking(minRadius, getWorldBorderRadius()); controlWorldBorder(minRadius, BattlefieldHandler.battlefields.get(world).getShrinkSpeed() + accelerateSpeed); new BukkitRunnable() { - public void run() { if (BattlefieldHandler.battlefields.get(world) != null) { BattlefieldHandler.battlefields.get(world) diff --git a/src/main/resources/configuration/default.yml b/src/main/resources/configuration/default.yml index 6fa796d..5b58c0e 100644 --- a/src/main/resources/configuration/default.yml +++ b/src/main/resources/configuration/default.yml @@ -19,32 +19,40 @@ world-border-option: max: 2048 # Integer shrink-speed: 1.0 # Double battle-misc-option: - protect-animal: True # Boolean("true" OR "false", IgnoreCase) - ore-auto-melt: False # Boolean("true" OR "false", IgnoreCase) - hide-player-name: True # Boolean("true" OR "false", IgnoreCase) + protect-animal: true # Boolean("true" OR "false", IgnoreCase) + ore-auto-melt: false # Boolean("true" OR "false", IgnoreCase) + hide-player-name: true # Boolean("true" OR "false", IgnoreCase) init-supply: # - Material: Integer # - Must be exact Material ID, see: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html - - REDSTONE: 1 - BREAD: 4 - BOAT: 1 + stone-droplist: + # - Material: Integer + # - Must be exact Material ID, see: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html + - REDSTONE: 1000 + - GLOWSTONE_DUST: 1000 + - GLOWSTONE_DUST: 1000 + - GLOWSTONE_DUST: 1000 + - GLOWSTONE_DUST: 1000 loading-time: 5 # Integer compass-option: - enabled: True # Boolean("true" OR "false", IgnoreCase) - mode: True # Boolean("true" OR "false", IgnoreCase) + enabled: true # Boolean("true" OR "false", IgnoreCase) + mode: true # Boolean("true" OR "false", IgnoreCase) cooldown: 100 # Integer max-shown-player: 4 # Integer + skip-invisible-players: true shrink-accelerating-option: - enabled: True # Boolean("true" OR "false", IgnoreCase) + enabled: true # Boolean("true" OR "false", IgnoreCase) activate-item: IRON_BLOCK # Material accelerate-speed: 1.0 # Double duration: 1200 # Integer cooldown: 300 # Integer protect-time: 6000 # Integer summon-blaze: - enabled: True # Boolean("true" OR "false", IgnoreCase) + enabled: true # Boolean("true" OR "false", IgnoreCase) deathmatch: - enabled: True # Boolean("true" OR "false", IgnoreCase + enabled: true # Boolean("true" OR "false", IgnoreCase killer-bonus: health: 5 # Integer saturation: 5 # Integer \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 29e7c75..e77c8b9 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: battleroyale -version: 1.1.0-SNAPSHOT.4 +version: 1.1.0-SNAPSHOT.5 load: POSTWORLD author: Klnsyf Sun main: com.klnsyf.battleroyale.BattleRoyale