-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/poll
- Loading branch information
Showing
33 changed files
with
424 additions
and
142 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
37 changes: 37 additions & 0 deletions
37
eternalcore-core/src/main/java/com/eternalcode/core/command/argument/SpeedTypeArgument.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 com.eternalcode.core.command.argument; | ||
|
||
import com.eternalcode.core.notification.Notification; | ||
import com.eternalcode.core.translation.Translation; | ||
import com.eternalcode.core.translation.TranslationManager; | ||
import com.eternalcode.core.feature.essentials.speed.SpeedType; | ||
import com.eternalcode.core.viewer.BukkitViewerProvider; | ||
import dev.rollczi.litecommands.argument.ArgumentName; | ||
import dev.rollczi.litecommands.command.LiteInvocation; | ||
import dev.rollczi.litecommands.suggestion.Suggestion; | ||
import panda.std.Option; | ||
import panda.std.Result; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
@ArgumentName("type") | ||
public class SpeedTypeArgument extends AbstractViewerArgument<SpeedType> { | ||
|
||
public SpeedTypeArgument(BukkitViewerProvider viewerProvider, TranslationManager translationManager) { | ||
super(viewerProvider, translationManager); | ||
} | ||
|
||
@Override | ||
public Result<SpeedType, Notification> parse(LiteInvocation invocation, String argument, Translation translation) { | ||
return Option.supplyThrowing(IllegalArgumentException.class, () -> SpeedType.valueOf(argument.toUpperCase())) | ||
.toResult(() -> translation.player().speedTypeNotCorrect()); | ||
} | ||
|
||
@Override | ||
public List<Suggestion> suggest(LiteInvocation invocation) { | ||
return Arrays.stream(SpeedType.values()) | ||
.map(SpeedType::name) | ||
.map(Suggestion::of) | ||
.toList(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...re-core/src/main/java/com/eternalcode/core/command/configurator/GameModeConfigurator.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,18 @@ | ||
package com.eternalcode.core.command.configurator; | ||
|
||
import com.eternalcode.core.command.configurator.config.CommandConfiguration; | ||
import dev.rollczi.litecommands.factory.CommandEditor; | ||
|
||
public class GameModeConfigurator implements CommandEditor { | ||
|
||
private final CommandConfiguration commandConfiguration; | ||
|
||
public GameModeConfigurator(CommandConfiguration commandConfiguration) { | ||
this.commandConfiguration = commandConfiguration; | ||
} | ||
|
||
@Override | ||
public State edit(State state) { | ||
return state.aliases(this.commandConfiguration.getGameModeShortCuts(), false); | ||
} | ||
} |
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
59 changes: 0 additions & 59 deletions
59
eternalcore-core/src/main/java/com/eternalcode/core/feature/essentials/SpeedCommand.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
Oops, something went wrong.