S10PacketSpawnPainting .java

net.minecraft.network.play.server.S10PacketSpawnPainting (class, 80 lines): members: getTitle, facing, title, entityID, getEntityID, getFacing, position.

net.minecraft.network.play.serverclass80 linesserver2.0 KB

Implements

API Surface (7)

void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
void processPacket(INetHandlerPlayClient handler)
int getEntityID()
BlockPos getPosition()
EnumFacing getFacing()
String getTitle()

Fields & Constants (4)

entityID
position
facing
title

Code Graph: Dependencies (6)

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

Full Source

S10PacketSpawnPainting.java80 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.entity.item.EntityPainting;
5
import net.minecraft.network.Packet;
6
import net.minecraft.network.PacketBuffer;
7
import net.minecraft.network.play.INetHandlerPlayClient;
8
import net.minecraft.util.BlockPos;
9
import net.minecraft.util.EnumFacing;
10
11
public class S10PacketSpawnPainting implements Packet<INetHandlerPlayClient>
12
{
13
    private int entityID;
14
    private BlockPos position;
15
    private EnumFacing facing;
16
    private String title;
17
18
    public S10PacketSpawnPainting()
19
    {
20
    }
21
22
    public S10PacketSpawnPainting(EntityPainting painting)
23
    {
24
        this.entityID = painting.getEntityId();
25
        this.position = painting.getHangingPosition();
26
        this.facing = painting.facingDirection;
27
        this.title = painting.art.title;
28
    }
29
30
    /**
31
     * Reads the raw packet data from the data stream.
32
     */
33
    public void readPacketData(PacketBuffer buf) throws IOException
34
    {
35
        this.entityID = buf.readVarIntFromBuffer();
36
        this.title = buf.readStringFromBuffer(EntityPainting.EnumArt.field_180001_A);
37
        this.position = buf.readBlockPos();
38
        this.facing = EnumFacing.getHorizontal(buf.readUnsignedByte());
39
    }
40
41
    /**
42
     * Writes the raw packet data to the data stream.
43
     */
44
    public void writePacketData(PacketBuffer buf) throws IOException
45
    {
46
        buf.writeVarIntToBuffer(this.entityID);
47
        buf.writeString(this.title);
48
        buf.writeBlockPos(this.position);
49
        buf.writeByte(this.facing.getHorizontalIndex());
50
    }
51
52
    /**
53
     * Passes this Packet on to the NetHandler for processing.
54
     */
55
    public void processPacket(INetHandlerPlayClient handler)
56
    {
57
        handler.handleSpawnPainting(this);
58
    }
59
60
    public int getEntityID()
61
    {
62
        return this.entityID;
63
    }
64
65
    public BlockPos getPosition()
66
    {
67
        return this.position;
68
    }
69
70
    public EnumFacing getFacing()
71
    {
72
        return this.facing;
73
    }
74
75
    public String getTitle()
76
    {
77
        return this.title;
78
    }
79
}
80

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