mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-28 01:05:36 +00:00
Update to Minecraft 1.21.9
This commit is contained in:
14 files changed
+41
-37
No files matched your search
+5
-5
@@ -13,9 +13,9 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
// https://modmuss50.me/fabric.html
|
||||
minecraft 'com.mojang:minecraft:1.21.8'
|
||||
mappings 'net.fabricmc:yarn:1.21.8+build.1:v2'
|
||||
modImplementation 'net.fabricmc:fabric-loader:0.16.14'
|
||||
minecraft 'com.mojang:minecraft:1.21.9'
|
||||
mappings 'net.fabricmc:yarn:1.21.9+build.1:v2'
|
||||
modImplementation 'net.fabricmc:fabric-loader:0.17.2'
|
||||
|
||||
Set<String> apiModules = [
|
||||
'fabric-api-base',
|
||||
@@ -26,10 +26,10 @@ dependencies {
|
||||
]
|
||||
|
||||
apiModules.forEach {
|
||||
modImplementation(fabricApi.module(it, '0.129.0+1.21.8'))
|
||||
modImplementation(fabricApi.module(it, '0.133.14+1.21.9'))
|
||||
}
|
||||
|
||||
include(modImplementation('me.lucko:fabric-permissions-api:0.4.1'))
|
||||
include(modImplementation('me.lucko:fabric-permissions-api:0.5.0'))
|
||||
|
||||
implementation project(':common')
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.ModContainer;
|
||||
import net.luckperms.api.platform.Platform;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.PlayerConfigEntry;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
||||
@@ -232,13 +233,13 @@ public final class LPFabricBootstrap implements LuckPermsBootstrap, DedicatedSer
|
||||
|
||||
@Override
|
||||
public Optional<UUID> lookupUniqueId(String username) {
|
||||
return getServer().map(MinecraftServer::getUserCache).flatMap(c -> c.findByName(username)).map(GameProfile::getId);
|
||||
return getServer().map(s -> s.getApiServices().nameToIdCache()).flatMap(c -> c.findByName(username)).map(PlayerConfigEntry::id);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<String> lookupUsername(UUID uniqueId) {
|
||||
return getServer().map(MinecraftServer::getUserCache).flatMap(c -> c.getByUuid(uniqueId)).map(GameProfile::getName);
|
||||
return getServer().map(s -> s.getApiServices().nameToIdCache()).flatMap(c -> c.getByUuid(uniqueId)).map(PlayerConfigEntry::name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -253,7 +254,7 @@ public final class LPFabricBootstrap implements LuckPermsBootstrap, DedicatedSer
|
||||
List<ServerPlayerEntity> players = server.getPlayerList();
|
||||
List<String> list = new ArrayList<>(players.size());
|
||||
for (ServerPlayerEntity player : players) {
|
||||
list.add(player.getGameProfile().getName());
|
||||
list.add(player.getGameProfile().name());
|
||||
}
|
||||
return list;
|
||||
})
|
||||
@@ -267,7 +268,7 @@ public final class LPFabricBootstrap implements LuckPermsBootstrap, DedicatedSer
|
||||
List<ServerPlayerEntity> players = server.getPlayerList();
|
||||
List<UUID> list = new ArrayList<>(players.size());
|
||||
for (ServerPlayerEntity player : players) {
|
||||
list.add(player.getGameProfile().getId());
|
||||
list.add(player.getGameProfile().id());
|
||||
}
|
||||
return list;
|
||||
})
|
||||
|
||||
@@ -57,7 +57,7 @@ public class FabricContextManager extends DetachedContextManager<ServerPlayerEnt
|
||||
|
||||
@Override
|
||||
public void customizeQueryOptions(ServerPlayerEntity subject, QueryOptions.Builder builder) {
|
||||
if (subject.getServer().isHost(subject.getGameProfile())) {
|
||||
if (subject.getEntityWorld().getServer().isHost(subject.getPlayerConfigEntry())) {
|
||||
builder.option(INTEGRATED_SERVER_OWNER, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class FabricPlayerCalculator implements ContextCalculator<ServerPlayerEnt
|
||||
}
|
||||
|
||||
// TODO: figure out dimension type context too
|
||||
ServerWorld world = target.getWorld();
|
||||
ServerWorld world = target.getEntityWorld();
|
||||
if (this.world) {
|
||||
this.plugin.getConfiguration().get(ConfigKeys.WORLD_REWRITES).rewriteAndSubmit(getContextKey(world.getRegistryKey().getValue()), consumer);
|
||||
}
|
||||
|
||||
@@ -87,9 +87,9 @@ public class FabricAutoOpListener implements LuckPermsEventListener {
|
||||
private void setOp(ServerPlayerEntity player, boolean value) {
|
||||
this.plugin.getBootstrap().getServer().ifPresent(server -> {
|
||||
if (value) {
|
||||
server.getPlayerManager().addToOperators(player.getGameProfile());
|
||||
server.getPlayerManager().addToOperators(player.getPlayerConfigEntry());
|
||||
} else {
|
||||
server.getPlayerManager().removeFromOperators(player.getGameProfile());
|
||||
server.getPlayerManager().removeFromOperators(player.getPlayerConfigEntry());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+4
-4
@@ -67,8 +67,8 @@ public class FabricConnectionListener extends AbstractConnectionListener {
|
||||
|
||||
// Get their profile from the net handler - it should have been initialised by now.
|
||||
GameProfile profile = ((ServerLoginNetworkHandlerAccessor) netHandler).getGameProfile();
|
||||
UUID uniqueId = profile.getId();
|
||||
String username = profile.getName();
|
||||
UUID uniqueId = profile.id();
|
||||
String username = profile.name();
|
||||
|
||||
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||
this.plugin.getLogger().info("Processing pre-login (sync phase) for " + uniqueId + " - " + username);
|
||||
@@ -110,14 +110,14 @@ public class FabricConnectionListener extends AbstractConnectionListener {
|
||||
final ServerPlayerEntity player = netHandler.player;
|
||||
|
||||
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
|
||||
this.plugin.getLogger().info("Processing login for " + player.getUuid() + " - " + player.getGameProfile().getName());
|
||||
this.plugin.getLogger().info("Processing login for " + player.getUuid() + " - " + player.getGameProfile().name());
|
||||
}
|
||||
|
||||
final User user = this.plugin.getUserManager().getIfLoaded(player.getUuid());
|
||||
|
||||
/* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */
|
||||
if (user == null) {
|
||||
this.plugin.getLogger().warn("User " + player.getUuid() + " - " + player.getGameProfile().getName() +
|
||||
this.plugin.getLogger().warn("User " + player.getUuid() + " - " + player.getGameProfile().id() +
|
||||
" doesn't currently have data pre-loaded - denying login.");
|
||||
Component reason = TranslationManager.render(Message.LOADING_STATE_ERROR.build());
|
||||
netHandler.disconnect(FabricSenderFactory.toNativeText(reason));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[versions]
|
||||
shadow = "8.3.8"
|
||||
blossom = "1.3.1"
|
||||
moddevgradle = "2.0.103"
|
||||
moddevgradle = "2.0.110"
|
||||
forgegradle = "[6.0,6.2)"
|
||||
loom = "1.11-SNAPSHOT"
|
||||
licenser = "0.6.1"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
minecraftVersion=1.21.8
|
||||
neoForgeVersion=21.8.4-beta
|
||||
minecraftVersion=1.21.9
|
||||
neoForgeVersion=21.9.2-beta
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class NeoForgeLoaderPlugin implements Supplier<ModContainer> {
|
||||
public NeoForgeLoaderPlugin(final ModContainer modContainer, final IEventBus modBus) {
|
||||
this.container = modContainer;
|
||||
|
||||
if (FMLEnvironment.dist.isClient()) {
|
||||
if (FMLEnvironment.getDist().isClient()) {
|
||||
LOGGER.info("Skipping LuckPerms init (not supported on the client!)");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ import me.lucko.luckperms.neoforge.util.NeoForgeEventBusFacade;
|
||||
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.neoforged.bus.api.EventPriority;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
@@ -244,12 +245,12 @@ public final class LPNeoForgeBootstrap implements LuckPermsBootstrap, LoaderBoot
|
||||
|
||||
@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
|
||||
@@ -262,7 +263,7 @@ public final class LPNeoForgeBootstrap implements LuckPermsBootstrap, LoaderBoot
|
||||
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());
|
||||
@@ -273,7 +274,7 @@ public final class LPNeoForgeBootstrap implements LuckPermsBootstrap, LoaderBoot
|
||||
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());
|
||||
|
||||
+3
-1
@@ -29,6 +29,7 @@ import me.lucko.luckperms.common.context.manager.SimpleContextManager;
|
||||
import me.lucko.luckperms.neoforge.LPNeoForgePlugin;
|
||||
import net.luckperms.api.query.OptionKey;
|
||||
import net.luckperms.api.query.QueryOptions;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
@@ -47,7 +48,8 @@ public class NeoForgeContextManager extends SimpleContextManager<ServerPlayer, S
|
||||
|
||||
@Override
|
||||
public void customizeQueryOptions(ServerPlayer subject, QueryOptions.Builder builder) {
|
||||
if (subject.getServer() != null && subject.getServer().isSingleplayerOwner(subject.getGameProfile())) {
|
||||
MinecraftServer server = subject.level().getServer();
|
||||
if (server != null && server.isSingleplayerOwner(subject.nameAndId())) {
|
||||
builder.option(INTEGRATED_SERVER_OWNER, true);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -87,9 +87,9 @@ public class NeoForgeAutoOpListener 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());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ public class NeoForgeCommandListUpdater 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);
|
||||
}
|
||||
|
||||
+8
-8
@@ -70,8 +70,8 @@ public class NeoForgeConnectionListener 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 NeoForgeConnectionListener 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 NeoForgeConnectionListener extends AbstractConnectionListener {
|
||||
@SubscribeEvent(priority = EventPriority.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