Cleanup
This commit is contained in:
@@ -49,7 +49,7 @@ public class GlobalData{
|
|||||||
for(Fi add : files){
|
for(Fi add : files){
|
||||||
if(add.isDirectory()) continue;
|
if(add.isDirectory()) continue;
|
||||||
zos.putNextEntry(new ZipEntry(add.path().substring(base.length())));
|
zos.putNextEntry(new ZipEntry(add.path().substring(base.length())));
|
||||||
Streams.copyStream(add.read(), zos);
|
Streams.copy(add.read(), zos);
|
||||||
zos.closeEntry();
|
zos.closeEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import mindustry.game.EventType.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.graphics.MultiPacker.*;
|
import mindustry.graphics.MultiPacker.*;
|
||||||
import mindustry.plugin.*;
|
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
|
||||||
@@ -118,7 +117,7 @@ public class Mods implements Loadable{
|
|||||||
private void packSprites(Array<Fi> sprites, LoadedMod mod, boolean prefix){
|
private void packSprites(Array<Fi> sprites, LoadedMod mod, boolean prefix){
|
||||||
for(Fi file : sprites){
|
for(Fi file : sprites){
|
||||||
try(InputStream stream = file.read()){
|
try(InputStream stream = file.read()){
|
||||||
byte[] bytes = Streams.copyStreamToByteArray(stream, Math.max((int)file.length(), 512));
|
byte[] bytes = Streams.copyBytes(stream, Math.max((int)file.length(), 512));
|
||||||
Pixmap pixmap = new Pixmap(bytes, 0, bytes.length);
|
Pixmap pixmap = new Pixmap(bytes, 0, bytes.length);
|
||||||
packer.add(getPage(file), (prefix ? mod.name + "-" : "") + file.nameWithoutExtension(), new PixmapRegion(pixmap));
|
packer.add(getPage(file), (prefix ? mod.name + "-" : "") + file.nameWithoutExtension(), new PixmapRegion(pixmap));
|
||||||
pixmap.dispose();
|
pixmap.dispose();
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class ModsDialog extends FloatingDialog{
|
|||||||
}else{
|
}else{
|
||||||
try{
|
try{
|
||||||
Fi file = tmpDirectory.child(text.replace("/", "") + ".zip");
|
Fi file = tmpDirectory.child(text.replace("/", "") + ".zip");
|
||||||
Streams.copyStream(result.getResultAsStream(), file.write(false));
|
Streams.copy(result.getResultAsStream(), file.write(false));
|
||||||
mods.importMod(file);
|
mods.importMod(file);
|
||||||
file.delete();
|
file.delete();
|
||||||
Core.app.post(() -> {
|
Core.app.post(() -> {
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=8f106aca9385924404e9f2125006d2b16457af4b
|
archash=23a7b4c41d1723835af9b79aab1093384cfcc621
|
||||||
|
|||||||
Reference in New Issue
Block a user