[Mod] A simple bedrock mod [20120316] [bedrock]

jn
Member
 
Posts: 106
Joined: Tue Jan 03, 2012 19:15

[Mod] A simple bedrock mod [20120316] [bedrock]

by jn » Sun Mar 11, 2012 22:06

As I felt it was lacking, I made a simple mod to add "bedrock" to minetest, a stone that you can't destroy.

Image

You can get it here: version history zip tar.gz (the license is WTFPL)


Notes:
- Using this mod together with mods like Moreores or Gemstones may lead to ores being placed at the bedrock layer. If this happens, please tell me if putting the name of the other mod into depends.txt helps.
- I will not announce new versions when I release them, but you can always find the version history (with previous versions) above.
Last edited by jn on Sat Mar 17, 2012 10:18, edited 1 time in total.
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Sun Mar 11, 2012 22:11

Wouldn't you be able to dig through this in 1000000 seconds? :P

This would be pretty useful for making impenetrable sections of the map if there was a fly mode privilege that prevented one from just flying past it.

Otherwise it's a nice way to show the end of the map.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

jn
Member
 
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Sun Mar 11, 2012 22:17

Temperest wrote:Wouldn't you be able to dig through this in 1000000 seconds? :P

Have fun spending two weeks pressing your mouse button :P

Temperest wrote:This would be pretty useful for making impenetrable sections of the map if there was a fly mode privilege that prevented one from just flying past it.

Indeed.

Temperest wrote:Otherwise it's a nice way to show the end of the map.

I'm glad you like it :)
 

User avatar
sdzen
Member
 
Posts: 1170
Joined: Fri Aug 05, 2011 22:33

by sdzen » Sun Mar 11, 2012 22:22

what if my pick has a basetime of 0?
[h]Zen S.D.[/h] The next generation of tranquility!
malheureusement mon français n'est pas bon :<
Owner of the Zelo's
In game name: MuadTralk, spdtainted, sdzen, sd zen, sdzeno
 

jn
Member
 
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Sun Mar 11, 2012 22:32

sdzen wrote:what if my pick has a basetime of 0?

Constant dig time (which is what I used) isn't influenced by the tool's basetime.
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Sun Mar 11, 2012 22:46

jn wrote:
Temperest wrote:Wouldn't you be able to dig through this in 1000000 seconds? :P

Have fun spending two weeks pressing your mouse button :P


Apparently it would only take 11.574074 days...
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

jn
Member
 
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Sun Mar 11, 2012 22:59

Ah, well, I estimated it in my head. (And did hope someone would actually calculate this, so I could compare)
 

Utilisatrice
Member
 
Posts: 103
Joined: Thu Feb 16, 2012 18:04

by Utilisatrice » Sun Mar 11, 2012 23:01

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
23:58:45: INFO[main]: Server: Loading mod "jn"
23:58:45: INFO[main]: Loading and running script from C:\Users\****\Desktop\minetest\bin\bin\..\data\mods\jn\init.lua
23:58:45: ERROR[main]: Failed to load and run script from C:\Users\****\Desktop\minetest\bin\bin\..\data\mods\jn\init.lua:
23:58:45: ERROR[main]: [LUA]
23:58:45: ERROR[main]: [LUA] ...p\minetest\bin\bin\..\data\builtin.lua:531: Name bedrock:bedrock does not follow naming conventions: "modname:" or ":" prefix required
23:58:45: ERROR[main]: stack traceback:
23:58:45: ERROR[main]:     [C]: in function 'error'
23:58:45: ERROR[main]:     ...p\minetest\bin\bin\..\data\builtin.lua:531: in function 'check_modname_prefix'
23:58:45: ERROR[main]:     ...p\minetest\bin\bin\..\data\builtin.lua:567: in function 'register_item'
23:58:45: ERROR[main]:     ...p\minetest\bin\bin\..\data\builtin.lua:623: in function 'register_node'
23:58:45: ERROR[main]:     ...si-minetest\bin\bin\..\data\mods\jn\init.lua:25: in main chunk
23:58:45: ERROR[main]: [LUA]
23:58:45: ERROR[main]: Server: Failed to load and run C:\Users\****\Desktop\minetest\bin\bin\..\data\mods\jn\init.lua
BanManager: saving to C:\Users\****\Desktop\minetest\bin\bin\..\world\ipban.txt
BanManager: failed loading from C:\Users\****Desktop\minetest\bin\bin\..\world\ipban.txt
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Mon Mar 12, 2012 00:00

Utilisatrice wrote:
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
23:58:45: INFO[main]: Server: Loading mod "jn"
23:58:45: INFO[main]: Loading and running script from C:\Users\****\Desktop\minetest\bin\bin\..\data\mods\jn\init.lua
23:58:45: ERROR[main]: Failed to load and run script from C:\Users\****\Desktop\minetest\bin\bin\..\data\mods\jn\init.lua:
23:58:45: ERROR[main]: [LUA]
23:58:45: ERROR[main]: [LUA] ...p\minetest\bin\bin\..\data\builtin.lua:531: Name bedrock:bedrock does not follow naming conventions: "modname:" or ":" prefix required
23:58:45: ERROR[main]: stack traceback:
23:58:45: ERROR[main]:     [C]: in function 'error'
23:58:45: ERROR[main]:     ...p\minetest\bin\bin\..\data\builtin.lua:531: in function 'check_modname_prefix'
23:58:45: ERROR[main]:     ...p\minetest\bin\bin\..\data\builtin.lua:567: in function 'register_item'
23:58:45: ERROR[main]:     ...p\minetest\bin\bin\..\data\builtin.lua:623: in function 'register_node'
23:58:45: ERROR[main]:     ...si-minetest\bin\bin\..\data\mods\jn\init.lua:25: in main chunk
23:58:45: ERROR[main]: [LUA]
23:58:45: ERROR[main]: Server: Failed to load and run C:\Users\****\Desktop\minetest\bin\bin\..\data\mods\jn\init.lua
BanManager: saving to C:\Users\****\Desktop\minetest\bin\bin\..\world\ipban.txt
BanManager: failed loading from C:\Users\****Desktop\minetest\bin\bin\..\world\ipban.txt


