Fixes for Fabric 1.19 by Kopo (#2419)

* Gradle 7.4.2
* Build changes for MC 1.19

- Updated loom to minor version 0.12 & moved to root project
- Updated mappings, command API, fabric API & loader version
- Moved Selenium to common module because of a conflict with loom's dependency resolution

* Add remap folder to .gitignore
* Fix version token replacement
* Update to Minecraft 1.19
* Don't forget the pipelines

Affects issues:
- Fixed #2417
This commit is contained in:
Antti Koponen 2022-06-10 16:21:53 +03:00 committed by GitHub
parent f191c47c25
commit 4196141db1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 59 additions and 91 deletions

View File

@ -26,7 +26,7 @@ jobs:
uses: actions/setup-java@v2 uses: actions/setup-java@v2
with: with:
distribution: 'adopt' distribution: 'adopt'
java-version: '16' java-version: '17'
- name: Setup Selenium Webdriver - name: Setup Selenium Webdriver
uses: nanasess/setup-chromedriver@v1 uses: nanasess/setup-chromedriver@v1
- name: Setup Selenium Webdriver settings - name: Setup Selenium Webdriver settings

View File

@ -28,7 +28,7 @@ jobs:
uses: actions/setup-java@v2 uses: actions/setup-java@v2
with: with:
distribution: 'adopt' distribution: 'adopt'
java-version: '16' java-version: '17'
- name: Setup Selenium Webdriver - name: Setup Selenium Webdriver
uses: nanasess/setup-chromedriver@v1 uses: nanasess/setup-chromedriver@v1
- name: Setup Selenium Webdriver settings - name: Setup Selenium Webdriver settings

View File

@ -20,7 +20,7 @@ jobs:
uses: actions/setup-java@v2 uses: actions/setup-java@v2
with: with:
distribution: 'adopt' distribution: 'adopt'
java-version: '16' java-version: '17'
- name: Build Javadocs 🔧 - name: Build Javadocs 🔧
run: | run: |
cd Plan cd Plan

30
.gitignore vendored
View File

@ -12,6 +12,9 @@ server.log
**/.gradle **/.gradle
out/ out/
# Fabric
remappedSrc/
# Created by https://www.gitignore.io/api/maven,eclipse,intellij,netbeans,osx,windows,notepadpp,windows,java # Created by https://www.gitignore.io/api/maven,eclipse,intellij,netbeans,osx,windows,notepadpp,windows,java
### Maven ### ### Maven ###
@ -165,33 +168,6 @@ $RECYCLE.BIN/
# Windows shortcuts # Windows shortcuts
*.lnk *.lnk
### NotepadPP ###
# Notepad++ backups #
*.bak
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### Java ### ### Java ###
*.class *.class

View File

@ -12,6 +12,7 @@ plugins {
id "jacoco" id "jacoco"
id "checkstyle" id "checkstyle"
id "org.sonarqube" version "3.4.0.2513" id "org.sonarqube" version "3.4.0.2513"
id 'fabric-loom' version '0.12.+' apply false
} }
apply plugin: 'nebula-aggregate-javadocs' apply plugin: 'nebula-aggregate-javadocs'
@ -115,7 +116,6 @@ subprojects {
testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion" // JUnit 5 testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion" // JUnit 5
testImplementation "org.mockito:mockito-core:$mockitoVersion" // Mockito Core testImplementation "org.mockito:mockito-core:$mockitoVersion" // Mockito Core
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" // Mockito JUnit 5 Extension testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion" // Mockito JUnit 5 Extension
testImplementation "org.seleniumhq.selenium:selenium-java:4.2.1" // Selenium (Browser tests)
testImplementation "com.jayway.awaitility:awaitility:1.7.0" // Awaitility (Concurrent wait conditions) testImplementation "com.jayway.awaitility:awaitility:1.7.0" // Awaitility (Concurrent wait conditions)
// Testing dependencies required by Plan // Testing dependencies required by Plan

View File

@ -52,7 +52,7 @@ dependencies {
testImplementation project(":api") testImplementation project(":api")
testImplementation "com.google.code.gson:gson:$gsonVersion" testImplementation "com.google.code.gson:gson:$gsonVersion"
testImplementation "org.seleniumhq.selenium:selenium-java:4.2.1"
testImplementation "org.testcontainers:testcontainers:$testContainersVersion" testImplementation "org.testcontainers:testcontainers:$testContainersVersion"
testImplementation "org.testcontainers:junit-jupiter:$testContainersVersion" testImplementation "org.testcontainers:junit-jupiter:$testContainersVersion"
testImplementation "org.testcontainers:nginx:$testContainersVersion" testImplementation "org.testcontainers:nginx:$testContainersVersion"

View File

@ -1,8 +1,4 @@
import org.apache.tools.ant.filters.ReplaceTokens apply plugin: 'fabric-loom'
plugins {
id 'fabric-loom' version '0.9.+'
}
dependencies { dependencies {
shadow "net.playeranalytics:platform-abstraction-layer-api:$palVersion" shadow "net.playeranalytics:platform-abstraction-layer-api:$palVersion"
@ -11,42 +7,36 @@ dependencies {
compileOnly project(":api") compileOnly project(":api")
modImplementation('me.lucko:fabric-permissions-api:0.1-SNAPSHOT') modImplementation('me.lucko:fabric-permissions-api:0.1-SNAPSHOT')
minecraft "com.mojang:minecraft:1.17.1" minecraft "com.mojang:minecraft:1.19"
mappings "net.fabricmc:yarn:1.17.1+build.35:v2" mappings "net.fabricmc:yarn:1.19+build.1:v2"
modImplementation "net.fabricmc:fabric-loader:0.11.6" modImplementation "net.fabricmc:fabric-loader:0.14.7"
// Fabric API // Fabric API
Set<String> apiModules = [ Set<String> apiModules = [
'fabric-api-base', 'fabric-api-base',
'fabric-command-api-v1', 'fabric-command-api-v2',
'fabric-entity-events-v1', 'fabric-entity-events-v1',
'fabric-lifecycle-events-v1', 'fabric-lifecycle-events-v1',
'fabric-networking-api-v1' 'fabric-networking-api-v1'
] ]
apiModules.forEach { apiModules.forEach {
modImplementation(fabricApi.module(it, "0.37.1+1.17")) modImplementation(fabricApi.module(it, "0.55.3+1.19"))
} }
testImplementation project(path: ":common", configuration: 'testArtifacts') testImplementation project(path: ":common", configuration: 'testArtifacts')
} }
compileJava { tasks.withType(JavaCompile).configureEach {
options.release = 16 options.release = 17
}
tasks.register('updateVersion', Copy) {
from('src/main/resources') {
include 'fabric.mod.json'
}
into 'build/sources/resources/'
filter(ReplaceTokens, tokens: [version: '' + project.ext.fullVersion])
} }
processResources { processResources {
dependsOn updateVersion inputs.property "version", project.ext.fullVersion
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from 'build/sources/resources' filesMatching("fabric.mod.json") {
expand "version": project.ext.fullVersion
}
} }
shadowJar { shadowJar {

View File

@ -26,7 +26,7 @@ import com.djrapitops.plan.settings.locale.Locale;
import com.djrapitops.plan.settings.locale.lang.PluginLang; import com.djrapitops.plan.settings.locale.lang.PluginLang;
import com.djrapitops.plan.settings.theme.PlanColorScheme; import com.djrapitops.plan.settings.theme.PlanColorScheme;
import net.fabricmc.api.DedicatedServerModInitializer; import net.fabricmc.api.DedicatedServerModInitializer;
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.dedicated.MinecraftDedicatedServer; import net.minecraft.server.dedicated.MinecraftDedicatedServer;
@ -163,7 +163,7 @@ public class PlanFabric implements PlanPlugin, DedicatedServerModInitializer {
onEnable(); onEnable();
}); });
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> commandManager = new CommandManager(dispatcher, this)); CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> commandManager = new CommandManager(dispatcher, this));
ServerLifecycleEvents.SERVER_STOPPING.register(server -> onDisable()); ServerLifecycleEvents.SERVER_STOPPING.register(server -> onDisable());
} }

