Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: merge spawn preview screen into world pre generation screen #5118

Merged
merged 3 commits into from
Jul 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unused code
  • Loading branch information
skaldarnar committed Jul 18, 2023
commit b02c4734885c214ce465f79b4a1c979d2633b012
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

import com.google.common.collect.Lists;
import org.joml.Vector2i;
import org.slf4j.Logger;

Check warning on line 7 in engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/WorldPreGenerationScreen.java

View check run for this annotation

Terasology Jenkins.io / CheckStyle

UnusedImportsCheck

NORMAL: Unused import - org.slf4j.Logger.
Raw output
<p>Since Checkstyle 3.0</p><p> Checks for unused import statements. Checkstyle uses a simple but very reliable algorithm to report on unused import statements. An import statement is considered unused if: </p><ul><li> It is not referenced in the file. The algorithm does not support wild-card imports like <code>import java.io.*;</code>. Most IDE's provide very sophisticated checks for imports that handle wild-card imports. </li><li> It is a duplicate of another import. This is when a class is imported more than once. </li><li> The class imported is from the <code>java.lang</code> package. For example importing <code>java.lang.String</code>. </li><li> The class imported is from the same package. </li><li><b>Optionally:</b> it is referenced in Javadoc comments. This check is on by default, but it is considered bad practice to introduce a compile time dependency for documentation purposes only. As an example, the import <code>java.util.Date</code> would be considered referenced with the Javadoc comment <code>{@link Date}</code>. The alternative to avoid introducing a compile time dependency would be to write the Javadoc comment as <code>{@link java.util.Date}</code>. </li></ul><p> The main limitation of this check is handling the case where an imported type has the same name as a declaration, such as a member variable. </p><p> For example, in the following case the import <code>java.awt.Component</code> will not be flagged as unused: </p><pre><code> import java.awt.Component; class FooBar { private Object Component; // a bad practice in my opinion ... } </code></pre>
import org.slf4j.LoggerFactory;

Check warning on line 8 in engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/WorldPreGenerationScreen.java

View check run for this annotation

Terasology Jenkins.io / CheckStyle

UnusedImportsCheck

NORMAL: Unused import - org.slf4j.LoggerFactory.
Raw output
<p>Since Checkstyle 3.0</p><p> Checks for unused import statements. Checkstyle uses a simple but very reliable algorithm to report on unused import statements. An import statement is considered unused if: </p><ul><li> It is not referenced in the file. The algorithm does not support wild-card imports like <code>import java.io.*;</code>. Most IDE's provide very sophisticated checks for imports that handle wild-card imports. </li><li> It is a duplicate of another import. This is when a class is imported more than once. </li><li> The class imported is from the <code>java.lang</code> package. For example importing <code>java.lang.String</code>. </li><li> The class imported is from the same package. </li><li><b>Optionally:</b> it is referenced in Javadoc comments. This check is on by default, but it is considered bad practice to introduce a compile time dependency for documentation purposes only. As an example, the import <code>java.util.Date</code> would be considered referenced with the Javadoc comment <code>{@link Date}</code>. The alternative to avoid introducing a compile time dependency would be to write the Javadoc comment as <code>{@link java.util.Date}</code>. </li></ul><p> The main limitation of this check is handling the case where an imported type has the same name as a declaration, such as a member variable. </p><p> For example, in the following case the import <code>java.awt.Component</code> will not be flagged as unused: </p><pre><code> import java.awt.Component; class FooBar { private Object Component; // a bad practice in my opinion ... } </code></pre>
import org.terasology.engine.config.Config;
import org.terasology.engine.context.Context;
import org.terasology.engine.core.GameEngine;
import org.terasology.engine.core.SimpleUri;
import org.terasology.engine.core.modes.StateLoading;
import org.terasology.engine.core.module.ModuleManager;
import org.terasology.engine.game.GameManifest;
Expand All @@ -29,7 +28,6 @@
import org.terasology.engine.world.generator.internal.WorldGeneratorManager;
import org.terasology.engine.world.generator.plugin.TempWorldGeneratorPluginLibrary;
import org.terasology.engine.world.generator.plugin.WorldGeneratorPluginLibrary;
import org.terasology.engine.world.internal.WorldInfo;
import org.terasology.engine.world.zones.Zone;
import org.terasology.gestalt.assets.ResourceUrn;
import org.terasology.gestalt.module.ModuleEnvironment;
Expand Down Expand Up @@ -57,8 +55,6 @@

public static final ResourceUrn ASSET_URI = new ResourceUrn("engine:worldPreGenerationScreen");

private static final Logger logger = LoggerFactory.getLogger(WorldPreGenerationScreen.class);

@In
private ModuleManager moduleManager;

Expand Down Expand Up @@ -167,15 +163,6 @@
} else {
getManager().createScreen(MessagePopup.ASSET_URI, MessagePopup.class).setMessage("Error", "Can't create new game!");
}

SimpleUri uri;
WorldInfo worldInfo;
//TODO: if we don't do that here, where do we do it? or does the world not show up in the game manifest?
//gameManifest.addWorld(worldInfo);

gameEngine.changeState(new StateLoading(gameManifest, (universeWrapper.getLoadingAsServer())
? NetworkMode.DEDICATED_SERVER
: NetworkMode.NONE));
});

WidgetUtil.trySubscribe(this, "mainMenu", button -> {
Expand Down
Loading