Skip to content

Commit 9583655

Browse files
authored
BentoBox 1.4.0 Update (#23)
1 parent 870c0c2 commit 9583655

File tree

9 files changed

+192
-62
lines changed

9 files changed

+192
-62
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Biomes addon for SkyBlock, SkyGrid, CaveBlock and AcidIsland. It allows to chang
66
## Where to find
77

88
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.
9-
Latest official **Alpha Release is 0.4.2**, and you can download it from [Release tab](https://github.com/BentoBoxWorld/Biomes/releases)
9+
Latest official **Alpha Release is 0.4.5**, and you can download it from [Release tab](https://github.com/BentoBoxWorld/Biomes/releases)
1010

1111
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/).
1212

TODO.md

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ This page contains plans for each Addon version.
66
- [ ] Store Biome per Island.
77
- [x] On owner change, reset biomes that is not available for new owner.
88

9+
## Release 0.5.0
10+
- [ ] Rework GUI again:
11+
- [ ] Do the same tricks as in Challenges GUI.
12+
- [ ] Add proper Biomes Description #18
13+
- [ ] Simplify user GUI
14+
- [ ] Store Biome change information per:
15+
- [ ] Player
16+
- [ ] Island
17+
- [ ] Implement more cost options:
18+
- [ ] Cost per biome change (linear / exponential)
19+
- [ ] Cost per block
20+
- [ ] Remove deprecated code.
21+
922
## Release 0.4.0
1023
- [ ] Create unlockable biomes:
1124
- [ ] By challenge #11

pom.xml

+52-50
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>world.bentobox</groupId>
88
<artifactId>biomes</artifactId>
9-
<version>0.4.2</version>
9+
<version>${revision}</version>
1010

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

61+
<profiles>
62+
<!-- Build profile is activated by BUILD_NUMBER variable. It replaces 0 with correct build number. -->
63+
<!-- This profile will be used only if BUILD_NUMBER environment variable exists. -->
64+
<profile>
65+
<id>ci</id>
66+
<activation>
67+
<property>
68+
<name>env.BUILD_NUMBER</name>
69+
</property>
70+
</activation>
71+
<properties>
72+
<!-- Override only if necessary -->
73+
<build.number>-#${env.BUILD_NUMBER}</build.number>
74+
<!-- GIT_BRANCH -->
75+
</properties>
76+
</profile>
77+
<!-- master profile is activated by GIT_BRANCH variable. It removes '-SNAPSHOT' at the end of -->
78+
<!-- ${build.version} -->
79+
<!-- This profile will be used only if environment variable GIT_BRANCH is origin/master. -->
80+
<profile>
81+
<id>master</id>
82+
<activation>
83+
<property>
84+
<name>env.GIT_BRANCH</name>
85+
<value>origin/master</value>
86+
</property>
87+
</activation>
88+
<properties>
89+
<!-- Override only if necessary -->
90+
<revision>${build.version}</revision>
91+
<!-- Empties build.number value -->
92+
<build.number></build.number>
93+
</properties>
94+
</profile>
95+
</profiles>
96+
5097
<repositories>
5198
<repository>
5299
<id>spigot-repo</id>
@@ -70,42 +117,24 @@
70117
<dependency>
71118
<groupId>org.spigotmc</groupId>
72119
<artifactId>spigot-api</artifactId>
73-
<version>1.13.2-R0.1-SNAPSHOT</version>
120+
<version>${spigot.version}</version>
74121
<scope>provided</scope>
75122
</dependency>
76-
<dependency>
77-
<groupId>org.mockito</groupId>
78-
<artifactId>mockito-all</artifactId>
79-
<version>1.10.19</version>
80-
<scope>test</scope>
81-
</dependency>
82-
<dependency>
83-
<groupId>org.powermock</groupId>
84-
<artifactId>powermock-module-junit4</artifactId>
85-
<version>${powermock.version}</version>
86-
<scope>test</scope>
87-
</dependency>
88-
<dependency>
89-
<groupId>org.powermock</groupId>
90-
<artifactId>powermock-api-mockito</artifactId>
91-
<version>${powermock.version}</version>
92-
<scope>test</scope>
93-
</dependency>
94123
<dependency>
95124
<groupId>world.bentobox</groupId>
96125
<artifactId>bentobox</artifactId>
97-
<version>1.1</version>
126+
<version>${bentobox.version}</version>
98127
<scope>provided</scope>
99128
</dependency>
100129
<dependency>
101130
<groupId>net.wesjd</groupId>
102131
<artifactId>anvilgui</artifactId>
103-
<version>1.2.1-SNAPSHOT</version>
132+
<version>${anvilgui.version}</version>
104133
</dependency>
105134
<dependency>
106135
<groupId>net.milkbowl.vault</groupId>
107136
<artifactId>VaultAPI</artifactId>
108-
<version>1.7</version>
137+
<version>${vault.version}</version>
109138
<scope>provided</scope>
110139
</dependency>
111140
</dependencies>
@@ -234,31 +263,4 @@
234263
</plugin>
235264
</plugins>
236265
</build>
237-
238-
<profiles>
239-
<profile>
240-
<id>sonar</id>
241-
<properties>
242-
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
243-
<sonar.organization>bentobox-world</sonar.organization>
244-
</properties>
245-
<build>
246-
<plugins>
247-
<plugin>
248-
<groupId>org.sonarsource.scanner.maven</groupId>
249-
<artifactId>sonar-maven-plugin</artifactId>
250-
<version>3.4.1.1168</version>
251-
<executions>
252-
<execution>
253-
<phase>verify</phase>
254-
<goals>
255-
<goal>sonar</goal>
256-
</goals>
257-
</execution>
258-
</executions>
259-
</plugin>
260-
</plugins>
261-
</build>
262-
</profile>
263-
</profiles>
264266
</project>

src/main/java/world/bentobox/biomes/panel/CommonPanel.java

+17-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.List;
99

1010
import world.bentobox.bentobox.api.panels.PanelItem;
11+
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
1112
import world.bentobox.bentobox.api.user.User;
1213
import world.bentobox.biomes.BiomesAddon;
1314
import world.bentobox.biomes.objects.Settings.UpdateMode;
@@ -299,10 +300,16 @@ protected PanelItem createCommonButton(CommonButtons button, PanelItem.ClickHand
299300
}
300301
default:
301302
// All buttons should be in switch case.
302-
return null;
303+
return new PanelItemBuilder().build();
303304
}
304305

305-
return new PanelItem(icon, name, description, glow, handler == null ? clickHandler : handler, false);
306+
return new PanelItemBuilder().
307+
icon(icon).
308+
name(name).
309+
description(description).
310+
glow(glow).
311+
clickHandler(handler == null ? clickHandler : handler).
312+
build();
306313
}
307314

