Skip to content

Commit fb65224

Browse files
committed
v1.1.0 - Conform to new Insights assistant update
1 parent 06d4af5 commit fb65224

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ plugins {
44

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

1111
repositories {
@@ -16,7 +16,7 @@ repositories {
1616
}
1717

1818
dependencies {
19-
compileOnly 'com.github.FrankHeijden:Insights:feature~cache-SNAPSHOT'
20-
compileOnly 'com.destroystokyo.paper:paper-api:1.15.2-R0.1-SNAPSHOT'
21-
compileOnly 'world.bentobox:bentobox:1.14.0-SNAPSHOT'
19+
compileOnly 'com.github.FrankHeijden:Insights:1a81653312'
20+
compileOnly 'com.destroystokyo.paper:paper-api:1.16.4-R0.1-SNAPSHOT'
21+
compileOnly 'world.bentobox:bentobox:1.15.4-SNAPSHOT'
2222
}

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
rootProject.name = 'InsightsBentoBoxAddon'
1+
rootProject.name = 'BentoBoxAddon'
22

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package net.frankheijden.insights.addons.bentobox;
22

3+
import net.frankheijden.insights.entities.Area;
34
import net.frankheijden.insights.entities.CacheAssistant;
4-
import net.frankheijden.insights.entities.Selection;
5+
import net.frankheijden.insights.entities.CuboidSelection;
56
import org.bukkit.Location;
67
import world.bentobox.bentobox.BentoBox;
78
import world.bentobox.bentobox.database.objects.Island;
89
import world.bentobox.bentobox.managers.IslandsManager;
910

11+
import java.util.Collections;
12+
1013
public class BentoBoxAssistant extends CacheAssistant {
1114

1215
private final IslandsManager manager = BentoBox.getInstance().getIslands();
@@ -15,15 +18,19 @@ public class BentoBoxAssistant extends CacheAssistant {
1518
* There needs to be a constructor without parameters.
1619
*/
1720
public BentoBoxAssistant() {
18-
super("BentoBox", "island");
21+
super("BentoBox", "BentoBox", "island", "v1.1.0");
22+
}
23+
24+
public String getId(Island is) {
25+
return getPluginName() + "@" + is.getUniqueId();
1926
}
2027

21-
public Selection adapt(Island is) {
22-
return new Selection(is.getWorld(), is.getProtectionBoundingBox());
28+
public Area adapt(Island is) {
29+
return Area.from(this, getId(is), Collections.singletonList(new CuboidSelection(is.getWorld(), is.getProtectionBoundingBox())));
2330
}
2431

2532
@Override
26-
public Selection getSelection(Location location) {
33+
public Area getArea(Location location) {
2734
return manager.getIslandAt(location)
2835
.map(this::adapt)
2936
.orElse(null);

0 commit comments

Comments
 (0)