Skip to content

Commit

Permalink
Make IBlockAccess more customizable
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauriichan committed Nov 19, 2021
1 parent 17e7e52 commit 3c62337
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion legacy-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.sourcewriters.spigot.rwg</groupId>
<artifactId>legacy-api</artifactId>
<version>3.0.0</version>
<version>3.0.1</version>

<distributionManagement>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Objects;
import java.util.Optional;
import java.util.function.BiFunction;

import org.bukkit.Bukkit;
import org.bukkit.Material;
Expand Down Expand Up @@ -35,17 +36,20 @@ public class BlockAccessImpl implements IBlockAccess {
private final IConversionAccess access;
private final IDataFixHandler fixHandler;

private final BlockDataLoaderManagerImpl loaderManager;
private final BlockDataParserManagerImpl parserManager;
private final BlockDataPlacerManagerImpl placerManager;
private final IBlockDataLoaderManager loaderManager;
private final IBlockDataParserManager parserManager;
private final IBlockDataPlacerManager placerManager;

public BlockAccessImpl(final ILogger logger, final IConversionAccess access, final IDataFixHandler fixHandler) {
public BlockAccessImpl(final ILogger logger, final IConversionAccess access, final IDataFixHandler fixHandler,
final BiFunction<ILogger, IBlockAccess, IBlockDataLoaderManager> buildLoader,
final BiFunction<ILogger, IBlockAccess, IBlockDataParserManager> buildParser,
final BiFunction<ILogger, IBlockAccess, IBlockDataPlacerManager> buildPlacer) {
this.logger = logger;
this.access = access;
this.fixHandler = fixHandler;
this.loaderManager = new BlockDataLoaderManagerImpl(logger, this);
this.parserManager = new BlockDataParserManagerImpl(logger, this);
this.placerManager = new BlockDataPlacerManagerImpl(logger);
this.loaderManager = buildLoader.apply(logger, this);
this.parserManager = buildParser.apply(logger, this);
this.placerManager = buildPlacer.apply(logger, this);
}

@NonNull
Expand Down

0 comments on commit 3c62337

Please sign in to comment.