Cuberite Forum
Prevent flying blocks from landing in area - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Prevent flying blocks from landing in area (/thread-2526.html)



Prevent flying blocks from landing in area - Mathias - 09-29-2016

Is there currently any way to prevent flying blocks (from explosions) from landing in a specific area?


RE: Prevent flying blocks from landing in area - NiLSPACE - 09-29-2016

You could use the OnExploding hook to detect them.


RE: Prevent flying blocks from landing in area - Mathias - 09-29-2016

(09-29-2016, 01:22 AM)NiLSPACE Wrote: You could use the OnExploding hook to detect them.

Do you have any code examples? I know that I can disable flying/falling blocks completely, but I'd like to make them disappear only when hitting the ground in a protected area.


RE: Prevent flying blocks from landing in area - NiLSPACE - 09-30-2016

Something like this
function OnExploding(World, ExplosionSize, CanCauseFire, X, Y, Z, Source, SourceData)
	if (--[[Explosion is not in protected area]]) then
		return false;
	end
	return true
end



RE: Prevent flying blocks from landing in area - xoft - 09-30-2016

That wouldn't help if the explosion is close to a protected area - the shrapnel can fly into the protected area even from an outside explosion.

As far as I know there's currently no way to block it; file a (request) issue at github.