Check VS snipe material against WE blacklist

This commit is contained in:
Jesse Boyd 2018-03-18 22:22:02 +11:00
parent 7c3ac8e362
commit ae3981cebf
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -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;
}