Skip to content

Commit fc23f45

Browse files
committed
fix: 🐛 Fixed storage containers closing at extended reach
1 parent 85ad5f8 commit fc23f45

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ loader_version_range=[4,)
1515
mod_id=sophisticatedstorage
1616
mod_name=Sophisticated Storage
1717
mod_license=All Rights Reserved
18-
mod_version=1.5.90
18+
mod_version=1.5.91
1919
mod_group_id=net.p3pp3rf1y
2020
mod_authors=P3pp3rF1y, Ridanisaurus
2121
mod_description=Fancy and functional storage containers.

src/main/java/net/p3pp3rf1y/sophisticatedstorage/common/gui/StorageContainerMenu.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public boolean detectSettingsChangeAndReload() {
133133
public boolean stillValid(Player player) {
134134
BlockPos pos = storageBlockEntity.getBlockPos();
135135
BlockEntity be = player.level().getBlockEntity(pos);
136-
return be instanceof StorageBlockEntity && (player.distanceToSqr(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D) <= 64.0D)
136+
return be instanceof StorageBlockEntity && player.canInteractWithBlock(pos, 4.0F)
137137
&& (!(be instanceof WoodStorageBlockEntity woodStorageBlockEntity) || !woodStorageBlockEntity.isPacked());
138138
}
139139

src/main/java/net/p3pp3rf1y/sophisticatedstorage/entity/MovingStorageOpenersCounter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void incrementOpeners(Player player, Entity entity) {
3535
nextOpenRecheck = player.level().getGameTime() + CHECK_TICK_DELAY;
3636
}
3737

38-
maxInteractionRange = Math.max(player.blockInteractionRange(), maxInteractionRange);
38+
maxInteractionRange = Math.max(player.entityInteractionRange(), maxInteractionRange);
3939
}
4040

4141
public void decrementOpeners(Player player, Entity entity) {
@@ -65,7 +65,7 @@ public void recheckOpeners(Entity entity) {
6565
maxInteractionRange = 0.0;
6666

6767
for (Player player : playersWithStorageOpen) {
68-
maxInteractionRange = Math.max(player.blockInteractionRange(), maxInteractionRange);
68+
maxInteractionRange = Math.max(player.entityInteractionRange(), maxInteractionRange);
6969
}
7070

7171
int numberOfPlayers = playersWithStorageOpen.size();

0 commit comments

Comments
 (0)