Comments (2)
不只是树场
用原版箱子作为机械动力机械结构实体(Contraption/多方块结构)的储存位,被强力胶选定的多方块区域在实体化成Contraption时,物品还不会丢失;但一旦在去实体化后(变回方块后)都会导致内部储存的所有物品丢失。
目前测试,原版箱子、双箱子、陷阱箱、Quark (asm的原版箱子)会丢失;
但原版木桶、原版熔炉、Iron Chest模组箱子、CookingForBlockHeads模组冰箱、MyCrayfishFurniture模组抽屉等,不会存在该问题。
猜测是 CatCustomInventory 相关的箱子,及 BarrelBlock 正常
原版箱子 ChestBlock 及其子类如 TrappedChestBlock,可能有地方需要修复
是否有后台报错:无
简化的复现步骤:
- 放铁轨
- 放装配站在铁轨上
- 放矿车在装配站中
- 放拉杆在装配站上
- 放箱子在装配站上
- 用强力胶黏住多个并排的箱子
- 拉动拉杆、开关控制 contraption 和 block 之间的转换
猜测的问题触发位置:
com.simibubi.create.content.contraptions.AbstractContraptionEntity
的 disassemble
方法
https://github.com/Creators-of-Create/Create/blob/2201d87da7744cf9ee3f83e1e4c21643244f342b/src/main/java/com/simibubi/create/content/contraptions/Contraption.java#L1076-L1098
其中的 blockEntity.load(tag);
或 storage.addStorageToWorld(block, blockEntity);
继续追进去能够发现:addStorageToWorld 对 ChestBlockEntity 有独立的处理逻辑:
https://github.com/Creators-of-Create/Create/blob/2201d87da7744cf9ee3f83e1e4c21643244f342b/src/main/java/com/simibubi/create/content/contraptions/MountedStorage.java#L143-L152
其调用 saveWithFullMetadata
中 saveWithoutMetadata
,对应 cat 存入 PublicBukkitValues
即 this.persistentDataContainer.toTagCompound()
对应 cat craftbukkit 部分:
的
this.customDataTags
可能需要进一步 debug 查看这里实际的内容变动
也可能是我排查的方向错了,可能只是 craftBukkit 没存进 forge 的箱子内容导致原版箱子变空(比如假设所有craftBukkit的原版箱子 CraftInventory 在放下时默认为空箱子?或者没有 loadForgeContainer)而 CatCustomInventory 相关的容器能够正常 loadForgeContainer
顺着这个思路去看的话:
其中的
能拿到 forge 的 MinecraftInventory
目前还不太会用 gradle 去 debug cat... 不过至于为什么猜是通过 ItemStackHandler 构造的 CatCustomInventory
是因为机械动力的 MountedStorage 的 handler 和 dummyHandler 成员均是 ItemStackHandler
from catserver.
不只是树场 用原版箱子作为机械动力机械结构实体(Contraption/多方块结构)的储存位,被强力胶选定的多方块区域在实体化成Contraption时,物品还不会丢失;但一旦在去实体化后(变回方块后)都会导致内部储存的所有物品丢失。
目前测试,原版箱子、双箱子、陷阱箱、Quark (asm的原版箱子)会丢失; 但原版木桶、原版熔炉、Iron Chest模组箱子、CookingForBlockHeads模组冰箱、MyCrayfishFurniture模组抽屉等,不会存在该问题。
猜测是 CatCustomInventory 相关的箱子,及 BarrelBlock 正常 原版箱子 ChestBlock 及其子类如 TrappedChestBlock,可能有地方需要修复
是否有后台报错:
无
简化的复现步骤:
- 放铁轨
- 放装配站在铁轨上
- 放矿车在装配站中
- 放拉杆在装配站上
- 放箱子在装配站上
- 用强力胶黏住多个并排的箱子
- 拉动拉杆、开关控制 contraption 和 block 之间的转换
猜测的问题触发位置:
com.simibubi.create.content.contraptions.AbstractContraptionEntity
的disassemble
方法 https://github.com/Creators-of-Create/Create/blob/2201d87da7744cf9ee3f83e1e4c21643244f342b/src/main/java/com/simibubi/create/content/contraptions/Contraption.java#L1076-L1098 其中的blockEntity.load(tag);
或storage.addStorageToWorld(block, blockEntity);
继续追进去能够发现:addStorageToWorld 对 ChestBlockEntity 有独立的处理逻辑: https://github.com/Creators-of-Create/Create/blob/2201d87da7744cf9ee3f83e1e4c21643244f342b/src/main/java/com/simibubi/create/content/contraptions/MountedStorage.java#L143-L152 其调用
saveWithFullMetadata
中saveWithoutMetadata
,对应 cat 存入PublicBukkitValues
即this.persistentDataContainer.toTagCompound()
对应 cat craftbukkit 部分:的
this.customDataTags
可能需要进一步 debug 查看这里实际的内容变动
也可能是我排查的方向错了,可能只是 craftBukkit 没存进 forge 的箱子内容导致原版箱子变空(比如假设所有craftBukkit的原版箱子 CraftInventory 在放下时默认为空箱子?或者没有 loadForgeContainer)而 CatCustomInventory 相关的容器能够正常 loadForgeContainer 顺着这个思路去看的话:其中的
能拿到 forge 的 MinecraftInventory
目前还不太会用 gradle 去 debug cat... 不过至于为什么猜是通过 ItemStackHandler 构造的 CatCustomInventory 是因为机械动力的 MountedStorage 的 handler 和 dummyHandler 成员均是 ItemStackHandler
说起来调试 我也没弄明白怎么让clone下来的catserver跑起来 甚至mc本体这个依赖都下不动() 不过调试的话 可以把整个服务器目录放到一个maven项目里 用maven启动catserver那个jar文件
如果要看jar里面代码的话 把forge那几个jar添加成maven依赖 然后刷新maven 就可以看里面代码了
比如这样w
<dependency>
<groupId>net.minecraftforge</groupId>
<artifactId>Forge-universal</artifactId>
<version>1.18.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/run/libraries/net/minecraftforge/forge/1.18.2-40.2.14/forge-1.18.2-40.2.14-universal.jar</systemPath>
</dependency>
这个run
目录里面就是服务器
(其实那次修拔刀剑capability丢失那个bug的时候 我一直靠写mod然后mixin进去打日志 内心是崩溃的QwQ)
祝你好运w
from catserver.
Related Issues (20)
- [1.18.2] LibertyBans插件无法加载 HOT 1
- [1.18.2] 跨世界传送末影龙时崩溃: EnderDragon cannot be cast to EnderDragonPart HOT 1
- [1.16.5] 安装Better End Potato Edition最新版时报错崩溃
- [1.16.5]Catserver,MythicMobs报错
- [1.16.5] 不兼容bountifulbaubles HOT 1
- [1.18.2] No explosions HOT 3
- [1.18.2] Issue on player death
- [1.16.5] 玩家重生后重生点丢失
- [1.20.4] 请更新到1.20.4
- [1.20.4] 请更新到1.20.4 HOT 8
- [1.16.5] 请求兼容biggerstacks
- [1.18.2] 请求更新forge版本
- [1.16.5] 放置向北(玩家面向南放置)的贴在方块上的橡木告示牌 报错 HOT 5
- [1.16.5] 请求更新Forge版本 HOT 1
- [1.18.2] lore 与 AttributePlus 在最新构建版本中无法正常使用
- [1.18.2] Custom Npcs模组控制台无法执行插件指令 HOT 1
- [1.16.5] Catserver与citizens2中的path设置寻路点不兼容缺nms方法导致崩服。
- [1.18.2] QuickShop插件无法正常使用
- [1.16.5] ModelEngine not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catserver.