Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@

public class RegisterRemoteWorldSystems extends SingleStepLoadProcess {
private final Context context;
private final GameManifest gameManifest;

public RegisterRemoteWorldSystems(GameManifest gameManifest, Context context) {

Check warning on line 20 in engine/src/main/java/org/terasology/engine/core/modes/loadProcesses/RegisterRemoteWorldSystems.java

View check run for this annotation

Terasology Jenkins.io / PMD

UnusedFormalParameter

NORMAL: Avoid unused constructor parameters such as 'gameManifest'.
Raw output
Reports parameters of methods and constructors that are not referenced them in the method body. Parameters whose name starts with `ignored` or `unused` are filtered out. Removing unused formal parameters from public methods could cause a ripple effect through the code base. Hence, by default, this rule only considers private methods. To include non-private methods, set the `checkAll` property to `true`. <pre> <code> public class Foo { private void bar(String howdy) { // howdy is not used } } </code> </pre> <a href="https://docs.pmd-code.org/pmd-doc-7.7.0/pmd_rules_java_bestpractices.html#unusedformalparameter"> See PMD documentation. </a>
Comment thread
Cervator marked this conversation as resolved.
Outdated
this.context = context;
this.gameManifest = gameManifest;
}

@Override
Expand All @@ -30,11 +28,6 @@

@Override
public boolean step() {
// WorldGenerator worldGenerator = context.get(WorldGenerator.class);
// InjectionHelper.inject(worldGenerator, context);
// // setting the world seed will create the world builder
// worldGenerator.setWorldSeed(gameManifest.getSeed());

context.get(NetworkSystem.class).setRemoteWorldProvider(context.get(RemoteChunkProvider.class));

ComponentSystemManager componentSystemManager = context.get(ComponentSystemManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public class ConsoleImpl implements Console {
private final Context context;

@Inject
public ConsoleImpl(Context context) {
this.networkSystem = context.get(NetworkSystem.class);
public ConsoleImpl(NetworkSystem networkSystem, Context context) {
this.networkSystem = networkSystem;
this.context = context;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,14 @@ public <T extends ControlWidget> T addOverlay(ResourceUrn overlayUri, Class<T> e
}

private <T extends ControlWidget> void initialiseControlWidget(T overlay, ResourceUrn screenUri) {
ContextImpl timedContextForModulesWidgets = new ContextImpl(this.context);
ContextImpl widgetContext = new ContextImpl(this.context);

Module declaringModule = moduleEnvironment.get(screenUri.getModuleName());
TypeWidgetLibrary moduleLibrary =
new TypeWidgetLibraryImpl(typeWidgetFactoryRegistry, declaringModule, timedContextForModulesWidgets);
timedContextForModulesWidgets.put(TypeWidgetLibrary.class, moduleLibrary);
new TypeWidgetLibraryImpl(typeWidgetFactoryRegistry, declaringModule, widgetContext);
widgetContext.put(TypeWidgetLibrary.class, moduleLibrary);

InjectionHelper.inject(overlay, timedContextForModulesWidgets);
InjectionHelper.inject(overlay, widgetContext);

overlay.initialise();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.engine.context.Context;
import org.terasology.engine.core.module.ModuleManager;
import org.terasology.engine.registry.InjectionHelper;
import org.terasology.engine.world.block.BlockBuilderHelper;
Expand Down Expand Up @@ -34,8 +33,8 @@ public class BlockFamilyLibrary {

private ClassLibrary<BlockFamily> library;

public BlockFamilyLibrary(ModuleEnvironment moduleEnvironment, Context context) {
library = new DefaultModuleClassLibrary<>(() -> moduleEnvironment, context.get(ReflectFactory.class), context.get(CopyStrategyLibrary.class));
public BlockFamilyLibrary(ModuleEnvironment moduleEnvironment, ReflectFactory reflectFactory, CopyStrategyLibrary copyStrategyLibrary) {
library = new DefaultModuleClassLibrary<>(() -> moduleEnvironment, reflectFactory, copyStrategyLibrary);
for (Class<?> entry : moduleEnvironment.getTypesAnnotatedWith(RegisterBlockFamily.class)) {

if (!BlockFamily.class.isAssignableFrom(entry)) {
Expand All @@ -52,8 +51,8 @@ public BlockFamilyLibrary(ModuleEnvironment moduleEnvironment, Context context)
}

@Inject
public BlockFamilyLibrary(ModuleManager moduleManager, Context context) {
this(moduleManager.getEnvironment(), context);
public BlockFamilyLibrary(ModuleManager moduleManager, ReflectFactory reflectFactory, CopyStrategyLibrary copyStrategyLibrary) {
this(moduleManager.getEnvironment(), reflectFactory, copyStrategyLibrary);
}

/**
Expand Down
Loading