PacketBuffer .java

net.minecraft.network.PacketBuffer (class, 1045 lines): extends ByteBuf. members: readNBTTagCompoundFromBuffer, writeNBTTagCompoundToBuffer, buf, alloc.

net.minecraft.networkclass1,045 linescommonextends ByteBuf25.8 KB

API Surface (166)

int getVarIntSize(int input)
void writeByteArray(byte[] array)
byte[] readByteArray()
BlockPos readBlockPos()
void writeBlockPos(BlockPos pos)
IChatComponent readChatComponent()
void writeChatComponent(IChatComponent component)
<T extends Enum<T>> T readEnumValue(Class<T> enumClass)
void writeEnumValue(Enum<?> value)
int readVarIntFromBuffer()
long readVarLong()
void writeUuid(UUID uuid)
UUID readUuid()
void writeVarIntToBuffer(int input)
void writeVarLong(long value)
void writeNBTTagCompoundToBuffer(NBTTagCompound nbt)
NBTTagCompound readNBTTagCompoundFromBuffer()
void writeItemStackToBuffer(ItemStack stack)
ItemStack readItemStackFromBuffer()
String readStringFromBuffer(int maxLength)
PacketBuffer writeString(String string)
int capacity()
ByteBuf capacity(int p_capacity_1_)
int maxCapacity()
ByteBufAllocator alloc()
ByteOrder order()
ByteBuf order(ByteOrder p_order_1_)
ByteBuf unwrap()
boolean isDirect()
int readerIndex()
ByteBuf readerIndex(int p_readerIndex_1_)
int writerIndex()
ByteBuf writerIndex(int p_writerIndex_1_)
ByteBuf setIndex(int p_setIndex_1_, int p_setIndex_2_)
int readableBytes()
int writableBytes()
int maxWritableBytes()
boolean isReadable()
boolean isReadable(int p_isReadable_1_)
boolean isWritable()
boolean isWritable(int p_isWritable_1_)
ByteBuf clear()
ByteBuf markReaderIndex()
ByteBuf resetReaderIndex()
ByteBuf markWriterIndex()
ByteBuf resetWriterIndex()
ByteBuf discardReadBytes()
ByteBuf discardSomeReadBytes()
ByteBuf ensureWritable(int p_ensureWritable_1_)
int ensureWritable(int p_ensureWritable_1_, boolean p_ensureWritable_2_)
boolean getBoolean(int p_getBoolean_1_)
byte getByte(int p_getByte_1_)
short getUnsignedByte(int p_getUnsignedByte_1_)
short getShort(int p_getShort_1_)
int getUnsignedShort(int p_getUnsignedShort_1_)
int getMedium(int p_getMedium_1_)
int getUnsignedMedium(int p_getUnsignedMedium_1_)
int getInt(int p_getInt_1_)
long getUnsignedInt(int p_getUnsignedInt_1_)
long getLong(int p_getLong_1_)
char getChar(int p_getChar_1_)
float getFloat(int p_getFloat_1_)
double getDouble(int p_getDouble_1_)
ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_)
ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_)
ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_)
ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_)
ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_)
ByteBuf getBytes(int p_getBytes_1_, ByteBuffer p_getBytes_2_)
ByteBuf getBytes(int p_getBytes_1_, OutputStream p_getBytes_2_, int p_getBytes_3_)
int getBytes(int p_getBytes_1_, GatheringByteChannel p_getBytes_2_, int p_getBytes_3_)
ByteBuf setBoolean(int p_setBoolean_1_, boolean p_setBoolean_2_)
ByteBuf setByte(int p_setByte_1_, int p_setByte_2_)
ByteBuf setShort(int p_setShort_1_, int p_setShort_2_)
ByteBuf setMedium(int p_setMedium_1_, int p_setMedium_2_)
ByteBuf setInt(int p_setInt_1_, int p_setInt_2_)
ByteBuf setLong(int p_setLong_1_, long p_setLong_2_)
ByteBuf setChar(int p_setChar_1_, int p_setChar_2_)
ByteBuf setFloat(int p_setFloat_1_, float p_setFloat_2_)
ByteBuf setDouble(int p_setDouble_1_, double p_setDouble_2_)
ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_)
ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_)
ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_)
ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_)
ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_)
ByteBuf setBytes(int p_setBytes_1_, ByteBuffer p_setBytes_2_)
int setBytes(int p_setBytes_1_, InputStream p_setBytes_2_, int p_setBytes_3_)
int setBytes(int p_setBytes_1_, ScatteringByteChannel p_setBytes_2_, int p_setBytes_3_)
ByteBuf setZero(int p_setZero_1_, int p_setZero_2_)
boolean readBoolean()
byte readByte()
short readUnsignedByte()
short readShort()
int readUnsignedShort()
int readMedium()
int readUnsignedMedium()
int readInt()
long readUnsignedInt()
long readLong()
char readChar()
float readFloat()
double readDouble()
ByteBuf readBytes(int p_readBytes_1_)
ByteBuf readSlice(int p_readSlice_1_)
ByteBuf readBytes(ByteBuf p_readBytes_1_)
ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_)
ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_)
ByteBuf readBytes(byte[] p_readBytes_1_)
ByteBuf readBytes(byte[] p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_)
ByteBuf readBytes(ByteBuffer p_readBytes_1_)
ByteBuf readBytes(OutputStream p_readBytes_1_, int p_readBytes_2_)
int readBytes(GatheringByteChannel p_readBytes_1_, int p_readBytes_2_)
ByteBuf skipBytes(int p_skipBytes_1_)
ByteBuf writeBoolean(boolean p_writeBoolean_1_)
ByteBuf writeByte(int p_writeByte_1_)
ByteBuf writeShort(int p_writeShort_1_)
ByteBuf writeMedium(int p_writeMedium_1_)
ByteBuf writeInt(int p_writeInt_1_)
ByteBuf writeLong(long p_writeLong_1_)
ByteBuf writeChar(int p_writeChar_1_)

…and 46 more (see full source).

Fields & Constants (1)

buf

String literals (4)

"VarInt too big"
"VarLong too big"
"String too big (was "
" bytes encoded, max "

Full Source

PacketBuffer.java1045 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.network;
2
3
import com.google.common.base.Charsets;
4
import io.netty.buffer.ByteBuf;
5
import io.netty.buffer.ByteBufAllocator;
6
import io.netty.buffer.ByteBufInputStream;
7
import io.netty.buffer.ByteBufOutputStream;
8
import io.netty.buffer.ByteBufProcessor;
9
import io.netty.handler.codec.DecoderException;
10
import io.netty.handler.codec.EncoderException;
11
import java.io.IOException;
12
import java.io.InputStream;
13
import java.io.OutputStream;
14
import java.nio.ByteBuffer;
15
import java.nio.ByteOrder;
16
import java.nio.channels.GatheringByteChannel;
17
import java.nio.channels.ScatteringByteChannel;
18
import java.nio.charset.Charset;
19
import java.util.UUID;
20
import net.minecraft.item.Item;
21
import net.minecraft.item.ItemStack;
22
import net.minecraft.nbt.CompressedStreamTools;
23
import net.minecraft.nbt.NBTSizeTracker;
24
import net.minecraft.nbt.NBTTagCompound;
25
import net.minecraft.util.BlockPos;
26
import net.minecraft.util.IChatComponent;
27
28
public class PacketBuffer extends ByteBuf
29
{
30
    private final ByteBuf buf;
31
32
    public PacketBuffer(ByteBuf wrapped)
33
    {
34
        this.buf = wrapped;
35
    }
36
37
    /**
38
     * Calculates the number of bytes required to fit the supplied int (0-5) if it were to be read/written using
39
     * readVarIntFromBuffer or writeVarIntToBuffer
40
     */
41
    public static int getVarIntSize(int input)
42
    {
43
        for (int i = 1; i < 5; ++i)
44
        {
45
            if ((input & -1 << i * 7) == 0)
46
            {
47
                return i;
48
            }
49
        }
50
51
        return 5;
52
    }
53
54
    public void writeByteArray(byte[] array)
55
    {
56
        this.writeVarIntToBuffer(array.length);
57
        this.writeBytes(array);
58
    }
59
60
    public byte[] readByteArray()
61
    {
62
        byte[] abyte = new byte[this.readVarIntFromBuffer()];
63
        this.readBytes(abyte);
64
        return abyte;
65
    }
66
67
    public BlockPos readBlockPos()
68
    {
69
        return BlockPos.fromLong(this.readLong());
70
    }
71
72
    public void writeBlockPos(BlockPos pos)
73
    {
74
        this.writeLong(pos.toLong());
75
    }
76
77
    public IChatComponent readChatComponent() throws IOException
78
    {
79
        return IChatComponent.Serializer.jsonToComponent(this.readStringFromBuffer(32767));
80
    }
81
82
    public void writeChatComponent(IChatComponent component) throws IOException
83
    {
84
        this.writeString(IChatComponent.Serializer.componentToJson(component));
85
    }
86
87
    public <T extends Enum<T>> T readEnumValue(Class<T> enumClass)
88
    {
89
        return enumClass.getEnumConstants()[this.readVarIntFromBuffer()]; // Fixed useless casts
90
    }
91
92
    public void writeEnumValue(Enum<?> value)
93
    {
94
        this.writeVarIntToBuffer(value.ordinal());
95
    }
96
97
    /**
98
     * Reads a compressed int from the buffer. To do so it maximally reads 5 byte-sized chunks whose most significant
99
     * bit dictates whether another byte should be read.
100
     */
101
    public int readVarIntFromBuffer()
102
    {
103
        int i = 0;
104
        int j = 0;
105
106
        while (true)
107
        {
108
            byte b0 = this.readByte();
109
            i |= (b0 & 127) << j++ * 7;
110
111
            if (j > 5)
112
            {
113
                throw new RuntimeException("VarInt too big");
114
            }
115
116
            if ((b0 & 128) != 128)
117
            {
118
                break;
119
            }
120
        }
121
122
        return i;
123
    }
124
125
    public long readVarLong()
126
    {
127
        long i = 0L;
128
        int j = 0;
129
130
        while (true)
131
        {
132
            byte b0 = this.readByte();
133
            i |= (long)(b0 & 127) << j++ * 7;
134
135
            if (j > 10)
136
            {
137
                throw new RuntimeException("VarLong too big");
138
            }
139
140
            if ((b0 & 128) != 128)
141
            {
142
                break;
143
            }
144
        }
145
146
        return i;
147
    }
148
149
    public void writeUuid(UUID uuid)
150
    {
151
        this.writeLong(uuid.getMostSignificantBits());
152
        this.writeLong(uuid.getLeastSignificantBits());
153
    }
154
155
    public UUID readUuid()
156
    {
157
        return new UUID(this.readLong(), this.readLong());
158
    }
159
160
    /**
161
     * Writes a compressed int to the buffer. The smallest number of bytes to fit the passed int will be written. Of
162
     * each such byte only 7 bits will be used to describe the actual value since its most significant bit dictates
163
     * whether the next byte is part of that same int. Micro-optimization for int values that are expected to have
164
     * values below 128.
165
     */
166
    public void writeVarIntToBuffer(int input)
167
    {
168
        while ((input & -128) != 0)
169
        {
170
            this.writeByte(input & 127 | 128);
171
            input >>>= 7;
172
        }
173
174
        this.writeByte(input);
175
    }
176
177
    public void writeVarLong(long value)
178
    {
179
        while ((value & -128L) != 0L)
180
        {
181
            this.writeByte((int)(value & 127L) | 128);
182
            value >>>= 7;
183
        }
184
185
        this.writeByte((int)value);
186
    }
187
188
    /**
189
     * Writes a compressed NBTTagCompound to this buffer
190
     */
191
    public void writeNBTTagCompoundToBuffer(NBTTagCompound nbt)
192
    {
193
        if (nbt == null)
194
        {
195
            this.writeByte(0);
196
        }
197
        else
198
        {
199
            try
200
            {
201
                CompressedStreamTools.write(nbt, new ByteBufOutputStream(this));
202
            }
203
            catch (IOException ioexception)
204
            {
205
                throw new EncoderException(ioexception);
206
            }
207
        }
208
    }
209
210
    /**
211
     * Reads a compressed NBTTagCompound from this buffer
212
     */
213
    public NBTTagCompound readNBTTagCompoundFromBuffer() throws IOException
214
    {
215
        int i = this.readerIndex();
216
        byte b0 = this.readByte();
217
218
        if (b0 == 0)
219
        {
220
            return null;
221
        }
222
        else
223
        {
224
            this.readerIndex(i);
225
            return CompressedStreamTools.read(new ByteBufInputStream(this), new NBTSizeTracker(2097152L));
226
        }
227
    }
228
229
    /**
230
     * Writes the ItemStack's ID (short), then size (byte), then damage. (short)
231
     */
232
    public void writeItemStackToBuffer(ItemStack stack)
233
    {
234
        if (stack == null)
235
        {
236
            this.writeShort(-1);
237
        }
238
        else
239
        {
240
            this.writeShort(Item.getIdFromItem(stack.getItem()));
241
            this.writeByte(stack.stackSize);
242
            this.writeShort(stack.getMetadata());
243
            NBTTagCompound nbttagcompound = null;
244
245
            if (stack.getItem().isDamageable() || stack.getItem().getShareTag())
246
            {
247
                nbttagcompound = stack.getTagCompound();
248
            }
249
250
            this.writeNBTTagCompoundToBuffer(nbttagcompound);
251
        }
252
    }
253
254
    /**
255
     * Reads an ItemStack from this buffer
256
     */
257
    public ItemStack readItemStackFromBuffer() throws IOException
258
    {
259
        ItemStack itemstack = null;
260
        int i = this.readShort();
261
262
        if (i >= 0)
263
        {
264
            int j = this.readByte();
265
            int k = this.readShort();
266
            itemstack = new ItemStack(Item.getItemById(i), j, k);
267
            itemstack.setTagCompound(this.readNBTTagCompoundFromBuffer());
268
        }
269
270
        return itemstack;
271
    }
272
273
    /**
274
     * Reads a string from this buffer. Expected parameter is maximum allowed string length. Will throw IOException if
275
     * string length exceeds this value!
276
     */
277
    public String readStringFromBuffer(int maxLength)
278
    {
279
        int i = this.readVarIntFromBuffer();
280
281
        if (i > maxLength * 4)
282
        {
283
            throw new DecoderException("The received encoded string buffer length is longer than maximum allowed (" + i + " > " + maxLength * 4 + ")");
284
        }
285
        else if (i < 0)
286
        {
287
            throw new DecoderException("The received encoded string buffer length is less than zero! Weird string!");
288
        }
289
        else
290
        {
291
            String s = new String(this.readBytes(i).array(), Charsets.UTF_8);
292
293
            if (s.length() > maxLength)
294
            {
295
                throw new DecoderException("The received string length is longer than maximum allowed (" + i + " > " + maxLength + ")");
296
            }
297
            else
298
            {
299
                return s;
300
            }
301
        }
302
    }
303
304
    public PacketBuffer writeString(String string)
305
    {
306
        byte[] abyte = string.getBytes(Charsets.UTF_8);
307
308
        if (abyte.length > 32767)
309
        {
310
            throw new EncoderException("String too big (was " + string.length() + " bytes encoded, max " + 32767 + ")");
311
        }
312
        else
313
        {
314
            this.writeVarIntToBuffer(abyte.length);
315
            this.writeBytes(abyte);
316
            return this;
317
        }
318
    }
319
320
    public int capacity()
321
    {
322
        return this.buf.capacity();
323
    }
324
325
    public ByteBuf capacity(int p_capacity_1_)
326
    {
327
        return this.buf.capacity(p_capacity_1_);
328
    }
329
330
    public int maxCapacity()
331
    {
332
        return this.buf.maxCapacity();
333
    }
334
335
    public ByteBufAllocator alloc()
336
    {
337
        return this.buf.alloc();
338
    }
339
340
    public ByteOrder order()
341
    {
342
        return this.buf.order();
343
    }
344
345
    public ByteBuf order(ByteOrder p_order_1_)
346
    {
347
        return this.buf.order(p_order_1_);
348
    }
349
350
    public ByteBuf unwrap()
351
    {
352
        return this.buf.unwrap();
353
    }
354
355
    public boolean isDirect()
356
    {
357
        return this.buf.isDirect();
358
    }
359
360
    public int readerIndex()
361
    {
362
        return this.buf.readerIndex();
363
    }
364
365
    public ByteBuf readerIndex(int p_readerIndex_1_)
366
    {
367
        return this.buf.readerIndex(p_readerIndex_1_);
368
    }
369
370
    public int writerIndex()
371
    {
372
        return this.buf.writerIndex();
373
    }
374
375
    public ByteBuf writerIndex(int p_writerIndex_1_)
376
    {
377
        return this.buf.writerIndex(p_writerIndex_1_);
378
    }
379
380
    public ByteBuf setIndex(int p_setIndex_1_, int p_setIndex_2_)
381
    {
382
        return this.buf.setIndex(p_setIndex_1_, p_setIndex_2_);
383
    }
384
385
    public int readableBytes()
386
    {
387
        return this.buf.readableBytes();
388
    }
389
390
    public int writableBytes()
391
    {
392
        return this.buf.writableBytes();
393
    }
394
395
    public int maxWritableBytes()
396
    {
397
        return this.buf.maxWritableBytes();
398
    }
399
400
    public boolean isReadable()
401
    {
402
        return this.buf.isReadable();
403
    }
404
405
    public boolean isReadable(int p_isReadable_1_)
406
    {
407
        return this.buf.isReadable(p_isReadable_1_);
408
    }
409
410
    public boolean isWritable()
411
    {
412
        return this.buf.isWritable();
413
    }
414
415
    public boolean isWritable(int p_isWritable_1_)
416
    {
417
        return this.buf.isWritable(p_isWritable_1_);
418
    }
419
420
    public ByteBuf clear()
421
    {
422
        return this.buf.clear();
423
    }
424
425
    public ByteBuf markReaderIndex()
426
    {
427
        return this.buf.markReaderIndex();
428
    }
429
430
    public ByteBuf resetReaderIndex()
431
    {
432
        return this.buf.resetReaderIndex();
433
    }
434
435
    public ByteBuf markWriterIndex()
436
    {
437
        return this.buf.markWriterIndex();
438
    }
439
440
    public ByteBuf resetWriterIndex()
441
    {
442
        return this.buf.resetWriterIndex();
443
    }
444
445
    public ByteBuf discardReadBytes()
446
    {
447
        return this.buf.discardReadBytes();
448
    }
449
450
    public ByteBuf discardSomeReadBytes()
451
    {
452
        return this.buf.discardSomeReadBytes();
453
    }
454
455
    public ByteBuf ensureWritable(int p_ensureWritable_1_)
456
    {
457
        return this.buf.ensureWritable(p_ensureWritable_1_);
458
    }
459
460
    public int ensureWritable(int p_ensureWritable_1_, boolean p_ensureWritable_2_)
461
    {
462
        return this.buf.ensureWritable(p_ensureWritable_1_, p_ensureWritable_2_);
463
    }
464
465
    public boolean getBoolean(int p_getBoolean_1_)
466
    {
467
        return this.buf.getBoolean(p_getBoolean_1_);
468
    }
469
470
    public byte getByte(int p_getByte_1_)
471
    {
472
        return this.buf.getByte(p_getByte_1_);
473
    }
474
475
    public short getUnsignedByte(int p_getUnsignedByte_1_)
476
    {
477
        return this.buf.getUnsignedByte(p_getUnsignedByte_1_);
478
    }
479
480
    public short getShort(int p_getShort_1_)
481
    {
482
        return this.buf.getShort(p_getShort_1_);
483
    }
484
485
    public int getUnsignedShort(int p_getUnsignedShort_1_)
486
    {
487
        return this.buf.getUnsignedShort(p_getUnsignedShort_1_);
488
    }
489
490
    public int getMedium(int p_getMedium_1_)
491
    {
492
        return this.buf.getMedium(p_getMedium_1_);
493
    }
494
495
    public int getUnsignedMedium(int p_getUnsignedMedium_1_)
496
    {
497
        return this.buf.getUnsignedMedium(p_getUnsignedMedium_1_);
498
    }
499
500
    public int getInt(int p_getInt_1_)
501
    {
502
        return this.buf.getInt(p_getInt_1_);
503
    }
504
505
    public long getUnsignedInt(int p_getUnsignedInt_1_)
506
    {
507
        return this.buf.getUnsignedInt(p_getUnsignedInt_1_);
508
    }
509
510
    public long getLong(int p_getLong_1_)
511
    {
512
        return this.buf.getLong(p_getLong_1_);
513
    }
514
515
    public char getChar(int p_getChar_1_)
516
    {
517
        return this.buf.getChar(p_getChar_1_);
518
    }
519
520
    public float getFloat(int p_getFloat_1_)
521
    {
522
        return this.buf.getFloat(p_getFloat_1_);
523
    }
524
525
    public double getDouble(int p_getDouble_1_)
526
    {
527
        return this.buf.getDouble(p_getDouble_1_);
528
    }
529
530
    public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_)
531
    {
532
        return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_);
533
    }
534
535
    public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_)
536
    {
537
        return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_);
538
    }
539
540
    public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_)
541
    {
542
        return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_);
543
    }
544
545
    public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_)
546
    {
547
        return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_);
548
    }
549
550
    public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_)
551
    {
552
        return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_);
553
    }
554
555
    public ByteBuf getBytes(int p_getBytes_1_, ByteBuffer p_getBytes_2_)
556
    {
557
        return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_);
558
    }
559
560
    public ByteBuf getBytes(int p_getBytes_1_, OutputStream p_getBytes_2_, int p_getBytes_3_) throws IOException
561
    {
562
        return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_);
563
    }
564
565
    public int getBytes(int p_getBytes_1_, GatheringByteChannel p_getBytes_2_, int p_getBytes_3_) throws IOException
566
    {
567
        return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_);
568
    }
569
570
    public ByteBuf setBoolean(int p_setBoolean_1_, boolean p_setBoolean_2_)
571
    {
572
        return this.buf.setBoolean(p_setBoolean_1_, p_setBoolean_2_);
573
    }
574
575
    public ByteBuf setByte(int p_setByte_1_, int p_setByte_2_)
576
    {
577
        return this.buf.setByte(p_setByte_1_, p_setByte_2_);
578
    }
