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 591b35b commit d75a4bb
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 @@ -37,6 +39,7 @@
import com.klikli_dev.occultism.network.OccultismPackets;
import com.klikli_dev.occultism.registry.*;
import com.mojang.logging.LogUtils;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.EntityAttributeCreationEvent;
import net.minecraftforge.eventbus.api.IEventBus;
Expand All @@ -54,6 +57,10 @@
import top.theillusivec4.curios.api.SlotTypeMessage;
import top.theillusivec4.curios.api.SlotTypePreset;

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 @@ -116,6 +123,13 @@ private void commonSetup(final FMLCommonSetupEvent event) {

event.enqueueWork(OccultismItems::registerCompostables);

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

PageLoaders.onCommonSetup(event);

//Register entity attributes on single thread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,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 RegistryObject<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 @@ -11,4 +11,5 @@ public net.minecraft.world.item.crafting.Ingredient$TagValue f_43959_ # tag
public net.minecraft.client.gui.GuiGraphics m_286081_()V # flushIfUnmanaged
public net.minecraft.world.entity.Entity m_284535_(Lnet/minecraft/world/level/Level;)V # setLevel
public net.minecraft.world.entity.LivingEntity m_21304_()I # getCurrentSwingDuration
public net.minecraft.world.item.crafting.AbstractCookingRecipe f_43729_ # ingredient
public net.minecraft.world.item.crafting.AbstractCookingRecipe f_43729_ # ingredient
public-f net.minecraft.world.level.block.entity.BlockEntityType f_58915_ # validBlocks

0 comments on commit d75a4bb

Please sign in to comment.