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

View File

@@ -324,7 +324,7 @@ public class MassDriver extends Block{
} }
protected boolean shooterValid(Building other){ 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(){ protected boolean linkValid(){

View File

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