S03PacketTimeUpdate .java

net.minecraft.network.play.server.S03PacketTimeUpdate (class): members: totalWorldTime, getTotalWorldTime, worldTime, getWorldTime, processPacket.

net.minecraft.network.play.serverclass69 linesserver1.6 KB

Implements

API Surface (5)

void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
void processPacket(INetHandlerPlayClient handler)
long getTotalWorldTime()
long getWorldTime()

Fields & Constants (2)

totalWorldTime
worldTime

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

S03PacketTimeUpdate.java69 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.network.Packet;
5
import net.minecraft.network.PacketBuffer;
6
import net.minecraft.network.play.INetHandlerPlayClient;
7
8
public class S03PacketTimeUpdate implements Packet<INetHandlerPlayClient>
9
{
10
    private long totalWorldTime;
11
    private long worldTime;
12
13
    public S03PacketTimeUpdate()
14
    {
15
    }
16
17
    public S03PacketTimeUpdate(long totalWorldTimeIn, long totalTimeIn, boolean doDayLightCycle)
18
    {
19
        this.totalWorldTime = totalWorldTimeIn;
20
        this.worldTime = totalTimeIn;
21
22
        if (!doDayLightCycle)
23
        {
24
            this.worldTime = -this.worldTime;
25
26
            if (this.worldTime == 0L)
27
            {
28
                this.worldTime = -1L;
29
            }
30
        }
31
    }
32
33
    /**
34
     * Reads the raw packet data from the data stream.
35
     */
36
    public void readPacketData(PacketBuffer buf) throws IOException
37
    {
38
        this.totalWorldTime = buf.readLong();
39
        this.worldTime = buf.readLong();
40
    }
41
42
    /**
43
     * Writes the raw packet data to the data stream.
44
     */
45
    public void writePacketData(PacketBuffer buf) throws IOException
46
    {
47
        buf.writeLong(this.totalWorldTime);
48
        buf.writeLong(this.worldTime);
49
    }
50
51
    /**
52
     * Passes this Packet on to the NetHandler for processing.
53
     */
54
    public void processPacket(INetHandlerPlayClient handler)
55
    {
56
        handler.handleTimeUpdate(this);
57
    }
58
59
    public long getTotalWorldTime()
60
    {
61
        return this.totalWorldTime;
62
    }
63
64
    public long getWorldTime()
65
    {
66
        return this.worldTime;
67
    }
68
}
69

Deobfuscated MCP 1.8.9 source of S03PacketTimeUpdate from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S03PacketTimeUpdate.java), stored verbatim.