#Please help me

1 messages · Page 1 of 1 (latest)

earnest meadow
#

I'm trying to create this plugin but it is not working, I'm using PlaceholderAPI APi to register the expansion but it is not even rigistering 😦

LevelEssentialsExpansion.java:

import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.OfflinePlayer;
import org.jetbrains.annotations.NotNull;

import java.util.UUID;

public class LevelEssentialsExpansion extends PlaceholderExpansion {

    private final LevelEssentialsPlugin plugin;

    public LevelEssentialsExpansion(LevelEssentialsPlugin plugin) {
        this.plugin = plugin;
    }

    @Override
    @NotNull
    public String getIdentifier() {
        return "level";
    }

    @Override
    @NotNull
    public String getAuthor() {
        return "YourName";
    }

    @Override
    @NotNull
    public String getVersion() {
        return "1.0.0";
    }

    @Override
    public boolean persist() {
        return true;
    }

    @Override
    public String onRequest(OfflinePlayer player, @NotNull String params) {
        if (player == null) {
            return "";
        }

        UUID playerId = player.getUniqueId();

        // Check placeholders
        switch (params.toLowerCase()) {
            case "bracket_color":
                return plugin.getPlayerBracketColor(playerId.toString());
            case "bracket_right":
                return plugin.getBracketSymbol(playerId.toString(), true);
            case "bracket_left":
                return plugin.getBracketSymbol(playerId.toString(), false);
            case "level_color":
                return plugin.getPlayerLevelColor(playerId.toString());
        }

        return null;
    }
}
#

Here's my main class but it also has problems, the commands not working 😦

LevelEssentialsPlugin.java:

#

please help me little porr guy

foggy steppe
#

did you add PlaceholderAPI to your plugin.yml's softdepend?

foggy steppe
#

send your server logs

earnest meadow
#

OK so I fixed it

#

but I'm unable to create account on ecloud website

#

I need to register my expansion

#

how do I that?

foggy steppe
#

I asked the admins to make you an account

#

they'll contact you and ask for your username when they can

#

weren't you making an internal expansion though? you don't need to upload it to the ecloud

#

unless your fix was to make it an external expansion instead I guess

earnest meadow
foggy steppe
#

so you're making an internal expansion?

#

why do you need to make an account on the ecloud then?

graceful cypress
#

@earnest meadow, ecloud is used for deploying external expansions. And we strongly suggest that expansions are kept internal when they don't need to be external. Some accepted reasons for expansions to be external and published to the ecloud are:

  • not made for a plugin (example is the player expansion)
  • made for a plugin you do not own or maintain (example is the essentials expansion)

Please let us know why you might need an ecloud account. Thanks

earnest meadow
earnest meadow
# earnest meadow I indeed need to make internal expansion:

as you can see in this, this is made for LevelEssential plugin which helps add more QOL to CyberLevels plugin, with certain permissions they can change level colors and brackets (in chat example: <3> <prefix> <username> >> <message>, here the <3> are the things this expanion will add colors to, when they reach level 20 they will be able to change color to for example blue

#

using placeholders

#

it also works for my plugin but if players not need my plugin they can still use these

graceful cypress
#

I am quite confused right now. I understand that a plugin called CyberLevel exists and you do not own or maintain it. You have created a LevelEssentials plugin that has an internal expansion. But that expansion could work without your plugin? What does this expansion do then?

graceful cypress
earnest meadow
graceful cypress
#

Well then, if the plugin is always required for the expansion to work, please put the expansion inside the plugin.

graceful cypress
#

since the expansion will never load without the plugin working bcz it is always loading from inside the plugin

#

that might be the reason it isn't loading properly

earnest meadow
graceful cypress
#

see if that fixes the issue

earnest meadow
graceful cypress
#
   @Override
    public boolean canRegister() {
        return (this.plugin = (LevelEssentials) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null;
    }

and

    @Override
    public @NotNull String getRequiredPlugin() {
        return "LevelEssentials";
    }
earnest meadow
#

oh, so I have to remove @Override from these 2?

#

thats it?

graceful cypress
#

not just the override

#

the methods

#

completely

earnest meadow
#

damn what? completly remove these 2 methods??

graceful cypress
#

yeah

earnest meadow
#
package me.zaming.levelessentials.placeholders;

import me.zaming.levelessentials.LevelEssentials;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class LevelEssentialsPlaceholder extends PlaceholderExpansion {
    private LevelEssentials plugin;

    public LevelEssentialsPlaceholder(LevelEssentials plugin) {
        this.plugin = plugin;
    }
    

    @Override
    public @NotNull String getIdentifier() {
        return "levelessentials";
    }

    @Override
    public @NotNull String getAuthor() {
        return "Abasing";
    }

    

    @Override
    public @NotNull String getVersion() {
        return plugin.getDescription().getVersion();
    }

    @Override
    public boolean persist() {
        return true;
    }

    @Override
    public @Nullable String onRequest(OfflinePlayer player, @NotNull String identifier) {
        if (player == null || !player.isOnline()) {
            return "";
        }

        switch (identifier) {
            case "brackets_bracket_left":
                return plugin.getConfig().getString(player.getUniqueId() + ".bracket_left", "<");
            case "brackets_bracket_right":
                return plugin.getConfig().getString(player.getUniqueId() + ".bracket_right", ">");
            case "bracketcolor_color":
                return plugin.getConfig().getString(player.getUniqueId() + ".bracketcolor", "&f");
            case "levelcolor_color":
                return plugin.getConfig().getString(player.getUniqueId() + ".levelcolor", "&f");
            default:
                return null;
        }
    }
}
earnest meadow
#

leme see

#

is it normal?

#

0 placeholders registered?

graceful cypress
#

I think only external expansions are listed there

earnest meadow
#

oh

graceful cypress
#

I do agree with you though. maybe the message should be changed or internal ones added as well

earnest meadow
#

Leme go in-game and try parse the placeholders, /papi parse me %levelessentials_brackets_bracket_left%

#

OMGG

#

omg

#

YEES

#

DAMN

graceful cypress
#

I'm assuming it worked?

earnest meadow
#

not tested it in-game yet, game's still loading but check this out:

#

registared internal expansion: LevelEssentials!

graceful cypress
#

ah

#

that's an improvement though :))

earnest meadow
#

I won't be having same problem in the future!