Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-MX committed May 15, 2024
1 parent c97c937 commit 4aff5ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ private void test() {
)
.register(false);

DeclarativeCommandBuilder.fromString(Player.class, "/hello <arg:string>")
.runs((context) -> {
DeclarativeCommandBuilder.fromString("/hello <arg:string>")
.runs(Player.class, (context) -> {
ArgumentContext<String> arg = context.getArgumentContext("arg");

if (arg == null) {
System.out.println("arg was null");
}

assert arg != null;
System.out.println(arg.getOrNull());
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.mattmx.ktgui.KotlinGui
import com.mattmx.ktgui.components.screen.GuiScreen
import com.mattmx.ktgui.components.signal.signal
import com.mattmx.ktgui.dsl.button
import com.mattmx.ktgui.dsl.effect
import com.mattmx.ktgui.dsl.event
import com.mattmx.ktgui.dsl.gui
import com.mattmx.ktgui.event.PreGuiBuildEvent
Expand Down Expand Up @@ -49,7 +50,7 @@ class GuiHookExample : Example {
if ((gui as GuiScreen).id != "kgui.example.gui-hook") return@event

var signalExampleVar by (gui as GuiScreen).signal(0)
gui.effect {
(gui as GuiScreen).effect {
button(Material.PURPLE_DYE) {
named(!"&d&lA button")
lore {
Expand Down

0 comments on commit 4aff5ea

Please sign in to comment.