Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -418,7 +418,7 @@ public boolean step() {
if (!headless) {
loadProcesses.add(new RegisterInputSystem(context));
}
loadProcesses.add(new RegisterRemoteWorldSystems(gameManifest, context));
loadProcesses.add(new RegisterRemoteWorldSystems(context));
loadProcesses.add(new RegisterBlockFamilies(context));
loadProcesses.add(new ProcessBlockPrefabs(context));
loadProcesses.add(new InitialiseSystems(context));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.terasology.engine.core.ComponentSystemManager;
import org.terasology.engine.core.modes.SingleStepLoadProcess;
import org.terasology.engine.entitySystem.systems.ComponentSystem;
import org.terasology.engine.game.GameManifest;
import org.terasology.engine.network.NetworkSystem;
import org.terasology.engine.rendering.world.WorldRenderer;
import org.terasology.engine.world.BlockEntityRegistry;
Expand All @@ -16,11 +15,9 @@

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

public RegisterRemoteWorldSystems(GameManifest gameManifest, Context context) {
public RegisterRemoteWorldSystems(Context context) {
this.context = context;
this.gameManifest = gameManifest;
}

@Override
Expand All @@ -30,11 +27,6 @@ public String getMessage() {

@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