Skip to content

Commit 982d2af

Browse files
committed
v1.1.1 - Add world name to bentobox id.
Seems like bentobox returns the overworld entity for a lookup in another dimension, his works around that.
1 parent fb65224 commit 982d2af

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
String packagePath = 'net.frankheijden.insights.addons.bentobox'
66
group = packagePath
7-
version = '1.1.0'
7+
version = '1.1.1'
88
description = 'BentoBoxAddon'
99
sourceCompatibility = '1.8'
1010

src/main/java/net/frankheijden/insights/addons/bentobox/BentoBoxAssistant.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import net.frankheijden.insights.entities.CacheAssistant;
55
import net.frankheijden.insights.entities.CuboidSelection;
66
import org.bukkit.Location;
7+
import org.bukkit.World;
78
import world.bentobox.bentobox.BentoBox;
89
import world.bentobox.bentobox.database.objects.Island;
910
import world.bentobox.bentobox.managers.IslandsManager;
@@ -18,21 +19,21 @@ public class BentoBoxAssistant extends CacheAssistant {
1819
* There needs to be a constructor without parameters.
1920
*/
2021
public BentoBoxAssistant() {
21-
super("BentoBox", "BentoBox", "island", "v1.1.0");
22+
super("BentoBox", "BentoBox", "island", "1.1.1");
2223
}
2324

24-
public String getId(Island is) {
25-
return getPluginName() + "@" + is.getUniqueId();
25+
public String getId(Island is, World world) {
26+
return getPluginName() + "@" + is.getUniqueId() + "-" + world.getName();
2627
}
2728

28-
public Area adapt(Island is) {
29-
return Area.from(this, getId(is), Collections.singletonList(new CuboidSelection(is.getWorld(), is.getProtectionBoundingBox())));
29+
public Area adapt(Island is, World world) {
30+
return Area.from(this, getId(is, world), Collections.singletonList(new CuboidSelection(is.getWorld(), is.getProtectionBoundingBox())));
3031
}
3132

3233
@Override
3334
public Area getArea(Location location) {
3435
return manager.getIslandAt(location)
35-
.map(this::adapt)
36+
.map(is -> adapt(is, location.getWorld()))
3637
.orElse(null);
3738
}
3839
}

0 commit comments

Comments
 (0)