View File

@ -32,7 +32,7 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import me.lucko.fabric.api.permissions.v0.Permissions; import me.lucko.fabric.api.permissions.v0.Permissions;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.LiteralText; import net.minecraft.text.Text;
import net.playeranalytics.plan.PlanFabric; import net.playeranalytics.plan.PlanFabric;
import net.playeranalytics.plugin.scheduling.RunnableFactory; import net.playeranalytics.plugin.scheduling.RunnableFactory;
@ -82,9 +82,9 @@ public class CommandManager {
subcommand.getExecutor().accept((CMDSender) ctx.getSource(), new Arguments(getCommandArguments(ctx))); subcommand.getExecutor().accept((CMDSender) ctx.getSource(), new Arguments(getCommandArguments(ctx)));
} catch (Exception e) { } catch (Exception e) {
if (e instanceof IllegalArgumentException) { if (e instanceof IllegalArgumentException) {
ctx.getSource().sendError(new LiteralText(e.getMessage())); ctx.getSource().sendError(Text.literal(e.getMessage()));
} else { } else {
ctx.getSource().sendError(new LiteralText("An internal error occurred, see the console for details.")); ctx.getSource().sendError(Text.literal("An internal error occurred, see the console for details."));
plugin.getSystem().getErrorLogger().error(e, ErrorContext.builder() plugin.getSystem().getErrorLogger().error(e, ErrorContext.builder()
.related(ctx.getSource().getClass()) .related(ctx.getSource().getClass())
.related(subcommand.getPrimaryAlias() + " " + getCommandArguments(ctx)) .related(subcommand.getPrimaryAlias() + " " + getCommandArguments(ctx))

View File

@ -19,7 +19,10 @@ package net.playeranalytics.plan.commands.use;
import com.djrapitops.plan.commands.use.CMDSender; import com.djrapitops.plan.commands.use.CMDSender;
import com.djrapitops.plan.commands.use.MessageBuilder; import com.djrapitops.plan.commands.use.MessageBuilder;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.*; import net.minecraft.text.ClickEvent;
import net.minecraft.text.HoverEvent;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import org.apache.commons.text.TextStringBuilder; import org.apache.commons.text.TextStringBuilder;
import java.util.Collection; import java.util.Collection;
@ -36,7 +39,7 @@ public class FabricMessageBuilder implements MessageBuilder {
FabricMessageBuilder(ServerCommandSource sender, FabricMessageBuilder previous) { FabricMessageBuilder(ServerCommandSource sender, FabricMessageBuilder previous) {
this.sender = sender; this.sender = sender;
this.builder = new LiteralText(""); this.builder = Text.literal("");
this.previous = previous; this.previous = previous;
} }
@ -67,19 +70,19 @@ public class FabricMessageBuilder implements MessageBuilder {
@Override @Override
public MessageBuilder hover(String message) { public MessageBuilder hover(String message) {
builder.styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText(message)))); builder.styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal(message))));
return this; return this;
} }
@Override @Override
public MessageBuilder hover(String... lines) { public MessageBuilder hover(String... lines) {
builder.styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText(new TextStringBuilder().appendWithSeparators(lines, "\n").toString())))); builder.styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal(new TextStringBuilder().appendWithSeparators(lines, "\n").toString()))));
return this; return this;
} }
@Override @Override
public MessageBuilder hover(Collection<String> lines) { public MessageBuilder hover(Collection<String> lines) {
builder.styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new LiteralText(new TextStringBuilder().appendWithSeparators(lines, "\n").toString())))); builder.styled(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal(new TextStringBuilder().appendWithSeparators(lines, "\n").toString()))));
return this; return this;
} }

