Fixed for multi block placement bypass

This commit is contained in:
Fabrizio La Rosa 2020-07-12 12:47:09 +02:00
parent a6035254b3
commit 86f24d306a
2 changed files with 9 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockMultiPlaceEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.*;
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
@ -37,6 +38,8 @@ public abstract class ListeningPermission extends BasicPermission {
public void onBreak(BlockBreakEvent event) {}
public void onPlace(BlockPlaceEvent event) {}
public void onMultiPlace(BlockMultiPlaceEvent event) {}
public void onVehicleDamage(VehicleDamageEvent event) {}

View File

@ -8,6 +8,7 @@ import com.songoda.skyblock.permission.PermissionHandler;
import com.songoda.skyblock.permission.PermissionType;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockMultiPlaceEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.PlayerInteractEvent;
@ -37,4 +38,9 @@ public class PlacePermission extends ListeningPermission {
public void onPlace(BlockPlaceEvent event) {
cancelAndMessage(event, event.getPlayer(), plugin, messageManager);
}
@PermissionHandler
public void onMultiPlace(BlockMultiPlaceEvent event) {
cancelAndMessage(event, event.getPlayer(), plugin, messageManager);
}
}