mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-24 15:23:20 +02:00
Merge branch '3.0' of github.com:essentials/Essentials into 3.0
This commit is contained in:
@@ -5,6 +5,7 @@ import com.earth2me.essentials.api.IEssentials;
|
||||
import com.earth2me.essentials.api.IWarp;
|
||||
import com.earth2me.essentials.api.IWarps;
|
||||
import com.earth2me.essentials.api.InvalidNameException;
|
||||
import com.earth2me.essentials.commands.WarpNotFoundException;
|
||||
import com.earth2me.essentials.settings.WarpHolder;
|
||||
import com.earth2me.essentials.storage.StorageObjectMap;
|
||||
import java.io.File;
|
||||
@@ -60,7 +61,7 @@ public class Warps extends StorageObjectMap<IWarp> implements IWarps
|
||||
IWarp warp = getObject(name);
|
||||
if (warp == null)
|
||||
{
|
||||
throw new Exception(_("warpNotExist"));
|
||||
throw new WarpNotFoundException(_("warpNotExist"));
|
||||
}
|
||||
warp.acquireReadLock();
|
||||
try
|
||||
|
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.api.IWarps;
|
||||
import org.bukkit.Location;
|
||||
|
||||
|
||||
@@ -21,7 +22,27 @@ public class Commandsetwarp extends EssentialsCommand
|
||||
}
|
||||
|
||||
final Location loc = user.getLocation();
|
||||
ess.getWarps().setWarp(args[0], loc);
|
||||
final IWarps warps = ess.getWarps();
|
||||
Location warpLoc = null;
|
||||
|
||||
try
|
||||
{
|
||||
warpLoc = warps.getWarp(args[0]);
|
||||
}
|
||||
catch (WarpNotFoundException ex)
|
||||
{
|
||||
}
|
||||
|
||||
if (warpLoc == null || user.hasPermission("essentials.warp.overwrite." + args[0]))
|
||||
{
|
||||
warps.setWarp(args[0], loc);
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("warpOverwrite"));
|
||||
return;
|
||||
}
|
||||
|
||||
user.sendMessage(_("warpSet", args[0]));
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,17 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
|
||||
public class WarpNotFoundException extends Exception
|
||||
{
|
||||
public WarpNotFoundException()
|
||||
{
|
||||
super("");
|
||||
}
|
||||
|
||||
public WarpNotFoundException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -383,6 +383,7 @@ warpUsePermission=\u00a7cYou do not have Permission to use that warp.
|
||||
warpingTo=\u00a77Warping to {0}.
|
||||
warps=Warps: {0}
|
||||
warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}.
|
||||
warpOverwrite=\u00a7cYou cannot overwrite that warp.
|
||||
weatherStorm=\u00a77You set the weather to storm in {0}
|
||||
weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds
|
||||
weatherSun=\u00a77You set the weather to sun in {0}
|
||||
|
@@ -383,6 +383,7 @@ warpUsePermission=\u00a7cDu har ikke tilladelse til at benytte den warp.
|
||||
warpingTo=\u00a77Warper til {0}.
|
||||
warps=Warps: {0}
|
||||
warpsCount=\u00a77Der er {0} warps. Viser side {1} af {2}.
|
||||
warpOverwrite=\u00a7cYou cannot overwrite that warp.
|
||||
weatherStorm=\u00a77Du har sat vejret til ''storm'' i {0}
|
||||
weatherStormFor=\u00a77Du har sat vejret til ''storm'' i {0} i {1} sekunder
|
||||
weatherSun=\u00a77Du har sat vejret til ''sol'' i {0}
|
||||
|
@@ -383,6 +383,7 @@ warpUsePermission=\u00a7cDu hast keinen Zugriff f\u00fcr diesen Warp-Punkt.
|
||||
warpingTo=\u00a77Teleportiere zu Warp-Punkt {0}.
|
||||
warps=Warps: {0}
|
||||
warpsCount=\u00a77Es gibt {0} Warp-Punkte. Zeige Seite {1} von {2}.
|
||||
warpOverwrite=\u00a7cYou cannot overwrite that warp.
|
||||
weatherStorm=\u00a77In {0} st\u00fcrmt es nun.
|
||||
weatherStormFor=\u00a77In {0} st\u00fcrmt es nun f\u00fcr {1} Sekunden.
|
||||
weatherSun=\u00a77In {0} scheint nun die Sonne.
|
||||
|
@@ -383,6 +383,7 @@ warpUsePermission=\u00a7cYou do not have Permission to use that warp.
|
||||
warpingTo=\u00a77Warping to {0}.
|
||||
warps=Warps: {0}
|
||||
warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}.
|
||||
warpOverwrite=\u00a7cYou cannot overwrite that warp.
|
||||
weatherStorm=\u00a77You set the weather to storm in {0}
|
||||
weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds
|
||||
weatherSun=\u00a77You set the weather to sun in {0}
|
||||
|
@@ -383,6 +383,7 @@ warpUsePermission=\u00a7cNo tienes permisos para usar ese teletransporte.
|
||||
warpingTo=\u00a77Teletransportandote a {0}.
|
||||
warps=Warps: {0}
|
||||
warpsCount=\u00a77Hay {0} teletransportes. Mostrando pagina {1} de {2}.
|
||||
warpOverwrite=\u00a7cYou cannot overwrite that warp.
|
||||
weatherStorm=\u00a77Has establecido el tiempo a tormenta en este mundo.
|
||||
weatherStormFor=\u00a77Has establecido el tiempo a tormenta en este {1} durante {0} segundos.
|
||||
weatherSun=\u00a77Has establecido el tiempo a sol en este mundo.
|
||||
|
@@ -383,6 +383,7 @@ warpUsePermission=\u00a7cVous n''avez pas la permission d''utiliser ce warp.
|
||||
warpingTo=\u00a77T\u00e9l\u00e9portation au warp {0}.
|
||||
warps=Raccourcis : {0}
|
||||
warpsCount=\u00a77Il y a {0} raccourcis. Page {1} sur {2}.
|
||||
warpOverwrite=\u00a7cYou cannot overwrite that warp.
|
||||
weatherStorm=\u00a77Vous avez programm\u00e9 l''orage dans {0}
|
||||
weatherStormFor=\u00a77Vous avez programm\u00e9 l''orage dans {0} pour {1} secondes.
|
||||
weatherSun=\u00a77Vous avez programm\u00e9 le beau temps dans {0}
|
||||
|
@@ -383,6 +383,7 @@ warpUsePermission=\u00a7cOnbevoegd om die warp te gebruiken.
|
||||
warpingTo=\u00a77Aan het warpen naar {0}.
|
||||
warps=Warps: {0}
|
||||
warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}.
|
||||
warpOverwrite=\u00a7cYou cannot overwrite that warp.
|
||||
weatherStorm=\u00a77Je hebt het weer naar storm gezet in de {0}
|
||||
weatherStormFor=\u00a77Je hebt het weer in de {0} naar storm gezet voor {1} seconde
|
||||
weatherSun=\u00a77Je hebt het weer naar zon gezet in de {0}
|
||||
|
Reference in New Issue
Block a user