• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyclopsMC / IntegratedDynamics / 24678481406

20 Apr 2026 04:38PM UTC coverage: 53.977% (+0.03%) from 53.947%
24678481406

push

github

web-flow
Fix battery capacity not persisting after world rejoin/restart (#1667)

Agent-Logs-Url: https://github.com/CyclopsMC/IntegratedDynamics/sessions/0af42aed-4a9c-4410-83f8-d8e4033bbf56

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>

3093 of 8981 branches covered (34.44%)

Branch coverage included in aggregate %.

18929 of 31818 relevant lines covered (59.49%)

3.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/src/main/java/org/cyclops/integrateddynamics/capability/energystorage/SimpleEnergyHandlerCapacity.java
1
package org.cyclops.integrateddynamics.capability.energystorage;
2

3
import net.minecraft.world.level.storage.ValueInput;
4
import net.minecraft.world.level.storage.ValueOutput;
5
import net.neoforged.neoforge.transfer.energy.SimpleEnergyHandler;
6

7
/**
8
 * @author rubensworks
9
 */
10
public class SimpleEnergyHandlerCapacity extends SimpleEnergyHandler implements IEnergyStorageCapacity {
11
    public SimpleEnergyHandlerCapacity(int capacity) {
12
        super(capacity);
3✔
13
    }
1✔
14

15
    public SimpleEnergyHandlerCapacity(int capacity, int maxTransfer) {
16
        super(capacity, maxTransfer);
×
17
    }
×
18

19
    public SimpleEnergyHandlerCapacity(int capacity, int maxInsert, int maxExtract) {
20
        super(capacity, maxInsert, maxExtract);
×
21
    }
×
22

23
    public SimpleEnergyHandlerCapacity(int capacity, int maxInsert, int maxExtract, int energy) {
24
        super(capacity, maxInsert, maxExtract, energy);
×
25
    }
×
26

27
    @Override
28
    public void serialize(ValueOutput output) {
29
        super.serialize(output);
3✔
30
        output.putInt("capacity", capacity);
5✔
31
    }
1✔
32

33
    @Override
34
    public void deserialize(ValueInput input) {
35
        super.deserialize(input);
3✔
36
        capacity = Math.max(0, input.getIntOr("capacity", capacity));
9✔
37
    }
1✔
38

39
    @Override
40
    public void setCapacity(int capacity) {
41
        this.capacity = capacity;
3✔
42
    }
1✔
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc