/
Belyash5
/
Flu
Обзор
Документация
Войти
/
Belyash5
/
Flu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/hbm/packet/threading/ThreadedPacket.java
31 строка
754 B
BallOfEnergy
just in case I disappear, here's particle threading and crate backpacks, along with spider crates, though opening a spider crate in the inventory will not spawn spiders yet.
13 янв 2025, 04:21
13 янв 2025, 04:21
9fa148c
Код
Авторство
О чём код?
package com.hbm.packet.threading; import cpw.mods.fml.common.network.simpleimpl.IMessage; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; /** * This is the base class for any packets passing through the PacketThreading system. */ public abstract class ThreadedPacket implements IMessage { ByteBuf compiledBuffer; public void compile() { if(compiledBuffer != null) compiledBuffer.release(); compiledBuffer = Unpooled.buffer(); this.toBytes(compiledBuffer); // Create buffer and read data to it. } /** * Returns the compiled buffer. */ public ByteBuf getCompiledBuffer() { if(compiledBuffer == null || compiledBuffer.readableBytes() <= 0 /* No data written */) this.compile(); return compiledBuffer; } }