mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-24 16:31:38 +01:00
Fix for furnaces not covering all furnaces types
This commit is contained in:
parent
c6791b104e
commit
8786cdd710
@ -7,6 +7,7 @@ import com.songoda.skyblock.permission.ListeningPermission;
|
|||||||
import com.songoda.skyblock.permission.PermissionHandler;
|
import com.songoda.skyblock.permission.PermissionHandler;
|
||||||
import com.songoda.skyblock.permission.PermissionType;
|
import com.songoda.skyblock.permission.PermissionType;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.block.Furnace;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
@ -24,15 +25,13 @@ public class FurnacePermission extends ListeningPermission {
|
|||||||
|
|
||||||
@PermissionHandler
|
@PermissionHandler
|
||||||
public void onInteract(PlayerInteractEvent event) {
|
public void onInteract(PlayerInteractEvent event) {
|
||||||
|
|
||||||
|
|
||||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.LEFT_CLICK_BLOCK)
|
if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.LEFT_CLICK_BLOCK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
|
|
||||||
if (CompatibleMaterial.getMaterial(block) == CompatibleMaterial.FURNACE)
|
if (block != null && block.getState() instanceof Furnace)
|
||||||
cancelAndMessage(event, player, plugin, messageManager);
|
cancelAndMessage(event, player, plugin, messageManager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user