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

Updated Bukkit to 1.21/1.21.1 #461

Merged
merged 13 commits into from
Sep 17, 2024
4 changes: 2 additions & 2 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ repositories {
maven("https://repo.codemc.org/repository/maven-public") {
name = "CodeMC"
}
maven("https://papermc.io/repo/repository/maven-public/") {
maven("https://repo.papermc.io/repository/maven-public/") {
name = "PaperMC"
}
}

dependencies {
//TODO Allow pulling from Versions.kt
implementation("com.github.johnrengelman", "shadow", "8.1.1")
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.0")
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.1")

implementation("org.ow2.asm", "asm", "9.7")
implementation("org.ow2.asm", "asm-tree", "9.7")
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/CompilationConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ fun Project.configureCompilation() {
apply<TectonicDocPlugin>()

configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

tasks.withType<JavaCompile> {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/DependencyConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun Project.configureDependencies() {
maven("https://repo.codemc.org/repository/maven-public") {
name = "CodeMC"
}
maven("https://papermc.io/repo/repository/maven-public/") {
maven("https://repo.papermc.io/repository/maven-public/") {
name = "PaperMC"
}
maven("https://files.minecraftforge.net/maven/") {
Expand Down
10 changes: 6 additions & 4 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ object Versions {
const val paralithic = "0.7.1"
const val strata = "1.3.2"

const val cloud = "1.8.4"
const val cloud = "2.0.0-rc.2"
const val cloudPaper = "2.0.0-beta.9"
const val cloudFabric = "2.0.0-beta.7"

const val caffeine = "3.1.8"

Expand Down Expand Up @@ -52,14 +54,14 @@ object Versions {
// }

object Bukkit {
const val minecraft = "1.20.6"
const val paperBuild = "$minecraft-R0.1-20240501.172135-12"
const val minecraft = "1.21"
const val paperBuild = "$minecraft-R0.1-SNAPSHOT"
const val paper = paperBuild
const val paperLib = "1.0.8"
const val reflectionRemapper = "0.1.1"
const val paperDevBundle = paperBuild
const val runPaper = "2.3.0"
const val paperWeight = "1.7.0"
const val paperWeight = "1.7.1"
}

//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.dfsek.terra.addons.commands.addons;

import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.CommandManager;

import com.dfsek.terra.addons.manifest.api.AddonInitializer;
import com.dfsek.terra.api.Platform;
import com.dfsek.terra.api.addon.BaseAddon;
Expand All @@ -12,6 +9,9 @@
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
import com.dfsek.terra.api.inject.annotations.Inject;

import org.incendo.cloud.CommandManager;
import org.incendo.cloud.description.Description;


public class AddonsCommandAddon implements AddonInitializer {
@Inject
Expand All @@ -30,7 +30,7 @@ public void initialize() {
CommandManager<CommandSender> manager = event.getCommandManager();

manager.command(
manager.commandBuilder("addons", ArgumentDescription.of("List installed Terra addons"))
manager.commandBuilder("addons", Description.of("List installed Terra addons"))
.permission("terra.addons")
.handler(context -> {
StringBuilder addons = new StringBuilder("Installed addons:\n");
Expand All @@ -41,7 +41,7 @@ public void initialize() {
.append('@')
.append(addon.getVersion().getFormatted())
.append('\n'));
context.getSender().sendMessage(addons.toString());
context.sender().sendMessage(addons.toString());
})
)
.command(
Expand All @@ -61,7 +61,7 @@ public void initialize() {
.append('@')
.append(versions.getFormatted())
.append('\n'));
context.getSender().sendMessage(addonInfo.toString());
context.sender().sendMessage(addonInfo.toString());
})
);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.dfsek.terra.addons.commands.packs;

import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.CommandManager;
import org.incendo.cloud.CommandManager;
import org.incendo.cloud.description.Description;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -35,20 +35,20 @@ public void initialize() {
CommandManager<CommandSender> manager = event.getCommandManager();

manager.command(
manager.commandBuilder("packs", ArgumentDescription.of("List installed config packs"))
manager.commandBuilder("packs", Description.of("List installed config packs"))
.permission("terra.packs")
.handler(context -> {
StringBuilder packs = new StringBuilder("Installed packs:\n");
platform.getConfigRegistry().forEach(pack -> packs.append(" - ")
.append(pack.getID())
.append('@')
.append(pack.getVersion().getFormatted()));
context.getSender().sendMessage(packs.toString());
context.sender().sendMessage(packs.toString());
})
)
.command(
manager.commandBuilder("packs")
.literal("info", ArgumentDescription.of("Get information about a pack"))
.literal("info", Description.of("Get information about a pack"))
.permission("terra.packs.info")
.argument(RegistryArgument.of("pack", platform.getConfigRegistry()))
.handler(context -> {
Expand All @@ -65,21 +65,21 @@ public void initialize() {
.append('@')
.append(versions.getFormatted())
.append('\n'));
context.getSender().sendMessage(packInfo.toString());
context.sender().sendMessage(packInfo.toString());
}))
.command(
manager.commandBuilder("packs")
.literal("reload", ArgumentDescription.of("Reload config packs"))
.literal("reload", Description.of("Reload config packs"))
.permission("terra.packs.reload")
.handler(context -> {
context.getSender().sendMessage("Reloading Terra...");
context.sender().sendMessage("Reloading Terra...");
logger.info("Reloading Terra...");
if(platform.reload()) {
logger.info("Terra reloaded successfully.");
context.getSender().sendMessage("Terra reloaded successfully.");
context.sender().sendMessage("Terra reloaded successfully.");
} else {
logger.error("Terra failed to reload.");
context.getSender().sendMessage(
context.sender().sendMessage(
"Terra failed to reload. See logs for more information.");
}
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.dfsek.terra.addons.commands.profiler;

import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.CommandManager;
import org.incendo.cloud.CommandManager;
import org.incendo.cloud.description.Description;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -33,24 +33,24 @@ public void initialize() {
CommandManager<CommandSender> manager = event.getCommandManager();
manager
.command(
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
.literal("start", ArgumentDescription.of("Start profiling"), "st")
manager.commandBuilder("profiler", Description.of("Access the profiler"))
.literal("start", Description.of("Start profiling"), "st")
.permission("terra.profiler.start")
.handler(context -> {
platform.getProfiler().start();
context.getSender().sendMessage("Profiling started.");
context.sender().sendMessage("Profiling started.");
}))
.command(
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
.literal("stop", ArgumentDescription.of("Stop profiling"), "s")
manager.commandBuilder("profiler", Description.of("Access the profiler"))
.literal("stop", Description.of("Stop profiling"), "s")
.permission("terra.profiler.stop")
.handler(context -> {
platform.getProfiler().stop();
context.getSender().sendMessage("Profiling stopped.");
context.sender().sendMessage("Profiling stopped.");
}))
.command(
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
.literal("query", ArgumentDescription.of("Query profiler results"), "q")
manager.commandBuilder("profiler", Description.of("Access the profiler"))
.literal("query", Description.of("Query profiler results"), "q")
.permission("terra.profiler.query")
.handler(context -> {
StringBuilder data = new StringBuilder("Terra Profiler data: \n");
Expand All @@ -59,15 +59,15 @@ public void initialize() {
.append(timings.toString())
.append('\n'));
logger.info(data.toString());
context.getSender().sendMessage("Profiling data dumped to console.");
context.sender().sendMessage("Profiling data dumped to console.");
}))
.command(
manager.commandBuilder("profiler", ArgumentDescription.of("Access the profiler"))
.literal("reset", ArgumentDescription.of("Reset the profiler"), "r")
manager.commandBuilder("profiler", Description.of("Access the profiler"))
.literal("reset", Description.of("Reset the profiler"), "r")
.permission("terra.profiler.reset")
.handler(context -> {
platform.getProfiler().reset();
context.getSender().sendMessage("Profiler reset.");
context.sender().sendMessage("Profiler reset.");
}));
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package com.dfsek.terra.addons.commands.structure;

import cloud.commandframework.ArgumentDescription;
import cloud.commandframework.CommandManager;
import cloud.commandframework.arguments.standard.EnumArgument;
import cloud.commandframework.arguments.standard.LongArgument;
import cloud.commandframework.context.CommandContext;

import java.util.Random;

import com.dfsek.terra.addons.manifest.api.AddonInitializer;
Expand All @@ -22,6 +16,13 @@
import com.dfsek.terra.api.util.Rotation;
import com.dfsek.terra.api.util.reflection.TypeKey;

import org.incendo.cloud.CommandManager;
import org.incendo.cloud.component.DefaultValue;
import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.description.Description;
import org.incendo.cloud.parser.standard.EnumParser;
import org.incendo.cloud.parser.standard.LongParser;


public class StructureCommandAddon implements AddonInitializer {
@Inject
Expand All @@ -31,7 +32,7 @@ public class StructureCommandAddon implements AddonInitializer {
private BaseAddon addon;

private static Registry<Structure> getStructureRegistry(CommandContext<CommandSender> sender) {
return sender.getSender().getEntity().orElseThrow().world().getPack().getRegistry(Structure.class);
return sender.sender().getEntity().orElseThrow().world().getPack().getRegistry(Structure.class);
}

@Override
Expand All @@ -43,16 +44,16 @@ public void initialize() {
CommandManager<CommandSender> manager = event.getCommandManager();

manager.command(
manager.commandBuilder("structures", ArgumentDescription.of("Manage or generate structures"))
manager.commandBuilder("structures", Description.of("Manage or generate structures"))
.literal("generate")
.argument(RegistryArgument.builder("structure",
.optional(RegistryArgument.builder("structure",
StructureCommandAddon::getStructureRegistry,
TypeKey.of(Structure.class)))
.argument(LongArgument.optional("seed", 0))
.argument(EnumArgument.optional(Rotation.class, "rotation", Rotation.NONE))
.optional("seed", LongParser.longParser(), DefaultValue.constant(0L))
.optional("rotation", EnumParser.enumParser(Rotation.class), DefaultValue.constant(Rotation.NONE))
.handler(context -> {
Structure structure = context.get("structure");
Entity sender = context.getSender().getEntity().orElseThrow();
Entity sender = context.sender().getEntity().orElseThrow();
structure.generate(
sender.position().toInt(),
sender.world(),
Expand Down
2 changes: 1 addition & 1 deletion common/api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dependencies {
api("ca.solo-studios", "strata", Versions.Libraries.strata)
compileOnlyApi("org.slf4j", "slf4j-api", Versions.Libraries.slf4j)
testImplementation("org.slf4j", "slf4j-api", Versions.Libraries.slf4j)
api("cloud.commandframework", "cloud-core", Versions.Libraries.cloud)
api("org.incendo", "cloud-core", Versions.Libraries.cloud)

api("com.dfsek.tectonic", "common", Versions.Libraries.tectonic)

Expand Down
Loading
Loading