Class AbstractNPCManagement

  • Direct Known Subclasses:
    BukkitNPCManagement

    public abstract class AbstractNPCManagement
    extends de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
    • Constructor Detail

      • AbstractNPCManagement

        public AbstractNPCManagement()
    • Method Detail

      • shouldWatchService

        protected boolean shouldWatchService​(de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)
        Specified by:
        shouldWatchService in class de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
      • shouldShowFullServices

        protected boolean shouldShowFullServices()
        Specified by:
        shouldShowFullServices in class de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
      • handle

        public void handle​(de.dytanic.cloudnet.driver.event.events.channel.ChannelMessageReceiveEvent event)
      • updateNPC

        public abstract void updateNPC​(CloudNPC cloudNPC)
      • isWorldLoaded

        public abstract boolean isWorldLoaded​(CloudNPC cloudNPC)
      • filterNPCServices

        public java.util.List<de.dytanic.cloudnet.common.collection.Pair<de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot,​de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher.ServiceInfoState>> filterNPCServices​(@NotNull
                                                                                                                                                                                                                                  @NotNull CloudNPC cloudNPC)
      • addNPC

        public boolean addNPC​(@NotNull
                              @NotNull CloudNPC npc)
        Adds a NPC to this wrapper instance
        Parameters:
        npc - the NPC to add
        Returns:
        if the NPC is allowed to exist on this wrapper instance
      • removeNPC

        public void removeNPC​(@NotNull
                              @NotNull CloudNPC npc)
        Removes a NPC from this wrapper instance
        Parameters:
        npc - the NPC to remove
      • sendNPCAddUpdate

        public void sendNPCAddUpdate​(@NotNull
                                     @NotNull CloudNPC npc)
        Adds a NPC to the whole cluster and the database
        Parameters:
        npc - the NPC to add
      • sendNPCRemoveUpdate

        public void sendNPCRemoveUpdate​(@NotNull
                                        @NotNull CloudNPC npc)
        Removes a NPC from the whole cluster and the database
        Parameters:
        npc - the NPC to remove
      • getNPCConfigurationFromNode

        public NPCConfiguration getNPCConfigurationFromNode()
      • getNPCsFromNode

        @Nullable
        public @Nullable java.util.Set<CloudNPC> getNPCsFromNode()
        Returns all NPCs contained in the CloudNet NPC database
        Returns:
        all NPCs or null, if an error occurred
      • setNPCConfiguration

        public void setNPCConfiguration​(NPCConfiguration npcConfiguration)
        Sets the NPCConfiguration for this wrapper instance
        Parameters:
        npcConfiguration - the NPCConfiguration to set
      • getCloudNPCS

        public java.util.Set<CloudNPC> getCloudNPCS()
        Returns a copy of the NPCs allowed to exist on this wrapper instance Use addNPC(CloudNPC) and removeNPC(CloudNPC) for local modification
        Returns:
        a copy of the NPCs