MCPcopy Create free account
hub / github.com/BuildCraft/BuildCraft / readPayload

Method readPayload

common/buildcraft/transport/pipe/Pipe.java:114–145  ·  view source on GitHub ↗
(PacketBuffer buffer, Side side, MessageContext ctx)

Source from the content-addressed store, hash-verified

112 }
113
114 @SideOnly(Side.CLIENT)
115 public void readPayload(PacketBuffer buffer, Side side, MessageContext ctx) throws IOException {
116 if (side == Side.CLIENT) {
117 connected.clear();
118 textures.clear();
119 types.clear();
120
121 int nColour = buffer.readUnsignedByte();
122 colour = nColour == 0 ? null : EnumDyeColor.byMetadata(nColour - 1);
123
124 for (EnumFacing face : EnumFacing.VALUES) {
125 if (buffer.readBoolean()) {
126 int tex = buffer.readUnsignedByte();
127 int type = buffer.readUnsignedByte();
128
129 connected.add(face);
130 textures.put(face, Integer.valueOf(tex));
131 if (type != 0) {
132 types.put(face, type == 1 ? ConnectedType.TILE : ConnectedType.PIPE);
133 }
134 }
135 }
136
137 behaviour.readPayload(buffer, side, ctx);
138
139 PipeModelKey model = getModel();
140 if (!model.equals(lastModel)) {
141 lastModel = model;
142 getHolder().scheduleRenderUpdate();
143 }
144 }
145 }
146
147 // IPipe
148

Callers 1

PipeMethod · 0.95

Calls 9

getModelMethod · 0.95
equalsMethod · 0.95
getHolderMethod · 0.95
readUnsignedByteMethod · 0.80
readBooleanMethod · 0.80
clearMethod · 0.65
putMethod · 0.65
addMethod · 0.45
scheduleRenderUpdateMethod · 0.45

Tested by

no test coverage detected