I guess everything is unsafe now

This commit is contained in:
Anuken
2021-06-13 19:27:28 -04:00
parent a756dec379
commit 2d9204d638
3 changed files with 9 additions and 20 deletions

View File

@@ -174,21 +174,12 @@ public class ModsDialog extends BaseDialog{
dialog.hide();
platform.showMultiFileChooser(file -> {
Runnable go = () -> {
try{
mods.importMod(file);
setup();
}catch(IOException e){
ui.showException(e);
e.printStackTrace();
}
};
//show unsafe jar file warning
if(file.extEquals("jar")){
ui.showConfirm("@warning", "@mod.jarwarn", go);
}else{
go.run();
try{
mods.importMod(file);
setup();
}catch(IOException e){
ui.showException(e);
Log.err(e);
}
}, "zip", "jar");
}).margin(12f);
@@ -529,10 +520,7 @@ public class ModsDialog extends BaseDialog{
private void githubImportMod(String repo, boolean isJava){
if(isJava){
ui.showConfirm("@warning", "@mod.jarwarn", () -> {
ui.loadfrag.show();
githubImportJavaMod(repo);
});
githubImportJavaMod(repo);
}else{
ui.loadfrag.show();
Core.net.httpGet(ghApi + "/repos/" + repo, res -> {

View File

@@ -324,7 +324,7 @@ public class MassDriver extends Block{
}
protected boolean shooterValid(Building other){
return other instanceof MassDriverBuild entity && other.consValid() && entity.block == block && entity.link == pos() && within(other, range);
return other instanceof MassDriverBuild entity && other.isValid() && other.consValid() && entity.block == block && entity.link == pos() && within(other, range);
}
protected boolean linkValid(){

View File

@@ -184,6 +184,7 @@ public class PayloadMassDriver extends PayloadBlock{
if(current != null &&
!(
current instanceof PayloadDriverBuild entity &&
current.isValid() &&
entity.consValid() && entity.block == block &&
entity.link == pos() && within(current, range)
)){