Skip to content

Commit 769fdea

Browse files
committed
Push Biomes 1.6.0.1 Release
2 parents a657b23 + b0df4ce commit 769fdea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3254
-696
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-37
This file was deleted.

.github/ISSUE_TEMPLATE/contributor-request.md

-18
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

-21
This file was deleted.

README.md

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

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

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

@@ -23,21 +23,8 @@ If you like this addon but something is missing or is not working as you want, y
2323

2424
## Config.yml
2525

26-
The *config.yml* has following sections:
27-
28-
* Advanced Menu: if this is *true*, users will be able to choose all options how the biome can be updated.
29-
* Default Type: this allows to choose default selected type that will be available when users opens Biome GUI.
30-
Valid values are *'ISLAND', 'CHUNK' and 'SQUARE'*
31-
* Default Size: this allows to set default value that will be set when Biome GUI is opened. It must be integer larger then 0.
32-
* Reset Biomes: if this is *true*, on owner change, addon will reset biome on whole island to default biome, if user does not have biomes.set permission.
33-
* Timeout: this allows to set some delay before user can change biome on his island again.
34-
* biomes-visibility: this variable allows to choose which biomes users can see in Biomes GUI.
35-
Valid values are *'ALL', 'DEPLOYED' , 'ACCESSIBLE' and 'TOGGLEABLE'*
36-
* disabled-gamemodes: this allows to disable Biomes Addon in certain GameModes. To disable GameMode just need to add new line with "-" in front of GameMode name, f.e.:
37-
```
38-
disabled-gamemodes:
39-
- BSkyBlock
40-
```
26+
After addon is successful installed, it will create config.yml file. Every option in this file comes with comments about them. Please check file for more information.
27+
Most of options are also editable admin via commands.
4128

4229
## Biomes.yml
4330

@@ -49,6 +36,8 @@ Note that you must import biomes into both BSkyBlock and AcidIsland separately.
4936

5037
## User commands
5138

39+
Users can access to biomes addon commands with `/[gamemode] biomes` command. By default for BSkyBlock it is **/island biomes**, for AcidIsland - **/ai biomes**, for CaveBlock - **/cave biomes**, for SkyGrid - **/sg biomes**.
40+
5241
* `/is biomes`: This method opens GUI that allows to change biome on User island.
5342
* `/is biomes help`: Show help for all the commands
5443
* `/is biomes info <biome>`: This command returns information about given biome, like cost and necessary level.

TODO.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ This page contains plans for each Addon version.
77
- [x] On owner change, reset biomes that is not available for new owner.
88

99
## 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
10+
- [x] Rework GUI again:
11+
- [x] Do the same tricks as in Challenges GUI.
12+
- [x] Add proper Biomes Description #18
13+
- [x] Simplify user GUI
1414
- [ ] Store Biome change information per:
1515
- [ ] Player
1616
- [ ] Island
1717
- [ ] Implement more cost options:
1818
- [ ] Cost per biome change (linear / exponential)
1919
- [ ] Cost per block
20-
- [ ] Remove deprecated code.
20+
- [x] Remove deprecated code.
2121

2222
## Release 0.4.0
2323
- [ ] Create unlockable biomes:

pom.xml

+6-12
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@
4747
<powermock.version>1.7.4</powermock.version>
4848
<!-- More visible way how to change dependency versions -->
4949
<spigot.version>1.13.2-R0.1-SNAPSHOT</spigot.version>
50-
<bentobox.version>1.5.0</bentobox.version>
51-
<level.version>1.4.0</level.version>
50+
<bentobox.version>1.6.0</bentobox.version>
51+
<level.version>1.6.0</level.version>
5252
<vault.version>1.7</vault.version>
53-
<anvilgui.version>1.2.1-SNAPSHOT</anvilgui.version>
5453
<!-- Revision variable removes warning about dynamic version -->
5554
<revision>${build.version}-SNAPSHOT</revision>
5655
<!-- This allows to change between versions and snapshots. -->
57-
<build.version>1.5.0.0</build.version>
56+
<build.version>1.6.0.1</build.version>
5857
<build.number>-LOCAL</build.number>
5958
</properties>
6059

@@ -108,8 +107,8 @@
108107
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
109108
</repository>
110109
<repository>
111-
<id>wesjd-repo</id>
112-
<url>https://nexus.wesjd.net/repository/thirdparty/</url>
110+
<id>jitpack.io</id>
111+
<url>https://jitpack.io</url>
113112
</repository>
114113
</repositories>
115114

@@ -131,19 +130,14 @@
131130
<artifactId>level</artifactId>
132131
<version>${level.version}</version>
133132
<scope>provided</scope>
134-
</dependency>
135-
<dependency>
136-
<groupId>net.wesjd</groupId>
137-
<artifactId>anvilgui</artifactId>
138-
<version>${anvilgui.version}</version>
139133
</dependency>
140134
<dependency>
141135
<groupId>net.milkbowl.vault</groupId>
142136
<artifactId>VaultAPI</artifactId>
143137
<version>${vault.version}</version>
144138
<scope>provided</scope>
145139
</dependency>
146-
</dependencies>
140+
</dependencies>
147141

