Skip to content

Commit

Permalink
Hack up a somewhat better "/npc sit", maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 2, 2017
1 parent 6e1e914 commit ee400ac
Showing 1 changed file with 12 additions and 4 deletions.
Expand Up @@ -7,11 +7,13 @@
import net.aufdemrand.denizencore.objects.Mechanism;
import net.citizensnpcs.api.persistence.Persist;
import net.citizensnpcs.api.trait.Trait;
import net.citizensnpcs.util.PlayerAnimation;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
Expand Down Expand Up @@ -82,9 +84,13 @@ public void sit() {
}

private void sitInternal() {
DenizenEntityType.getByName("FAKE_ARROW").spawnNewEntity(npc.getEntity().getLocation(),
new ArrayList<Mechanism>()).setPassenger(npc.getEntity());
//PlayerAnimation.SIT.play((Player)npc.getEntity());
if (npc.getEntity() instanceof Player) {
PlayerAnimation.SIT.play((Player)npc.getEntity());
}
else {
DenizenEntityType.getByName("FAKE_ARROW").spawnNewEntity(npc.getEntity().getLocation(),
new ArrayList<Mechanism>()).setPassenger(npc.getEntity());
}
//eh.getDataWatcher().watch(0, (byte) 0x04);
sitting = true;
}
Expand All @@ -97,7 +103,9 @@ private void standInternal() {
vehicle.setPassenger(null);
vehicle.remove();
}
//PlayerAnimation.STOP_SITTING.play((Player)npc.getEntity());
if (npc.getEntity() instanceof Player) {
PlayerAnimation.STOP_SITTING.play((Player) npc.getEntity());
}
//eh.getDataWatcher().watch(0, (byte) 0x00);
sitting = false;
}
Expand Down

0 comments on commit ee400ac

Please sign in to comment.