mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 12:23:59 +00:00
Merge branch 'master' into release
This commit is contained in:
commit
21d0661d79
27 changed files with 553 additions and 144 deletions
|
@ -0,0 +1,39 @@
|
|||
package com.earth2me.essentials;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class BukkitPermissionsHandler implements IPermissionsHandler
|
||||
{
|
||||
|
||||
public String getGroup(Player base)
|
||||
{
|
||||
return "default";
|
||||
}
|
||||
|
||||
public boolean canBuild(Player base, String group)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean inGroup(Player base, String group)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasPermission(Player base, String node)
|
||||
{
|
||||
return base.hasPermission(node);
|
||||
}
|
||||
|
||||
public String getPrefix(Player base)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getSuffix(Player base)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
|
@ -46,7 +46,7 @@ import org.bukkit.plugin.java.*;
|
|||
|
||||
public class Essentials extends JavaPlugin implements IEssentials
|
||||
{
|
||||
public static final int BUKKIT_VERSION = 974;
|
||||
public static final int BUKKIT_VERSION = 1000;
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private transient ISettings settings;
|
||||
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
|
||||
|
@ -157,9 +157,16 @@ public class Essentials extends JavaPlugin implements IEssentials
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.getSettings().useBukkitPermissions())
|
||||
{
|
||||
this.permissionsHandler = new BukkitPermissionsHandler();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.permissionsHandler = new ConfigPermissionsHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
final ServerListener serverListener = new EssentialsPluginListener(paymentMethod);
|
||||
pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Low, this);
|
||||
|
@ -190,6 +197,8 @@ public class Essentials extends JavaPlugin implements IEssentials
|
|||
pm.registerEvent(Type.BLOCK_BREAK, signBlockListener, Priority.Highest, this);
|
||||
pm.registerEvent(Type.BLOCK_IGNITE, signBlockListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.BLOCK_BURN, signBlockListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.BLOCK_PISTON_EXTEND, signBlockListener, Priority.Low, this);
|
||||
pm.registerEvent(Type.BLOCK_PISTON_RETRACT, signBlockListener, Priority.Low, this);
|
||||
|
||||
final SignPlayerListener signPlayerListener = new SignPlayerListener(this);
|
||||
pm.registerEvent(Type.PLAYER_INTERACT, signPlayerListener, Priority.Low, this);
|
||||
|
|
|
@ -60,6 +60,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
|||
if (user.isMuted())
|
||||
{
|
||||
event.setCancelled(true);
|
||||
user.sendMessage(Util.i18n("playerMuted"));
|
||||
LOGGER.info(Util.format("mutedUserSpeaks", user.getName()));
|
||||
}
|
||||
final Iterator<Player> it = event.getRecipients().iterator();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.earth2me.essentials;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.bukkit.BlockChangeDelegate;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.ChunkSnapshot;
|
||||
|
@ -8,6 +9,7 @@ import org.bukkit.Effect;
|
|||
import org.bukkit.Location;
|
||||
import org.bukkit.TreeType;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Boat;
|
||||
|
@ -172,26 +174,6 @@ public class FakeWorld implements World
|
|||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public Minecart spawnMinecart(Location lctn)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public StorageMinecart spawnStorageMinecart(Location lctn)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public PoweredMinecart spawnPoweredMinecart(Location lctn)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public Boat spawnBoat(Location lctn)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public LivingEntity spawnCreature(Location lctn, CreatureType ct)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
|
@ -392,7 +374,33 @@ public class FakeWorld implements World
|
|||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public long getUID()
|
||||
public UUID getUID()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public Block getHighestBlockAt(int i, int i1)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public Block getHighestBlockAt(Location lctn)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
|
||||
public Biome getBiome(int i, int i1)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public double getTemperature(int i, int i1)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public double getHumidity(int i, int i1)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
|
|
@ -128,4 +128,6 @@ public interface ISettings extends IConf
|
|||
boolean changeDisplayName();
|
||||
|
||||
boolean isPlayerCommand(String string);
|
||||
|
||||
public boolean useBukkitPermissions();
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.earth2me.essentials;
|
|||
import java.net.InetSocketAddress;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.bukkit.Achievement;
|
||||
import org.bukkit.Effect;
|
||||
|
@ -23,6 +24,10 @@ import org.bukkit.entity.Vehicle;
|
|||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionAttachment;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
|
||||
|
@ -513,4 +518,62 @@ public class OfflinePlayer implements Player
|
|||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean isPermissionSet(String string)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isPermissionSet(Permission prmsn)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasPermission(String string)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasPermission(Permission prmsn)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public PermissionAttachment addAttachment(Plugin plugin)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln, int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public PermissionAttachment addAttachment(Plugin plugin, int i)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void removeAttachment(PermissionAttachment pa)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void recalculatePermissions()
|
||||
{
|
||||
}
|
||||
|
||||
public Set<PermissionAttachmentInfo> getEffectivePermissions()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void setOp(boolean bln)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,10 @@ import org.bukkit.block.Block;
|
|||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.inventory.*;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionAttachment;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class PlayerWrapper implements Player
|
||||
|
@ -560,4 +564,64 @@ public class PlayerWrapper implements Player
|
|||
{
|
||||
base.resetPlayerTime();
|
||||
}
|
||||
|
||||
public boolean isPermissionSet(String string)
|
||||
{
|
||||
return base.isPermissionSet(string);
|
||||
}
|
||||
|
||||
public boolean isPermissionSet(Permission prmsn)
|
||||
{
|
||||
return base.isPermissionSet(prmsn);
|
||||
}
|
||||
|
||||
public boolean hasPermission(String string)
|
||||
{
|
||||
return base.hasPermission(string);
|
||||
}
|
||||
|
||||
public boolean hasPermission(Permission prmsn)
|
||||
{
|
||||
return base.hasPermission(prmsn);
|
||||
}
|
||||
|
||||
public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln)
|
||||
{
|
||||
return base.addAttachment(plugin, string, bln);
|
||||
}
|
||||
|
||||
public PermissionAttachment addAttachment(Plugin plugin)
|
||||
{
|
||||
return base.addAttachment(plugin);
|
||||
}
|
||||
|
||||
public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln, int i)
|
||||
{
|
||||
return base.addAttachment(plugin, string, bln, i);
|
||||
}
|
||||
|
||||
public PermissionAttachment addAttachment(Plugin plugin, int i)
|
||||
{
|
||||
return base.addAttachment(plugin, i);
|
||||
}
|
||||
|
||||
public void removeAttachment(PermissionAttachment pa)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public void recalculatePermissions()
|
||||
{
|
||||
base.recalculatePermissions();
|
||||
}
|
||||
|
||||
public Set<PermissionAttachmentInfo> getEffectivePermissions()
|
||||
{
|
||||
return base.getEffectivePermissions();
|
||||
}
|
||||
|
||||
public void setOp(boolean bln)
|
||||
{
|
||||
base.setOp(bln);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -464,4 +464,8 @@ public class Settings implements ISettings
|
|||
return config.getBoolean("change-displayname", true);
|
||||
}
|
||||
|
||||
public boolean useBukkitPermissions()
|
||||
{
|
||||
return config.getBoolean("use-bukkit-permissions", false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -375,7 +375,6 @@ public class Util
|
|||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
return cl.getResourceAsStream(string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,11 @@ public class Commandmute extends EssentialsCommand
|
|||
}
|
||||
|
||||
User p = getPlayer(server, args, 0, true);
|
||||
if (p.isAuthorized("essentials.mute.exempt"))
|
||||
{
|
||||
sender.sendMessage(Util.i18n("muteExempt"));
|
||||
return;
|
||||
}
|
||||
long muteTimestamp = 0;
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
@ -30,13 +35,18 @@ public class Commandmute extends EssentialsCommand
|
|||
}
|
||||
p.setMuteTimeout(muteTimestamp);
|
||||
charge(sender);
|
||||
|
||||
|
||||
boolean muted = p.toggleMuted();
|
||||
sender.sendMessage(
|
||||
p.toggleMuted()
|
||||
muted
|
||||
? (muteTimestamp > 0
|
||||
? Util.format("mutedPlayerFor", p.getDisplayName(), Util.formatDateDiff(muteTimestamp))
|
||||
: Util.format("mutedPlayer", p.getDisplayName()))
|
||||
: Util.format("unmutedPlayer", p.getDisplayName()));
|
||||
p.sendMessage(
|
||||
muted
|
||||
? (muteTimestamp > 0
|
||||
? Util.format("playerMutedFor", Util.formatDateDiff(muteTimestamp))
|
||||
: Util.i18n("playerMuted"))
|
||||
: Util.i18n("playerUnmuted"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,9 +189,14 @@ public class EssentialsSign
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean onBlockPush(Block block, IEssentials ess)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean checkIfBlockBreaksSigns(final Block block)
|
||||
{
|
||||
if (block.getFace(BlockFace.UP).getType() == Material.SIGN_POST)
|
||||
if (block.getRelative(BlockFace.UP).getType() == Material.SIGN_POST)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -204,7 +209,7 @@ public class EssentialsSign
|
|||
};
|
||||
for (BlockFace blockFace : directions)
|
||||
{
|
||||
final Block signblock = block.getFace(blockFace);
|
||||
final Block signblock = block.getRelative(blockFace);
|
||||
if (signblock.getType() == Material.WALL_SIGN)
|
||||
{
|
||||
final org.bukkit.material.Sign sign = (org.bukkit.material.Sign)signblock.getState().getData();
|
||||
|
@ -333,7 +338,7 @@ public class EssentialsSign
|
|||
protected final Double getDoublePositive(final String line) throws SignException
|
||||
{
|
||||
final double quantity = getDouble(line);
|
||||
if (Math.round(quantity*100.0) < 1.0)
|
||||
if (Math.round(quantity * 100.0) < 1.0)
|
||||
{
|
||||
throw new SignException(Util.i18n("moreThanZero"));
|
||||
}
|
||||
|
@ -425,7 +430,6 @@ public class EssentialsSign
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@ import org.bukkit.event.block.BlockBreakEvent;
|
|||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.block.BlockListener;
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
|
||||
|
@ -104,7 +106,8 @@ public class SignBlockListener extends BlockListener
|
|||
User user = ess.getUser(event.getPlayer());
|
||||
if (user.isAuthorized("essentials.signs.color"))
|
||||
{
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
event.setLine(i, event.getLine(i).replaceAll("&([0-9a-f])", "§$1"));
|
||||
}
|
||||
}
|
||||
|
@ -184,4 +187,55 @@ public class SignBlockListener extends BlockListener
|
|||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPistonExtend(BlockPistonExtendEvent event)
|
||||
{
|
||||
for (Block block : event.getBlocks())
|
||||
{
|
||||
if ((block.getType() == Material.WALL_SIGN
|
||||
|| block.getType() == Material.SIGN_POST
|
||||
|| EssentialsSign.checkIfBlockBreaksSigns(block)))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockPush(block, ess))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPistonRetract(BlockPistonRetractEvent event)
|
||||
{
|
||||
if (event.isSticky())
|
||||
{
|
||||
final Block block = event.getBlock();
|
||||
if ((block.getType() == Material.WALL_SIGN
|
||||
|| block.getType() == Material.SIGN_POST
|
||||
|| EssentialsSign.checkIfBlockBreaksSigns(block)))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
for (Signs signs : Signs.values())
|
||||
{
|
||||
final EssentialsSign sign = signs.getSign();
|
||||
if (sign.getBlocks().contains(block.getType())
|
||||
&& !sign.onBlockPush(block, ess))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,12 +168,12 @@ public class SignProtection extends EssentialsSign
|
|||
{
|
||||
return new Block[]
|
||||
{
|
||||
block.getFace(BlockFace.NORTH),
|
||||
block.getFace(BlockFace.SOUTH),
|
||||
block.getFace(BlockFace.EAST),
|
||||
block.getFace(BlockFace.WEST),
|
||||
block.getFace(BlockFace.DOWN),
|
||||
block.getFace(BlockFace.UP)
|
||||
block.getRelative(BlockFace.NORTH),
|
||||
block.getRelative(BlockFace.SOUTH),
|
||||
block.getRelative(BlockFace.EAST),
|
||||
block.getRelative(BlockFace.WEST),
|
||||
block.getRelative(BlockFace.DOWN),
|
||||
block.getRelative(BlockFace.UP)
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -311,4 +311,12 @@ public class SignProtection extends EssentialsSign
|
|||
|
||||
return state == SignProtectionState.NOSIGN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockPush(final Block block, final IEssentials ess)
|
||||
{
|
||||
final SignProtectionState state = isBlockProtected(block, null, null, false);
|
||||
|
||||
return state == SignProtectionState.NOSIGN;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -182,10 +182,16 @@ debug: false
|
|||
|
||||
# Set the locale for all messages
|
||||
# If you don't set this, the default locale of the server will be used.
|
||||
# Don't forget to remove the # infront of the line
|
||||
#locale: de_DE
|
||||
|
||||
#turn off god mode when people exit
|
||||
remove-god-on-disconnect: false
|
||||
|
||||
# Use the permission system of bukkit
|
||||
# This only works if no other permission plugins are installed
|
||||
use-bukkit-permissions: false
|
||||
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
# | EssentialsHome | #
|
||||
|
@ -299,7 +305,7 @@ protect:
|
|||
on-placement: 10,11,46
|
||||
on-use:
|
||||
# 46: TNT
|
||||
on-break: 46
|
||||
on-break:
|
||||
|
||||
# Users cannot PLACE these types of blocks/items.
|
||||
# < 255 designates a BLOCK
|
||||
|
@ -312,6 +318,8 @@ protect:
|
|||
#break: 20,50
|
||||
break:
|
||||
|
||||
# Which blocks should not be pushed by pistons
|
||||
piston:
|
||||
|
||||
# General physics/behavior modifications
|
||||
prevent:
|
||||
|
|
|
@ -168,6 +168,7 @@ month = month
|
|||
months = months
|
||||
moreThanZero = Quantities must be greater than 0.
|
||||
msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
|
||||
muteExempt = \u00a7cYou may not mute that player.
|
||||
mutedPlayer = Player {0} muted.
|
||||
mutedPlayerFor = Player {0} muted for {1}.
|
||||
mutedUserSpeaks = {0} tried to speak, but is muted.
|
||||
|
@ -182,6 +183,7 @@ nickSet = \u00a77Your nickname is now \u00a7c{0}
|
|||
noAccessCommand = \u00a7cYou do not have access to that command.
|
||||
noAccessPermission = \u00a7cYou do not have permission to access that {0}.
|
||||
noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}.
|
||||
noHelpFound = \u00a7cNo matching commands.
|
||||
noHomeSet = You have not set a home.
|
||||
noHomeSetPlayer = Player has not set a home.
|
||||
noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.
|
||||
|
@ -213,8 +215,11 @@ playerInJail = \u00a7cPlayer is already in jail {0}.
|
|||
playerJailed = \u00a77Player {0} jailed.
|
||||
playerJailedFor = \u00a77Player {0} jailed for {1}.
|
||||
playerKicked = \u00a7cPlayer {0} kicked: {1}
|
||||
playerMuted = "\u00a77You have been muted"
|
||||
playerMutedFor = "\u00a77You have been muted for {0}"
|
||||
playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
|
||||
playerNotFound = \u00a7cPlayer not found.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
|
||||
powerToolAir = Command can''t be attached to air.
|
||||
|
|
|
@ -170,6 +170,7 @@ month = m\u00e5ned
|
|||
months = m\u00e5neder
|
||||
moreThanZero = M\u00e6ngder skal v\u00e6re st\u00f8rre end 0.
|
||||
msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
|
||||
muteExempt = \u00a7cYou may not mute that player.
|
||||
mutedPlayer = Spiller {0} d\u00e6mpet.
|
||||
mutedPlayerFor = Spiller {0} d\u00e6mpet for {1}.
|
||||
mutedUserSpeaks = {0} pr\u00f8vede at snakke, men er muted.
|
||||
|
@ -184,6 +185,7 @@ nickSet = \u00a77Dit kaldenavn er nu \u00a7c{0}
|
|||
noAccessCommand = \u00a7cDu har ikke adgang til den kommando.
|
||||
noAccessPermission = \u00a7cDu har ikke tilladelse til at f\u00e5 adgang til det {0}.
|
||||
noDestroyPermission = \u00a7cDu har ikke tilladelse til at \u00f8del\u00e6gge det {0}.
|
||||
noHelpFound = \u00a7cNo matching commands.
|
||||
noHomeSet = Du har sat et nyt hjem.
|
||||
noHomeSetPlayer = Spiller har ikke sat et hjem.
|
||||
noKitPermission = \u00a7cDu har brug for \u00a7c{0}\u00a7c tilladelsen for at bruge den pakke.
|
||||
|
@ -215,8 +217,11 @@ playerInJail = \u00a7cSpiller er allerede i f\u00e6ngsel {0}.
|
|||
playerJailed = \u00a77Spiller {0} f\u00e6ngslet.
|
||||
playerJailedFor = \u00a77Spiller {0} f\u00e6ngslet for {1}.
|
||||
playerKicked = \u00a7cPlayer {0} kicked: {1}
|
||||
playerMuted = "\u00a77You have been muted"
|
||||
playerMutedFor = "\u00a77You have been muted for {0}"
|
||||
playerNeverOnServer = \u00a7cSpiller {0} var aldrig p\u00e5 denne server.
|
||||
playerNotFound = \u00a7cSpiller ikke fundet.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Mulige verdener er numrene 0 igennem {0}.
|
||||
powerToolAir = Kommando kan ikke blive tildelt luft.
|
||||
|
|
|
@ -168,6 +168,7 @@ month = Monat
|
|||
months = Monate
|
||||
moreThanZero = Anzahl muss gr\u00f6sser als 0 sein.
|
||||
msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
|
||||
muteExempt = \u00a7cYou may not mute that player.
|
||||
mutedPlayer = Player {0} ist nun stumm.
|
||||
mutedPlayerFor = Player {0} ist nun stumm f\u00fcr {1}.
|
||||
mutedUserSpeaks = {0} versuchte zu sprechen, aber ist stumm geschalt.
|
||||
|
@ -182,6 +183,7 @@ nickSet = \u00a77Dein Nickname ist nun \u00a7c{0}
|
|||
noAccessCommand = \u00a7cDu hast keinen Zugriff auf diesen Befehl.
|
||||
noAccessPermission = \u00a7cDu hast keine Rechte, den Block {0} zu \u00f6ffnen.
|
||||
noDestroyPermission = \u00a7cDu hast keine Rechte, den Block {0} zu zerst\u00f6ren.
|
||||
noHelpFound = \u00a7cNo matching commands.
|
||||
noHomeSet = Du hast kein Zuhause gesetzt.
|
||||
noHomeSetPlayer = Spieler hat kein Zuhause gesetzt.
|
||||
noKitPermission = \u00a7cDu brauchst die Berechtigung \u00a7c{0}\u00a7c um diese Ausr\u00fcstung anzufordern.
|
||||
|
@ -213,8 +215,11 @@ playerInJail = \u00a7cSpieler ist bereits in Gef\u00e4ngnis {0}.
|
|||
playerJailed = \u00a77Spieler {0} eingesperrt.
|
||||
playerJailedFor = \u00a77Spieler {0} eingesperrt f\u00fcr {1}.
|
||||
playerKicked = \u00a7cSpieler {0} rausgeworfen: {1}
|
||||
playerMuted = "\u00a77You have been muted"
|
||||
playerMutedFor = "\u00a77You have been muted for {0}"
|
||||
playerNeverOnServer = \u00a7cSpieler {0} war niemals auf diesem Server.
|
||||
playerNotFound = \u00a7cSpieler nicht gefunden.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77M\u00f6gliche Welten sind nummeriet von 0 bis {0}.
|
||||
powerToolAir = Befehl kann nicht mit Luft verbunden werden.
|
||||
|
|
|
@ -168,6 +168,7 @@ month = month
|
|||
months = months
|
||||
moreThanZero = Quantities must be greater than 0.
|
||||
msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
|
||||
muteExempt = \u00a7cYou may not mute that player.
|
||||
mutedPlayer = Player {0} muted.
|
||||
mutedPlayerFor = Player {0} muted for {1}.
|
||||
mutedUserSpeaks = {0} tried to speak, but is muted.
|
||||
|
@ -214,8 +215,11 @@ playerInJail = \u00a7cPlayer is already in jail {0}.
|
|||
playerJailed = \u00a77Player {0} jailed.
|
||||
playerJailedFor = \u00a77Player {0} jailed for {1}.
|
||||
playerKicked = \u00a7cPlayer {0} kicked: {1}
|
||||
playerMuted = "\u00a77You have been muted"
|
||||
playerMutedFor = "\u00a77You have been muted for {0}"
|
||||
playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
|
||||
playerNotFound = \u00a7cPlayer not found.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
|
||||
powerToolAir = Command can''t be attached to air.
|
||||
|
|
|
@ -168,6 +168,7 @@ month = mois
|
|||
months = mois
|
||||
moreThanZero = Les Quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro.
|
||||
msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
|
||||
muteExempt = \u00a7cYou may not mute that player.
|
||||
mutedPlayer = Le joueur {0} est d\u00e9sormais muet.
|
||||
mutedPlayerFor = {0} a \u00e9t\u00e9 mute pour {1}.
|
||||
mutedUserSpeaks = {0} a essay\u00e9 de parler mais est muet.
|
||||
|
@ -182,6 +183,7 @@ nickSet = \u00a77Votre pseudo est maintenant \u00a7c{0}
|
|||
noAccessCommand = \u00a7cVous n''avez pas acc\u00e8s \u00e0 cette commande.
|
||||
noAccessPermission = \u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0}
|
||||
noDestroyPermission = \u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}.
|
||||
noHelpFound = \u00a7cNo matching commands.
|
||||
noHomeSet = Vous n''avez pas d\u00e9fini de home.
|
||||
noHomeSetPlayer = Le joueur n''a pas d\u00e9fini son home.
|
||||
noKitPermission = \u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour utiliser ce kit.
|
||||
|
@ -213,8 +215,11 @@ playerInJail = \u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}.
|
|||
playerJailed = \u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9.
|
||||
playerJailedFor = \u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}.
|
||||
playerKicked = \u00a7cPlayer {0} kicked: {1}
|
||||
playerMuted = "\u00a77You have been muted"
|
||||
playerMutedFor = "\u00a77You have been muted for {0}"
|
||||
playerNeverOnServer = \u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur.
|
||||
playerNotFound = \u00a7cLe joueur est introuvable.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Les mondes possibles sont les nombres 0 par {0}.
|
||||
powerToolAir = La commande ne peut pas \u00eatre attach\u00e9e \u00e0 l''air.
|
||||
|
|
|
@ -169,6 +169,7 @@ month = maand
|
|||
months = maanden
|
||||
moreThanZero = Aantal moet groter zijn dan 0.
|
||||
msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
|
||||
muteExempt = \u00a7cYou may not mute that player.
|
||||
mutedPlayer = Speler {0} gemute.
|
||||
mutedPlayerFor = Speler {0} is gemute voor {1}.
|
||||
mutedUserSpeaks = {0} probeerde te praten, maar is gemute.
|
||||
|
@ -183,6 +184,7 @@ nickSet = \u00a77Je nickname is nu \u00a7c{0}
|
|||
noAccessCommand = \u00a7cJe hebt geen toegang tot die opdracht.
|
||||
noAccessPermission = \u00a7cJe hebt hier geen toegang voor {0}.
|
||||
noDestroyPermission = \u00a7cJe hebt geen toegang om dat te vernietigen {0}.
|
||||
noHelpFound = \u00a7cNo matching commands.
|
||||
noHomeSet = Je hebt geen home gemaakt.
|
||||
noHomeSetPlayer = Speler heeft geen home.
|
||||
noKitPermission = \u00a7cJe hebt de \u00a7c{0}\u00a7c toestemming nodig om die kit te gebruiken.
|
||||
|
@ -214,8 +216,11 @@ playerInJail = \u00a7cSpeler zit al in de gevangenis {0}.
|
|||
playerJailed = \u00a77Speler {0} is in de gevangenis gezet.
|
||||
playerJailedFor = \u00a77Speler {0} is in de gevangenis gezet voor {1}.
|
||||
playerKicked = \u00a7cPlayer {0} kicked: {1}
|
||||
playerMuted = "\u00a77You have been muted"
|
||||
playerMutedFor = "\u00a77You have been muted for {0}"
|
||||
playerNeverOnServer = \u00a7cSpeler {0} is nooit op deze server geweest.
|
||||
playerNotFound = \u00a7cSpeler niet gevonden.
|
||||
playerUnmuted = "\u00a77You have been unmuted"
|
||||
pong = Pong!
|
||||
possibleWorlds = \u00a77Mogelijk zijn de werelden de nummer 0 tot en met {0}.
|
||||
powerToolAir = Command kan niet worden bevestigd aan de lucht.
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.avaje.ebean.config.ServerConfig;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
|
@ -244,4 +245,9 @@ public class FakeServer implements Server
|
|||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public World getWorld(UUID uuid)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
|
|||
pm.registerEvent(Type.BLOCK_IGNITE, blockListener, Priority.Highest, this);
|
||||
pm.registerEvent(Type.BLOCK_BURN, blockListener, Priority.Highest, this);
|
||||
pm.registerEvent(Type.BLOCK_BREAK, blockListener, Priority.Highest, this);
|
||||
pm.registerEvent(Type.BLOCK_PISTON_EXTEND, blockListener, Priority.Highest, this);
|
||||
pm.registerEvent(Type.BLOCK_PISTON_RETRACT, blockListener, Priority.Highest, this);
|
||||
|
||||
final EssentialsProtectEntityListener entityListener = new EssentialsProtectEntityListener(this);
|
||||
pm.registerEvent(Type.ENTITY_EXPLODE, entityListener, Priority.Highest, this);
|
||||
|
|
|
@ -14,6 +14,8 @@ import org.bukkit.event.block.BlockBurnEvent;
|
|||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.block.BlockListener;
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
|
||||
|
||||
|
@ -58,7 +60,7 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
prot.alert(user, blockPlaced.getType().toString(), Util.i18n("alertPlaced"));
|
||||
}
|
||||
|
||||
final Block below = blockPlaced.getFace(BlockFace.DOWN);
|
||||
final Block below = blockPlaced.getRelative(BlockFace.DOWN);
|
||||
if (below.getType() == Material.RAILS
|
||||
&& prot.getSettingBool(ProtectConfig.prevent_block_on_rail)
|
||||
&& prot.getStorage().isProtected(below, user.getName()))
|
||||
|
@ -75,7 +77,7 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
protect.add(blockPlaced);
|
||||
if (prot.getSettingBool(ProtectConfig.protect_below_rails))
|
||||
{
|
||||
protect.add(blockPlaced.getFace(BlockFace.DOWN));
|
||||
protect.add(blockPlaced.getRelative(BlockFace.DOWN));
|
||||
}
|
||||
}
|
||||
if ((blockPlaced.getType() == Material.SIGN_POST || blockPlaced.getType() == Material.WALL_SIGN)
|
||||
|
@ -115,7 +117,7 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
return;
|
||||
}
|
||||
if (event.getBlock().getType() == Material.OBSIDIAN
|
||||
|| event.getBlock().getFace(BlockFace.DOWN).getType() == Material.OBSIDIAN)
|
||||
|| event.getBlock().getRelative(BlockFace.DOWN).getType() == Material.OBSIDIAN)
|
||||
{
|
||||
event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_portal_creation));
|
||||
return;
|
||||
|
@ -260,14 +262,14 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
storage.unprotectBlock(block);
|
||||
if (type == Material.RAILS || type == Material.SIGN_POST)
|
||||
{
|
||||
final Block below = block.getFace(BlockFace.DOWN);
|
||||
final Block below = block.getRelative(BlockFace.DOWN);
|
||||
storage.unprotectBlock(below);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (BlockFace blockFace : faces)
|
||||
{
|
||||
final Block against = block.getFace(blockFace);
|
||||
final Block against = block.getRelative(blockFace);
|
||||
storage.unprotectBlock(against);
|
||||
}
|
||||
}
|
||||
|
@ -276,7 +278,7 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
{
|
||||
for (BlockFace blockFace : faces)
|
||||
{
|
||||
final Block against = block.getFace(blockFace);
|
||||
final Block against = block.getRelative(blockFace);
|
||||
storage.unprotectBlock(against);
|
||||
}
|
||||
}
|
||||
|
@ -296,14 +298,14 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
storage.unprotectBlock(block);
|
||||
if (type == Material.RAILS || type == Material.SIGN_POST)
|
||||
{
|
||||
final Block below = block.getFace(BlockFace.DOWN);
|
||||
final Block below = block.getRelative(BlockFace.DOWN);
|
||||
storage.unprotectBlock(below);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (BlockFace blockFace : faces)
|
||||
{
|
||||
final Block against = block.getFace(blockFace);
|
||||
final Block against = block.getRelative(blockFace);
|
||||
storage.unprotectBlock(against);
|
||||
}
|
||||
}
|
||||
|
@ -312,11 +314,107 @@ public class EssentialsProtectBlockListener extends BlockListener
|
|||
{
|
||||
for (BlockFace blockFace : faces)
|
||||
{
|
||||
final Block against = block.getFace(blockFace);
|
||||
final Block against = block.getRelative(blockFace);
|
||||
storage.unprotectBlock(against);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPistonExtend(BlockPistonExtendEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (Block block : event.getBlocks())
|
||||
{
|
||||
if (prot.checkProtectionItems(ProtectConfig.blacklist_piston, block.getTypeId()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if ((block.getRelative(BlockFace.UP).getType() == Material.RAILS
|
||||
|| block.getType() == Material.RAILS)
|
||||
&& prot.getSettingBool(ProtectConfig.protect_rails))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (prot.getSettingBool(ProtectConfig.protect_signs))
|
||||
{
|
||||
for (BlockFace blockFace : faces)
|
||||
{
|
||||
if (blockFace == BlockFace.DOWN)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
final Block sign = block.getRelative(blockFace);
|
||||
if ((blockFace == BlockFace.UP || blockFace == BlockFace.SELF)
|
||||
&& sign.getType() == Material.SIGN_POST)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if ((blockFace == BlockFace.NORTH || blockFace == BlockFace.EAST
|
||||
|| blockFace == BlockFace.SOUTH || blockFace == BlockFace.WEST
|
||||
|| blockFace == BlockFace.SELF)
|
||||
&& sign.getType() == Material.WALL_SIGN)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPistonRetract(BlockPistonRetractEvent event)
|
||||
{
|
||||
if (event.isCancelled() || !event.isSticky())
|
||||
{
|
||||
return;
|
||||
}
|
||||
final Block block = event.getRetractLocation().getBlock();
|
||||
if (prot.checkProtectionItems(ProtectConfig.blacklist_piston, block.getTypeId()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if ((block.getRelative(BlockFace.UP).getType() == Material.RAILS
|
||||
|| block.getType() == Material.RAILS)
|
||||
&& prot.getSettingBool(ProtectConfig.protect_rails))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (prot.getSettingBool(ProtectConfig.protect_signs))
|
||||
{
|
||||
for (BlockFace blockFace : faces)
|
||||
{
|
||||
if (blockFace == BlockFace.DOWN)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
final Block sign = block.getRelative(blockFace);
|
||||
if ((blockFace == BlockFace.UP || blockFace == BlockFace.SELF)
|
||||
&& sign.getType() == Material.SIGN_POST)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if ((blockFace == BlockFace.NORTH || blockFace == BlockFace.EAST
|
||||
|| blockFace == BlockFace.SOUTH || blockFace == BlockFace.WEST
|
||||
|| blockFace == BlockFace.SELF)
|
||||
&& sign.getType() == Material.WALL_SIGN)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -240,19 +240,19 @@ public class EssentialsProtectEntityListener extends EntityListener
|
|||
|
||||
for (Block block : event.blockList())
|
||||
{
|
||||
if ((block.getType() == Material.RAILS || block.getFace(BlockFace.UP).getType() == Material.RAILS)
|
||||
if ((block.getType() == Material.RAILS || block.getRelative(BlockFace.UP).getType() == Material.RAILS)
|
||||
&& prot.getSettingBool(ProtectConfig.protect_rails))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if ((block.getType() == Material.WALL_SIGN
|
||||
|| block.getFace(BlockFace.NORTH).getType() == Material.WALL_SIGN
|
||||
|| block.getFace(BlockFace.EAST).getType() == Material.WALL_SIGN
|
||||
|| block.getFace(BlockFace.SOUTH).getType() == Material.WALL_SIGN
|
||||
|| block.getFace(BlockFace.WEST).getType() == Material.WALL_SIGN
|
||||
|| block.getRelative(BlockFace.NORTH).getType() == Material.WALL_SIGN
|
||||
|| block.getRelative(BlockFace.EAST).getType() == Material.WALL_SIGN
|
||||
|| block.getRelative(BlockFace.SOUTH).getType() == Material.WALL_SIGN
|
||||
|| block.getRelative(BlockFace.WEST).getType() == Material.WALL_SIGN
|
||||
|| block.getType() == Material.SIGN_POST
|
||||
|| block.getFace(BlockFace.UP).getType() == Material.SIGN_POST)
|
||||
|| block.getRelative(BlockFace.UP).getType() == Material.SIGN_POST)
|
||||
&& prot.getSettingBool(ProtectConfig.protect_signs))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
|
|
@ -45,7 +45,8 @@ public enum ProtectConfig
|
|||
alert_on_break("protect.alert.on-break"),
|
||||
blacklist_placement("protect.blacklist.placement"),
|
||||
blacklist_usage("protect.blacklist.usage"),
|
||||
blacklist_break("protect.blacklist.break");
|
||||
blacklist_break("protect.blacklist.break"),
|
||||
blacklist_piston("protect.blacklist.piston");
|
||||
private final String configName;
|
||||
private final String defValueString;
|
||||
private final boolean defValueBoolean;
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue