mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
refactor: return info.server
for %plotsquared_currentplot_owner%
if plot is a server plot (#3640)
This commit is contained in:
parent
5eb2fc3ad0
commit
2c2314e95c
@ -38,6 +38,7 @@ import com.plotsquared.core.player.PlotPlayer;
|
|||||||
import com.plotsquared.core.plot.Plot;
|
import com.plotsquared.core.plot.Plot;
|
||||||
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
|
||||||
import com.plotsquared.core.plot.flag.PlotFlag;
|
import com.plotsquared.core.plot.flag.PlotFlag;
|
||||||
|
import com.plotsquared.core.plot.flag.implementations.ServerPlotFlag;
|
||||||
import com.plotsquared.core.util.EventDispatcher;
|
import com.plotsquared.core.util.EventDispatcher;
|
||||||
import com.plotsquared.core.util.PlayerManager;
|
import com.plotsquared.core.util.PlayerManager;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
@ -110,6 +111,9 @@ public final class PlaceholderRegistry {
|
|||||||
return plot.getAlias();
|
return plot.getAlias();
|
||||||
});
|
});
|
||||||
this.createPlaceholder("currentplot_owner", (player, plot) -> {
|
this.createPlaceholder("currentplot_owner", (player, plot) -> {
|
||||||
|
if (plot.getFlag(ServerPlotFlag.class)){
|
||||||
|
return legacyComponent(TranslatableCaption.of("info.server"), player);
|
||||||
|
}
|
||||||
final UUID plotOwner = plot.getOwnerAbs();
|
final UUID plotOwner = plot.getOwnerAbs();
|
||||||
if (plotOwner == null) {
|
if (plotOwner == null) {
|
||||||
return legacyComponent(TranslatableCaption.of("generic.generic_unowned"), player);
|
return legacyComponent(TranslatableCaption.of("generic.generic_unowned"), player);
|
||||||
|
Loading…
Reference in New Issue
Block a user