Giter Club home page Giter Club logo

lunarbus's Introduction

LunarBus

A fast, lightweight, and dependency-free event bus system for Minecraft Coder Pack (MCP) clients.

Forked from HomoBus & RadBus

Features

  • Fast: Minimal overhead for maximum speed.
  • Dependency-free: No external libraries required.
  • Simple: Easy to use and integrate.
  • Lightweight: Minimal impact on your project.
  • Priorities: Control the order of event listeners.
  • Cancellation: Easily cancel events.
  • Documentation: Built-in support for event documentation.
  • State Control: Manage events based on different states (pre, on, post).

Installation

Gradle

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation group ='com.github.Izikie', name = 'LunarBus', version = 'Tag'
}

Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
	    <groupId>com.github.Izikie</groupId>
	    <artifactId>LunarBus</artifactId>
	    <version>Tag</version>
	</dependency>
</dependencies>

or the prebuilt artifacts on the releases page.

How to use

public class Client {
    public static final Client INSTANCE = new Client();
    private final EventBusImpl bus = EventBus.newInstance()

    private final NameTagMod nameTag = new NameTagMod()

    public void init() {
        bus.subscribe(nameTag)
    }

    public void unInit() {
        bus.unsubscribe(nameTag)
    }

    public EventBusImpl getBus() {
        return bus;
    }
}

Event Classes (Event, EventCancellable, EventState. EventStateCancellable)

public class Render2D {
    private final width, height

    public Render2D(int width, int height) {
        this.width = width;
        this.height = height;
    }

    public void getWidth() {
        return width;
    }

    public void getHeight() {
        return height;
    }
}
public class NameTagMod {

    @Listen
    public final Listener<Render2D> render2DListener = event -> {
        // Code
    }
}

Benchmarks

Soon™

lunarbus's People

Contributors

izikie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.