Removed stream usage from PunishmentHolder.

This commit is contained in:
MobiusDevelopment
2023-01-08 14:52:54 +00:00
parent b4c8bb7bfc
commit 834387f340
29 changed files with 403 additions and 290 deletions

View File

@@ -48,16 +48,15 @@ public class PunishmentHolder
public void stopPunishment(PunishmentTask task)
{
final String key = String.valueOf(task.getKey());
if (!_holder.containsKey(key))
if (_holder.containsKey(key))
{
return;
}
task.stopPunishment();
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
punishments.remove(task.getType());
if (punishments.isEmpty())
{
_holder.remove(key);
task.stopPunishment();
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
punishments.remove(task.getType());
if (punishments.isEmpty())
{
_holder.remove(key);
}
}
}
@@ -78,6 +77,10 @@ public class PunishmentHolder
*/
public PunishmentTask getPunishment(String key, PunishmentType type)
{
return _holder.containsKey(key) ? _holder.get(key).get(type) : null;
if (_holder.containsKey(key))
{
return _holder.get(key).get(type);
}
return null;
}
}