Fix disallowedBlocks

This commit is contained in:
Jesse Boyd
2019-04-11 14:05:29 +10:00
parent f726c9afc4
commit 24590199c8
6 changed files with 45 additions and 24 deletions

View File

@ -272,7 +272,7 @@ public class SnipeData {
* @param voxelId the voxelId to set
*/
public final void setVoxelId(final int voxelId) {
if (WorldEdit.getInstance().getConfiguration().disallowedBlocks.contains(BlockTypes.getFromStateId(voxelId).getId())) {
if (WorldEdit.getInstance().getConfiguration().checkDisallowedBlocks(BlockTypes.getFromStateId(voxelId).getDefaultState())) {
if (owner != null) {
Player plr = owner.getPlayer();
if (plr != null) {

View File

@ -55,7 +55,7 @@ public class VoxelVoxelCommand extends VoxelCommand {
Material blockType = block.getType();
BlockType weType = BukkitAdapter.adapt(blockType);
if(!player.hasPermission("voxelsniper.ignorelimitations") && WorldEdit.getInstance().getConfiguration().disallowedBlocks.contains(weType.getId())) {
if(!player.hasPermission("voxelsniper.ignorelimitations") && WorldEdit.getInstance().getConfiguration().checkDisallowedBlocks(weType.getDefaultState())) {
player.sendMessage("You are not allowed to use " + blockType.name() + ". (WorldEdit config.yml)");
return true;
}
@ -68,7 +68,7 @@ public class VoxelVoxelCommand extends VoxelCommand {
} else {
BlockType weType = BlockTypes.parse(args[0]);
if(weType != null) {
if(!player.hasPermission("voxelsniper.ignorelimitations") && WorldEdit.getInstance().getConfiguration().disallowedBlocks.contains(weType.getId())) {
if(!player.hasPermission("voxelsniper.ignorelimitations") && WorldEdit.getInstance().getConfiguration().checkDisallowedBlocks(weType.getDefaultState())) {
player.sendMessage("You are not allowed to use " + weType + ".");
return true;
} else {