Forge 1.19 (#3397)

This commit is contained in:
Alex Thomson 2022-07-25 03:06:32 +12:00 committed by GitHub
parent 48e5f428b5
commit ad08b158f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 25 deletions

View File

@ -1,2 +1,2 @@
minecraftVersion=1.18.2
forgeVersion=40.1.20
minecraftVersion=1.19
forgeVersion=41.0.19

View File

@ -1,5 +1,5 @@
modLoader="javafml"
loaderVersion="[40,)"
loaderVersion="[41,)"
license="MIT"
issueTrackerURL="https://github.com/LuckPerms/LuckPerms/issues"
@ -11,10 +11,4 @@ issueTrackerURL="https://github.com/LuckPerms/LuckPerms/issues"
logoFile="luckperms.png"
credits="Luck"
authors="Luck"
description="A permissions plugin for Minecraft servers."
[[dependencies.luckperms]]
modId="forge"
mandatory=true
versionRange="[40.1.20,)"
ordering="NONE"
side="BOTH"
description="A permissions plugin for Minecraft servers."

View File

@ -1,6 +1,6 @@
{
"pack": {
"description": "LuckPerms resources",
"pack_format": 8
"pack_format": 9
}
}

View File

@ -37,13 +37,10 @@ import me.lucko.luckperms.forge.LPForgePlugin;
import me.lucko.luckperms.forge.capabilities.UserCapabilityImpl;
import net.kyori.adventure.text.Component;
import net.minecraft.Util;
import net.minecraft.core.UUIDUtil;
import net.minecraft.network.Connection;
import net.minecraft.network.chat.ChatType;
import net.minecraft.network.protocol.game.ClientboundChatPacket;
import net.minecraft.network.protocol.login.ClientboundLoginDisconnectPacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerNegotiationEvent;
import net.minecraftforge.eventbus.api.EventPriority;
@ -63,7 +60,7 @@ public class ForgeConnectionListener extends AbstractConnectionListener {
@SubscribeEvent
public void onPlayerNegotiation(PlayerNegotiationEvent event) {
String username = event.getProfile().getName();
UUID uniqueId = event.getProfile().isComplete() ? event.getProfile().getId() : Player.createPlayerUUID(username);
UUID uniqueId = event.getProfile().isComplete() ? event.getProfile().getId() : UUIDUtil.createOfflinePlayerUUID(username);
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
this.plugin.getLogger().info("Processing pre-login (sync phase) for " + uniqueId + " - " + username);
@ -99,15 +96,8 @@ public class ForgeConnectionListener extends AbstractConnectionListener {
Component component = TranslationManager.render(Message.LOADING_DATABASE_ERROR.build());
connection.send(new ClientboundLoginDisconnectPacket(ForgeSenderFactory.toNativeText(component)));
connection.disconnect(ForgeSenderFactory.toNativeText(component));
} else {
// Schedule the message to be sent on the next tick.
this.plugin.getBootstrap().getServer().orElseThrow(IllegalStateException::new).execute(() -> {
Component component = TranslationManager.render(Message.LOADING_STATE_ERROR.build());
connection.send(new ClientboundChatPacket(ForgeSenderFactory.toNativeText(component), ChatType.SYSTEM, Util.NIL_UUID));
});
this.plugin.getEventDispatcher().dispatchPlayerLoginProcess(uniqueId, username, null);
}
this.plugin.getEventDispatcher().dispatchPlayerLoginProcess(uniqueId, username, null);
}
}
@ -135,7 +125,7 @@ public class ForgeConnectionListener extends AbstractConnectionListener {
if (this.plugin.getConfiguration().get(ConfigKeys.CANCEL_FAILED_LOGINS)) {
player.connection.disconnect(ForgeSenderFactory.toNativeText(component));
} else {
player.sendMessage(ForgeSenderFactory.toNativeText(component), Util.NIL_UUID);
player.sendSystemMessage(ForgeSenderFactory.toNativeText(component));
}
}