mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 03:03:43 +01:00 
			
		
		
		
	Encapsulation and Magic Values (#2711)
* Encapsulate attributes of PlotArea using lombok Getters/Setters * Limit access to collections, don't expose implementation details * Better naming for some boolean attributes * Replace magic type value with PlotAreaType enum * Replace magic terrain value with PlotAreaTerrainType enum * Fix remaining rebase conflicts * Reduce code duplication Co-authored-by: Alexander Söderberg <Sauilitired@users.noreply.github.com>
This commit is contained in:
		@@ -185,7 +185,7 @@ public final class NukkitMain extends PluginBase implements Listener, IPlotMain
 | 
			
		||||
            @Override public void run() {
 | 
			
		||||
                PlotSquared.get().foreachPlotArea(new RunnableVal<PlotArea>() {
 | 
			
		||||
                    @Override public void run(PlotArea plotArea) {
 | 
			
		||||
                        Level world = getServer().getLevelByName(plotArea.worldname);
 | 
			
		||||
                        Level world = getServer().getLevelByName(plotArea.getWorldName());
 | 
			
		||||
                        try {
 | 
			
		||||
                            if (world == null) {
 | 
			
		||||
                                return;
 | 
			
		||||
 
 | 
			
		||||
@@ -85,7 +85,7 @@ public class NukkitPlotGenerator extends Generator implements GeneratorWrapper<G
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override public void augment(PlotArea area) {
 | 
			
		||||
        NukkitAugmentedGenerator.get(NukkitUtil.getWorld(area.worldname));
 | 
			
		||||
        NukkitAugmentedGenerator.get(NukkitUtil.getWorld(area.getWorldName()));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override public boolean isFull() {
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,7 @@ public class NukkitEventUtil extends EventUtil {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override public boolean callUnlink(PlotArea area, ArrayList<PlotId> plots) {
 | 
			
		||||
        return callEvent(new PlotUnlinkEvent(NukkitUtil.getWorld(area.worldname), area, plots));
 | 
			
		||||
        return callEvent(new PlotUnlinkEvent(NukkitUtil.getWorld(area.getWorldName()), area, plots));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override public void callEntry(PlotPlayer player, Plot plot) {
 | 
			
		||||
 
 | 
			
		||||
@@ -155,7 +155,7 @@ public class NukkitSetupUtils extends SetupUtils {
 | 
			
		||||
        if (SetupUtils.generators.isEmpty()) {
 | 
			
		||||
            updateGenerators();
 | 
			
		||||
        }
 | 
			
		||||
        Level world = NukkitUtil.getWorld(plotArea.worldname);
 | 
			
		||||
        Level world = NukkitUtil.getWorld(plotArea.getWorldName());
 | 
			
		||||
        if (world == null) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user