-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9058610
commit 8626d79
Showing
32 changed files
with
189 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package eu.endermite.togglepvp; | ||
|
||
import eu.endermite.togglepvp.players.SmartCache; | ||
import java.util.UUID; | ||
|
||
public class TogglePvpAPI { | ||
|
||
/** | ||
* Sets player PvP state. This will always save to database. | ||
* @param uuid uuid of player to set | ||
* @param newState State to set | ||
*/ | ||
public static void setPvpEnabled(UUID uuid, boolean newState) { | ||
SmartCache.setPlayerPvpState(uuid, newState); | ||
} | ||
|
||
/** | ||
* Gets player's PvP state. If player is not cached this will query the database. | ||
* @param uuid uuid of player to get data from. | ||
* @return true if enabled, false if disabled | ||
*/ | ||
public static boolean getPvpEnabled(UUID uuid) { | ||
return SmartCache.getPlayerData(uuid).isPvpEnabled(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.