mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-27 04:35:46 +01:00
Cauldron permission
This commit is contained in:
parent
47ef00bb6f
commit
cd15898858
@ -86,6 +86,7 @@ public class PermissionManager {
|
|||||||
new ItemPickupPermission(),
|
new ItemPickupPermission(),
|
||||||
new ItemDropPermission(),
|
new ItemDropPermission(),
|
||||||
new FishingPermission(plugin),
|
new FishingPermission(plugin),
|
||||||
|
new CauldronPermission(plugin),
|
||||||
|
|
||||||
// Basic
|
// Basic
|
||||||
new MemberPermission(),
|
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'
|
Displayname: '&aPvP'
|
||||||
Noteblock:
|
Noteblock:
|
||||||
Displayname: '&aNoteblock use'
|
Displayname: '&aNoteblock use'
|
||||||
|
Cauldron:
|
||||||
|
Displayname: '&aCauldron use'
|
||||||
Minecart:
|
Minecart:
|
||||||
Displayname: '&aMinecart'
|
Displayname: '&aMinecart'
|
||||||
Damage:
|
Damage:
|
||||||
|
@ -28,6 +28,7 @@ Settings:
|
|||||||
LeverButton: false
|
LeverButton: false
|
||||||
Milking: false
|
Milking: false
|
||||||
Jukebox: false
|
Jukebox: false
|
||||||
|
Cauldron: false
|
||||||
PressurePlate: false
|
PressurePlate: false
|
||||||
Redstone: false
|
Redstone: false
|
||||||
Shearing: false
|
Shearing: false
|
||||||
@ -59,6 +60,7 @@ Settings:
|
|||||||
AnimalBreeding: true
|
AnimalBreeding: true
|
||||||
Brewing: true
|
Brewing: true
|
||||||
Bucket: true
|
Bucket: true
|
||||||
|
Cauldron: true
|
||||||
WaterCollection: true
|
WaterCollection: true
|
||||||
Storage: true
|
Storage: true
|
||||||
Workbench: true
|
Workbench: true
|
||||||
@ -130,6 +132,7 @@ Settings:
|
|||||||
Crop: true
|
Crop: true
|
||||||
Door: true
|
Door: true
|
||||||
Gate: true
|
Gate: true
|
||||||
|
Cauldron: true
|
||||||
Projectile: true
|
Projectile: true
|
||||||
Enchant: true
|
Enchant: true
|
||||||
Fire: true
|
Fire: true
|
||||||
|
Loading…
Reference in New Issue
Block a user