mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Removed stateless-related stuff from BlockManager
This commit is contained in:
parent
98fc704139
commit
1e5dc8d870
@ -20,8 +20,6 @@ public class BlockManager {
|
|||||||
// Namespace -> handler supplier
|
// Namespace -> handler supplier
|
||||||
private final Map<String, Supplier<BlockHandler>> blockHandlerMap = new ConcurrentHashMap<>();
|
private final Map<String, Supplier<BlockHandler>> blockHandlerMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private final Map<String, BlockHandler> statelessCache = new ConcurrentHashMap<>();
|
|
||||||
|
|
||||||
// block id -> block placement rule
|
// block id -> block placement rule
|
||||||
private final Int2ObjectMap<BlockPlacementRule> placementRuleMap = new Int2ObjectOpenHashMap<>();
|
private final Int2ObjectMap<BlockPlacementRule> placementRuleMap = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
@ -29,11 +27,6 @@ public class BlockManager {
|
|||||||
blockHandlerMap.put(namespace, handlerSupplier);
|
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) {
|
public @Nullable BlockHandler getHandler(@NotNull String namespace) {
|
||||||
final var handler = blockHandlerMap.get(namespace);
|
final var handler = blockHandlerMap.get(namespace);
|
||||||
return handler != null ? handler.get() : null;
|
return handler != null ? handler.get() : null;
|
||||||
|
Loading…
Reference in New Issue
Block a user