Skip to content

Commit

Permalink
fix: spirit campfire cooking
Browse files Browse the repository at this point in the history
Closes #1097
  • Loading branch information
klikli-dev committed Mar 31, 2024
1 parent 77a0c8b commit faaad40
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/main/java/com/klikli_dev/occultism/Occultism.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

package com.klikli_dev.occultism;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
import com.klikli_dev.occultism.client.render.SelectedBlockRenderer;
import com.klikli_dev.occultism.client.render.ThirdEyeEffectRenderer;
import com.klikli_dev.occultism.common.DebugHelper;
Expand All @@ -40,6 +42,7 @@
import com.klikli_dev.theurgy.Theurgy;
import com.klikli_dev.theurgy.registry.ParticleRegistry;
import com.mojang.logging.LogUtils;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModLoadingContext;
Expand All @@ -53,6 +56,10 @@
import org.slf4j.Logger;
import software.bernie.geckolib.GeckoLib;

import java.util.HashSet;
import java.util.Set;
import java.util.stream.Stream;

@Mod(Occultism.MODID)
public class Occultism {
public static final String MODID = "occultism";
Expand Down Expand Up @@ -115,6 +122,13 @@ public Occultism(IEventBus modEventBus) {
private void commonSetup(final FMLCommonSetupEvent event) {
PageLoaders.onCommonSetup(event);

event.enqueueWork(() -> {
BlockEntityType.CAMPFIRE.validBlocks = Stream.concat(
BlockEntityType.CAMPFIRE.validBlocks.stream(),
Stream.of(OccultismBlocks.SPIRIT_CAMPFIRE.get())
).collect(ImmutableSet.toImmutableSet());
});

//Register entity attributes on single thread

LOGGER.info("Common setup complete.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ public void tick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSou
.requiresCorrectToolForDrops().strength(3.5F).sound(SoundType.LANTERN)
.lightLevel((state) -> 10).noOcclusion()));

//See Occultism#commonSetup for extending the campfire blockentity type to accept our spirit campfire
public static final DeferredBlock<Block> SPIRIT_CAMPFIRE = register("spirit_campfire",
() -> new CampfireBlock(false, 0, BlockBehaviour.Properties.of()
.mapColor(MapColor.PODZOL)
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/META-INF/accesstransformer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ public net.minecraft.client.gui.GuiGraphics flushIfUnmanaged()V # flushIfUnmanag
public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V # setLevel
public net.minecraft.world.entity.LivingEntity getCurrentSwingDuration()I # getCurrentSwingDuration
public-f net.minecraft.world.level.block.TorchBlock flameParticle
public net.minecraft.world.item.crafting.AbstractCookingRecipe ingredient
public net.minecraft.world.item.crafting.AbstractCookingRecipe ingredient
public-f net.minecraft.world.level.block.entity.BlockEntityType validBlocks

0 comments on commit faaad40

Please sign in to comment.