bukkit: Update for Minecraft 1.17

This commit is contained in:
Jason Penilla 2021-06-11 03:00:39 -07:00 committed by Jason
parent f7e756e901
commit 123341563d
10 changed files with 253 additions and 50 deletions

View file

@ -1,5 +1,6 @@
plugins {
id("com.github.johnrengelman.shadow")
id("xyz.jpenilla.run-paper") version "1.0.3-SNAPSHOT"
}
tasks {
@ -11,6 +12,11 @@ tasks {
build {
dependsOn(shadowJar)
}
runServer {
minecraftVersion("1.17")
paperclip(file("spigot-1.17.jar"))
legacyPluginLoading()
}
}
dependencies {

View file

@ -476,7 +476,10 @@ public final class ExamplePlugin extends JavaPlugin {
},
ArgumentDescription.of("The ItemStack to give")
)
.handler(ctx -> ((Player) ctx.getSender()).getInventory().addItem(ctx.get("itemstack"))));
.handler(ctx -> {
final ItemStack stack = ctx.get("itemstack");
((Player) ctx.getSender()).getInventory().addItem(stack);
}));
}
@CommandMethod("example help [query]")