launchcraft 0.0.1.1 → 0.0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/launchcraft/java.rb +5 -6
- data/lib/launchcraft/version.rb +1 -1
- data/lib/os.rb +1 -1
- metadata +2 -2
data/lib/launchcraft/java.rb
CHANGED
@@ -17,20 +17,19 @@
|
|
17
17
|
# along with launchcraft. If not, see <http://www.gnu.org/licenses/>.
|
18
18
|
#++
|
19
19
|
|
20
|
+
require 'os'
|
20
21
|
require 'launchcraft'
|
21
22
|
|
22
|
-
require 'rbconfig'
|
23
|
-
|
24
23
|
class Dir
|
25
24
|
def self.path
|
26
|
-
((
|
27
|
-
['/bin', '/usr/bin', '/sbin', '/usr/sbin', '/usr/local/bin'].join(RbConfig::CONFIG['PATH_SEPARATOR'])
|
28
|
-
).split(RbConfig::CONFIG['PATH_SEPARATOR'])
|
25
|
+
((ENV.key?('PATH') and ENV['PATH'] and !ENV['PATH'].empty?) ? ENV['PATH'] : '').split(File::PATH_SEPARATOR)
|
29
26
|
end
|
30
27
|
end
|
31
28
|
|
32
29
|
module Kernel
|
33
30
|
def self.which (bin, which=0)
|
31
|
+
bin << '.exe' if OS.windows? and bin !~ /\.exe$/
|
32
|
+
|
34
33
|
res = Dir.path.map {|path|
|
35
34
|
File.join(path, bin)
|
36
35
|
}.select {|bin|
|
@@ -73,7 +72,7 @@ class LaunchCraft
|
|
73
72
|
bindir = File.join(LaunchCraft.working_dir, 'bin')
|
74
73
|
[BIN, '-Xmx1024M', '-Xms512M', '-cp', %w[jinput lwjgl lwjgl_util minecraft].map {|x|
|
75
74
|
File.join(bindir, "#{x}.jar")
|
76
|
-
}.join(
|
75
|
+
}.join(File::PATH_SEPARATOR), "-Djava.library.path=#{File.join(bindir, 'natives')}", "-Dminecraft.appname=#{LaunchCraft.appname}",
|
77
76
|
'net.minecraft.client.Minecraft', user, sessid].compact
|
78
77
|
end
|
79
78
|
end
|
data/lib/launchcraft/version.rb
CHANGED
data/lib/os.rb
CHANGED