Update to Caliburn v1.0-RC-03

This commit is contained in:
Daniel Saukel 2020-10-27 17:11:45 +01:00
parent a9c52d201d
commit d7b137c55e
8 changed files with 38 additions and 10 deletions

View File

@ -49,6 +49,7 @@ import de.erethon.dungeonsxl.api.world.GameWorld;
import de.erethon.dungeonsxl.api.world.InstanceWorld;
import de.erethon.dungeonsxl.api.world.ResourceWorld;
import de.erethon.dungeonsxl.command.DCommandCache;
import de.erethon.dungeonsxl.command.StatusCommand;
import de.erethon.dungeonsxl.config.MainConfig;
import de.erethon.dungeonsxl.config.MainConfig.BackupMode;
import de.erethon.dungeonsxl.dungeon.DDungeon;
@ -92,6 +93,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.LivingEntity;
@ -200,6 +202,14 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI {
@Override
public void onEnable() {
super.onEnable();
String ixlVersion = manager.isPluginEnabled("ItemsXL") ? manager.getPlugin("ItemsXL").getDescription().getVersion() : "";
if (ixlVersion.startsWith("0.[0-5]") || ixlVersion.equals("0.6") || ixlVersion.equals("0.6.1")) {
getLogger().log(Level.SEVERE, "DungeonsXL includes v1.0-RC-03 of the Caliburn custom item library. ItemsXL must implement the same or a newer, "
+ "but still compatible version of this library. This build of DungeonsXL is compatible with ItemsXL v" + StatusCommand.LATEST_IXL
+ " and, possibly, higher. The latest DXL and IXL versions available on SpigotMC.org should always be compatible with each other.");
manager.disablePlugin(this);
return;
}
if (Internals.andHigher(Internals.v1_14_R1).contains(compat.getInternals())) {
getLogger().warning("Support for Minecraft 1.14 and higher is experimental. Do not use this in a production environment.");
}
@ -225,6 +235,7 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI {
registerGroupAdapter(new PartiesAdapter(this));
}
VignetteAPI.init(this);
loaded = true;
}
@Override
@ -413,7 +424,6 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI {
}
dCommands.register(this);
loaded = true;
}
public void saveData() {

View File

@ -51,6 +51,16 @@ public class ReloadCommand extends DCommand {
@Override
public void onExecute(String[] args, CommandSender sender) {
if (args.length >= 2 && (args[1].equalsIgnoreCase("-caliburn") || args[1].equalsIgnoreCase("-c"))) {
plugin.getCaliburn().reload();
MessageUtil.sendCenteredMessage(sender, DMessage.CMD_RELOAD_SUCCESS.getMessage());
String ci = String.valueOf(plugin.getCaliburn().getCustomItems().size());
String cm = String.valueOf(plugin.getCaliburn().getCustomMobs().size());
String lt = String.valueOf(plugin.getCaliburn().getLootTables().size());
MessageUtil.sendCenteredMessage(sender, DMessage.CMD_RELOAD_CALIBURN.getMessage(ci, cm, lt));
return;
}
Collection<InstancePlayer> dPlayers = this.dPlayers.getAllInstancePlayers();
if (!dPlayers.isEmpty() && args.length == 1 && sender instanceof Player) {
MessageUtil.sendMessage(sender, DMessage.CMD_RELOAD_PLAYERS.getMessage());
@ -97,6 +107,11 @@ public class ReloadCommand extends DCommand {
MessageUtil.sendCenteredMessage(sender, DMessage.CMD_RELOAD_SUCCESS.getMessage());
MessageUtil.sendCenteredMessage(sender, DMessage.CMD_MAIN_LOADED.getMessage(String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players)));
MessageUtil.sendCenteredMessage(sender, DMessage.CMD_MAIN_COMPATIBILITY.getMessage(String.valueOf(internals), vault, ixl));
ClickEvent onClick = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dungeonsxl reload -caliburn");
String message = DefaultFontInfo.center(DMessage.CMD_RELOAD_BUTTON_CALIBURN.getMessage());
TextComponent text = new TextComponent(message);
text.setClickEvent(onClick);
MessageUtil.sendMessage(sender, text);
}
}

View File

@ -38,6 +38,8 @@ public class StatusCommand extends DCommand {
public static final String TRUE = ChatColor.GREEN + "\u2714";
public static final String FALSE = ChatColor.DARK_RED + "\u2718";
public static final String LATEST_IXL = "0.6.2";
public StatusCommand(DungeonsXL plugin) {
super(plugin);
setCommand("status");
@ -67,7 +69,6 @@ public class StatusCommand extends DCommand {
MessageUtil.sendMessage(sender, "= DungeonsXL: " + dungeonsxlVersion + " " + dungeonsxlVersionCorrect);
Plugin vault = manager.getPlugin("Vault");
Plugin commandsxl = manager.getPlugin("CommandsXL");
Plugin itemsxl = manager.getPlugin("ItemsXL");
Plugin citizens = manager.getPlugin("Citizens");
Plugin custommobs = manager.getPlugin("CustomMobs");
@ -77,7 +78,6 @@ public class StatusCommand extends DCommand {
String vaultVersion = "Not enabled";
String permissionPlugin = "No plugin found";
String economyPlugin = "No plugin found";
String commandsxlVersion = "Not enabled";
String itemsxlVersion = "Not enabled";
String citizensVersion = "Not enabled";
String custommobsVersion = "Not enabled";
@ -94,9 +94,6 @@ public class StatusCommand extends DCommand {
economyPlugin = plugin.getEconomyProvider().getName();
}
}
if (commandsxl != null) {
commandsxlVersion = commandsxl.getDescription().getVersion();
}
if (itemsxl != null) {
itemsxlVersion = itemsxl.getDescription().getVersion();
}
@ -116,8 +113,7 @@ public class StatusCommand extends DCommand {
String vaultVersionCorrect = getSymbol(vaultVersion.startsWith("1.7"));
String permissionPluginCorrect = getSymbol(plugin.getPermissionProvider() != null && plugin.getPermissionProvider().hasGroupSupport());
String economyPluginCorrect = getSymbol(!plugin.getMainConfig().isEconomyEnabled() || plugin.getEconomyProvider() != null);
String commandsxlVersionCorrect = getSymbol(commandsxlVersion.startsWith("2.1"));
String itemsxlVersionCorrect = getSymbol(itemsxlVersion.equals("0.6.1"));
String itemsxlVersionCorrect = getSymbol(itemsxlVersion.equals(LATEST_IXL));
String citizensVersionCorrect = getSymbol(citizensVersion.startsWith("2.0"));
String custommobsVersionCorrect = getSymbol(custommobsVersion.startsWith("4."));
String insanemobsVersionCorrect = getSymbol(insanemobsVersion.startsWith("3."));
@ -128,7 +124,6 @@ public class StatusCommand extends DCommand {
MessageUtil.sendMessage(sender, "= Vault: " + vaultVersion + " " + vaultVersionCorrect);
MessageUtil.sendMessage(sender, " = Permissions: " + permissionPlugin + " " + permissionPluginCorrect);
MessageUtil.sendMessage(sender, " = Economy: " + economyPlugin + " " + economyPluginCorrect);
MessageUtil.sendMessage(sender, "= CommandsXL: " + commandsxlVersion + " " + commandsxlVersionCorrect);
MessageUtil.sendMessage(sender, "= ItemsXL: " + itemsxlVersion + " " + itemsxlVersionCorrect);
MessageUtil.sendMessage(sender, "= Citizens: " + citizensVersion + " " + citizensVersionCorrect);
MessageUtil.sendMessage(sender, "= CustomMobs: " + custommobsVersion + " " + custommobsVersionCorrect);

View File

@ -84,6 +84,8 @@ public enum DMessage implements Message {
CMD_MSG_UPDATED("cmd.msg.updated"),
CMD_PORTAL_HELP("cmd.portal.help"),
CMD_PLAY_HELP("cmd.play.help"),
CMD_RELOAD_BUTTON_CALIBURN("cmd.reload.buttonCaliburn"),
CMD_RELOAD_CALIBURN("cmd.reload.caliburn"),
CMD_RELOAD_HELP("cmd.reload.help"),
CMD_RELOAD_SUCCESS("cmd.reload.success"),
CMD_RELOAD_PLAYERS("cmd.reload.players"),

View File

@ -91,6 +91,8 @@ cmd:
portal:
help: "/dxl portal ([material=portal]) - Creates a portal that leads into a dungeon"
reload:
buttonCaliburn: "&9[ RELOAD CALIBURN CONTENT ]"
caliburn: "&eCustom Items: &o[&v1] &eMobs: &o[&v2] &eLoot Tables: &o[&v3]"
help: "/dxl reload - Reloads the plugin"
players: "&4Warning: If you reload the plugin, all players will be kicked out of their game."
success: "&7Successfully reloaded DungeonsXL."

View File

@ -85,6 +85,8 @@ cmd:
portal:
help: "/dxl portal ([material=portal]) - Créer un portail qui mène à un donjon"
reload:
buttonCaliburn: "&9[ RECHARGE LES CONTENUES DE CALIBURN ]"
caliburn: "&eItems personnalisés: &o[&v1] &eMobs: &o[&v2] &eTableaux Loot: &o[&v3]"
help: "/dxl reload - Recharge le plugin"
players: "&4Attention: Si vous rechargez le plugin, tous les joueurs seront éjectés de leur jeu."
success: "&7DungeonsXL a été rechargé avec succès."

View File

@ -89,6 +89,8 @@ cmd:
portal:
help: "/dxl portal ([material=portal]) - Erstellt ein Portal, das in einen Dungeon führt"
reload:
buttonCaliburn: "&9[ CALIBURN-INHALTE NEU LADEN ]"
caliburn: "&eBenutzerdefinierte Items: &o[&v1] &eMobs: &o[&v2] &eLoottabellen: &o[&v3]"
help: "/dxl reload - Lädt das Plugin neu"
players: "&4Warnung: Wenn Du das Plugin neu lädst, werden alle Spieler aus ihrem Spiel geworfen."
success: "&7DungeonsXL wurde erfolgreich neugeladen."

View File

@ -39,7 +39,7 @@
<dependency>
<groupId>de.erethon</groupId>
<artifactId>caliburn</artifactId>
<version>1.0-RC-02</version>
<version>1.0-RC-03</version>
<scope>compile</scope>
</dependency>
<dependency>