Merge branch 'development'
This commit is contained in:
commit
25c2809252
|
@ -4,7 +4,7 @@ stages:
|
|||
variables:
|
||||
name: "EpicBosses"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "1.2.1"
|
||||
version: "1.2.2"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
|
|
@ -3,7 +3,7 @@ main: ${plugin.main}
|
|||
version: ${plugin.version}
|
||||
author: ${plugin.author}
|
||||
api-version: 1.13
|
||||
softdepend: [PlaceholderAPI] # TODO: Add other softdepends
|
||||
softdepend: [PlaceholderAPI, PlayerPoints, Vault] # TODO: Add other softdepends
|
||||
commands:
|
||||
Boss:
|
||||
description: Used to handle all CustomBosses related commands.
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
package com.songoda.epicbosses.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.epicbosses.EpicBosses;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CommandBoss extends AbstractCommand {
|
||||
|
||||
EpicBosses instance;
|
||||
|
||||
public CommandBoss() {
|
||||
super(false, "Boss");
|
||||
instance = EpicBosses.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ReturnType runCommand(CommandSender sender, String... args) {
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage(TextUtils.formatText("&b&lEpicBosses &8» &7Version " + instance.getDescription().getVersion()
|
||||
+ " Created with <3 by &5&l&oSongoda"));
|
||||
|
||||
for (AbstractCommand command : instance.getCommandManager().getAllCommands()) {
|
||||
if (command.getPermissionNode() == null || sender.hasPermission(command.getPermissionNode())) {
|
||||
sender.sendMessage(TextUtils.formatText("&8 - &a" + command.getSyntax() + "&7 - " + command.getDescription()));
|
||||
}
|
||||
}
|
||||
sender.sendMessage("");
|
||||
|
||||
return ReturnType.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> onTab(CommandSender cs, String... args) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Displays this page.";
|
||||
}
|
||||
}
|
|
@ -88,7 +88,7 @@ public class CommandCreate extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss create <[>name> <entity>";
|
||||
return "create <[>name> <entity>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -52,7 +52,7 @@ public class CommandDebug extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss reload";
|
||||
return "reload";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,7 +40,7 @@ public class CommandDropTable extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss droptable";
|
||||
return "droptable";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -71,7 +71,7 @@ public class CommandEdit extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss edit <name>";
|
||||
return "edit <name>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -105,7 +105,7 @@ public class CommandGiveEgg extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss giveegg <name> <player> [amount]";
|
||||
return "giveegg <name> <player> [amount]";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -64,7 +64,7 @@ public class CommandInfo extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss info <name>";
|
||||
return "info <name>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ public class CommandItems extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss items";
|
||||
return "items";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -61,7 +61,7 @@ public class CommandKillAll extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss killall [world]";
|
||||
return "killall [world]";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ public class CommandList extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss list";
|
||||
return "list";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,7 +34,7 @@ public class CommandMenu extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
return "/boss menu";
|
||||
return "menu";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -81,7 +81,7 @@ public class CommandNearby extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss nearby [radius]";
|
||||
return "nearby [radius]";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -60,7 +60,7 @@ public class CommandNewAutoSpawn extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss new autospawn <name>";
|
||||
return "new autospawn <name>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -54,7 +54,7 @@ public class CommandNewCommand extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss new command <name> <commands...>";
|
||||
return "new command <name> <commands...>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -80,7 +80,7 @@ public class CommandNewDropTable extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss new droptable <name> <type>";
|
||||
return "new droptable <name> <type>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,7 +58,7 @@ public class CommandNewMessage extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss new message <name> <message...>";
|
||||
return "new message <name> <message...>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -94,7 +94,7 @@ public class CommandNewSkill extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss new skill <name> <type> <mods>";
|
||||
return "new skill <name> <type> <mods>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -47,7 +47,7 @@ public class CommandReload extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss reload";
|
||||
return "reload";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -46,7 +46,7 @@ public class CommandShop extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss shop";
|
||||
return "shop";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ public class CommandSkills extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss skills";
|
||||
return "skills";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -62,8 +62,11 @@ public class CommandSpawn extends AbstractCommand {
|
|||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
BossAPI.spawnNewBoss(bossEntity, spawnLocation, null, null, false);
|
||||
Message.Boss_Spawn_Spawned.msg(sender, bossInput, StringUtils.get().translateLocation(spawnLocation));
|
||||
if (BossAPI.spawnNewBoss(bossEntity, spawnLocation, null, null, false) != null)
|
||||
Message.Boss_Spawn_Spawned.msg(sender, bossInput, StringUtils.get().translateLocation(spawnLocation));
|
||||
else
|
||||
Message.Boss_Spawn_Editing.msg(sender);
|
||||
|
||||
return ReturnType.SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -84,7 +87,7 @@ public class CommandSpawn extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss spawn <name> [location]";
|
||||
return "spawn <name> [location]";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -82,7 +82,7 @@ public class CommandTime extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/boss time <section>";
|
||||
return "time <section>";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,12 +7,16 @@ import com.songoda.epicbosses.events.BossDamageEvent;
|
|||
import com.songoda.epicbosses.holder.ActiveBossHolder;
|
||||
import com.songoda.epicbosses.managers.BossEntityManager;
|
||||
import com.songoda.epicbosses.managers.files.BossesFileManager;
|
||||
import com.songoda.epicbosses.settings.Settings;
|
||||
import com.songoda.epicbosses.utils.ServerUtils;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityCombustEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
|
||||
/**
|
||||
* @author Charles Cullen
|
||||
|
@ -85,4 +89,13 @@ public class BossDamageListener implements Listener {
|
|||
activeBossHolder.getMapOfDamagingUsers().put(player.getUniqueId(), currentDamage + damage);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onBossExplode(ExplosionPrimeEvent event) {
|
||||
if (!(event.getEntity() instanceof LivingEntity)) return;
|
||||
LivingEntity livingEntity = (LivingEntity) event.getEntity();
|
||||
ActiveBossHolder activeBossHolder = this.bossEntityManager.getActiveBossHolder(livingEntity);
|
||||
|
||||
if (activeBossHolder != null && !Settings.BOSS_EXPLOSIONS.getBoolean())
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,8 +53,6 @@ public class BossSpawnListener implements Listener {
|
|||
Action action = event.getAction();
|
||||
|
||||
if (!event.hasItem()) return;
|
||||
if (action != Action.RIGHT_CLICK_BLOCK) return;
|
||||
if (block.getType() == Material.AIR) return;
|
||||
|
||||
Map<BossEntity, ItemStack> entitiesAndSpawnItems = this.bossEntityManager.getMapOfEntitiesAndSpawnItems();
|
||||
ItemStack itemStack = player.getItemInHand();
|
||||
|
@ -67,7 +65,15 @@ public class BossSpawnListener implements Listener {
|
|||
}
|
||||
}
|
||||
|
||||
if (bossEntity == null) return;
|
||||
if (bossEntity == null)
|
||||
return;
|
||||
else {
|
||||
if (action != Action.RIGHT_CLICK_BLOCK
|
||||
|| block.getType() == Material.AIR) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (bossEntity.isEditing()) {
|
||||
Message.Boss_Edit_CannotSpawn.msg(player);
|
||||
|
|
|
@ -28,6 +28,9 @@ public class Settings {
|
|||
"Which economy plugin should be used?",
|
||||
"Supported plugins you have installed: \"" + EconomyManager.getManager().getRegisteredPlugins().stream().collect(Collectors.joining("\", \"")) + "\".");
|
||||
|
||||
public static final ConfigSetting BOSS_EXPLOSIONS = new ConfigSetting(config, "Toggles.bossExplosions", false,
|
||||
"Should bosses such as Creepers be allowed to explode?");
|
||||
|
||||
public static final ConfigSetting BOSS_SHOP = new ConfigSetting(config, "Toggles.bossShop", true);
|
||||
|
||||
public static final ConfigSetting ENDERMAN_TELEPORTING = new ConfigSetting(config, "Toggles.endermanTeleporting", true);
|
||||
|
|
|
@ -134,6 +134,7 @@ public enum Message {
|
|||
Boss_Spawn_MustBePlayer("&c&l(!) &cTo use this command without an input of location you must be a player."),
|
||||
Boss_Spawn_InvalidBoss("&c&l(!) &cThe specified boss is not a valid type."),
|
||||
Boss_Spawn_Spawned("&c&l(!) &cYou have spawned a {0} boss at {1}."),
|
||||
Boss_Spawn_Editing("&c&l(!) &cYou must disable editing for this boss before spawning it."),
|
||||
|
||||
Boss_Statistics_SetChance("&b&lEpicBosses &8» &7You have {0} the health of the entity to &f{1}&7."),
|
||||
Boss_Statistics_SetDisplayName("&b&lEpicBosses &8» &7Your next input in to chat will be the display name for the entity. If you enter &f-&7 it will remove/clear the display name of the entity. For color codes use the &f& &7sign."),
|
||||
|
|
Loading…
Reference in New Issue