308315

@@ -460,7 +467,13 @@ else if (reduce)
460467
};
461468
}
462469

463-
return new PanelItem(icon, name, Collections.emptyList(), false, handler == null ? clickHandler : handler, false);
470+
return new PanelItemBuilder().
471+
icon(icon).
472+
name(name).
473+
description(Collections.emptyList()).
474+
glow(false).
475+
clickHandler(handler == null ? clickHandler : handler).
476+
build();
464477
}
465478

466479

@@ -508,6 +521,7 @@ protected enum CommonButtons
508521
/**
509522
* This enum contains buttons that is made of numbers.
510523
*/
524+
@Deprecated
511525
protected enum NumberButtons
512526
{
513527
SET_1,

src/main/java/world/bentobox/biomes/panel/admin/AdminBiomeEditPanel.java

+15-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import net.wesjd.anvilgui.AnvilGUI;
1212
import world.bentobox.bentobox.api.panels.PanelItem;
1313
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
14+
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
1415
import world.bentobox.bentobox.api.user.User;
1516
import world.bentobox.biomes.BiomesAddon;
1617
import world.bentobox.biomes.objects.BiomesObject;
@@ -645,7 +646,13 @@ private PanelItem createPropertyButton(PropertyButtons button)
645646
clickHandler = (panel, user1, clickType, slot) -> true;
646647
}
647648

