mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-10 01:11:22 +01:00
Full update
This commit is contained in:
parent
c994315060
commit
97ddf858ce
@ -630,17 +630,18 @@ public class EventListen implements Listener {
|
||||
public void onProjectileHit(final ProjectileHitEvent event) {
|
||||
if (!(event.getEntity() instanceof FishHook))
|
||||
return;
|
||||
NMS.removeHookIfNecessary(CitizensAPI.getNPCRegistry(), (FishHook) event.getEntity());
|
||||
NMS.removeHookIfNecessary((FishHook) event.getEntity());
|
||||
new BukkitRunnable() {
|
||||
int n = 0;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (n++ > 5) {
|
||||
if (n++ > 5 || !CitizensAPI.hasImplementation()) {
|
||||
cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
NMS.removeHookIfNecessary(CitizensAPI.getNPCRegistry(), (FishHook) event.getEntity());
|
||||
NMS.removeHookIfNecessary((FishHook) event.getEntity());
|
||||
}
|
||||
}.runTaskTimer(CitizensAPI.getPlugin(), 0, 1);
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ public class Settings {
|
||||
HOLOGRAM_UPDATE_RATE("How often to update hologram names (including placeholders)",
|
||||
"npc.hologram.update-rate-ticks", "npc.hologram.update-rate", "1s"),
|
||||
INITIAL_PLAYER_JOIN_SKIN_PACKET_DELAY("How long to wait before sending skins to joined players",
|
||||
"npc.skins.player-join-update-delay-ticks", "npc.skins.player-join-update-delay", "3s"),
|
||||
"npc.skins.player-join-update-delay-ticks", "npc.skins.player-join-update-delay", "1s"),
|
||||
KEEP_CHUNKS_LOADED("Whether to keep NPC chunks loaded", "npc.chunks.always-keep-loaded", false),
|
||||
LOCALE("Controls translation files - defaults to your system language, set to en if English required",
|
||||
"general.translation.locale", ""),
|
||||
|
@ -100,6 +100,7 @@ import net.citizensnpcs.commands.gui.NPCConfigurator;
|
||||
import net.citizensnpcs.commands.history.CommandHistory;
|
||||
import net.citizensnpcs.commands.history.CreateNPCHistoryItem;
|
||||
import net.citizensnpcs.commands.history.RemoveNPCHistoryItem;
|
||||
import net.citizensnpcs.editor.Editor;
|
||||
import net.citizensnpcs.npc.EntityControllers;
|
||||
import net.citizensnpcs.npc.NPCSelector;
|
||||
import net.citizensnpcs.npc.Template;
|
||||
@ -1928,7 +1929,7 @@ public class NPCCommands {
|
||||
public void owner(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
Owner ownerTrait = npc.getOrAddTrait(Owner.class);
|
||||
if (args.argsLength() == 1) {
|
||||
Messaging.sendTr(sender, Messages.NPC_OWNER, npc.getName(), ownerTrait.getOwnerId());
|
||||
Messaging.sendTr(sender, Messages.NPC_OWNER, npc.getName(), ownerTrait.getOwner());
|
||||
return;
|
||||
}
|
||||
OfflinePlayer p;
|
||||
@ -3405,6 +3406,9 @@ public class NPCCommands {
|
||||
permission = "citizens.npc.wander")
|
||||
public void wander(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
Waypoints trait = npc.getOrAddTrait(Waypoints.class);
|
||||
if (sender instanceof Player && Editor.hasEditor(((Player) sender))) {
|
||||
Editor.leave(((Player) sender));
|
||||
}
|
||||
trait.setWaypointProvider(trait.getCurrentProviderName().equals("wander") ? "linear" : "wander");
|
||||
Messaging.sendTr(sender, Messages.WAYPOINT_PROVIDER_SET, trait.getCurrentProviderName());
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class EquipmentEditor extends Editor {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
|
||||
if (!npc.isSpawned() || !event.getPlayer().equals(player) || Util.isOffHand(event)
|
||||
if (!npc.isSpawned() || menu != null || !event.getPlayer().equals(player) || Util.isOffHand(event)
|
||||
|| !npc.equals(CitizensAPI.getNPCRegistry().getNPC(event.getRightClicked())))
|
||||
return;
|
||||
Equipper equipper = EQUIPPERS.get(npc.getEntity().getType());
|
||||
|
@ -326,9 +326,9 @@ public class LinearWaypointProvider implements EnumerableWaypointProvider {
|
||||
|
||||
@Override
|
||||
public Waypoint getCurrentWaypoint() {
|
||||
if (waypoints.size() == 0 || !editing) {
|
||||
if (waypoints.size() == 0 || !editing)
|
||||
return null;
|
||||
}
|
||||
|
||||
return selectedWaypoint == null ? waypoints.get(waypoints.size() - 1) : selectedWaypoint;
|
||||
}
|
||||
|
||||
|
@ -131,6 +131,11 @@ public class Waypoint {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Waypoint [" + location + (triggers == null ? "]" : ", " + triggers.size() + " triggers]");
|
||||
}
|
||||
|
||||
static {
|
||||
PersistenceLoader.registerPersistDelegate(WaypointTrigger.class, WaypointTriggerRegistry.class);
|
||||
}
|
||||
|
@ -136,6 +136,7 @@ public class NMS {
|
||||
if (!PAPER_KNOCKBACK_EVENT_EXISTS) {
|
||||
event.getKnockbackVector().multiply(new Vector(-1, 0, -1));
|
||||
}
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
cb.accept(event);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user