579
580
    public ByteBuf setShort(int p_setShort_1_, int p_setShort_2_)
581
    {
582
        return this.buf.setShort(p_setShort_1_, p_setShort_2_);
583
    }
584
585
    public ByteBuf setMedium(int p_setMedium_1_, int p_setMedium_2_)
586
    {
587
        return this.buf.setMedium(p_setMedium_1_, p_setMedium_2_);
588
    }
589
590
    public ByteBuf setInt(int p_setInt_1_, int p_setInt_2_)
591
    {
592
        return this.buf.setInt(p_setInt_1_, p_setInt_2_);
593
    }
594
595
    public ByteBuf setLong(int p_setLong_1_, long p_setLong_2_)
596
    {
597
        return this.buf.setLong(p_setLong_1_, p_setLong_2_);
598
    }
599
600
    public ByteBuf setChar(int p_setChar_1_, int p_setChar_2_)
601
    {
602
        return this.buf.setChar(p_setChar_1_, p_setChar_2_);
603
    }
604
605
    public ByteBuf setFloat(int p_setFloat_1_, float p_setFloat_2_)
606
    {
607
        return this.buf.setFloat(p_setFloat_1_, p_setFloat_2_);
608
    }
609
610
    public ByteBuf setDouble(int p_setDouble_1_, double p_setDouble_2_)