648-
return new PanelItem(icon, name, description, this.currentEditMode.equals(button), clickHandler, false);
649+
return new PanelItemBuilder().
650+
icon(icon).
651+
name(name).
652+
description(description).
653+
glow(this.currentEditMode.equals(button)).
654+
clickHandler(clickHandler).
655+
build();
649656
}
650657

651658

@@ -680,7 +687,13 @@ private PanelItem reopenAnvilGui()
680687
return true;
681688
};
682689

683-
return new PanelItem(icon, name, description, false, clickHandler, false);
690+
return new PanelItemBuilder().
691+
icon(icon).
692+
name(name).
693+
description(description).
694+
glow(false).
695+
clickHandler(clickHandler).
696+
build();
684697
}
685698

686699

src/main/java/world/bentobox/biomes/panel/admin/AdminMainPanel.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import world.bentobox.bentobox.api.panels.PanelItem;
1111
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
12+
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
1213
import world.bentobox.bentobox.api.user.User;
1314
import world.bentobox.biomes.BiomesAddon;
1415
import world.bentobox.biomes.panel.CommonPanel;
@@ -223,7 +224,13 @@ private PanelItem createButton(ButtonType buttonType)
223224
};
224225
}
225226

226-
return new PanelItem(icon, name, description, glow, clickHandler, false);
227+
return new PanelItemBuilder().
228+
icon(icon).
229+
name(name).
230+
description(description).
231+
glow(glow).
232+
clickHandler(clickHandler).
233+
build();
227234
}
228235

229236

src/main/java/world/bentobox/biomes/panel/admin/AdminSettingsPanel.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import world.bentobox.bentobox.api.panels.PanelItem;
1010
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
11+
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
1112
import world.bentobox.bentobox.api.user.User;
1213
import world.bentobox.biomes.BiomesAddon;
1314
import world.bentobox.biomes.objects.Settings.UpdateMode;
@@ -444,7 +445,13 @@ else if (visibilityMode.equals(VisibilityMode.ACCESSIBLE))
444445
return null;
445446
}
446447

447-
return new PanelItem(icon, name, description, glow, clickHandler, false);
448+
return new PanelItemBuilder().
449+
icon(icon).
450+
name(name).
451+
description(description).
452+
glow(glow).
453+
clickHandler(clickHandler).
454+
build();
448455
}
449456

450457

src/main/java/world/bentobox/biomes/utils/Utils.java

+11
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ public class Utils
2323
* Thus method parses input string to ItemStack.
2424
* @param inputString Splitted string.
2525
* @return ItemStack that represents input string.
26+
* @deprecated
27+
* @see world.bentobox.bentobox.util.ItemParser#parse(String)
2628
*/
29+
@Deprecated
2730
private static ItemStack parse2ArrayString(String[] inputString)
2831
{
2932
int reqAmount;
@@ -57,7 +60,10 @@ private static ItemStack parse2ArrayString(String[] inputString)
5760
* Create ItemStack from 3 string parts.
5861
* @param inputString Splitted string.
5962
* @return ItemStack that is created from input string.
63+
* @deprecated
64+
* @see world.bentobox.bentobox.util.ItemParser#parse(String)
6065
*/
66+
@Deprecated
6167
private static ItemStack parse3ArrayString(String[] inputString)
6268
{
6369
String[] twoArrayString = {inputString[0], inputString[2]};
@@ -68,7 +74,10 @@ private static ItemStack parse3ArrayString(String[] inputString)
6874
/**
6975
* This method parse given string to ItemStack element.
7076
* @return the parsed ItemStack element.
77+
* @deprecated
78+
* @see world.bentobox.bentobox.util.ItemParser#parse(String)
7179
*/
80+
@Deprecated
7281
public static ItemStack parseItem(BiomesAddon addon, String inputString)
7382
{
7483
String[] part = inputString.split(":");
@@ -118,7 +127,9 @@ public static List<String> splitString(String string)
118127
* This method combines input string array in single string.
119128
* @param args String list that must be combined.
120129
* @return Combined string.
130+
* @deprecated
121131
*/
132+
@Deprecated
122133
public static String mergeStringList(List<String> args)
123134
{
124135
if (args.isEmpty())

0 commit comments

Comments
 (0)