Skip to content

Commit

Permalink
fix: 🐛 Fixed compression upgrade to properly pickup decompression ite…
Browse files Browse the repository at this point in the history
…m config changes.

Changed storage block neighbor change checks to only run server side which should prevent StackOverflowErrors with some specific combination of mods
  • Loading branch information
P3pp3rF1y committed Oct 13, 2024
1 parent cf55489 commit f083ff8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
minecraft_version=1.18.2
forge_version=40.1.30
mod_version=0.9.7
mod_version=0.9.8
jei_mc_version=1.18.2
jei_version=9.7.2.281
balm_cf_file_id=3914491
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public void onConfigLoad(ModConfigEvent.Loading event) {
private void clearCache() {
stackUpgrade.clearNonStackableItems();
maxUpgradesPerStorage.clearCache();
compressionUpgrade.clearCache();
}

public Server(ForgeConfigSpec.Builder builder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,10 @@ public void toggleUpgradesVisiblity() {
}

public void onNeighborChange(BlockPos neighborPos) {
if (level != null && level.isClientSide()) {
return;
}

Direction direction = Direction.fromNormal(Integer.signum(neighborPos.getX() - worldPosition.getX()), Integer.signum(neighborPos.getY() - worldPosition.getY()), Integer.signum(neighborPos.getZ() - worldPosition.getZ()));
if (direction == null) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,8 @@ public Optional<RecipeHelper.UncompactingResult> getDecompressionResult(Item ite
}
return Optional.ofNullable(additionalDecompressibleItemsMap.get(item));
}

public void clearCache() {
additionalDecompressibleItemsMap = null;
}
}

0 comments on commit f083ff8

Please sign in to comment.