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

CyclopsMC / IntegratedDynamics / 16552051255

27 Jul 2025 01:58PM UTC coverage: 53.206% (+8.0%) from 45.161%
16552051255

push

github

rubensworks
Resolve minor TODOs

2888 of 8740 branches covered (33.04%)

Branch coverage included in aggregate %.

17341 of 29280 relevant lines covered (59.22%)

3.08 hits per line

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

0.0
/src/main/java/org/cyclops/integrateddynamics/core/network/diagnostics/RawObserverData.java
1
package org.cyclops.integrateddynamics.core.network.diagnostics;
2

3
import lombok.Data;
4
import net.minecraft.core.BlockPos;
5
import net.minecraft.core.Direction;
6
import net.minecraft.core.registries.Registries;
7
import net.minecraft.nbt.CompoundTag;
8
import net.minecraft.resources.ResourceKey;
9
import net.minecraft.resources.ResourceLocation;
10
import net.minecraft.world.level.Level;
11

12
/**
13
 * @author rubensworks
14
 */
15
@Data
×
16
public class RawObserverData implements IRawData {
17

18
    private final ResourceKey<Level> dimension;
×
19
    private final BlockPos pos;
×
20
    private final Direction side;
×
21
    private final String name;
×
22
    private final long last20TicksDurationNs;
×
23

24
    @Override
25
    public String toString() {
26
        return String.format("%s: %s,%s,%s,%s (%s)", name, pos.getX(), pos.getY(), pos.getZ(), side, dimension.location());
×
27
    }
28

29
    public CompoundTag toNbt() {
30
        CompoundTag tag = new CompoundTag();
×
31
        tag.putString("dimension", dimension.location().toString());
×
32
        tag.putLong("pos", pos.asLong());
×
33
        if (side != null) {
×
34
            tag.putInt("side", side.ordinal());
×
35
        }
36
        tag.putString("name", name);
×
37
        tag.putLong("last20TicksDurationNs", last20TicksDurationNs);
×
38
        return tag;
×
39
    }
40

41
    public static RawObserverData fromNbt(CompoundTag tag) {
42
        return new RawObserverData(
×
43
                ResourceKey.create(Registries.DIMENSION, ResourceLocation.parse(tag.getString("dimension").orElseThrow())),
×
44
                BlockPos.of(tag.getLong("pos").orElseThrow()),
×
45
                tag.contains("side") ? Direction.values()[tag.getInt("side").orElseThrow()] : null,
×
46
                tag.getString("name").orElseThrow(),
×
47
                tag.getLong("last20TicksDurationNs").orElseThrow()
×
48
        );
49
    }
50

51
}
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