mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-24 00:51:41 +01:00
Minor changes
This commit is contained in:
parent
bfc7a540cf
commit
838aa3019b
@ -108,6 +108,7 @@ import net.citizensnpcs.trait.ScoreboardTrait;
|
||||
import net.citizensnpcs.util.ChunkCoord;
|
||||
import net.citizensnpcs.util.Messages;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.PlayerAnimation;
|
||||
import net.citizensnpcs.util.Util;
|
||||
|
||||
public class EventListen implements Listener {
|
||||
@ -523,7 +524,9 @@ public class EventListen implements Listener {
|
||||
Bukkit.getPluginManager().callEvent(rightClickEvent);
|
||||
if (rightClickEvent.isCancelled()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
PlayerAnimation.STOP_USE_ITEM.play(player);
|
||||
if (npc.hasTrait(CommandTrait.class)) {
|
||||
npc.getTraitNullable(CommandTrait.class).dispatch(player, CommandTrait.Hand.RIGHT);
|
||||
}
|
||||
|
@ -541,7 +541,7 @@ public class NPCCommands {
|
||||
copy.setName(name);
|
||||
}
|
||||
|
||||
if (copy.isSpawned() && args.getSenderLocation() != null) {
|
||||
if (copy.getOrAddTrait(Spawned.class).shouldSpawn() && args.getSenderLocation() != null) {
|
||||
Location location = args.getSenderLocation();
|
||||
location.getChunk().load();
|
||||
copy.teleport(location, TeleportCause.COMMAND);
|
||||
@ -1317,7 +1317,7 @@ public class NPCCommands {
|
||||
desc = "Manages NPC metadata",
|
||||
modifiers = { "metadata" },
|
||||
flags = "t",
|
||||
min = 2,
|
||||
min = 3,
|
||||
max = 4,
|
||||
permission = "citizens.npc.metadata")
|
||||
@Requirements(selected = true, ownership = true)
|
||||
|
@ -45,7 +45,7 @@ public class SitTrait extends Trait {
|
||||
}
|
||||
holder = registry.createNPC(EntityType.ARMOR_STAND, "");
|
||||
holder.getOrAddTrait(ArmorStandTrait.class).setAsPointEntity();
|
||||
holder.spawn(npc.getEntity().getLocation());
|
||||
holder.spawn(npc.getStoredLocation());
|
||||
}
|
||||
if (holder.getEntity() != null && !NMS.getPassengers(holder.getEntity()).contains(npc.getEntity())) {
|
||||
NMS.mount(holder.getEntity(), npc.getEntity());
|
||||
|
Loading…
Reference in New Issue
Block a user