Skip to content

Commit

Permalink
BentoBox 1.4.0 Update (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Mar 29, 2019
1 parent 870c0c2 commit 9583655
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 62 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Biomes addon for SkyBlock, SkyGrid, CaveBlock and AcidIsland. It allows to chang
## Where to find

Currently Biomes Addon is in **Alpha stage**, so it may or may not contain bugs... a lot of bugs. Also it means, that some features are not working or implemented.
Latest official **Alpha Release is 0.4.2**, and you can download it from [Release tab](https://github.com/BentoBoxWorld/Biomes/releases)
Latest official **Alpha Release is 0.4.5**, and you can download it from [Release tab](https://github.com/BentoBoxWorld/Biomes/releases)

Or you can try **nightly builds** where you can check and test new features that will be implemented in next release from [Jenkins Server](https://ci.codemc.org/job/BentoBoxWorld/job/Biomes/lastStableBuild/).

Expand Down
13 changes: 13 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ This page contains plans for each Addon version.
- [ ] Store Biome per Island.
- [x] On owner change, reset biomes that is not available for new owner.

## Release 0.5.0
- [ ] Rework GUI again:
- [ ] Do the same tricks as in Challenges GUI.
- [ ] Add proper Biomes Description #18
- [ ] Simplify user GUI
- [ ] Store Biome change information per:
- [ ] Player
- [ ] Island
- [ ] Implement more cost options:
- [ ] Cost per biome change (linear / exponential)
- [ ] Cost per block
- [ ] Remove deprecated code.

## Release 0.4.0
- [ ] Create unlockable biomes:
- [ ] By challenge #11
Expand Down
102 changes: 52 additions & 50 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>world.bentobox</groupId>
<artifactId>biomes</artifactId>
<version>0.4.2</version>
<version>${revision}</version>

<name>Biomes</name>
<description>Biomes is an add-on for BentoBox, an expandable Minecraft Spigot plugin for island-type games like SkyBlock or AcidIsland.</description>
Expand Down Expand Up @@ -45,8 +45,55 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<powermock.version>1.7.4</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.13.2-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.4.0</bentobox.version>
<level.version>1.3.0</level.version>
<vault.version>1.7</vault.version>
<anvilgui.version>1.2.1-SNAPSHOT</anvilgui.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. -->
<build.version>0.4.5</build.version>
<build.number>-LOCAL</build.number>
</properties>

<profiles>
<!-- Build profile is activated by BUILD_NUMBER variable. It replaces 0 with correct build number. -->
<!-- This profile will be used only if BUILD_NUMBER environment variable exists. -->
<profile>
<id>ci</id>
<activation>
<property>
<name>env.BUILD_NUMBER</name>
</property>
</activation>
<properties>
<!-- Override only if necessary -->
<build.number>-#${env.BUILD_NUMBER}</build.number>
<!-- GIT_BRANCH -->
</properties>
</profile>
<!-- master profile is activated by GIT_BRANCH variable. It removes '-SNAPSHOT' at the end of -->
<!-- ${build.version} -->
<!-- This profile will be used only if environment variable GIT_BRANCH is origin/master. -->
<profile>
<id>master</id>
<activation>
<property>
<name>env.GIT_BRANCH</name>
<value>origin/master</value>
</property>
</activation>
<properties>
<!-- Override only if necessary -->
<revision>${build.version}</revision>
<!-- Empties build.number value -->
<build.number></build.number>
</properties>
</profile>
</profiles>

<repositories>
<repository>
<id>spigot-repo</id>
Expand All @@ -70,42 +117,24 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId>
<version>1.1</version>
<version>${bentobox.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>${anvilgui.version}</version>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<version>${vault.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -234,31 +263,4 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>sonar</id>
<properties>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>bentobox-world</sonar.organization>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.4.1.1168</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sonar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
20 changes: 17 additions & 3 deletions src/main/java/world/bentobox/biomes/panel/CommonPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;

import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.biomes.BiomesAddon;
import world.bentobox.biomes.objects.Settings.UpdateMode;
Expand Down Expand Up @@ -299,10 +300,16 @@ protected PanelItem createCommonButton(CommonButtons button, PanelItem.ClickHand
}
default:
// All buttons should be in switch case.
return null;
return new PanelItemBuilder().build();
}

return new PanelItem(icon, name, description, glow, handler == null ? clickHandler : handler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(glow).
clickHandler(handler == null ? clickHandler : handler).
build();
}


Expand Down Expand Up @@ -460,7 +467,13 @@ else if (reduce)
};
}

return new PanelItem(icon, name, Collections.emptyList(), false, handler == null ? clickHandler : handler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(Collections.emptyList()).
glow(false).
clickHandler(handler == null ? clickHandler : handler).
build();
}


Expand Down Expand Up @@ -508,6 +521,7 @@ protected enum CommonButtons
/**
* This enum contains buttons that is made of numbers.
*/
@Deprecated
protected enum NumberButtons
{
SET_1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.wesjd.anvilgui.AnvilGUI;
import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.biomes.BiomesAddon;
import world.bentobox.biomes.objects.BiomesObject;
Expand Down Expand Up @@ -645,7 +646,13 @@ private PanelItem createPropertyButton(PropertyButtons button)
clickHandler = (panel, user1, clickType, slot) -> true;
}

return new PanelItem(icon, name, description, this.currentEditMode.equals(button), clickHandler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(this.currentEditMode.equals(button)).
clickHandler(clickHandler).
build();
}


Expand Down Expand Up @@ -680,7 +687,13 @@ private PanelItem reopenAnvilGui()
return true;
};

return new PanelItem(icon, name, description, false, clickHandler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(false).
clickHandler(clickHandler).
build();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.biomes.BiomesAddon;
import world.bentobox.biomes.panel.CommonPanel;
Expand Down Expand Up @@ -223,7 +224,13 @@ private PanelItem createButton(ButtonType buttonType)
};
}

return new PanelItem(icon, name, description, glow, clickHandler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(glow).
clickHandler(clickHandler).
build();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.biomes.BiomesAddon;
import world.bentobox.biomes.objects.Settings.UpdateMode;
Expand Down Expand Up @@ -444,7 +445,13 @@ else if (visibilityMode.equals(VisibilityMode.ACCESSIBLE))
return null;
}

return new PanelItem(icon, name, description, glow, clickHandler, false);
return new PanelItemBuilder().
icon(icon).
name(name).
description(description).
glow(glow).
clickHandler(clickHandler).
build();
}


