mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Changed to ML placeholder parser
This commit is contained in:
parent
9367fb1d20
commit
db78c8d9c3
@ -88,6 +88,7 @@ public class MMOItems extends JavaPlugin {
|
||||
private TierManager tierManager;
|
||||
private SetManager setManager;
|
||||
|
||||
@Deprecated
|
||||
private PlaceholderParser placeholderParser = new DefaultPlaceholderParser();
|
||||
private VaultSupport vaultSupport;
|
||||
private RPGHandler rpgPlugin;
|
||||
@ -513,6 +514,7 @@ public class MMOItems extends JavaPlugin {
|
||||
return upgradeManager;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public PlaceholderParser getPlaceholderParser() {
|
||||
return placeholderParser;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package net.Indyuce.mmoitems.api.crafting.trigger;
|
||||
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
import io.lumine.mythic.lib.MythicLib;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerData;
|
||||
import io.lumine.mythic.lib.api.MMOLineConfig;
|
||||
|
||||
@ -17,6 +17,6 @@ public class MessageTrigger extends Trigger {
|
||||
@Override
|
||||
public void whenCrafting(PlayerData data) {
|
||||
if(!data.isOnline()) return;
|
||||
data.getPlayer().sendMessage(MMOItems.plugin.getPlaceholderParser().parse(data.getPlayer(), message));
|
||||
data.getPlayer().sendMessage(MythicLib.plugin.getPlaceholderParser().parse(data.getPlayer(), message));
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class UseItem {
|
||||
* @param command Command to execute
|
||||
*/
|
||||
private void scheduleCommandExecution(CommandData command) {
|
||||
String parsed = MMOItems.plugin.getPlaceholderParser().parse(player, command.getCommand());
|
||||
String parsed = MythicLib.plugin.getPlaceholderParser().parse(player, command.getCommand());
|
||||
|
||||
if (!command.hasDelay())
|
||||
dispatchCommand(parsed, command.isConsoleCommand(), command.hasOpPerms());
|
||||
|
@ -2,7 +2,9 @@ package net.Indyuce.mmoitems.comp.parse.placeholders;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
||||
@Deprecated
|
||||
public class DefaultPlaceholderParser implements PlaceholderParser {
|
||||
|
||||
@Override
|
||||
public String parse(OfflinePlayer player, String string) {
|
||||
return string.replace("%player%", player.getName());
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.OfflinePlayer;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import io.lumine.mythic.lib.MythicLib;
|
||||
|
||||
@Deprecated
|
||||
public class PlaceholderAPIParser implements PlaceholderParser {
|
||||
public PlaceholderAPIParser() {
|
||||
new MMOItemsPlaceholders().register();
|
||||
@ -12,6 +13,6 @@ public class PlaceholderAPIParser implements PlaceholderParser {
|
||||
|
||||
@Override
|
||||
public String parse(OfflinePlayer player, String string) {
|
||||
return MythicLib.plugin.parseColors(PlaceholderAPI.setPlaceholders(player, string.replace("%player%", player.getName())));
|
||||
return MythicLib.plugin.parseColors(PlaceholderAPI.setPlaceholders(player, string));
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.comp.parse.placeholders;
|
||||
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
||||
@Deprecated
|
||||
public interface PlaceholderParser {
|
||||
String parse(OfflinePlayer player, String string);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user