Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TileRemoteInterface implementation #17

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Fix TileRemoteInterface implementation #17

merged 1 commit into from
Nov 25, 2024

Conversation

reobf
Copy link

@reobf reobf commented Nov 24, 2024

The bug is:
1.Place a RIO Interface block, and insert an AE Network Chip
2.Link the RIO Interface to a Wireless Connector(from ae2stuff)
3.game crash
crash-2024-11-24_15.04.12-server.txt

And this is caused by AE Chip part of RIO Interface not being properly implemented.
other chips(like fluid/item trans chip, EU trans chip) has code like

public ReturnType getXX(){
        IInterfaceXXXX  instance= (IInterfaceXXXX) getTransferImplementation(IInterfaceXXXX.class);//get target
        return instance!= null ? instance.getXX() :EMPTY;//if present, call getXX    if not, return an empty placeholder
}

However, AE Chip code goes like:

public EnumSet<GridFlags> getFlags() {
        IGridBlock gridBlock = (IGridBlock) getTransferImplementation(IGridBlock.class);
        return gridBlock != null ? /*   recursive call!!!receiver is not gridBlock! */getFlags() : EnumSet.noneOf(GridFlags.class);
    
}

Normally, these two functions are not called, but if bound to Wireless Connector, these methods are called for some reason and game crashes.
By the way, I checked history of the .java file, it seems that these two methods are buggy since the mod has been migrated to 1.7.10 by its original author.

Screenshot: Not crashing the game. This is impossible before the PR.
2024-11-24_23 36 59

@Dream-Master Dream-Master requested a review from a team November 24, 2024 18:17
Copy link
Member

@wlhlm wlhlm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Dream-Master Dream-Master merged commit df05832 into GTNewHorizons:master Nov 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants