Skip to content

Commit

Permalink
Update to 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris committed Aug 2, 2024
1 parent c9bfb57 commit 3c31bf6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
15 changes: 8 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java-library'
id 'java'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'io.github.goooler.shadow' version '8.1.7'
}

group 'net.onebeastchris.geyser.extension'
Expand All @@ -26,21 +26,22 @@ repositories {
}
}

java {
sourceCompatibility(JavaVersion.VERSION_17)
targetCompatibility(JavaVersion.VERSION_17)
}

dependencies {
compileOnly('org.geysermc.geyser:core:2.2.3-SNAPSHOT') {
compileOnly('org.geysermc.geyser:core:2.4.1-SNAPSHOT') {
exclude group: 'io.netty'
}
compileOnly('org.geysermc.geyser:api:2.2.3-SNAPSHOT')
compileOnly('org.geysermc.geyser:api:2.4.1-SNAPSHOT')

api('com.fasterxml.jackson.core:jackson-annotations:2.17.0')
api('com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.0')
api('com.fasterxml.jackson.core:jackson-core:2.17.0')
}

test {
useJUnitPlatform()
}

jar {
archiveClassifier.set("unshaded")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
import org.geysermc.geyser.api.event.lifecycle.GeyserDefineCommandsEvent;
import org.geysermc.geyser.api.event.lifecycle.GeyserPostInitializeEvent;
import org.geysermc.geyser.api.event.lifecycle.GeyserPreInitializeEvent;
import org.geysermc.geyser.api.event.lifecycle.GeyserRegisterPermissionsEvent;
import org.geysermc.geyser.api.extension.Extension;
import org.geysermc.geyser.api.extension.ExtensionLogger;
import org.geysermc.geyser.api.pack.ResourcePack;
import org.geysermc.geyser.api.util.TriState;
import org.geysermc.geyser.command.GeyserCommandSource;

import java.io.IOException;
Expand Down Expand Up @@ -101,15 +103,24 @@ public void onPlayerResourcePackLoadEvent(SessionLoadResourcePacksEvent event) {
}

@Subscribe
public void CommandEvent(GeyserDefineCommandsEvent commandsEvent) {
public void onPermissionRegistration(GeyserRegisterPermissionsEvent event) {
// menu permission
event.register(config.menuPermission(), TriState.TRUE);
// reset permission
event.register(config.defaultPermission(), TriState.TRUE);
// reload permission
event.register(config.reloadPermission(), TriState.NOT_SET);
}

@Subscribe
public void onCommandEvent(GeyserDefineCommandsEvent commandsEvent) {
commandsEvent.register(Command.builder(this)
.name("menu")
.aliases(List.of("list"))
.bedrockOnly(true)
.playerOnly(true)
.source(GeyserConnection.class)
.description(config.translations().menuCommandDescription())
.executableOnConsole(false)
.suggestedOpOnly(false)
.permission(config.menuPermission())
.executor((source, command, args) -> {
Form form = new Form((GeyserConnection) source);
Expand All @@ -121,10 +132,9 @@ public void CommandEvent(GeyserDefineCommandsEvent commandsEvent) {
.name("reset")
.aliases(List.of("default"))
.bedrockOnly(true)
.playerOnly(true)
.source(GeyserConnection.class)
.description(config.translations().resetCommandDescription())
.executableOnConsole(false)
.suggestedOpOnly(false)
.permission(config.defaultPermission())
.executor((source, command, args) -> {
Form form = new Form((GeyserConnection) source);
Expand All @@ -134,11 +144,8 @@ public void CommandEvent(GeyserDefineCommandsEvent commandsEvent) {

commandsEvent.register(Command.builder(this)
.name("reload")
.bedrockOnly(false)
.source(GeyserCommandSource.class)
.description(config.translations().reloadCommandDescription())
.executableOnConsole(true)
.suggestedOpOnly(true)
.permission(config.reloadPermission())
.executor((source, command, args) -> {
loader.reload();
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/extension.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id: pickpack
name: PickPack
main: net.onebeastchris.geyser.extension.pickpack.PickPack
api: 1.0.0
version: 1.2.3
api: 2.4.1
version: 1.2.4
authors: [onebeastchris]

0 comments on commit 3c31bf6

Please sign in to comment.