Scaffolding is a library for Minestom that allows you to load and place schematics.

Overview

Scaffolding

Scaffolding is a library for Minestom that allows you to load and place schematics.

This library is very early in development and has too many bugs to count. For your own safety, you should not use it in a production environment.

Usage

// Load a schematic from File.
public void method1() {
    Schematic schematic = Scaffolding.fromFile(new File("schematics/my_schematic.schematic"));
}

public void method2() {
    Schematic schematic = new SpongeSchematic();
    schematic.read(new FileInputStream(new File("schematics/my_schematic.schematic")));
}
// Place a schematic at a location.
Instance instance = player.getInstance();
Pos position = player.getPosition();
schematic.build(instance, position).thenRun(() -> player.sendMessage("Schematic placed!"));
// Write a schematic (SOONtm)
Region region = new Region(new Pos(0, 0, 0), new Pos(10, 10, 10));
Schematic schematic = new SpongeSchematic();
schematic.write(new FileOutputStream("schematics/my_schematic.schematic"), region);

Build Tools

Repository

<repository>
    <id>crystalgamesid>
    <url>https://repo.crystalgames.net/snapshots/url>
repository>

Dependency

<dependency>
    <groupId>net.crystalgamesgroupId>
    <artifactId>ScaffoldingartifactId>
    <version>0.1.1-SNAPSHOTversion>
