aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtnhlanth/common/beamline/BeamLinePacket.java
blob: fb7bab1f1dbed7043bdc8bb0513f0aeb8f83e021 (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
package gtnhlanth.common.beamline;

import net.minecraft.nbt.NBTTagCompound;

import tectech.mechanics.dataTransport.DataPacket;

public class BeamLinePacket extends DataPacket<BeamInformation> {

    public BeamLinePacket(BeamInformation content) {
        super(content);
    }

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

    @Override
    protected BeamInformation contentFromNBT(NBTTagCompound nbt) {

        return new BeamInformation(
            nbt.getFloat("energy"),
            nbt.getInteger("rate"),
            nbt.getInteger("particleId"),
            nbt.getInteger("focus"));
    }

    @Override
    protected NBTTagCompound contentToNBT() {

        NBTTagCompound compound = new NBTTagCompound();

        compound.setFloat("energy", content.getEnergy());
        compound.setInteger("rate", content.getRate());
        compound.setInteger("particleId", content.getParticleId());
        compound.setFloat("focus", content.getFocus());

        return compound;
    }

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

    @Override
    protected BeamInformation unifyContentWith(BeamInformation arg0) {
        throw new NoSuchMethodError("Unavailable to unify beam info data packet");
    }
}