Merge remote branch 'remotes/ess/master' into essrelease

This commit is contained in:
KHobbits 2011-10-11 17:52:56 +01:00
commit eb71097546
24 changed files with 91 additions and 12 deletions

View File

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials;
import java.net.InetSocketAddress;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import org.bukkit.Achievement;
@ -725,4 +726,22 @@ public class OfflinePlayer implements Player
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int getTicksLived()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void setTicksLived(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Map<String, Object> serialize()
{
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -756,4 +756,22 @@ public class PlayerWrapper implements Player
return base.getPlayerListName();
}
@Override
public int getTicksLived()
{
return base.getTicksLived();
}
@Override
public void setTicksLived(int i)
{
base.setTicksLived(i);
}
@Override
public Map<String, Object> serialize()
{
return base.serialize();
}
}

View File

View File

View File

@ -3,7 +3,7 @@ name: Essentials
main: com.earth2me.essentials.Essentials
# Note to developers: This next line cannot change, or the automatic versioning system will break.
version: TeamCity
website: http://www.earth2me.net:8001/
website: http://ci.earth2me.net/
description: Provides an essential, core set of commands for Bukkit.
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits]
commands:

View File

@ -36,4 +36,7 @@ v 1.3:
- Added event handling to manage new world creation at runtime.
- Added the ability to handle unknown worlds at server start.
(GM will create the data files for any worlds it finds which are not in the config.yml)
- Fix for Bukkit passing a null To location on a player portaling.
- Fix for Bukkit passing a null To location on a player Portaling
- Fixed manudelsub not correctly selecting the group to remove.
- Added two new permission nodes - groupmanager.notify.self & groupmanager.notify.other
These allow players/admins to be notified when players are moved between groups.

View File

@ -18,5 +18,5 @@ settings:
- world_nether
- world2
- world3
world4:
- world5
# world4:
# - world5

View File

@ -8,6 +8,7 @@ groups:
- essentials.motd
- essentials.rules
- essentials.spawn
- groupmanager.notify.self
inheritance: []
info:
prefix: '&e'
@ -119,6 +120,7 @@ groups:
- groupmanager.manuadd
- groupmanager.manudel
- groupmanager.manwhois
- groupmanager.notify.other
inheritance:
- builder
info:

View File

@ -28,6 +28,7 @@ import org.anjocaido.groupmanager.events.GMWorldListener;
import org.anjocaido.groupmanager.utils.GMLoggerHandler;
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
import org.anjocaido.groupmanager.utils.Tasks;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@ -159,7 +160,7 @@ public class GroupManager extends JavaPlugin {
}
};
scheduler = new ScheduledThreadPoolExecutor(1);
int minutes = getConfig().getSaveInterval();
int minutes = getGMConfig().getSaveInterval();
scheduler.scheduleAtFixedRate(commiter, minutes, minutes, TimeUnit.MINUTES);
GroupManager.logger.info("Scheduled Data Saving is set for every " + minutes + " minutes!");
}
@ -236,7 +237,7 @@ public class GroupManager extends JavaPlugin {
* @param cmd
* @param args
*/
@SuppressWarnings({"null", "deprecation"})
@SuppressWarnings({"deprecation"})
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
boolean playerCanDo = false;
@ -478,6 +479,12 @@ public class GroupManager extends JavaPlugin {
} else {
auxUser = dataHolder.getUser(args[0]);
}
auxGroup = dataHolder.getGroup(args[1]);
if (auxGroup == null) {
sender.sendMessage(ChatColor.RED + "Group not found!");
return false;
}
//VALIDANDO PERMISSAO
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher.");
@ -1746,10 +1753,35 @@ public class GroupManager extends JavaPlugin {
}
/**
* Send confirmation of a group change.
* using permission nodes...
*
* groupmanager.notify.self
* groupmanager.notify.other
*
* @param name
* @param msg
*/
public static void notify(String name, String msg) {
Player player = Bukkit.getServer().getPlayerExact(name);
for(Player test: Bukkit.getServer().getOnlinePlayers()) {
if (!test.equals(player)){
if (test.hasPermission("groupmanager.notify.other"))
test.sendMessage(ChatColor.YELLOW + name +" was " + msg);
} else
if ((player != null) && ((player.hasPermission("groupmanager.notify.self")) || (player.hasPermission("groupmanager.notify.other"))))
player.sendMessage(ChatColor.YELLOW + "You we're " + msg);
}
}
/**
* @return the config
*/
public GMConfiguration getConfig() {
public GMConfiguration getGMConfig() {
return config;
}

View File

@ -119,9 +119,12 @@ public class User extends DataUnit implements Cloneable {
group = getDataSource().getGroup(group.getName());
this.group = group.getName();
flagAsChanged();
if (GroupManager.isLoaded())
if (GroupManager.isLoaded()) {
if (GroupManager.BukkitPermissions.player_join = false)
GroupManager.BukkitPermissions.updateAllPlayers();
GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName()));
}
}
public void addSubGroup(Group subGroup) {

View File

@ -111,7 +111,7 @@ public class WorldsHolder {
@SuppressWarnings("rawtypes")
public void mirrorSetUp() {
mirrors.clear();
Map<String, Object> mirrorsMap = plugin.getConfig().getMirrorsMap();
Map<String, Object> mirrorsMap = plugin.getGMConfig().getMirrorsMap();
if (mirrorsMap != null) {
for (String source : mirrorsMap.keySet()) {
// Make sure all non mirrored worlds have a set of data files.

View File

@ -19,3 +19,5 @@ The default line ending is LF.
To build all jars, select the BuildAll project and build that. You'll find all jars inside the dist/lib folder of the BuildAll project.
If you create pull requests, always make them for the master branch.
The essentials bug tracker can be found at http://www.assembla.com/spaces/essentials/tickets

Binary file not shown.

Binary file not shown.