mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 07:49:03 +00:00
New general Barrel open perms checker + Towny
This commit is contained in:
@@ -2,6 +2,7 @@ package com.dre.brewery.api.events.barrel;
|
||||
|
||||
import com.dre.brewery.Barrel;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
@@ -16,12 +17,18 @@ public class BarrelAccessEvent extends BarrelEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private final Player player;
|
||||
private final Block clickedBlock;
|
||||
private final BlockFace clickedBlockFace;
|
||||
private boolean isCancelled;
|
||||
|
||||
public BarrelAccessEvent(Barrel barrel, Player player, Block clickedBlock) {
|
||||
this(barrel, player, clickedBlock, BlockFace.UP);
|
||||
}
|
||||
|
||||
public BarrelAccessEvent(Barrel barrel, Player player, Block clickedBlock, BlockFace clickedBlockFace) {
|
||||
super(barrel);
|
||||
this.player = player;
|
||||
this.clickedBlock = clickedBlock;
|
||||
this.clickedBlockFace = clickedBlockFace;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,6 +39,13 @@ public class BarrelAccessEvent extends BarrelEvent implements Cancellable {
|
||||
return clickedBlock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the clicked Block Face when clicking on the Barrel Block
|
||||
*/
|
||||
public BlockFace getClickedBlockFace() {
|
||||
return clickedBlockFace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return isCancelled;
|
||||
|
||||
Reference in New Issue
Block a user