• 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

9.52
/src/main/java/org/cyclops/integrateddynamics/network/packet/ActionLabelPacket.java
1
package org.cyclops.integrateddynamics.network.packet;
2

3
import net.minecraft.network.RegistryFriendlyByteBuf;
4
import net.minecraft.network.codec.StreamCodec;
5
import net.minecraft.resources.ResourceLocation;
6
import net.minecraft.server.level.ServerPlayer;
7
import net.minecraft.world.entity.player.Player;
8
import net.minecraft.world.level.Level;
9
import org.cyclops.cyclopscore.network.CodecField;
10
import org.cyclops.cyclopscore.network.PacketCodec;
11
import org.cyclops.integrateddynamics.IntegratedDynamics;
12
import org.cyclops.integrateddynamics.Reference;
13
import org.cyclops.integrateddynamics.core.persist.world.LabelsWorldStorage;
14

15
/**
16
 * Packet for notifying onLabelPacket changes.
17
 * @author rubensworks
18
 *
19
 */
20
public class ActionLabelPacket extends PacketCodec {
21

22
    public static final Type<ActionLabelPacket> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "action_label"));
7✔
23
    public static final StreamCodec<RegistryFriendlyByteBuf, ActionLabelPacket> CODEC = getCodec(ActionLabelPacket::new);
4✔
24

25
    @CodecField
26
    private int variableId;
27
    @CodecField
28
    private String label; // If null, this action is assumed to be a removal.
29

30
    public ActionLabelPacket() {
31
        super(TYPE);
×
32
    }
×
33

34
    public ActionLabelPacket(int variableId, String label) {
35
        super(TYPE);
×
36
        this.variableId = variableId;
×
37
        this.label = label;
×
38
    }
×
39

40
    @Override
41
    public boolean isAsync() {
42
        return false;
×
43
    }
44

45
    @Override
46
    public void actionClient(Level world, Player player) {
47
        if(label == null) {
×
48
            LabelsWorldStorage.Access.getInstance(IntegratedDynamics._instance).get().removeUnsafe(variableId);
×
49
        } else {
50
            LabelsWorldStorage.Access.getInstance(IntegratedDynamics._instance).get().putUnsafe(variableId, label);
×
51
        }
52
    }
×
53

54
    @Override
55
    public void actionServer(Level world, ServerPlayer player) {
56
        if(label == null) {
×
57
            LabelsWorldStorage.Access.getInstance(IntegratedDynamics._instance).get().remove(variableId);
×
58
        } else {
59
            LabelsWorldStorage.Access.getInstance(IntegratedDynamics._instance).get().put(variableId, label);
×
60
        }
61
    }
×
62

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