craftbelt 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/craftbelt/minecraft_instance.rb +9 -7
- data/lib/craftbelt/version.rb +1 -1
- metadata +2 -2
@@ -40,11 +40,13 @@ module Craftbelt
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def to_h(include_paths = [])
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
Dir.chdir(root) do
|
44
|
+
{
|
45
|
+
root: root,
|
46
|
+
paths: relative_level_paths + include_paths.select{|p| File.exist?(p) },
|
47
|
+
settings: read_settings
|
48
|
+
}
|
49
|
+
end
|
48
50
|
end
|
49
51
|
|
50
52
|
def level_dats
|
@@ -62,7 +64,7 @@ module Craftbelt
|
|
62
64
|
def read_settings
|
63
65
|
settings = {}
|
64
66
|
begin
|
65
|
-
nbt = NBTFile.read(File.open(level_dats
|
67
|
+
nbt = NBTFile.read(File.open(level_dats.first))
|
66
68
|
settings = {
|
67
69
|
seed: nbt[1]['Data']['RandomSeed'].value.to_s
|
68
70
|
}
|
@@ -89,7 +91,7 @@ module Craftbelt
|
|
89
91
|
Find.find(@initial_root) do |path|
|
90
92
|
ROOT_FILES.each do |root_file|
|
91
93
|
if path.end_with? root_file
|
92
|
-
return File.dirname(path)
|
94
|
+
return File.expand_path(File.dirname(path))
|
93
95
|
end
|
94
96
|
end
|
95
97
|
end
|
data/lib/craftbelt/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: craftbelt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nbtfile
|