mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-25 22:31:21 +01:00
Fixed a NPE in TerrainCheck pre shop creation
This commit is contained in:
parent
4ba69135cb
commit
616950e54a
@ -7,6 +7,7 @@ import com.Acrobot.ChestShop.Permission;
|
||||
import com.Acrobot.ChestShop.Security;
|
||||
import com.Acrobot.ChestShop.Signs.ChestShopSign;
|
||||
import com.Acrobot.ChestShop.Utils.uBlock;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Chest;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -41,8 +42,9 @@ public class TerrainChecker implements Listener {
|
||||
}
|
||||
|
||||
Chest connectedChest = uBlock.findConnectedChest(event.getSign().getBlock());
|
||||
Location chestLocation = (connectedChest != null ? connectedChest.getLocation() : null);
|
||||
|
||||
BuildPermissionEvent bEvent = new BuildPermissionEvent(player, connectedChest.getLocation(), event.getSign().getLocation());
|
||||
BuildPermissionEvent bEvent = new BuildPermissionEvent(player, chestLocation, event.getSign().getLocation());
|
||||
ChestShop.callEvent(bEvent);
|
||||
|
||||
if (!bEvent.isAllowed()) {
|
||||
|
Loading…
Reference in New Issue
Block a user