FastAsyncWorldEdit (FAWE) Documentation

repository·main·Indexed 21 days ago

https://github.com/intellectualsites/fastasyncworldedit

A high-performance fork of WorldEdit for Minecraft servers providing asynchronous world editing, advanced masking, and robust rollback capabilities. Includes documentation on installation, the Developer API, CraftScripts for JavaScript-based editing, and the WorldEdit CLI. Covers build instructions using Gradle and Java 21, as well as detailed command references for operations like //replace, //set, //copy, and //paste.

Tokens
34.3K
Snippets
153
Records
185
Agent score
73%

What's inside FastAsyncWorldEdit

  1. Understand shading in FastAsyncWorldEdit libraries

    main

    FastAsyncWorldEdit uses shading specifically for API libraries—libraries whose classes are publicly referenced by -core classes.

    Implementation libraries (those used internally by the project but not exposed via the public API) are not shaded. This distinction ensures that when you depend on the -core API, you only receive the shading necessary for the public-facing interfaces you are interacting with, while implementation-specific dependencies remain internal to the project's runtime.

  2. Identify FAWE modifications in WorldEdit source code

    main

    When using the -sources jar of FastAsyncWorldEdit (FAWE) in a Maven or Gradle project, you can identify where FAWE has modified the original WorldEdit codebase by looking for specific comment annotations. This allows developers to easily see differences between the standard WorldEdit and the FAWE implementation.

    There are three types of annotations used:

    1. In-line annotations: Used for specific lines of code. They follow the pattern //FAWE start - [explanation] and end with //FAWE end. The explanation provides context on what was changed and why.
    2. Block annotations: Used to wrap entire methods or multiple methods. These use //FAWE start and //FAWE end without in-line explanations.
    3. Package annotations: When FAWE adds classes to a package-private scope, a package-info.java file is included in that package. This file contains a Javadoc comment listing the FAWE-added classes using @see tags.
    // Example of In-line annotation
    //FAWE start - Get player from PlayerProxy instead of BukkitPlayer if null
    player = PlayerProxy.unwrap(player);
    //FAWE end
    
    // Example of Block annotation
    //FAWE start
    @Override
    public void setPermission(String permission, boolean value) {
    }
    //FAWE end
  3. Understand FAWE placement modes and performance

    main

    FAWE processes editing asynchronously to minimize impact on the main server thread. It utilizes different placement modes to optimize throughput. The default mode is chunk placement.

    Available placement modes:

    • Blocks (Bukkit-API): Used only if chunk placement is unsupported. It is still faster than other Spigot-based plugins.
    • Chunks (NMS): Places entire chunk sections for higher throughput.
    • World (CFI): Used specifically for generating new worlds or regions.
  4. Use logging and rollback features

    main

    FAWE provides built-in tools to inspect and revert changes.

    • Use //inspect to examine changes.
    • Use //history rollback to search and restore previous states.
    • To bypass logging (for maximum speed at the cost of rollback capability), use the //fast command.

    Optimization Tip: To reduce disk usage caused by logging, you can increase the compression level and buffer size in the configuration.

    //inspect
    //history rollback
    //fast
  5. Generate IDE project files

    main

    You can generate project files for your preferred Integrated Development Environment (IDE) using the following Gradle commands:

    • IntelliJ IDEA: Run gradlew idea to generate an IntelliJ IDEA module for each folder.
    • Eclipse: Run gradlew eclipse to generate an Eclipse project for each folder (Note: this command may be unreliable/broken).
    gradlew idea
    gradlew eclipse
  6. Prerequisites for compiling FastAsyncWorldEdit

    main

    To compile FastAsyncWorldEdit, you must have Java 21 or greater installed.

    Important Notes:

    • Gradle will attempt to use your existing Java installation to bootstrap. If you have JRE 8 installed, Gradle may attempt to use it, which will cause the build to fail. It is recommended to uninstall JRE 8 and replace it with JDK 21.
    • You can obtain JDK 21 from Adoptium.
    • You do not need to download Gradle manually; the project uses the included Gradle wrapper.
  7. Install FastAsyncWorldEdit

    main

    FastAsyncWorldEdit (FAWE) is a high-performance fork of WorldEdit designed for efficient world editing. It can be installed as a standalone plugin or used to boost the performance of other plugins that depend on WorldEdit.

    Stable releases are available on:

    • Modrinth
    • CurseForge

    For developers or testers needing the latest features, experimental builds can be found on Jenkins.

    https://modrinth.com/plugin/fastasyncworldedit/
    https://dev.bukkit.org/projects/fawe
  8. Locate compiled build artifacts

    main

    After a successful build, the compiled files are located in the build/libs directory of each module:

    • FastAsyncWorldEdit API: worldedit-core/build/libs
    • Bukkit Plugin: worldedit-bukkit/build/libs
    • CLI Version: worldedit-cli/build/libs

    Usage Tip: If you intend to use FastAsyncWorldEdit as a Bukkit plugin, use the file named FastAsyncWorldEdit-<identifier> found in worldedit-bukkit/build/libs. The version suffixed with -# includes FastAsyncWorldEdit and all necessary libraries.

  9. Install CraftScripts for WorldEdit

    main

    CraftScripts allow you to write world editing scripts using JavaScript. To use them, you must perform two steps:

    1. Install the Rhino JavaScript library: CraftScripts require the Rhino engine to execute. Refer to the Rhino installation documentation to ensure your environment is set up.
    2. Install the script files: If you wish to use the provided scripts, place the entire craftscripts/ folder into the directory corresponding to your WorldEdit installation platform.

    Note: Installing these scripts is optional.

    # Example command structure for running a script
    /cs maze.js glowstone 10 10
  10. Compile FastAsyncWorldEdit using Gradle

    main

    FastAsyncWorldEdit is a multi-module project consisting of worldedit-core (API), worldedit-bukkit (Bukkit plugin), and worldedit-cli (CLI). Use the following commands to build the project from the root directory.

    On Windows

    1. Shift + right-click the folder containing the source files and select "Open command prompt".
    2. Run gradlew clean build.

    On Linux, BSD, or macOS

    1. Open a terminal and navigate to the project folder: cd /path/to/fawe/files.
    2. Run ./gradlew clean build.
    # Windows
    gradlew clean build
    
    # Linux/macOS
    ./gradlew clean build