Skip to content

Commit 5400117

Browse files
committed
fix: 🐛 Fixed storage containers closing at extended reach
1 parent 4465575 commit 5400117

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
@@ -13,7 +13,7 @@ loader_version_range=[4,)
1313
mod_id=sophisticatedstorage
1414
mod_name=Sophisticated Storage
1515
mod_license=All Rights Reserved
16-
mod_version=1.5.111
16+
mod_version=1.5.112
1717
mod_group_id=net.p3pp3rf1y
1818
mod_authors=P3pp3rF1y, Ridanisaurus
1919
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
@@ -127,7 +127,7 @@ public boolean detectSettingsChangeAndReload() {
127127
public boolean stillValid(Player player) {
128128
BlockPos pos = storageBlockEntity.getBlockPos();
129129
BlockEntity be = player.level().getBlockEntity(pos);
130-
return be instanceof StorageBlockEntity && (player.distanceToSqr(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D) <= 64.0D)
130+
return be instanceof StorageBlockEntity && player.isWithinBlockInteractionRange(pos, 4.0F)
131131
&& (!(be instanceof WoodStorageBlockEntity woodStorageBlockEntity) || !woodStorageBlockEntity.isPacked());
132132
}
133133

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)