Skip to content

Commit 53249ad

Browse files
committed
API 3.0.0
And fixed flyspeed
1 parent aac36b3 commit 53249ad

122 files changed

Lines changed: 204 additions & 2169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build and Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
branches:
9+
- '**'
10+
pull_request:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
build-maven:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup Java
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: 'temurin'
28+
java-version: '21'
29+
30+
- name: Build with Maven
31+
run: mvn -B package -DskipTests=false -Darguments="-Dmaven.javadoc.skip=true"
32+
33+
- name: Read project metadata
34+
id: project
35+
shell: bash
36+
run: |
37+
ARTIFACT_ID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
38+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
39+
FINAL_NAME=$(mvn help:evaluate -Dexpression=project.build.finalName -q -DforceStdout)
40+
41+
echo "artifact_id=$ARTIFACT_ID" >> "$GITHUB_OUTPUT"
42+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
43+
echo "final_name=$FINAL_NAME" >> "$GITHUB_OUTPUT"
44+
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
45+
echo "jar_path=target/$FINAL_NAME.jar" >> "$GITHUB_OUTPUT"
46+
47+
- name: Verify artifact
48+
shell: bash
49+
run: |
50+
if [ ! -f "${{ steps.project.outputs.jar_path }}" ]; then
51+
echo "${{ steps.project.outputs.jar_path }} was not created"
52+
exit 1
53+
fi
54+
55+
- name: Upload artifacts
56+
uses: actions/upload-artifact@v4
57+
if: success()
58+
with:
59+
name: ${{ steps.project.outputs.artifact_id }}
60+
path: ${{ steps.project.outputs.jar_path }}
61+
62+
- name: Create GitHub release
63+
if: github.event_name == 'push' && (github.ref_type == 'tag' || github.ref_name == github.event.repository.default_branch)
64+
env:
65+
GH_TOKEN: ${{ github.token }}
66+
run: |
67+
if [ "${{ github.ref_type }}" = "tag" ]; then
68+
RELEASE_TAG="${{ github.ref_name }}"
69+
else
70+
RELEASE_TAG="${{ steps.project.outputs.tag }}"
71+
fi
72+
73+
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
74+
gh release upload "$RELEASE_TAG" "${{ steps.project.outputs.jar_path }}" --clobber
75+
else
76+
gh release create "$RELEASE_TAG" "${{ steps.project.outputs.jar_path }}" --target "${{ github.sha }}" --title "$RELEASE_TAG" --notes "Automated release for $RELEASE_TAG"
77+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target/
2+
/.idea/

pom.xml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>cn.yescallop.essentialsnk</groupId>
66
<artifactId>EssentialsPNX</artifactId>
7-
<version>1.9.3</version>
7+
<version>1.9.4</version>
88

99
<name>EssentialsPNX</name>
1010
<description>Essential commands for your server</description>
@@ -16,17 +16,37 @@
1616
</properties>
1717

1818
<repositories>
19+
<repository>
20+
<id>central</id>
21+
<url>https://repo.maven.apache.org/maven2/</url>
22+
</repository>
1923
<repository>
2024
<id>jitpack.io</id>
21-
<url>https://jitpack.io</url>
25+
<url>https://www.jitpack.io</url>
26+
</repository>
27+
<repository>
28+
<id>opencollab-repository-maven-releases</id>
29+
<name>Opencollab Repository releases</name>
30+
<url>https://repo.opencollab.dev/maven-releases</url>
31+
</repository>
32+
<repository>
33+
<id>opencollab-repository-maven-snapshots</id>
34+
<name>Opencollab Repository snapshots</name>
35+
<url>https://repo.opencollab.dev/maven-snapshots</url>
36+
</repository>
37+
<repository>
38+
<id>PowerNukkitX-releases</id>
39+
<name>PowerNukkitX Repository</name>
40+
<url>https://repo.powernukkitx.org/releases</url>
2241
</repository>
2342
</repositories>
2443

2544
<dependencies>
2645
<dependency>
27-
<groupId>com.github.PowerNukkitX</groupId>
28-
<artifactId>PowerNukkitX</artifactId>
29-
<version>snapshot</version>
46+
<groupId>org.powernukkitx</groupId>
47+
<artifactId>server</artifactId>
48+
<version>b-migration-SNAPSHOT</version>
49+
<scope>provided</scope>
3050
</dependency>
3151
<dependency>
3252
<groupId>org.projectlombok</groupId>
@@ -49,8 +69,8 @@
4969
<groupId>org.apache.maven.plugins</groupId>
5070
<artifactId>maven-compiler-plugin</artifactId>
5171
<configuration>
52-
<source>9</source>
53-
<target>9</target>
72+
<source>21</source>
73+
<target>21</target>
5474
</configuration>
5575
</plugin>
5676
</plugins>

