mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
More work
This commit is contained in:
parent
7f29b5d1e8
commit
c31c4b4286
@ -65,7 +65,6 @@ import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.backup.BackupManager;
|
||||
import com.plotsquared.core.command.WE_Anywhere;
|
||||
import com.plotsquared.core.components.ComponentPresetManager;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.caption.ChatFormatter;
|
||||
import com.plotsquared.core.configuration.ConfigurationNode;
|
||||
import com.plotsquared.core.configuration.ConfigurationSection;
|
||||
@ -276,7 +275,7 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||
if (!plotSquared.getConfigurationVersion().equalsIgnoreCase("v5")) {
|
||||
// Perform upgrade
|
||||
if (DBFunc.dbManager.convertFlags()) {
|
||||
log(Captions.PREFIX.getTranslated() + "Flags were converted successfully!");
|
||||
logger.info("[P2] Flags were converted successfully!");
|
||||
// Update the config version
|
||||
try {
|
||||
plotSquared.setConfigurationVersion("v5");
|
||||
|
@ -36,14 +36,15 @@ import com.google.inject.Inject;
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.core.command.Command;
|
||||
import com.plotsquared.core.command.MainCommand;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import com.plotsquared.core.plot.Plot;
|
||||
import com.plotsquared.core.plot.PlotArea;
|
||||
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||
import com.plotsquared.core.plot.world.PlotAreaManager;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.TileState;
|
||||
@ -287,7 +288,10 @@ public class PaperListener implements Listener {
|
||||
final int tileEntityCount = event.getBlock().getChunk().getTileEntities(false).length;
|
||||
if (tileEntityCount >= Settings.Chunk_Processor.MAX_TILES) {
|
||||
final PlotPlayer<?> plotPlayer = BukkitUtil.adapt(event.getPlayer());
|
||||
Captions.TILE_ENTITY_CAP_REACHED.send(plotPlayer, Settings.Chunk_Processor.MAX_TILES);
|
||||
plotPlayer.sendMessage(
|
||||
TranslatableCaption.of("errors.tile_entity_cap_reached"),
|
||||
Template.of("<amount>", String.valueOf(Settings.Chunk_Processor.MAX_TILES))
|
||||
);
|
||||
event.setCancelled(true);
|
||||
event.setBuild(false);
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ import com.plotsquared.bukkit.player.BukkitPlayer;
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.bukkit.util.UpdateUtility;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.configuration.caption.Caption;
|
||||
import com.plotsquared.core.permissions.Permission;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
@ -706,19 +707,17 @@ import java.util.regex.Pattern;
|
||||
this.eventDispatcher.doJoinTask(pp);
|
||||
}, TaskTime.seconds(1L));
|
||||
|
||||
if (pp.hasPermission(Permission.PERMISSION_ADMIN_UPDATE_NOTIFICATION.getTranslated())
|
||||
&& Settings.Enabled_Components.UPDATE_NOTIFICATIONS && PremiumVerification.isPremium()
|
||||
if (pp.hasPermission(Permission.PERMISSION_ADMIN_UPDATE_NOTIFICATION.toString())
|
||||
&& Settings.Enabled_Components.UPDATE_NOTIFICATIONS
|
||||
&& PremiumVerification.isPremium()
|
||||
&& UpdateUtility.hasUpdate) {
|
||||
new PlotMessage("-----------------------------------").send(pp);
|
||||
new PlotMessage(Captions.PREFIX + "There appears to be a PlotSquared update available!")
|
||||
.color("$1").send(pp);
|
||||
new PlotMessage(
|
||||
Captions.PREFIX + "&6You are running version " + UpdateUtility.internalVersion
|
||||
.versionString() + ", &6latest version is " + UpdateUtility.spigotVersion)
|
||||
.color("$1").send(pp);
|
||||
new PlotMessage(Captions.PREFIX + "Download at:").color("$1").send(pp);
|
||||
player.sendMessage(" https://www.spigotmc.org/resources/77506/updates");
|
||||
new PlotMessage("-----------------------------------").send(pp);
|
||||
Caption upperBoundary = TranslatableCaption.of("update.update_boundary");
|
||||
Caption updateNotification = TranslatableCaption.of("update.update_notification");
|
||||
Template internalVersion = Template.of("p2version", String.valueOf(UpdateUtility.internalVersion.versionString()));
|
||||
Template spigotVersion = Template.of("spigotversion", UpdateUtility.spigotVersion);
|
||||
Template downloadUrl = Template.of("downloadurl", "https://www.spigotmc.org/resources/77506/updates");
|
||||
Caption lowerBoundary = TranslatableCaption.of("update.update_boundary");
|
||||
pp.sendMessage(upperBoundary, updateNotification, internalVersion, spigotVersion, downloadUrl, lowerBoundary);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1025,10 +1024,11 @@ import java.util.regex.Pattern;
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
String message = event.getMessage();
|
||||
String format = Captions.PLOT_CHAT_FORMAT.getTranslated();
|
||||
String sender = event.getPlayer().getDisplayName();
|
||||
PlotId id = plot.getId();
|
||||
Caption msg = TranslatableCaption.of("chat.plot_chat_format");
|
||||
Template msgTemplate = Template.of("msg", event.getMessage());
|
||||
Template plotTemplate = Template.of("plot_id", String.valueOf(plot.getId()));
|
||||
Template senderTemplate = Template.of("sender", event.getPlayer().getDisplayName());
|
||||
plotPlayer.sendMessage(msg, msgTemplate, plotTemplate, senderTemplate);
|
||||
Set<Player> recipients = event.getRecipients();
|
||||
recipients.clear();
|
||||
Set<Player> spies = new HashSet<>();
|
||||
@ -1052,11 +1052,12 @@ import java.util.regex.Pattern;
|
||||
receiver.sendMessage(full);
|
||||
}
|
||||
if (!spies.isEmpty()) {
|
||||
String spyMessage = Captions.PLOT_CHAT_SPY_FORMAT.getTranslated()
|
||||
.replace("%plot_id%", id.getX() + ";" + id.getY()).replace("%sender%", sender)
|
||||
.replace("%msg%", message);
|
||||
Caption spymsg = TranslatableCaption.of("chat.plot_chat_spy_format");
|
||||
Template plotidTemplate = Template.of("plot_id", id.getX() + ";" + id.getY());
|
||||
Template spysenderTemplate = Template.of("sender", sender);
|
||||
Template spymessageTemplate = Template.of("msg", message);
|
||||
for (Player player : spies) {
|
||||
player.sendMessage(spyMessage);
|
||||
plotPlayer.sendMessage(spymsg, plotidTemplate, spysenderTemplate, spymessageTemplate);
|
||||
}
|
||||
}
|
||||
// TODO: Re-implement
|
||||
|
@ -162,15 +162,15 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
||||
|
||||
@Override @Nonnegative public int hasPermissionRange(@Nonnull final String stub,
|
||||
@Nonnegative final int range) {
|
||||
if (hasPermission(Permission.PERMISSION_ADMIN.getTranslated())) {
|
||||
if (hasPermission(Permission.PERMISSION_ADMIN.toString())) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
final String[] nodes = stub.split("\\.");
|
||||
final StringBuilder n = new StringBuilder();
|
||||
for (int i = 0; i < (nodes.length - 1); i++) {
|
||||
n.append(nodes[i]).append(".");
|
||||
if (!stub.equals(n + Permission.PERMISSION_STAR.getTranslated())) {
|
||||
if (hasPermission(n + Permission.PERMISSION_STAR.getTranslated())) {
|
||||
if (!stub.equals(n + Permission.PERMISSION_STAR.toString())) {
|
||||
if (hasPermission(n + Permission.PERMISSION_STAR.toString())) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
package com.plotsquared.bukkit.schematic;
|
||||
|
||||
import com.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.sk89q.jnbt.ByteTag;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.ListTag;
|
||||
|
@ -27,7 +27,6 @@ package com.plotsquared.core.util.helpmenu;
|
||||
|
||||
import com.plotsquared.core.command.Argument;
|
||||
import com.plotsquared.core.command.Command;
|
||||
import com.plotsquared.core.configuration.Captions;
|
||||
import com.plotsquared.core.util.StringMan;
|
||||
|
||||
public class HelpObject {
|
||||
|
@ -502,6 +502,12 @@
|
||||
"legacyconfig.legacy_config_replaced": "<prefix><gray><value1> has been replaced with <value2></gray>",
|
||||
"legacyconfig.legacy_config_done": "<prefix><green>The conversion has finished. PlotSquared will now be disabled and the new configuration file will be used at next startup. Please review the new worlds.yml file. Please note that schematics will not be converted, as we are now using WorldEdit to handle schematics. You need to re-generate the schematics.</green>",
|
||||
"legacyconfig.legacy_config_conversion_failed": "<prefix><red>Failed to convert the legacy configuration file. See stack trace for information.</red>",
|
||||
|
||||
"update.update_boundary": "<gold>-----------------------------------</gold>",
|
||||
"update.update_notification": "<prefix><gold>There appears to be a PlotSquared update available!</gold>",
|
||||
"update.internal_version": "<prefix><gold>You are running version </gold><dark_aqua><p2version></dark_aqua>",
|
||||
"update.spigot_version": "<prefix><gold>Latest version is </gold><dark_aqua><spigotversion></dark_aqua>",
|
||||
"update.download": "<prefix><gold>Download the update at: <click:open_url:<downloadurl>>",
|
||||
|
||||
"flag.flag_key": "<gray>Key: <key></gray>",
|
||||
"flag.flag_desc": "<gray>Desc: <value></gray>",
|
||||
|
Loading…
Reference in New Issue
Block a user