mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-29 14:15:50 +01:00
Fix npc path block updates (#1611)
* Fix npc path block updates * Only update pathfind blocks in debug mode
This commit is contained in:
parent
ae31173ac4
commit
f47912f001
@ -471,7 +471,7 @@ public class NMSImpl implements NMSBridge {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
if (navigation.k() != null) {
|
if (params.debug() && navigation.k() != null) {
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
for (int i = 0; i < navigation.k().d(); i++) {
|
for (int i = 0; i < navigation.k().d(); i++) {
|
||||||
PathPoint pp = navigation.k().a(i);
|
PathPoint pp = navigation.k().a(i);
|
||||||
|
@ -474,7 +474,7 @@ public class NMSImpl implements NMSBridge {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
if (navigation.l() != null) {
|
if (params.debug() && navigation.l() != null) {
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
for (int i = 0; i < navigation.l().d(); i++) {
|
for (int i = 0; i < navigation.l().d(); i++) {
|
||||||
PathPoint pp = navigation.l().a(i);
|
PathPoint pp = navigation.l().a(i);
|
||||||
|
@ -19,6 +19,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.boss.BarColor;
|
import org.bukkit.boss.BarColor;
|
||||||
import org.bukkit.boss.BarStyle;
|
import org.bukkit.boss.BarStyle;
|
||||||
import org.bukkit.boss.BossBar;
|
import org.bukkit.boss.BossBar;
|
||||||
@ -486,13 +487,13 @@ public class NMSImpl implements NMSBridge {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
if (navigation.m() != null) {
|
if (params.debug() && navigation.m() != null) {
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
for (int i = 0; i < navigation.m().d(); i++) {
|
for (int i = 0; i < navigation.m().d(); i++) {
|
||||||
PathPoint pp = navigation.m().a(i);
|
PathPoint pp = navigation.m().a(i);
|
||||||
org.bukkit.block.Block block = new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld())
|
org.bukkit.block.Block block = new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld())
|
||||||
.getBlock();
|
.getBlock();
|
||||||
player.sendBlockChange(block.getLocation(), block.getType(), block.getData());
|
player.sendBlockChange(block.getLocation(), block.getBlockData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -519,11 +520,11 @@ public class NMSImpl implements NMSBridge {
|
|||||||
lastSpeed = params.speed();
|
lastSpeed = params.speed();
|
||||||
}
|
}
|
||||||
if (params.debug() && !NMSImpl.isNavigationFinished(navigation)) {
|
if (params.debug() && !NMSImpl.isNavigationFinished(navigation)) {
|
||||||
|
BlockData data = Material.DANDELION.createBlockData();
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
for (int i = 0; i < navigation.m().d(); i++) {
|
for (int i = 0; i < navigation.m().d(); i++) {
|
||||||
PathPoint pp = navigation.m().a(i);
|
PathPoint pp = navigation.m().a(i);
|
||||||
player.sendBlockChange(new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld()),
|
player.sendBlockChange(new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld()), data);
|
||||||
Material.SUNFLOWER, (byte) 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user