mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-27 04:55:25 +01:00
Make Obsidian Bomb skip non-air blocks and look upwards for one.
This commit is contained in:
parent
515fbc6a22
commit
71fe565316
@ -1,7 +1,7 @@
|
||||
name: MobArena
|
||||
author: garbagemule
|
||||
main: com.garbagemule.MobArena.MobArena
|
||||
version: 0.96.2.15
|
||||
version: 0.96.2.16
|
||||
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
|
||||
commands:
|
||||
ma:
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.garbagemule.MobArena.waves.ability.core;
|
||||
|
||||
import com.garbagemule.MobArena.Messenger;
|
||||
import com.garbagemule.MobArena.framework.Arena;
|
||||
import com.garbagemule.MobArena.waves.MABoss;
|
||||
import com.garbagemule.MobArena.waves.ability.Ability;
|
||||
@ -9,6 +10,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
@AbilityInfo(
|
||||
@ -28,12 +30,25 @@ public class ObsidianBomb implements Ability
|
||||
LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), true);
|
||||
|
||||
final World world = arena.getWorld();
|
||||
final Location loc = target.getLocation();
|
||||
|
||||
Block b = world.getBlockAt(loc);
|
||||
final Location loc;
|
||||
|
||||
Block b = world.getBlockAt(target.getLocation());
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (b.getType() == Material.AIR) {
|
||||
break;
|
||||
}
|
||||
b = b.getRelative(BlockFace.UP);
|
||||
}
|
||||
loc = b.getLocation();
|
||||
|
||||
if (b.getType() != Material.AIR) {
|
||||
Messenger.warning("Failed to place Obsidian Bomb at: " + target.getLocation());
|
||||
return;
|
||||
}
|
||||
|
||||
b.setType(Material.OBSIDIAN);
|
||||
arena.addBlock(b);
|
||||
|
||||
|
||||
arena.scheduleTask(new Runnable() {
|
||||
public void run() {
|
||||
if (!arena.isRunning())
|
||||
|
Loading…
Reference in New Issue
Block a user