src/main/java/cn/yescallop/essentialsnk/EssentialsAPI.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import cn.nukkit.nbt.tag.ListTag;
2626
import cn.nukkit.permission.PermissionAttachmentInfo;
2727
import cn.nukkit.plugin.PluginLogger;
28+
import cn.nukkit.registry.BlockRegistry;
29+
import cn.nukkit.registry.Registries;
2830
import cn.nukkit.utils.Config;
2931
import cn.nukkit.utils.ConfigSection;
3032
import cn.yescallop.essentialsnk.util.ConfigType;
@@ -49,9 +51,7 @@ public class EssentialsAPI {
4951
private static final Pattern COOLDOWN_PATTERN = Pattern.compile("^essentialsnk\\.cooldown\\.([0-9]+)$", Pattern.CASE_INSENSITIVE);
5052
private static final Pattern TP_COOLDOWN_PATTERN = Pattern.compile("^essentialsnk\\.tp\\.cooldown\\.([0-9]+)$", Pattern.CASE_INSENSITIVE);
5153
private static final Pattern HOMES_PERMISSION_PATTERN = Pattern.compile("^essentialsnk\\.homes\\.([0-9]+)$", Pattern.CASE_INSENSITIVE);
52-
public static final String[] NON_SOLID_BLOCKS = new String[]{Block.AIR, Block.ACACIA_SAPLING,Block.SPRUCE_SAPLING,Block.BAMBOO_SAPLING,Block.BIRCH_SAPLING,Block.CHERRY_SAPLING,Block.DARK_OAK_SAPLING,Block.JUNGLE_SAPLING,Block.OAK_SAPLING, Block.WATER, Block.FLOWING_WATER, Block.LAVA, Block.FLOWING_LAVA, Block.WEB, Block.TALL_GRASS, Block.SWEET_BERRY_BUSH,Block.DEADBUSH, Block.YELLOW_FLOWER,Block.CORNFLOWER,Block.TORCHFLOWER,
53-
Block.POPPY, Block.BROWN_MUSHROOM, Block.RED_MUSHROOM, Block.TORCH, Block.FIRE, Block.WHEAT, Block.STANDING_SIGN,Block.OAK_HANGING_SIGN, Block.WALL_SIGN, Item.SUGAR_CANE,
54-
Block.PUMPKIN_STEM, Block.MELON_STEM, Block.VINE, Block.CARROTS, Block.POTATOES, Block.SUNFLOWER,Block.ROSE_BUSH,Block.TALL_GRASS,Block.FERN,Block.PEONY};
54+
public static final String[] NON_SOLID_BLOCKS = Registries.BLOCK.getKeySet().stream().map(Registries.BLOCK::get).filter(block -> !block.isSolid()).map(Block::getId).toArray(String[]::new);
5555
private static EssentialsAPI instance = null;
5656
private static Duration THIRTY_DAYS = Duration.ZERO.plusDays(30);
5757
private Vector3 temporalVector = new Vector3();

src/main/java/cn/yescallop/essentialsnk/command/defaults/BroadcastCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package cn.yescallop.essentialsnk.command.defaults;
22

33
import cn.nukkit.command.CommandSender;
4-
import cn.nukkit.command.data.CommandParamType;
54
import cn.nukkit.command.data.CommandParameter;
65
import cn.yescallop.essentialsnk.EssentialsAPI;
76
import cn.yescallop.essentialsnk.command.CommandBase;
7+
import org.cloudburstmc.protocol.bedrock.data.command.CommandParamType;
88

99
import java.util.LinkedList;
1010

src/main/java/cn/yescallop/essentialsnk/command/defaults/BurnCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import cn.nukkit.Player;
44
import cn.nukkit.command.CommandSender;
5-
import cn.nukkit.command.data.CommandParamType;
65
import cn.nukkit.command.data.CommandParameter;
76
import cn.nukkit.utils.TextFormat;
87
import cn.yescallop.essentialsnk.EssentialsAPI;
98
import cn.yescallop.essentialsnk.Language;
109
import cn.yescallop.essentialsnk.command.CommandBase;
10+
import org.cloudburstmc.protocol.bedrock.data.command.CommandParamType;
1111

1212
import java.util.LinkedList;
1313

@@ -19,7 +19,7 @@ public BurnCommand(EssentialsAPI api) {
1919
// command parameters
2020
commandParameters.clear();
2121
this.commandParameters.put("default", new CommandParameter[] {
22-
CommandParameter.newType("target", false, CommandParamType.TARGET),
22+
CommandParameter.newType("target", false, CommandParamType.WILDCARD_SELECTION),
2323
CommandParameter.newType("time", false, CommandParamType.INT)
2424
});
2525
//KailynDev2024®

src/main/java/cn/yescallop/essentialsnk/command/defaults/ClearInventoryCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import cn.nukkit.Player;
44
import cn.nukkit.command.CommandSender;
5-
import cn.nukkit.command.data.CommandParamType;
65
import cn.nukkit.command.data.CommandParameter;
76
import cn.nukkit.utils.TextFormat;
87
import cn.yescallop.essentialsnk.EssentialsAPI;
98
import cn.yescallop.essentialsnk.Language;
109
import cn.yescallop.essentialsnk.command.CommandBase;
10+
import org.cloudburstmc.protocol.bedrock.data.command.CommandParamType;
1111

1212
import java.util.LinkedList;
1313

@@ -20,7 +20,7 @@ public ClearInventoryCommand(EssentialsAPI api) {
2020
// command parameters
2121
commandParameters.clear();
2222
this.commandParameters.put("default", new CommandParameter[] {
23-
CommandParameter.newType("target", true, CommandParamType.TARGET)
23+
CommandParameter.newType("target", true, CommandParamType.WILDCARD_SELECTION)
2424
});
2525
//KailynDev2024®
2626
}

src/main/java/cn/yescallop/essentialsnk/command/defaults/EssentialsCommand.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
package cn.yescallop.essentialsnk.command.defaults;
22

33
import cn.nukkit.command.CommandSender;
4-
import cn.nukkit.command.data.CommandParamType;
54
import cn.nukkit.command.data.CommandParameter;
65
import cn.yescallop.essentialsnk.EssentialsAPI;
76
import cn.yescallop.essentialsnk.Language;
87
import cn.yescallop.essentialsnk.command.CommandBase;
98

10-
import java.util.Arrays;
11-
import java.util.LinkedList;
12-
139
public class EssentialsCommand extends CommandBase {
1410
public EssentialsCommand(EssentialsAPI api) {
1511
super("essentials", api);

src/main/java/cn/yescallop/essentialsnk/command/defaults/ExtinguishCommand.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
import cn.nukkit.Player;
44
import cn.nukkit.command.CommandSender;
5-
import cn.nukkit.command.data.CommandParamType;
65
import cn.nukkit.command.data.CommandParameter;
76
import cn.nukkit.utils.TextFormat;
87
import cn.yescallop.essentialsnk.EssentialsAPI;
98
import cn.yescallop.essentialsnk.Language;
109
import cn.yescallop.essentialsnk.command.CommandBase;
11-
12-
import java.util.LinkedList;
10+
import org.cloudburstmc.protocol.bedrock.data.command.CommandParamType;
1311

1412
public class ExtinguishCommand extends CommandBase {
1513

@@ -20,7 +18,7 @@ public ExtinguishCommand(EssentialsAPI api) {
2018
// command parameters
2119
commandParameters.clear();
2220
this.commandParameters.put("default", new CommandParameter[] {
23-
CommandParameter.newType("player", true, CommandParamType.TARGET)
21+
CommandParameter.newType("player", true, CommandParamType.WILDCARD_SELECTION)
2422
});
2523
//KailynDev2024®
2624
}

src/main/java/cn/yescallop/essentialsnk/command/defaults/FeedCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
import cn.nukkit.Player;
44
import cn.nukkit.PlayerFood;
55
import cn.nukkit.command.CommandSender;
6-
import cn.nukkit.command.data.CommandParamType;
76
import cn.nukkit.command.data.CommandParameter;
87
import cn.nukkit.utils.TextFormat;
98
import cn.yescallop.essentialsnk.EssentialsAPI;
109
import cn.yescallop.essentialsnk.Language;
1110
import cn.yescallop.essentialsnk.command.CommandBase;
11+
import org.cloudburstmc.protocol.bedrock.data.command.CommandParamType;
1212

1313
import java.util.LinkedList;
1414

@@ -21,7 +21,7 @@ public FeedCommand(EssentialsAPI api) {
2121
// command parameters
2222
commandParameters.clear();
2323
this.commandParameters.put("default", new CommandParameter[] {
24-
CommandParameter.newType("player", true, CommandParamType.TARGET)
24+
CommandParameter.newType("player", true, CommandParamType.WILDCARD_SELECTION)
2525
});
2626
//KailynDev2024®
2727
}

0 commit comments

Comments
 (0)