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
417148f5da
7 changed files with 85 additions and 29 deletions
|
@ -1,6 +1,7 @@
|
||||||
package com.earth2me.essentials;
|
package com.earth2me.essentials;
|
||||||
|
|
||||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||||
|
import com.earth2me.essentials.signs.EssentialsSign;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -100,6 +101,8 @@ public interface ISettings extends IConf
|
||||||
boolean isTradeInStacks(int id);
|
boolean isTradeInStacks(int id);
|
||||||
|
|
||||||
List<Integer> itemSpawnBlacklist();
|
List<Integer> itemSpawnBlacklist();
|
||||||
|
|
||||||
|
List<EssentialsSign> enabledSigns();
|
||||||
|
|
||||||
boolean permissionBasedItemSpawn();
|
boolean permissionBasedItemSpawn();
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.earth2me.essentials;
|
||||||
|
|
||||||
import static com.earth2me.essentials.I18n._;
|
import static com.earth2me.essentials.I18n._;
|
||||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||||
|
import com.earth2me.essentials.signs.EssentialsSign;
|
||||||
|
import com.earth2me.essentials.signs.Signs;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -278,7 +280,7 @@ public class Settings implements ISettings
|
||||||
@Override
|
@Override
|
||||||
public boolean areSignsDisabled()
|
public boolean areSignsDisabled()
|
||||||
{
|
{
|
||||||
return config.getBoolean("signs-disabled", false);
|
return enabledSigns.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -356,11 +358,20 @@ public class Settings implements ISettings
|
||||||
{
|
{
|
||||||
config.load();
|
config.load();
|
||||||
noGodWorlds = new HashSet<String>(config.getStringList("no-god-in-worlds", Collections.<String>emptyList()));
|
noGodWorlds = new HashSet<String>(config.getStringList("no-god-in-worlds", Collections.<String>emptyList()));
|
||||||
|
enabledSigns = getEnabledSigns();
|
||||||
|
itemSpawnBl = getItemSpawnBlacklist();
|
||||||
chatFormats.clear();
|
chatFormats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> itemSpawnBlacklist()
|
public List<Integer> itemSpawnBlacklist()
|
||||||
|
{
|
||||||
|
return itemSpawnBl;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Integer> getItemSpawnBlacklist()
|
||||||
{
|
{
|
||||||
final List<Integer> epItemSpwn = new ArrayList<Integer>();
|
final List<Integer> epItemSpwn = new ArrayList<Integer>();
|
||||||
for (String itemName : config.getString("item-spawn-blacklist", "").split(","))
|
for (String itemName : config.getString("item-spawn-blacklist", "").split(","))
|
||||||
|
@ -369,12 +380,11 @@ public class Settings implements ISettings
|
||||||
if (itemName.isEmpty())
|
if (itemName.isEmpty())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ItemStack is;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
is = ess.getItemDb().get(itemName);
|
final ItemStack iStack = ess.getItemDb().get(itemName);
|
||||||
epItemSpwn.add(is.getTypeId());
|
epItemSpwn.add(iStack.getTypeId());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -383,6 +393,37 @@ public class Settings implements ISettings
|
||||||
}
|
}
|
||||||
return epItemSpwn;
|
return epItemSpwn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<EssentialsSign> enabledSigns = new ArrayList<EssentialsSign>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EssentialsSign> enabledSigns()
|
||||||
|
{
|
||||||
|
return enabledSigns;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<EssentialsSign> getEnabledSigns()
|
||||||
|
{
|
||||||
|
List<EssentialsSign> newSigns = new ArrayList<EssentialsSign>();
|
||||||
|
|
||||||
|
for (String signName : config.getStringList("enabledSigns", null))
|
||||||
|
{
|
||||||
|
signName = signName.trim().toUpperCase(Locale.ENGLISH);
|
||||||
|
if (signName.isEmpty())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
newSigns.add(Signs.valueOf(signName).getSign());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
logger.log(Level.SEVERE, _("unknownItemInList", signName, "enabledSigns"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newSigns;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean spawnIfNoHome()
|
public boolean spawnIfNoHome()
|
||||||
|
@ -559,7 +600,8 @@ public class Settings implements ISettings
|
||||||
{
|
{
|
||||||
return config.getBoolean("death-messages", true);
|
return config.getBoolean("death-messages", true);
|
||||||
}
|
}
|
||||||
Set<String> noGodWorlds = new HashSet<String>();
|
|
||||||
|
private Set<String> noGodWorlds = new HashSet<String>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getNoGodWorlds()
|
public Set<String> getNoGodWorlds()
|
||||||
|
|
|
@ -44,9 +44,9 @@ public class SignBlockListener implements Listener
|
||||||
if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId())
|
if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId())
|
||||||
{
|
{
|
||||||
final Sign csign = (Sign)block.getState();
|
final Sign csign = (Sign)block.getState();
|
||||||
for (Signs signs : Signs.values())
|
|
||||||
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (csign.getLine(0).equalsIgnoreCase(sign.getSuccessName())
|
if (csign.getLine(0).equalsIgnoreCase(sign.getSuccessName())
|
||||||
&& !sign.onSignBreak(block, player, ess))
|
&& !sign.onSignBreak(block, player, ess))
|
||||||
{
|
{
|
||||||
|
@ -62,9 +62,8 @@ public class SignBlockListener implements Listener
|
||||||
LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
|
LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
for (Signs signs : Signs.values())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (sign.getBlocks().contains(block.getType())
|
if (sign.getBlocks().contains(block.getType())
|
||||||
&& !sign.onBlockBreak(block, player, ess))
|
&& !sign.onBlockBreak(block, player, ess))
|
||||||
{
|
{
|
||||||
|
@ -159,9 +158,8 @@ public class SignBlockListener implements Listener
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (Signs signs : Signs.values())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (sign.getBlocks().contains(block.getType())
|
if (sign.getBlocks().contains(block.getType())
|
||||||
&& !sign.onBlockBurn(block, ess))
|
&& !sign.onBlockBurn(block, ess))
|
||||||
{
|
{
|
||||||
|
@ -188,9 +186,8 @@ public class SignBlockListener implements Listener
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (Signs signs : Signs.values())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (sign.getBlocks().contains(block.getType())
|
if (sign.getBlocks().contains(block.getType())
|
||||||
&& !sign.onBlockIgnite(block, ess))
|
&& !sign.onBlockIgnite(block, ess))
|
||||||
{
|
{
|
||||||
|
@ -213,9 +210,8 @@ public class SignBlockListener implements Listener
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (Signs signs : Signs.values())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (sign.getBlocks().contains(block.getType())
|
if (sign.getBlocks().contains(block.getType())
|
||||||
&& !sign.onBlockPush(block, ess))
|
&& !sign.onBlockPush(block, ess))
|
||||||
{
|
{
|
||||||
|
@ -240,9 +236,8 @@ public class SignBlockListener implements Listener
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (Signs signs : Signs.values())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (sign.getBlocks().contains(block.getType())
|
if (sign.getBlocks().contains(block.getType())
|
||||||
&& !sign.onBlockPush(block, ess))
|
&& !sign.onBlockPush(block, ess))
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,9 +32,8 @@ public class SignEntityListener implements Listener
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (Signs signs : Signs.values())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (sign.getBlocks().contains(block.getType()))
|
if (sign.getBlocks().contains(block.getType()))
|
||||||
{
|
{
|
||||||
event.setCancelled(!sign.onBlockExplode(block, ess));
|
event.setCancelled(!sign.onBlockExplode(block, ess));
|
||||||
|
@ -61,9 +60,8 @@ public class SignEntityListener implements Listener
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (Signs signs : Signs.values())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (sign.getBlocks().contains(block.getType())
|
if (sign.getBlocks().contains(block.getType())
|
||||||
&& !sign.onBlockBreak(block, ess))
|
&& !sign.onBlockBreak(block, ess))
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,9 +41,8 @@ public class SignPlayerListener implements Listener
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Sign csign = (Sign)block.getState();
|
final Sign csign = (Sign)block.getState();
|
||||||
for (Signs signs : Signs.values())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (csign.getLine(0).equalsIgnoreCase(sign.getSuccessName()))
|
if (csign.getLine(0).equalsIgnoreCase(sign.getSuccessName()))
|
||||||
{
|
{
|
||||||
sign.onSignInteract(block, event.getPlayer(), ess);
|
sign.onSignInteract(block, event.getPlayer(), ess);
|
||||||
|
@ -54,9 +53,8 @@ public class SignPlayerListener implements Listener
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (Signs signs : Signs.values())
|
for (EssentialsSign sign : ess.getSettings().enabledSigns())
|
||||||
{
|
{
|
||||||
final EssentialsSign sign = signs.getSign();
|
|
||||||
if (sign.getBlocks().contains(block.getType())
|
if (sign.getBlocks().contains(block.getType())
|
||||||
&& !sign.onBlockInteract(block, event.getPlayer(), ess))
|
&& !sign.onBlockInteract(block, event.getPlayer(), ess))
|
||||||
{
|
{
|
||||||
|
|
|
@ -166,8 +166,28 @@ kits:
|
||||||
- 278 1
|
- 278 1
|
||||||
- 279 1
|
- 279 1
|
||||||
|
|
||||||
# Disable all signs
|
# Essentials Sign Control
|
||||||
signs-disabled: false
|
# See http://ess.khhq.net/wiki/Sign_Tutorial for instructions on how to use these.
|
||||||
|
# To enable signs, remove # symbol. To disable all signs, comment/remove each sign.
|
||||||
|
# We recommend not enabling chest protection signs if you don't intend to use them, (or are using LWC/Lockette).
|
||||||
|
|
||||||
|
enabledSigns:
|
||||||
|
#- balance
|
||||||
|
#- buy
|
||||||
|
#- sell
|
||||||
|
#- trade
|
||||||
|
#- free
|
||||||
|
#- disposal
|
||||||
|
#- warp
|
||||||
|
#- kit
|
||||||
|
#- mail
|
||||||
|
#- enchant
|
||||||
|
#- gamemode
|
||||||
|
#- heal
|
||||||
|
#- spawnmob
|
||||||
|
#- time
|
||||||
|
#- weather
|
||||||
|
#- protection
|
||||||
|
|
||||||
# Backup runs a command while saving is disabled
|
# Backup runs a command while saving is disabled
|
||||||
backup:
|
backup:
|
||||||
|
|
|
@ -90,7 +90,7 @@ v 1.7:
|
||||||
v 1.8:
|
v 1.8:
|
||||||
- Changed ServicesManager registration to lowest from normal.
|
- Changed ServicesManager registration to lowest from normal.
|
||||||
- Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup.
|
- Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup.
|
||||||
- manpromote and mandemote now correctly send the notification to the console if the command was issued there.
|
- 'manpromote' and 'mandemote' now correctly send the notification to the console if the command was issued there.
|
||||||
- Expanded GlobalGroups.yml and Groups.yml to include Towny permissions.
|
- Expanded GlobalGroups.yml and Groups.yml to include Towny permissions.
|
||||||
- Delayed GroupManager events so Superperms will be fully updated before plugins receive the events.
|
- Delayed GroupManager events so Superperms will be fully updated before plugins receive the events.
|
||||||
- Changed the way events are raised to prevent variable corruption.
|
- Changed the way events are raised to prevent variable corruption.
|
||||||
|
|
Loading…
Reference in a new issue