Your mod folder name must be "bedrock", not "jn".
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

User avatar
jordan4ibanez
Member
 
Posts: 1865
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Mon Mar 12, 2012 04:21

very cool
If you can think it, you can make it.
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Mon Mar 12, 2012 07:27

must add to mc 4 mt.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon Mar 12, 2012 13:18

Nice Mod!
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
IPushButton2653
Member
 
Posts: 666
Joined: Wed Nov 16, 2011 22:47

by IPushButton2653 » Mon Mar 12, 2012 18:20

Needed this for a while. Implemented a bedrock node in my personal minetest, and now I can use it :D
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Fri Mar 16, 2012 21:19

Quick texture, better than an uniform color (:P): http://ompldr.org/vZDFxbg/bedrock.png
 

jn
Member
 
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Fri Mar 16, 2012 22:57

Calinou wrote:Quick texture, better than an uniform color (:P): http://ompldr.org/vZDFxbg/bedrock.png

Yes, definately. But it looks a bit like rubber.
May I include the texture? Under which basic license?
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Fri Mar 16, 2012 23:05

Feel free to, license is "do whatever you want with it".
You can edit it if you want.
 

jn
Member
 
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Fri Mar 16, 2012 23:35

Thanks, I brightened it up a bit to match the brightness of stone (I'm not sure if that's a good idea, but at least it's not too minecrafty).
 

Demostan
Member
 
Posts: 14
Joined: Wed Feb 29, 2012 17:38

by Demostan » Wed Apr 11, 2012 16:15

is there a /giveme and if it has what is it?
When you have a dream you never,ever,ever let it go.
 

User avatar
LolManKuba
Member
 
Posts: 939
Joined: Fri Feb 10, 2012 22:36

by LolManKuba » Wed Apr 11, 2012 22:38

I do not know why this mod is needed.
 

Troy6879
Member
 
Posts: 63
Joined: Tue Mar 27, 2012 04:19

by Troy6879 » Tue Apr 24, 2012 09:32

Temperest wrote:
jn wrote:
Temperest wrote:Wouldn't you be able to dig through this in 1000000 seconds? :P

Have fun spending two weeks pressing your mouse button :P


Apparently it would only take 11.574074 days...

Bit of a math freak arn't you?(No offence)
They shall not grow old as we that are left grow old,
Age shall not weary them,nor the years condemn, (For the fallen, In honur of ANZAC, 25th April 1915))
At the going down of the sun and in the morning,
We shall remember them.
 

User avatar
Death Dealer
Member
 
Posts: 1379
Joined: Wed Feb 15, 2012 18:46

by Death Dealer » Tue Apr 24, 2012 14:09

LolManKuba wrote:I do not know why this mod is needed.

To keep certain monsters from digging to low, or to section off the nether do you can't dig to it. Or there placed at-32000 and they would be put there to make things a bit more realistic when you get to it. Instead of seeing into the void.
Keep calm and code python^_^
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Tue Apr 24, 2012 19:57

Troy6879 wrote:
Temperest wrote:...

Bit of a math freak arn't you?(No offence)


It's what happens when you have a calculator built into your launcher... :P
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

User avatar
LolManKuba
Member
 
Posts: 939
Joined: Fri Feb 10, 2012 22:36

by LolManKuba » Tue Apr 24, 2012 21:29

What would happen if you flew below that point?
 

jn
Member
 
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Tue Apr 24, 2012 21:35

LolManKuba wrote:What would happen if you flew below that point?

Well, just that -- you flew below there. ;-)
 

xxxeasternxxx
 

by xxxeasternxxx » Sat Jul 14, 2012 17:24

How deep is the bedrock
 

jn
Member
 
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Sat Jul 14, 2012 18:52

xxxeasternxxx wrote:How deep is the bedrock

By default it is at y=-30976, but you can change that by editing init.lua.
 

User avatar
Element
Member
 
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962

by Element » Mon Sep 23, 2013 19:33

the unuke(tnt) mod can destroy bedrock...is there a way you can make it so it cant
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

User avatar
Element
Member
 
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962

by Element » Tue Sep 24, 2013 20:44

thanks to this, my world has a bottom at -1000 nodes
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

by Wuzzy » Tue Sep 24, 2013 20:51

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:
  1. have sounds for bedrock (preferably not the default sounds! ;-))
  2. use LuaVoxelManip instead of set_node for better performance (I do not understand LuaVoxelManip yet :-(. )

My changes fall under the WTFPL, of course.
Last edited by Wuzzy on Tue Sep 24, 2013 20:53, edited 1 time in total.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
Element
Member
 
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962

by Element » Tue Sep 24, 2013 20:56

is there a way to make the bedrock layer be thicker than one node
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 44 guests