Skip to content

Commit

Permalink
Fix settings. Fix homes to be settable.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Apr 23, 2023
1 parent f78f97d commit a28eb9f
Show file tree
Hide file tree
Showing 2 changed files with 330 additions and 320 deletions.
41 changes: 17 additions & 24 deletions src/main/java/world/bentobox/skygrid/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@ public class Settings implements WorldSettings {
@ConfigEntry(path = "world.skygrid-height")
private int islandHeight = 128;

@ConfigComment("Spawn height")
@ConfigComment("Height where players will spawn. Can be less than the grid height")
@ConfigEntry(path = "world.spawn-height")
private int spawnHeight = 128;

@ConfigComment("Space around new players in blocks (will be rounded up to nearest 16 blocks)")
@ConfigEntry(path = "world.space-around-players")
private int islandDistance = 1000;
Expand Down Expand Up @@ -213,15 +208,20 @@ public class Settings implements WorldSettings {
@ConfigComment("Default maximum number of coop rank members per area")
@ConfigComment("Players can have the skygrid.coop.maxsize.<number> permission to be bigger but")
@ConfigComment("permission size cannot be less than the default below. ")
@ConfigEntry(path = "island.max-coop-size", since = "1.13.0")
@ConfigEntry(path = "area.max-coop-size", since = "1.13.0")
private int maxCoopSize = 4;

@ConfigComment("Default maximum number of trusted rank members per area")
@ConfigComment("Players can have the skygrid.trust.maxsize.<number> permission to be bigger but")
@ConfigComment("permission size cannot be less than the default below. ")
@ConfigEntry(path = "island.max-trusted-size", since = "1.13.0")
@ConfigEntry(path = "area.max-trusted-size", since = "1.13.0")
private int maxTrustSize = 4;

@ConfigComment("Default maximum number of homes a player can have. Min = 1")
@ConfigComment("Accessed via /sg sethome <number> or /sg go <number>")
@ConfigEntry(path = "area.max-homes")
private int maxHomes = 5;

// Reset
@ConfigComment("How many resets a player is allowed (override with /sgadmin clearresets <player>)")
@ConfigComment("Value of -1 means unlimited, 0 means hardcore - no resets.")
Expand Down Expand Up @@ -577,7 +577,7 @@ public void setIslandStartZ(int islandStartZ) {
@Override
public int getIslandHeight() {
if (islandHeight > 255) islandHeight = 255;
else if (islandHeight < 0) islandHeight = 0;
else if (islandHeight < -64) islandHeight = -64;
return islandHeight;
}

Expand All @@ -586,24 +586,10 @@ public int getIslandHeight() {
*/
public void setIslandHeight(int islandHeight) {
if (islandHeight > 255) islandHeight = 255;
else if (islandHeight < 0) islandHeight = 0;
else if (islandHeight < -64) islandHeight = -64;
this.islandHeight = islandHeight;
}

/**
* @return the spawnHeight
*/
public int getSpawnHeight() {
return spawnHeight;
}

/**
* @param spawnHeight the spawnHeight to set
*/
public void setSpawnHeight(int spawnHeight) {
this.spawnHeight = spawnHeight;
}

/**
* @return the islandDistance
*/
Expand Down Expand Up @@ -1174,7 +1160,7 @@ public int getIslandZOffset() {

@Override
public int getMaxHomes() {
return 0;
return maxHomes;
}

@Override
Expand Down Expand Up @@ -1628,4 +1614,11 @@ public boolean isCheckForBlocks()
{
return false;
}

/**
* @param maxHomes the maxHomes to set
*/
public void setMaxHomes(int maxHomes) {
this.maxHomes = maxHomes;
}
}

0 comments on commit a28eb9f

Please sign in to comment.