File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 4545 x_offset = 0.5
4646end
4747
48+ drawers .shared = minetest .settings :get_bool (" drawers.shared" , true )
49+
4850local drawers_formspec_data = {}
4951local drawer_formspec = " size[9,7]" ..
5052 " list[context;upgrades;2,0.5;5,1;]" ..
@@ -58,6 +60,10 @@ local drawer_formspec = "size[9,7]" ..
5860 drawers .get_upgrade_slots_bg (2 , 0.5 )
5961
6062drawers .get_drawer_formspec = function (pos )
63+ if not drawers .shared then
64+ return drawers .drawer_formspec
65+ end
66+
6167 local shared
6268 if minetest .get_meta (pos ):get_string (" shared" ) == " true" then
6369 shared = " true"
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ core.register_entity("drawers:visual", {
152152
153153 on_rightclick = function (self , clicker )
154154 if core .is_protected (self .drawer_pos , clicker :get_player_name ()) and
155- minetest .get_meta (self .drawer_pos ):get_string (" shared" ) ~= " true" then
155+ ( not drawers . shared or minetest .get_meta (self .drawer_pos ):get_string (" shared" ) ~= " true" ) then
156156 core .record_protection_violation (self .drawer_pos , clicker :get_player_name ())
157157 return
158158 end
@@ -216,7 +216,7 @@ core.register_entity("drawers:visual", {
216216 end
217217 local add_stack = not puncher :get_player_control ().sneak
218218 if core .is_protected (self .drawer_pos , puncher :get_player_name ()) and
219- minetest .get_meta (self .drawer_pos ):get_string (" shared" ) ~= " true" then
219+ ( not drawers . shared or minetest .get_meta (self .drawer_pos ):get_string (" shared" ) ~= " true" ) then
220220 core .record_protection_violation (self .drawer_pos , puncher :get_player_name ())
221221 return
222222 end
Original file line number Diff line number Diff line change 1+ drawers.shared (Enable sharing drawers) bool true
You can’t perform that action at this time.
0 commit comments