mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-21 16:09:24 +00:00
Legacy base64 system has been removed in favour of the eco items system
This commit is contained in:
@@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.willfp.eco.core.EcoPlugin;
|
||||
import com.willfp.eco.core.PluginDependent;
|
||||
import com.willfp.eco.core.config.interfaces.Config;
|
||||
import com.willfp.eco.core.items.Items;
|
||||
import com.willfp.eco.core.items.builder.ItemBuilder;
|
||||
import com.willfp.eco.core.items.builder.ItemStackBuilder;
|
||||
import com.willfp.eco.core.recipe.Recipes;
|
||||
@@ -329,13 +330,12 @@ public class EcoBoss extends PluginDependent<EcoPlugin> {
|
||||
chance = Double.parseDouble(split[0]);
|
||||
string = split[1];
|
||||
}
|
||||
String tempConfigString = new String(Base64.getDecoder().decode(string));
|
||||
try {
|
||||
tempConfig.loadFromString(tempConfigString);
|
||||
} catch (InvalidConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
ItemStack itemStack = Items.lookup(string).getItem();
|
||||
if (itemStack.getType() == Material.AIR) {
|
||||
Bukkit.getLogger().warning(this.getName() + " has an invalid drop configured! (" + string + ")");
|
||||
continue;
|
||||
}
|
||||
ItemStack itemStack = tempConfig.getItemStack("drop-key");
|
||||
this.drops.put(itemStack, chance);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.willfp.ecobosses.commands;
|
||||
|
||||
import com.willfp.eco.core.command.CommandHandler;
|
||||
import com.willfp.eco.core.command.impl.Subcommand;
|
||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Base64;
|
||||
|
||||
public class CommandBase64 extends Subcommand {
|
||||
/**
|
||||
* Instantiate a new executor for /ebdrop.
|
||||
*
|
||||
* @param plugin The plugin to manage the execution for.
|
||||
*/
|
||||
public CommandBase64(@NotNull final EcoBossesPlugin plugin) {
|
||||
super(plugin, "base64", "ecobosses.command.base64", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandHandler getHandler() {
|
||||
return (sender, args) -> {
|
||||
Player player = (Player) sender;
|
||||
ItemStack itemStack = player.getInventory().getItemInMainHand();
|
||||
String key = "drop-key";
|
||||
YamlConfiguration jank = new YamlConfiguration();
|
||||
jank.set(key, itemStack);
|
||||
String configString = jank.saveToString();
|
||||
String dropString = Base64.getEncoder().encodeToString(configString.getBytes());
|
||||
|
||||
Bukkit.getLogger().info("Copy this into the drops section of your boss yml!");
|
||||
Bukkit.getLogger().info("\n" + dropString);
|
||||
|
||||
player.sendMessage(this.getPlugin().getLangYml().getMessage("sent-drop"));
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,6 @@ public class CommandEcobosses extends PluginCommand {
|
||||
this.addSubcommand(new CommandReload(plugin))
|
||||
.addSubcommand(new CommandKillall(plugin))
|
||||
.addSubcommand(new CommandSpawn(plugin))
|
||||
.addSubcommand(new CommandBase64(plugin))
|
||||
.addSubcommand(new CommandGive(plugin));
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,7 @@ rewards:
|
||||
# Use %player% as the placeholder for the player name
|
||||
commands: []
|
||||
|
||||
# Get items to add here by copying the console output for /ecobosses base64
|
||||
# To set the chance for a drop, put <chance>::<base64>
|
||||
# To set the chance for a drop, put <chance>::item
|
||||
drops: []
|
||||
|
||||
broadcast:
|
||||
|
||||
@@ -60,8 +60,7 @@ rewards:
|
||||
# Use %player% as the placeholder for the player name
|
||||
commands: []
|
||||
|
||||
# Get items to add here by copying the console output for /ecobosses base64
|
||||
# To set the chance for a drop, put <chance>::<base64>
|
||||
# To set the chance for a drop, put <chance>::item
|
||||
drops: []
|
||||
|
||||
broadcast:
|
||||
|
||||
@@ -60,8 +60,7 @@ rewards:
|
||||
# Use %player% as the placeholder for the player name
|
||||
commands: []
|
||||
|
||||
# Get items to add here by copying the console output for /ecobosses base64
|
||||
# To set the chance for a drop, put <chance>::<base64>
|
||||
# To set the chance for a drop, put <chance>::item
|
||||
drops: []
|
||||
|
||||
broadcast:
|
||||
|
||||
@@ -60,8 +60,7 @@ rewards:
|
||||
# Use %player% as the placeholder for the player name
|
||||
commands: []
|
||||
|
||||
# Get items to add here by copying the console output for /ecobosses base64
|
||||
# To set the chance for a drop, put <chance>::<base64>
|
||||
# To set the chance for a drop, put <chance>::item
|
||||
drops: []
|
||||
|
||||
broadcast:
|
||||
|
||||
@@ -26,17 +26,12 @@ permissions:
|
||||
ecobosses.command.ecobosses: true
|
||||
ecobosses.command.reload: true
|
||||
ecobosses.command.spawn: true
|
||||
ecobosses.command.base64: true
|
||||
ecobosses.command.give: true
|
||||
|
||||
ecobosses.command.ecobosses:
|
||||
description: Allows the use of /ecobosses
|
||||
default: true
|
||||
|
||||
ecobosses.command.base64:
|
||||
description: Allows the use of /ecobosses base64
|
||||
default: op
|
||||
|
||||
ecobosses.command.give:
|
||||
description: Allows the use of /ecobosses give
|
||||
default: op
|
||||
|
||||
Reference in New Issue
Block a user