Of course there is. -_-Element wrote:is there a way to put a bedrock layer in the air an underground...it will be like a limit on how far you can go up an down
I don't know, but it certainly is possible. To quote my original signature "If you want something done, do it yourself."Element wrote:then how...do i do -1000, 1000
Wuzzy wrote:Element wrote:the unuke(tnt) mod can destroy bedrock...
This is both a bug in unuke and bedrock.Element wrote:is there a way you can make it so it cant
Yes, by fixing the bugs. I fixed one of them. :-)
Now to the bugs:
unuke bug: A nuke destroys ANY node, no matter what it is, completely ignoring the properties of the node. This is a bit rude. This is also true for the TNT mod, for the same reasons.
bedrock bug: It does not use on_blast. By the way, bedrock’s code is kinda dated, I am surprised that you made the mod work at all.
On_blast is a neat little function defined in the modding API as a node callback if an explosion is close to a node. The engine does not use this function yet, but it is intended to be called by mods that cause explosions for every node that is affected by the explosion.
on_blast syntax: on_blast(pos, intensity)
pos = position
intensity = intensity of explosion. The intensity of a regular TNT is defined to be 1.
The trick is, on_blast will only be called if it’s not nil. If it’s nil, a standard behaviour will be done to the mod (removing it, for example). Well, at least that’s the idea how the mods handle on_blast. Mods still may screw this up.
Also there were no groups back in the days where this olden mod had been created. For nodes like bedrocks, there is now the group “immortal”. :-) Now you can dig forever on a bedrock and it will never break. It may be still possible to remove bedrock with special tools like the admin pickaxe, or stuff like that.
Here is a fresh version of Bedrock:
init.lua:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local bedrock = {}
bedrock.layer = -30912 -- determined as appropriate by experiment
bedrock.node = {name = "bedrock:bedrock"}
minetest.register_on_generated(function(minp, maxp)
if maxp.y >= bedrock.layer and minp.y <= bedrock.layer then
local p = {y = bedrock.layer}
local n = bedrock.node
for x = minp.x,maxp.x do
for z = minp.z,maxp.z do
p.x=x; p.z=z
minetest.env:set_node(p, n)
end
end
end
end)
minetest.register_node("bedrock:bedrock", {
description = "Bedrock",
tiles = {"bedrock.png"},
groups = {immortal=1, stone=1, not_in_creative_inventory=1},
on_blast = function() end,
})
(the other files keep unchanged)
Above code was tested with 0.4.7. It’s usable again. :-)
I call this version of bedrock “20130924”.
Funnily, the lowest possible Y coordinate has changed over the years.
See the trick? On_blast here is defined as a function which does literally nothing, not caring about the position and the explosion intensity. Because that’s exactly what we want: No matter how big the explosion, bedrock shall stay bedrock forever.
Note that the unuke mod and the TNT mod both do not respect on_blast yet. So these mods have to be changed, too, so that bedrock does not get destroyed by explosions. I should start complaining in their respective threads soon. ;-)
For the future I would like the bedrock mod to:
- have sounds for bedrock (preferably not the default sounds! ;-))
- use LuaVoxelManip instead of set_node for better performance (I do not understand LuaVoxelManip yet :-(. )
My changes fall under the WTFPL, of course.
Element wrote:do i replace this init with the old one
Element wrote:i have had this mod for sometime and all of a sudden i cant build under the bedrock layer...do i have to change something in the programing
Element wrote:then how...do i do -1000, 1000
--[[ A simple bedrock mod by jn
-- Calinou made the texture, I brightened it up
-- This program is free software. It comes without any warranty, to
-- the extent permitted by applicable law. You can redistribute it
-- and/or modify it under the terms of the Do What The Fuck You Want
-- To Public License, Version 2, as published by Sam Hocevar. See
-- http://sam.zoy.org/wtfpl/COPYING or the file COPYING for more details.
--do return end -- uncomment to disable bedrock
local bedrock = {}
bedrock.layer = -1000 -- determined as appropriate by experiment
bedrock.node = {name = "bedrock:bedrock"}
--bedrock.digprop = minetest.digprop_constanttime(1000000)
bedrock.digprop = {diggability = "not"}
minetest.register_on_generated(function(minp, maxp)
if maxp.y >= bedrock.layer and minp.y <= bedrock.layer then
local p = {y = bedrock.layer}
local n = bedrock.node
for x = minp.x,maxp.x do
for z = minp.z,maxp.z do
p.x=x; p.z=z
minetest.env:add_node(p, n)
end
end
end
end)
minetest.register_node("bedrock:bedrock", {
description = "Bedrock",
tile_images = {"bedrock.png"},
material = bedrock.digprop
})
--]]
local bedrock = {}
bedrock.layer = -1000 -- determined as appropriate by experiment
bedrock.node = {name = "bedrock:bedrock"}
minetest.register_on_generated(function(minp, maxp)
if maxp.y >= bedrock.layer and minp.y <= bedrock.layer then
local p = {y = bedrock.layer}
local n = bedrock.node
for x = minp.x,maxp.x do
for z = minp.z,maxp.z do
p.x=x; p.z=z
minetest.env:set_node(p, n)
end
end
end
end)
minetest.register_node("bedrock:bedrock", {
description = "Bedrock",
tiles = {"bedrock.png"},
groups = {immortal=1, stone=1, not_in_creative_inventory=1},
on_blast = function() end,
})
Element wrote:is there anything wrong in here that might be stopping me
leetelate wrote:wait...did you say "..i cant build or destroy anything at or below the bedrock layer,"
lol i guess bedrock is now really bedrock - no you cannot build or destroy anything below or at the bedrock layer - bedrock cannot be dug - follws the mc pattern, but idk about the texture...too um...idk, just isn't recognizable as bedrock - i wonder what bedrock look like irl...
Element wrote:my iron, mese, and uranium tnt can still blow the bedrock up
Wuzzy wrote:Note that the unuke mod and the TNT mod both do not respect on_blast yet. So these mods have to be changed, too, so that bedrock does not get destroyed by explosions. I should start complaining in their respective threads soon. ;-)
Element wrote:how do i make it so i can build under the layer again
Element wrote:ok...yes i did use fly and noclip and then i used a tnt to make a cave...i can put stuff on the layer at -999 nodes but not at -1000 nodes and below...the blocks under the layer are normal stone, minerals, lava...i am in creative...and this is the second world i have had this problem
Element wrote:2. what do you mean buy build
Users browsing this forum: No registered users and 34 guests