File tree Expand file tree Collapse file tree 10 files changed +38
-21
lines changed
src/main/java/com/azuriom/azlink/fabric
src/main/java/com/azuriom/azlink/neoforge Expand file tree Collapse file tree 10 files changed +38
-21
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ name: Java CI
33on :
44 push :
55 pull_request :
6+ workflow_dispatch :
67
78jobs :
89 build :
Original file line number Diff line number Diff line change 11plugins {
22 id ' net.kyori.blossom' version ' 2.2.0'
3- id ' org.jetbrains.gradle.plugin.idea-ext' version ' 1.3'
3+ // id 'org.jetbrains.gradle.plugin.idea-ext' version '1.3'
44}
55
66repositories {
Original file line number Diff line number Diff line change 11plugins {
2- id ' fabric-loom' version ' 1.11 -SNAPSHOT'
3- id ' com.gradleup.shadow' version ' 8 .3.5 '
2+ id ' fabric-loom' version ' 1.14 -SNAPSHOT'
3+ id ' com.gradleup.shadow' version ' 9 .3.1 '
44}
55
66java {
99}
1010
1111ext {
12- minecraft_version = ' 1.21.8 '
13- yarn_mappings = ' 1.21.8 +build.1 '
14- loader_version = ' 0.17.2 '
15- fabric_version = ' 0.132.0 +1.21.8 '
12+ minecraft_version = ' 1.21.11 '
13+ yarn_mappings = ' 1.21.11 +build.4 '
14+ loader_version = ' 0.18.4 '
15+ fabric_version = ' 0.141.1 +1.21.11 '
1616}
1717
1818dependencies {
@@ -54,6 +54,6 @@ remapJar {
5454 archiveFileName = " AzLink-Fabric-${ project.version} -${ project.ext.minecraft_version} .jar"
5555}
5656
57- artifacts {
58- archives remapJar
57+ build {
58+ dependsOn remapJar
5959}
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ public Stream<CommandSender> getOnlinePlayers() {
133133 @ Override
134134 public void dispatchConsoleCommand (String command ) {
135135 ServerCommandSource source = getServer ().getCommandSource ();
136- getServer ().getCommandManager ().executeWithPrefix (source , command );
136+ getServer ().getCommandManager ().parseAndExecute (source , command );
137137 }
138138
139139 @ Override
Original file line number Diff line number Diff line change 11package com .azuriom .azlink .fabric .command ;
22
33import com .azuriom .azlink .common .command .CommandSender ;
4+ import net .minecraft .command .permission .Permission ;
5+ import net .minecraft .command .permission .PermissionLevel ;
46import net .minecraft .entity .Entity ;
57import net .minecraft .server .command .ServerCommandSource ;
68
79import java .util .UUID ;
810
911public class FabricCommandSource implements CommandSender {
1012
13+ private static final Permission PERMISSION_LEVEL_OWNERS = new Permission .Level (PermissionLevel .OWNERS );
14+
1115 private final ServerCommandSource source ;
1216
1317 public FabricCommandSource (ServerCommandSource source ) {
@@ -35,6 +39,6 @@ public void sendMessage(String message) {
3539
3640 @ Override
3741 public boolean hasPermission (String permission ) {
38- return this .source .hasPermissionLevel ( 3 );
42+ return this .source .getPermissions (). hasPermission ( PERMISSION_LEVEL_OWNERS );
3943 }
4044}
Original file line number Diff line number Diff line change 11package com .azuriom .azlink .fabric .command ;
22
33import com .azuriom .azlink .common .command .CommandSender ;
4+ import net .minecraft .command .permission .Permission ;
5+ import net .minecraft .command .permission .PermissionLevel ;
46import net .minecraft .server .network .ServerPlayerEntity ;
57
68import java .util .UUID ;
79
810public class FabricPlayer implements CommandSender {
911
12+ private static final Permission PERMISSION_LEVEL_OWNERS = new Permission .Level (PermissionLevel .OWNERS );
13+
1014 private final ServerPlayerEntity player ;
1115
1216 public FabricPlayer (ServerPlayerEntity player ) {
@@ -30,6 +34,6 @@ public void sendMessage(String message) {
3034
3135 @ Override
3236 public boolean hasPermission (String permission ) {
33- return this .player .hasPermissionLevel ( 3 );
37+ return this .player .getPermissions (). hasPermission ( PERMISSION_LEVEL_OWNERS );
3438 }
3539}
Original file line number Diff line number Diff line change 11plugins {
2- id ' net.neoforged.moddev' version ' 2.0.82 '
3- id ' com.gradleup.shadow' version ' 8 .3.5 '
2+ id ' net.neoforged.moddev' version ' 2.0.139 '
3+ id ' com.gradleup.shadow' version ' 9 .3.1 '
44}
55
66java {
99}
1010
1111ext {
12- minecraft_version = ' 1.21.8 '
13- neo_version = ' 21.8.4 -beta'
12+ minecraft_version = ' 1.21.11 '
13+ neo_version = ' 21.11.35 -beta'
1414}
1515
1616neoForge {
@@ -60,6 +60,6 @@ shadowJar {
6060 relocate ' net.kyori' , ' com.azuriom.azlink.libs'
6161}
6262
63- artifacts {
64- archives shadowJar
63+ build {
64+ dependsOn shadowJar
6565}
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ public PlatformInfo getPlatformInfo() {
116116 .map (IModInfo ::getDisplayName )
117117 .orElse ("unknown" );
118118
119- return new PlatformInfo (name , FMLLoader .versionInfo ().neoForgeVersion ());
119+ return new PlatformInfo (name , FMLLoader .getCurrent (). getVersionInfo ().neoForgeVersion ());
120120 }
121121
122122 @ Override
Original file line number Diff line number Diff line change 22
33import com .azuriom .azlink .common .command .CommandSender ;
44import net .minecraft .commands .CommandSourceStack ;
5+ import net .minecraft .server .permissions .Permission ;
6+ import net .minecraft .server .permissions .PermissionLevel ;
57import net .minecraft .world .entity .Entity ;
68
79import java .util .UUID ;
810
911public class NeoForgeCommandSource implements CommandSender {
1012
13+ private static final Permission PERMISSION_LEVEL_OWNERS = new Permission .HasCommandLevel (PermissionLevel .OWNERS );
14+
1115 private final CommandSourceStack source ;
1216
1317 public NeoForgeCommandSource (CommandSourceStack source ) {
@@ -35,6 +39,6 @@ public void sendMessage(String message) {
3539
3640 @ Override
3741 public boolean hasPermission (String permission ) {
38- return this .source .hasPermission (3 );
42+ return this .source .permissions (). hasPermission (PERMISSION_LEVEL_OWNERS );
3943 }
4044}
Original file line number Diff line number Diff line change 22
33import com .azuriom .azlink .common .command .CommandSender ;
44import net .minecraft .server .level .ServerPlayer ;
5+ import net .minecraft .server .permissions .Permission ;
6+ import net .minecraft .server .permissions .PermissionLevel ;
57
68import java .util .UUID ;
79
810public class NeoForgePlayer implements CommandSender {
911
12+ private static final Permission PERMISSION_LEVEL_OWNERS = new Permission .HasCommandLevel (PermissionLevel .OWNERS );
13+
1014 private final ServerPlayer player ;
1115
1216 public NeoForgePlayer (ServerPlayer player ) {
@@ -30,6 +34,6 @@ public void sendMessage(String message) {
3034
3135 @ Override
3236 public boolean hasPermission (String permission ) {
33- return this .player .hasPermissions ( 3 );
37+ return this .player .permissions (). hasPermission ( PERMISSION_LEVEL_OWNERS );
3438 }
3539}
You can’t perform that action at this time.
0 commit comments