Commit 5bd9eac0 authored by ClaudiusMinimus's avatar ClaudiusMinimus
Browse files

merged in master

parents e695ad8c 4cb83e53
Pipeline #345 failed with stage
Subproject commit 97fad4d782e7d1bfac13ac28b8717fb46eb4ecea
Subproject commit 6b7c5ea990999de385a9e9eda8cc08f1ce12c00e
Subproject commit a470ac7cc1786c188866ca57d4a0d13e3e8f37d0
Subproject commit 2aa6227f0a03d20a6c4733f74c46612bd33e0be1
Minetest Game mod: nyancat
==========================
License of source code:
-----------------------
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
-----------------------
Everything not listed in here:
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
VanessaE (WTFPL):
nyancat_front.png
nyancat_back.png
nyancat_side.png
nyancat_rainbow.png
minetest.register_node("nyancat:nyancat", {
description = "Nyan Cat",
tiles = {"nyancat_side.png", "nyancat_side.png", "nyancat_side.png",
"nyancat_side.png", "nyancat_back.png", "nyancat_front.png"},
paramtype2 = "facedir",
groups = {cracky = 2},
is_ground_content = false,
legacy_facedir_simple = true,
sounds = default.node_sound_defaults(),
})
minetest.register_node("nyancat:nyancat_rainbow", {
description = "Nyan Cat Rainbow",
tiles = {
"nyancat_rainbow.png^[transformR90",
"nyancat_rainbow.png^[transformR90",
"nyancat_rainbow.png"
},
paramtype2 = "facedir",
groups = {cracky = 2},
is_ground_content = false,
sounds = default.node_sound_defaults(),
})
minetest.register_craft({
type = "fuel",
recipe = "nyancat:nyancat",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "nyancat:nyancat_rainbow",
burntime = 1,
})
nyancat = {}
function nyancat.place(pos, facedir, length)
if facedir > 3 then
facedir = 0
end
local tailvec = minetest.facedir_to_dir(facedir)
local p = {x = pos.x, y = pos.y, z = pos.z}
minetest.set_node(p, {name = "nyancat:nyancat", param2 = facedir})
for i = 1, length do
p.x = p.x + tailvec.x
p.z = p.z + tailvec.z
minetest.set_node(p, {name = "nyancat:nyancat_rainbow", param2 = facedir})
end
end
function nyancat.generate(minp, maxp, seed)
local height_min = -31000
local height_max = -32
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1)
local pr = PseudoRandom(seed + 9324342)
local max_num_nyancats = math.floor(volume / (16 * 16 * 16))
for i = 1, max_num_nyancats do
if pr:next(0, 1000) == 0 then
local x0 = pr:next(minp.x, maxp.x)
local y0 = pr:next(minp.y, maxp.y)
local z0 = pr:next(minp.z, maxp.z)
local p0 = {x = x0, y = y0, z = z0}
nyancat.place(p0, pr:next(0, 3), pr:next(3, 15))
end
end
end
minetest.register_on_generated(function(minp, maxp, seed)
nyancat.generate(minp, maxp, seed)
end)
-- Legacy
minetest.register_alias("default:nyancat", "nyancat:nyancat")
minetest.register_alias("default:nyancat_rainbow", "nyancat:nyancat_rainbow")
minetest.register_alias("nyancat", "nyancat:nyancat")
minetest.register_alias("nyancat_rainbow", "nyancat:nyancat_rainbow")
minetest.register_alias("default:nyancat_rainbow_doublepanel", "nyancat:nyancat_rainbow_doublepanel")
minetest.register_alias("default:nyancat_rainbow_outerstair", "nyancat:nyancat_rainbow_outerstair")
default.make_nyancat = nyancat.place
default.generate_nyancats = nyancat.generate
--[[
RandomMessages mod by arsdragonfly.
arsdragonfly@gmail.com
6/19/2013
--]]
--Time between two subsequent messages.
local MESSAGE_INTERVAL = 0
math.randomseed(os.time())
random_messages = {}
random_messages.messages = {} --This table contains all messages.
function table.count( t )
local i = 0
for k in pairs( t ) do i = i + 1 end
return i
end
function table.random( t )
local rk = math.random( 1, table.count( t ) )
local i = 1
for k, v in pairs( t ) do
if ( i == rk ) then return v, k end
i = i + 1
end
end
function random_messages.initialize() --Set the interval in minetest.conf.
minetest.setting_set("random_messages_interval",1800)
minetest.setting_save();
return 1800
end
function random_messages.set_interval() --Read the interval from minetest.conf(set it if it doesn'st exist)
MESSAGE_INTERVAL = tonumber(minetest.setting_get("random_messages_interval")) or random_messages.initialize()
end
function random_messages.check_params(name,func,params)
local stat,msg = func(params)
if not stat then
minetest.chat_send_player(name,msg)
return false
end
return true
end
function random_messages.read_messages()
random_messages.messages = {
"# Illuna-Notes: Soup is very useful to fight hunger, everyone should have some.",
"# Illuna-Notes: Meet your fellows on our Mumbleserver at tchncs.de",
"# Illuna-Notes: Enjoy Illuna? Invite your friends today!",
"# Illuna-Notes: Have something to share? Create and join discussion at the Illuna forum: https://forum.illuna-minetest.tk!",
"# Illuna-Notes: Sell and buy stuff on the Illuna marketplace. It is below the spawnhouse."
}
end
function random_messages.display_message(message_number)
local msg = random_messages.messages[message_number] or message_number
if msg then
minetest.chat_send_all(msg)
end
end
function random_messages.show_message()
random_messages.display_message(table.random(random_messages.messages))
end
function random_messages.list_messages()
local str = ""
for k,v in pairs(random_messages.messages) do
str = str .. k .. " | " .. v .. "\n"
end
return str
end
function random_messages.remove_message(k)
table.remove(random_messages.messages,k)
random_messages.save_messages()
end
function random_messages.add_message(t)
table.insert(random_messages.messages,table.concat(t," ",2))
random_messages.save_messages()
end
function random_messages.save_messages()
local output = io.open(minetest.get_worldpath().."/random_messages","w")
for k,v in pairs(random_messages.messages) do
output:write(v .. "\n")
end
io.close(output)
end
--When server starts:
random_messages.set_interval()
random_messages.read_messages()
local TIMER = 0
minetest.register_globalstep(function(dtime)
TIMER = TIMER + dtime;
if TIMER > MESSAGE_INTERVAL then
random_messages.show_message()
TIMER = 0
end
end)
local register_chatcommand_table = {
params = "viewmessages | removemessage <number> | addmessage <number>",
privs = {server = true},
description = "View and/or alter the server's random messages",
func = function(name,param)
local t = string.split(param, " ")
if t[1] == "viewmessages" then
minetest.chat_send_player(name,random_messages.list_messages())
elseif t[1] == "removemessage" then
if not random_messages.check_params(
name,
function (params)
if not tonumber(params[2]) or
random_messages.messages[tonumber(params[2])] == nil then
return false,"ERROR: No such message."
end
return true
end,
t) then return end
random_messages.remove_message(t[2])
elseif t[1] == "addmessage" then
if not t[2] then
minetest.chat_send_player(name,"ERROR: No message.")
else
random_messages.add_message(t)
end
else
minetest.chat_send_player(name,"ERROR: Invalid command.")
end
end
}
minetest.register_chatcommand("random_messages", register_chatcommand_table)
minetest.register_chatcommand("rmessages", register_chatcommand_table)
RandomMessages mod by arsdragonfly.
Put your messages in (world directory)/random_messages,1 message per line.
Messages can be all kinds of hints, mod usage, etc.
Add/Remove messages on the fly:
/rmessages viewmessages
to see all the messages.
/rmessages addmessage blah blah blah
to add the random message blah blah blah.
/rmessages removemessage 2
to remove the 2nd random message in /rmessages viewmessages .
In minetest.conf, random_messages_interval decides how often a message is sent.
Released under CC0.
Special thanks to:
Michael Rasmussen (michael@jamhome.us)
Enjoy it! ^_^
arsdragonfly@gmail.com
6/19/2013
\ No newline at end of file
......@@ -64,6 +64,7 @@ screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses)
end
else
if not ndef or not ndef.paramtype2 == "facedir" or
ndef.on_rotate == false or
(ndef.drawtype == "nodebox" and
not ndef.node_box.type == "fixed") or
node.param2 == nil then
......
......@@ -239,6 +239,7 @@ end
if replace then
minetest.register_abm({
label = "Slab replace",
nodenames = {"group:slabs_replace"},
interval = 16,
chance = 1,
......@@ -271,7 +272,7 @@ end
stairs.register_stair_and_slab(
"wood",
"default:wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"default_wood.png"},
"Wooden Stair",
"Wooden Slab",
......@@ -281,7 +282,7 @@ stairs.register_stair_and_slab(
stairs.register_stair_and_slab(
"junglewood",
"default:junglewood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"default_junglewood.png"},
"Jungle Wood Stair",
"Jungle Wood Slab",
......@@ -291,7 +292,7 @@ stairs.register_stair_and_slab(
stairs.register_stair_and_slab(
"pine_wood",
"default:pine_wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
{"default_pine_wood.png"},
"Pine Wood Stair",
"Pine Wood Slab",
......@@ -301,7 +302,7 @@ stairs.register_stair_and_slab(
stairs.register_stair_and_slab(
"acacia_wood",
"default:acacia_wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"default_acacia_wood.png"},
"Acacia Wood Stair",
"Acacia Wood Slab",
......@@ -311,7 +312,7 @@ stairs.register_stair_and_slab(
stairs.register_stair_and_slab(
"aspen_wood",
"default:aspen_wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
{"default_aspen_wood.png"},
"Aspen Wood Stair",
"Aspen Wood Slab",
......
Subproject commit 5c6baef96f7d9cb79ccc6c10b670bf0078d93d55
......@@ -42,7 +42,7 @@ end
local function eject_drops(drops, pos, radius)
local drop_pos = vector.new(pos)
for _, item in pairs(drops) do
local count = item:get_count()
local count = math.min(item:get_count(), item:get_stack_max())
while count > 0 do
local take = math.max(1,math.min(radius * radius,
count,
......@@ -78,7 +78,6 @@ local function add_drop(drops, item)
end
end
local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_protection, ignore_on_blast)
if not ignore_protection and minetest.is_protected(npos, "") then
return cid
......@@ -102,7 +101,6 @@ local function destroy(drops, npos, cid, c_air, c_fire, on_blast_queue, ignore_p
end
end
local function calc_velocity(pos1, pos2, old_vel, power)
-- Avoid errors caused by a vector of zero length
if vector.equals(pos1, pos2) then
......@@ -488,14 +486,6 @@ minetest.register_node("tnt:gunpowder_burning", {
end,
})
minetest.register_abm({
nodenames = {"group:tnt", "tnt:gunpowder"},
neighbors = {"fire:basic_flame", "default:lava_source", "default:lava_flowing"},
interval = 4,
chance = 1,
action = tnt.burn,
})
minetest.register_craft({
output = "tnt:gunpowder",
type = "shapeless",
......@@ -503,14 +493,23 @@ minetest.register_craft({
})
minetest.register_craft({
output = "tnt:tnt",
recipe = {
{"", "group:wood", ""},
{"group:wood", "tnt:gunpowder", "group:wood"},
{"", "group:wood", ""}
}
output = "tnt:tnt",
recipe = {
{"", "group:wood", ""},
{"group:wood", "tnt:gunpowder", "group:wood"},
{"", "group:wood", ""}
}
})
minetest.register_abm({
label = "TNT ignition",
nodenames = {"group:tnt", "tnt:gunpowder"},
neighbors = {"fire:basic_flame", "default:lava_source", "default:lava_flowing"},
interval = 4,
chance = 1,
action = tnt.burn,
})
function tnt.register_tnt(def)
local name
if not def.name:find(':') then
......@@ -588,4 +587,3 @@ tnt.register_tnt({
description = "TNT",
radius = tnt_radius,
})
Subproject commit e0f401bad71cc7ac8739251464902c921feba184
Subproject commit dbef5947bf143986bd85083c3cf1b37ba076073e
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment