mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-02 14:37:46 +01:00
Merge branch '2.9' of https://github.com/essentials/Essentials into 2.9
This commit is contained in:
commit
4a4f443fee
@ -3,6 +3,8 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandtptoggle extends EssentialsCommand
|
||||
@ -12,29 +14,60 @@ public class Commandtptoggle extends EssentialsCommand
|
||||
super("tptoggle");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
toggleOtherPlayers(server, sender, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
User otherUser = null;
|
||||
if (args.length > 0 && user.isAuthorized("essentials.tptoggle.others"))
|
||||
if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.tptoggle.others"))
|
||||
{
|
||||
otherUser = ess.getUser(server.getPlayer(args[0]));
|
||||
if (otherUser == null)
|
||||
toggleOtherPlayers(server, user, args);
|
||||
return;
|
||||
}
|
||||
|
||||
user.sendMessage(user.toggleTeleportEnabled() ? _("teleportationEnabled") : _("teleportationDisabled"));
|
||||
}
|
||||
|
||||
private void toggleOtherPlayers(final Server server, final CommandSender sender, final String[] args)
|
||||
{
|
||||
for (Player matchPlayer : server.matchPlayer(args[0]))
|
||||
{
|
||||
final User player = ess.getUser(matchPlayer);
|
||||
if (player.isHidden())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (args.length > 1)
|
||||
{
|
||||
if (args[1].contains("on") || args[1].contains("ena") || args[1].equalsIgnoreCase("1"))
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
player.setTeleportEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ess.getUser(server.getPlayer(args[0])).sendMessage(user.toggleTeleportEnabled()
|
||||
? _("teleportationEnabled")
|
||||
: _("teleportationDisabled"));
|
||||
player.setTeleportEnabled(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(user.toggleTeleportEnabled()
|
||||
? _("teleportationEnabled")
|
||||
: _("teleportationDisabled"));
|
||||
}
|
||||
else
|
||||
{
|
||||
player.toggleTeleportEnabled();
|
||||
}
|
||||
|
||||
final boolean enabled = player.isTeleportEnabled();
|
||||
|
||||
|
||||
player.sendMessage(enabled ? _("teleportationEnabled") : _("teleportationDisabled"));
|
||||
sender.sendMessage(enabled ? _("teleportationEnabledFor", matchPlayer.getDisplayName()) : _("teleportationDisabledFor", matchPlayer.getDisplayName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ overridden-commands:
|
||||
# Disabled commands will be completely unavailable on the server.
|
||||
# Disabling commands here will have no effect on command conflicts.
|
||||
disabled-commands:
|
||||
# - nick
|
||||
# - nick
|
||||
|
||||
# If you do not wish to use a permission system, you can define a list of 'player perms' below.
|
||||
# This list has no effect if your using a supported permissions system.
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -463,3 +463,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -251,7 +251,7 @@ noPendingRequest=No tienes ninguna peticion pendiente.
|
||||
noPerm=\u00a7cNo tienes el permiso de \u00a7f{0}\u00a7c.
|
||||
noPermToSpawnMob=\u00a7cNo tienes permisos para spawnear a este mob.
|
||||
noPlacePermission=\u00a7cNo tienes permiso para situar ese bloque en ese lugar.
|
||||
noPowerTools=Usted no tiene ningunas herramientas eléctricas asignadas.
|
||||
noPowerTools=Usted no tiene ningunas herramientas el\u00c3\u00a9ctricas asignadas.
|
||||
noRules=\u00a7cNo hay reglas especificadas todavia.
|
||||
noWarpsDefined=No hay teletransportes definidos aun.
|
||||
none=ninguno
|
||||
@ -448,7 +448,7 @@ youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f p
|
||||
posX=\u00a76X: {0} (+Este <-> -Oeste)
|
||||
posY=\u00a76Y: {0} (+Arriba <-> -abajo)
|
||||
posZ=\u00a76Z: {0} (+Sur <-> -Norte)
|
||||
posYaw=\u00a76guiñar: {0} (Rotacion)
|
||||
posYaw=\u00a76gui\u00c3\u00b1ar: {0} (Rotacion)
|
||||
posPitch=\u00a76Tono: {0} (Angulo de cabeza)
|
||||
distance=\u00a76Distancia: {0}
|
||||
giveSpawn=\u00a76Se a dado\u00a7c {0} \u00a76de\u00a7c {1} a\u00a7c {2}\u00a76.
|
||||
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Nombre de casa invalido
|
||||
invalidWarpName=\u00a74Nombre de warp invalido
|
||||
userUnknown=\u00a74Peligro: El jugador '\u00a7c{0}\u00a74' Nunca a ingresado a este servidor.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -35,7 +35,7 @@ burnMsg=\u00a77Vous avez enflamm\u00e9 {0} pour {1} seconde(s).
|
||||
canTalkAgain=\u00a77Vous pouvez de nouveau parler.
|
||||
cantFindGeoIpDB=N'arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
|
||||
cantReadGeoIpDB=Echec de la lecture de la base de donn\u00e9es GeoIP!
|
||||
cantSpawnItem=\u00a7cVous n''avez pas le droit de faire appara\u00eEtre {0}
|
||||
cantSpawnItem=\u00a7cVous n''avez pas le droit de faire appara\u00eetre {0}
|
||||
chatTypeAdmin=[A]
|
||||
chatTypeLocal=[L]
|
||||
chatTypeSpy=[Spy]
|
||||
@ -91,7 +91,7 @@ essentialsHelp2=Le fichier est corrompuet Essentials ne peut l'ouvrir. Essential
|
||||
essentialsReload=\u00a77Essentials {0} a \u00e9t\u00e9 recharg\u00e9.
|
||||
exp=\u00a7c{0} \u00a77a\u00a7c {1} \u00a77exp (niveau\u00a7c {2}\u00a77) et a besoin de\u00a7c {3} \u00a77pour monter d'un niveau.
|
||||
expSet=\u00a7c{0} \u00a77a maintenant\u00a7c {1} \u00a77exp.
|
||||
extinguish=\u00a77Vous cessez de br\u00FBler.
|
||||
extinguish=\u00a77Vous cessez de br\u00fbler.
|
||||
extinguishOthers=\u00a77Vous avez \u00e9teint la combustion de {0}.
|
||||
failedToCloseConfig=Echec de la fermeture de la configuration {0}
|
||||
failedToCreateConfig=Echec de la cr\u00e9ation de la configuration {0}
|
||||
@ -142,7 +142,7 @@ infoChapterPages=Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f:
|
||||
infoFileDoesNotExist=Le fichier info.txt n'existe pas. Le fichier est en cours de cr\u00e9ation pour vous.
|
||||
infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} \u00a7e----
|
||||
infoUnknownChapter=Chapitre inconnu.
|
||||
invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00F4tre.
|
||||
invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre.
|
||||
invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu.
|
||||
invSee=Vous voyez l''inventaire de {0}.
|
||||
invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire.
|
||||
@ -459,4 +459,6 @@ antiBuildDrop=\u00a74Vous n'\u00eates pas autoris\u00e9s \u00e0 jeter\u00a7c {0}
|
||||
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 portions, \u00a7c{3}\u00a76 entit\u00e9s
|
||||
invalidHomeName=\u00a74Nom de r\u00e9sindence invalide
|
||||
invalidWarpName=\u00a74Nom de warp invalide
|
||||
userUnknown=\u00a74Attention : Le joueur '\u00a7c{0}\u00a74' n'est jamais venu sur ce serveur.
|
||||
userUnknown=\u00a74Attention : Le joueur '\u00a7c{0}\u00a74' n'est jamais venu sur ce serveur.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -460,3 +460,5 @@ gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00
|
||||
invalidHomeName=\u00a74Invalid home name
|
||||
invalidWarpName=\u00a74Invalid warp name
|
||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
||||
teleportationEnabledFor=\u00a76Teleportation enabled for {0}
|
||||
teleportationDisabledFor=\u00a76Teleportation disabled for {0}
|
||||
|
@ -404,7 +404,7 @@ commands:
|
||||
aliases: [etppos]
|
||||
tptoggle:
|
||||
description: Blocks all forms of teleportation.
|
||||
usage: /<command>
|
||||
usage: /<command> [player [on|off]]
|
||||
aliases: [etptoggle]
|
||||
tree:
|
||||
description: Spawn a tree where you are looking.
|
||||
|
@ -1,9 +1,11 @@
|
||||
package com.earth2me.essentials.protect;
|
||||
|
||||
import com.earth2me.essentials.protect.data.IProtectedBlock;
|
||||
import com.mchange.v2.log.MLevel;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Filter;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
@ -27,14 +29,20 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
|
||||
@Override
|
||||
public void onLoad()
|
||||
{
|
||||
C3P0logger = com.mchange.v2.log.MLog.getLogger(com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.class);
|
||||
C3P0logger.setFilter(new Filter()
|
||||
try
|
||||
{
|
||||
public boolean isLoggable(LogRecord lr)
|
||||
{
|
||||
return lr.getLevel() != Level.INFO;
|
||||
}
|
||||
});
|
||||
// Simple fix for the case that log4j is on the class path by another plugin
|
||||
Class propertyConfiguratorClass = Class.forName("org.apache.log4j.PropertyConfigurator");
|
||||
Properties properties = new Properties();
|
||||
properties.load(this.getClass().getResourceAsStream("log4j.properties"));
|
||||
propertyConfiguratorClass.getMethod("configure", Properties.class).invoke(null, properties);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Ignore me, log4j not found on classloader.
|
||||
}
|
||||
C3P0logger = com.mchange.v2.log.MLog.getLogger(com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.class);
|
||||
C3P0logger.setLevel(MLevel.WARNING);
|
||||
}
|
||||
|
||||
public void onEnable()
|
||||
@ -65,7 +73,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
|
||||
{
|
||||
final EmergencyListener emListener = new EmergencyListener();
|
||||
pm.registerEvents(emListener, this);
|
||||
|
||||
|
||||
for (Player player : getServer().getOnlinePlayers())
|
||||
{
|
||||
player.sendMessage("Essentials Protect is in emergency mode. Check your log for errors.");
|
||||
@ -89,7 +97,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
|
||||
{
|
||||
return ess;
|
||||
}
|
||||
|
||||
|
||||
public Map<ProtectConfig, Boolean> getSettingsBoolean()
|
||||
{
|
||||
return settingsBoolean;
|
||||
|
@ -0,0 +1,4 @@
|
||||
log4j.rootLogger=INFO, A1
|
||||
log4j.appender.A1=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
|
Loading…
Reference in New Issue
Block a user