Commit 06f910d2 by Jonathan Thomas

New whitelist and blacklist Minecraft commands, to show and hide chat bubbles based on entity type

parent eb9872b2
Pipeline #12656 passed with stages
in 2 minutes 27 seconds
...@@ -6,8 +6,12 @@ All notable changes to **CreatureChat** are documented in this file. The format ...@@ -6,8 +6,12 @@ All notable changes to **CreatureChat** are documented in this file. The format
## Unreleased ## Unreleased
### Added
- New whitelist and blacklist Minecraft commands, to show and hide chat bubbles based on entity type
### Changed ### Changed
- Fixed CurseForge deploy script to be much faster, and correctly lookup valid Type and Version IDs - Fixed CurseForge deploy script to be much faster, and correctly lookup valid Type and Version IDs
- Large refactor of Minecraft commands (and how --config args are parsed)
## [1.0.7] - 2024-07-03 ## [1.0.7] - 2024-07-03
......
...@@ -14,6 +14,8 @@ import java.io.Writer; ...@@ -14,6 +14,8 @@ import java.io.Writer;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
/** /**
* The {@code ConfigurationHandler} class loads and saves configuration settings for this mod. It first * The {@code ConfigurationHandler} class loads and saves configuration settings for this mod. It first
...@@ -69,6 +71,8 @@ public class ConfigurationHandler { ...@@ -69,6 +71,8 @@ public class ConfigurationHandler {
private int maxOutputTokens = 200; private int maxOutputTokens = 200;
private double percentOfContext = 0.75; private double percentOfContext = 0.75;
private int timeout = 10; private int timeout = 10;
private List<String> whitelist = new ArrayList<>();
private List<String> blacklist = new ArrayList<>();
// Getters and setters for existing fields // Getters and setters for existing fields
public String getApiKey() { return apiKey; } public String getApiKey() { return apiKey; }
...@@ -77,7 +81,7 @@ public class ConfigurationHandler { ...@@ -77,7 +81,7 @@ public class ConfigurationHandler {
// Update URL if a CreatureChat API key is detected // Update URL if a CreatureChat API key is detected
setUrl("https://api.creaturechat.com/v1/chat/completions"); setUrl("https://api.creaturechat.com/v1/chat/completions");
} else if (apiKey.startsWith("sk-")) { } else if (apiKey.startsWith("sk-")) {
// Update URL if a OpenAI API key is detected // Update URL if an OpenAI API key is detected
setUrl("https://api.openai.com/v1/chat/completions"); setUrl("https://api.openai.com/v1/chat/completions");
} }
this.apiKey = apiKey; this.apiKey = apiKey;
...@@ -92,7 +96,6 @@ public class ConfigurationHandler { ...@@ -92,7 +96,6 @@ public class ConfigurationHandler {
public int getTimeout() { return timeout; } public int getTimeout() { return timeout; }
public void setTimeout(int timeout) { this.timeout = timeout; } public void setTimeout(int timeout) { this.timeout = timeout; }
// Getters and setters for new fields
public int getMaxContextTokens() { return maxContextTokens; } public int getMaxContextTokens() { return maxContextTokens; }
public void setMaxContextTokens(int maxContextTokens) { this.maxContextTokens = maxContextTokens; } public void setMaxContextTokens(int maxContextTokens) { this.maxContextTokens = maxContextTokens; }
...@@ -102,5 +105,10 @@ public class ConfigurationHandler { ...@@ -102,5 +105,10 @@ public class ConfigurationHandler {
public double getPercentOfContext() { return percentOfContext; } public double getPercentOfContext() { return percentOfContext; }
public void setPercentOfContext(double percentOfContext) { this.percentOfContext = percentOfContext; } public void setPercentOfContext(double percentOfContext) { this.percentOfContext = percentOfContext; }
public List<String> getWhitelist() { return whitelist; }
public void setWhitelist(List<String> whitelist) { this.whitelist = whitelist; }
public List<String> getBlacklist() { return blacklist; }
public void setBlacklist(List<String> blacklist) { this.blacklist = blacklist; }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment