Skip to content

Commit

Permalink
hope this will fix placeholders not loaded after papi reload
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Jan 12, 2025
1 parent 80c1f18 commit 62f835a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ public PlaceholderIntegration(DependencyManager depManager)
@Override
public @NotNull String getVersion()
{
return "1.3.3";
return "1.5.0";
}

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

private void addPlaceholders(List<IPlaceholderProvider> providerList)
Expand Down Expand Up @@ -70,7 +76,7 @@ private boolean providerEquals(IPlaceholderProvider source, IPlaceholderProvider
return source.getPlaceholderIdentifier().equals(target.getPlaceholderIdentifier());
}

private static final String defaultString = "???";
private static final String defaultString = "invalid_placeholder";

@Override
public @Nullable String onPlaceholderRequest(Player player, @NotNull String param)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public class StateNameProvider extends MorphPluginObject implements IPlaceholder
{
return state != null
? state.getDisguiseIdentifier()
: "???";
: "not_disguised";
}

case "name" ->
{
return state != null
? PlainTextComponentSerializer.plainText().serialize(state.getServerDisplay())
: "???";
: "not_disguised";
}

case "status" ->
Expand All @@ -51,7 +51,7 @@ public class StateNameProvider extends MorphPluginObject implements IPlaceholder
if (param.startsWith("provider_is"))
{
var spilt = param.split("\\?", 2);
if (spilt.length < 2) return "false";
if (spilt.length < 2) return "invalid_provider_param";

var namespace = spilt[1];
return state != null
Expand All @@ -62,13 +62,13 @@ public class StateNameProvider extends MorphPluginObject implements IPlaceholder
if (param.startsWith("id_is"))
{
var spilt = param.split("\\?", 2);
if (spilt.length < 2) return "false";
if (spilt.length < 2) return "invalid_id_param";

return state != null
? state.getDisguiseIdentifier().equals(spilt[1]) ? "true" : "false"
: "false";
}

return "not_enough_param";
return "invalid_param";
}
}

0 comments on commit 62f835a

Please sign in to comment.