Giter Club home page Giter Club logo

groovyduvet's Introduction

GroovyDuvet

Version VersionCore

GroovyDuvet is a Quilt language adapter for mods written in Groovy. It allows the use of scripts, classes, fields, or methods as entrypoints, provides mappings at runtime for dynamically compiled code, and provides wrappers and DSLs around Minecraft and QSL code for ease of development.

Using

To use, add the following to your build.gradle:

repositories {
    mavenCentral()
}

configurations {
	localImplementation
	runtimeClasspath.extendsFrom localImplementation
	compileOnly.extendsFrom localImplementation
}

dependencies {
    modImplementation 'org.groovymc.groovyduvet:groovyduvet:<version>'
    localImplementation 'org.groovymc.groovyduvet:groovyduvet-core:<groovymc-core-version>'
}

The localImplementation configuration and dependency on groovyduvet-core is necessary so that the groovy runtime will be loaded on the same classloader at runtime in the development environment as it will be at runtime in production; the configuration, as set up above, ensures that the dependency will be marked properly within the generated module and pom files during publishing.

Then, use the groovyduvet language adapter for your groovy entrypoints. Entrypoints can target classes, static fields, or static methods that extend the entrypoint type just like usual; GroovyDuvet can also target local variables inside of scripts. The script will be run, and the variable will be extracted; for this to work, the local variable must have the @Field annotation. If the entrypoint class has exactly one abstract method, GroovyDuvet can also target closures, through any of the previous methods, or entire scripts, where the method arguments are fed into the script as local variables going arg0, arg1, etc.

For a template mod using GroovyDuvet, see: quilt-template-mod-groovy. For an example of using GroovyDuvet in a multiloader project, see: Multiloader-Groovy-Template

Included Groovy Modules

  • stdlib
  • contracts
  • datetime
  • nio
  • macro
  • macro-library
  • templates
  • typecheckers
  • dateutil
  • ginq
  • toml
  • json
  • xml

Support

If you are having issues using GroovyDuvet or wish to discuss contributions to the project, you may either open an issue or PR on this repo or go to the groovy-mc channel here: https://discord.gg/Em7b3dv4Nk

groovyduvet's People

Contributors

lukebemish avatar dependabot[bot] avatar matyrobbrt avatar

Stargazers

Ari avatar Dakedres avatar ふらまりん avatar KhanhTypo avatar

Watchers

 avatar

Forkers

lukebemish

groovyduvet's Issues

Version Dependency

I'd like to use this on 1.18.2, but it seems like it's dependent on 1.19.3 for some reason. Why is that?
A language adapter doesn't really need to depend on any version-specific functions does it?

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.