Update Upstream

9516002 Register platforms and commands in a more proper way (1766)
This commit is contained in:
NotMyFault
2021-06-05 10:27:38 +02:00
parent f139088b6e
commit d1af6c38e7
21 changed files with 858 additions and 81 deletions

View File

@ -30,12 +30,13 @@ class BlockMapTest {
static void setupFakePlatform() {
when(MOCKED_PLATFORM.getRegistries()).thenReturn(new BundledRegistries() {
});
when(MOCKED_PLATFORM.getCapabilities()).thenReturn(ImmutableMap.of(
Capability.WORLD_EDITING, Preference.PREFERRED,
Capability.GAME_HOOKS, Preference.PREFERRED
));
when(MOCKED_PLATFORM.getCapabilities()).thenReturn(
Stream.of(Capability.values())
.collect(Collectors.toMap(Function.identity(), __ -> Preference.NORMAL))
);
PlatformManager platformManager = WorldEdit.getInstance().getPlatformManager();
platformManager.register(MOCKED_PLATFORM);
WorldEdit.getInstance().getEventBus().post(new PlatformsRegisteredEvent());
registerBlock("minecraft:air");
registerBlock("minecraft:oak_wood");