dependency>
Comments
  • Schematics don't paste at correct location

    Schematics don't paste at correct location

    The schematic should be building at/around the area where the schematic was saved from.

    The schematic is saved using WorldEdit on Fabric like so image

    However when the schematic is pasted with schematic.build(spawnInstance, new Pos(0, 100, 0)) the schematic is actually built with the centre emerald block at 9, 119, 8 instead of 0, 99, 0

    image

    image

    opened by Technerder 7
  • Version 0.2.0 proposal

    Version 0.2.0 proposal

    This PR fixes many issues but probably creates many more. I believe these changes are necessary to reach a point where this library can be used in a production capacity.

    Fixes Fixes #4 - Scaffolding methods now cannot return null Fixes #8 - Schematics now cannot be placed in positions which would put them outside of world bounds Fixes #10 - MCEdit schematics now use correct block palette

    Improvements

    • More documentation
    • Distribution via JitPack is supported
    • Use CompletableFutures wherever possible
    • Rewrite schematic loading to make adding new schematic formats easier
    • WIP wiki site
    • WIP WorldEdit like editor server
    • Many other small changes
    opened by DamianKocher 6
  • SchematicChunkLoader + Schematic#apply implementation

    SchematicChunkLoader + Schematic#apply implementation

    Heya,

    I have implemented a schematic chunk loader and added an example of it's usage in the test server. Let me know if you have any issues with the pr.

    Thanks.

    opened by KrystilizeNevaDies 1
  • refactor: move to hypera.dev

    refactor: move to hypera.dev

    CrystalGames is being discontinued and the project has been transferred to Hypera Development. This pull request moves the project to the domain hypera.dev and sets up Hypera's maven repository.

    opened by joshuasing 0
  • Configure Mend Bolt for GitHub

    Configure Mend Bolt for GitHub

    Welcome to Mend Bolt for GitHub (formerly WhiteSource). This is an onboarding PR to help you understand and configure settings before Mend starts scanning your repository for security vulnerabilities.

    :vertical_traffic_light: Mend Bolt for GitHub will start scanning your repository only once you merge this Pull Request. To disable Mend Bolt for GitHub, simply close this Pull Request.


    What to Expect

    This PR contains a '.whitesource' configuration file which can be customized to your needs. If no changes were applied to this file, Mend Bolt for GitHub will use the default configuration.

    Before merging this PR, Make sure the Issues tab is enabled. Once you merge this PR, Mend Bolt for GitHub will scan your repository and create a GitHub Issue for every vulnerability detected in your repository.

    If you do not want a GitHub Issue to be created for each detected vulnerability, you can edit the '.whitesource' file and set the 'minSeverityLevel' parameter to 'NONE'.


    :question: Got questions? Check out Mend Bolt for GitHub docs. If you need any further assistance then you can also request help here.

    opened by mend-bolt-for-github[bot] 0
  • Fix preloading incorrect chunks in Schematic#build() implementations

    Fix preloading incorrect chunks in Schematic#build() implementations

    When placing a schematic in unloaded chunks build() failed to preload the correct chunks. It would preload chunks for each block relative to the schematic, not the absolute position (schematic placement position + relative block position). This PR remedies the issue.

    opened by DamianKocher 0
  • Sign Bug?

    Sign Bug?

    I have a schematic created and loaded which contains Signs with Text on it. The Signs on loading does not have a Text

    Does Schematics contain the Text of the Signs? if yes -> They dont get loaded correctly (I have BlockHandler for Signs registered)

    opened by einfachBlu 5
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/codeql.yml (github-actions)
    • pom.xml (maven)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 1 Pull Request:

    chore(deps): update actions/setup-java action to v3.6.0
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-setup-java-3.x
    • Merge into: master
    • Upgrade actions/setup-java to v3.6.0

    ⚠ Dependency Lookup Warnings ⚠

    Please correct - or verify that you can safely ignore - these lookup failures before you merge this PR.

    • Failed to look up maven dependency com.github.Minestom:Minestom

    Files affected: pom.xml


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • MCEdit schematics use the incorrect block pallet

    MCEdit schematics use the incorrect block pallet

    Describe the bug MCEdit schematics are loaded with a different block pallet when compared to how WorldEdit handles the same schematic. Currently, state Ids can only go from 0 to 255 if addBlocks is not used. This is an issue since Minestom block state Ids can go up to ~15000. To fix the issue, blockId and blockData should be mapped together to get the true stateId, such as how WorldEdit does.

    I have a have a solution that just needs to be cleaned up when I have a bit of free time. I just wanted to create an issue so I can resolve it ;)

    bug 
    opened by DamianKocher 0
  • Cannot place schematic

    Cannot place schematic

    Describe the bug When placing a schematic it produces:

    java.lang.ArrayIndexOutOfBoundsException: Index 1048576 out of bounds for length 24
    	at java.base/java.util.ImmutableCollections$ListN.get(ImmutableCollections.java:680)
    	at net.minestom.server.instance.DynamicChunk.getSection(DynamicChunk.java:109)
    	at net.minestom.server.instance.Chunk.getSectionAt(Chunk.java:95)
    	at net.minestom.server.instance.DynamicChunk.setBlock(DynamicChunk.java:72)
    	at net.minestom.server.instance.batch.ChunkBatch.apply(ChunkBatch.java:216)
    	at net.minestom.server.instance.batch.ChunkBatch.singleThreadFlush(ChunkBatch.java:188)
    	at net.minestom.server.instance.batch.ChunkBatch.lambda$apply$0(ChunkBatch.java:156)
    

    To Reproduce Steps to reproduce the behavior:

    Schematic schem = Scaffolding.fromFile(...);
    schem.build(..., Pos.ZERO);
    

    (unpack for schematic, WE is ok with it, and it seems to have everything expected) lightouse.schem.zip

    Expected behavior should build

    Screenshots If applicable, add screenshots to help explain your problem.

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22] ah yes very good

    Smartphone (please complete the following information):

    • Device: [e.g. iPhone6]
    • OS: [e.g. iOS8.1]
    • Browser [e.g. stock browser, safari]
    • Version [e.g. 22] +1 for template

    Additional context Add any other context about the problem here.

    bug 
    opened by mworzala 0
  • Null response without an error

    Null response without an error

    Describe the bug So when you trying to load up a schematic via Scaffolding.fromFile or via the FileInputStream the response is always null. There is no exception too which would be thrown. BTW my entire completeable future is beeing closed but i have no idea what why and whats caused it...

    To Reproduce Steps to reproduce the behavior:

    1. Load up a schematic
    2. look via if(schematic != null) if its null
    3. Use it in a CompleteableFuture
    4. See null response with no error (Schematics are tested and worked fine)

    Expected behavior It should throw an error and should load when the schematics are right, load them up.

    Screenshots 1. image 2. (Debug) image (- Please ask for a full code snippet)

    Desktop (please complete the following information):

    • Latest Scaffolding version
    • Latest Minestom verison (Not 1.18 branch)
    • Java 17
    bug good first issue 
    opened by GoldenGamerLP 20
