mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-26 07:54:41 +02:00
@@ -84,7 +84,7 @@ public interface IUser extends Player, IStorageObjectHolder<UserData>, IReload,
|
||||
|
||||
void addMail(String string);
|
||||
|
||||
boolean toggleMuted();
|
||||
void setMuted(boolean mute);
|
||||
|
||||
boolean toggleSocialSpy();
|
||||
|
||||
|
@@ -22,7 +22,7 @@ public class Commandmute extends EssentialsCommand
|
||||
|
||||
@Cleanup
|
||||
final IUser player = getPlayer(args, 0, true);
|
||||
player.acquireReadLock();
|
||||
player.acquireReadLock();
|
||||
if (!player.getData().isMuted() && Permissions.MUTE_EXEMPT.isAuthorized(player))
|
||||
{
|
||||
throw new Exception(_("muteExempt"));
|
||||
@@ -30,11 +30,16 @@ public class Commandmute extends EssentialsCommand
|
||||
long muteTimestamp = 0;
|
||||
if (args.length > 1)
|
||||
{
|
||||
String time = getFinalArg(args, 1);
|
||||
final String time = getFinalArg(args, 1);
|
||||
muteTimestamp = DateUtil.parseDateDiff(time, true);
|
||||
player.setMuted(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setMuted(!player.getData().isMuted());
|
||||
}
|
||||
player.setTimestamp(TimestampType.MUTE, muteTimestamp);
|
||||
final boolean muted = player.toggleMuted();
|
||||
final boolean muted = player.getData().isMuted();
|
||||
sender.sendMessage(
|
||||
muted
|
||||
? (muteTimestamp > 0
|
||||
|
@@ -21,7 +21,7 @@ public class EssentialsBlockListener implements Listener
|
||||
this.ess = ess;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.Low, ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public void onBlockPlace(final BlockPlaceEvent event)
|
||||
{
|
||||
// Do not rely on getItemInHand();
|
||||
|
@@ -129,7 +129,7 @@ public class EssentialsPlayerListener implements Listener
|
||||
settings.acquireReadLock();
|
||||
if (settings.getData().getCommands().getGod().isRemoveOnDisconnect() && user.isGodModeEnabled())
|
||||
{
|
||||
user.toggleGodModeEnabled();
|
||||
user.setGodModeEnabled(false);
|
||||
}
|
||||
if (user.getData().getInventory() != null)
|
||||
{
|
||||
|
@@ -408,6 +408,7 @@ public class User extends UserBase implements IUser
|
||||
}
|
||||
|
||||
//Returns true if status expired during this check
|
||||
@Override
|
||||
public boolean checkMuteTimeout(final long currentTime)
|
||||
{
|
||||
acquireReadLock();
|
||||
|
@@ -285,14 +285,12 @@ public abstract class UserBase extends AsyncStorageObjectHolder<UserData> implem
|
||||
}
|
||||
}
|
||||
|
||||
public boolean toggleMuted()
|
||||
public void setMuted(boolean mute)
|
||||
{
|
||||
acquireWriteLock();
|
||||
try
|
||||
{
|
||||
boolean ret = !getData().isMuted();
|
||||
getData().setMuted(ret);
|
||||
return ret;
|
||||
{
|
||||
getData().setMuted(mute);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
Reference in New Issue
Block a user