Skip to content

Commit cc0c512

Browse files
added cooldown for uninitialized tile check
1 parent 6851a30 commit cc0c512

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/dev/core/pipe/item/travelingItem/TravelingItem.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ class TravelingItem {
115115
this.destroy(true);
116116
return;
117117
}
118-
118+
const tileEntity = World.getTileEntity(x, y, z, this.blockSource);
119+
if (tileEntity?.__initialized === false) {
120+
this.cooldown = ITEM_COOLDOWN_TIME;
121+
return;
122+
}
119123

120124
if (this.modifyByPipe()) {
121125
this.destroy();
@@ -132,8 +136,11 @@ class TravelingItem {
132136
}
133137

134138
this.networkEntity.getClients().setupDistancePolicy(x, y, z, this.blockSource.getDimension(), 32);
135-
if (this.itemMover.findNewMoveVector(this.blockSource)) {
139+
const findResult = this.itemMover.findNewMoveVector(this.blockSource);
140+
if (findResult > 0) {
136141
this.updateMoveData();
142+
} else if (findResult < 0) {
143+
this.cooldown = ITEM_COOLDOWN_TIME;
137144
} else {
138145
this.destroy(true);
139146
return;

0 commit comments

Comments
 (0)