Allow the player to create a shop if the "chest-access" flag is set

This commit is contained in:
Flowsqy 2022-06-26 22:33:36 +02:00
parent 63c7b677f5
commit b6eb7f7d91

View File

@ -3,6 +3,7 @@ package de.epiceric.shopchest.external.worldguard;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldguard.protection.flags.Flags;
import de.epiceric.shopchest.hook.CreateShopHook;
import de.epiceric.shopchest.hook.ExtendShopHook;
import org.bukkit.block.Block;
@ -28,7 +29,7 @@ public class WGCreateHook extends WGHook implements CreateShopHook, ExtendShopHo
final World world = BukkitAdapter.adapt(newestBlock.getWorld());
final List<Location> locations = getLocations(world, currentShopBlocks);
locations.add(getLocation(world, newestBlock));
return test(locations, null, registry.getCreate().get());
return test(locations, player, Flags.CHEST_ACCESS, registry.getCreate().get());
}
}