Skip to content

Commit bc3d69c

Browse files
tastybentoBONNe
andauthored
Release 1.17.0 (#54)
* Version 1.16.1 * Expose BentoBox 1.16 portal generation mechanics. BentoBoxWorld/BentoBox#1718 * Adds isCheckForBlocks to false similar to CaveBlock. (#49) * Revert "Adds isCheckForBlocks to false similar to CaveBlock. (#49)" (#53) This reverts commit bd36b95. * Expose BentoBox mobLimitSettings option. (#52) * Expose BentoBox 1.14 onRespawnCommands (#51) BentoBoxWorld/BentoBox#1719 * Implements #49 * Update to 1.17 * Improved blocks and items for 1.17 * Update GitHub Action to Java 16 * Make Pladdon Java 16 code clean up. * Remove missing blocks/items checking code. * Correct reference to SkyGrid in settings * Fix code smells. Co-authored-by: BONNe <bonne@bonne.id.lv>
1 parent 685d283 commit bc3d69c

File tree

13 files changed

+722
-260
lines changed

13 files changed

+722
-260
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@ jobs:
1414
- uses: actions/checkout@v2
1515
with:
1616
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
17-
- name: Set up JDK 11
18-
uses: actions/setup-java@v1
17+
- name: Set up JDK 16
18+
uses: actions/setup-java@v2
1919
with:
20-
java-version: 11
20+
distribution: 'adopt'
21+
java-version: 16
2122
- name: Cache SonarCloud packages
22-
uses: actions/cache@v1
23+
uses: actions/cache@v2
2324
with:
2425
path: ~/.sonar/cache
2526
key: ${{ runner.os }}-sonar
2627
restore-keys: ${{ runner.os }}-sonar
2728
- name: Cache Maven packages
28-
uses: actions/cache@v1
29+
uses: actions/cache@v2
2930
with:
3031
path: ~/.m2
3132
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

pom.xml

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@
5353
<properties>
5454
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5555
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
56-
<java.version>1.8</java.version>
56+
<java.version>16</java.version>
5757
<!-- Non-minecraft related dependencies -->
5858
<powermock.version>2.0.2</powermock.version>
5959
<!-- More visible way how to change dependency versions -->
60-
<spigot.version>1.16.1-R0.1-SNAPSHOT</spigot.version>
61-
<bentobox.version>1.16.0</bentobox.version>
60+
<spigot.version>1.17.1-R0.1-SNAPSHOT</spigot.version>
61+
<bentobox.version>1.17.1</bentobox.version>
6262
<!-- Revision variable removes warning about dynamic version -->
6363
<revision>${build.version}-SNAPSHOT</revision>
6464
<!-- Do not change unless you want different name for local builds. -->
6565
<build.number>-LOCAL</build.number>
6666
<!-- This allows to change between versions. -->
67-
<build.version>1.16.0</build.version>
67+
<build.version>1.17.0</build.version>
6868
<!-- SonarCloud -->
6969
<sonar.projectKey>BentoBoxWorld_SkyGrid</sonar.projectKey>
7070
<sonar.organization>bentobox-world</sonar.organization>
@@ -111,30 +111,6 @@
111111
<build.number></build.number>
112112
</properties>
113113
</profile>
114-
<profile>
115-
<id>sonar</id>
116-
<properties>
117-
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
118-
<sonar.organization>bentobox-world</sonar.organization>
119-
</properties>
120-
<build>
121-
<plugins>
122-
<plugin>
123-
<groupId>org.sonarsource.scanner.maven</groupId>
124-
<artifactId>sonar-maven-plugin</artifactId>
125-
<version>3.6.0.1398</version>
126-
<executions>
127-
<execution>
128-
<phase>verify</phase>
129-
<goals>
130-
<goal>sonar</goal>
131-
</goals>
132-
</execution>
133-
</executions>
134-
</plugin>
135-
</plugins>
136-
</build>
137-
</profile>
138114
</profiles>
139115

140116
<repositories>
@@ -254,8 +230,7 @@
254230
<artifactId>maven-compiler-plugin</artifactId>
255231
<version>3.7.0</version>
256232
<configuration>
257-
<source>${java.version}</source>
258-
<target>${java.version}</target>
233+
<release>${java.version}</release>
259234
</configuration>
260235
</plugin>
261236
<plugin>
@@ -268,18 +243,20 @@
268243
<artifactId>maven-jar-plugin</artifactId>
269244
<version>3.1.0</version>
270245
</plugin>
271-
<plugin>
246+
<plugin>
272247
<groupId>org.apache.maven.plugins</groupId>
273248
<artifactId>maven-javadoc-plugin</artifactId>
274-
<version>3.0.1</version>
249+
<version>3.3.0</version>
275250
<configuration>
276-
<show>public</show>
277251
<failOnError>false</failOnError>
278252
<additionalJOption>-Xdoclint:none</additionalJOption>
253+
<!-- To compile with Java 11, this tag may be required -->
254+
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
279255
</configuration>
280256
<executions>
281257
<execution>
282258
<id>attach-javadocs</id>
259+
<phase>install</phase>
283260
<goals>
284261
<goal>jar</goal>
285262
</goals>

src/main/java/world/bentobox/skygrid/Settings.java

Lines changed: 130 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
package world.bentobox.skygrid;
22

3-
import java.util.ArrayList;
4-
import java.util.EnumMap;
5-
import java.util.HashMap;
6-
import java.util.HashSet;
7-
import java.util.List;
8-
import java.util.Map;
9-
import java.util.Set;
3+
import java.util.*;
104

115
import org.bukkit.Difficulty;
126
import org.bukkit.GameMode;
@@ -92,6 +86,12 @@ public class Settings implements WorldSettings {
9286
@ConfigEntry(path = "world.nether.blocks")
9387
private Map<Material, Integer> netherBlocks = new EnumMap<>(Material.class);
9488

89+
@ConfigComment("This option indicates if nether portals should be linked via dimensions.")
90+
@ConfigComment("Option will simulate vanilla portal mechanics that links portals together")
91+
@ConfigComment("or creates a new portal, if there is not a portal in that dimension.")
92+
@ConfigEntry(path = "world.nether.create-and-link-portals", since = "1.16")
93+
private boolean makeNetherPortals = false;
94+
9595
// End
9696
@ConfigComment("Generate SkyGrid End - if this is false, the end world will not be made")
9797
@ConfigEntry(path = "world.end.generate")
@@ -101,6 +101,11 @@ public class Settings implements WorldSettings {
101101
@ConfigEntry(path = "world.end.blocks")
102102
private Map<Material, Integer> endBlocks = new EnumMap<>(Material.class);
103103

104+
@ConfigComment("This option indicates if obsidian platform in the end should be generated")
105+
@ConfigComment("when player enters the end world.")
106+
@ConfigEntry(path = "world.end.create-obsidian-platform", since = "1.16")
107+
private boolean makeEndPortals = false;
108+
104109
/* SkyGrid */
105110
@ConfigComment("Biomes - this will affect some block types and tree types.")
106111
@ConfigEntry(path = "world.create-biomes")
@@ -330,13 +335,50 @@ public class Settings implements WorldSettings {
330335

331336
// Commands
332337
@ConfigComment("List of commands to run when a player joins.")
338+
@ConfigComment("These commands are run by the console, unless otherwise stated using the [SUDO] prefix,")
339+
@ConfigComment("in which case they are executed by the player.")
340+
@ConfigComment("")
341+
@ConfigComment("Available placeholders for the commands are the following:")
342+
@ConfigComment(" * [name]: name of the player")
343+
@ConfigComment("")
344+
@ConfigComment("Here are some examples of valid commands to execute:")
345+
@ConfigComment(" * '[SUDO] bbox version'")
346+
@ConfigComment(" * 'bsbadmin deaths set [player] 0'")
347+
@ConfigComment("")
348+
@ConfigComment("Note that player-executed commands might not work, as these commands can be run with said player being offline.")
333349
@ConfigEntry(path = "area.commands.on-join")
334350
private List<String> onJoinCommands = new ArrayList<>();
335351

336352
@ConfigComment("list of commands to run when a player leaves.")
353+
@ConfigComment("These commands are run by the console, unless otherwise stated using the [SUDO] prefix,")
354+
@ConfigComment("in which case they are executed by the player.")
355+
@ConfigComment("")
356+
@ConfigComment("Available placeholders for the commands are the following:")
357+
@ConfigComment(" * [name]: name of the player")
358+
@ConfigComment("")
359+
@ConfigComment("Here are some examples of valid commands to execute:")
360+
@ConfigComment(" * '[SUDO] bbox version'")
361+
@ConfigComment(" * 'bsbadmin deaths set [player] 0'")
362+
@ConfigComment("")
363+
@ConfigComment("Note that player-executed commands might not work, as these commands can be run with said player being offline.")
337364
@ConfigEntry(path = "area.commands.on-leave")
338365
private List<String> onLeaveCommands = new ArrayList<>();
339366

367+
@ConfigComment("List of commands that should be executed when the player respawns after death if Flags.ISLAND_RESPAWN is true.")
368+
@ConfigComment("These commands are run by the console, unless otherwise stated using the [SUDO] prefix,")
369+
@ConfigComment("in which case they are executed by the player.")
370+
@ConfigComment("")
371+
@ConfigComment("Available placeholders for the commands are the following:")
372+
@ConfigComment(" * [name]: name of the player")
373+
@ConfigComment("")
374+
@ConfigComment("Here are some examples of valid commands to execute:")
375+
@ConfigComment(" * '[SUDO] bbox version'")
376+
@ConfigComment(" * 'bsbadmin deaths set [player] 0'")
377+
@ConfigComment("")
378+
@ConfigComment("Note that player-executed commands might not work, as these commands can be run with said player being offline.")
379+
@ConfigEntry(path = "area.commands.on-respawn", since = "1.14.0")
380+
private List<String> onRespawnCommands = new ArrayList<>();
381+
340382
// Sethome
341383
@ConfigComment("Allow setting home in the nether. Only available on nether islands, not vanilla nether.")
342384
@ConfigEntry(path = "area.sethome.nether.allow")
@@ -377,6 +419,11 @@ public class Settings implements WorldSettings {
377419
@ConfigEntry(path = "protection.geo-limit-settings")
378420
private List<String> geoLimitSettings = new ArrayList<>();
379421

422+
@ConfigComment("SkyGrid blocked mobs.")
423+
@ConfigComment("List of mobs that should not spawn in SkyGrid.")
424+
@ConfigEntry(path = "protection.block-mobs")
425+
private List<String> mobLimitSettings = new ArrayList<>();
426+
380427
// Invincible visitor settings
381428
@ConfigComment("Invincible visitors. List of damages that will not affect visitors.")
382429
@ConfigComment("Make list blank if visitors should receive all damages")
@@ -1295,7 +1342,7 @@ public void setDeathsResetOnNewIsland(boolean deathsResetOnNewIsland) {
12951342
*/
12961343
@Override
12971344
public List<String> getOnJoinCommands() {
1298-
return onJoinCommands;
1345+
return Objects.requireNonNullElseGet(onJoinCommands, ArrayList::new);
12991346
}
13001347

13011348
/**
@@ -1310,7 +1357,7 @@ public void setOnJoinCommands(List<String> onJoinCommands) {
13101357
*/
13111358
@Override
13121359
public List<String> getOnLeaveCommands() {
1313-
return onLeaveCommands;
1360+
return Objects.requireNonNullElseGet(onLeaveCommands, ArrayList::new);
13141361
}
13151362

13161363
/**
@@ -1320,6 +1367,23 @@ public void setOnLeaveCommands(List<String> onLeaveCommands) {
13201367
this.onLeaveCommands = onLeaveCommands;
13211368
}
13221369

1370+
/**
1371+
* @return the onRespawnCommands
1372+
*/
1373+
@Override
1374+
public List<String> getOnRespawnCommands() {
1375+
return Objects.requireNonNullElseGet(onRespawnCommands, ArrayList::new);
1376+
}
1377+
1378+
/**
1379+
* Sets on respawn commands.
1380+
*
1381+
* @param onRespawnCommands the on respawn commands
1382+
*/
1383+
public void setOnRespawnCommands(List<String> onRespawnCommands) {
1384+
this.onRespawnCommands = onRespawnCommands;
1385+
}
1386+
13231387
/**
13241388
* @return the onJoinResetHealth
13251389
*/
@@ -1493,4 +1557,61 @@ public String getDefaultPlayerAction() {
14931557
public void setDefaultPlayerAction(String defaultPlayerAction) {
14941558
this.defaultPlayerAction = defaultPlayerAction;
14951559
}
1560+
1561+
/**
1562+
* @return the mobLimitSettings
1563+
*/
1564+
@Override
1565+
public List<String> getMobLimitSettings() {
1566+
return mobLimitSettings;
1567+
}
1568+
1569+
/**
1570+
* @param mobLimitSettings the mobLimitSettings to set
1571+
*/
1572+
public void setMobLimitSettings(List<String> mobLimitSettings) {
1573+
this.mobLimitSettings = mobLimitSettings;
1574+
}
1575+
1576+
/**
1577+
* @return the makeNetherPortals
1578+
*/
1579+
@Override
1580+
public boolean isMakeNetherPortals() {
1581+
return makeNetherPortals;
1582+
}
1583+
1584+
/**
1585+
* @return the makeEndPortals
1586+
*/
1587+
@Override
1588+
public boolean isMakeEndPortals() {
1589+
return makeEndPortals;
1590+
}
1591+
1592+
/**
1593+
* Sets make nether portals.
1594+
* @param makeNetherPortals the make nether portals
1595+
*/
1596+
public void setMakeNetherPortals(boolean makeNetherPortals) {
1597+
this.makeNetherPortals = makeNetherPortals;
1598+
}
1599+
1600+
/**
1601+
* Sets make end portals.
1602+
* @param makeEndPortals the make end portals
1603+
*/
1604+
public void setMakeEndPortals(boolean makeEndPortals) {
1605+
this.makeEndPortals = makeEndPortals;
1606+
}
1607+
1608+
/**
1609+
* SkyGrid should not check for blocks.
1610+
* @return false
1611+
*/
1612+
@Override
1613+
public boolean isCheckForBlocks()
1614+
{
1615+
return false;
1616+
}
14961617
}

src/main/java/world/bentobox/skygrid/SkyGrid.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class SkyGrid extends GameModeAddon {
3030
private Settings settings;
3131
private WorldStyles worldStyles;
3232
private SkyGridGen gen;
33-
private Config<Settings> configObject = new Config<>(this, Settings.class);
33+
private final Config<Settings> configObject = new Config<>(this, Settings.class);
3434

3535
@Override
3636
public void onLoad() {
@@ -46,6 +46,7 @@ private void loadSettings() {
4646
// Disable
4747
logError("SkyGrid settings could not load! Addon disabled.");
4848
setState(State.DISABLED);
49+
return;
4950
}
5051
saveWorldSettings();
5152
worldStyles = new WorldStyles(this);
@@ -60,7 +61,7 @@ private void loadSettings() {
6061
}
6162

6263
@Override
63-
public void onEnable(){
64+
public void onEnable() {
6465
// Set default protection flags for world to allow everything
6566
Flags.values().stream().filter(f -> f.getType().equals(Type.PROTECTION)).forEach(f -> f.setDefaultSetting(getOverWorld(), true));
6667
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package world.bentobox.skygrid;
2+
3+
import world.bentobox.bentobox.api.addons.Addon;
4+
import world.bentobox.bentobox.api.addons.Pladdon;
5+
6+
public class SkyGridPladdon extends Pladdon {
7+
8+
@Override
9+
public Addon getAddon() {
10+
return new SkyGrid();
11+
}
12+
}

src/main/java/world/bentobox/skygrid/generators/Biomes.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
import org.bukkit.block.Biome;
88

99
/**
10-
* In order to find the biome of a region, we look up how close it's
11-
* conditions are to the conditions on this map. We can use it's proximity
10+
* In order to find the biome of a region, we look up how close its
11+
* conditions are to the conditions on this map. We can use its proximity
1212
* to a biome to determine how much influence that biome's noise generators,
1313
* vegetation and features should have on the area of the map. This allows us
1414
* to have seamless transitions between the biomes (at the price of speed)
1515
*
16-
* For example, a place with no precipitation and -30 degree (celcius) weather
17-
* is a tundra, but it is also much closer to a dessert than a rain forest.
16+
* For example, a place with no precipitation and -30 degree (Celcius) weather
17+
* is a tundra, but it is also much closer to a desert than a rain forest.
1818
*
1919
*/
2020
public enum Biomes {

src/main/java/world/bentobox/skygrid/generators/BlockProbability.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void addBlock(Material material, int prob) {
3131
/**
3232
* This picks a random block with the following constraints:
3333
* A cactus is never chosen as the bottom block.
34-
* Water or lava never is placed above sugar cane or cactuses because when they grow, they will touch the
34+
* Water or lava is never placed above sugar cane or cacti because when they grow, they will touch the
3535
* liquid and cause it to flow.
3636
* @param random - random object
3737
* @param bottom - if true, result will never be CACTUS

src/main/java/world/bentobox/skygrid/generators/RandomSeries.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*/
1010
public class RandomSeries {
11-
private Random random = new Random();
11+
private final Random random = new Random();
1212
private final int[] reset;
1313
private int[] series;
1414
private int pos;

0 commit comments

Comments
 (0)