611
    {
612
        return this.buf.setDouble(p_setDouble_1_, p_setDouble_2_);
613
    }
614
615
    public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_)
616
    {
617
        return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_);
618
    }
619
620
    public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_)
621
    {
622
        return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_);
623
    }
624
625
    public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_)
626
    {
627
        return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_);
628
    }
629
630
    public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_)
631
    {
632
        return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_);
633
    }
634
635
    public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_)
636
    {
637
        return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_);
638
    }
639
640
    public ByteBuf setBytes(int p_setBytes_1_, ByteBuffer p_setBytes_2_)
641
    {
642
        return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_);
643
    }
644
645
    public int setBytes(int p_setBytes_1_, InputStream p_setBytes_2_, int p_setBytes_3_) throws IOException
646
    {
647
        return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_);
648
    }
649
650
    public int setBytes(int p_setBytes_1_, ScatteringByteChannel p_setBytes_2_, int p_setBytes_3_) throws IOException
651
    {
652
        return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_);
653
    }
654
655
    public ByteBuf setZero(int p_setZero_1_, int p_setZero_2_)
656
    {
657
        return this.buf.setZero(p_setZero_1_, p_setZero_2_);
658
    }
659
660
    public boolean readBoolean()
661
    {
662
        return this.buf.readBoolean();
663
    }
