Skip to content

Commit d80f850

Browse files
committed
Update Gradle, paperweight, Paper
1 parent 77ba1fa commit d80f850

File tree

6 files changed

+9
-136
lines changed

6 files changed

+9
-136
lines changed

build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import xyz.jpenilla.resourcefactory.bukkit.BukkitPluginYaml
22

33
plugins {
44
`java-library`
5-
id("io.papermc.paperweight.userdev") version "2.0.0-beta.17"
5+
id("io.papermc.paperweight.userdev") version "2.0.0-beta.18"
66
id("xyz.jpenilla.run-paper") version "2.3.1" // Adds runServer and runMojangMappedServer tasks for testing
77
id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.3.0" // Generates plugin.yml based on the Gradle config
88
}
@@ -26,9 +26,9 @@ tasks.assemble {
2626
*/
2727

2828
dependencies {
29-
paperweight.paperDevBundle("1.21.5-R0.1-SNAPSHOT")
30-
// paperweight.foliaDevBundle("1.21.5-R0.1-SNAPSHOT")
31-
// paperweight.devBundle("com.example.paperfork", "1.21.5-R0.1-SNAPSHOT")
29+
paperweight.paperDevBundle("1.21.8-R0.1-SNAPSHOT")
30+
// paperweight.foliaDevBundle("1.21.8-R0.1-SNAPSHOT")
31+
// paperweight.devBundle("com.example.paperfork", "1.21.8-R0.1-SNAPSHOT")
3232
}
3333

3434
tasks {
@@ -57,5 +57,5 @@ bukkitPluginYaml {
5757
main = "io.papermc.paperweight.testplugin.TestPlugin"
5858
load = BukkitPluginYaml.PluginLoadOrder.STARTUP
5959
authors.add("Author")
60-
apiVersion = "1.21.5"
60+
apiVersion = "1.21.8"
6161
}

gradle/wrapper/gradle-wrapper.jar

1.65 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.

src/main/java/io/papermc/paperweight/testplugin/PluginBrigadierCommand.java

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,17 @@
11
package io.papermc.paperweight.testplugin;
22

3-
import com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource;
4-
import com.destroystokyo.paper.event.brigadier.CommandRegisteredEvent;
5-
import com.mojang.brigadier.Command;
6-
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
7-
import com.mojang.brigadier.tree.LiteralCommandNode;
8-
import java.util.Collection;
9-
import java.util.function.Consumer;
10-
import net.minecraft.ChatFormatting;
11-
import net.minecraft.commands.CommandSourceStack;
12-
import net.minecraft.commands.arguments.EntityArgument;
13-
import net.minecraft.network.chat.ClickEvent;
14-
import net.minecraft.network.chat.Component;
15-
import net.minecraft.server.level.ServerPlayer;
16-
import org.bukkit.craftbukkit.CraftServer;
17-
import org.bukkit.event.EventHandler;
3+
import net.minecraft.SharedConstants;
184
import org.bukkit.event.Listener;
195
import org.bukkit.plugin.java.JavaPlugin;
206
import org.checkerframework.checker.nullness.qual.NonNull;
217
import org.checkerframework.framework.qual.DefaultQualifier;
228

23-
import static net.kyori.adventure.text.Component.text;
24-
import static net.kyori.adventure.text.format.NamedTextColor.BLUE;
25-
import static net.minecraft.commands.Commands.argument;
26-
import static net.minecraft.commands.Commands.literal;
27-
import static net.minecraft.commands.arguments.EntityArgument.players;
28-
299
@DefaultQualifier(NonNull.class)
3010
public final class TestPlugin extends JavaPlugin implements Listener {
3111
@Override
3212
public void onEnable() {
3313
this.getServer().getPluginManager().registerEvents(this, this);
3414

35-
this.registerPluginBrigadierCommand(
36-
"paperweight",
37-
literal -> literal.requires(stack -> stack.getBukkitSender().hasPermission("paperweight"))
38-
.then(literal("hello")
39-
.executes(ctx -> {
40-
ctx.getSource().getBukkitSender().sendMessage(text("Hello!", BLUE));
41-
return Command.SINGLE_SUCCESS;
42-
}))
43-
.then(argument("players", players())
44-
.executes(ctx -> {
45-
final Collection<ServerPlayer> players = EntityArgument.getPlayers(ctx, "players");
46-
for (final ServerPlayer player : players) {
47-
player.sendSystemMessage(
48-
Component.literal("Hello from Paperweight test plugin!")
49-
.withStyle(ChatFormatting.ITALIC, ChatFormatting.GREEN)
50-
.withStyle(style -> style.withClickEvent(new ClickEvent.RunCommand("/paperweight @a")))
51-
);
52-
}
53-
return players.size();
54-
}))
55-
);
56-
}
57-
58-
private PluginBrigadierCommand registerPluginBrigadierCommand(final String label, final Consumer<LiteralArgumentBuilder<CommandSourceStack>> command) {
59-
final PluginBrigadierCommand pluginBrigadierCommand = new PluginBrigadierCommand(this, label, command);
60-
this.getServer().getCommandMap().register(this.getName(), pluginBrigadierCommand);
61-
((CraftServer) this.getServer()).syncCommands();
62-
return pluginBrigadierCommand;
63-
}
64-
65-
@SuppressWarnings({"rawtypes", "unchecked"})
66-
@EventHandler
67-
public void onCommandRegistered(final CommandRegisteredEvent<BukkitBrigadierCommandSource> event) {
68-
if (!(event.getCommand() instanceof PluginBrigadierCommand pluginBrigadierCommand)) {
69-
return;
70-
}
71-
final LiteralArgumentBuilder<CommandSourceStack> node = literal(event.getCommandLabel());
72-
pluginBrigadierCommand.command().accept(node);
73-
event.setLiteral((LiteralCommandNode) node.build());
15+
this.getLogger().info(SharedConstants.getCurrentVersion().id());
7416
}
7517
}

0 commit comments

Comments
 (0)