mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-26 11:07:59 +01:00
This commit is contained in:
commit
97468a4a65
@ -1,6 +1,7 @@
|
|||||||
package net.citizensnpcs.npc.ai;
|
package net.citizensnpcs.npc.ai;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.ListIterator;
|
||||||
|
|
||||||
import net.citizensnpcs.Settings.Setting;
|
import net.citizensnpcs.Settings.Setting;
|
||||||
import net.citizensnpcs.api.ai.EntityTarget;
|
import net.citizensnpcs.api.ai.EntityTarget;
|
||||||
@ -306,8 +307,8 @@ public class CitizensNavigator implements Navigator, Runnable {
|
|||||||
private static class DoorOpener implements PathCallback {
|
private static class DoorOpener implements PathCallback {
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void run(NPC npc, Block point, double radius) {
|
public void run(NPC npc, Block point, ListIterator<Block> path) {
|
||||||
if (radius < 2) {
|
if (npc.getStoredLocation().distance(point.getLocation()) < 2) {
|
||||||
boolean bottom = (point.getData() & 8) == 0;
|
boolean bottom = (point.getData() & 8) == 0;
|
||||||
Block set = bottom ? point : point.getRelative(BlockFace.DOWN);
|
Block set = bottom ? point : point.getRelative(BlockFace.DOWN);
|
||||||
set.setData((byte) ((set.getData() & 7) | 4));
|
set.setData((byte) ((set.getData() & 7) | 4));
|
||||||
|
Loading…
Reference in New Issue
Block a user