-
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.
Merge pull request #84 from Nookure/dev
3.1.0
- Loading branch information
Showing
93 changed files
with
1,073 additions
and
420 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ name: JavaDoc Generator | |
|
||
on: | ||
push: | ||
branches: [ 2.x ] | ||
branches: [ 3.x ] | ||
jobs: | ||
|
||
build-on-ubuntu: | ||
|
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
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
41 changes: 41 additions & 0 deletions
41
MAStaff-API/src/main/java/com/nookure/mast/api/config/bukkit/ScoreboardConfig.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,41 @@ | ||
package com.nookure.mast.api.config.bukkit; | ||
|
||
import org.spongepowered.configurate.objectmapping.ConfigSerializable; | ||
import org.spongepowered.configurate.objectmapping.meta.Setting; | ||
|
||
import java.util.List; | ||
|
||
@ConfigSerializable | ||
public class ScoreboardConfig { | ||
private boolean enabled = true; | ||
|
||
public boolean enabled() { | ||
return enabled; | ||
} | ||
|
||
public final Scoreboard scoreboard = new Scoreboard(); | ||
|
||
@ConfigSerializable | ||
public static final class Scoreboard { | ||
@Setting | ||
private String title = "<b><dark_aqua>Staff Mode</dark_aqua></b>"; | ||
|
||
public String title() { | ||
return title; | ||
} | ||
|
||
@Setting | ||
private List<String> lines = List.of( | ||
"<b><yellow>|</yellow></b> <white>Rank:</white> <b><red>%vault_prefix%</red></b>", | ||
"<b><yellow>|</yellow></b> <white>Vanished:</white> <green>True</green>", | ||
"", | ||
"<b><red>|</red></b> <white>Staffs online:</white> <green>%mastaff_staffcount%</green>", | ||
"<b><red>|</red></b> <white>Online players:</white> <green>%server_online%</green>", | ||
"<b><red>|</red></b> <white>Frozen players:</white> <green>%mastaff_freeze_count%</green>" | ||
); | ||
|
||
public List<String> lines() { | ||
return lines; | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
MAStaff-API/src/main/java/com/nookure/mast/api/event/Channels.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,5 @@ | ||
package com.nookure.mast.api.event; | ||
|
||
public class Channels { | ||
public static final String EVENTS = "mastaff:events"; | ||
} |
4 changes: 3 additions & 1 deletion
4
MAStaff-API/src/main/java/com/nookure/mast/api/event/Event.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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
package com.nookure.mast.api.event; | ||
|
||
public abstract class Event { | ||
import java.io.Serializable; | ||
|
||
public interface Event extends Serializable { | ||
} |
35 changes: 35 additions & 0 deletions
35
MAStaff-API/src/main/java/com/nookure/mast/api/event/PluginMessageManager.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,35 @@ | ||
package com.nookure.mast.api.event; | ||
|
||
import com.google.inject.Inject; | ||
import com.nookure.mast.api.MAStaff; | ||
import es.angelillo15.mast.api.ILogger; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.io.IOException; | ||
import java.io.ObjectInputStream; | ||
import java.util.Objects; | ||
import java.util.Optional; | ||
|
||
public abstract class PluginMessageManager<P> { | ||
@Inject | ||
private ILogger logger; | ||
@Inject | ||
private MAStaff plugin; | ||
abstract public void sendEvent(@NotNull Event event, @NotNull P player); | ||
|
||
@NotNull | ||
public Optional<Event> decodeEvent(@NotNull ObjectInputStream objetStream) { | ||
Objects.requireNonNull(objetStream); | ||
|
||
try { | ||
return Optional.of((Event) objetStream.readObject()); | ||
} catch (IOException | ClassNotFoundException e) { | ||
logger.error("Error while decoding event from object stream"); | ||
if (plugin.isDebug()) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
return Optional.empty(); | ||
} | ||
} |
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.