Go to file
2024-01-03 12:22:14 -05:00
.idea Implemented Custom Screens 2024-01-03 12:13:38 -05:00
Bridge Implemented Custom Screens 2024-01-03 12:13:38 -05:00
Client Implemented Custom Screens 2024-01-03 12:13:38 -05:00
gradle/wrapper Basic bridge system, has some documentation. 2023-12-31 01:13:55 -05:00
libs (feat) start on very basic bridge 2024-01-02 15:53:55 -05:00
v1_8_9 Implemented Custom Screens 2024-01-03 12:22:14 -05:00
.gitignore Basic bridge system, has some documentation. 2023-12-31 01:13:55 -05:00
build.gradle Implemented Custom Screens 2024-01-03 12:13:38 -05:00
gradle.properties Basic bridge system, has some documentation. 2023-12-31 01:13:55 -05:00
gradlew Basic bridge system, has some documentation. 2023-12-31 01:13:55 -05:00
gradlew.bat Basic bridge system, has some documentation. 2023-12-31 01:13:55 -05:00
README.md Fix an oopsie. Our implementation is not the same as Lunar's. 2023-12-31 17:09:06 -05:00
settings.gradle (feat) start on very basic bridge 2024-01-02 15:53:55 -05:00

Bridge Base

An easy-to-use base with base bridging already set up.

License: CC BY 4.0

Before starting off, I highly suggest you read:

This article by Me and
This article by Decencies.

The Bridge

The Bridge is an inheritance based system which uses Interfaces to allow the client to work on multiple versions with minimal modification. (Decencies 1)

This is how most clients multi version. Our implementation is very similar to Lunar and other popular clients'

In our implementation, all the client code is stored in the Client module, which has no access to the Minecraft API. You have to create your own bridges and use them. In the target versions, you'd implement those bridges to access the Minecraft API.

Table of Contents

Introduction

Bridge Base is a framework designed to simplify the process of creating bridges for client developers. By providing an easy-to-use base with pre-configured bridging, developers can focus on the core functionality of their projects without dealing with the intricacies of bridging implementation.

How to Create a Bridge

Creating a bridge with Bridge Base involves a few straightforward steps. Follow this guide to seamlessly integrate your bridge into the framework.

1. Add Your Bridge

Begin by adding your bridge to the bridge module.

package your.package.bridge;

public interface ExampleBridge {
    // Here is where you would add your bridges
}

2. Define Bridge Methods

IMPORTANT: Make sure to start your methods with bridge$ or sometimes they can clash with the existing methods in your target class.

Inside your ExampleBridge interface, define the methods that you need. For example:

package your.package.bridge;

public interface ExampleBridge {
    public void bridge$test();
}

3. Implement the Bridge

To integrate your bridge, implement it either as a mixin or as an implementation in your target versions. Here's a basic example:

package your.package.plugin;

import bridge.your.package.bridge.ExampleBridge;

@Mixin(Example.class)
public abstract class MixinExample implements ExampleBridge {
    public abstract void test();
    
    @Override
    public void bridge$test() {
        test(); // This is the implementation
    }
}

By following these steps, you seamlessly integrate your needed bridge into Bridge Base, allowing client developers to leverage its functionality effortlessly.

Feel free to explore the repository for additional details and updates.

🔥 Happy bridging, and star if you have found this useful!

Contributing

Fork, and open a PR. If it's good, I'll merge it. Make sure to give your PRs proper descriptions

License

Bridge Base by Refactoring is licensed under Attribution 4.0 International

In short, you're allowed to:

  • Modify this code
  • Use it for commercial purposes

but you have to:

  • Provide proper attribution to me.