aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/tectech/mechanics/dataTransport/QuantumDataPacket.java
blob: 974831df07f66cf3063c41f7fdbde4cc12b68818 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package tectech.mechanics.dataTransport;

import net.minecraft.nbt.NBTTagCompound;

import com.gtnewhorizon.structurelib.util.Vec3Impl;

public class QuantumDataPacket extends DataPacket<Long> {

    public QuantumDataPacket(Long content) {
        super(content);
    }

    public QuantumDataPacket(NBTTagCompound compound) {
        super(compound);
    }

    @Override
    protected Long contentFromNBT(NBTTagCompound nbt) {
        return nbt.getLong("computation");
    }

    @Override
    protected NBTTagCompound contentToNBT() {
        NBTTagCompound compound = new NBTTagCompound();
        compound.setLong("computation", content);
        return compound;
    }

    @Override
    public boolean extraCheck() {
        return true;
    }

    @Override
    protected Long unifyContentWith(Long content) {
        return this.content + content;
    }

    public QuantumDataPacket unifyTraceWith(Vec3Impl... positions) {
        return (QuantumDataPacket) super.unifyTrace(positions);
    }

    public QuantumDataPacket unifyTraceWith(QuantumDataPacket p) {
        return (QuantumDataPacket) super.unifyTrace(p);
    }

    public QuantumDataPacket unifyPacketWith(QuantumDataPacket p) {
        return (QuantumDataPacket) super.unifyWith(p);
    }
}