Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
06f910d2
Commit
06f910d2
authored
Jul 10, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
CHANGELOG.md
CHANGELOG.md
+4
-0
ConfigurationHandler.java
...ain/java/com/owlmaddie/commands/ConfigurationHandler.java
+10
-2
CreatureChatCommands.java
...ain/java/com/owlmaddie/commands/CreatureChatCommands.java
+0
-0
No files found.
CHANGELOG.md
View file @
06f910d2
...
...
@@ -6,8 +6,12 @@ All notable changes to **CreatureChat** are documented in this file. The format
## Unreleased
### Added
-
New whitelist and blacklist Minecraft commands, to show and hide chat bubbles based on entity type
### Changed
-
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
...
...
src/main/java/com/owlmaddie/commands/ConfigurationHandler.java
View file @
06f910d2
...
...
@@ -14,6 +14,8 @@ import java.io.Writer;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
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
...
...
@@ -69,6 +71,8 @@ public class ConfigurationHandler {
private
int
maxOutputTokens
=
200
;
private
double
percentOfContext
=
0.75
;
private
int
timeout
=
10
;
private
List
<
String
>
whitelist
=
new
ArrayList
<>();
private
List
<
String
>
blacklist
=
new
ArrayList
<>();
// Getters and setters for existing fields
public
String
getApiKey
()
{
return
apiKey
;
}
...
...
@@ -77,7 +81,7 @@ public class ConfigurationHandler {
// Update URL if a CreatureChat API key is detected
setUrl
(
"https://api.creaturechat.com/v1/chat/completions"
);
}
else
if
(
apiKey
.
startsWith
(
"sk-"
))
{
// Update URL if a OpenAI API key is detected
// Update URL if a
n
OpenAI API key is detected
setUrl
(
"https://api.openai.com/v1/chat/completions"
);
}
this
.
apiKey
=
apiKey
;
...
...
@@ -92,7 +96,6 @@ public class ConfigurationHandler {
public
int
getTimeout
()
{
return
timeout
;
}
public
void
setTimeout
(
int
timeout
)
{
this
.
timeout
=
timeout
;
}
// Getters and setters for new fields
public
int
getMaxContextTokens
()
{
return
maxContextTokens
;
}
public
void
setMaxContextTokens
(
int
maxContextTokens
)
{
this
.
maxContextTokens
=
maxContextTokens
;
}
...
...
@@ -102,5 +105,10 @@ public class ConfigurationHandler {
public
double
getPercentOfContext
()
{
return
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
;
}
}
}
src/main/java/com/owlmaddie/commands/CreatureChatCommands.java
View file @
06f910d2
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment