forked from AddstarMC/Minigames
-
Notifications
You must be signed in to change notification settings - Fork 1
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
72a3482
commit 9691609
Showing
53 changed files
with
575 additions
and
281 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
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
51 changes: 51 additions & 0 deletions
51
Minigames/src/main/java/au/com/mineauz/minigames/config/ComponentFlag.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,51 @@ | ||
package au.com.mineauz.minigames.config; | ||
|
||
import au.com.mineauz.minigames.menu.Callback; | ||
import au.com.mineauz.minigames.menu.MenuItem; | ||
import au.com.mineauz.minigames.menu.MenuItemString; | ||
import net.kyori.adventure.text.Component; | ||
import org.bukkit.Material; | ||
import org.bukkit.configuration.file.FileConfiguration; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
public class ComponentFlag extends Flag<Component> { | ||
public ComponentFlag(Component value, String name) { | ||
setFlag(value); | ||
setDefaultFlag(value); | ||
setName(name); | ||
} | ||
|
||
@Override | ||
public void saveValue(String path, FileConfiguration config) { | ||
config.set(path + "." + getName(), getFlag()); | ||
} | ||
|
||
@Override | ||
public void loadValue(String path, FileConfiguration config) { | ||
if (config.contains(path + "." + getName())) { | ||
setFlag(config.getString(path + "." + getName())); | ||
} else { | ||
setFlag(getDefaultFlag()); | ||
} | ||
} | ||
|
||
@Override | ||
public MenuItem getMenuItem(@Nullable Material displayMat, @Nullable Component name, | ||
@Nullable List<@NotNull Component> description) { | ||
return new MenuItemString(displayMat, name, description, new Callback<>() { | ||
|
||
@Override | ||
public String getValue() { | ||
return getFlag(); | ||
} | ||
|
||
@Override | ||
public void setValue(String value) { | ||
setFlag(value); | ||
} | ||
}); | ||
} | ||
} |
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
5 changes: 0 additions & 5 deletions
5
Minigames/src/main/java/au/com/mineauz/minigames/menu/InteractionInterface.java
This file was deleted.
Oops, something went wrong.
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.