Skip to content

CraftsBlock/CraftsNet-StreamEncoders

Repository files navigation

CraftsNet-StreamEncoders

Additional stream encoders for CraftsNet

Latest Release on Maven GitHub code size in bytes GitHub GitHub all releases GitHub issues

Note

This addon requires at least CraftsNet version 3.3.3-SNAPSHOT.


This addon was created to supply more advanced stream encoders to the CraftsNet framework. The following stream encoders are currently supported:

  • ZStandard
  • Brotli

Installation

Addon File

Download the latest release and put the jar file in your addon folder of your CraftsNet Application.

Maven

<repositories>
  ...
  <repository>
    <id>craftsblock-releases</id>
    <name>CraftsBlock Repositories</name>
    <url>https://repo.craftsblock.de/releases</url>
  </repository>
</repositories>
<dependencies>
  ...
  <dependency>
    <groupId>de.craftsblock.craftsnet.modules</groupId>
    <artifactId>streamencoders</artifactId>
    <version>VERSION</version>
  </dependency>
</dependencies>

Gradle

repositories {
  ...
  maven { url "https://repo.craftsblock.de/releases" }
  mavenCentral()
}
dependencies {
  ...
  implementation "de.craftsblock.craftsnet.modules:streamencoders:VERSION"
}

Loading

Note

Only required if you are using the install method Maven or Gradle. You are also required to export your jar as a thin / fat jar!

Using the AddonContainingBuilder

package de.craftsblock.myaddon;

import de.craftsblock.cnet.modules.encoders.StreamEncoders;
import de.craftsblock.craftsnet.CraftsNet;
import de.craftsblock.craftsnet.addon.Addon;
import de.craftsblock.craftsnet.addon.meta.annotations.Depends;
import de.craftsblock.craftsnet.addon.meta.annotations.Meta;

import java.io.IOException;

@Meta(name = "MyAddon")
@Depends(StreamEncoders.class) // Depend the stream encoders addon
public class MyAddon extends Addon {

    public static void main(String[] args) throws IOException {
        CraftsNet.create(MyAddon.class).withArgs(args).build(); // Starting CraftsNet + loading your addon
    }

}

Open Source Licenses

We are using some third party open source libraries. Below you find a list of all third party open source libraries used:

Name Description Licecnse
CraftsNet Easy creation of HTTP routes and WebSocket endpoints in Java. Apache License 2.0
CraftsCore https://repo.craftsblock.de/#/releases/de/craftsblock/craftscore/CraftsCore Apache License 2.0
JVM-Brotli Lightweight, cross-platform Java library for the Brotli compression format Apache License 2.0
zstd-jni JNI binding for Zstd BSD 2-Clause "Simplified" License