Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.2.0 #101

Merged
merged 24 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a623b66
Merge pull request #97 from Nookure/release/1.x
Angelillo15 May 20, 2024
182f3ff
Merge pull request #99 from Nookure/release/1.x
Angelillo15 May 24, 2024
45485a9
Update build scripts
Angelillo15 May 24, 2024
e81ecc8
Add new permissions
Angelillo15 May 24, 2024
65ea82d
Add the permission from the Permission class and a todo
Angelillo15 May 24, 2024
95b5db1
Add a method to parse the args and return the suggestions
Angelillo15 May 24, 2024
b5a8443
Improve arguments logic
Angelillo15 May 24, 2024
59776c7
Add permission field
Angelillo15 May 24, 2024
23b5375
Create remove command
Angelillo15 May 24, 2024
5fb2891
Create impl for pagination list in chat
Angelillo15 May 24, 2024
6391b71
Add NoteMessages
Angelillo15 May 24, 2024
2e64752
Update CI tasks
Angelillo15 May 28, 2024
9bd1d7d
Move NoteMessages to a partial folder
Angelillo15 May 28, 2024
0022672
get permission from static class
Angelillo15 May 28, 2024
3c9150f
Add toggle show command
Angelillo15 May 28, 2024
ca80b09
Add tab complete to the ListNoteCommand
Angelillo15 May 28, 2024
7f03567
Add new field to UserNoteService
Angelillo15 May 28, 2024
cf3ac1c
Update messages and implements toggleShowOnJoin method
Angelillo15 May 28, 2024
8738587
Create OnPlayerNoteJoin listener
Angelillo15 May 28, 2024
e7e1c15
Add commands usage messages
Angelillo15 May 28, 2024
4ab7295
Refactor noteMessages package
Angelillo15 May 28, 2024
dc17e46
Add subcommands usage messages
Angelillo15 May 28, 2024
1ae766f
Merge pull request #100 from Nookure/release/1.x
Angelillo15 May 28, 2024
0a9794b
Add distribution
Angelillo15 May 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
pull_request:
branches: [ release/1.x]
jobs:

build-on-ubuntu:
# The type of runner that the job will run on
runs-on: ubuntu-latest
Expand All @@ -18,15 +17,15 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout main branch from GitHub
uses: actions/checkout@v3
uses: actions/checkout@v4
# Runs a single command using the runners shell
- name: Seting up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

- name: Execute Gradle build
run: |
Expand All @@ -37,5 +36,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: NookureStaff
path: staging

path: staging
22 changes: 22 additions & 0 deletions .github/workflows/dependency-submission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependency Submission

on:
push:
branches: [ release/1.x ]
permissions:
contents: write
jobs:
dependency-submission:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v3
with:
dependency-resolution-task: shadowJar
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: JavaDoc Generator
name: Update Javadoc

on:
push:
branches: [ release/1.x ]
jobs:

build-on-ubuntu:
# The type of runner that the job will run on
runs-on: ubuntu-latest
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: NookureStaff build

on:
push:
branches: [ release/1.x ]
jobs:
build-on-ubuntu:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout main branch from GitHub
uses: actions/checkout@v4
# Runs a single command using the runners shell
- name: Seting up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Execute Gradle build
env:
GRGIT_USER: "Angelillo15"
GRGIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
chmod +x gradlew
./gradlew NookureStaff-API:publish NookureStaff-API:gitPublishPushAll
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ public final class Permissions {
/**
* Permissions to have administrator notes.
*/
public static final String STAFF_NOTES = "nookure.staff.notes";
public static final String STAFF_NOTES_ADMIN = "nookure.staff.notes.admin";

public static final String STAFF_NOTES_LIST = "nookure.staff.notes.list";

public static final String STAFF_NOTES_ADD = "nookure.staff.notes.add";

public static final String STAFF_NOTES_REMOVE = "nookure.staff.notes.remove";

public static final String STAFF_NOTES_EDIT = "nookure.staff.notes.edit";

private Permissions() {
throw new UnsupportedOperationException("This class cannot be instantiated");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Objects;

/**
* This class represents a command.
Expand Down Expand Up @@ -44,6 +45,22 @@ public void prepare() {
// Override this method to prepare the command
}

/**
* Obtain a list of possible completions for the message
*
* @param args The list of arguments
* @param message The message to complete
* @return A list of possible completions
*/
public List<String> getSuggestionFilter(@NotNull List<String> args, @NotNull String message) {
Objects.requireNonNull(args, "args can't be null");
Objects.requireNonNull(message, "message can't be null");

return args.stream()
.filter(arg -> arg.startsWith(message))
.toList();
}

/**
* Get the command data of the command
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class BukkitMessages {
public final FreezeMessagePartial freeze = new FreezeMessagePartial();
public final StaffChatPartial staffChat = new StaffChatPartial();
public final PlaceholderPartial placeholder = new PlaceholderPartial();
public final NoteMessages note = new NoteMessages();
@Setting
@Comment(
"""
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.nookure.staff.api.config.bukkit.partials.messages.note;

import org.spongepowered.configurate.objectmapping.ConfigSerializable;
import org.spongepowered.configurate.objectmapping.meta.Comment;
import org.spongepowered.configurate.objectmapping.meta.Setting;

@ConfigSerializable
public class NoteCommandsMessages {
@Setting
@Comment("The command usage message for the /note add.")
private String addNoteUsage = "{prefix} <red>Usage: /note add <player> <show on join> <note> [show only to admins]";

@Setting
@Comment("The command usage message for the /note remove.")
private String removeNoteUsage = "{prefix} <red>Usage: /note remove <note id>";

@Setting
@Comment("The command usage message for the /note list.")
private String listNoteUsage = "{prefix} <red>Usage: /note list <player> [page]";

@Setting
@Comment("The command usage message for the /note toggle-show command.")
private String toggleShowUsage = "{prefix} <red>Usage: /note toggle-show <note id>";

public String getAddNoteUsage() {
return addNoteUsage;
}

public String getRemoveNoteUsage() {
return removeNoteUsage;
}

public String getListNoteUsage() {
return listNoteUsage;
}

public String getToggleShowUsage() {
return toggleShowUsage;
}
}
Loading
Loading