GithubHelp home page GithubHelp logo

lilgallon / bettercolorsengine Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 1.04 MB

The engine used by the mod Bettercolors. Works with any modding API and every Minecraft version

License: Apache License 2.0

Java 100.00%

bettercolorsengine's Introduction

Release Build Status Maven Open issues

A hacking engine that does the annoying part for you. Designed to work with independently of forge and fabric. This engine is the one used by the mod Bettercolors.

Support

The engine takes into account the MC input design change of 1.13 and above (glfw vs vk), and works with all versions of MC (at least from 1.8.9 to 1.16.2). And should work with future versions of Minecraft.

Why?

With that engine, the only thing that you need to do is to implement your modules (aimbot, autoclick, whatever). Then, the rest is handled by the engine (window, parameters, file saving, version checking, and so on).

Here is what the automatically generated window looks like:

features

How to install it

1. Using maven central (recommended)

Maven:

<dependency>
  <groupId>dev.nero</groupId>
  <artifactId>bettercolors-engine</artifactId>
  <version>1.1.1</version>
</dependency>

Gradle:

implementation 'dev.nero:bettercolors-engine:1.1.1'

If you are building a minecraft mod, then add those lines to your build.gradle:

configurations {
    // ... your stuff if you have something already

    // It defines a new configurration called inJar that we will use later on
    // compile is needed so that the library is recognized by the IDE
    inJar
    compile.extendsFrom inJar
}

dependencies {
    // ... your stuff if you have something already

    // The library with the inJar configuration that we created previously
    inJar "dev.nero:bettercolors-engine:1.1.1"
}

jar {
    // ... your stuff if you have something already

    // It will extract all the libraries needed for the inJar configuration to be working in the root of the .jar
    // Basically, it will extract the bettercolorsengine jar file to your mod.jar
    from {
        configurations.inJar.collect {
            it.isDirectory() ? it : zipTree(it)
        }
    }
}

2. Using the raw source code

  • Download the files (release page) and move them in your project
  • Don't forget to get the resources (images and fonts)

Documentation

Will come later on... You can see the examples below for the moment.

  • Here is an example on how you could use the engine:
void yourInitFunction() {
    engine = new BettercolorsEngine();
    engine.init(modules...);
}

void yourEvent() {
    engine.event(eventCode, eventInformation);
}

void onKeyPress(k) {
    engine.keyEvent(k.code, k.pressed);
}
  • Add these lines to the build.gradle file:
configurations {
    // ... your stuff if you have something already

    // It defines a new configurration called inJar that we will use later on
    // compile is needed so that the library is recognized by the IDE
	inJar
	compile.extendsFrom inJar
}

dependencies {
    // ... your stuff if you have something already

    // The library with the inJar configuration that we created previously
    inJar "dev.nero:bettercolors-engine:1.1.1"
}

jar {
    // ... your stuff if you have something already

    // It will extract all the libraries needed for inJar to be working in the root of the .jar
    from {
        configurations.inJar.collect {
            it.isDirectory() ? it : zipTree(it)
        }
    }
}

Real examples (all of them use all the engine's features):

Credits & Acknowledgements

bettercolorsengine's People

Contributors

lilgallon avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

bettercolorsengine's Issues

Call to the key mapping lambda function even if the argument is invalid

We don't want to call the key mapping lambda function when there's no toggle key set!

if (module.getToggleKey() != -1) { // Check for the key to be valid first!
    keybindButton.setText(
            module.getName() + " toggle key: " + module.getToggleKey() + "(" + this.keyNameFunc.getKeyName(module.getToggleKey()) + ")"
    );
}  else {
    keybindButton.setText(module.getName() + " toggle key: none");
}

related to #10

java.lang.ThreadGroup:uncaughtException when calling Window#synchronizeComponents() in the wrong thread

Exception in thread "AWT-EventQueue-0" [21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.IllegalStateException: Rendersystem called from wrong thread
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at com.mojang.blaze3d.systems.RenderSystem.assertThread(RenderSystem.java:76)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at net.minecraft.client.MainWindow.logGlError(MainWindow.java:218)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.lwjgl.glfw.GLFWErrorCallbackI.callback(GLFWErrorCallbackI.java:36)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.lwjgl.system.JNI.invokeI(Native Method)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at org.lwjgl.glfw.GLFW.glfwGetKeyScancode(GLFW.java:3371)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at dev.nero.bettercolors.Bettercolors.lambda$new$0(Bettercolors.java:85)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at dev.nero.bettercolors.engine.view.Window.synchronizeComponents(Window.java:1213)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at dev.nero.bettercolors.engine.BettercolorsEngine.toggleModule(BettercolorsEngine.java:516)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at dev.nero.bettercolors.core.modules.Panic.onToggle(Panic.java:42)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at dev.nero.bettercolors.engine.module.Module.toggle(Module.java:89)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at dev.nero.bettercolors.engine.view.Window.lambda$setupModulesActivationStatus$5(Window.java:435)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:308)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.Component.processMouseEvent(Component.java:6533)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.Component.processEvent(Component.java:6298)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.Container.processEvent(Container.java:2236)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.Component.dispatchEventImpl(Component.java:4889)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.Container.dispatchEventImpl(Container.java:2294)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.Component.dispatchEvent(Component.java:4711)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.Container.dispatchEventImpl(Container.java:2280)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.Window.dispatchEventImpl(Window.java:2746)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.Component.dispatchEvent(Component.java:4711)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventQueue.access$500(EventQueue.java:97)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventQueue$3.run(EventQueue.java:709)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventQueue$3.run(EventQueue.java:703)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.security.AccessController.doPrivileged(Native Method)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventQueue$4.run(EventQueue.java:731)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventQueue$4.run(EventQueue.java:729)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.security.AccessController.doPrivileged(Native Method)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
[21:24:50] [AWT-EventQueue-0/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

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.