Commit 47d63a12e1d9c884a5b61238277735fd76e2911a
1 parent
7f3ee908
Add copyright to debug srcs, fix changes which were accidentally removed
Showing
3 changed files
with
30 additions
and
5 deletions
src/debug/java/com/mumfrey/liteloader/debug/LoginManager.java
src/debug/java/com/mumfrey/liteloader/debug/LoginPanel.java
src/debug/java/com/mumfrey/liteloader/debug/Start.java
1 | +/* | |
2 | + * This file is part of LiteLoader. | |
3 | + * Copyright (C) 2012-16 Adam Mummery-Smith | |
4 | + * All Rights Reserved. | |
5 | + */ | |
1 | 6 | package com.mumfrey.liteloader.debug; |
2 | 7 | |
3 | 8 | import java.io.File; |
... | ... | @@ -123,6 +128,7 @@ public abstract class Start |
123 | 128 | |
124 | 129 | File gameDir = new File(System.getProperty("user.dir")); |
125 | 130 | File assetsDir = new File(gameDir, "assets"); |
131 | + File assetIndexDir = new File(assetsDir, "indexes"); | |
126 | 132 | |
127 | 133 | Start.addArg(qualifiedArgs, "--tweakClass", LiteLoaderTweaker.class.getName()); |
128 | 134 | Start.addArg(qualifiedArgs, "--username", loginManager.getProfileName()); |
... | ... | @@ -130,10 +136,10 @@ public abstract class Start |
130 | 136 | Start.addArg(qualifiedArgs, "--accessToken", loginManager.getAuthenticatedToken()); |
131 | 137 | Start.addArg(qualifiedArgs, "--userType", loginManager.getUserType()); |
132 | 138 | Start.addArg(qualifiedArgs, "--userProperties", loginManager.getUserProperties()); |
133 | - Start.addArg(qualifiedArgs, "--version", "mcp"); | |
134 | - Start.addArg(qualifiedArgs, "--gameDir", gameDir.getAbsolutePath()); | |
135 | - Start.addArg(qualifiedArgs, "--assetIndex", LiteLoaderTweaker.VERSION); | |
136 | - Start.addArg(qualifiedArgs, "--assetsDir", assetsDir.getAbsolutePath()); | |
139 | + Start.addArg(qualifiedArgs, "--version", "mcp", true); | |
140 | + Start.addArg(qualifiedArgs, "--gameDir", gameDir.getAbsolutePath(), true); | |
141 | + Start.addArg(qualifiedArgs, "--assetIndex", LiteLoaderTweaker.VERSION, true); | |
142 | + Start.addArg(qualifiedArgs, "--assetsDir", assetsDir.getAbsolutePath(), !assetIndexDir.exists()); | |
137 | 143 | } |
138 | 144 | |
139 | 145 | private static void addRequiredArgsServer(String[] args, List<String> unqualifiedArgs, Map<String, Set<String>> qualifiedArgs) |
... | ... | @@ -162,13 +168,22 @@ public abstract class Start |
162 | 168 | |
163 | 169 | private static void addArg(Map<String, Set<String>> qualifiedArgs, String qualifier, String arg) |
164 | 170 | { |
171 | + Start.addArg(qualifiedArgs, qualifier, arg, false); | |
172 | + } | |
173 | + | |
174 | + private static void addArg(Map<String, Set<String>> qualifiedArgs, String qualifier, String arg, boolean skipExisting) | |
175 | + { | |
165 | 176 | Set<String> args = qualifiedArgs.get(qualifier); |
166 | - | |
177 | + | |
167 | 178 | if (args == null) |
168 | 179 | { |
169 | 180 | args = new HashSet<String>(); |
170 | 181 | qualifiedArgs.put(qualifier, args); |
171 | 182 | } |
183 | + else if (skipExisting) | |
184 | + { | |
185 | + return; | |
186 | + } | |
172 | 187 | |
173 | 188 | if (!Start.MULTI_VALUE_ARGS.contains(qualifier)) |
174 | 189 | { | ... | ... |