diff --git a/src/main/java/net/knarcraft/paidsigns/listener/SignListener.java b/src/main/java/net/knarcraft/paidsigns/listener/SignListener.java index e560359..1985514 100644 --- a/src/main/java/net/knarcraft/paidsigns/listener/SignListener.java +++ b/src/main/java/net/knarcraft/paidsigns/listener/SignListener.java @@ -8,8 +8,9 @@ import net.knarcraft.paidsigns.formatting.PaidSignsTranslatableMessage; import net.knarcraft.paidsigns.manager.EconomyManager; import net.knarcraft.paidsigns.manager.TrackedSignManager; import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.block.Block; -import org.bukkit.block.data.type.Sign; +import org.bukkit.block.Sign; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -120,12 +121,13 @@ public class SignListener implements Listener { } performPaidSignTransaction(paidSign, player, event); + Location signLocation = event.getBlock().getLocation(); if (!event.isCancelled()) { //Immediately refund if a plugin destroyed the sign within 5 ticks of the creation Bukkit.getScheduler().scheduleSyncDelayedTask(PaidSigns.getInstance(), () -> { - Block block = event.getBlock(); - if (!(block.getBlockData() instanceof Sign)) { + Block block = signLocation.getBlock(); + if (!(block.getState() instanceof Sign)) { try { TrackedSignManager.removeTrackedSign(block.getLocation(), true, true); } catch (IOException e) {