Make scaling exempt from protection
...similar to how loose items are. - They're emphemeral/air-like anyway - Prevent exploiting protection areas to make traps to capture players or their items.
This commit is contained in:
parent
c1588a7656
commit
b05180da02
@ -68,10 +68,9 @@ local function tryreplace(pos, newname, rootpos)
|
||||
return true
|
||||
end
|
||||
|
||||
function nodecore.scaling_apply(pointed, player)
|
||||
function nodecore.scaling_apply(pointed)
|
||||
if pointed.type ~= "node" or (not pointed.above) or (not pointed.under) then return end
|
||||
local pos = pointed.above
|
||||
if nodecore.protection_test(pos, player) then return end
|
||||
if pointed.under.y > pointed.above.y and issolid(pointed.under) then
|
||||
if tryreplace(pos, "ceil", pointed.under) then
|
||||
if tryreplace({x = pos.x, y = pos.y - 1, z = pos.z}, "hang", pos) then
|
||||
|
@ -75,7 +75,7 @@ hand.on_place = function(stack, player, pointed, ...)
|
||||
if def and def.on_scaling and def.on_scaling(stats,
|
||||
stack, player, pointed, node, ...) then return end
|
||||
|
||||
if nodecore.scaling_apply(pointed, player) then
|
||||
if nodecore.scaling_apply(pointed) then
|
||||
nodecore.player_discover(player, "craft:scaling dy="
|
||||
.. (pointed.under.y - pointed.above.y))
|
||||
return nodecore.scaling_particles(pointed.above, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user