Code Monkey home page Code Monkey logo

preprocessor's Introduction

ReplayMod

A Minecraft mod to record game sessions and replay them afterwards from any perspective.

Building

Make sure your sub-projects are up-to-date: git submodule update --init --recursive

For compiling 1.7.10, you must run ./gradlew :jGui:1.7.10:setupDecompWorkspace :1.7.10:setupDecompWorkspace once after the initial clone. This may take quite some time.

No IDE

You can build the mod by running ./gradlew build (or just ./gradlew bundleJar). You can then find the final jar files in versions/$MCVERSION/build/libs/. You can also build single versions by running ./gradlew :1.8:build (or just ./gradlew :1.8:bundleJar) (builds the MC 1.8 version).

IntelliJ

Ensure you have at least IDEA 2020.1. Build the mod via Gradle as explained above at least once (./gradlew compileJava should be sufficient). This will ensure that the sources for all MC versions are generated. Then import the Gradle project from within IDEA: File -> Open -> build.gradle -> Open as Project Finally configure IDEA to build everything by itself instead of delegating it to Gradle (cause that is slow): File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Build and run using: IntelliJ IDEA

Eclipse

Development

Branches

Loosely based on this branching model with stable instead of master.

TL;DR: Main development happens on the develop branch, snapshots are built from this branch. The stable branch contains the most recent release.

The master branch is solely to be used for the version.json file that contains a list of all versions used by the clients to check for updates of this mod.

The Preprocessor

To support multiple Minecraft versions with the ReplayMod, a JCP-inspired preprocessor is used. It has by now acquired a lot more sophisticated features to make it as noninvasive as possible. Please read the preprocessor's README to understand how it works.

Versioning

The ReplayMod uses the versioning scheme outlined here with three changes:

  • No MAJORAPI, the ReplayMod does not provide any external API
  • "Updating to a new Minecraft version" should not increment MAJORMOD, we maintain one version of the ReplayMod for each version of Minecraft and all these versions share the same feature set (and most bugs). We therefore try to keep the version name the same for all of them (with the exception of MCVERSION of course). This also means that the "Multiple Minecraft Version" section does not apply.
  • For pre-releases the shorter -bX is used instead of -betaX

When a new version is (pre-)release, a new commit modifying the version.txt file should be added and the versions.json file in the master branch should be updated. To simplify this process the gradle task doRelease can be used: ./gradlew -PreleaseVersion=2.0.0-rc1 doRelease. It will create the commit and update the version.json accordingly.

Care should be taken that the updated version.json is not pushed before a jar file is available on the download page (or Jenkins) as it will inform the users of the update.

Bugs

GitHub should generally be used to report bugs.

In the past, bugs were tracked via Bugzilla, so bug numbers in commits prior to 2020 such as (fixes #42) generally referred to Bugzilla unless noted otherwise.

License

The ReplayMod is provided under the terms of the GNU General Public License Version 3 or (at your option) any later version. See LICENSE.md for the full license text.

preprocessor's People

Contributors

hendrix-shen avatar jasonhk avatar johni0702 avatar mattco98 avatar paulzhng avatar wyvest 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

Watchers

 avatar  avatar  avatar  avatar

preprocessor's Issues

Combine with Architectury

Is it possible to use this preprocesor in conjunction with an Architectury multiplatform project setup? I haven't been able to get it working yet, and would like to know if it's even possible. I love the benefits of a multi-version project using this preprocessor and don't really want to give them up just because I'm starting to go multi-platform.

[Bug?] This may be my doing... But I came across an issue with preprocessor.

here is the stacktrace. I don't really understand it at all xD.

    ///*


    //#if MC < 11700

    @ModifyExpressionValue(
            method = "checkEntityChunkPos",
            at = @At(
                    value = "INVOKE",
                    target = "net/minecraft/entity/Entity.teleportRequested()Z"
            )
    )
    private boolean carbon$updateTeleportRequested(boolean original, @Local(argsOnly = true) Entity entity) {
        return original || (CarbonSettings.forceLoadEnderPearls && (entity instanceof EnderPearlEntity));
    }




    //#endif

   //*/

the code that breaks ONLY if the // is before the block comments. The preprocessed code outputs correctly in newer versions.

I suspect it has to do with remapping classes or something.

Sorry if this is my fault.... I know this is more of a support thing as I don't know the issue.

Thanks!

Tab indentation support

When processing sources, it doesn't recognize tab character as valid indentation, only space characters will be recognized as indentation (See PreprocessTask)

Maybe adding an optional parameter to switch between space and tab indentation will be a workaround for this

Support _ in numbers

This would allow conditions instead of MC <= 1_19_02, which is much easier to read and harder to mess up than MC <= 11902.

Task not found

.\gradlew.bat :1.9.4:setCoreVersion
Results in a Project 1.9.4 not found exception

.\gradlew.bat :versions:1.9.4:setCoreVersion
Results in a Task not found exception

It's probably me doing something wrong, but just in case..

Be more strict about `//#else`

In particular, the following should not pass:

                    //#if MC>=12000
                    //$$ print(used1)
                    //#else#if MC>=11600
                    //$$ print(used2)
                    //#else
                    //$$ print(used3)
                    //#endif

Because

  1. That's supposed to be an elseif but it was typo'd (current processor reads it as an else without complaints)
  2. That's two else which probably shouldn't be legal

RetroFuturaGradle support

Hey there, I'm currently trying to get the source code from 1.20.4-1.16.5 using Archloom down to 1.12/1.8(/1.7?) using RetroFuturaGradle.
Currently, I'm stuck at this step, as preprocessor doesn't seem able to find the mappings used by RetroFuturaGradle

IllegalStateException: Failed to find mappings from project ':1.16.5-forge' to project ':1.12.2-forge'.

Maybe it's possible to get it working by just creating fake createMcpToSrg etc tasks that return the files required by preprocessor, not sure.

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.