mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-05 23:08:23 +00:00
Fixed priorities
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1046 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
fcf67d18b7
commit
6e9561764f
2 changed files with 14 additions and 12 deletions
|
@ -163,9 +163,9 @@ public class Essentials extends JavaPlugin
|
||||||
pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.High, this);
|
pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.High, this);
|
||||||
|
|
||||||
blockListener = new EssentialsBlockListener(this);
|
blockListener = new EssentialsBlockListener(this);
|
||||||
pm.registerEvent(Type.SIGN_CHANGE, blockListener, Priority.Monitor, this);
|
pm.registerEvent(Type.SIGN_CHANGE, blockListener, Priority.Low, this);
|
||||||
pm.registerEvent(Type.BLOCK_BREAK, blockListener, Priority.Monitor, this);
|
pm.registerEvent(Type.BLOCK_BREAK, blockListener, Priority.Lowest, this);
|
||||||
pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Monitor, this);
|
pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Lowest, this);
|
||||||
|
|
||||||
entityListener = new EssentialsEntityListener(this);
|
entityListener = new EssentialsEntityListener(this);
|
||||||
pm.registerEvent(Type.ENTITY_DAMAGE, entityListener, Priority.Lowest, this);
|
pm.registerEvent(Type.ENTITY_DAMAGE, entityListener, Priority.Lowest, this);
|
||||||
|
|
|
@ -47,6 +47,7 @@ public class EssentialsBlockListener extends BlockListener
|
||||||
user.sendMessage("§cYou do not have permission to destroy that sign.");
|
user.sendMessage("§cYou do not have permission to destroy that sign.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSignChange(SignChangeEvent event)
|
public void onSignChange(SignChangeEvent event)
|
||||||
{
|
{
|
||||||
|
@ -77,8 +78,10 @@ public class EssentialsBlockListener extends BlockListener
|
||||||
if (event.getLine(0).equalsIgnoreCase("[Heal]"))
|
if (event.getLine(0).equalsIgnoreCase("[Heal]"))
|
||||||
{
|
{
|
||||||
event.setLine(0, "§4[Heal]");
|
event.setLine(0, "§4[Heal]");
|
||||||
if (user.isAuthorized("essentials.signs.heal.create")) {
|
if (user.isAuthorized("essentials.signs.heal.create"))
|
||||||
if (!event.getLine(1).isEmpty()) {
|
{
|
||||||
|
if (!event.getLine(1).isEmpty())
|
||||||
|
{
|
||||||
String[] l1 = event.getLine(1).split("[ :-]+");
|
String[] l1 = event.getLine(1).split("[ :-]+");
|
||||||
boolean m1 = l1[0].matches("\\$[0-9]+");
|
boolean m1 = l1[0].matches("\\$[0-9]+");
|
||||||
int q1 = Integer.parseInt(m1 ? l1[0].substring(1) : l1[0]);
|
int q1 = Integer.parseInt(m1 ? l1[0].substring(1) : l1[0]);
|
||||||
|
@ -101,7 +104,6 @@ public class EssentialsBlockListener extends BlockListener
|
||||||
if (event.getLine(0).equalsIgnoreCase("[Mail]"))
|
if (event.getLine(0).equalsIgnoreCase("[Mail]"))
|
||||||
{
|
{
|
||||||
if (user.isAuthorized("essentials.signs.mail.create"))
|
if (user.isAuthorized("essentials.signs.mail.create"))
|
||||||
|
|
||||||
event.setLine(0, "§1[Mail]");
|
event.setLine(0, "§1[Mail]");
|
||||||
else
|
else
|
||||||
event.setLine(0, "§4[Mail]");
|
event.setLine(0, "§4[Mail]");
|
||||||
|
@ -110,7 +112,6 @@ public class EssentialsBlockListener extends BlockListener
|
||||||
if (event.getLine(0).equalsIgnoreCase("[Balance]"))
|
if (event.getLine(0).equalsIgnoreCase("[Balance]"))
|
||||||
{
|
{
|
||||||
if (user.isAuthorized("essentials.signs.balance.create"))
|
if (user.isAuthorized("essentials.signs.balance.create"))
|
||||||
|
|
||||||
event.setLine(0, "§1[Balance]");
|
event.setLine(0, "§1[Balance]");
|
||||||
else
|
else
|
||||||
event.setLine(0, "§4[Balance]");
|
event.setLine(0, "§4[Balance]");
|
||||||
|
@ -124,18 +125,19 @@ public class EssentialsBlockListener extends BlockListener
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
public void onBlockPlace(BlockPlaceEvent event)
|
||||||
|
{
|
||||||
Block signBlock = event.getBlockAgainst();
|
Block signBlock = event.getBlockAgainst();
|
||||||
if (signBlock.getType() == Material.WALL_SIGN || signBlock.getType() == Material.SIGN_POST) {
|
if (signBlock.getType() == Material.WALL_SIGN || signBlock.getType() == Material.SIGN_POST)
|
||||||
|
{
|
||||||
Sign sign = new CraftSign(signBlock);
|
Sign sign = new CraftSign(signBlock);
|
||||||
if (sign.getLine(0).matches("§1\\[[a-zA-Z]+\\]")) {
|
if (sign.getLine(0).matches("§1\\[[a-zA-Z]+\\]"))
|
||||||
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean hasAdjacentChest(Block block)
|
public boolean hasAdjacentChest(Block block)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue