Merge branch 'master' into Patch-Listring
This commit is contained in:
commit
61c1a4552e
|
@ -7,9 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Listring add for circular saw.
|
- Listring add for circular saw.
|
||||||
|
- The circular saw can no longer replace items from the player's inventory
|
||||||
|
when it is full.
|
||||||
|
|
||||||
## [1.1.0] - 2017-10-04
|
## [1.1.0] - 2017-10-04
|
||||||
|
|
||||||
|
@ -35,5 +35,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||||
|
|
||||||
- Initial versioned release.
|
- 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
|
[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
|
|
||||||
|
|
|
@ -299,6 +299,17 @@ function circular_saw.on_metadata_inventory_put(
|
||||||
end
|
end
|
||||||
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(
|
function circular_saw.on_metadata_inventory_take(
|
||||||
pos, listname, index, stack, player)
|
pos, listname, index, stack, player)
|
||||||
|
|
||||||
|
@ -427,6 +438,7 @@ minetest.register_node("moreblocks:circular_saw", {
|
||||||
allow_metadata_inventory_move = circular_saw.allow_metadata_inventory_move,
|
allow_metadata_inventory_move = circular_saw.allow_metadata_inventory_move,
|
||||||
-- Only input- and recycle-slot are intended as input slots:
|
-- Only input- and recycle-slot are intended as input slots:
|
||||||
allow_metadata_inventory_put = circular_saw.allow_metadata_inventory_put,
|
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.
|
-- 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:
|
-- 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,
|
on_metadata_inventory_put = circular_saw.on_metadata_inventory_put,
|
||||||
|
|
Loading…
Reference in New Issue