Skip to content

Commit

Permalink
Fix compacting drawers not retaining items when broken
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiDragon committed Jul 10, 2024
1 parent 515b62b commit 7ef1141
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog/3.0.2+1.21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fixed compacting drawers not retaining items when broken
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11

mod_version=3.0.1
mod_version=3.0.2
maven_group=io.github.mattidragon
archives_base_name=ExtendedDrawers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{
"function": "minecraft:copy_components",
"include": [
"extended_drawers:drawer_contents"
"extended_drawers:drawer_contents",
"extended_drawers:compacting_drawer_contents"
],
"source": "block_entity"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{
"function": "minecraft:copy_components",
"include": [
"extended_drawers:drawer_contents"
"extended_drawers:drawer_contents",
"extended_drawers:compacting_drawer_contents"
],
"source": "block_entity"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{
"function": "minecraft:copy_components",
"include": [
"extended_drawers:drawer_contents"
"extended_drawers:drawer_contents",
"extended_drawers:compacting_drawer_contents"
],
"source": "block_entity"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{
"function": "minecraft:copy_components",
"include": [
"extended_drawers:drawer_contents"
"extended_drawers:drawer_contents",
"extended_drawers:compacting_drawer_contents"
],
"source": "block_entity"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ private LootTable.Builder drawerDrops(Block drop) {
return LootTable.builder().pool(addSurvivesExplosionCondition(drop, LootPool.builder().rolls(ConstantLootNumberProvider.create(1.0f))
.with(ItemEntry.builder(drop)
.apply(CopyComponentsLootFunction.builder(CopyComponentsLootFunction.Source.BLOCK_ENTITY)
.include(ModDataComponents.DRAWER_CONTENTS)))));
.include(ModDataComponents.DRAWER_CONTENTS)
.include(ModDataComponents.COMPACTING_DRAWER_CONTENTS)))));
}
}

0 comments on commit 7ef1141

Please sign in to comment.