mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-20 07:01:41 +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 static com.earth2me.essentials.I18n._;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|
||||||
public class Commandtptoggle extends EssentialsCommand
|
public class Commandtptoggle extends EssentialsCommand
|
||||||
@ -12,29 +14,60 @@ public class Commandtptoggle extends EssentialsCommand
|
|||||||
super("tptoggle");
|
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
|
@Override
|
||||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
User otherUser = null;
|
if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.tptoggle.others"))
|
||||||
if (args.length > 0 && user.isAuthorized("essentials.tptoggle.others"))
|
|
||||||
{
|
{
|
||||||
otherUser = ess.getUser(server.getPlayer(args[0]));
|
toggleOtherPlayers(server, user, args);
|
||||||
if (otherUser == null)
|
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
|
else
|
||||||
{
|
{
|
||||||
ess.getUser(server.getPlayer(args[0])).sendMessage(user.toggleTeleportEnabled()
|
player.setTeleportEnabled(false);
|
||||||
? _("teleportationEnabled")
|
|
||||||
: _("teleportationDisabled"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
user.sendMessage(user.toggleTeleportEnabled()
|
player.toggleTeleportEnabled();
|
||||||
? _("teleportationEnabled")
|
}
|
||||||
: _("teleportationDisabled"));
|
|
||||||
|
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.
|
# Disabled commands will be completely unavailable on the server.
|
||||||
# Disabling commands here will have no effect on command conflicts.
|
# Disabling commands here will have no effect on command conflicts.
|
||||||
disabled-commands:
|
disabled-commands:
|
||||||
# - nick
|
# - nick
|
||||||
|
|
||||||
# If you do not wish to use a permission system, you can define a list of 'player perms' below.
|
# 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.
|
# 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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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.
|
noPerm=\u00a7cNo tienes el permiso de \u00a7f{0}\u00a7c.
|
||||||
noPermToSpawnMob=\u00a7cNo tienes permisos para spawnear a este mob.
|
noPermToSpawnMob=\u00a7cNo tienes permisos para spawnear a este mob.
|
||||||
noPlacePermission=\u00a7cNo tienes permiso para situar ese bloque en ese lugar.
|
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.
|
noRules=\u00a7cNo hay reglas especificadas todavia.
|
||||||
noWarpsDefined=No hay teletransportes definidos aun.
|
noWarpsDefined=No hay teletransportes definidos aun.
|
||||||
none=ninguno
|
none=ninguno
|
||||||
@ -448,7 +448,7 @@ youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f p
|
|||||||
posX=\u00a76X: {0} (+Este <-> -Oeste)
|
posX=\u00a76X: {0} (+Este <-> -Oeste)
|
||||||
posY=\u00a76Y: {0} (+Arriba <-> -abajo)
|
posY=\u00a76Y: {0} (+Arriba <-> -abajo)
|
||||||
posZ=\u00a76Z: {0} (+Sur <-> -Norte)
|
posZ=\u00a76Z: {0} (+Sur <-> -Norte)
|
||||||
posYaw=\u00a76guiñar: {0} (Rotacion)
|
posYaw=\u00a76gui\u00c3\u00b1ar: {0} (Rotacion)
|
||||||
posPitch=\u00a76Tono: {0} (Angulo de cabeza)
|
posPitch=\u00a76Tono: {0} (Angulo de cabeza)
|
||||||
distance=\u00a76Distancia: {0}
|
distance=\u00a76Distancia: {0}
|
||||||
giveSpawn=\u00a76Se a dado\u00a7c {0} \u00a76de\u00a7c {1} a\u00a7c {2}\u00a76.
|
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
|
invalidHomeName=\u00a74Nombre de casa invalido
|
||||||
invalidWarpName=\u00a74Nombre de warp invalido
|
invalidWarpName=\u00a74Nombre de warp invalido
|
||||||
userUnknown=\u00a74Peligro: El jugador '\u00a7c{0}\u00a74' Nunca a ingresado a este servidor.
|
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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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.
|
canTalkAgain=\u00a77Vous pouvez de nouveau parler.
|
||||||
cantFindGeoIpDB=N'arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
|
cantFindGeoIpDB=N'arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
|
||||||
cantReadGeoIpDB=Echec de la lecture de 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]
|
chatTypeAdmin=[A]
|
||||||
chatTypeLocal=[L]
|
chatTypeLocal=[L]
|
||||||
chatTypeSpy=[Spy]
|
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.
|
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.
|
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.
|
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}.
|
extinguishOthers=\u00a77Vous avez \u00e9teint la combustion de {0}.
|
||||||
failedToCloseConfig=Echec de la fermeture de la configuration {0}
|
failedToCloseConfig=Echec de la fermeture de la configuration {0}
|
||||||
failedToCreateConfig=Echec de la cr\u00e9ation 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.
|
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----
|
infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} \u00a7e----
|
||||||
infoUnknownChapter=Chapitre inconnu.
|
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.
|
invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu.
|
||||||
invSee=Vous voyez l''inventaire de {0}.
|
invSee=Vous voyez l''inventaire de {0}.
|
||||||
invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire.
|
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
|
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 portions, \u00a7c{3}\u00a76 entit\u00e9s
|
||||||
invalidHomeName=\u00a74Nom de r\u00e9sindence invalide
|
invalidHomeName=\u00a74Nom de r\u00e9sindence invalide
|
||||||
invalidWarpName=\u00a74Nom de warp 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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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
|
invalidHomeName=\u00a74Invalid home name
|
||||||
invalidWarpName=\u00a74Invalid warp name
|
invalidWarpName=\u00a74Invalid warp name
|
||||||
userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
|
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]
|
aliases: [etppos]
|
||||||
tptoggle:
|
tptoggle:
|
||||||
description: Blocks all forms of teleportation.
|
description: Blocks all forms of teleportation.
|
||||||
usage: /<command>
|
usage: /<command> [player [on|off]]
|
||||||
aliases: [etptoggle]
|
aliases: [etptoggle]
|
||||||
tree:
|
tree:
|
||||||
description: Spawn a tree where you are looking.
|
description: Spawn a tree where you are looking.
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package com.earth2me.essentials.protect;
|
package com.earth2me.essentials.protect;
|
||||||
|
|
||||||
import com.earth2me.essentials.protect.data.IProtectedBlock;
|
import com.earth2me.essentials.protect.data.IProtectedBlock;
|
||||||
|
import com.mchange.v2.log.MLevel;
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
import java.util.logging.Filter;
|
import java.util.logging.Filter;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.LogRecord;
|
import java.util.logging.LogRecord;
|
||||||
@ -27,14 +29,20 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
|
|||||||
@Override
|
@Override
|
||||||
public void onLoad()
|
public void onLoad()
|
||||||
{
|
{
|
||||||
C3P0logger = com.mchange.v2.log.MLog.getLogger(com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.class);
|
try
|
||||||
C3P0logger.setFilter(new Filter()
|
|
||||||
{
|
{
|
||||||
public boolean isLoggable(LogRecord lr)
|
// Simple fix for the case that log4j is on the class path by another plugin
|
||||||
{
|
Class propertyConfiguratorClass = Class.forName("org.apache.log4j.PropertyConfigurator");
|
||||||
return lr.getLevel() != Level.INFO;
|
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()
|
public void onEnable()
|
||||||
@ -65,7 +73,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
|
|||||||
{
|
{
|
||||||
final EmergencyListener emListener = new EmergencyListener();
|
final EmergencyListener emListener = new EmergencyListener();
|
||||||
pm.registerEvents(emListener, this);
|
pm.registerEvents(emListener, this);
|
||||||
|
|
||||||
for (Player player : getServer().getOnlinePlayers())
|
for (Player player : getServer().getOnlinePlayers())
|
||||||
{
|
{
|
||||||
player.sendMessage("Essentials Protect is in emergency mode. Check your log for errors.");
|
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;
|
return ess;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<ProtectConfig, Boolean> getSettingsBoolean()
|
public Map<ProtectConfig, Boolean> getSettingsBoolean()
|
||||||
{
|
{
|
||||||
return settingsBoolean;
|
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