Skip to content

Commit

Permalink
Merge pull request #100 from BentoBoxWorld/develop
Browse files Browse the repository at this point in the history
Version 2.8.0
  • Loading branch information
tastybento authored Nov 17, 2024
2 parents 9850a76 + 6d66242 commit 091c767
Show file tree
Hide file tree
Showing 11 changed files with 1,466 additions and 29 deletions.
26 changes: 10 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,27 @@
</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>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<java.version>21</java.version>
<!-- Non-minecraft related dependencies -->
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.21.1-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.5.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.7.2</build.version>
<build.version>2.8.0</build.version>

<sonar.projectKey>BentoBoxWorld_Boxed</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
Expand Down Expand Up @@ -119,6 +115,10 @@
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<repository>
<id>bentoboxworld</id>
<url>https://repo.codemc.org/repository/bentoboxworld/</url>
</repository>
<repository>
<id>codemc</id>
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
Expand Down Expand Up @@ -185,12 +185,6 @@
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc.....</groupId>
<artifactId>spigot</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc......</groupId>
<artifactId>spigot</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/world/bentobox/boxed/Boxed.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ public void onEnable() {
if (this.getPlugin().getAddonsManager().getAddonByName("InvSwitcher").isEmpty()) {
this.logWarning("Boxed normally requires the InvSwitcher addon for per-world Advancements.");
}
if (Bukkit.getPluginManager().isPluginEnabled("MultiverseCore")) {
this.logError("Boxed is not compatible with Multiverse! Disabling!");
this.setState(State.DISABLED);
return;
}
// Advancements manager
advManager = new AdvancementsManager(this);
// Make flags only applicable to this game mode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package world.bentobox.boxed.generators.biomes;

import java.util.Arrays;
import java.util.List;

import org.bukkit.Registry;
import org.bukkit.World.Environment;
import org.bukkit.block.Biome;
import org.bukkit.generator.BiomeProvider;
import org.bukkit.generator.WorldInfo;
import org.bukkit.util.Vector;
import org.eclipse.jdt.annotation.Nullable;

import com.google.common.base.Enums;

import world.bentobox.bentobox.BentoBox;
import world.bentobox.boxed.Boxed;
import world.bentobox.boxed.generators.chunks.AbstractBoxedChunkGenerator;
Expand Down Expand Up @@ -56,7 +54,7 @@ public Biome getBiome(WorldInfo worldInfo, int x, int y, int z) {
@Override
public List<Biome> getBiomes(WorldInfo worldInfo) {
// Return all of them for now!
return Arrays.stream(Biome.values()).filter(b -> !b.equals(Biome.CUSTOM)).filter(b -> !b.equals(Enums.getIfPresent(Biome.class, "CHERRY_GROVE").orNull())).toList();
return Registry.BIOME.stream().filter(b -> !b.equals(Biome.CUSTOM)).toList();
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package world.bentobox.boxed.generators.biomes;

import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumMap;
import java.util.List;
Expand All @@ -11,6 +10,7 @@
import java.util.SortedMap;
import java.util.TreeMap;

import org.bukkit.Registry;
import org.bukkit.World.Environment;
import org.bukkit.block.Biome;
import org.bukkit.block.BlockFace;
Expand All @@ -21,8 +21,6 @@
import org.bukkit.util.Vector;
import org.eclipse.jdt.annotation.NonNull;

import com.google.common.base.Enums;

import world.bentobox.boxed.Boxed;

/**
Expand Down Expand Up @@ -1129,7 +1127,7 @@ Biome getBeachBiome(int t) {
}

public static double convertToY(double x) {
x = Math.max(-1, Math.min(1, x)); // Clamp value
x = Math.clamp(x, -1, 1);
if (x >= -1 && x < -0.5) {
return 2 * x + 1;
} else if (x >= -0.5 && x < 0) {
Expand Down Expand Up @@ -1196,7 +1194,7 @@ private Biome getMappedBiome(WorldInfo worldInfo, int x, int y, int z, BiomePara
@Override
public List<Biome> getBiomes(WorldInfo worldInfo) {
// Return all of them for now!
return Arrays.stream(Biome.values()).filter(b -> !b.equals(Biome.CUSTOM)).toList();
return Registry.BIOME.stream().filter(b -> !b.equals(Biome.CUSTOM)).toList();
}

/**
Expand All @@ -1215,7 +1213,7 @@ private SortedMap<Double, Biome> loadQuad(YamlConfiguration config, String secto
if (split.length == 2) {
try {
double d = Double.parseDouble(split[0]);
Biome biome = Enums.getIfPresent(Biome.class, split[1].toUpperCase(Locale.ENGLISH)).orNull();
Biome biome = Biome.valueOf(split[1].toUpperCase(Locale.ENGLISH));
if (biome == null) {
addon.logError(split[1].toUpperCase(Locale.ENGLISH) + " is an unknown biome on this server.");
result.put(d, Biome.CUSTOM);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ private void setUpIsland(Island island) {
}

private void place(ConfigurationSection section, Location center, Environment env) {
if (section == null) {
return;
}
World world = env.equals(Environment.NORMAL) ? addon.getOverWorld() : addon.getNetherWorld();
if (world == null) {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package world.bentobox.boxed.nms.v1_21_3_R0_1_SNAPSHOT;

public class GetMetaData extends world.bentobox.boxed.nms.v1_21_R0_1_SNAPSHOT.GetMetaData {
// Identical to 1.21
}
2 changes: 1 addition & 1 deletion src/main/resources/addon.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Boxed
main: world.bentobox.boxed.Boxed
version: ${version}${build.number}
api-version: 2.5.1
api-version: 2.7.1
metrics: true
icon: "COMPOSTER"
repository: "BentoBoxWorld/Boxed"
Expand Down
Loading

0 comments on commit 091c767

Please sign in to comment.