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

[BUG] Crash with Covers when TileEntities lose their capabilities #1263

Closed
PrototypeTrousers opened this issue Oct 5, 2020 · 6 comments
Closed

Comments

@PrototypeTrousers
Copy link
Contributor

Describe the bug
Placing two Gregtech tanks ( not quantum tanks ) with pumps facing each other in import mode will crash the game on world load.

Versions
Mods:
CodeChickenLib-1.12.2-3.2.3.358-universal
gregtech-1.12.2-1.10.2.566
jei_1.12.2-4.16.1.301
MouseTweaks-2.10-mc1.12.2

Setup
Playing Solo
New world generated

Steps To Reproduce
1)Place 2 tanks adjacent to each other
2)Place pumps on the tanks, facing each other
3)set them to import
4)Save and quit
5)try to load the world

Expected behavior
Placing 2 tanks touching will form a multiblock
Placing one pump will visually show the multiblock not forming anymore.
Placing the second one will work as usual.
Setting the pumps to import
Save and quit
Restart world. Crash.

Crash Report
https://pastebin.com/t2ERFTDJ

Screenshots
tanks placed down
1
pump installed on right tank
2
placing water will fill both tanks
3
saving and reloading will show the multiblock formed again
4
installed pump in the left tank, set as export
5
reload world ( if theres still water on both during the save it will crash on load too
6
setting both pump to import will crash the world on load

@PrototypeTrousers
Copy link
Contributor Author

broke between gregtech-1.12.2-1.8.8.440 and gregtech-1.12.2-1.8.9.457 so i guess since multiblock tanks is a thing

@LAGIdiot
Copy link
Member

LAGIdiot commented Oct 8, 2020

Version:
GTCE: 1.10.2

Outcome:
Bug confirmed based on provided crash-log

Additional information:
This is definitely related to multiblock tanks. It seems that multiblock was formed in same time as Pump Cover started working (on load) which lead to loosing FluidHandlerDelegate which was then used by Pump Cover. But this situation should not happened as multiblock tank should not be formed when there is cover.

Implementation notes:
Check code for multiblock tank forming and prevent it in case that cover is present on side which would be in.

@PrototypeTrousers

This comment has been minimized.

@PrototypeTrousers
Copy link
Contributor Author

from gregtech/common/covers/CoverPump.java
@Override
public <T> T getCapability(Capability<T> capability, T defaultValue) {
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY && defaultValue != null) {

adding the null check avoids the crash but not solves the issue completely, the case being defaultValue should never been null since we check for the capability before even placing the cover.

@PrototypeTrousers PrototypeTrousers changed the title [BUG] Ticking block entity crash with importing pumps facing each other in adjacent tanks [BUG] Crash with Covers when TileEntities lose their capabilities Nov 2, 2020
@PrototypeTrousers
Copy link
Contributor Author

Managed to crash a brewery by installing a conveyor, then wrenching its output side to the conveyor. (brewery only has fluid_item_capability on sides other than output, so defaultValue becomes null). crashes after trying to place anything with capability on the same side (conduits,pipe from logistics pipes,etc)

@LAGIdiot
Copy link
Member

Closing as this one was already fixed

Tictim referenced this issue in Tictim/GregTech Feb 14, 2023
* Go over the models quads to see if they can be rendered at a specific

layer

* optimization

* comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants