This library has no specific purpose, it's just a collection of utilities that I've made for my own projects.
I've decided to make it public so that others can use it as well.
If you have any suggestions or want to contribute, feel free to do so!
Build Refraction and get the jar file from the target folder. Add it to your project lib folder (make one if you haven't). Then add the jar file as a flatdir dependency in your build.gradle file.
repositiories {
flatDir {
dirs 'lib'
}
}
dependencies {
include "blank:refraction-MOD_LOADER-MINECRAFT_VERSION:REFRACTION_VERSION"
}To set up some Refraction features, you need to register the mod to it.
Adding this to your main class constructor will register it.
#constructor(...) {
RModRegistrar.registerSelf(MOD_ID);
// everything else
}- ReConfig—Config system with auto syncing support
- Atda—Persistent data storage system
- Syncables—Server → Client class syncing capability
- Channels—Custom data channels between server and client w/ headers
- NamedAPI—Extension of Channels for named API channel schemes
- Runnabler—Handler for delayed and ticking runnables on client / server
- RefractionEvents—Event system with multiloader support
- VoxelUtils—Voxel generation utilities
- Particler—Particle wrapper with render and tick manipulation
- RAABB—Allows for non-axis aligned boxes with collision
- Cutscenes—Customizable cutscenes through code (future command support)
- Custom debuggers—Similar to Minecraft's system of debugging, Refraction has custom debug support
- Interactions—NPC Interaction handler
- Quests—Quest handler system, doesn't offer quest stacking by default (future change)
- Server Screens—Full server side control of screens without extra packets including closing, opening and sharing data
between client ↔ server
- Registrable tracking sounds—Ticking sounds that can be registered on the client and called from the server
- Flood Filler—Highly customizable flood filler
- Camera shake—Provides a camera shake interface
- SyncConfig—Automatic syncing for player joins
- Vec3Helper—A lot of vec3 util
And a lot more, just take a look for yourself, mainly in @helper and @feature dirs :D
- Use camelCase for variables and methods.
- Use PascalCase for class names.
- Use K&R brace style and use tabs.
- No more than 2 levels of nesting if possible. (use early returns)
- Add comments for public methods and classes. (also for non-clear private methods)
- Use meaningful names for variables, methods, and classes.
- Avoid hardcoding values, unless necessary.
- Keep overhead low, avoid unnecessary object creation.
- Validate client and server side code.
- Use client proxy methods in common code.
- Keep methods short and focused on a single task. (no monolithic methods)
- IF a tool is not meant for internal use, make sure extension points are available and easy to configure.
- Write example usages for complex features.
Thank you! --Zeus