fixed pixelblocks being placable in protected regions

This commit is contained in:
2024-12-24 18:06:43 +01:00
parent fc043a2529
commit 224f4a9f1e
3 changed files with 5 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
package eu.mhsl.minecraft.pixelblocks.utils;
import eu.mhsl.minecraft.pixelblocks.Main;
import eu.mhsl.minecraft.pixelblocks.pixelblock.PixelBlock;
import eu.mhsl.minecraft.pixelblocks.pixelblock.PixelBlockWorld;
import org.bukkit.World;
@@ -13,6 +14,7 @@ public class EventCanceling {
if(!PixelBlockWorld.isPixelWorld(world)) return;
@Nullable PixelBlock pixelBlock = PixelBlock.getPixelBlockFromBlockWorld(world);
if(pixelBlock == null) {
Main.logger().warning("Cancelling place event because PixelBlock could not be found: " + world.getName());
event.setCancelled(true);
return;
}