mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-12-04 00:13:26 +01:00
Moving strings, part 1
This commit is contained in:
parent
7031e9e58b
commit
21b997c1a2
@ -266,7 +266,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core, Messag
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
this.messaging = new MVMessaging();
|
this.messaging = new MVMessaging(this);
|
||||||
this.banker = new AllPay(this, LOG_TAG + " ");
|
this.banker = new AllPay(this, LOG_TAG + " ");
|
||||||
// Output a little snippet to show it's enabled.
|
// Output a little snippet to show it's enabled.
|
||||||
this.log(Level.INFO, "- Version " + this.getDescription().getVersion() + " (API v" + PROTOCOL + ") Enabled - By " + getAuthors());
|
this.log(Level.INFO, "- Version " + this.getDescription().getVersion() + " (API v" + PROTOCOL + ") Enabled - By " + getAuthors());
|
||||||
@ -308,7 +308,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core, Messag
|
|||||||
this.worldManager.loadDefaultWorlds();
|
this.worldManager.loadDefaultWorlds();
|
||||||
this.worldManager.loadWorlds(true);
|
this.worldManager.loadWorlds(true);
|
||||||
} else {
|
} else {
|
||||||
this.log(Level.SEVERE, this.getMessageProvider().getMessage(MultiverseMessage.ERROR_LOAD));
|
this.log(Level.SEVERE, "Your configs were not loaded. Very little will function in Multiverse.");
|
||||||
}
|
}
|
||||||
this.anchorManager.loadAnchors();
|
this.anchorManager.loadAnchors();
|
||||||
|
|
||||||
@ -863,7 +863,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core, Messag
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
|
||||||
if (!this.isEnabled()) {
|
if (!this.isEnabled()) {
|
||||||
sender.sendMessage(this.getMessageProvider().getMessage(MultiverseMessage.GENERIC_PLUGIN_DISABLED));
|
this.messaging.sendMessage(sender, MultiverseMessage.CH_PLUGIN_DISABLED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
ArrayList<String> allArgs = new ArrayList<String>(Arrays.asList(args));
|
ArrayList<String> allArgs = new ArrayList<String>(Arrays.asList(args));
|
||||||
@ -872,11 +872,8 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core, Messag
|
|||||||
return this.commandHandler.locateAndRunCommand(sender, allArgs, getMVConfig().getDisplayPermErrors());
|
return this.commandHandler.locateAndRunCommand(sender, allArgs, getMVConfig().getDisplayPermErrors());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
sender.sendMessage(ChatColor.RED + "An internal error occurred when attempting to perform this command.");
|
this.messaging.sendMessage(sender, MultiverseMessage.CH_INTERNAL_ERROR);
|
||||||
if (sender.isOp())
|
this.messaging.sendMessage(sender, sender.isOp() ? MultiverseMessage.CH_ADMIN_DEBUG : MultiverseMessage.CH_USER_DEBUG);
|
||||||
sender.sendMessage(ChatColor.RED + "Details were printed to the server console and logs, please add that to your bug report.");
|
|
||||||
else
|
|
||||||
sender.sendMessage(ChatColor.RED + "Try again and contact the server owner or an admin if this problem persists.");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -970,8 +967,8 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core, Messag
|
|||||||
* @param worldName The name of the invalid world
|
* @param worldName The name of the invalid world
|
||||||
*/
|
*/
|
||||||
public void showNotMVWorldMessage(CommandSender sender, String worldName) {
|
public void showNotMVWorldMessage(CommandSender sender, String worldName) {
|
||||||
sender.sendMessage("Multiverse doesn't know about " + ChatColor.DARK_AQUA + worldName + ChatColor.WHITE + " yet.");
|
// TODO remove this method because we can now send this message in one line
|
||||||
sender.sendMessage("Type " + ChatColor.DARK_AQUA + "/mv import ?" + ChatColor.WHITE + " for help!");
|
this.messaging.sendMessage(sender, MultiverseMessage.GENERIC_NOT_MV_WORLD, worldName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,6 +4,8 @@ import java.util.Collection;
|
|||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
import com.onarandombox.MultiverseCore.localization.MultiverseMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multiverse-messaging.
|
* Multiverse-messaging.
|
||||||
*/
|
*/
|
||||||
@ -14,6 +16,27 @@ public interface MultiverseMessaging {
|
|||||||
*/
|
*/
|
||||||
void setCooldown(int milliseconds);
|
void setCooldown(int milliseconds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a message to the specified sender if the cooldown has passed.
|
||||||
|
*
|
||||||
|
* @param sender The person/console to send the message to.
|
||||||
|
* @param message The message to send.
|
||||||
|
* @param formatArgs Format arguments for the message.
|
||||||
|
* @return true if the message was sent, false if not.
|
||||||
|
*/
|
||||||
|
boolean sendMessage(CommandSender sender, MultiverseMessage message, Object...formatArgs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a message to the specified sender if the cooldown has passed.
|
||||||
|
*
|
||||||
|
* @param sender The person/console to send the message to.
|
||||||
|
* @param message The message to send.
|
||||||
|
* @param ignoreCooldown If true this message will always be sent. Useful for things like menus
|
||||||
|
* @param formatArgs Format arguments for the message.
|
||||||
|
* @return true if the message was sent, false if not.
|
||||||
|
*/
|
||||||
|
boolean sendMessage(CommandSender sender, MultiverseMessage message, boolean ignoreCooldown, Object... formatArgs);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a message to the specified sender if the cooldown has passed.
|
* Sends a message to the specified sender if the cooldown has passed.
|
||||||
*
|
*
|
||||||
|
@ -12,6 +12,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||||
|
import com.onarandombox.MultiverseCore.localization.MultiverseMessage;
|
||||||
import com.onarandombox.MultiverseCore.utils.DebugLog;
|
import com.onarandombox.MultiverseCore.utils.DebugLog;
|
||||||
import com.pneumaticraft.commandhandler.CommandHandler;
|
import com.pneumaticraft.commandhandler.CommandHandler;
|
||||||
|
|
||||||
@ -106,7 +107,7 @@ public abstract class MultiversePlugin extends JavaPlugin implements MVPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
if (!this.isEnabled()) {
|
if (!this.isEnabled()) {
|
||||||
sender.sendMessage("This plugin is Disabled!");
|
this.core.getMessaging().sendMessage(sender, MultiverseMessage.CH_PLUGIN_DISABLED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,19 +24,18 @@ import java.util.List;
|
|||||||
* Displays a listing of all worlds that a player can enter.
|
* Displays a listing of all worlds that a player can enter.
|
||||||
*/
|
*/
|
||||||
public class ListCommand extends PaginatedCoreCommand<String> {
|
public class ListCommand extends PaginatedCoreCommand<String> {
|
||||||
|
|
||||||
private MessageProvider provider;
|
private MessageProvider provider;
|
||||||
|
|
||||||
public ListCommand(MultiverseCore plugin) {
|
public ListCommand(MultiverseCore plugin) {
|
||||||
super(plugin);
|
super(plugin);
|
||||||
provider = plugin.getMessageProvider();
|
provider = plugin.getMessageProvider();
|
||||||
this.setName(provider.getMessage(MultiverseMessage.LIST_NAME));
|
this.setName(provider.getMessage(MultiverseMessage.CMD_LIST_NAME));
|
||||||
this.setCommandUsage("/mv list");
|
this.setCommandUsage("/mv list");
|
||||||
this.setArgRange(0, 2);
|
this.setArgRange(0, 2);
|
||||||
this.addKey("mvlist");
|
this.addKey("mvlist");
|
||||||
this.addKey("mvl");
|
this.addKey("mvl");
|
||||||
this.addKey("mv list");
|
this.addKey("mv list");
|
||||||
this.setPermission("multiverse.core.list.worlds", provider.getMessage(MultiverseMessage.LIST_DESC), PermissionDefault.OP);
|
this.setPermission("multiverse.core.list.worlds", provider.getMessage(MultiverseMessage.CMD_LIST_DESC), PermissionDefault.OP);
|
||||||
this.setItemsPerPage(8); // SUPPRESS CHECKSTYLE: MagicNumberCheck
|
this.setItemsPerPage(8); // SUPPRESS CHECKSTYLE: MagicNumberCheck
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +70,7 @@ public class ListCommand extends PaginatedCoreCommand<String> {
|
|||||||
}
|
}
|
||||||
for (String name : this.plugin.getMVWorldManager().getUnloadedWorlds()) {
|
for (String name : this.plugin.getMVWorldManager().getUnloadedWorlds()) {
|
||||||
if (p == null || this.plugin.getMVPerms().hasPermission(p, "multiverse.access." + name, true)) {
|
if (p == null || this.plugin.getMVPerms().hasPermission(p, "multiverse.access." + name, true)) {
|
||||||
worldList.add(ChatColor.GRAY + name + " - " + provider.getMessage(MultiverseMessage.GENERIC_UNLOADED));
|
worldList.add(ChatColor.GRAY + name + " - " + "UNLOADED");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return worldList;
|
return worldList;
|
||||||
@ -96,7 +95,7 @@ public class ListCommand extends PaginatedCoreCommand<String> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runCommand(CommandSender sender, List<String> args) {
|
public void runCommand(CommandSender sender, List<String> args) {
|
||||||
sender.sendMessage(ChatColor.LIGHT_PURPLE + "====[ " + this.provider.getMessage(MultiverseMessage.LIST_TITLE) + " ]====");
|
sender.sendMessage(ChatColor.LIGHT_PURPLE + "====[ " + this.provider.getMessage(MultiverseMessage.CMD_LIST_TITLE) + " ]====");
|
||||||
Player p = null;
|
Player p = null;
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
p = (Player) sender;
|
p = (Player) sender;
|
||||||
@ -109,7 +108,7 @@ public class ListCommand extends PaginatedCoreCommand<String> {
|
|||||||
if (filterObject.getFilter().length() > 0) {
|
if (filterObject.getFilter().length() > 0) {
|
||||||
availableWorlds = this.getFilteredItems(availableWorlds, filterObject.getFilter());
|
availableWorlds = this.getFilteredItems(availableWorlds, filterObject.getFilter());
|
||||||
if (availableWorlds.size() == 0) {
|
if (availableWorlds.size() == 0) {
|
||||||
sender.sendMessage(ChatColor.RED + provider.getMessage(MultiverseMessage.GENERIC_SORRY) + " " + ChatColor.WHITE + provider.getMessage(MultiverseMessage.LIST_NO_MATCH) + " " + ChatColor.AQUA + filterObject.getFilter());
|
sender.sendMessage(ChatColor.RED + "Sorry... " + ChatColor.WHITE + provider.getMessage(MultiverseMessage.CMD_LIST_NO_MATCH) + " " + ChatColor.AQUA + filterObject.getFilter());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,7 +126,7 @@ public class ListCommand extends PaginatedCoreCommand<String> {
|
|||||||
filterObject.setPage(totalPages);
|
filterObject.setPage(totalPages);
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.sendMessage(ChatColor.AQUA + " " + provider.getMessage(MultiverseMessage.GENERIC_PAGE) + " " + filterObject.getPage() + " " + provider.getMessage(MultiverseMessage.GENERIC_OF) + " " + totalPages);
|
sender.sendMessage(ChatColor.AQUA + " Page " + filterObject.getPage() + " of " + totalPages);
|
||||||
|
|
||||||
this.showPage(filterObject.getPage(), sender, availableWorlds);
|
this.showPage(filterObject.getPage(), sender, availableWorlds);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import com.onarandombox.MultiverseCore.MultiverseCore;
|
|||||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
||||||
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
||||||
import com.onarandombox.MultiverseCore.event.MVRespawnEvent;
|
import com.onarandombox.MultiverseCore.event.MVRespawnEvent;
|
||||||
|
import com.onarandombox.MultiverseCore.localization.MultiverseMessage;
|
||||||
import com.onarandombox.MultiverseCore.utils.PermissionTools;
|
import com.onarandombox.MultiverseCore.utils.PermissionTools;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -119,7 +120,7 @@ public class MVPlayerListener implements Listener {
|
|||||||
this.plugin.log(Level.FINER, "Player joined AGAIN!");
|
this.plugin.log(Level.FINER, "Player joined AGAIN!");
|
||||||
if (this.plugin.getMVConfig().getEnforceAccess() // check this only if we're enforcing access!
|
if (this.plugin.getMVConfig().getEnforceAccess() // check this only if we're enforcing access!
|
||||||
&& !this.plugin.getMVPerms().hasPermission(p, "multiverse.access." + p.getWorld().getName(), false)) {
|
&& !this.plugin.getMVPerms().hasPermission(p, "multiverse.access." + p.getWorld().getName(), false)) {
|
||||||
p.sendMessage("[MV] - Sorry you can't be in this world anymore!");
|
this.plugin.getMessaging().sendMessage(p, MultiverseMessage.LISTENER_PLAYER_LOSTACCESSPERM);
|
||||||
this.sendPlayerToDefaultWorld(p);
|
this.sendPlayerToDefaultWorld(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,23 +8,36 @@ public enum MultiverseMessage {
|
|||||||
// BEGIN CHECKSTYLE-SUPPRESSION: JavadocVariable
|
// BEGIN CHECKSTYLE-SUPPRESSION: JavadocVariable
|
||||||
TEST_STRING("a test-string from the enum"),
|
TEST_STRING("a test-string from the enum"),
|
||||||
|
|
||||||
// Generic Strings
|
//// Command handling error messages
|
||||||
GENERIC_SORRY("Sorry..."),
|
CH_PLUGIN_DISABLED("This plugin is disabled!"),
|
||||||
GENERIC_PAGE("Page"),
|
CH_INTERNAL_ERROR("&cAn internal error occurred when attempting to perform this command."),
|
||||||
GENERIC_OF("of"),
|
CH_ADMIN_DEBUG("&cDetails were printed to the server console and logs, please add that to your bug report."),
|
||||||
GENERIC_UNLOADED("UNLOADED"),
|
CH_USER_DEBUG("&cTry again and contact the server owner or an admin if this problem persists."),
|
||||||
GENERIC_PLUGIN_DISABLED("This plugin is Disabled!"),
|
|
||||||
|
|
||||||
// Errors
|
//// Not MV world message
|
||||||
ERROR_LOAD("Your configs were not loaded. Very little will function in Multiverse."),
|
GENERIC_NOT_MV_WORLD("Multiverse doesn't know about &3%s&f yet.\nType &3/mv import ?&f for help!"),
|
||||||
|
|
||||||
//// Commands
|
//// Commands
|
||||||
// List Command
|
// List Command
|
||||||
LIST_NAME("World Listing"),
|
CMD_LIST_NAME("World Listing"),
|
||||||
LIST_DESC("Displays a listing of all worlds that you can enter."),
|
CMD_LIST_DESC("Displays a listing of all worlds that you can enter."),
|
||||||
LIST_TITLE("Multiverse World List"),
|
CMD_LIST_TITLE("Multiverse World List"),
|
||||||
LIST_NO_MATCH("No worlds matched your filter:");
|
CMD_LIST_NO_MATCH("No worlds matched your filter:"),
|
||||||
|
|
||||||
|
//// Listeners
|
||||||
|
// PlayerListener
|
||||||
|
LISTENER_PLAYER_LOSTACCESSPERM("[MV] - Sorry you can't be in this world anymore!"),
|
||||||
|
|
||||||
|
//// Permissions
|
||||||
|
PERMS_NOACCESS_SELF("You don't have access to go here..."),
|
||||||
|
PERMS_NOACCESS_OTHER("You can't send %s here..."),
|
||||||
|
PERMS_NOACCESS_BLACKLIST_SELF("You don't have access to go to %s from %s"),
|
||||||
|
PERMS_NOACCESS_BLACKLIST_OTHER("You don't have access to send %s from %s to %s"),
|
||||||
|
|
||||||
|
//// World purger
|
||||||
|
PURGER_ENTITIESKILLED("%d entities purged from the world '%s'"),
|
||||||
// END CHECKSTYLE-SUPPRESSION: JavadocVariable
|
// END CHECKSTYLE-SUPPRESSION: JavadocVariable
|
||||||
|
;
|
||||||
|
|
||||||
private final String def;
|
private final String def;
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.onarandombox.MultiverseCore.api.MultiverseMessaging;
|
import com.onarandombox.MultiverseCore.api.MultiverseMessaging;
|
||||||
|
import com.onarandombox.MultiverseCore.localization.MessageProviding;
|
||||||
|
import com.onarandombox.MultiverseCore.localization.MultiverseMessage;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -20,10 +22,12 @@ import java.util.Map;
|
|||||||
* The default-implementation of {@link MultiverseMessaging}.
|
* The default-implementation of {@link MultiverseMessaging}.
|
||||||
*/
|
*/
|
||||||
public class MVMessaging implements MultiverseMessaging {
|
public class MVMessaging implements MultiverseMessaging {
|
||||||
|
private final MessageProviding msgProviding;
|
||||||
private Map<String, Long> sentList;
|
private Map<String, Long> sentList;
|
||||||
private int cooldown;
|
private int cooldown;
|
||||||
|
|
||||||
public MVMessaging() {
|
public MVMessaging(MessageProviding msgProviding) {
|
||||||
|
this.msgProviding = msgProviding;
|
||||||
this.sentList = new HashMap<String, Long>();
|
this.sentList = new HashMap<String, Long>();
|
||||||
this.cooldown = 5000; // SUPPRESS CHECKSTYLE: MagicNumberCheck
|
this.cooldown = 5000; // SUPPRESS CHECKSTYLE: MagicNumberCheck
|
||||||
}
|
}
|
||||||
@ -50,7 +54,6 @@ public class MVMessaging implements MultiverseMessaging {
|
|||||||
@Override
|
@Override
|
||||||
public boolean sendMessages(CommandSender sender, String[] messages, boolean ignoreCooldown) {
|
public boolean sendMessages(CommandSender sender, String[] messages, boolean ignoreCooldown) {
|
||||||
if (!(sender instanceof Player) || ignoreCooldown) {
|
if (!(sender instanceof Player) || ignoreCooldown) {
|
||||||
|
|
||||||
sendMessages(sender, messages);
|
sendMessages(sender, messages);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -90,4 +93,20 @@ public class MVMessaging implements MultiverseMessaging {
|
|||||||
public int getCooldown() {
|
public int getCooldown() {
|
||||||
return cooldown;
|
return cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean sendMessage(CommandSender sender, MultiverseMessage message, Object... args) {
|
||||||
|
return this.sendMessage(sender, message, true, args); // TODO what is a good default value?
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean sendMessage(CommandSender sender, MultiverseMessage message, boolean ignoreCooldown, Object...args) {
|
||||||
|
return this.sendMessage(sender, this.msgProviding.getMessageProvider().getMessage(message, args), ignoreCooldown);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ package com.onarandombox.MultiverseCore.utils;
|
|||||||
import com.fernferret.allpay.GenericBank;
|
import com.fernferret.allpay.GenericBank;
|
||||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||||
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
||||||
|
import com.onarandombox.MultiverseCore.localization.MultiverseMessage;
|
||||||
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -208,11 +210,10 @@ public class PermissionTools {
|
|||||||
// Actual checks
|
// Actual checks
|
||||||
if (toWorld != null) {
|
if (toWorld != null) {
|
||||||
if (!this.plugin.getMVPerms().canEnterWorld(teleporterPlayer, toWorld)) {
|
if (!this.plugin.getMVPerms().canEnterWorld(teleporterPlayer, toWorld)) {
|
||||||
if (teleportee.equals(teleporter)) {
|
if (teleportee.equals(teleporter))
|
||||||
teleporter.sendMessage("You don't have access to go here...");
|
this.plugin.getMessaging().sendMessage(teleporter, MultiverseMessage.PERMS_NOACCESS_SELF);
|
||||||
} else {
|
else
|
||||||
teleporter.sendMessage("You can't send " + teleportee.getName() + " here...");
|
this.plugin.getMessaging().sendMessage(teleporter, MultiverseMessage.PERMS_NOACCESS_OTHER, teleportee.getName());
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -223,12 +224,10 @@ public class PermissionTools {
|
|||||||
}
|
}
|
||||||
if (fromWorld != null) {
|
if (fromWorld != null) {
|
||||||
if (fromWorld.getWorldBlacklist().contains(toWorld.getName())) {
|
if (fromWorld.getWorldBlacklist().contains(toWorld.getName())) {
|
||||||
if (teleportee.equals(teleporter)) {
|
if (teleportee.equals(teleporter))
|
||||||
teleporter.sendMessage("You don't have access to go to " + toWorld.getColoredWorldString() + " from " + fromWorld.getColoredWorldString());
|
this.plugin.getMessaging().sendMessage(teleporter, MultiverseMessage.PERMS_NOACCESS_BLACKLIST_SELF, toWorld.getColoredWorldString(), fromWorld.getColoredWorldString());
|
||||||
} else {
|
else
|
||||||
teleporter.sendMessage("You don't have access to send " + teleportee.getName() + " from "
|
this.plugin.getMessaging().sendMessage(teleporter, MultiverseMessage.PERMS_NOACCESS_BLACKLIST_OTHER, teleportee.getName(), fromWorld.getColoredWorldString(), toWorld.getColoredWorldString());
|
||||||
+ fromWorld.getColoredWorldString() + " to " + toWorld.getColoredWorldString());
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ package com.onarandombox.MultiverseCore.utils;
|
|||||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||||
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
||||||
import com.onarandombox.MultiverseCore.api.WorldPurger;
|
import com.onarandombox.MultiverseCore.api.WorldPurger;
|
||||||
|
import com.onarandombox.MultiverseCore.localization.MultiverseMessage;
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -95,9 +96,8 @@ public class SimpleWorldPurger implements WorldPurger {
|
|||||||
entitiesKilled++;
|
entitiesKilled++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sender != null) {
|
if (sender != null)
|
||||||
sender.sendMessage(entitiesKilled + " entities purged from the world '" + world.getName() + "'");
|
this.plugin.getMessaging().sendMessage(sender, MultiverseMessage.PURGER_ENTITIESKILLED, entitiesKilled, world.getName());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean killDecision(Entity e, List<String> thingsToKill, boolean negateAnimals,
|
private boolean killDecision(Entity e, List<String> thingsToKill, boolean negateAnimals,
|
||||||
|
Loading…
Reference in New Issue
Block a user