664
665
    public byte readByte()
666
    {
667
        return this.buf.readByte();
668
    }
669
670
    public short readUnsignedByte()
671
    {
672
        return this.buf.readUnsignedByte();
673
    }
674
675
    public short readShort()
676
    {
677
        return this.buf.readShort();
678
    }
679
680
    public int readUnsignedShort()
681
    {
682
        return this.buf.readUnsignedShort();
683
    }
684
685
    public int readMedium()
686
    {
687
        return this.buf.readMedium();
688
    }
689
690
    public int readUnsignedMedium()
691
    {
692
        return this.buf.readUnsignedMedium();
693
    }
694
695
    public int readInt()
696
    {
697
        return this.buf.readInt();
698
    }
699
700
    public long readUnsignedInt()
701
    {
702
        return this.buf.readUnsignedInt();
703
    }
704
705
    public long readLong()
706
    {
707
        return this.buf.readLong();
708
    }
709
710
    public char readChar()
711
    {
712
        return this.buf.readChar();
713
    }
714
715
    public float readFloat()
716
    {
717
        return this.buf.readFloat();
718
    }
719
720
    public double readDouble()
721
    {
722
        return this.buf.readDouble();
723
    }
724
725
    public ByteBuf readBytes(int p_readBytes_1_)
726
    {
727
        return this.buf.readBytes(p_readBytes_1_);
728
    }
729
730
    public ByteBuf readSlice(int p_readSlice_1_)
731
    {
732
        return this.buf.readSlice(p_readSlice_1_);
733
    }
734
735
    public ByteBuf readBytes(ByteBuf p_readBytes_1_)
736
    {
737
        return this.buf.readBytes(p_readBytes_1_);
738
    }
739
740
    public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_)
741
    {
742
        return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_);
743
    }
744
745
    public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_)
746
    {
747
        return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_);
748
    }
749
750
    public ByteBuf readBytes(byte[] p_readBytes_1_)
751
    {
752
        return this.buf.readBytes(p_readBytes_1_);
753
    }
754
755
    public ByteBuf readBytes(byte[] p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_)