Expand Down
11 changes: 11 additions & 0 deletions src/main/java/world/bentobox/biomes/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public class Utils
* Thus method parses input string to ItemStack.
* @param inputString Splitted string.
* @return ItemStack that represents input string.
* @deprecated
* @see world.bentobox.bentobox.util.ItemParser#parse(String)
*/
@Deprecated
private static ItemStack parse2ArrayString(String[] inputString)
{
int reqAmount;
Expand Down Expand Up @@ -57,7 +60,10 @@ private static ItemStack parse2ArrayString(String[] inputString)
* Create ItemStack from 3 string parts.
* @param inputString Splitted string.
* @return ItemStack that is created from input string.
* @deprecated
* @see world.bentobox.bentobox.util.ItemParser#parse(String)
*/
@Deprecated
private static ItemStack parse3ArrayString(String[] inputString)
{
String[] twoArrayString = {inputString[0], inputString[2]};
Expand All @@ -68,7 +74,10 @@ private static ItemStack parse3ArrayString(String[] inputString)
/**
* This method parse given string to ItemStack element.
* @return the parsed ItemStack element.
* @deprecated
* @see world.bentobox.bentobox.util.ItemParser#parse(String)
*/
@Deprecated
public static ItemStack parseItem(BiomesAddon addon, String inputString)
{
String[] part = inputString.split(":");
Expand Down Expand Up @@ -118,7 +127,9 @@ public static List<String> splitString(String string)
* This method combines input string array in single string.
* @param args String list that must be combined.
* @return Combined string.
* @deprecated
*/
@Deprecated
public static String mergeStringList(List<String> args)
{
if (args.isEmpty())
Expand Down

0 comments on commit 9583655

Please sign in to comment.