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

Annotations #13

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ repositories {
dependencies {
// Base modules
implementation "net.infumia:frame:VERSION"
runtimeOnly "net.infumia:frame-core:VERSION"
implementation "net.infumia:frame-core:VERSION"

// Annotation modules
implementation "net.infumia:frame-annotations:VERSION"
}
```
### Code
Expand All @@ -29,7 +32,8 @@ public final class Plugin extends JavaPlugin {
builder.add(Plugin.CONSOLE_KEY, Bukkit.getConsoleSender()));
}
}

```
```java
public final class ViewExample implements ViewHandler {

@Override
Expand Down Expand Up @@ -65,3 +69,35 @@ public final class ViewExample implements ViewHandler {
}
}
```
#### Annotation Version

```java
@ViewCancelOnClick
@ViewType(InvType.CHEST)
@ViewLayout({
"xxxxxxxxx",
"xxxxaxxxx",
"xxxxxxxxx"
})
public final class View {

@ViewOnTitle
public CompletableFuture<String> onTitle(final ContextBase ctx, final Player viewer) {
return CompletableFuture.completedFuture("Player: " + player.getName());
}

@ElementSlotLayout('x')
@ElementConfigKey("fill-item")
public void glasses() {}

@ElementCloseOnClick
@ElementSlotLayout('a')
@ElementConfigKey("diamond-item")
public void diamond(
final Player viewer,
final MessageSender sender
) {
sender.sendMessage(viewer, "Player " + viewer.getName() + " clicked to a diamond!");
}
}
```

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

13 changes: 13 additions & 0 deletions annotations/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import net.infumia.gradle.applyPublish

applyPublish("annotations")

dependencies {
compileOnly(project(":common"))
compileOnly(project(":core"))
compileOnly(libs.minecraft.one.eight.eight.paper)

compileOnly(libs.guice) { isTransitive = false }
compileOnly(libs.geantyref)
compileOnly(libs.adventure.api)
}
Loading