sandrohc / schematic4j Goto Github PK
View Code? Open in Web Editor NEWJava parser for the .schem/.schematic/.litematic Minecraft formats. ๐บ
License: MIT License
Java parser for the .schem/.schematic/.litematic Minecraft formats. ๐บ
License: MIT License
Some schematics don't seem to load properly, while others work just fine. I tested a few schematics, and it seems like .schematics and .litematics don't work while .schems do work.
TestedSchematics.zip contains the schematics I have tested.
In 3 and 4, all blocks have suddenly become air. Screenshot of code (offset returns 0,0,0):
5 outputs a bugged schematic that somewhat looks like what it should look like, but obviously it is not 100% correct.
Hope you can do something with this.
Hello! New to the Minecraft dev scene so bear with me, but I'm pretty bewildered here. :)
I'm working on a side project to try and implement a layer-by-layer blueprint viewer (a la Schematic2Blueprint) that works on .schem
Sponge format schematic files, and am using this library as a dependency. With some schematics (I'm using Amulet to export them to .schem
, if that makes any difference) it works fine, but with others, weird stuff starts to happen in the block ordering.
Case in point - I set up a big pile of many different block types in my creative world so I could test how my app behaves on all of them:
The .schem
file itself seems to be fine, because I can re-import it into Amulet or Litematica and all the blocks look correct. However, parsing it with SchematicUtil.load
has some weird behavior.
The first level of blocks, for instance:
Going from north to south on one vertical Y value (if I understand correctly) should be
Schematic schematic = SchematicUtil.load(path);
int length = schematic.getLength();
int height = schematic.getHeight();
int width = schematic.getWidth();
for (int i = 0; i < height; i++) {
for (int j = 0; j < length; j++) {
for (int k = 0; k < width; k++) {
SchematicBlock block = schematic.getBlock(k, i, j);
}
}
}
which is what I am doing in my application. Given the row above, the result I would expect would be
minecraft:stone
minecraft:granite
minecraft:polished_granite
minecraft:diorite
minecraft:polished_diorite
minecraft:andesite
minecraft:polished_andesite
minecraft:deepslate
minecraft:cobbled_deepslate
Instead, what I get is
minecraft:stone
minecraft:granite
minecraft:polished_granite
minecraft:polished_blackstone_brick_stairs
minecraft:grass_block
minecraft:mossy_stone_bricks
minecraft:grass_block
minecraft:yellow_stained_glass
minecraft:grass_block
As you can see, it starts off correct and then kind of goes off the rails from there. The rest of the parsing gives much the same result - some blocks are listed as being where they are supposed to be, while others seem to have been swapped in from wildly different parts of the schematic, or just slotted in at random. (The grass_block
is a repeated offender.)
Am I doing something wrong in how I'm using the library? Or is there a sneaky bug lurking around here? I've attached the .schem
file in question here: palette-lvl1.zip; please let me know if there's other info that would be helpful! :)
(Thanks very much for this tool, also! Assuming I can figure out what the issue is here, it's been awesome in all other regards. :) )
VoxelSniper used to have a proprietary system for stencils (basically schematics) which no longer works (due to block id's no longer numerical for many a year). In our fork we have refactored this to use schematics using Schematic4J. Creating schematics from an area selection is something that we still have to implement.
We would like to see a way to create a schematic from an input of blocks, entities etc. Perhaps something like a builder pattern.
Is this something you would consider within the scope of Schematic4J?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.