756
    {
757
        return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_);
758
    }
759
760
    public ByteBuf readBytes(ByteBuffer p_readBytes_1_)
761
    {
762
        return this.buf.readBytes(p_readBytes_1_);
763
    }
764
765
    public ByteBuf readBytes(OutputStream p_readBytes_1_, int p_readBytes_2_) throws IOException
766
    {
767
        return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_);
768
    }
769
770
    public int readBytes(GatheringByteChannel p_readBytes_1_, int p_readBytes_2_) throws IOException
771
    {
772
        return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_);
773
    }
774
775
    public ByteBuf skipBytes(int p_skipBytes_1_)
776
    {
777
        return this.buf.skipBytes(p_skipBytes_1_);
778
    }
779
780
    public ByteBuf writeBoolean(boolean p_writeBoolean_1_)
781
    {
782
        return this.buf.writeBoolean(p_writeBoolean_1_);
783
    }
784
785
    public ByteBuf writeByte(int p_writeByte_1_)
786
    {
787
        return this.buf.writeByte(p_writeByte_1_);
788
    }
789
790
    public ByteBuf writeShort(int p_writeShort_1_)
791
    {
792
        return this.buf.writeShort(p_writeShort_1_);
793
    }
794
795
    public ByteBuf writeMedium(int p_writeMedium_1_)
796
    {
797
        return this.buf.writeMedium(p_writeMedium_1_);
798
    }
799
800
    public ByteBuf writeInt(int p_writeInt_1_)
801
    {
802
        return this.buf.writeInt(p_writeInt_1_);
803
    }
804
805
    public ByteBuf writeLong(long p_writeLong_1_)
806
    {
807
        return this.buf.writeLong(p_writeLong_1_);
808
    }
809
810
    public ByteBuf writeChar(int p_writeChar_1_)
811
    {
812
        return this.buf.writeChar(p_writeChar_1_);
813
    }
814
815
    public ByteBuf writeFloat(float p_writeFloat_1_)
816
    {
817
        return this.buf.writeFloat(p_writeFloat_1_);
818
    }
819
820
    public ByteBuf writeDouble(double p_writeDouble_1_)
821
    {
822
        return this.buf.writeDouble(p_writeDouble_1_);
823
    }
824
825
    public ByteBuf writeBytes(ByteBuf p_writeBytes_1_)
826
    {
827
        return this.buf.writeBytes(p_writeBytes_1_);
828
    }
829
830
    public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_)
831
    {
832
        return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_);
833
    }
834
835
    public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_)
836
    {
837
        return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_);
838
    }
839
840
    public ByteBuf writeBytes(byte[] p_writeBytes_1_)
841
    {
842
        return this.buf.writeBytes(p_writeBytes_1_);
843
    }
844
845
    public ByteBuf writeBytes(byte[] p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_)
846
    {
847
        return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_);
848
    }
849
850
    public ByteBuf writeBytes(ByteBuffer p_writeBytes_1_)
851
    {
852
        return this.buf.writeBytes(p_writeBytes_1_);
853
    }
854
855
    public int writeBytes(InputStream p_writeBytes_1_, int p_writeBytes_2_) throws IOException
856
    {
857
        return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_);
858
    }
859
860
    public int writeBytes(ScatteringByteChannel p_writeBytes_1_, int p_writeBytes_2_) throws IOException
861
    {
862
        return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_);
863
    }
864
865
    public ByteBuf writeZero(int p_writeZero_1_)
866
    {
867
        return this.buf.writeZero(p_writeZero_1_);
868
    }
869
870
    public int indexOf(int p_indexOf_1_, int p_indexOf_2_, byte p_indexOf_3_)
871
    {
872
        return this.buf.indexOf(p_indexOf_1_, p_indexOf_2_, p_indexOf_3_);
873
    }
874
875
    public int bytesBefore(byte p_bytesBefore_1_)
876
    {
877
        return this.buf.bytesBefore(p_bytesBefore_1_);
878
    }
879
880
    public int bytesBefore(int p_bytesBefore_1_, byte p_bytesBefore_2_)
881
    {
882
        return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_);
883
    }
884
885
    public int bytesBefore(int p_bytesBefore_1_, int p_bytesBefore_2_, byte p_bytesBefore_3_)
886
    {
887
        return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_, p_bytesBefore_3_);
888
    }
889
890
    public int forEachByte(ByteBufProcessor p_forEachByte_1_)
891
    {
892
        return this.buf.forEachByte(p_forEachByte_1_);
893
    }
894
895
    public int forEachByte(int p_forEachByte_1_, int p_forEachByte_2_, ByteBufProcessor p_forEachByte_3_)
