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: Shining Block of Diamond recipe advancement triggered with first inventory change (Fabric/Quilt)
  • Loading branch information
cech12 committed May 11, 2024
1 parent ed31c4b commit 5d79f80
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 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
- Shining Block of Diamond recipe advancement triggered with first inventory change (Fabric/Quilt)

## [1.20.4-3.1.0.0] - 2024-04-27
### Added
- add Fabric (>=0.96.11+1.20.4) support (Fabric, Quilt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"conditions": {
"items": [
{
"item": "minecraft:diamond_block"
"items": [
"minecraft:diamond_block"
]
}
]
}
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.solarcooker
mod_version=3.1.0.0
mod_version=3.1.1.0
mod_id=solarcooker
mod_name=Solar Cooker
mod_author=Cech12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
import net.neoforged.fml.ModList;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
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;

@Mod(Constants.MOD_ID)
@Mod.EventBusSubscriber(modid= Constants.MOD_ID, bus= Mod.EventBusSubscriber.Bus.MOD)
Expand All @@ -45,6 +48,11 @@ public static void onClientRegister(FMLClientSetupEvent event) {
BlockEntityRenderers.register(Constants.SOLAR_COOKER_ENTITY_TYPE.get(), SolarCookerBlockEntityRenderer::new);
}

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

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

0 comments on commit 5d79f80

Please sign in to comment.