-
Notifications
You must be signed in to change notification settings - Fork 20
Capacitor crashing server #314
Comments
Yep, there's a problem |
Worth noting the crash (and the same problem) occurs in |
Probably changing it to |
@MrJake222, there's no |
It's breaking in To me |
Well... You'll need to override everything then. Because |
I think we could get away with just overriding |
Maybe... But if there's no actual reason for |
The field technially wouldn't be unused because it'll store the energy and pass it around for saving to/restoring from NBT. The Gate essentially treats itself as one of the capacitors right now so the border between the capacitor and the Gate as a energy buffer is very thin. The naming is probably lacking here because |
Well, yes, basically variable duplicate. Power will be stored both in NBT and this variable and all operations will work with 2 similar variables (NBT and field). But... What for?
But it doesn't treat itself as capacitor based on
If you just want to have |
But still there will be a lot of code duplication handling exact same things (simulations when extracting/inserting energy for example). One
For simplicity. You wouldn't need to think whether the returned class will be ItemStorage or StargateEnergy. I get it, the naming is not perfect, but the base class don't have too much overhead.
The only real difference is where the data is being saved. For ItemStack it's the compound attached to ItemStack, for TileEntity it's the compound saved with |
That's why we can create custom base class if you want.
Globals will not be collected by garbage collector tho so I think it's better to have local vars
Well, if you're working with item it will return item storage, if you're working with stargate - stargate storage. Isn't it simple? Also we can create
Yes. And if it's the difference - it's probably better to have 2 different classes with different read/write methods extending one base class without read/write method |
The base class doesn't have read/write methods. There is only serialization which can be ignored.
Or just rename StargateAbstract to sth else. |
As you wish ¯_(ツ)_/¯ |
Btw, what's the point of StargateAbstractEnergyStorage.receiveEnergyInternal? |
It should be able to bypass the limit. |
crash-2021-05-24_20.35.20-server.txt
This causes complete crash
The text was updated successfully, but these errors were encountered: