From f2ede87a5af2fccc9ce4ff1dc2fa20efccdeb846 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 5 Oct 2017 19:06:57 +0200 Subject: [PATCH 1/3] Fix the version comparison links in the changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba3678d..add5c89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,5 +31,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Initial versioned release. +[Unreleased]: https://github.com/minetest-mods/moreblocks/compare/v1.1.0...HEAD [1.1.0]: https://github.com/minetest-mods/moreblocks/compare/v1.0.0...v1.1.0 -[Unreleased]: https://github.com/minetest-mods/moreblocks/compare/v1.0.0...HEAD From 1fa4669ae81fbd236bdab8c3c2a5aef1918bbdfb Mon Sep 17 00:00:00 2001 From: fishyWET Date: Tue, 21 Nov 2017 06:09:27 +0800 Subject: [PATCH 2/3] Fix "replacement when inv is full" (#85) * fix replacement when inv is full. * Use allow_metadata_inventory_take instead --- circular_saw.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/circular_saw.lua b/circular_saw.lua index 6c3a974..c9d4525 100644 --- a/circular_saw.lua +++ b/circular_saw.lua @@ -299,6 +299,17 @@ function circular_saw.on_metadata_inventory_put( end end +function circular_saw.allow_metadata_inventory_take(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local input_stack = inv:get_stack(listname, index) + local player_inv = player:get_inventory() + if not player_inv:room_for_item("main", input_stack) then + return 0 + else return stack:get_count() + end +end + function circular_saw.on_metadata_inventory_take( pos, listname, index, stack, player) @@ -417,6 +428,7 @@ minetest.register_node("moreblocks:circular_saw", { allow_metadata_inventory_move = circular_saw.allow_metadata_inventory_move, -- Only input- and recycle-slot are intended as input slots: allow_metadata_inventory_put = circular_saw.allow_metadata_inventory_put, + allow_metadata_inventory_take = circular_saw.allow_metadata_inventory_take, -- Taking is allowed from all slots (even the internal microblock slot). Moving is forbidden. -- Putting something in is slightly more complicated than taking anything because we have to make sure it is of a suitable material: on_metadata_inventory_put = circular_saw.on_metadata_inventory_put, From 65e3afdd8b744eee7da3ec8233c278e8dcc23947 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 20 Nov 2017 23:13:16 +0100 Subject: [PATCH 3/3] Update changelog to add the recently-merged bug fix --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index add5c89..9e1b02b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed + +- The circular saw can no longer replace items from the player's inventory + when it is full. + ## [1.1.0] - 2017-10-04 ### Added