Comments (2)
if anyone have the same problem as me this was my solution:
void _readFile() async
//I was able to extract Uint8List by doing like this.
final ByteData data = await rootBundle.load('assets/files/dd.schem');
//normally NbtReader.fromfile() already implemented but in my case reading bytes was not an option
final nbtReader = NbtReader(data.buffer.asUint8List());
// after that I was able to read file
await nbtReader.read();
NbtCompound<NbtTag>? rootNode = nbtReader.root;
List<NbtTag>? block_types = rootNode?.getChildrenByName("Palette");
print(block_types);
}
from dart_minecraft.
Flutter does files a bit different depending on the platform, which is why packages like path_provider
exist. NbtReader.fromFile
internally just does File(path).readAsBytesSync()
, which is relative to the app's working directory, which is not where the assets
are stored by default afaik, though I haven't used Flutter with assets for a while. Though glad you fixed it using a different solution.
from dart_minecraft.
Related Issues (8)
- Improvement: Refactor code to match effective_dart guidelines HOT 1
- I can't ping servers that have a port other than 25565 HOT 6
- NBTReader.getContentEndian() returns Endian.big without condition HOT 1
- Can't read mcstructure file (it is nbt file) HOT 2
- can you code plugins in minecraft using dart? HOT 2
- Can't ping server HOT 1
- Can't read player.dat file on web
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart_minecraft.