Giter Club home page Giter Club logo

chattriggers's Introduction

forthebadge
ChatTriggers is always in development. Although we try to follow standard version conventions and deprecate old methods before removing them, there may be times where we need to restructure something to the point where deprecation is impossible. Modules can and will break at any time.

About

ChatTriggers is a framework for Minecraft that allows for live scripting and client modification using JavaScript. We provide libraries, wrappers, objects and more to make your life as a modder as easy as possible. Even without the proper wrapper, you can still use exposed Minecraft methods and variables but you will need knowledge of FML mappings. The entire ChatTriggers engine is built on Rhino using Java 8 so you have access to any Rhino methods and functions. Rhino supports some ES6 features, as can be seen here.

The basic premise of ChatTriggers is that everything is based around Triggers. From a modding standpoint, Triggers can be thought of as event listeners. These can range from a chat Trigger that runs on a specific chat event matching criteria to a render overlay Trigger that runs when the crosshair is being rendered. We are constantly adding more Triggers and Trigger types as the mod evolves for more integration with Minecraft.

register("chat", function(name, message, event) {
  cancel(event);
  ChatLib.chat(name + ": " + message);
}).setCriteria("<${name}> ${message}");

register("renderCrosshair", function(event) {
  cancel(event);
  Renderer.drawRect(
    0x50ffffff,
    Renderer.screen.getWidth() / 2 - 1,
    Renderer.screen.getHeight() / 2 - 1,
    2, 2
  );
});

You can learn the basics of scripting with ChatTriggers from the Slate tutorial and once you get the basics, check out the JavaDocs for a more in depth look at all of the available methods.

Releases

The ChatTriggers website will always be kept up to date with the latest release. As of beta version 0.6.4, we have started to move the release changelog along with a .jar download (mirror of the website) to the GitHub releases page.

Feature changes

Any major features are moved to separate branches before being merged into master. This will avoid the issue of waiting after a release to fix bugs when we want to be working on new features. Any contributors will have to abide by the same standard. New features get their own branch and bug fixes require a pull request on the master branch.

Issues

Any issue can be opened using the normal GitHub issue page. Issues can be anything from bug reports to feature requests. For us to consider an issue to be valid, it needs a simple but effective title that conveys the problem in a few words and a well thought out and well written description.

Bug Report

  • Should be reproducible
  • Needs a step by step guide on how to reproduce
  • Any evidence of the bug occurring (e.g. images or video) is welcome

Feature Request

  • Needs a general description of the feature requests
  • Specifics on what is being requested (e.g. what class you want it in or what it should do) is highly recommended

Duplicate issues will be merged to avoid too much clutter. If an issue is moved to "next" we will usually comment on it to explain how we expect to implement or fix that issue.

Special Thanks To

jProfiler The Java Profiler jProfiler

chattriggers's People

Contributors

appable0 avatar camnwalter avatar dalwynwastaken avatar debuggingss avatar djtheredstoner avatar falsehonesty avatar glasss13 avatar ixnoahlive avatar kerbybit avatar kevinpriv avatar marvinschs avatar mattco98 avatar mistercheezecake avatar musicalcookie avatar qkleinfelter avatar realfork avatar soopyboo32 avatar srockw avatar strainger avatar thepoptartcrpr avatar valscsgo avatar walshydev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chattriggers's Issues

Add ability to do 3D rendering

Goals

  • Allow users to draw polygons in the 3D space
  • Allow for coloring and opacity of the drawing
  • Add utilities for drawing common shapes, like rectangles

/ct dump is really wrong

It needs a complete rewrite that doesn't use reflection
It could also use built in ChatLib methods instead of building it from scratch

Add a Block wrapper

Similar to the Item wrapper but to replace the return in the looking at wrapper

Add user tracking

Automatically track number of users by storing their hashed UUID in the web site's database

Fix trigger priorities

Trigger priorities are borked, but I think they are just reversed. Highest should be triggered first.

Source of the issue regarding /ct simulate and it's ability to trigger Triggers

When doing /ct simulate [msg], it is unlikely to actually trigger any of the user's trigger because of the way it creates the ClientChatReceivedEvent. I know the exact reason, but cannot figure out a solution.

The issue lies in this line; specifically in regards to the ChatComponentText instantiation:

ClientChatReceivedEvent event = new ClientChatReceivedEvent((byte) 0, new ChatComponentText(toSend.toString()));

toSend.toString() is completely accurate. However, when logging event.message.getFormattedText(), there is suddenly a §r at the end. That extra text is the reason for the issue - it prevents some trigger criteria from matching the command arguments.

It would be an easy fix if it was this way for every ClientChatReceivedEvent, however the part I can't figure out is that incoming chat events do not have this extra formatting at the end. They must somehow be created differently, and I can't quite find out how. All I found was the forge code that results in the §r:

/**
 * Gets the text of this component, with formatting codes added for rendering.
 */
public final String getFormattedText() {
    StringBuilder stringbuilder = new StringBuilder();

    for (IChatComponent ichatcomponent : this) {
        stringbuilder.append(ichatcomponent.getChatStyle().getFormattingCode());
        stringbuilder.append(ichatcomponent.getUnformattedTextForChat());
        stringbuilder.append((Object)EnumChatFormatting.RESET);
    }

    return stringbuilder.toString();
}

Basically,

  • Calling event.message.getFormattedText() on an incoming ClientChatReceivedEvent from forge produces <the text>
  • Calling event.message.getFormattedText() on a ClientChatReceivedEvent that was created manually produces <the text> §r

Module name is exact same as name in metadata breaks things

If you have the name in the module metadata the exact same as whatever it's uploaded as, it breaks ctjs. If Minecraft is already open it just freezes during module reload. If you're launching Minecraft it crashes with the following error

The game crashed whilst initializing game
Error: java.lang.NumberFormatException: multiple points

Render minecraft buttons

Ability to render in minecraft buttons. Even if you can't customize the size of them it would be cool to have regular buttons. Also add the arrow button that's in the resource pack menu if possible

Add more render triggers

Goals

Add more options to trigger on and cancel different render events. This would allow for custom player list, crosshair, hunger bar, and other things.

Completed

  • PlayerList
  • Crosshair
  • Debug
  • BossHealth
  • Health
  • Hunger
  • MountHealth
  • Experience
  • Hotbar
  • Air
  • Scoreboard

Add an Item wrapper

Goal

Add a new Item wrapper for use as the return in the inventory wrapper. This will allow for more seamless integration with item icons, unlocalized names, registry names and more without over populating the inventory wrapper.

Change how loading works

Currently, loading is done by taking all files in the top level of a folder inside of the "modules" folder, and making them one string. This string is then passed into the global nashorn script engine, along with all of the other modules. This means that if two modules have the same global variable or function name, there will be errors.

Goals

  • Ability to declare top level variables with the same name in different modules.
  • Keep the ability to make libraries or APIs by having global functions or variables.
  • Add more robust support for Sentry when loading scripts/modules for better error reporting.
  • Add support for nested folders to load for more organization.
  • Support for disabling modules through module metadata file

Refactor minecraft/libs directory

Currently, there is a split between the minecraft/libs and the minecraft/wrappers directory. For example, there is a WorldLib and a World wrapper, which just splits methods between two different objects for no reason.

I would like to move WorldLib into the World wrapper, along with all of the other libs that make sense to be in that directory, like ChatLib and FileLib (Should be renamed to something like Chat and FileSystem). Then, other things like MathLib should be moved out to a top level package, like /libs and possibly renamed.

Documentation for Wrappers & Libs

The Minecraft directory contains most of the user facing code, but still lacks a lot of documentation. Most of these are simple getters and setters so you should be able to look at them and find out what they do, and thus can be easily documented.

Inventory rework

Currently, the inventory object is linked directly to the player and only the player. We want to be able to abstract that object to let it be useful in something like a chest inventory.

Goals

  • abstract the Inventory object
  • add a Player getter to get inventory
  • add some sort of chest gui getter to get inventory

setCommandUsage doubles the command

registerCommand.setCommandUsage re- registers the command. removing setCommandUsage is probably the best solution. the usage is not used by anything in forge that I can tell

Rewrite the config stuff

The config as it stands right now uses the forge gui factory and gui config stuff which makes it a pain to port between versions. It would be much more ideal to have a custom gui and move the gui to a json.

Goals

  • change config loading and saving to a json based system
  • create a custom gui for changing the config settings
  • implement the custom config gui into the current modules gui somehow

Issue with image download resizing

If you use RenderLib.downloadImage() and specify false for whether or not it should resize the image for you, it still downsizes it to 256x256

Add FileLib.create() and FileLib.delete()

Would be useful for dynamic file saving/resetting and stuff, but make sure FileLib.delete() is limited to inside the ChatTriggers folder to avoid people from making troll modules that delete System32 or stuff like that.

chat criteria is undefined by default

TriggerRegister.registerChat("methodName") should have chat criteria automatically defined as a blank string
It breaks loading if no chat criteria is provided

Improve XHR

Add function to get response headers from XMLHttpRequest (ct.js/src/main/java/com/chattriggers/ctjs/objects/XMLHttpRequest.java).

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.