@@ -71,6 +71,10 @@ public String onPlaceholderRequest(Player p, String identifier) {
7171 return "" ;
7272 }
7373
74+ if (identifier .equals ("this" )) {
75+ identifier = pl .getLocation ().getWorldName ();
76+ }
77+
7478 return pl .getPlotCount (identifier ) > 0 ?
7579 PlaceholderAPIPlugin .booleanTrue () :
7680 PlaceholderAPIPlugin .booleanFalse ();
@@ -82,6 +86,10 @@ public String onPlaceholderRequest(Player p, String identifier) {
8286 return "" ;
8387 }
8488
89+ if (identifier .equals ("this" )) {
90+ identifier = pl .getLocation ().getWorldName ();
91+ }
92+
8593 return String .valueOf (pl .getPlotCount (identifier ));
8694 }
8795
@@ -91,6 +99,10 @@ public String onPlaceholderRequest(Player p, String identifier) {
9199 return "" ;
92100 }
93101
102+ if (identifier .equals ("this" )) {
103+ identifier = pl .getLocation ().getWorldName ();
104+ }
105+
94106 return String .valueOf (PlotQuery .newQuery ()
95107 .ownedBy (pl )
96108 .inWorld (identifier )
@@ -99,6 +111,39 @@ public String onPlaceholderRequest(Player p, String identifier) {
99111 .count ());
100112 }
101113
114+ if (identifier .startsWith ("server_plot_count_" )) {
115+ identifier = identifier .substring ("server_plot_count_" .length ());
116+ if (identifier .isEmpty ()) {
117+ return "" ;
118+ }
119+
120+ if (identifier .equals ("this" )) {
121+ identifier = pl .getLocation ().getWorldName ();
122+ }
123+
124+ return String .valueOf (PlotQuery .newQuery ()
125+ .allPlots ()
126+ .inWorld (identifier )
127+ .count ());
128+ }
129+
130+ if (identifier .startsWith ("server_base_plot_count_" )) {
131+ identifier = identifier .substring ("server_base_plot_count_" .length ());
132+ if (identifier .isEmpty ()) {
133+ return "" ;
134+ }
135+
136+ if (identifier .equals ("this" )) {
137+ identifier = pl .getLocation ().getWorldName ();
138+ }
139+
140+ return String .valueOf (PlotQuery .newQuery ()
141+ .allPlots ()
142+ .inWorld (identifier )
143+ .whereBasePlot ()
144+ .count ());
145+ }
146+
102147 // PlotSquared placeholders
103148 return PlotSquared .platform ().placeholderRegistry ().getPlaceholderValue (identifier , pl );
104149 }
0 commit comments