Skip to content

Commit

Permalink
Merge pull request #70 from BentoBoxWorld/develop
Browse files Browse the repository at this point in the history
Release 2.2.0
  • Loading branch information
tastybento authored Nov 24, 2024
2 parents d9859eb + 3322871 commit 1c402a4
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 33 deletions.
24 changes: 6 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,9 @@
</issueManagement>

<distributionManagement>
<snapshotRepository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.org/repository/maven-snapshots</url>
</snapshotRepository>
<repository>
<id>codemc-releases</id>
<url>https://repo.codemc.org/repository/maven-releases</url>
<id>bentoboxworld</id>
<url>https://repo.codemc.org/repository/bentoboxworld/</url>
</repository>
</distributionManagement>

Expand All @@ -58,14 +54,14 @@
<!-- Non-minecraft related dependencies -->
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.21-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.4.1-SNAPSHOT</bentobox.version>
<spigot.version>1.21.3-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>2.1.0</build.version>
<build.version>2.2.0</build.version>
<!-- SonarCloud -->
<sonar.projectKey>BentoBoxWorld_SkyGrid</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
Expand Down Expand Up @@ -133,7 +129,7 @@
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
<url>https://repo.codemc.org/repository/bentoboxworld/</url>
</repository>
<repository>
<id>vault-repo</id>
Expand Down Expand Up @@ -174,14 +170,6 @@
<version>${bentobox.version}</version>
<scope>provided</scope>
</dependency>
<!-- Vault -->
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>

</dependencies>

<build>
Expand Down
41 changes: 41 additions & 0 deletions src/main/java/world/bentobox/skygrid/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.bukkit.Material;
import org.bukkit.entity.EntityType;

import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.configuration.ConfigComment;
import world.bentobox.bentobox.api.configuration.ConfigEntry;
import world.bentobox.bentobox.api.configuration.StoreAt;
Expand Down Expand Up @@ -147,6 +148,15 @@ public class Settings implements WorldSettings {
@ConfigEntry(path = "world.skygrid-height")
private int islandHeight = 128;

@ConfigComment("The number of concurrent areas a player can have")
@ConfigComment("A value of 0 will use the BentoBox config.yml default")
@ConfigEntry(path = "world.concurrent-area")
private int concurrentIslands = 0;

@ConfigComment("Disallow team members from having their own area.")
@ConfigEntry(path = "world.disallow-team-member-areas")
private boolean disallowTeamMemberIslands = true;

@ConfigComment("End Frame height")
@ConfigComment("This is the height where end frames will generate.")
@ConfigEntry(path = "world.end-frame-height", since = "1.20.0")
Expand Down Expand Up @@ -1642,4 +1652,35 @@ public int getEndFrameHeight() {
public void setEndFrameHeight(int endFrameHeight) {
this.endFrameHeight = endFrameHeight;
}

/**
* @return the concurrentIslands
*/
public int getConcurrentIslands() {
if (concurrentIslands <= 0) {
return BentoBox.getInstance().getSettings().getIslandNumber();
}
return concurrentIslands;
}

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

/**
* @return the disallowTeamMemberIslands
*/
public boolean isDisallowTeamMemberIslands() {
return disallowTeamMemberIslands;
}

/**
* @param disallowTeamMemberIslands the disallowTeamMemberIslands to set
*/
public void setDisallowTeamMemberIslands(boolean disallowTeamMemberIslands) {
this.disallowTeamMemberIslands = disallowTeamMemberIslands;
}
}
7 changes: 6 additions & 1 deletion src/main/java/world/bentobox/skygrid/SkyGridPladdon.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@

public class SkyGridPladdon extends Pladdon {

private SkyGrid addon;

@Override
public Addon getAddon() {
return new SkyGrid();
if (addon == null) {
addon = new SkyGrid();
}
return addon;
}
}
24 changes: 12 additions & 12 deletions src/main/java/world/bentobox/skygrid/generators/SkyGridPop.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,18 @@ private void setFrame(LimitedRegion region, int xx, int yy, int zz) {

private void setSaplingType(LimitedRegion region, Location loc) {
// Set sapling type if there is one specific to this biome
Material sapling = switch (region.getBiome(loc)) {
case JUNGLE -> Material.JUNGLE_SAPLING;
case PLAINS -> random.nextBoolean() ? Material.BIRCH_SAPLING : Material.OAK_SAPLING;
case TAIGA -> Material.SPRUCE_SAPLING;
case SWAMP -> Material.MANGROVE_PROPAGULE;
case DESERT -> Material.DEAD_BUSH;
case BADLANDS -> Material.DEAD_BUSH;
case CHERRY_GROVE -> Material.CHERRY_SAPLING;
case BAMBOO_JUNGLE -> Material.BAMBOO;
case SAVANNA -> Material.ACACIA_SAPLING; // Acacia
case BIRCH_FOREST -> Material.BIRCH_SAPLING;
case MUSHROOM_FIELDS -> random.nextBoolean() ? Material.RED_MUSHROOM : Material.BROWN_MUSHROOM;
Material sapling = switch (region.getBiome(loc).getKey().getKey()) {
case "jungle" -> Material.JUNGLE_SAPLING;
case "plains" -> random.nextBoolean() ? Material.BIRCH_SAPLING : Material.OAK_SAPLING;
case "taiga" -> Material.SPRUCE_SAPLING;
case "swamp" -> Material.MANGROVE_PROPAGULE;
case "desert" -> Material.DEAD_BUSH;
case "badlands" -> Material.DEAD_BUSH;
case "cherry_grove" -> Material.CHERRY_SAPLING;
case "bamboo_jungle" -> Material.BAMBOO;
case "savana" -> Material.ACACIA_SAPLING; // Acacia
case "birch_forest" -> Material.BIRCH_SAPLING;
case "mushroom_fields" -> random.nextBoolean() ? Material.RED_MUSHROOM : Material.BROWN_MUSHROOM;
default -> SAPLING_TYPE[random.nextInt(6)];
};
region.setType(loc.add(new Vector(0, 1, 0)), sapling);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/addon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: ${version}${build.number}
metrics: true
repository: "BentoBoxWorld/SkyGrid"
icon: "COBWEB"
api-version: 1.21
api-version: 2.7.1

authors: tastybento

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: BentoBox-SkyGrid
main: world.bentobox.skygrid.SkyGridPladdon
version: ${project.version}${build.number}
api-version: "1.19"
api-version: "1.21"

authors: [tastybento]
contributors: ["The BentoBoxWorld Community"]
Expand Down

0 comments on commit 1c402a4

Please sign in to comment.