Skip to content

Commit ff4b41c

Browse files
Fix broken lands integration
1 parent 88708df commit ff4b41c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@
573573
<dependency>
574574
<groupId>com.github.angeschossen</groupId>
575575
<artifactId>LandsAPI</artifactId>
576-
<version>6.12.1</version>
576+
<version>6.22.0</version>
577577
<scope>provided</scope>
578578
</dependency>
579579
<dependency>

src/main/java/org/maxgamer/quickshop/integration/lands/LandsIntegration.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@
4242
import org.maxgamer.quickshop.util.reload.ReloadResult;
4343
import org.maxgamer.quickshop.util.reload.ReloadStatus;
4444

45-
import java.util.*;
45+
import java.util.Collection;
46+
import java.util.Collections;
47+
import java.util.HashSet;
48+
import java.util.List;
49+
import java.util.Map;
50+
import java.util.Set;
51+
import java.util.UUID;
4652
import java.util.concurrent.CopyOnWriteArrayList;
4753
import java.util.stream.Collectors;
4854

@@ -81,7 +87,8 @@ public boolean canCreateShopHere(@NotNull Player player, @NotNull Location locat
8187
if (landsIntegration.getLandWorld(location.getWorld()) == null) {
8288
return ignoreDisabledWorlds;
8389
}
84-
Land land = landsIntegration.getLand(location);
90+
org.bukkit.Chunk chunk = location.getChunk();
91+
Land land = landsIntegration.getLand(chunk.getWorld(), chunk.getX(), chunk.getZ());
8592
if (land != null) {
8693
return land.getOwnerUID().equals(player.getUniqueId()) || land.isTrusted(player.getUniqueId());
8794
} else {
@@ -100,7 +107,7 @@ public boolean canTradeShopHere(@NotNull Player player, @NotNull Location locati
100107
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
101108
public void onLandsDelete(LandDeleteEvent event) {
102109
@NotNull DeleteReason reason = event.getReason();
103-
if (reason != DeleteReason.EXPIRED) {
110+
if (reason != me.angeschossen.lands.api.events.land.DeleteReason.CAMP_EXPIRED) {
104111
if (!deleteWhenLandDeleted) {
105112
return;
106113
}
@@ -110,7 +117,7 @@ public void onLandsDelete(LandDeleteEvent event) {
110117
Land land = event.getLand();
111118
Set<UUID> uuids = new HashSet<>(land.getTrustedPlayers());
112119
uuids.add(land.getOwnerUID());
113-
deleteShopInLand(event.getLand(), uuids, reason == DeleteReason.EXPIRED ? Reason.EXPIRED : Reason.DELETED);
120+
deleteShopInLand(event.getLand(), uuids, reason == DeleteReason.CAMP_EXPIRED ? Reason.EXPIRED : Reason.DELETED);
114121
}
115122

116123
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)

0 commit comments

Comments
 (0)