148142
<build>
149143
<!-- By default ${revision} is ${build.version}-SNAPSHOT -->

src/main/java/world/bentobox/biomes/BiomesAddon.java

+44-5
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@
33

44
import org.bukkit.Bukkit;
55
import org.bukkit.Material;
6-
import java.util.ArrayList;
7-
import java.util.List;
6+
import org.bukkit.World;
7+
import java.util.Iterator;
88
import java.util.Optional;
99

1010
import world.bentobox.bentobox.api.addons.Addon;
11-
import world.bentobox.bentobox.api.addons.GameModeAddon;
1211
import world.bentobox.bentobox.api.configuration.Config;
1312
import world.bentobox.bentobox.api.flags.Flag;
1413
import world.bentobox.bentobox.hooks.VaultHook;
1514
import world.bentobox.bentobox.managers.RanksManager;
1615
import world.bentobox.biomes.commands.admin.AdminCommand;
1716
import world.bentobox.biomes.commands.user.BiomesCommand;
17+
import world.bentobox.biomes.database.objects.BiomeChunkUpdateObject;
1818
import world.bentobox.biomes.handlers.BiomeDataRequestHandler;
1919
import world.bentobox.biomes.handlers.BiomeListRequestHandler;
2020
import world.bentobox.biomes.handlers.ChangeBiomeRequestHandler;
2121
import world.bentobox.biomes.listeners.ChangeOwnerListener;
2222
import world.bentobox.biomes.config.Settings;
23+
import world.bentobox.biomes.listeners.ChunkLoadListener;
2324
import world.bentobox.level.Level;
2425

2526

@@ -121,6 +122,7 @@ public void onEnable()
121122

122123
// Register the reset listener
123124
this.registerListener(new ChangeOwnerListener(this));
125+
this.registerListener(new ChunkLoadListener(this));
124126

125127
// Register Flags
126128
this.registerFlag(BIOMES_WORLD_PROTECTION);
@@ -131,6 +133,37 @@ public void onEnable()
131133
this.registerRequestHandler(new BiomeListRequestHandler(this));
132134

133135
this.registerRequestHandler(new ChangeBiomeRequestHandler(this));
136+
137+
// This task will force-load chunk every 5th tick if its biome is not updated.
138+
Bukkit.getScheduler().runTaskTimer(this.getPlugin(), () -> {
139+
Iterator<BiomeChunkUpdateObject> iterator = this.addonManager.getBiomeUpdaterCollection().iterator();
140+
141+
// if there is nothing to load, then skip.
142+
if (!iterator.hasNext())
143+
{
144+
return;
145+
}
146+
147+
BiomeChunkUpdateObject updater = iterator.next();
148+
149+
// if chunk is already force-loaded, then skip.
150+
while (iterator.hasNext() && updater.isForceLoaded())
151+
{
152+
updater = iterator.next();
153+
}
154+
155+
World world = updater.getWorld();
156+
157+
// if chunk is loaded then skip.
158+
if (!world.isChunkLoaded(updater.getChunkX(), updater.getChunkZ()))
159+
{
160+
// Set flag as force-loaded.
161+
updater.setForceLoaded(true);
162+
163+
// force-load chunk.
164+
world.loadChunk(updater.getChunkX(), updater.getChunkZ());
165+
}
166+
}, 5L, 5L);
134167
}
135168
else
136169
{
@@ -315,15 +348,21 @@ public boolean isLevelProvided()
315348
* player to their island. Useful for skygrid without protection flags.
316349
*/
317350
public static Flag BIOMES_WORLD_PROTECTION =
318-
new Flag.Builder("BIOMES_WORLD_PROTECTION", Material.GRASS_BLOCK).type(Flag.Type.WORLD_SETTING).defaultSetting(true).build();
351+
new Flag.Builder("BIOMES_WORLD_PROTECTION", Material.GRASS_BLOCK).
352+
type(Flag.Type.WORLD_SETTING).
353+
mode(Flag.Mode.ADVANCED).
354+
defaultSetting(true).
355+
build();
319356

320357
/**
321358
* This flag allows to define which users can change biomes. F.e. it can be set
322359
* that only Island owner can change biomes.
323360
* By default it is set to Visitor.
324361
*/
325362
public static Flag BIOMES_ISLAND_PROTECTION =
326-
new Flag.Builder("BIOMES_ISLAND_PROTECTION", Material.GRASS_BLOCK).defaultRank(RanksManager.VISITOR_RANK).build();
363+
new Flag.Builder("BIOMES_ISLAND_PROTECTION", Material.GRASS_BLOCK).
364+
mode(Flag.Mode.ADVANCED).
365+
build();
327366

328367

329368
// ---------------------------------------------------------------------

0 commit comments

Comments
 (0)