Skip to content

Commit

Permalink
崩溃修复
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnyi116 committed Jan 2, 2025
1 parent f392522 commit 84e0dcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Mod Properties
mod_version=1.2.33
mod_version=1.2.34
maven_group=yan.lx.bedrockMiner
archives_base_name=bedrock-miner

Expand Down
7 changes: 3 additions & 4 deletions src/main/java/yan/lx/bedrockminer/task/TaskHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ private void findSlimeBlock() {
MessageUtils.setOverlayMessage(Text.literal(LanguageText.HANDLE_SEEK.getString().replace("%BlockPos%", pos.toShortString())));
} else {
state = TaskState.WAIT_GAME_UPDATE;
this.tick(true);
}
}

Expand Down Expand Up @@ -276,6 +277,7 @@ private void findRedstoneTorch() {
MessageUtils.setOverlayMessage(Text.literal(LanguageText.HANDLE_SEEK.getString().replace("%BlockPos%", pos.toShortString())));
} else {
state = TaskState.WAIT_GAME_UPDATE;
this.tick(true);
}
}

Expand Down Expand Up @@ -342,6 +344,7 @@ private void findPiston() {
MessageUtils.setOverlayMessage(Text.literal(LanguageText.HANDLE_SEEK.getString().replace("%BlockPos%", pos.toShortString())));
} else {
state = TaskState.WAIT_GAME_UPDATE;
this.tick(true);
}
}

Expand Down Expand Up @@ -437,7 +440,6 @@ private void updateStates() {
if (!world.getBlockState(pos).isOf(block)) {
this.state = TaskState.RECYCLED_ITEMS;
this.debugUpdateStates("目标不存在");
this.tick(true);
return;
}
if (!this.executed) {
Expand All @@ -446,20 +448,17 @@ private void updateStates() {
if (this.piston == null) {
this.debugUpdateStates("活塞未获取,准备查找合适的位置");
this.state = TaskState.FIND_PISTON;
this.tick(true);
return;
}

if (this.redstoneTorch == null) {
this.debugUpdateStates("红石火把未获取,准备查找合适的位置");
this.state = TaskState.FIND_REDSTONE_TORCH;
this.tick(true);
return;
}
if (this.slimeBlock == null) {
this.debugUpdateStates("红石火把底座未获取,准备查找合适的位置");
this.state = TaskState.FIND_SLIME_BLOCK;
this.tick(true);
return;
}

Expand Down

0 comments on commit 84e0dcb

Please sign in to comment.