Jump to content

I made a campfire block but it doesn't work - 1.20.6


Red4X

Recommended Posts

Posted (edited)

I made it, but, it emits those lava particles not the smoke particles, my custom fire texture I made is rendered without transparency, no food shows up when placed on it, but it's there, trust me, and also I can't reignite it. I can't find a reason whyy

Here's my ModBlocks class:

package net.Blue4X.Revive;

import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.CampfireBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import java.util.function.Supplier;
import java.util.function.ToIntFunction;

public class ModBlocks {

    public static final DeferredRegister<Block> BLOCKS =
            DeferredRegister.create(ForgeRegistries.BLOCKS, TheRevival.MODID);

    public static final RegistryObject<Block> BLOCK_CAMPFIRE = registerBlock(
            () -> new CampfireBlock(true, 4, BlockBehaviour.Properties.ofFullCopy(Blocks.SOUL_CAMPFIRE)
                    .ignitedByLava()
                    .noOcclusion()
                    .lightLevel(litBlockEmission(15))
            )
    );

    private static <T extends Block> RegistryObject<T> registerBlock(Supplier<T> block) {
        RegistryObject<T> toReturn = BLOCKS.register("block_campfire", block);
        registerBlockItem(toReturn);
        return toReturn;
    }

    private static <T extends Block> void registerBlockItem(RegistryObject<T> block) {
        ModItems.ITEMS.register("block_campfire", () -> new BlockItem(block.get(), new Item.Properties()));
    }

    public static void register(IEventBus EventBus) {
        BLOCKS.register(EventBus);
    }

    private static ToIntFunction<BlockState> litBlockEmission(int pLightValue) {
        return p_50763_ -> p_50763_.getValue(BlockStateProperties.LIT) ? pLightValue : 0;
    }
}

Minecraft 1.20.6

Forge 50.0.5

Edited by Red4X
Link to comment
Share on other sites

  • Red4X changed the title to I made a campfire block but it doesn't work - 1.20.6

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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