mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-06 02:40:23 -08:00
Cleanup
This commit is contained in:
parent
39e47db8c7
commit
4ed9f10c1b
4 changed files with 7 additions and 8 deletions
|
|
@ -422,7 +422,7 @@ public class Maps{
|
|||
}
|
||||
|
||||
private void writeCache(Map map) throws IOException{
|
||||
try(DataOutputStream stream = new DataOutputStream(map.cacheFile().write(false, Streams.DEFAULT_BUFFER_SIZE))){
|
||||
try(DataOutputStream stream = new DataOutputStream(map.cacheFile().write(false, Streams.defaultBufferSize))){
|
||||
stream.write(0);
|
||||
stream.writeInt(map.spawns);
|
||||
stream.write(map.teams.size);
|
||||
|
|
@ -434,7 +434,7 @@ public class Maps{
|
|||
}
|
||||
|
||||
private void readCache(Map map) throws IOException{
|
||||
try(DataInputStream stream = new DataInputStream(map.cacheFile().read(Streams.DEFAULT_BUFFER_SIZE))){
|
||||
try(DataInputStream stream = new DataInputStream(map.cacheFile().read(Streams.defaultBufferSize))){
|
||||
stream.read(); //version
|
||||
map.spawns = stream.readInt();
|
||||
int teamsize = stream.readByte();
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import arc.assets.loaders.SoundLoader.*;
|
|||
import arc.audio.*;
|
||||
import arc.files.*;
|
||||
import arc.func.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import arc.util.Log.*;
|
||||
import arc.util.io.*;
|
||||
import mindustry.*;
|
||||
import mindustry.mod.Mods.*;
|
||||
import rhino.*;
|
||||
|
|
@ -18,7 +18,6 @@ import rhino.module.provider.*;
|
|||
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
import java.util.regex.*;
|
||||
|
||||
public class Scripts implements Disposable{
|
||||
|
|
@ -131,7 +130,7 @@ public class Scripts implements Disposable{
|
|||
|
||||
/** writeFile but for a byte[] */
|
||||
public void writeBinFile(String purpose, String ext, byte[] contents){
|
||||
if(contents == null) contents = new byte[0];
|
||||
if(contents == null) contents = Streams.emptyBytes;
|
||||
final byte[] fContents = contents;
|
||||
selectFile(false, purpose, ext, fi -> fi.writeBytes(fContents));
|
||||
}
|
||||
|
|
@ -183,7 +182,7 @@ public class Scripts implements Disposable{
|
|||
}
|
||||
|
||||
private class ScriptModuleProvider extends UrlModuleSourceProvider{
|
||||
private Pattern directory = Pattern.compile("^(.+?)/(.+)");
|
||||
private final Pattern directory = Pattern.compile("^(.+?)/(.+)");
|
||||
|
||||
public ScriptModuleProvider(){
|
||||
super(null, null);
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ kapt.include.compile.classpath=false
|
|||
kotlin.stdlib.default.dependency=false
|
||||
#needed for android compilation
|
||||
android.useAndroidX=true
|
||||
archash=b5d3986d159cc42f2b38da24682ad0cc19c6c656
|
||||
archash=ca296ad37aeca186fcef3290bb8a6e9143bdd245
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
|||
|
||||
if(SaveIO.isSaveValid(file)){
|
||||
try{
|
||||
SaveMeta meta = SaveIO.getMeta(new DataInputStream(new InflaterInputStream(file.read(Streams.DEFAULT_BUFFER_SIZE))));
|
||||
SaveMeta meta = SaveIO.getMeta(new DataInputStream(new InflaterInputStream(file.read(Streams.defaultBufferSize))));
|
||||
if(meta.tags.containsKey("name")){
|
||||
//is map
|
||||
if(!ui.editor.isShown()){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue