Skip to content

Commit 84881e2

Browse files
committed
Fix ResourceLocation crash and revert default LongCat model to Flash-Thinking-2601
1 parent c5af0b4 commit 84881e2

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ temperature = 0.7
4545

4646
[longcat]
4747
apiKey = "ak_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
48-
model = "LongCat-Flash-Chat"
48+
model = "LongCat-Flash-Thinking-2601"
4949
```
5050

5151
Then spawn a Steve with `/steve spawn Bob` and press K to start giving commands.
@@ -242,7 +242,7 @@ temperature = 0.7
242242

243243
[longcat]
244244
apiKey = "ak_..."
245-
model = "LongCat-Flash-Chat"
245+
model = "LongCat-Flash-Thinking-2601"
246246

247247
[deepseek]
248248
apiKey = "sk-..."

config/steve-common.toml.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
apiKey = "ak_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
1717

1818
# LongCat model to use (LongCat-Flash-Chat, LongCat-Flash-Thinking, LongCat-Flash-Thinking-2601)
19-
model = "LongCat-Flash-Chat"
19+
model = "LongCat-Flash-Thinking-2601"
2020

2121
# DeepSeek API Configuration
2222
[deepseek]

src/main/java/com/steve/ai/action/actions/MineBlockAction.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ private net.minecraft.world.entity.player.Player findNearestPlayer() {
359359
}
360360

361361
private Block parseBlock(String blockName) {
362+
if (blockName == null || blockName.isEmpty()) return Blocks.AIR;
363+
362364
blockName = blockName.toLowerCase().replace(" ", "_");
363365

364366
Map<String, String> resourceToOre = new HashMap<>() {{
@@ -380,7 +382,11 @@ private Block parseBlock(String blockName) {
380382
blockName = "minecraft:" + blockName;
381383
}
382384

383-
ResourceLocation resourceLocation = new ResourceLocation(blockName);
385+
ResourceLocation resourceLocation = ResourceLocation.tryParse(blockName);
386+
if (resourceLocation == null) {
387+
SteveMod.LOGGER.error("Invalid ResourceLocation for block: {}", blockName);
388+
return Blocks.AIR;
389+
}
384390
return BuiltInRegistries.BLOCK.get(resourceLocation);
385391
}
386392
}

src/main/java/com/steve/ai/action/actions/PlaceBlockAction.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,18 @@ public String getDescription() {
7474
}
7575

7676
private Block parseBlock(String blockName) {
77+
if (blockName == null || blockName.isEmpty()) return Blocks.AIR;
78+
7779
blockName = blockName.toLowerCase().replace(" ", "_");
7880
if (!blockName.contains(":")) {
7981
blockName = "minecraft:" + blockName;
8082
}
81-
ResourceLocation resourceLocation = new ResourceLocation(blockName);
83+
84+
ResourceLocation resourceLocation = ResourceLocation.tryParse(blockName);
85+
if (resourceLocation == null) {
86+
com.steve.ai.SteveMod.LOGGER.error("Invalid ResourceLocation for block: {}", blockName);
87+
return Blocks.AIR;
88+
}
8289
return BuiltInRegistries.BLOCK.get(resourceLocation);
8390
}
8491
}

src/main/java/com/steve/ai/config/SteveConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class SteveConfig {
6262

6363
LONGCAT_MODEL = builder
6464
.comment("LongCat model to use (LongCat-Flash-Chat, LongCat-Flash-Thinking, LongCat-Flash-Thinking-2601)")
65-
.define("model", "LongCat-Flash-Chat");
65+
.define("model", "LongCat-Flash-Thinking-2601");
6666

6767
builder.pop();
6868

src/main/java/com/steve/ai/llm/PromptBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public static String buildSystemPrompt() {
3333
7. Keep reasoning under 15 words
3434
8. COLLABORATIVE BUILDING: Multiple Steves can work on same structure simultaneously
3535
9. MINING: Can mine any ore (iron, diamond, coal, etc)
36+
10. CRITICAL: All block, item, and entity IDs MUST be in English snake_case (e.g. "oak_log", "diamond_ore").
37+
11. NEVER use Chinese or any other localized language for IDs.
3638
3739
EXAMPLES (copy these formats exactly):
3840

0 commit comments

Comments
 (0)