Removed stateless-related stuff from BlockManager

This commit is contained in:
Шандуренко Константин Владимирович 2021-09-10 18:42:21 +03:00
parent 98fc704139
commit 1e5dc8d870

View File

@ -20,8 +20,6 @@ public class BlockManager {
// Namespace -> handler supplier
private final Map<String, Supplier<BlockHandler>> blockHandlerMap = new ConcurrentHashMap<>();
private final Map<String, BlockHandler> statelessCache = new ConcurrentHashMap<>();
// block id -> block placement rule
private final Int2ObjectMap<BlockPlacementRule> placementRuleMap = new Int2ObjectOpenHashMap<>();
@ -29,11 +27,6 @@ public class BlockManager {
blockHandlerMap.put(namespace, handlerSupplier);
}
public void registerStatelessHandler(@NotNull String namespace, @NotNull BlockHandler handler) {
statelessCache.put(namespace, handler);
registerHandler(namespace, () -> statelessCache.get(namespace));
}
public @Nullable BlockHandler getHandler(@NotNull String namespace) {
final var handler = blockHandlerMap.get(namespace);
return handler != null ? handler.get() : null;