View File

@ -23,13 +23,13 @@ import net.playeranalytics.plan.gathering.listeners.events.PlanFabricEvents;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(Entity.class) @Mixin(Entity.class)
public class EntityMixin { public class EntityMixin {
@Inject(method = "onKilledOther", at = @At(value = "TAIL")) @Inject(method = "onKilledOther", at = @At(value = "TAIL"))
public void onDeath(ServerWorld world, LivingEntity other, CallbackInfo ci) { public void onDeath(ServerWorld world, LivingEntity other, CallbackInfoReturnable<Boolean> cir) {
PlanFabricEvents.ON_KILLED.invoker().onKilled(other, (Entity) (Object) this); PlanFabricEvents.ON_KILLED.invoker().onKilled(other, (Entity) (Object) this);
} }

View File

@ -23,13 +23,13 @@ import net.playeranalytics.plan.gathering.listeners.events.PlanFabricEvents;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PlayerEntity.class) @Mixin(PlayerEntity.class)
public class PlayerEntityMixin { public class PlayerEntityMixin {
@Inject(method = "onKilledOther", at = @At(value = "TAIL")) @Inject(method = "onKilledOther", at = @At("TAIL"))
public void onDeath(ServerWorld world, LivingEntity other, CallbackInfo ci) { public void onDeath(ServerWorld world, LivingEntity other, CallbackInfoReturnable<Boolean> cir) {
PlanFabricEvents.ON_KILLED.invoker().onKilled(other, (PlayerEntity) (Object) this); PlanFabricEvents.ON_KILLED.invoker().onKilled(other, (PlayerEntity) (Object) this);
} }

View File

@ -20,7 +20,6 @@ import com.djrapitops.plan.commands.use.*;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.playeranalytics.plan.commands.CommandManager; import net.playeranalytics.plan.commands.CommandManager;
import net.playeranalytics.plan.commands.use.FabricMessageBuilder; import net.playeranalytics.plan.commands.use.FabricMessageBuilder;
@ -73,7 +72,7 @@ public abstract class ServerCommandSourceMixin implements CMDSender {
@Override @Override
public void send(String message) { public void send(String message) {
this.sendFeedback(new LiteralText(message), false); this.sendFeedback(Text.literal(message), false);
} }
@Override @Override

View File

@ -28,12 +28,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ServerPlayNetworkHandler.class) @Mixin(ServerPlayNetworkHandler.class)
public class ServerPlayNetworkHandlerMixin { public class ServerPlayNetworkHandlerMixin {
@Inject(method = "onGameMessage", at = @At(value = "INVOKE", target = "Ljava/lang/String;startsWith(Ljava/lang/String;)Z")) @Inject(method = "onChatMessage", at = @At("TAIL"))
public void onChatMessage(ChatMessageC2SPacket packet, CallbackInfo ci) { public void onChatMessage(ChatMessageC2SPacket packet, CallbackInfo ci) {
PlanFabricEvents.ON_CHAT.invoker().onChat((ServerPlayNetworkHandler) (Object) this, packet.getChatMessage()); PlanFabricEvents.ON_CHAT.invoker().onChat((ServerPlayNetworkHandler) (Object) this, packet.getChatMessage());
} }
@Inject(method = "onPlayerMove", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;getServerWorld()Lnet/minecraft/server/world/ServerWorld;")) @Inject(method = "onPlayerMove", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayerEntity;getWorld()Lnet/minecraft/server/world/ServerWorld;"))
public void onPlayerMove(PlayerMoveC2SPacket packet, CallbackInfo ci) { public void onPlayerMove(PlayerMoveC2SPacket packet, CallbackInfo ci) {
PlanFabricEvents.ON_MOVE.invoker().onMove((ServerPlayNetworkHandler) (Object) this, packet); PlanFabricEvents.ON_MOVE.invoker().onMove((ServerPlayNetworkHandler) (Object) this, packet);
} }

View File

@ -72,7 +72,7 @@ public class ChatListener implements FabricListener {
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
ServerPlayerEntity player = handler.player; ServerPlayerEntity player = handler.player;
UUID uuid = player.getUuid(); UUID uuid = player.getUuid();
String displayName = player.getDisplayName().asString(); String displayName = player.getDisplayName().getString();
dbSystem.getDatabase().executeTransaction(new NicknameStoreTransaction( dbSystem.getDatabase().executeTransaction(new NicknameStoreTransaction(
uuid, new Nickname(displayName, time, serverInfo.getServerUUID()), uuid, new Nickname(displayName, time, serverInfo.getServerUUID()),

View File

@ -89,11 +89,11 @@ public class DeathEventListener implements FabricListener {
} }
private PlayerKill.Killer getKiller(ServerPlayerEntity killer) { private PlayerKill.Killer getKiller(ServerPlayerEntity killer) {
return new PlayerKill.Killer(killer.getUuid(), killer.getName().asString()); return new PlayerKill.Killer(killer.getUuid(), killer.getName().getString());
} }
private PlayerKill.Victim getVictim(ServerPlayerEntity victim) { private PlayerKill.Victim getVictim(ServerPlayerEntity victim) {
return new PlayerKill.Victim(victim.getUuid(), victim.getName().asString()); return new PlayerKill.Victim(victim.getUuid(), victim.getName().getString());
} }
public Optional<ServerPlayerEntity> getCause(Entity killer) { public Optional<ServerPlayerEntity> getCause(Entity killer) {
@ -107,12 +107,12 @@ public class DeathEventListener implements FabricListener {
if (killer instanceof ServerPlayerEntity) return getItemInHand((ServerPlayerEntity) killer); if (killer instanceof ServerPlayerEntity) return getItemInHand((ServerPlayerEntity) killer);
// Projectile, EnderCrystal and all other causes that are not known yet // Projectile, EnderCrystal and all other causes that are not known yet
return new EntityNameFormatter().apply(killer.getType().getName().asString()); return new EntityNameFormatter().apply(killer.getType().getName().getString());
} }
private String getItemInHand(ServerPlayerEntity killer) { private String getItemInHand(ServerPlayerEntity killer) {
ItemStack itemInHand = killer.getMainHandStack(); ItemStack itemInHand = killer.getMainHandStack();
return itemInHand.getItem().getName().asString(); return itemInHand.getItem().getName().getString();
} }
private Optional<ServerPlayerEntity> getShooter(ProjectileEntity projectile) { private Optional<ServerPlayerEntity> getShooter(ProjectileEntity projectile) {

View File

@ -72,7 +72,7 @@ public class GameModeChangeListener implements FabricListener {
UUID uuid = player.getUuid(); UUID uuid = player.getUuid();
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
String gameMode = newGameMode.name(); String gameMode = newGameMode.name();
String worldName = player.getServerWorld().getRegistryKey().getValue().toString(); String worldName = player.getWorld().getRegistryKey().getValue().toString();
dbSystem.getDatabase().executeTransaction(new WorldNameStoreTransaction(serverInfo.getServerUUID(), worldName)); dbSystem.getDatabase().executeTransaction(new WorldNameStoreTransaction(serverInfo.getServerUUID(), worldName));
worldAliasSettings.addWorld(worldName); worldAliasSettings.addWorld(worldName);

View File

@ -179,7 +179,7 @@ public class PlayerOnlineListener implements FabricListener {
FabricAFKListener.afkTracker.performedAction(playerUUID, time); FabricAFKListener.afkTracker.performedAction(playerUUID, time);
String world = player.getServerWorld().getRegistryKey().getValue().toString(); String world = player.getWorld().getRegistryKey().getValue().toString();
String gm = player.interactionManager.getGameMode().name(); String gm = player.interactionManager.getGameMode().name();
Database database = dbSystem.getDatabase(); Database database = dbSystem.getDatabase();
@ -188,7 +188,7 @@ public class PlayerOnlineListener implements FabricListener {
Supplier<String> getHostName = () -> getHostname(player); Supplier<String> getHostName = () -> getHostname(player);
String playerName = player.getEntityName(); String playerName = player.getEntityName();
String displayName = player.getDisplayName().asString(); String displayName = player.getDisplayName().getString();
database.executeTransaction(new PlayerServerRegisterTransaction(playerUUID, database.executeTransaction(new PlayerServerRegisterTransaction(playerUUID,
@ -199,7 +199,7 @@ public class PlayerOnlineListener implements FabricListener {
gatherGeolocation(player, playerUUID, time, database); gatherGeolocation(player, playerUUID, time, database);
} }
database.executeTransaction(new OperatorStatusTransaction(playerUUID, serverUUID, server.getPlayerManager().getOpList().isOp(player.getGameProfile()))); database.executeTransaction(new OperatorStatusTransaction(playerUUID, serverUUID, server.getPlayerManager().getOpList().get(player.getGameProfile()) != null));
ActiveSession session = new ActiveSession(playerUUID, serverUUID, time, world, gm); ActiveSession session = new ActiveSession(playerUUID, serverUUID, time, world, gm);
session.getExtraData().put(PlayerName.class, new PlayerName(playerName)); session.getExtraData().put(PlayerName.class, new PlayerName(playerName));

View File

@ -67,7 +67,7 @@ public class WorldChangeListener implements FabricListener {
UUID uuid = player.getUuid(); UUID uuid = player.getUuid();
String worldName = player.getServerWorld().getRegistryKey().getValue().toString(); String worldName = player.getWorld().getRegistryKey().getValue().toString();
String gameMode = player.interactionManager.getGameMode().name(); String gameMode = player.interactionManager.getGameMode().name();
dbSystem.getDatabase().executeTransaction(new WorldNameStoreTransaction(serverInfo.getServerUUID(), worldName)); dbSystem.getDatabase().executeTransaction(new WorldNameStoreTransaction(serverInfo.getServerUUID(), worldName));

View File

@ -2,8 +2,7 @@
"schemaVersion": 1, "schemaVersion": 1,
"id": "plan", "id": "plan",
"name": "Plan", "name": "Plan",
"version": "@version@", "version": "${version}",
"environment": "server", "environment": "server",
"entrypoints": { "entrypoints": {
"server": [ "server": [
@ -14,10 +13,10 @@
"plan.mixins.json" "plan.mixins.json"
], ],
"depends": { "depends": {
"minecraft": ">=1.17", "minecraft": ">=1.19",
"java": ">=16", "java": ">=17",
"fabric-api-base": "*", "fabric-api-base": "*",
"fabric-command-api-v1": "*", "fabric-command-api-v2": "*",
"fabric-entity-events-v1": "*", "fabric-entity-events-v1": "*",
"fabric-lifecycle-events-v1": "*", "fabric-lifecycle-events-v1": "*",
"fabric-networking-v0": "*" "fabric-networking-v0": "*"

View File

@ -2,7 +2,7 @@
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "net.playeranalytics.plan.gathering.listeners.events.mixin", "package": "net.playeranalytics.plan.gathering.listeners.events.mixin",
"compatibilityLevel": "JAVA_16", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [
"EntityMixin", "EntityMixin",
"KickCommandMixin", "KickCommandMixin",

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -4,6 +4,7 @@ pluginManagement {
name = 'Fabric' name = 'Fabric'
url = 'https://maven.fabricmc.net/' url = 'https://maven.fabricmc.net/'
} }
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
} }
} }