Skip to content

Commit

Permalink
Fix grid nodes being corrupted under specific circumstances (spatial …
Browse files Browse the repository at this point in the history
…anchor + adjacent QNB) (#8162)
  • Loading branch information
shartte authored Aug 24, 2024
1 parent b55bd4c commit 5af3298
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ if (ext.tag) {
// still support configuration caching.
project.version = providers.gradleProperty("version").orElse("").flatMap(version -> {
if (!version.isBlank()) {
return version;
return providers.provider { version }
}
return providers.of(ProjectVersionSource.class, spec -> {
spec.getParameters().getDefaultBranches().addAll("main", "neoforge/" + project.minecraft_version)
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/appeng/me/GridNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,12 @@ void validateGrid() {

public Grid getInternalGrid() {
if (this.myGrid == null) {
this.myGrid = Grid.create(this);
Grid.create(this);
// Note that the node can be moved immediately to a new grid when
// it triggers adjacent connections due to block updates emitted while it joins the grid.
// That means the return value of Grid.create is not necessarily the new grid,
// but myGrid will already have been updated by the Grid calling setGrid on this node.
return Objects.requireNonNull(this.myGrid);
}

return this.myGrid;
Expand Down

0 comments on commit 5af3298

Please sign in to comment.