mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 12:15:53 +01:00
Fix the sit animation, fixes #96
The task would fail to cancel properly, and sometimes fail to recognize NPC removal. In addition, gitignore maven and IntelliJ artifacts to give contributors an easier time.
This commit is contained in:
parent
ec2eae62b7
commit
edbf8e6fda
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,3 +5,5 @@
|
|||||||
Citizens.jar
|
Citizens.jar
|
||||||
*.lnk
|
*.lnk
|
||||||
*.iml
|
*.iml
|
||||||
|
/.idea
|
||||||
|
dependency-reduced-pom.xml
|
||||||
|
@ -52,10 +52,11 @@ public enum PlayerAnimation {
|
|||||||
protected void playAnimation(final EntityPlayer player, int radius) {
|
protected void playAnimation(final EntityPlayer player, int radius) {
|
||||||
player.getBukkitEntity().setMetadata("citizens.sitting",
|
player.getBukkitEntity().setMetadata("citizens.sitting",
|
||||||
new FixedMetadataValue(CitizensAPI.getPlugin(), true));
|
new FixedMetadataValue(CitizensAPI.getPlugin(), true));
|
||||||
Bukkit.getScheduler().runTaskTimer(CitizensAPI.getPlugin(), new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (player.dead || !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
if (player.dead || !player.valid ||
|
||||||
|
!player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
||||||
cancel();
|
cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -67,7 +68,7 @@ public enum PlayerAnimation {
|
|||||||
player.mount(player);
|
player.mount(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 0, 1);
|
}.runTaskTimer(CitizensAPI.getPlugin(), 0, 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SLEEP {
|
SLEEP {
|
||||||
|
Loading…
Reference in New Issue
Block a user