Owner
Crystal Games
Crystal Games
A FabricMC Mod that allows you to give yourself a few Custom Cosmetics.

Cosmetics-Fabric A FabricMC Mod that allows you to give yourself a few Custom Cosmetics.

null 1 Apr 13, 2022
JPassport works like Java Native Access (JNA) but uses the Foreign Linker API instead of JNI. Similar to JNA, you declare a Java interface that is bound to the external C library using method names.

JPassport works like Java Native Access (JNA) but uses the Foreign Linker API instead of JNI. Similar to JNA, you declare a Java interface t

null 28 Dec 30, 2022
An MIT AI2 extension to allows developers to show media style notifications for their applications.

Media Notifications An MIT AI2 extension to allows developers to show media style notifications for their applications.

Shreyash Saitwal 5 Jan 7, 2023
A simple fabric mod which allows deepslate to be instamined

InstantDeepslate An extremely simple mod that allows you to instantly mine deepslate. This works by changing the blast resistance and break time value

null 3 Jan 31, 2022
A Nexus Repository 3 plugin that allows usage of Terraform repositories

Nexus Repository Terraform Format Table Of Contents Developing Requirements Download Building Using Terraform with Nexus Repository Manager 3 Compatib

null 8 Dec 5, 2022
Function allowing you to find duplicate in an array in linear time and constant space

Floyd's tortoise and hare Function allowing you to find duplicate in an array in linear time and constant space ! Floyd's method is a pretty amazing,

null 7 Mar 29, 2022
An app that weighs the pros and cons of a decision to help you make the best decision

An app that weighs the pros and cons of a decision to help you make the best decision

Mambo Bryan 5 Feb 2, 2022
a little project that will help you get in jail

Heftgen [ˈhɛftçən] ausgesprochen: Heftchen Development Install this npm module globally (https://www.npmjs.com/package/git-conventional-commits) Enabl

null 5 Jun 26, 2021
A small program to allow you to easily generate fabric mods

FabricModGenerator A small program to allow you to easily generate fabric mods. Most of the code was taken from GeneratorFabricMod and TemplateMakerFa

Aaron 2 Mar 3, 2022
A Local implementation of a java library functions to create a serverside and clientside application which will communicate over TCP using given port and ip address.

A Local implementation of java library functions to create a serverside and clientside application which will communicate over TCP using given port and ip address.

Isaac Barry 1 Feb 12, 2022
Java XML library. A really cool one. Obviously.

XMLBeam This is a Java XML library with an extraordinary expressive API. By using XPath for read and write operations, many operations take only one l

Sven Ewald 70 Aug 25, 2022
icecream-java is a Java port of the icecream library for Python.

icecream-java is a Java port of the icecream library for Python.

Akshay Thakare 20 Apr 7, 2022
This library provides facilities to match an input string against a collection of regex patterns.

This library provides facilities to match an input string against a collection of regex patterns. This library acts as a wrapper around the popular Chimera library, which allows it to be used in Java.

Sahab 5 Oct 26, 2022
Apache OpenNLP library is a machine learning based toolkit for the processing of natural language text

Welcome to Apache OpenNLP! The Apache OpenNLP library is a machine learning based toolkit for the processing of natural language text. This toolkit is

The Apache Software Foundation 1.2k Dec 29, 2022
Java serialization library, proto compiler, code generator

A java serialization library with built-in support for forward-backward compatibility (schema evolution) and validation. efficient, both in speed and

protostuff 1.9k Dec 23, 2022
Discord IPC - Pure Java 16 library

Pure Java 16 library for interacting with locally running Discord instance without the use of JNI.

Meteor Development 8 Nov 14, 2022
Crackersanimator is a particle system library that works with the standard Android UI

Crackersanimator is a particle system library that works with the standard Android UI. This library build from https://github.com/plattysoft/Leonids library but make some update to support for latest version of android.

null 3 Jun 14, 2022
null 8 Dec 22, 2022
Sauron, the all seeing eye! It is a service to generate automated reports and track migrations, changes and dependency versions for backend services also report on known CVE and security issues.

SAURON - VERSION AND DEPLOYMENT TRACKER DESCRIPTION Sauron, the all seeing eye! It is a service to generate automated reports and track migrations, ch

FREENOWTech 20 Oct 31, 2022