896
    {
897
        return this.buf.forEachByte(p_forEachByte_1_, p_forEachByte_2_, p_forEachByte_3_);
898
    }
899
900
    public int forEachByteDesc(ByteBufProcessor p_forEachByteDesc_1_)
901
    {
902
        return this.buf.forEachByteDesc(p_forEachByteDesc_1_);
903
    }
904
905
    public int forEachByteDesc(int p_forEachByteDesc_1_, int p_forEachByteDesc_2_, ByteBufProcessor p_forEachByteDesc_3_)
906
    {
907
        return this.buf.forEachByteDesc(p_forEachByteDesc_1_, p_forEachByteDesc_2_, p_forEachByteDesc_3_);
908
    }
909
910
    public ByteBuf copy()
911
    {
912
        return this.buf.copy();
913
    }
914
915
    public ByteBuf copy(int p_copy_1_, int p_copy_2_)
916
    {
917
        return this.buf.copy(p_copy_1_, p_copy_2_);
918
    }
919
920
    public ByteBuf slice()
921
    {
922
        return this.buf.slice();
923
    }
924
925
    public ByteBuf slice(int p_slice_1_, int p_slice_2_)
926
    {
927
        return this.buf.slice(p_slice_1_, p_slice_2_);
928
    }
929
930
    public ByteBuf duplicate()
931
    {
932
        return this.buf.duplicate();
933
    }
934
935
    public int nioBufferCount()
936
    {
937
        return this.buf.nioBufferCount();
938
    }
939
940
    public ByteBuffer nioBuffer()
941
    {
942
        return this.buf.nioBuffer();
943
    }
944
945
    public ByteBuffer nioBuffer(int p_nioBuffer_1_, int p_nioBuffer_2_)
946
    {
947
        return this.buf.nioBuffer(p_nioBuffer_1_, p_nioBuffer_2_);
948
    }
949
950
    public ByteBuffer internalNioBuffer(int p_internalNioBuffer_1_, int p_internalNioBuffer_2_)
951
    {
952
        return this.buf.internalNioBuffer(p_internalNioBuffer_1_, p_internalNioBuffer_2_);
953
    }
954
955
    public ByteBuffer[] nioBuffers()
956
    {
957
        return this.buf.nioBuffers();
958
    }
959
960
    public ByteBuffer[] nioBuffers(int p_nioBuffers_1_, int p_nioBuffers_2_)
961
    {
962
        return this.buf.nioBuffers(p_nioBuffers_1_, p_nioBuffers_2_);
963
    }
964
965
    public boolean hasArray()
966
    {
967
        return this.buf.hasArray();
968
    }
969
970
    public byte[] array()
971
    {
972
        return this.buf.array();
973
    }
974
975
    public int arrayOffset()
976
    {
977
        return this.buf.arrayOffset();
978
    }
979
980
    public boolean hasMemoryAddress()
981
    {
982
        return this.buf.hasMemoryAddress();
983
    }
984
985
    public long memoryAddress()
986
    {
987
        return this.buf.memoryAddress();
988
    }
989
990
    public String toString(Charset p_toString_1_)
991
    {
992
        return this.buf.toString(p_toString_1_);
993
    }
994
995
    public String toString(int p_toString_1_, int p_toString_2_, Charset p_toString_3_)
996
    {
997
        return this.buf.toString(p_toString_1_, p_toString_2_, p_toString_3_);
998
    }
999
1000
    public int hashCode()
1001
    {
1002
        return this.buf.hashCode();
1003
    }
1004
1005
    public boolean equals(Object p_equals_1_)
1006
    {
1007
        return this.buf.equals(p_equals_1_);
1008
    }
1009
1010
    public int compareTo(ByteBuf p_compareTo_1_)
1011
    {
1012
        return this.buf.compareTo(p_compareTo_1_);
1013
    }
1014
1015
    public String toString()
1016
    {
1017
        return this.buf.toString();
1018
    }
1019
1020
    public ByteBuf retain(int p_retain_1_)
1021
    {
1022
        return this.buf.retain(p_retain_1_);
1023
    }
1024
1025
    public ByteBuf retain()
1026
    {
1027
        return this.buf.retain();
1028
    }
1029
1030
    public int refCnt()
1031
    {
1032
        return this.buf.refCnt();
1033
    }
1034
1035
    public boolean release()
1036
    {
1037
        return this.buf.release();
1038
    }
1039
1040
    public boolean release(int p_release_1_)
1041
    {
1042
        return this.buf.release(p_release_1_);
1043
    }
1044
}
1045

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