mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-23 20:39:38 +00:00
Update Forge module to Minecraft 1.21.9
This commit is contained in:
7 files changed
+20
-19
No files matched your search
+1
-1
@@ -18,7 +18,7 @@ minecraft {
|
||||
|
||||
dependencies {
|
||||
minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}"
|
||||
annotationProcessor 'net.minecraftforge:eventbus-validator:7.0-beta.7'
|
||||
annotationProcessor 'net.minecraftforge:eventbus-validator:7.0-beta.10'
|
||||
implementation project(':common')
|
||||
compileOnly project(':common:loader-utils')
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
minecraftVersion=1.21.8
|
||||
forgeVersion=58.0.0
|
||||
minecraftVersion=1.21.9
|
||||
forgeVersion=59.0.1
|
||||
@@ -37,6 +37,7 @@ import me.lucko.luckperms.common.plugin.scheduler.SchedulerAdapter;
|
||||
import net.luckperms.api.platform.Platform;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.players.NameAndId;
|
||||
import net.minecraft.server.players.PlayerList;
|
||||
import net.minecraftforge.event.server.ServerAboutToStartEvent;
|
||||
import net.minecraftforge.event.server.ServerStoppingEvent;
|
||||
@@ -254,12 +255,12 @@ public final class LPForgeBootstrap implements LuckPermsBootstrap, LoaderBootstr
|
||||
|
||||
@Override
|
||||
public Optional<UUID> lookupUniqueId(String username) {
|
||||
return getServer().map(MinecraftServer::getProfileCache).flatMap(profileCache -> profileCache.get(username)).map(GameProfile::getId);
|
||||
return getServer().map(s -> s.services().nameToIdCache()).flatMap(profileCache -> profileCache.get(username)).map(NameAndId::id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<String> lookupUsername(UUID uniqueId) {
|
||||
return getServer().map(MinecraftServer::getProfileCache).flatMap(profileCache -> profileCache.get(uniqueId)).map(GameProfile::getName);
|
||||
return getServer().map(s -> s.services().nameToIdCache()).flatMap(profileCache -> profileCache.get(uniqueId)).map(NameAndId::name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -272,7 +273,7 @@ public final class LPForgeBootstrap implements LuckPermsBootstrap, LoaderBootstr
|
||||
return getServer().map(MinecraftServer::getPlayerList).map(PlayerList::getPlayers).map(players -> {
|
||||
List<String> list = new ArrayList<>(players.size());
|
||||
for (ServerPlayer player : players) {
|
||||
list.add(player.getGameProfile().getName());
|
||||
list.add(player.getGameProfile().name());
|
||||
}
|
||||
return list;
|
||||
}).orElse(Collections.emptyList());
|
||||
@@ -283,7 +284,7 @@ public final class LPForgeBootstrap implements LuckPermsBootstrap, LoaderBootstr
|
||||
return getServer().map(MinecraftServer::getPlayerList).map(PlayerList::getPlayers).map(players -> {
|
||||
List<UUID> list = new ArrayList<>(players.size());
|
||||
for (ServerPlayer player : players) {
|
||||
list.add(player.getGameProfile().getId());
|
||||
list.add(player.getGameProfile().id());
|
||||
}
|
||||
return list;
|
||||
}).orElse(Collections.emptyList());
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ForgeContextManager extends SimpleContextManager<ServerPlayer, Serv
|
||||
|
||||
@Override
|
||||
public void customizeQueryOptions(ServerPlayer subject, QueryOptions.Builder builder) {
|
||||
if (subject.getServer() != null && subject.getServer().isSingleplayerOwner(subject.getGameProfile())) {
|
||||
if (subject.level().getServer() != null && subject.level().getServer().isSingleplayerOwner(subject.nameAndId())) {
|
||||
builder.option(INTEGRATED_SERVER_OWNER, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,9 +87,9 @@ public class ForgeAutoOpListener implements LuckPermsEventListener {
|
||||
private void setOp(ServerPlayer player, boolean value) {
|
||||
this.plugin.getBootstrap().getServer().ifPresent(server -> {
|
||||
if (value) {
|
||||
server.getPlayerList().op(player.getGameProfile());
|
||||
server.getPlayerList().op(player.nameAndId());
|
||||
} else {
|
||||
server.getPlayerList().deop(player.getGameProfile());
|
||||
server.getPlayerList().deop(player.nameAndId());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class ForgeCommandListUpdater implements LuckPermsEventListener {
|
||||
private void sendUpdate(UUID uniqueId) {
|
||||
this.plugin.getBootstrap().getScheduler().sync().execute(() -> {
|
||||
this.plugin.getBootstrap().getPlayer(uniqueId).ifPresent(player -> {
|
||||
MinecraftServer server = player.getServer();
|
||||
MinecraftServer server = player.level().getServer();
|
||||
if (server != null) {
|
||||
server.getPlayerList().sendPlayerPermissionLevel(player);
|
||||
}
|
||||
|
||||
@@ -71,8 +71,8 @@ public class ForgeConnectionListener extends AbstractConnectionListener {
|
||||
return;
|
||||
}
|
||||
|
||||
String username = gameProfile.getName();
|
||||
UUID uniqueId = gameProfile.getId();
|
||||
String username = gameProfile.name();
|
||||
UUID uniqueId = gameProfile.id();
|
||||
|
||||
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||
this.plugin.getLogger().info("Processing pre-login (sync phase) for " + uniqueId + " - " + username);
|
||||
@@ -122,17 +122,17 @@ public class ForgeConnectionListener extends AbstractConnectionListener {
|
||||
GameProfile profile = player.getGameProfile();
|
||||
|
||||
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||
this.plugin.getLogger().info("Processing post-login for " + profile.getId() + " - " + profile.getName());
|
||||
this.plugin.getLogger().info("Processing post-login for " + profile.id() + " - " + profile.name());
|
||||
}
|
||||
|
||||
User user = this.plugin.getUserManager().getIfLoaded(profile.getId());
|
||||
User user = this.plugin.getUserManager().getIfLoaded(profile.id());
|
||||
|
||||
if (user == null) {
|
||||
if (!getUniqueConnections().contains(profile.getId())) {
|
||||
this.plugin.getLogger().warn("User " + profile.getId() + " - " + profile.getName() +
|
||||
if (!getUniqueConnections().contains(profile.id())) {
|
||||
this.plugin.getLogger().warn("User " + profile.id() + " - " + profile.name() +
|
||||
" doesn't have data pre-loaded, they have never been processed during pre-login in this session.");
|
||||
} else {
|
||||
this.plugin.getLogger().warn("User " + profile.getId() + " - " + profile.getName() +
|
||||
this.plugin.getLogger().warn("User " + profile.id() + " - " + profile.name() +
|
||||
" doesn't currently have data pre-loaded, but they have been processed before in this session.");
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class ForgeConnectionListener extends AbstractConnectionListener {
|
||||
@SubscribeEvent(priority = Priority.LOWEST)
|
||||
public void onPlayerLoggedOut(PlayerEvent.PlayerLoggedOutEvent event) {
|
||||
ServerPlayer player = (ServerPlayer) event.getEntity();
|
||||
handleDisconnect(player.getGameProfile().getId());
|
||||
handleDisconnect(player.getGameProfile().id());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user