diff --git a/src/main/java/net/neoforged/neoforge/registries/DeferredRegister.java b/src/main/java/net/neoforged/neoforge/registries/DeferredRegister.java index a4b4133417..f839b4c3cb 100644 --- a/src/main/java/net/neoforged/neoforge/registries/DeferredRegister.java +++ b/src/main/java/net/neoforged/neoforge/registries/DeferredRegister.java @@ -424,24 +424,56 @@ public DeferredBlock register(String name, Supplier DeferredBlock registerBlock(String name, Function func, BlockBehaviour.Properties props) { return this.register(name, key -> func.apply(props.setId(ResourceKey.create(Registries.BLOCK, key)))); } /** - * Adds a new simple {@link Block} to the list of entries to be registered and returns a {@link DeferredHolder} that will be populated with the created block automatically. + * Adds a new block to the list of entries to be registered and returns a {@link DeferredHolder} that will be populated with the created block automatically. + * This method uses the default {@link BlockBehaviour.Properties}. + * + * @param name The new block's name. It will automatically have the {@linkplain #getNamespace() namespace} prefixed. + * @param func A factory for the new block. The factory should not cache the created block. + * @return A {@link DeferredHolder} that will track updates from the registry for this block. + * @see #registerBlock(String, Function, BlockBehaviour.Properties) + * @see #registerSimpleBlock(String, BlockBehaviour.Properties) + * @see #registerSimpleBlock(String) + */ + public DeferredBlock registerBlock(String name, Function func) { + return this.registerBlock(name, func, BlockBehaviour.Properties.of()); + } + + /** + * Adds a new simple {@link Block} with the given {@link BlockBehaviour.Properties properties} to the list of entries to be registered and returns a {@link DeferredHolder} that will be populated with the created block automatically. * * @param name The new block's name. It will automatically have the {@linkplain #getNamespace() namespace} prefixed. * @param props The properties for the created block. * @return A {@link DeferredHolder} that will track updates from the registry for this block. * @see #registerBlock(String, Function, BlockBehaviour.Properties) + * @see #registerBlock(String, Function) + * @see #registerSimpleBlock(String) */ public DeferredBlock registerSimpleBlock(String name, BlockBehaviour.Properties props) { return this.registerBlock(name, Block::new, props); } + /** + * Adds a new simple {@link Block} with the default {@link BlockBehaviour.Properties properties} to the list of entries to be registered and returns a {@link DeferredHolder} that will be populated with the created block automatically. + * + * @param name The new block's name. It will automatically have the {@linkplain #getNamespace() namespace} prefixed. + * @return A {@link DeferredHolder} that will track updates from the registry for this block. + * @see #registerBlock(String, Function, BlockBehaviour.Properties) + * @see #registerBlock(String, Function) + * @see #registerSimpleBlock(String, BlockBehaviour.Properties) + */ + public DeferredBlock registerSimpleBlock(String name) { + return this.registerSimpleBlock(name, BlockBehaviour.Properties.of()); + } + @Override protected DeferredBlock createHolder(ResourceKey> registryKey, ResourceLocation key) { return DeferredBlock.createBlock(ResourceKey.create(registryKey, key));