Skip to content

Commit

Permalink
Fix block break command
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 2, 2015
1 parent f3b9354 commit a1c1020
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -15,7 +15,8 @@
import net.aufdemrand.denizencore.scripts.commands.AbstractCommand;
import net.aufdemrand.denizencore.scripts.commands.Holdable;
import net.citizensnpcs.api.ai.tree.BehaviorStatus;
import net.citizensnpcs.npc.ai.BlockBreaker;
import net.citizensnpcs.api.npc.BlockBreaker;
import net.citizensnpcs.npc.ai.CitizensBlockBreaker;
import org.bukkit.Bukkit;

import java.util.HashMap;
Expand Down Expand Up @@ -81,11 +82,10 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
context.put("location", location);
context.put("material", material);


dB.report(scriptEntry, getName(), location.debug() + entity.debug() + radius.debug());

final ScriptEntry se = scriptEntry;
BlockBreaker.Configuration config = new BlockBreaker.Configuration();
BlockBreaker.BlockBreakerConfiguration config = new BlockBreaker.BlockBreakerConfiguration();
config.item(entity.getLivingEntity().getEquipment().getItemInHand());
config.radius(radius.asDouble());
config.callback(new Runnable() {
Expand All @@ -98,8 +98,7 @@ public void run() {
}
});


final BlockBreaker breaker = BlockBreaker.createWithConfiguration(entity.getLivingEntity(),
final CitizensBlockBreaker breaker = new CitizensBlockBreaker(entity.getLivingEntity(),
location.getBlock(), config);
if (breaker.shouldExecute()) {
TaskRunnable run = new TaskRunnable(breaker);
Expand Down

0 comments on commit a1c1020

Please sign in to comment.