本文整理匯總了Java中org.bukkit.event.block.BlockIgniteEvent.getBlock方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockIgniteEvent.getBlock方法的具體用法?Java BlockIgniteEvent.getBlock怎麽用?Java BlockIgniteEvent.getBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.event.block.BlockIgniteEvent
的用法示例。
在下文中一共展示了BlockIgniteEvent.getBlock方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockIgnite(BlockIgniteEvent event) {
Player player = event.getPlayer();
if(player != null){
Block block = event.getBlock();
if(block != null && block.getRelative(BlockFace.DOWN).getType().equals(Material.NETHERRACK) && block.getRelative(BlockFace.DOWN, 2).getType().equals(Material.NETHERRACK)){
if(block.getRelative(BlockFace.DOWN).getRelative(BlockFace.EAST).getType().equals(Material.TRAP_DOOR) || block.getRelative(BlockFace.DOWN).getRelative(BlockFace.WEST).getType().equals(Material.TRAP_DOOR) || block.getRelative(BlockFace.DOWN).getRelative(BlockFace.SOUTH).getType().equals(Material.TRAP_DOOR) || block.getRelative(BlockFace.DOWN).getRelative(BlockFace.NORTH).getType().equals(Material.TRAP_DOOR)){
if(player.hasPermission("pmf.createfireplace")){
block.getRelative(BlockFace.DOWN).setType(Material.FIRE, false);
player.sendMessage(ChatColor.GREEN + "[PMF] Fireplace has been created!");
} else {
player.sendMessage(ChatColor.RED + "[PMF] You need the permission pmf.createfireplace to create a fireplace!");
}
}
}
}
}
示例2: onBlockStartBurn
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockStartBurn(BlockIgniteEvent e){
if (e.isCancelled()){
return;
}
Block b = e.getBlock();
Block bignit = e.getIgnitingBlock();
if ( b == null || bignit == null){
return;
}
RedProtect.get().logger.debug("Is BlockIgniteEvent event from global-listener");
Region r = RedProtect.get().rm.getTopRegion(b.getLocation());
if (r != null){
return;
}
if ((bignit.getType().equals(Material.FIRE) || bignit.getType().name().contains("LAVA")) && !RPConfig.getGlobalFlagBool(b.getWorld().getName()+".fire-spread")){
e.setCancelled(true);
}
}
示例3: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGH)
public void onBlockIgnite(final BlockIgniteEvent event) {
if (event.isCancelled())
return;
final Block block = event.getBlock();
// Ok so a frame block ignites
// Find the nearest gate!
final WorldCoord blockCoord = new WorldCoord(block);
final Gate nearestGate = Gates.gateFromFrameAndSurround(blockCoord);
if (nearestGate != null) {
event.setCancelled(true);
}
}
示例4: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockIgnite(BlockIgniteEvent 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")) {
String pvillage = ((HashMap) ((HashMap) serverdata.get("worldmap").get(world).get(x)).get(z)).get("cla").toString();
if (serverdata.get("villages").get(pvillage).containsKey("fire")) {
if (serverdata.get("villages").get(pvillage).get("fire").equals("off")) {
event.setCancelled(true);
}
} else if (Config.getString("Village Settings.Toggle Settings.Fire Enabled").equals("off")) {
event.setCancelled(true);
}
}
}
示例5: WhenFireLimitor
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void WhenFireLimitor(BlockIgniteEvent event) {
if (ConfigOptimize.FireLimitorenable == true) {
if (event.getCause() == IgniteCause.FLINT_AND_STEEL) {
return;
}
Block block = event.getBlock();
if (CheckFast(block.getChunk())) {
event.setCancelled(true);
} else {
ChunkChecked.put(block.getChunk(), System.currentTimeMillis());
}
}
}
示例6: onBlockStartBurn
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockStartBurn(BlockIgniteEvent e){
RedProtect.get().logger.debug("RPBlockListener - Is BlockIgniteEvent event");
if (e.isCancelled()){
return;
}
Block b = e.getBlock();
Block bignit = e.getIgnitingBlock();
if (b == null){
return;
}
RedProtect.get().logger.debug("Is BlockIgniteEvent event. Canceled? " + e.isCancelled());
Region r = RedProtect.get().rm.getTopRegion(b.getLocation());
if (r != null && !r.canFire()){
if (e.getIgnitingEntity() != null){
if (e.getIgnitingEntity() instanceof Player){
Player p = (Player) e.getIgnitingEntity();
if (!r.canBuild(p)){
RPLang.sendMessage(p, "blocklistener.region.cantplace");
e.setCancelled(true);
return;
}
} else {
e.setCancelled(true);
return;
}
}
if (bignit != null && (bignit.getType().equals(Material.FIRE) || bignit.getType().name().contains("LAVA"))){
e.setCancelled(true);
return;
}
if (e.getCause().equals(IgniteCause.LIGHTNING) || e.getCause().equals(IgniteCause.EXPLOSION) || e.getCause().equals(IgniteCause.FIREBALL)){
e.setCancelled(true);
}
}
}
示例7: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockIgnite(BlockIgniteEvent event)
{
Block block = event.getBlock();
Chunk blockChunk = block.getChunk();
if (config.getClaimed(blockChunk))
{
if(!config.isTrusted(blockChunk, event.getPlayer()))
{
event.getPlayer().sendMessage("This chunk is claimed by: "+config.getConfig().getString(LocationHandeler.toConfigHandler(blockChunk)+".owner")+" thus you cant start fires here.");
event.setCancelled(true);
}
}
}
示例8: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockIgnite(BlockIgniteEvent event) {
Block b = event.getBlock();
ArenaManager am = SimpleSurvivalGames.instance.getArenaManager();
// Capture the block
for(Arena a : am.getArenas())
if(a.isArenaCuboidSet())
if(a.getArenaCuboid().isInsideCuboid(b))
if(a.getState().equals(ArenaState.PLAYING) || a.getState().equals(ArenaState.STARTING))
a.getPlayerBlockManager().addBlock(b);
}
示例9: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockIgnite(BlockIgniteEvent event)
{
final ProtectHolder settings = prot.getSettings();
final Block block = event.getBlock();
if (block.getType() == Material.OBSIDIAN || block.getRelative(BlockFace.DOWN).getType() == Material.OBSIDIAN)
{
event.setCancelled(settings.getData().getPrevent().isPortalCreation());
return;
}
if (event.getCause().equals(BlockIgniteEvent.IgniteCause.SPREAD))
{
event.setCancelled(settings.getData().getPrevent().isFirespread());
return;
}
if (event.getCause().equals(BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL) && event.getPlayer() != null)
{
event.setCancelled(Permissions.USEFLINTSTEEL.isAuthorized(event.getPlayer()));
return;
}
if (event.getCause().equals(BlockIgniteEvent.IgniteCause.LAVA))
{
event.setCancelled(settings.getData().getPrevent().isLavaFirespread());
return;
}
if (event.getCause().equals(BlockIgniteEvent.IgniteCause.LIGHTNING))
{
event.setCancelled(settings.getData().getPrevent().isLightningFirespread());
}
}