Skip to content

Commit

Permalink
Fix potion effects on players
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jun 5, 2016
1 parent 9abb940 commit 924d8b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/net/citizensnpcs/commands/NPCCommands.java
Expand Up @@ -32,6 +32,8 @@
import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.entity.Villager.Profession;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
Expand Down Expand Up @@ -977,6 +979,7 @@ public void npc(CommandContext args, CommandSender sender, NPC npc) {
Messaging.send(sender,
String.format(format, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), loc.getWorld().getName()));
}
((LivingEntity) npc.getEntity()).addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 1, 10));
Messaging.send(sender, " <a>Traits<e>");
for (Trait trait : npc.getTraits()) {
if (CitizensAPI.getTraitFactory().isInternalTrait(trait))
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java
Expand Up @@ -278,6 +278,8 @@ public void m() {
super.m();
if (npc == null)
return;
updateEffects = true;
tickPotionEffects();

boolean navigating = npc.getNavigator().isNavigating();
updatePackets(navigating);
Expand Down

0 comments on commit 924d8b4

Please sign in to comment.