Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XSkull] - NullPointerException: Cannot invoke GameProfile.getProperties() because "profile" is null (Profileable::getProfileValue -> PlayerProfiles::getTextureProperty) #300

Closed
Sraconni opened this issue Sep 26, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Sraconni
Copy link

Description
Some error occurs while configuration initializing.
Stack trace: https://pastebin.com/A7Q3rmbn

The correctly configuration file generated should look like this

  info:
    title: '&a&lDetails &7#&f%(name)'
    items:
      back:
        material: REDSTONE_TORCH
        name: '&cBack'
      owner:
        material: PLAYER_HEAD
        name: '&7Residence owned by &f%(owner)'
        lore: 
        - '&7'
        - '&a ▶ Click &8|&f See all his residences'
      server:
        material: CREEPER_HEAD
        name: '&e&oServer Residence'
        lore: 
        - '&7'
      teleport-to:
        material: ENDER_EYE
        name: '&dTeleport to residence'
        lore:
        - '&7'
        - '&7Residence location:'
        - '&f%(world)&7@&f%(x)&7,&f%(y),&f%(z)'
        - ''
        - '&a ▶ Click &8|&f Teleport to residence.'

The incorrect configuration file currently generated

info:
    title: '&a&lDetails &7#&f%(name)'
    items:
      back:
        material: REDSTONE_TORCH
        name: '&cBack'
      teleport-to:
        material: ENDER_EYE
        name: '&dTeleport to residence'
        lore:
        - '&7'
        - '&7Residence location:'
        - '&f%(world)&7@&f%(x)&7,&f%(y),&f%(z)'
        - ''
        - '&a ▶ Click &8|&f Teleport to residence.'

Code here

//initItems
        if (ResidenceUtils.isServerLand(getData().getResidence())) {
            setItem(14, new GUIItem(CONFIG.ITEMS.SERVER.prepare().get(getViewer())));
        } else {
            setItem(14, new GUIItem(CONFIG.ITEMS.OWNER.prepare(getData().getOwner())
                    .setSkullOwner(getData().getResidence().getOwnerUUID())
                    .get(getViewer())) {
                @Override
                public void onClick(Player clicker, ClickType type) {
                    ResidenceListUI.open(getViewer(), getData().getOwner());
                    PluginConfig.GUI.CLICK_SOUND.playTo(getViewer());
                }
            });
        }

//ConfiguredItem
            ConfiguredItem OWNER = ConfiguredItem.create()
                    .defaultType(Material.PLAYER_HEAD)
                    .defaultName("&7Residence owned by &f%(owner)")
                    .defaultLore(
                            "&7",
                            "&a ▶ Click &8|&f See all his residences"
                    ).params("owner").build();

            ConfiguredItem SERVER = ConfiguredItem.create()
                    .defaultType(Material.CREEPER_HEAD)
                    .defaultName("&e&oServer Residence")
                    .defaultLore(
                            "&7"
                    ).build();

Full source code: https://github.com/ArtformGames/ResidenceList/blob/master/plugin/src/main/java/com/artformgames/plugin/residencelist/ui/ResidenceInfoUI.java#L105-L117

https://github.com/ArtformGames/ResidenceList/blob/master/plugin/src/main/java/com/artformgames/plugin/residencelist/ui/ResidenceInfoUI.java#L220-L233

Version
XSeries: 11.2.2
This error occurs with Paper-1.21 Build130
Tested on Paper-1.21.1 Build99 & Spigot-1.21.1 (CraftBukkit version 4324-Spigot-a759b62-d25e1e7), same error occurs.

@Sraconni Sraconni added the bug Something isn't working label Sep 26, 2024
@CryptoMorin CryptoMorin changed the title [XItemStack] - Error while configuration initializing. [XSkull] - NullPointerException: Cannot invoke GameProfile.getProperties() because "profile" is null (Profileable::getProfileValue -> PlayerProfiles::PlayerProfiles) Sep 27, 2024
@CryptoMorin CryptoMorin changed the title [XSkull] - NullPointerException: Cannot invoke GameProfile.getProperties() because "profile" is null (Profileable::getProfileValue -> PlayerProfiles::PlayerProfiles) [XSkull] - NullPointerException: Cannot invoke GameProfile.getProperties() because "profile" is null (Profileable::getProfileValue -> PlayerProfiles::getTextureProperty) Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants