4242import org .maxgamer .quickshop .util .reload .ReloadResult ;
4343import 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 ;
4652import java .util .concurrent .CopyOnWriteArrayList ;
4753import 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