From ae3981cebff5100bb23ace24d952f7ae2ea70e0f Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sun, 18 Mar 2018 22:22:02 +1100 Subject: [PATCH] Check VS snipe material against WE blacklist --- .../java/com/thevoxelbox/voxelsniper/SnipeData.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/favs/src/main/java/com/thevoxelbox/voxelsniper/SnipeData.java b/favs/src/main/java/com/thevoxelbox/voxelsniper/SnipeData.java index ea5825fe..ab853f43 100644 --- a/favs/src/main/java/com/thevoxelbox/voxelsniper/SnipeData.java +++ b/favs/src/main/java/com/thevoxelbox/voxelsniper/SnipeData.java @@ -24,10 +24,13 @@ */ package com.thevoxelbox.voxelsniper; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.pattern.Pattern; import com.thevoxelbox.voxelsniper.util.VoxelList; +import org.bukkit.ChatColor; import org.bukkit.World; +import org.bukkit.entity.Player; /** * @author Piotr @@ -268,6 +271,15 @@ public class SnipeData { * @param voxelId the voxelId to set */ public final void setVoxelId(final int voxelId) { + if (WorldEdit.getInstance().getConfiguration().disallowedBlocks.contains(voxelId)) { + if (owner != null) { + Player plr = owner.getPlayer(); + if (plr != null) { + plr.sendMessage(ChatColor.RED + "You are not allowed to use '" + voxelId + "'"); + return; + } + } + } this.voxelId = voxelId; }