mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-23 10:45:54 +01:00
Cauldron permission
This commit is contained in:
parent
47ef00bb6f
commit
cd15898858
@ -86,6 +86,7 @@ public class PermissionManager {
|
||||
new ItemPickupPermission(),
|
||||
new ItemDropPermission(),
|
||||
new FishingPermission(plugin),
|
||||
new CauldronPermission(plugin),
|
||||
|
||||
// Basic
|
||||
new MemberPermission(),
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.songoda.skyblock.permission.permissions.listening;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.skyblock.SkyBlock;
|
||||
import com.songoda.skyblock.message.MessageManager;
|
||||
import com.songoda.skyblock.permission.ListeningPermission;
|
||||
import com.songoda.skyblock.permission.PermissionHandler;
|
||||
import com.songoda.skyblock.permission.PermissionType;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
public class CauldronPermission extends ListeningPermission {
|
||||
|
||||
private final SkyBlock plugin;
|
||||
private final MessageManager messageManager;
|
||||
|
||||
public CauldronPermission(SkyBlock plugin) {
|
||||
super("Cauldron", CompatibleMaterial.CAULDRON, PermissionType.GENERIC);
|
||||
this.plugin = plugin;
|
||||
this.messageManager = plugin.getMessageManager();
|
||||
}
|
||||
|
||||
@PermissionHandler
|
||||
public void onInteract(PlayerInteractEvent event) {
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
if(event.getItem() != null && !event.getItem().getType().isBlock()){
|
||||
Player player = event.getPlayer();
|
||||
Block block = event.getClickedBlock();
|
||||
|
||||
|
||||
if (CompatibleMaterial.getMaterial(block) == CompatibleMaterial.CAULDRON)
|
||||
cancelAndMessage(event, player, plugin, messageManager);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1168,6 +1168,8 @@ Menu:
|
||||
Displayname: '&aPvP'
|
||||
Noteblock:
|
||||
Displayname: '&aNoteblock use'
|
||||
Cauldron:
|
||||
Displayname: '&aCauldron use'
|
||||
Minecart:
|
||||
Displayname: '&aMinecart'
|
||||
Damage:
|
||||
|
@ -28,6 +28,7 @@ Settings:
|
||||
LeverButton: false
|
||||
Milking: false
|
||||
Jukebox: false
|
||||
Cauldron: false
|
||||
PressurePlate: false
|
||||
Redstone: false
|
||||
Shearing: false
|
||||
@ -59,6 +60,7 @@ Settings:
|
||||
AnimalBreeding: true
|
||||
Brewing: true
|
||||
Bucket: true
|
||||
Cauldron: true
|
||||
WaterCollection: true
|
||||
Storage: true
|
||||
Workbench: true
|
||||
@ -130,6 +132,7 @@ Settings:
|
||||
Crop: true
|
||||
Door: true
|
||||
Gate: true
|
||||
Cauldron: true
|
||||
Projectile: true
|
||||
Enchant: true
|
||||
Fire: true
|
||||
|
Loading…
Reference in New Issue
Block a user