-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Add support of multiple save modes (#261)
- Loading branch information
Showing
15 changed files
with
245 additions
and
67 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
43 changes: 43 additions & 0 deletions
43
plugin/src/main/java/fr/utarwyn/endercontainers/configuration/enderchests/SaveMode.java
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,43 @@ | ||
package fr.utarwyn.endercontainers.configuration.enderchests; | ||
|
||
/** | ||
* The mode in which the plugin will save enderchests. | ||
* | ||
* @author Utarwyn | ||
* @since 2.3.0 | ||
*/ | ||
public enum SaveMode { | ||
/** | ||
* Save enderchests of a player when he logs out. | ||
* It's the default mode. | ||
*/ | ||
LOGOUT("logout"), | ||
/** | ||
* Save enderchests of a player when he closes the inventory. | ||
*/ | ||
ON_CLOSE("on-close"), | ||
/** | ||
* Save all enderchests during a world save. | ||
*/ | ||
WORLD_SAVE("world-save"), | ||
; | ||
|
||
private final String name; | ||
|
||
SaveMode(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public static SaveMode fromName(String name) { | ||
for (SaveMode mode : SaveMode.values()) { | ||
if (mode.getName().equalsIgnoreCase(name)) { | ||
return mode; | ||
} | ||
} | ||
return null; | ||
} | ||
} |
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
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.