mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-03 18:53:43 +01:00 
			
		
		
		
	Add a placeholder for grants
Signed-off-by: Alexander Brandes <mc.cache@web.de>
This commit is contained in:
		@@ -27,6 +27,8 @@ import com.plotsquared.core.PlotSquared;
 | 
			
		||||
import com.plotsquared.core.configuration.Settings;
 | 
			
		||||
import com.plotsquared.core.configuration.caption.LocaleHolder;
 | 
			
		||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
 | 
			
		||||
import com.plotsquared.core.player.MetaDataAccess;
 | 
			
		||||
import com.plotsquared.core.player.PlayerMetaDataKeys;
 | 
			
		||||
import com.plotsquared.core.player.PlotPlayer;
 | 
			
		||||
import com.plotsquared.core.plot.Plot;
 | 
			
		||||
import com.plotsquared.core.plot.flag.GlobalFlagContainer;
 | 
			
		||||
@@ -197,6 +199,10 @@ public final class PlaceholderRegistry {
 | 
			
		||||
        });
 | 
			
		||||
        this.createPlaceholder("currentplot_biome", (player, plot) -> plot.getBiomeSynchronous().toString());
 | 
			
		||||
        this.createPlaceholder("currentplot_size", (player, plot) -> String.valueOf(plot.getConnectedPlots().size()));
 | 
			
		||||
        this.createPlaceholder("total_grants", player -> {
 | 
			
		||||
            final MetaDataAccess<Integer> metaDataAccess = player.accessPersistentMetaData(PlayerMetaDataKeys.PERSISTENT_GRANTED_PLOTS);
 | 
			
		||||
            return Integer.toString(metaDataAccess.get().orElse(0));
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user