mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-04 19:03:14 +01:00
add world-specific variant
This commit is contained in:
parent
2f64af7ebb
commit
9de1ea8232
@ -20,6 +20,8 @@ package com.plotsquared.bukkit.placeholder;
|
|||||||
|
|
||||||
import com.plotsquared.core.PlotSquared;
|
import com.plotsquared.core.PlotSquared;
|
||||||
import com.plotsquared.core.player.PlotPlayer;
|
import com.plotsquared.core.player.PlotPlayer;
|
||||||
|
import com.plotsquared.core.plot.flag.implementations.DoneFlag;
|
||||||
|
import com.plotsquared.core.util.query.PlotQuery;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -83,6 +85,20 @@ public class PAPIPlaceholders extends PlaceholderExpansion {
|
|||||||
return String.valueOf(pl.getPlotCount(identifier));
|
return String.valueOf(pl.getPlotCount(identifier));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (identifier.startsWith("base_plot_count_")) {
|
||||||
|
identifier = identifier.substring("base_plot_count_".length());
|
||||||
|
if (identifier.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return String.valueOf(PlotQuery.newQuery()
|
||||||
|
.ownedBy(pl)
|
||||||
|
.inWorld(identifier)
|
||||||
|
.whereBasePlot()
|
||||||
|
.thatPasses(plot -> !DoneFlag.isDone(plot))
|
||||||
|
.count());
|
||||||
|
}
|
||||||
|
|
||||||
// PlotSquared placeholders
|
// PlotSquared placeholders
|
||||||
return PlotSquared.platform().placeholderRegistry().getPlaceholderValue(identifier, pl);
|
return PlotSquared.platform().placeholderRegistry().getPlaceholderValue(identifier, pl);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user