mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 05:16:55 +00:00
missed refactors
This commit is contained in:
+1
-1
@@ -31,7 +31,7 @@ public class PlayerHitByExplosionListener implements Listener {
|
|||||||
UUID damageruuid = UUID.fromString(event.getDamager().getMetadata("PLAYEREXPLODED").get(0).asString());
|
UUID damageruuid = UUID.fromString(event.getDamager().getMetadata("PLAYEREXPLODED").get(0).asString());
|
||||||
if (!victim.getUniqueId().equals(damageruuid)) {
|
if (!victim.getUniqueId().equals(damageruuid)) {
|
||||||
ConfigCache config = TogglePvp.getPlugin().getConfigCache();
|
ConfigCache config = TogglePvp.getPlugin().getConfigCache();
|
||||||
boolean damagerPvpEnabled = SmartCache.getPlayerData(damageruuid).isPvpEnabled();
|
boolean damagerPvpEnabled = TogglePvp.getPlugin().getSmartCache().getPlayerData(damageruuid).isPvpEnabled();
|
||||||
if (!damagerPvpEnabled) {
|
if (!damagerPvpEnabled) {
|
||||||
PluginMessages.sendActionBar(damageruuid, config.getCannot_attack_attacker());
|
PluginMessages.sendActionBar(damageruuid, config.getCannot_attack_attacker());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class CombatTimer {
|
|||||||
public static void refreshPlayersCombatTime(UUID uuid) {
|
public static void refreshPlayersCombatTime(UUID uuid) {
|
||||||
try {
|
try {
|
||||||
long now = Instant.now().getEpochSecond();
|
long now = Instant.now().getEpochSecond();
|
||||||
long combattime = SmartCache.getPlayerData(uuid).getCombattime();
|
long combattime = TogglePvp.getPlugin().getSmartCache().getPlayerData(uuid).getCombattime();
|
||||||
if (combattime < now) {
|
if (combattime < now) {
|
||||||
PluginMessages.sendActionBar(uuid, TogglePvp.getPlugin().getConfigCache().getEntering_combat());
|
PluginMessages.sendActionBar(uuid, TogglePvp.getPlugin().getConfigCache().getEntering_combat());
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ public class CombatTimer {
|
|||||||
|
|
||||||
public static boolean isInCombat(UUID uuid) {
|
public static boolean isInCombat(UUID uuid) {
|
||||||
try {
|
try {
|
||||||
long combattimer = SmartCache.getPlayerData(uuid).getCombattime();
|
long combattimer = TogglePvp.getPlugin().getSmartCache().getPlayerData(uuid).getCombattime();
|
||||||
long now = Instant.now().getEpochSecond();
|
long now = Instant.now().getEpochSecond();
|
||||||
return combattimer > now;
|
return combattimer > now;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user