-
Notifications
You must be signed in to change notification settings - Fork 5
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 #49 from PhantazmNetwork/staging
Staging
- Loading branch information
Showing
263 changed files
with
6,405 additions
and
2,327 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 |
---|---|---|
|
@@ -8,6 +8,8 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
|
@@ -48,16 +50,4 @@ jobs: | |
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USER }} | ||
script: | | ||
tmux -S /home/prod/tmux_sockets/prod send-keys -t prod 'stop' Enter | ||
rm -rf /home/prod/archive/config | ||
rm -rf /home/prod/archive/build | ||
mkdir /home/prod/archive/config | ||
mkdir /home/prod/archive/build | ||
git clone [email protected]:PhantazmNetwork/Configuration.git /home/prod/archive/config | ||
tar -xf /home/prod/archive/server.tar.gz -C /home/prod/archive/build | ||
rsync -ac --delete /home/prod/archive/build/ /home/prod/servers/prod | ||
rsync -ac /home/prod/archive/config/ /home/prod/servers/prod | ||
rsync -ac /home/prod/archive/persistent/ /home/prod/servers/prod | ||
tmux -S /home/prod/tmux_sockets/prod send-keys -t prod 'cd /home/prod/servers/prod' Enter | ||
tmux -S /home/prod/tmux_sockets/prod send-keys -t prod 'chmod +x ./start.sh' Enter | ||
tmux -S /home/prod/tmux_sockets/prod send-keys -t prod './start.sh' Enter | ||
/home/prod/archive/sync.sh |
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,4 @@ | ||
[submodule "minestom"] | ||
path = minestom | ||
url = https://github.com/PhantazmNetwork/Minestom | ||
branch = master |
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
37 changes: 37 additions & 0 deletions
37
commons/src/main/java/org/phantazm/commons/CancellableState.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,37 @@ | ||
package org.phantazm.commons; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Objects; | ||
import java.util.UUID; | ||
|
||
public interface CancellableState { | ||
void start(); | ||
|
||
void end(); | ||
|
||
@NotNull UUID id(); | ||
|
||
static @NotNull CancellableState named(@NotNull UUID id, @NotNull Runnable start, @NotNull Runnable end) { | ||
Objects.requireNonNull(id, "id"); | ||
Objects.requireNonNull(start, "start"); | ||
Objects.requireNonNull(end, "end"); | ||
|
||
return new CancellableState() { | ||
@Override | ||
public void start() { | ||
start.run(); | ||
} | ||
|
||
@Override | ||
public void end() { | ||
end.run(); | ||
} | ||
|
||
@Override | ||
public @NotNull UUID id() { | ||
return id; | ||
} | ||
}; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
commons/src/main/java/org/phantazm/commons/MiniMessageUtils.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,42 @@ | ||
package org.phantazm.commons; | ||
|
||
import net.kyori.adventure.text.Component; | ||
import net.kyori.adventure.text.ComponentLike; | ||
import net.kyori.adventure.text.JoinConfiguration; | ||
import net.kyori.adventure.text.minimessage.tag.Tag; | ||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder; | ||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class MiniMessageUtils { | ||
|
||
private MiniMessageUtils() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public static @NotNull TagResolver optional(@NotNull String key, boolean present) { | ||
return TagResolver.resolver(key, (argumentQueue, context) -> { | ||
String message = argumentQueue.pop().value(); | ||
Component result; | ||
if (present) { | ||
result = context.deserialize(message); | ||
} else { | ||
result = Component.empty(); | ||
} | ||
|
||
return Tag.selfClosingInserting(result); | ||
}); | ||
} | ||
|
||
public static @NotNull TagResolver list(@NotNull String key, | ||
@NotNull Iterable<? extends ComponentLike> components) { | ||
return TagResolver.resolver(key, (argumentQueue, context) -> { | ||
String separatorString = argumentQueue.pop().value(); | ||
Component separator = context.deserialize(separatorString); | ||
|
||
Component result = Component.join(JoinConfiguration.separator(separator), components); | ||
return Tag.inserting(result); | ||
}); | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -2,4 +2,8 @@ | |
|
||
public interface TickableTask extends Tickable { | ||
boolean isFinished(); | ||
|
||
default void end() { | ||
|
||
} | ||
} |
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 org.phantazm.core; | ||
|
||
import net.kyori.adventure.text.Component; | ||
import net.kyori.adventure.text.minimessage.MiniMessage; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.IllegalFormatException; | ||
import java.util.Objects; | ||
|
||
public final class ComponentUtils { | ||
private ComponentUtils() { | ||
} | ||
|
||
public static @NotNull Component tryFormat(@NotNull String formatString, Object... objects) { | ||
Objects.requireNonNull(formatString, "formatString"); | ||
|
||
String message; | ||
try { | ||
message = String.format(formatString, objects); | ||
} | ||
catch (IllegalFormatException ignored) { | ||
message = formatString; | ||
} | ||
|
||
return MiniMessage.miniMessage().deserialize(message); | ||
} | ||
} |
Oops, something went wrong.