This commit is contained in:
fullwall 2015-02-15 17:15:56 +08:00
parent cc841ce0c7
commit bcca71d5bd

View File

@ -1,6 +1,7 @@
package net.citizensnpcs.npc.ai;
import java.util.Iterator;
import java.util.ListIterator;
import net.citizensnpcs.Settings.Setting;
import net.citizensnpcs.api.ai.EntityTarget;
@ -306,8 +307,8 @@ public class CitizensNavigator implements Navigator, Runnable {
private static class DoorOpener implements PathCallback {
@Override
@SuppressWarnings("deprecation")
public void run(NPC npc, Block point, double radius) {
if (radius < 2) {
public void run(NPC npc, Block point, ListIterator<Block> path) {
if (npc.getStoredLocation().distance(point.getLocation()) < 2) {
boolean bottom = (point.getData() & 8) == 0;
Block set = bottom ? point : point.getRelative(BlockFace.DOWN);
set.setData((byte) ((set.getData() & 7) | 4));