Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
bigguy345 committed 2025-07-07 22:40:10 +03:00
commit aec11c617b
4 files changed
+21 -4

No files matched your search

@@ -4,6 +4,7 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import kamkeel.npcs.controllers.data.attribute.requirement.IRequirementChecker;
import kamkeel.npcs.controllers.ProfileController;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
@@ -83,7 +84,25 @@ public class SoulbindRequirement implements IRequirementChecker {
@Override
public void apply(NBTTagCompound nbt, Object value) {
if (value instanceof String) {
nbt.setString(getKey(), (String) value);
String entry = (String) value;
if (entry.isEmpty())
return;
// Check if the provided value is already a valid UUID
UUID uuid = null;
try {
uuid = UUID.fromString(entry);
} catch (Exception ignored) {
}
// If not a UUID, attempt to treat the value as a username
if (uuid == null) {
uuid = ProfileController.Instance.getUUIDFromUsername(entry);
}
if (uuid != null) {
nbt.setString(getKey(), uuid.toString());
}
}
}
@@ -168,7 +168,6 @@ public class MailActionPacket extends AbstractPacket {
}
@Override
@SideOnly(Side.SERVER)
protected void handleCompleteData(ByteBuf data, EntityPlayer player) throws IOException {
if (!(player instanceof EntityPlayerMP))
return;
@@ -46,7 +46,6 @@ public final class DimensionTeleportPacket extends AbstractPacket {
out.writeInt(dimensionID);
}
@SideOnly(Side.SERVER)
@Override
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
if (!(player instanceof EntityPlayerMP))