-
Notifications
You must be signed in to change notification settings - Fork 12
fixes for deployer and node breaker #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
name = pipeworks | ||
depends = fakelib, sbz_base, mesecons_mvps, unifieddyes | ||
depends = fakelib, creative, sbz_base, mesecons_mvps, unifieddyes |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,7 +227,8 @@ pipeworks.register_wielder({ | |
local stack = fakeplayer:get_wielded_item() | ||
local old_stack = ItemStack(stack) | ||
local item_def = minetest.registered_items[stack:get_name()] | ||
if item_def.on_use then | ||
-- use only items that's allowed to be used | ||
if item_def.on_use and core.get_item_group(stack:get_name(), 'nb_nouse') == 0 then | ||
stack = item_def.on_use(stack, fakeplayer, pointed) or stack | ||
fakeplayer:set_wielded_item(stack) | ||
else | ||
|
@@ -293,6 +294,9 @@ pipeworks.register_wielder({ | |
local def = minetest.registered_items[stack:get_name()] | ||
if def and def.on_place then | ||
local new_stack, placed_pos = def.on_place(stack, fakeplayer, pointed) | ||
if new_stack and core.is_creative_enabled(fakeplayer:get_player_name()) then | ||
new_stack:take_item() -- undoes creative's auto-add | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not good, what if you are using a deployer with a tool The replacer tool will vanish BTW: feel free to modify the creative mod, it's heavily modified in sbz anyway (feel free to modify any mod, just state that it has been modified in sbz) |
||
end | ||
fakeplayer:set_wielded_item(new_stack or stack) | ||
-- minetest.item_place_node doesn't play sound to the placer | ||
local sound = placed_pos and def.sounds and def.sounds.place | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really really small nitpick: it would be better named "nb_no_use" :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im just following convention of
nb_nodig
. i'll change that too i guessThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure