S1DPacketEntityEffect .java

net.minecraft.network.play.server.S1DPacketEntityEffect (class): members: func_149429_c, func_179707_f, hideParticles, getAmplifier, getDuration, duration.

net.minecraft.network.play.serverclass101 linesserver2.4 KB

Implements

API Surface (9)

void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
boolean func_149429_c()
void processPacket(INetHandlerPlayClient handler)
int getEntityId()
byte getEffectId()
byte getAmplifier()
int getDuration()
boolean func_179707_f()

Fields & Constants (5)

entityId
effectId
amplifier
duration
hideParticles

Code Graph: Dependencies (4)

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

Full Source

S1DPacketEntityEffect.java101 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
import net.minecraft.potion.PotionEffect;
8
9
public class S1DPacketEntityEffect implements Packet<INetHandlerPlayClient>
10
{
11
    private int entityId;
12
    private byte effectId;
13
    private byte amplifier;
14
    private int duration;
15
    private byte hideParticles;
16
17
    public S1DPacketEntityEffect()
18
    {
19
    }
20
21
    public S1DPacketEntityEffect(int entityIdIn, PotionEffect effect)
22
    {
23
        this.entityId = entityIdIn;
24
        this.effectId = (byte)(effect.getPotionID() & 255);
25
        this.amplifier = (byte)(effect.getAmplifier() & 255);
26
27
        if (effect.getDuration() > 32767)
28
        {
29
            this.duration = 32767;
30
        }
31
        else
32
        {
33
            this.duration = effect.getDuration();
34
        }
35
36
        this.hideParticles = (byte)(effect.getIsShowParticles() ? 1 : 0);
37
    }
38
39
    /**
40
     * Reads the raw packet data from the data stream.
41
     */
42
    public void readPacketData(PacketBuffer buf) throws IOException
43
    {
44
        this.entityId = buf.readVarIntFromBuffer();
45
        this.effectId = buf.readByte();
46
        this.amplifier = buf.readByte();
47
        this.duration = buf.readVarIntFromBuffer();
48
        this.hideParticles = buf.readByte();
49
    }
50
51
    /**
52
     * Writes the raw packet data to the data stream.
53
     */
54
    public void writePacketData(PacketBuffer buf) throws IOException
55
    {
56
        buf.writeVarIntToBuffer(this.entityId);
57
        buf.writeByte(this.effectId);
58
        buf.writeByte(this.amplifier);
59
        buf.writeVarIntToBuffer(this.duration);
60
        buf.writeByte(this.hideParticles);
61
    }
62
63
    public boolean func_149429_c()
64
    {
65
        return this.duration == 32767;
66
    }
67
68
    /**
69
     * Passes this Packet on to the NetHandler for processing.
70
     */
71
    public void processPacket(INetHandlerPlayClient handler)
72
    {
73
        handler.handleEntityEffect(this);
74
    }
75
76
    public int getEntityId()
77
    {
78
        return this.entityId;
79
    }
80
81
    public byte getEffectId()
82
    {
83
        return this.effectId;
84
    }
85
86
    public byte getAmplifier()
87
    {
88
        return this.amplifier;
89
    }
90
91
    public int getDuration()
92
    {
93
        return this.duration;
94
    }
95
96
    public boolean func_179707_f()
97
    {
98
        return this.hideParticles != 0;
99
    }
100
}
101

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