Skip to content

Commit

Permalink
- added: registering ItemHandlers to be more compatible with other mo…
Browse files Browse the repository at this point in the history
…ds (NeoForge)

- fixed: Brick Furnace recipe advancement triggered with first inventory change (Fabric/Quilt)
  • Loading branch information
cech12 committed May 11, 2024
1 parent 77e1582 commit 2b1af7b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/).

## [1.20.4-3.1.1.0] - 2024-05-11
### Added
- registering ItemHandlers to be more compatible with other mods (NeoForge)

### Fixed
- Brick Furnace recipe advancement triggered with first inventory change (Fabric/Quilt)

## [1.20.4-3.1.0.1] - 2024-04-27
### Fixed
- JEI plugin was not loaded in Fabric/Quilt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "minecraft:brick"
"items": [
"minecraft:brick"
]
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Project
group=de.cech12.brickfurnace
mod_version=3.1.0.1
mod_version=3.1.1.0
mod_id=brickfurnace
mod_name=Brick Furnace
mod_author=Cech12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
import de.cech12.brickfurnace.init.ModItems;
import de.cech12.brickfurnace.init.ModRecipeTypes;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.item.CreativeModeTabs;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModList;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.capabilities.Capabilities;
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
import net.neoforged.neoforge.items.wrapper.SidedInvWrapper;
import net.neoforged.neoforge.registries.RegisterEvent;

@SuppressWarnings("unused")
@Mod(Constants.MOD_ID)
@Mod.EventBusSubscriber(modid= Constants.MOD_ID, bus= Mod.EventBusSubscriber.Bus.MOD)
public class BrickFurnaceMod {
Expand All @@ -41,6 +44,13 @@ public static void register(RegisterEvent event) {
}
}

@SubscribeEvent
public static void registerCapabilities(RegisterCapabilitiesEvent event) {
event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, Constants.BRICK_FURNACE_BLOCK_ENTITY_TYPE.get(), SidedInvWrapper::new);
event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, Constants.BRICK_BLAST_FURNACE_BLOCK_ENTITY_TYPE.get(), SidedInvWrapper::new);
event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, Constants.BRICK_SMOKER_BLOCK_ENTITY_TYPE.get(), SidedInvWrapper::new);
}

@SubscribeEvent
public static void addItemsToTabs(BuildCreativeModeTabContentsEvent event) {
if (event.getTabKey() == CreativeModeTabs.FUNCTIONAL_BLOCKS) {
Expand Down

0 comments on commit 2b1af7b

Please sign in to comment.