mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-30 04:19:30 +00:00
feat: fix some error
This commit is contained in:
@@ -13,6 +13,7 @@ import com.mojang.authlib.yggdrasil.response.HasJoinedMinecraftServerResponse;
|
||||
import com.mojang.authlib.yggdrasil.response.ProfileAction;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.players.NameAndId;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.leavesmc.leaves.LeavesConfig;
|
||||
import org.leavesmc.leaves.bot.ServerBot;
|
||||
@@ -63,9 +64,9 @@ public class LeavesMinecraftSessionService extends PaperMinecraftSessionService
|
||||
arguments.put("ip", address.getHostAddress());
|
||||
}
|
||||
|
||||
GameProfile cache = null;
|
||||
NameAndId cache = null;
|
||||
if (LeavesConfig.mics.yggdrasil.loginProtect) {
|
||||
cache = MinecraftServer.getServer().services.profileCache().getProfileIfCached(profileName);
|
||||
cache = MinecraftServer.getServer().services.nameToIdCache().getIfCached(profileName);
|
||||
}
|
||||
|
||||
for (URL checkUrl : extraYggdrasilList) {
|
||||
|
||||
@@ -13,6 +13,8 @@ import org.leavesmc.leaves.protocol.jade.accessor.BlockAccessor;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.ItemStorageProvider;
|
||||
import org.leavesmc.leaves.protocol.jade.provider.StreamServerDataProvider;
|
||||
|
||||
import static net.minecraft.world.level.block.CampfireBlock.FACING;
|
||||
|
||||
public enum ChiseledBookshelfProvider implements StreamServerDataProvider<BlockAccessor, ItemStack> {
|
||||
INSTANCE;
|
||||
|
||||
@@ -20,7 +22,7 @@ public enum ChiseledBookshelfProvider implements StreamServerDataProvider<BlockA
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack streamData(@NotNull BlockAccessor accessor) {
|
||||
int slot = ((ChiseledBookShelfBlock) accessor.getBlock()).getHitSlot(accessor.getHitResult(), accessor.getBlockState()).orElse(-1);
|
||||
int slot = ((ChiseledBookShelfBlock) accessor.getBlock()).getHitSlot(accessor.getHitResult(), accessor.getBlockState().getValue(FACING)).orElse(-1);
|
||||
if (slot == -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package org.leavesmc.leaves.protocol.jade.util;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.boss.EnderDragonPart;
|
||||
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
|
||||
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.leavesmc.leaves.LeavesLogger;
|
||||
import org.leavesmc.leaves.protocol.jade.accessor.Accessor;
|
||||
@@ -47,7 +47,7 @@ public class CommonUtil {
|
||||
if (uuid == null) {
|
||||
return null;
|
||||
}
|
||||
Optional<GameProfile> optional = SkullBlockEntity.fetchGameProfile(String.valueOf(uuid)).getNow(Optional.empty());
|
||||
Optional<GameProfile> optional = MinecraftServer.getServer().services.profileResolver().fetchById(uuid);
|
||||
return optional.map(GameProfile::name).orElse(null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user