Class AbstractNPCManagement
- java.lang.Object
-
- de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
-
- eu.cloudnetservice.cloudnet.ext.npcs.AbstractNPCManagement
-
- Direct Known Subclasses:
BukkitNPCManagement
public abstract class AbstractNPCManagement extends de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<CloudNPC>cloudNPCSprotected java.util.Map<de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher.ServiceInfoState,NPCConfigurationEntry.ItemLayout>itemLayoutsprotected NPCConfigurationnpcConfigurationprotected NPCConfigurationEntryownNPCConfigurationEntry
-
Constructor Summary
Constructors Constructor Description AbstractNPCManagement()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaddNPC(@NotNull CloudNPC npc)Adds a NPC to this wrapper instancejava.util.List<de.dytanic.cloudnet.common.collection.Pair<de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot,de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher.ServiceInfoState>>filterNPCServices(@NotNull CloudNPC cloudNPC)java.util.Set<CloudNPC>getCloudNPCS()Returns a copy of the NPCs allowed to exist on this wrapper instance UseaddNPC(CloudNPC)andremoveNPC(CloudNPC)for local modificationNPCConfigurationgetNPCConfiguration()NPCConfigurationgetNPCConfigurationFromNode()@Nullable java.util.Set<CloudNPC>getNPCsFromNode()Returns all NPCs contained in the CloudNet NPC databaseNPCConfigurationEntrygetOwnNPCConfigurationEntry()voidhandle(de.dytanic.cloudnet.driver.event.events.channel.ChannelMessageReceiveEvent event)abstract booleanisWorldLoaded(CloudNPC cloudNPC)voidremoveNPC(@NotNull CloudNPC npc)Removes a NPC from this wrapper instancevoidsendNPCAddUpdate(@NotNull CloudNPC npc)Adds a NPC to the whole cluster and the databasevoidsendNPCRemoveUpdate(@NotNull CloudNPC npc)Removes a NPC from the whole cluster and the databasevoidsetNPCConfiguration(NPCConfiguration npcConfiguration)Sets the NPCConfiguration for this wrapper instanceprotected booleanshouldShowFullServices()protected booleanshouldWatchService(de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)abstract voidupdateNPC(CloudNPC cloudNPC)
-
-
-
Field Detail
-
npcConfiguration
protected NPCConfiguration npcConfiguration
-
ownNPCConfigurationEntry
protected NPCConfigurationEntry ownNPCConfigurationEntry
-
cloudNPCS
protected java.util.Set<CloudNPC> cloudNPCS
-
itemLayouts
protected java.util.Map<de.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher.ServiceInfoState,NPCConfigurationEntry.ItemLayout> itemLayouts
-
-
Method Detail
-
shouldWatchService
protected boolean shouldWatchService(de.dytanic.cloudnet.driver.service.ServiceInfoSnapshot serviceInfoSnapshot)
- Specified by:
shouldWatchServicein classde.dytanic.cloudnet.ext.bridge.ServiceInfoStateWatcher
-
shouldShowFullServices
protected boolean shouldShowFullServices()
- Specified by:
shouldShowFullServicesin classde.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
-
getNPCConfiguration
public NPCConfiguration getNPCConfiguration()
-
setNPCConfiguration
public void setNPCConfiguration(NPCConfiguration npcConfiguration)
Sets the NPCConfiguration for this wrapper instance- Parameters:
npcConfiguration- the NPCConfiguration to set
-
getOwnNPCConfigurationEntry
public NPCConfigurationEntry getOwnNPCConfigurationEntry()
-
getCloudNPCS
public java.util.Set<CloudNPC> getCloudNPCS()
Returns a copy of the NPCs allowed to exist on this wrapper instance UseaddNPC(CloudNPC)andremoveNPC(CloudNPC)for local modification- Returns:
- a copy of the NPCs
-
-