Skip to content

Commit

Permalink
update: add search group function to default.
Browse files Browse the repository at this point in the history
  • Loading branch information
WDRshadow committed Mar 27, 2024
1 parent fc944e1 commit edbe7b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/jackdaw/chatwithnpc/npc/NPCEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.jackdaw.chatwithnpc.ChatWithNPCMod;
import com.jackdaw.chatwithnpc.SettingManager;
import com.jackdaw.chatwithnpc.openaiapi.function.FunctionManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.text.Text;
Expand Down Expand Up @@ -259,7 +260,7 @@ public boolean hasThreadId() {
* @param function The function to add
*/
public void addFunction(String function) {
functions.add(function);
if (!functions.contains(function) && FunctionManager.getRegistryList().contains(function)) functions.add(function);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public static void registerNPCEntity(@NotNull Entity entity, boolean isOP) {
NPCDataManager npcDataManager = npcEntity.getDataManager();
if (!isOP && !npcDataManager.isExist()) return;
npcDataManager.sync();
npcEntity.addFunction("inquiry_group");
npcMap.put(entity.getUuid(), npcEntity);
}

Expand Down

0 comments on commit edbe7b1

Please sign in to comment.