mirror of
https://github.com/zDevelopers/ImageOnMap.git
synced 2024-11-16 15:15:11 +01:00
Add permission to remove splattermap off wall
This commit is contained in:
parent
3753a03ef3
commit
13881f751e
@ -44,6 +44,7 @@ public enum Permissions
|
||||
LIST("imageonmap.list"),
|
||||
GET("imageonmap.get"),
|
||||
RENAME("imageonmap.rename"),
|
||||
REMOVE_SPLATTER_MAP("imageonmap.removesplattermap"),
|
||||
DELETE("imageonmap.delete"),
|
||||
ADMINISTRATIVE("imageonmap.administrative"),
|
||||
BYPASS_SIZE("imageonmap.bypasssize")
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
package fr.moribus.imageonmap.ui;
|
||||
|
||||
import fr.moribus.imageonmap.Permissions;
|
||||
import fr.moribus.imageonmap.map.ImageMap;
|
||||
import fr.moribus.imageonmap.map.MapManager;
|
||||
import fr.moribus.imageonmap.map.PosterMap;
|
||||
@ -285,17 +286,20 @@ public class MapItemManager implements Listener
|
||||
ItemStack item = frame.getItem();
|
||||
if (frame.getItem().getType() != Material.FILLED_MAP) return;
|
||||
|
||||
if (player.isSneaking())
|
||||
if (Permissions.REMOVE_SPLATTER_MAP.grantedTo(player))
|
||||
{
|
||||
PosterMap poster = SplatterMapManager.removeSplatterMap(frame,player);
|
||||
if (poster != null)
|
||||
if (player.isSneaking())
|
||||
{
|
||||
event.setCancelled(true);
|
||||
PosterMap poster = SplatterMapManager.removeSplatterMap(frame,player);
|
||||
if (poster != null)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
if (player.getGameMode() != GameMode.CREATIVE || !SplatterMapManager.hasSplatterMap(player, poster))
|
||||
poster.give(player);
|
||||
if (player.getGameMode() != GameMode.CREATIVE || !SplatterMapManager.hasSplatterMap(player, poster))
|
||||
poster.give(player);
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,15 +23,16 @@ permissions:
|
||||
imageonmap.get: true
|
||||
imageonmap.explore: true
|
||||
imageonmap.rename: true
|
||||
imageonmap.removesplattermap: true
|
||||
imageonmap.delete: true
|
||||
imageonmap.bypasssize: false
|
||||
|
||||
imageonmap.userender:
|
||||
description: "Allows you to use /tomap and related commands (/maptool getremaing). Alias of imageonmap.new."
|
||||
description: "Allows you to use /tomap and related commands (/maptool getremaining). Alias of imageonmap.new."
|
||||
default: true
|
||||
|
||||
imageonmap.new:
|
||||
description: "Allows you to use /tomap and related commands (/maptool getremaing)."
|
||||
description: "Allows you to use /tomap and related commands (/maptool getremaining)."
|
||||
default: true
|
||||
|
||||
imageonmap.list:
|
||||
@ -39,7 +40,7 @@ permissions:
|
||||
default: true
|
||||
|
||||
imageonmap.get:
|
||||
description: "Allows you to get a new map among the ones you already rendered, and related commands (/maptool getremaing)."
|
||||
description: "Allows you to get a new map among the ones you already rendered, and related commands (/maptool getremaining)."
|
||||
default: true
|
||||
|
||||
imageonmap.explore:
|
||||
@ -54,6 +55,10 @@ permissions:
|
||||
description: "Allows you to delete a map you rendered in the past."
|
||||
default: true
|
||||
|
||||
imageonmap.removesplattermap:
|
||||
description: "Allows you to remove a splatter map from a wall by sneaking and breaking a map."
|
||||
default: true
|
||||
|
||||
imageonmap.administrative:
|
||||
description: "Allows you to perform administrative tasks (like /maptool migrate)."
|
||||
default: op
|
||||
|
Loading…
Reference in New Issue
Block a user