Class LifestealerUser

java.lang.Object
dev.chicoferreira.lifestealer.user.LifestealerUser

@ConfigSerializable public class LifestealerUser extends Object
Stores lifesteal information about a player, such has the amount of hearts they have, the heart cap, etc.
  • Constructor Details

  • Method Details

    • readLock

      public void readLock()
      Locks the user for reading. You need to use this method before reading any user information. You also need to unlock the user after you're done reading.
    • readUnlock

      public void readUnlock()
      Unlocks the user after reading. You need to call this method after you're done reading the user information.
    • writeLock

      public void writeLock()
      Locks the user for writing. You need to use this method before writing any user information. You also need to unlock the user after you're done writing.
    • writeUnlock

      public void writeUnlock()
      Unlocks the user after writing. You need to call this method after you're done writing the user information.
    • getUuid

      @NotNull public @NotNull UUID getUuid()
      Thread-safety: Requires a read lock on this user.
      Returns:
      the UUID of the user
    • getHearts

      public int getHearts()
      Thread-safety: Requires a read lock on this user.
      Returns:
      the amount of hearts the user has
    • getInternalBan

      @Nullable public @Nullable LifestealerUser.Ban getInternalBan()
      Gets the ban information of the user if they are banned, otherwise null. This method is only intended to be used by the LifestealerUserController. If you want to check if a player is banned, use LifestealerUserController.getBan(LifestealerUser).

      Thread-safety: Requires a read lock on this user.

      Returns:
      the ban information of the user if they have a banning record, otherwise null
    • getRulesModifier

      @NotNull public @NotNull LifestealerUserRules getRulesModifier()
      Gets the modifier rules of the user. This rule will have its values summed with the values in the rule given by the LifestealerUserRulesController which is based on the user's permissions to get the final rule value.

      Use LifestealerUserController.computeUserRules(Player, LifestealerUser) to get the final rule value.

      Thread-safety: Requires a read lock on this user.