Skip to content

Conversation

Copy link

Copilot AI commented Dec 31, 2025

Multiplayer servers crash with ClassCastException: Vec3 cannot be cast to BlockPos when multiple players interact with temperature-calculating blocks simultaneously. Root cause is thread-unsafe shared state in FrostedHeart's SurroundingTemperatureSimulator.java.

Changes

  • Disabled problematic recipe in kubejs/server_scripts/src/recipes_types/frostedheart/block_temp.js

    • Commented out frostedheart:block_temp for charcoal_pit:log_pile
    • Log piles still produce charcoal, but no longer contribute to environmental temperature
  • Added KNOWN_ISSUES.md documenting the issue

Code Example

// Before: Recipe triggers thread-unsafe temperature calculation
event.custom({
    type: "frostedheart:block_temp",
    block: "charcoal_pit:log_pile",
    must_lit: true,
    temperature: 300.0
})

// After: Recipe disabled with explanation
/* ... commented out until upstream mod is fixed ... */

This is a temporary workaround pending a thread-safe fix in the FrostedHeart mod.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug] 疑似多人服务器环境下计算温度的方块会出现转型问题</issue_title>
<issue_description>### Error Behaviour

崩服,扔出java.lang.RuntimeException: java.lang.ClassCastException: class net.minecraft.world.phys.Vec3 cannot be cast to class net.minecraft.core.BlockPos (net.minecraft.world.phys.Vec3 and net.minecraft.core.BlockPos are in module minecraft@1.20.1 of loader 'TRANSFORMER' @9c73fff)

Expected Behaviour

查询一下这个神必的SurroundingTemperatureSimulator.java
我怀疑里头有些什么神必的线程和线程抢对象的环节
毕竟你包的温度检测居然是1gametick检测一次
我怀疑是你们给generator new在了外头成了全局对象整的活

Reproduce

1.多搞几个人
2.像我一样,挖了十几个烧窑的坑
3.像我一样,感觉一个营火不够快,做了4个一起跑
4.至少有两个人在这旁边收东西
5.服务器已关闭

Crash Report

https://mclo.gs/E7Crw1B

Modpack version

0.6.0-rc8

Server version

forge-1.20.1-47.4.10

Other mods and plugins

希望这里还有活人</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 31, 2025 01:22
…tException

Co-authored-by: yuesha-yc <52098789+yuesha-yc@users.noreply.github.com>
Co-authored-by: yuesha-yc <52098789+yuesha-yc@users.noreply.github.com>
… number

Co-authored-by: yuesha-yc <52098789+yuesha-yc@users.noreply.github.com>
Co-authored-by: yuesha-yc <52098789+yuesha-yc@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ClassCastException in temperature calculation block Disable block_temp recipe to prevent multiplayer ClassCastException crash Dec 31, 2025
Copilot AI requested a review from yuesha-yc December 31, 2025 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 疑似多人服务器环境下计算温度的方块会出现转型问题

2 participants