Bugfixes
This commit is contained in:
@@ -222,35 +222,8 @@ public class Control implements ApplicationListener{
|
||||
return hiscore;
|
||||
}
|
||||
|
||||
private void checkUnlockableBlocks(){
|
||||
TileEntity entity = players[0].getClosestCore();
|
||||
|
||||
if(entity == null) return;
|
||||
|
||||
entity.items.forEach((item, amount) -> data.unlockContent(item));
|
||||
|
||||
if(players[0].inventory.hasItem()){
|
||||
data.unlockContent(players[0].inventory.getItem().item);
|
||||
}
|
||||
|
||||
outer:
|
||||
for(int i = 0; i < content.recipes().size; i ++){
|
||||
Recipe recipe = content.recipes().get(i);
|
||||
if(!recipe.isHidden() && recipe.requirements != null){
|
||||
for(ItemStack stack : recipe.requirements){
|
||||
if(!entity.items.has(stack.item, Math.min((int) (stack.amount), 2000))) continue outer;
|
||||
}
|
||||
|
||||
if(data.unlockContent(recipe)){
|
||||
ui.hudfrag.showUnlock(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose(){
|
||||
Platform.instance.onGameExit();
|
||||
content.dispose();
|
||||
Net.dispose();
|
||||
ui.editor.dispose();
|
||||
|
||||
@@ -38,8 +38,6 @@ public abstract class Platform {
|
||||
}
|
||||
/**Update discord RPC.*/
|
||||
public void updateRPC(){}
|
||||
/**Called when the game is exited.*/
|
||||
public void onGameExit(){}
|
||||
/**Open donation dialog. Currently android only.*/
|
||||
public void openDonations(){}
|
||||
/**Whether donating is supported.*/
|
||||
|
||||
@@ -9,7 +9,6 @@ import io.anuke.arc.function.Consumer;
|
||||
import io.anuke.arc.util.OS;
|
||||
import io.anuke.arc.util.Strings;
|
||||
import io.anuke.arc.util.serialization.Base64Coder;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.core.Platform;
|
||||
import io.anuke.mindustry.game.GameMode;
|
||||
@@ -29,11 +28,13 @@ public class DesktopPlatform extends Platform{
|
||||
public DesktopPlatform(String[] args){
|
||||
this.args = args;
|
||||
|
||||
Vars.testMobile = Array.with(args).contains("-testMobile", false);
|
||||
testMobile = Array.with(args).contains("-testMobile");
|
||||
|
||||
if(useDiscord){
|
||||
DiscordEventHandlers handlers = new DiscordEventHandlers();
|
||||
DiscordRPC.INSTANCE.Discord_Initialize(applicationId, handlers, true, "");
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(DiscordRPC.INSTANCE::Discord_Shutdown));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,11 +85,6 @@ public class DesktopPlatform extends Platform{
|
||||
DiscordRPC.INSTANCE.Discord_UpdatePresence(presence);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGameExit(){
|
||||
if(useDiscord) DiscordRPC.INSTANCE.Discord_Shutdown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUUID(){
|
||||
try{
|
||||
|
||||
Reference in New Issue
Block a user