Mod
inject
No reviews yet
A library for making injecting into Netty easier!
Provides a framework or library for other mods to use.
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Paper is a fork of Spigot that adds its own plugin API on top of the Bukkit API. All Spigot plugins are compatible with paper, not all paper plugins are compatible with Spigot.
Spigot is a popular software for running dedicated servers that can load Plugins created with the Bukkit API.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
inject
Inject is a simple server-side library to allow developers to inject into Netty easier.
Example
This uses the HttpInjector class to respond to HTTP requests to the Minecraft
server.
class MyEpicHttpInjector extends HttpInjector {
@Override
public HttpByteBuf intercept(ChannelHandlerContext ctx, HttpRequest request) {
HttpByteBuf buf = HttpByteBuf.httpBuf(ctx);
buf.writeStatusLine("1.1", 200, "OK");
buf.writeText("Hello, from Minecraft!");
return buf;
}
}
Registration
For Fabric, use the InjectFabric class:
public class MyMod implements ModInitializer {
@Override
public void onInitialize() {
InjectFabric.INSTANCE.registerInjector(new MyEpicHttpInjector());
}
}
For Spigot, Paper and derivatives, use the InjectSpigot class:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
InjectSpigot.INSTANCE.registerInjector(new MyEpicHttpInjector());
}
}
This will register an HTTP injector which will respond with Hello, from Minecraft!
to any HTTP request to the Minecraft port.
$ curl http://localhost:25565
Hello, from Minecraft!
Supported web servers
- Spring Boot:
springmodule - Javalin:
javalinmodule - Ktor:
ktormodule - Jetty:
jettymodule - manual request handling:
httpmodule
Examples can be found in the examples module.
Usage
Add the andante repo to gradle:
repositories {
maven("https://maven.mcbrawls.net/releases/")
}
Add the dependency:
dependencies {
implementation("net.mcbrawls.inject:api:VERSION")
// For HTTP-related things:
implementation("net.mcbrawls.inject:http:VERSION")
// Fabric:
include(modImplementation("net.mcbrawls.inject:fabric:VERSION")!!)
// Spigot/Paper:
implementation("net.mcbrawls.inject:spigot:VERSION")
// You can find the other modules for Spring, Ktor, etc. on the Github repo.
}
Replace VERSION with the latest version from the releases tab.
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers