Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I'm looking to make a custom torch (well two but anyway). I've been looking at vanilla and think I'm almost there, but just having some issues with registration.

In particular where I'm calling fromBlock for the two TORCH_ITEMS below cannot be resolved:

    public static final RegistryObject<Block> LIGHTSTONE_TORCH = BLOCKS.register("lightstone_torch", () -> new TorchBlock(BlockBehaviour.Properties.of(Material.DECORATION)
            .noCollission().instabreak().lightLevel((p_50886_) -> {return 10;})
            .sound(SoundType.GLASS), ParticleTypes.FLAME));
    public static final RegistryObject<Block> WALL_LIGHTSTONE_TORCH = BLOCKS.register ("wall_lightstone_torch", () -> new WallTorchBlock((BlockBehaviour.Properties.of(Material.DECORATION)
            .noCollission().instabreak().lightLevel((p_152607_) -> {return 10;})
            .sound(SoundType.GLASS).dropsLike(Registration.LIGHTSTONE_TORCH.get())), ParticleTypes.FLAME));
    public static final RegistryObject<Item> LIGHTSTONE_TORCH_ITEM = new StandingAndWallBlockItem.fromBlock(LIGHTSTONE_TORCH).ItemProperties();
    public static final RegistryObject<Block> LIGHTSTONE_REFINED_TORCH = BLOCKS.register("lightstone_refined_torch", () -> new TorchBlock(BlockBehaviour.Properties.of(Material.DECORATION)
            .noCollission().instabreak().lightLevel((p_50886_) -> {return 15;})
            .sound(SoundType.GLASS), ParticleTypes.FLAME));
    public static final RegistryObject<Block> WALL_LIGHTSTONE_REFINED_TORCH = BLOCKS.register ("wall_lightstone_refined_torch", () -> new WallTorchBlock((BlockBehaviour.Properties.of(Material.DECORATION)
            .noCollission().instabreak().lightLevel((p_152607_) -> {return 15;})
            .sound(SoundType.GLASS).dropsLike(Registration.LIGHTSTONE_REFINED_TORCH.get())), ParticleTypes.FLAME));
    public static final RegistryObject<Item> LIGHTSTONE_REFINED_TORCH_ITEM = new StandingAndWallBlockItem.fromBlock(LIGHTSTONE_REFINED_TORCH).ItemProperties();

Rest of my datagen is here should it be needed - https://github.com/Mattah12/Kanohi_Craft2022/tree/master/src/main/java/com/Mattah12/kanohicraft/datagen

Edited by Mattah12

19 minutes ago, Mattah12 said:
new StandingAndWallBlockItem.fromBlock(LIGHTSTONE_TORCH).ItemProperties();

this is completely wrong

you need to do it like you done it with Blocks, create a DeferredRegister for Items then call DeferredRegister#register
inside the supplier you need to create a new instance of StandingAndWallBlockItem
ย 

  • Author

Ah OK, so more like this?

public static final RegistryObject<StandingAndWallBlockItem> LIGHTSTONE_TORCH_ITEM = ITEMS.register("lightstone_torch_item", () -> new StandingAndWallBlockItem(Registration.LIGHTSTONE_TORCH.get(), Registration.WALL_LIGHTSTONE_TORCH.get(), new Item.Properties()));

ย 

  • Author
8 minutes ago, Luis_ST said:

yes that should work

i would recommend you to set a CreativeModeTab but this is optional

Funilly enough I was just doing that as it was causing issues with my loot tables.

I think I also have more work to do on the WALL blocks but thats tomorrows problem.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.