mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-20 15:39:31 +00:00
Updated eco
This commit is contained in:
@@ -47,7 +47,7 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'com.willfp:eco:6.9.0'
|
compileOnly 'com.willfp:eco:6.17.1'
|
||||||
|
|
||||||
compileOnly 'org.jetbrains:annotations:19.0.0'
|
compileOnly 'org.jetbrains:annotations:19.0.0'
|
||||||
|
|
||||||
|
|||||||
@@ -500,15 +500,15 @@ public class EcoBoss extends PluginDependent<EcoPlugin> {
|
|||||||
|
|
||||||
// Messages
|
// Messages
|
||||||
this.spawnMessages = new ArrayList<>();
|
this.spawnMessages = new ArrayList<>();
|
||||||
for (String string : this.getConfig().getStrings("broadcast.spawn")) {
|
for (String string : this.getConfig().getFormattedStrings("broadcast.spawn")) {
|
||||||
this.spawnMessages.add(StringUtils.format(string));
|
this.spawnMessages.add(StringUtils.format(string));
|
||||||
}
|
}
|
||||||
this.deathMessages = new ArrayList<>();
|
this.deathMessages = new ArrayList<>();
|
||||||
for (String string : this.getConfig().getStrings("broadcast.death")) {
|
for (String string : this.getConfig().getFormattedStrings("broadcast.death")) {
|
||||||
this.deathMessages.add(StringUtils.format(string));
|
this.deathMessages.add(StringUtils.format(string));
|
||||||
}
|
}
|
||||||
this.despawnMessages = new ArrayList<>();
|
this.despawnMessages = new ArrayList<>();
|
||||||
for (String string : this.getConfig().getStrings("broadcast.despawn")) {
|
for (String string : this.getConfig().getFormattedStrings("broadcast.despawn")) {
|
||||||
this.despawnMessages.add(StringUtils.format(string));
|
this.despawnMessages.add(StringUtils.format(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.willfp.ecobosses.commands;
|
package com.willfp.ecobosses.commands;
|
||||||
|
|
||||||
import com.willfp.eco.core.command.CommandHandler;
|
|
||||||
import com.willfp.eco.core.command.impl.PluginCommand;
|
import com.willfp.eco.core.command.impl.PluginCommand;
|
||||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CommandEcobosses extends PluginCommand {
|
public class CommandEcobosses extends PluginCommand {
|
||||||
/**
|
/**
|
||||||
* Instantiate a new executor for /ebdrop.
|
* Instantiate a new executor for /ebdrop.
|
||||||
@@ -20,9 +22,8 @@ public class CommandEcobosses extends PluginCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandHandler getHandler() {
|
public void onExecute(@NotNull final CommandSender sender,
|
||||||
return (sender, args) -> {
|
@NotNull final List<String> args) {
|
||||||
sender.sendMessage(this.getPlugin().getLangYml().getMessage("invalid-command"));
|
sender.sendMessage(this.getPlugin().getLangYml().getMessage("invalid-command"));
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,12 @@ package com.willfp.ecobosses.commands;
|
|||||||
|
|
||||||
|
|
||||||
import com.willfp.eco.core.EcoPlugin;
|
import com.willfp.eco.core.EcoPlugin;
|
||||||
import com.willfp.eco.core.command.CommandHandler;
|
|
||||||
import com.willfp.eco.core.command.TabCompleteHandler;
|
|
||||||
import com.willfp.eco.core.command.impl.Subcommand;
|
import com.willfp.eco.core.command.impl.Subcommand;
|
||||||
import com.willfp.eco.core.config.updating.ConfigUpdater;
|
import com.willfp.eco.core.config.updating.ConfigUpdater;
|
||||||
import com.willfp.ecobosses.bosses.EcoBoss;
|
import com.willfp.ecobosses.bosses.EcoBoss;
|
||||||
import com.willfp.ecobosses.bosses.EcoBosses;
|
import com.willfp.ecobosses.bosses.EcoBosses;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.util.StringUtil;
|
import org.bukkit.util.StringUtil;
|
||||||
@@ -62,8 +61,8 @@ public class CommandGive extends Subcommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandHandler getHandler() {
|
public void onExecute(@NotNull final CommandSender sender,
|
||||||
return (sender, args) -> {
|
@NotNull final List<String> args) {
|
||||||
if (args.isEmpty()) {
|
if (args.isEmpty()) {
|
||||||
sender.sendMessage(this.getPlugin().getLangYml().getMessage("needs-player"));
|
sender.sendMessage(this.getPlugin().getLangYml().getMessage("needs-player"));
|
||||||
return;
|
return;
|
||||||
@@ -108,12 +107,11 @@ public class CommandGive extends Subcommand {
|
|||||||
ItemStack itemStack = boss.getSpawnEgg();
|
ItemStack itemStack = boss.getSpawnEgg();
|
||||||
itemStack.setAmount(amount);
|
itemStack.setAmount(amount);
|
||||||
reciever.getInventory().addItem(itemStack);
|
reciever.getInventory().addItem(itemStack);
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TabCompleteHandler getTabCompleter() {
|
public List<String> tabComplete(@NotNull final CommandSender sender,
|
||||||
return (sender, args) -> {
|
@NotNull final List<String> args) {
|
||||||
List<String> completions = new ArrayList<>();
|
List<String> completions = new ArrayList<>();
|
||||||
|
|
||||||
if (args.isEmpty()) {
|
if (args.isEmpty()) {
|
||||||
@@ -146,6 +144,5 @@ public class CommandGive extends Subcommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new ArrayList<>(0);
|
return new ArrayList<>(0);
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.willfp.ecobosses.commands;
|
package com.willfp.ecobosses.commands;
|
||||||
|
|
||||||
import com.willfp.eco.core.command.CommandHandler;
|
|
||||||
import com.willfp.eco.core.command.impl.Subcommand;
|
import com.willfp.eco.core.command.impl.Subcommand;
|
||||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||||
import com.willfp.ecobosses.bosses.util.BossUtils;
|
import com.willfp.ecobosses.bosses.util.BossUtils;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CommandKillall extends Subcommand {
|
public class CommandKillall extends Subcommand {
|
||||||
/**
|
/**
|
||||||
* Instantiate a new executor for /ebspawn.
|
* Instantiate a new executor for /ebspawn.
|
||||||
@@ -17,14 +19,13 @@ public class CommandKillall extends Subcommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandHandler getHandler() {
|
public void onExecute(@NotNull final CommandSender sender,
|
||||||
return (sender, args) -> {
|
@NotNull final List<String> args) {
|
||||||
boolean force = false;
|
boolean force = false;
|
||||||
if (args.size() == 1) {
|
if (args.size() == 1) {
|
||||||
force = args.get(0).equalsIgnoreCase("force");
|
force = args.get(0).equalsIgnoreCase("force");
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.sendMessage(this.getPlugin().getLangYml().getMessage("killall").replace("%amount%", String.valueOf(BossUtils.killAllBosses(force))));
|
sender.sendMessage(this.getPlugin().getLangYml().getMessage("killall").replace("%amount%", String.valueOf(BossUtils.killAllBosses(force))));
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.willfp.ecobosses.commands;
|
package com.willfp.ecobosses.commands;
|
||||||
|
|
||||||
import com.willfp.eco.core.command.CommandHandler;
|
|
||||||
import com.willfp.eco.core.command.impl.Subcommand;
|
import com.willfp.eco.core.command.impl.Subcommand;
|
||||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CommandReload extends Subcommand {
|
public class CommandReload extends Subcommand {
|
||||||
/**
|
/**
|
||||||
* Instantiate a new executor for /ebreload.
|
* Instantiate a new executor for /ebreload.
|
||||||
@@ -16,11 +18,10 @@ public class CommandReload extends Subcommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandHandler getHandler() {
|
public void onExecute(@NotNull final CommandSender sender,
|
||||||
return (sender, args) -> {
|
@NotNull final List<String> args) {
|
||||||
this.getPlugin().reload();
|
this.getPlugin().reload();
|
||||||
this.getPlugin().reload();
|
this.getPlugin().reload();
|
||||||
sender.sendMessage(this.getPlugin().getLangYml().getMessage("reloaded"));
|
sender.sendMessage(this.getPlugin().getLangYml().getMessage("reloaded"));
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.willfp.ecobosses.commands;
|
package com.willfp.ecobosses.commands;
|
||||||
|
|
||||||
import com.willfp.eco.core.command.CommandHandler;
|
|
||||||
import com.willfp.eco.core.command.TabCompleteHandler;
|
|
||||||
import com.willfp.eco.core.command.impl.Subcommand;
|
import com.willfp.eco.core.command.impl.Subcommand;
|
||||||
import com.willfp.eco.core.config.updating.ConfigUpdater;
|
import com.willfp.eco.core.config.updating.ConfigUpdater;
|
||||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||||
@@ -10,6 +8,7 @@ import com.willfp.ecobosses.bosses.EcoBosses;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.StringUtil;
|
import org.bukkit.util.StringUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -53,8 +52,8 @@ public class CommandSpawn extends Subcommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandHandler getHandler() {
|
public void onExecute(@NotNull final CommandSender sender,
|
||||||
return (sender, args) -> {
|
@NotNull final List<String> args) {
|
||||||
if (args.isEmpty()) {
|
if (args.isEmpty()) {
|
||||||
sender.sendMessage(this.getPlugin().getLangYml().getMessage("specify-boss"));
|
sender.sendMessage(this.getPlugin().getLangYml().getMessage("specify-boss"));
|
||||||
return;
|
return;
|
||||||
@@ -155,13 +154,11 @@ public class CommandSpawn extends Subcommand {
|
|||||||
|
|
||||||
boss.spawn(location);
|
boss.spawn(location);
|
||||||
sender.sendMessage(this.getPlugin().getLangYml().getMessage("spawned"));
|
sender.sendMessage(this.getPlugin().getLangYml().getMessage("spawned"));
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TabCompleteHandler getTabCompleter() {
|
public List<String> tabComplete(@NotNull final CommandSender sender,
|
||||||
return (sender, args) -> {
|
@NotNull final List<String> args) {
|
||||||
|
|
||||||
List<String> completions = new ArrayList<>();
|
List<String> completions = new ArrayList<>();
|
||||||
|
|
||||||
if (args.isEmpty()) {
|
if (args.isEmpty()) {
|
||||||
@@ -205,6 +202,5 @@ public class CommandSpawn extends Subcommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new ArrayList<>(0);
|
return new ArrayList<>(0);
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
package com.willfp.ecobosses.config;
|
package com.willfp.ecobosses.config;
|
||||||
|
|
||||||
import com.willfp.eco.core.config.yaml.YamlExtendableConfig;
|
import com.willfp.eco.core.config.ConfigType;
|
||||||
|
import com.willfp.eco.core.config.ExtendableConfig;
|
||||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class BaseBossConfig extends YamlExtendableConfig {
|
public class BaseBossConfig extends ExtendableConfig {
|
||||||
/**
|
/**
|
||||||
* Create new EcoBoss config.
|
* Create new EcoBoss config.
|
||||||
*
|
*
|
||||||
* @param configName The name of the config.
|
* @param configName The name of the config.
|
||||||
*/
|
*/
|
||||||
public BaseBossConfig(@NotNull final String configName) {
|
public BaseBossConfig(@NotNull final String configName) {
|
||||||
super(configName, true, EcoBossesPlugin.getInstance(), EcoBossesPlugin.class, "bosses/");
|
super(configName, true, EcoBossesPlugin.getInstance(), EcoBossesPlugin.class, "bosses/", ConfigType.YAML);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.willfp.ecobosses.config;
|
package com.willfp.ecobosses.config;
|
||||||
|
|
||||||
import com.willfp.eco.core.config.yaml.YamlTransientConfig;
|
import com.willfp.eco.core.config.TransientConfig;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class CustomConfig extends YamlTransientConfig {
|
public class CustomConfig extends TransientConfig {
|
||||||
/**
|
/**
|
||||||
* The name of the config.
|
* The name of the config.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user