![JAR search and dependency download from the Maven repository](/logo.png)
cn.nukkit.network.protocol.ResourcePacksInfoPacket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.network.protocol;
import cn.nukkit.resourcepacks.ResourcePack;
import lombok.ToString;
@ToString
public class ResourcePacksInfoPacket extends DataPacket {
public static final byte NETWORK_ID = ProtocolInfo.RESOURCE_PACKS_INFO_PACKET;
public boolean mustAccept;
public boolean scripting;
public ResourcePack[] behaviourPackEntries = ResourcePack.EMPTY_ARRAY;
public ResourcePack[] resourcePackEntries = ResourcePack.EMPTY_ARRAY;
@Override
public void decode() {
}
@Override
public void encode() {
this.reset();
this.putBoolean(this.mustAccept);
this.putBoolean(this.scripting);
encodePacks(this.behaviourPackEntries);
encodePacks(this.resourcePackEntries);
}
private void encodePacks(ResourcePack[] packs) {
this.putLShort(packs.length);
for (ResourcePack entry : packs) {
this.putString(entry.getPackId().toString());
this.putString(entry.getPackVersion());
this.putLLong(entry.getPackSize());
this.putString(""); // encryption key
this.putString(""); // sub-pack name
this.putString(""); // content identity
this.putBoolean(false); // scripting
this.putBoolean(false); // raytracing capable
}
}
@Override
public byte pid() {
return NETWORK_ID;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy