本文整理汇总了Java中org.bukkit.event.block.EntityBlockFormEvent.setCancelled方法的典型用法代码示例。如果您正苦于以下问题:Java EntityBlockFormEvent.setCancelled方法的具体用法?Java EntityBlockFormEvent.setCancelled怎么用?Java EntityBlockFormEvent.setCancelled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.event.block.EntityBlockFormEvent
的用法示例。
在下文中一共展示了EntityBlockFormEvent.setCancelled方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEntityBlockFormEvent
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityBlockFormEvent(EntityBlockFormEvent event)
{
if (WorldGuardExtraFlagsPlugin.isSupportFrostwalker())
{
BlockState newState = event.getNewState();
if (newState.getType() == Material.FROSTED_ICE)
{
if (event.getEntity() instanceof Player)
{
Player player = (Player)event.getEntity();
if (!WorldGuardUtils.hasBypass(player))
{
ApplicableRegionSet regions = WorldGuardExtraFlagsPlugin.getWorldGuardPlugin().getRegionContainer().createQuery().getApplicableRegions(newState.getLocation());
if (regions.queryValue(WorldGuardUtils.wrapPlayer(player), FlagUtils.FROSTWALKER) == State.DENY)
{
event.setCancelled(true);
}
}
}
}
}
}
示例2: onPlayerFrostWalk
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler
public void onPlayerFrostWalk(EntityBlockFormEvent e) {
Region r = RedProtect.get().rm.getTopRegion(e.getBlock().getLocation());
if (r != null){
return;
}
RedProtect.get().logger.debug("RPGlobalListener - EntityBlockFormEvent canceled? " + e.isCancelled());
if (e.getEntity() instanceof Player){
Player p = (Player) e.getEntity();
if (!RPConfig.getGlobalFlagBool(p.getWorld().getName()+".iceform-by.player") && !p.hasPermission("redprotect.bypass.world")){
e.setCancelled(true);
}
}
else if (!RPConfig.getGlobalFlagBool(e.getEntity().getWorld().getName()+".iceform-by.entity")){
e.setCancelled(true);
}
}
示例3: onBlockForm
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
/**
* Handles Frost Walking on visitor's islands
* @param e
*/
@EventHandler(priority = EventPriority.LOW, ignoreCancelled=true)
public void onBlockForm(EntityBlockFormEvent e) {
if (DEBUG) {
plugin.getLogger().info("1.9 " +e.getEventName());
}
if (e.getEntity() instanceof Player && e.getNewState().getType().equals(Material.FROSTED_ICE)) {
Player player= (Player) e.getEntity();
if (!Util.inWorld(player)) {
return;
}
if (player.isOp()) {
return;
}
// This permission bypasses protection
if (VaultHelper.hasPerm(player, Settings.PERMPREFIX + "mod.bypassprotect")) {
return;
}
// Check island
Island island = plugin.getIslands().getIslandAt(player.getLocation());
if (island == null && Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
return;
}
if (island !=null) {
if (island.getMembers().contains(player.getUniqueId()) || island.getFlag(SettingsFlag.PLACE_BLOCKS)) {
return;
}
}
// Silently cancel the event
e.setCancelled(true);
}
}
示例4: onBlockForm
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onBlockForm(EntityBlockFormEvent event) {
Entity e = event.getEntity();
if (ReflectionUtil.getEntityHandle(e) instanceof IEntityPet && event.getNewState().getType().equals(Material.SNOW)) {
event.setCancelled(true);
event.getNewState().setType(Material.AIR);
}
}
示例5: disableFrostWalker
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void disableFrostWalker(EntityBlockFormEvent e) {
if (config.checkEnabled(Config.Node.FROSTWALKER, e.getBlock().getLocation())
&& e.getEntity() instanceof Player
&& !wg.canBuild((Player) e.getEntity(), e.getBlock())) e.setCancelled(true);
}
示例6: onBlockForm
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onBlockForm(EntityBlockFormEvent event) {
Entity e = event.getEntity();
if (plugin.isPet(e) && event.getNewState().getType().equals(Material.SNOW)) {
event.setCancelled(true);
event.getNewState().setType(Material.AIR);
}
}
示例7: onPlayerFrostWalk
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler
public void onPlayerFrostWalk(EntityBlockFormEvent e) {
if (e.getEntity() instanceof Player){
return;
}
RedProtect.get().logger.debug("RPEntityListener - EntityBlockFormEvent canceled? " + e.isCancelled());
Region r = RedProtect.get().rm.getTopRegion(e.getBlock().getLocation());
if (r != null && !r.canIceForm()){
e.setCancelled(true);
}
}
示例8: onPlayerFrostWalk
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOW)
public void onPlayerFrostWalk(EntityBlockFormEvent e) {
if (!(e.getEntity() instanceof Player)){
return;
}
RedProtect.get().logger.debug("RPPlayerListener - EntityBlockFormEvent canceled? " + e.isCancelled());
Player p = (Player) e.getEntity();
Region r = RedProtect.get().rm.getTopRegion(e.getBlock().getLocation());
if (r != null && e.getNewState().getType().name().contains("FROSTED_ICE") && !r.canIceForm(p)){
e.setCancelled(true);
}
}
示例9: onEntityBlockForm
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onEntityBlockForm(final EntityBlockFormEvent e) {
final String world = e.getBlock().getWorld().getName();
if (!PlotSquared.isPlotWorld(world)) {
return;
}
if ((!(e.getEntity() instanceof Player))) {
if (MainUtil.isPlotArea(BukkitUtil.getLocation(e.getBlock().getLocation()))) {
e.setCancelled(true);
}
}
}
示例10: onBlockForm
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
/**
* Handles Frost Walking on visitor's islands
* @param e
*/
@EventHandler(priority = EventPriority.LOW, ignoreCancelled=true)
public void onBlockForm(EntityBlockFormEvent e) {
if (DEBUG) {
plugin.getLogger().info("1.9 " +e.getEventName());
}
if (e.getEntity() instanceof Player && e.getNewState().getType().equals(Material.FROSTED_ICE)) {
Player player= (Player) e.getEntity();
if (!IslandGuard.inWorld(player)) {
return;
}
if (player.isOp()) {
return;
}
// This permission bypasses protection
if (VaultHelper.checkPerm(player, Settings.PERMPREFIX + "mod.bypassprotect")) {
return;
}
// Check island
Island island = plugin.getGrid().getIslandAt(player.getLocation());
if (island == null && Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {
return;
}
if (island !=null) {
if (island.getMembers().contains(player.getUniqueId()) || island.getIgsFlag(SettingsFlag.PLACE_BLOCKS)) {
return;
}
}
// Silently cancel the event
e.setCancelled(true);
}
}
示例11: onEntityBlockForm
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler
public void onEntityBlockForm(EntityBlockFormEvent event) {
Block block = event.getBlock();
String world = block.getWorld().getUID().toString();
Integer x = block.getLocation().getChunk().getX(), z = block.getLocation().getChunk().getZ();
if (QuickChecks.isWorldChunkClaimed(serverdata.get("worldmap").get(world), x, z, "cla")) {
if (((HashMap) ((HashMap) serverdata.get("worldmap").get(world).get(x)).get(z)).containsKey("str")) {
event.setCancelled(true);
}
}
}
示例12: onEntityBlockForm
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = false, priority = EventPriority.LOWEST)
public void onEntityBlockForm(EntityBlockFormEvent e) {
e.setCancelled(true);
}
示例13: onEntityBlockForm
import org.bukkit.event.block.EntityBlockFormEvent; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true)
void onEntityBlockForm(EntityBlockFormEvent event) {
if (plugin.isShopkeeper(event.getEntity())) {
event.setCancelled(true);
}
}