Skip to content

Commit

Permalink
Bump version to 0.3.3, update changelog and apply dartfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
spnda committed Mar 30, 2021
1 parent 3c8b5f3 commit 83ad03d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 25 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.3.3

- Implement server pinging
- Generalized NBT file read/write internally.

## 0.3.2

- Custom NBT File exceptions
Expand Down
34 changes: 11 additions & 23 deletions example/servers_nbt_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,17 @@ void main() async {

/// If you have not supplied a servers.dat file to read from, we'll
/// fill in some basic servers as an example.
nbtFile.root ??= NbtCompound(
name: '',
children: [
NbtList(
name: 'servers',
children: <NbtCompound>[
NbtCompound(
name: '',
children: [
NbtString(
name: 'ip',
value: 'mc.hypixel.net'
),
NbtString(
name: 'name',
value: 'Hypixel'
),
]
),
],
)
]
);
nbtFile.root ??= NbtCompound(name: '', children: [
NbtList(
name: 'servers',
children: <NbtCompound>[
NbtCompound(name: '', children: [
NbtString(name: 'ip', value: 'mc.hypixel.net'),
NbtString(name: 'name', value: 'Hypixel'),
]),
],
)
]);

/// As we now have NBT data stored in our [NbtFile], we
/// will begin reading from it and pinging the first
Expand Down
3 changes: 2 additions & 1 deletion lib/src/server_ping.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ Future<ResponsePacket?> pingUri(String serverUri) async {

/// Ping a single server. [port] will default to 25565 as that is the
/// default Minecraft server port. This method is for post 1.6 servers.
Future<ResponsePacket?> ping(String serverUri, {int port = 25565, Duration timeout = const Duration(seconds: 30)}) async {
Future<ResponsePacket?> ping(String serverUri,
{int port = 25565, Duration timeout = const Duration(seconds: 30)}) async {
try {
final socket = await Socket.connect(serverUri, port, timeout: timeout);
final stream = socket.asBroadcastStream();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dart_minecraft
description: Utilities for Minecraft and Mojang Web-APIs and reading/writing NBT Files.
version: 0.3.2
version: 0.3.3
homepage: https://github.com/spnda/dart_minecraft

environment:
Expand Down

0 comments on commit 83ad03d

Please sign in to comment.