spnda / dart_minecraft Goto Github PK
View Code? Open in Web Editor NEWA Dart library for Minecraft and Mojang Web-APIs, authentication, and NBT Files.
Home Page: https://pub.dev/packages/dart_minecraft
License: MIT License
A Dart library for Minecraft and Mojang Web-APIs, authentication, and NBT Files.
Home Page: https://pub.dev/packages/dart_minecraft
License: MIT License
Bedrock .mcstructure files structure https://gist.github.com/tryashtar/87ad9654305e5df686acab05cc4b6205
While reading the code I found that PascalCase
is being used to name Dart source files (e.g. Minecraft.java
). Effective Dart guidelines (proposed by the Dart team) advise to name files with lower_snake_case convention. It would be nice to refactor the code so it matches this guideline so all Dart & Flutter developers communicate using the same language patterns.
In lib/src/nbt/nbt_reader.dart, class NbtReader
Line 70 to 72
Endian getContentEndian() { return Endian.big; }
This code is going to cause that whenever I try to get the endian of a NBT file, I would get Endian.big.
Is this an oversight? Or maybe you just don't intend to implement this function?
Also, can you please add an argument that receives Endian type variable to NbtWriter().writeFile() to enable us to write NBT file in little endian? I read a NBT file in little endian then write it as another file but then the new NBT file seems broken.
void getServer() async {
final server = await ping('mc.hypixel.net');
if (server == null || server.response == null) return;
final players = server.response!.players;
if (kDebugMode) {
print('Pinged ...');
}
if (kDebugMode) {
print('${players.online} / ${players.max}. ${server.ping}ms.');
}
setState(() {
playersOnline = players;
});
}
Error: Unsupported operation: dart:io is required to ping servers.
Even when i import dart:io, it still doesnt work
Hello, I noticed that only the server with port 25565 is displayed. If the server has a different port, it is not displayed.
below my code:
I have the file in my folders but every time I try to read the nbt file I get error (E/flutter ( 5298): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PathNotFoundException: Cannot open file, path = 'assets/gifs/deneme1.nbt' (OS Error: No such file or directory, errno = 2))
void asd() async {
print("executed main");
final nbtReader = NbtReader.fromFile('assets/gifs/deneme1.nbt');
try {
nbtReader.read();
} on NbtFileReadException {
print('Failed to read data.nbt');
}
}
I'm trying to read a Minecraft playerdata file using Flutter Web, and I'm running into a couple issues:
Apparently the file I was trying to read was compressed as gzip. Digging into the code, I saw this comment:
"On JS platforms, this does nothing, as it requires converters from 'dart:io'."
Not a huge problem for me though, as I can detect the compression type and just use https://pub.dev/packages/archive which does support web.
After decompressing, I'm getting "Error: Unsupported operation: Int64 accessor not supported by dart2js." which is from this line: https://github.com/spnda/dart_minecraft/blob/main/lib/src/utilities/readers/_byte_reader.dart#L61
I also found this related issue: dart-lang/sdk#10275
Is there anything we can do about this?
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.