first commit

This commit is contained in:
kaadmy 2015-09-01 08:15:24 -07:00
commit 12c94adf09
619 changed files with 19556 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*~
*.blend1

116
LICENSE_CC0.txt Normal file
View File

@ -0,0 +1,116 @@
CC0 1.0 Universal
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific
works ("Commons") that the public can reliably and without fear of later
claims of infringement build upon, modify, incorporate in other works, reuse
and redistribute as freely as possible in any form whatsoever and for any
purposes, including without limitation commercial purposes. These owners may
contribute to the Commons to promote the ideal of a free culture and the
further production of creative, cultural and scientific works, or to gain
reputation or greater distribution for their Work in part through the use and
efforts of others.
For these and/or other purposes and motivations, and without any expectation
of additional consideration or compensation, the person associating CC0 with a
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
and publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not limited
to, the following:
i. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or likeness
depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
vii. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
the Waiver for the benefit of each member of the public at large and to the
detriment of Affirmer's heirs and successors, fully intending that such Waiver
shall not be subject to revocation, rescission, cancellation, termination, or
any other legal or equitable action to disrupt the quiet enjoyment of the Work
by the public as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
is so judged Affirmer hereby grants to each affected person a royalty-free,
non transferable, non sublicensable, non exclusive, irrevocable and
unconditional license to exercise Affirmer's Copyright and Related Rights in
the Work (i) in all territories worldwide, (ii) for the maximum duration
provided by applicable law or treaty (including future time extensions), (iii)
in any current or future medium and for any number of copies, and (iv) for any
purpose whatsoever, including without limitation commercial, advertising or
promotional purposes (the "License"). The License shall be deemed effective as
of the date CC0 was applied by Affirmer to the Work. Should any part of the
License for any reason be judged legally invalid or ineffective under
applicable law, such partial invalidity or ineffectiveness shall not
invalidate the remainder of the License, and in such case Affirmer hereby
affirms that he or she will not (i) exercise any of his or her remaining
Copyright and Related Rights in the Work or (ii) assert any associated claims
and causes of action with respect to the Work, in either case contrary to
Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or otherwise,
including without limitation warranties of title, merchantability, fitness
for a particular purpose, non infringement, or the absence of latent or
other defects, accuracy, or the present or absence of errors, whether or not
discoverable, all to the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without limitation
any person's Copyright and Related Rights in the Work. Further, Affirmer
disclaims responsibility for obtaining any necessary consents, permissions
or other rights required for any use of the Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
<http://creativecommons.org/publicdomain/zero/1.0/>

21
LICENSE_MIT.txt Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Kaadmy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

13
README.txt Normal file
View File

@ -0,0 +1,13 @@
Pixture
=======
By Kaadmy
Extra-special credit to Kenney(kenney.nl)
Special credits:
Extra-special credit to Kenney(kenney.nl) for the inspiration, most of the graphics design
(All images are of my own creation but based off Kenney's), and the overall feeling.
Sounds in the default mod are all by Kenney(CC0)
All textures/models by Kaadmy(CC0)
Asset license: almost all CC0, see per-mod READMEs.
Source license: almost all MIT, see per-mod READMEs.

1
game.conf Normal file
View File

@ -0,0 +1 @@
name = Pixture

BIN
menu/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

BIN
menu/header.xcf Normal file

Binary file not shown.

BIN
menu/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

BIN
menu/icon.xcf Normal file

Binary file not shown.

BIN
menu/overlay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 KiB

BIN
menu/overlay.xcf Normal file

Binary file not shown.

61
minetest.conf Normal file
View File

@ -0,0 +1,61 @@
#day-night cycle is 12 min(about)
time_speed = 120
# movement
movement_acceleration_default = 3.6
movement_acceleration_fast = 7.0
movement_acceleration_air = 3.2
movement_speed_walk = 4.2
movement_speed_fast = 7.0
movement_speed_crouch = 2.2
movement_speed_climb = 2.6
movement_speed_descend = 3.0
movement_speed_jump = 6.8
movement_liquid_fluidity = 0.9
movement_liquid_sink = 11.0
movement_gravity = 9.4
# privs
default_privs = interact, shout, spawn, fast
# if you're given the inital stuff; a stone pick and 10 torches
give_initial_stuff = false
# if beds can be slept in
bed_enabled = true
# if music players are usable
music_enable = true
# if dynamically changing weather is enabled
weather_enable = true
# if pvp is enabled
enable_pvp = true
# tnt is enabledxx
tnt_enable = true
# server
max_users = 8
max_block_generate_distance = 4
max_block_send_distance = 3
max_simultaneous_block_sends_per_client = 20
max_simultaneous_block_sends_server_total = 100
time_send_interval = 5
active_block_range = 4
server_map_save_interval = 15
# mapgen
mg_flags = trees, caves
mgv6_spflags = nojungles
mgv6_freq_desert = 0.65
mgv6_freq_beach = -0.04
water_level = 0
# i don't really know what these numbers change, but whatever :)
# offset, scale, (spread factors), seed offset, number of octaves, persistence, lacunarity.
mg_biome_np_humidity = 50, 20, (600, 850, 600), 31478, 3, 0.5, 2.0
mgv7_np_terrain_base = 10, 30, (750, 1500, 750), 88533, 8, 0.65, 2, 2

9
mods/armor/README.txt Normal file
View File

@ -0,0 +1,9 @@
Armor mod
=========
By Kaadmy, for Pixture
Adds craftable and wearable armor
Asset license: CC0
Source code license: MIT

254
mods/armor/init.lua Normal file
View File

@ -0,0 +1,254 @@
--
-- Armor mod
-- By Kaadmy, for Pixture
--
armor = {}
armor.update_time = 1
armor.materials = {
-- material craftitem % description
{"wood", "group:planks", 15, "Wooden"},
{"steel", "default:ingot_steel", 30, "Steel"},
{"chainmail", "armor:chainmail_sheet", 45, "Chainmail"},
{"carbonsteel", "default:ingot_carbonsteel", 60, "Carbonsteel"},
}
armor.slots = {"helmet", "chestplate", "boots"}
local form_armor = default.ui.get_page("core_2part")
default.ui.register_page("core_armor", form_armor)
local armor_timer = 10
function armor.is_armor(itemname)
local item = minetest.registered_items[itemname]
if item ~= nil and item.groups ~= nil then
if item.groups.is_armor then
return true
end
end
end
function armor.is_slot(itemname, slot)
local match = string.find(itemname, "armor:" .. slot .. "_")
local matchbool = false
if match ~= nil and match >= 1 then
matchbool = true
end
return matchbool
end
function armor.get_texture(player, base)
local inv = player:get_inventory()
local image = base
for _, slot in ipairs(armor.slots) do
local itemstack = inv:get_stack("armor_"..slot, 1)
local itemname = itemstack:get_name()
if armor.is_armor(itemname) and armor.is_slot(itemname, slot) then
local item = minetest.registered_items[itemname]
local mat = armor.materials[item.groups.armor_material][1]
image = image .. "^armor_" .. slot .. "_" .. mat ..".png"
end
end
-- print("[armor] Got armor texture: " .. image)
return image
end
function armor.get_groups(player)
local groups = {fleshy = 100}
local match_mat = nil
local match_amt = 0
local inv = player:get_inventory()
for _, slot in ipairs(armor.slots) do
local itemstack = inv:get_stack("armor_"..slot, 1)
local itemname = itemstack:get_name()
if armor.is_armor(itemname) then
local item = minetest.registered_items[itemname]
for mat_index, _ in ipairs(armor.materials) do
local mat = armor.materials[mat_index][1]
if mat_index == item.groups.armor_material then
groups.fleshy = groups.fleshy - item.groups.armor
if match_mat == nil then
match_mat = mat
end
if mat == match_mat then
match_amt = match_amt + 1
end
break
end
end
end
end
if match_amt == #armor.slots then -- if full set of same armor material, then boost armor by 10%
groups.fleshy = groups.fleshy - 10
end
-- print("[armor] Armor groups: " .. dump(groups))
return groups
end
function armor.init(player)
local inv = player:get_inventory()
for _, slot in ipairs(armor.slots) do
if inv:get_size("armor_"..slot) ~= 1 then
inv:set_size("armor_"..slot, 1)
end
end
end
function armor.update(player)
local groups = armor.get_groups(player)
player:set_armor_groups({fleshy = groups.fleshy})
local image = armor.get_texture(player, "character.png")
if image ~= default.player_get_textures(player)[1] then
default.player_set_textures(player, {image})
end
end
local function on_newplayer(player)
armor.init(player)
end
local function on_joinplayer(player)
armor.init(player)
end
local function on_die(player)
-- remove your armor(when i get to doing it...)
end
local function step(dtime)
armor_timer = armor_timer + dtime
if armor_timer > armor.update_time then
for _, player in pairs(minetest.get_connected_players()) do
armor.update(player)
end
armor_timer = 0
end
end
minetest.register_craftitem(
"armor:chainmail_sheet",
{
description = "Chainmail sheet",
inventory_image = "armor_chainmail.png",
wield_image = "armor_chainmail.png",
stack_max = 20,
})
minetest.register_craft(
{
output = "armor:chainmail_sheet 3",
recipe = {
{"default:ingot_steel", "", "default:ingot_steel"},
{"", "default:ingot_steel", ""},
{"default:ingot_steel", "", "default:ingot_steel"},
}
})
for mat_index, _ in ipairs(armor.materials) do
local def = armor.materials[mat_index]
local mat = def[1]
local armor_def = math.floor(def[3] / #armor.slots)
-- print("Material " .. mat .. ": " .. armor_def)
for _, slot in ipairs(armor.slots) do
minetest.register_craftitem(
"armor:"..slot.."_"..mat,
{
description = def[4].." "..slot,
inventory_image = "armor_"..slot.."_"..mat.."_inventory.png",
wield_image = "armor_"..slot.."_"..mat.."_inventory.png",
groups = {
is_armor = 1,
armor = armor_def,
armor_material = mat_index
},
stack_max = 1,
})
end
local n = def[2]
minetest.register_craft(
{
output = "armor:helmet_"..mat,
recipe = {
{n, n, n},
{n, "", n},
{"", "", ""},
}
})
minetest.register_craft(
{
output = "armor:chestplate_"..mat,
recipe = {
{n, "", n},
{n, n, n},
{n, n, n},
}
})
minetest.register_craft(
{
output = "armor:boots_"..mat,
recipe = {
{"", "", ""},
{n, "", n},
{n, "", n},
}
})
end
minetest.register_on_newplayer(on_newplayer)
minetest.register_on_joinplayer(on_joinplayer)
minetest.register_on_dieplayer(on_die)
minetest.register_globalstep(step)
local form_armor = default.ui.get_page("core_2part")
form_armor = form_armor .. "list[current_player;main;0.25,4.75;8,4;]"
form_armor = form_armor .. default.ui.get_hotbar_itemslot_bg(0.25, 4.75, 8, 1)
form_armor = form_armor .. default.ui.get_itemslot_bg(0.25, 5.75, 8, 3)
form_armor = form_armor .. "listring[current_player;main]"
form_armor = form_armor .. "label[3.25,3;Boots]"
form_armor = form_armor .. "list[current_player;armor_boots;2.25,2.75;1,1;]"
form_armor = form_armor .. "listring[current_player;armor_boots]"
form_armor = form_armor .. default.ui.get_itemslot_bg(2.25, 2.75, 1, 1)
form_armor = form_armor .. "label[3.25,2;Chestplate]"
form_armor = form_armor .. "list[current_player;armor_chestplate;2.25,1.75;1,1;]"
form_armor = form_armor .. "listring[current_player;armor_chestplate]"
form_armor = form_armor .. default.ui.get_itemslot_bg(2.25, 1.75, 1, 1)
form_armor = form_armor .. "label[3.25,1;Helmet]"
form_armor = form_armor .. "list[current_player;armor_helmet;2.25,0.75;1,1;]"
form_armor = form_armor .. "listring[current_player;armor_helmet]"
form_armor = form_armor .. default.ui.get_itemslot_bg(2.25, 0.75, 1, 1)
default.ui.register_page("core_armor", form_armor)

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

9
mods/bed/README.txt Normal file
View File

@ -0,0 +1,9 @@
Beds mod
========
By PilzAdam, thefamilygrog66
Tweaked by Kadmy, for Pixture
Right-click a bed to sleep, right-click again to get out.
Asset license: CC0
Source license: MIT(originally WTFPL)

2
mods/bed/depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
farming

215
mods/bed/init.lua Normal file
View File

@ -0,0 +1,215 @@
--
-- Bed mod
-- By PilzAdam, thefamilygrog66
-- Tweaked by Kaadmy, for Pixture
--
local players_in_bed = 0
minetest.register_node(
"bed:bed_foot",
{
description = "Bed",
drawtype = "nodebox",
tiles = {"bed_foot.png", "default_wood.png", "bed_side.png"},
inventory_image = "bed_bed_inventory.png",
wield_image = "bed_bed_inventory.png",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 2/16, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 2/16, 1.5},
}
},
after_place_node = function(pos, placer, itemstack)
local node = minetest.env:get_node(pos)
local p = {x = pos.x, y = pos.y, z = pos.z}
local param2 = node.param2
node.name = "bed:bed_head"
if param2 == 0 then
pos.z = pos.z + 1
elseif param2 == 1 then
pos.x = pos.x + 1
elseif param2 == 2 then
pos.z = pos.z - 1
elseif param2 == 3 then
pos.x = pos.x - 1
end
if minetest.registered_nodes[minetest.env:get_node(pos).name].buildable_to then
minetest.env:set_node(pos, node)
else
minetest.env:remove_node(p)
return true
end
end,
on_destruct = function(pos)
local node = minetest.env:get_node(pos)
local param2 = node.param2
if param2 == 0 then
pos.z = pos.z+1
elseif param2 == 1 then
pos.x = pos.x+1
elseif param2 == 2 then
pos.z = pos.z-1
elseif param2 == 3 then
pos.x = pos.x-1
end
if (minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z}).name == "bed:bed_head") then
if (minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z}).param2 == param2) then
minetest.env:remove_node(pos)
end
end
end,
on_rightclick =function(pos, node, clicker)
if not clicker:is_player()
or not minetest.is_singleplayer()
and not minetest.setting_getbool("bed_enabled") then return end
local meta = minetest.env:get_meta(pos)
local param2 = node.param2
if param2 == 0 then
pos.z = pos.z + 0.5
elseif param2 == 1 then
pos.x = pos.x + 0.5
elseif param2 == 2 then
pos.z = pos.z - 0.5
elseif param2 == 3 then
pos.x = pos.x - 0.5
end
if clicker:get_player_name() == meta:get_string("player") then
if param2 == 0 then
pos.x = pos.x - 1
elseif param2 == 1 then
pos.z = pos.z + 1
elseif param2 == 2 then
pos.x = pos.x + 1
elseif param2 == 3 then
pos.z = pos.z - 1
end
clicker:set_physics_override({speed = 1.0, jump = 1.0, sneak = true})
pos.y = pos.y - 0.5
clicker:setpos(pos)
clicker:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
meta:set_string("player", "")
players_in_bed = players_in_bed - 1
default.player_attached[clicker:get_player_name()] = false
clicker:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
default.player_set_animation(clicker, "stand", 30)
elseif meta:get_string("player") == "" then
default.player_attached[clicker:get_player_name()] = true
clicker:set_local_animation({x=162, y=166}, {x=162, y=166}, {x=162, y=166}, {x=162, y=168}, 30)
default.player_set_animation(clicker, "lay", 30)
clicker:set_physics_override({speed = 0.0, jump = 0.0, sneak = false})
pos.y = pos.y + 0.5625
clicker:setpos(pos)
clicker:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = -13, z = 0})
if param2 == 0 then
clicker:set_look_yaw(math.pi)
elseif param2 == 1 then
clicker:set_look_yaw(0.5 * math.pi)
elseif param2 == 2 then
clicker:set_look_yaw(0)
elseif param2 == 3 then
clicker:set_look_yaw(1.5 * math.pi)
end
meta:set_string("player", clicker:get_player_name())
players_in_bed = players_in_bed + 1
end
end
})
minetest.register_node(
"bed:bed_head",
{
drawtype = "nodebox",
tiles = {"bed_head.png", "default_wood.png", "bed_side.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 2/16, 0.5},
}
},
selection_box = {type = "fixed", fixed = {{0, 0, 0, 0, 0, 0},}},
})
minetest.register_alias("bed:bed", "bed:bed_foot")
minetest.register_craft(
{
output = "bed:bed",
recipe = {
{"group:fuzzy", "group:fuzzy", "group:fuzzy"},
{"group:planks", "group:planks", "group:planks"},
}
})
bed_player_spawns = {}
local file = io.open(minetest.get_worldpath().."/bed.txt", "r")
if file then
bed_player_spawns = minetest.deserialize(file:read("*all"))
file:close()
end
local timer = 0
local wait = false
minetest.register_globalstep(
function(dtime)
if timer < 2 then
timer = timer + dtime
return
end
timer = 0
local players = #minetest.get_connected_players()
if players ~= 0 and players * 0.5 < players_in_bed then
if minetest.env:get_timeofday() < 0.2 or minetest.env:get_timeofday() > 0.8 then
if not wait then
minetest.chat_send_all("[zzz] " .. players_in_bed .. " of " .. players .. " players slept, skipping to day.")
minetest.after(2, function()
minetest.env:set_timeofday(0.23)
wait = false
end)
wait = true
for _,player in ipairs(minetest.get_connected_players()) do
bed_player_spawns[player:get_player_name()] = player:getpos()
end
local file = io.open(minetest.get_worldpath().."/bed.txt", "w")
if file then
file:write(minetest.serialize(bed_player_spawns))
file:close()
end
end
end
end
end)
minetest.register_on_respawnplayer(
function(player)
local name = player:get_player_name()
if bed_player_spawns[name] then
player:setpos(bed_player_spawns[name])
return true
end
end)
default.log("mod:bed", "loaded")

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

10
mods/book/README.txt Normal file
View File

@ -0,0 +1,10 @@
Books mod
=========
By Kaadmy, for Pixture
Mod originally designed for Pixture, may not work elsewhere
This mod adds books that can be written to, just
left-click while holding one, write, and save
Source license: MIT

1
mods/book/depends.txt Normal file
View File

@ -0,0 +1 @@
default

47
mods/book/init.lua Normal file
View File

@ -0,0 +1,47 @@
--
-- Editable books
-- Code based off the books_plus mod
-- By Kaadmy, for Pixture
--
minetest.register_craftitem(
":default:book",
{
description = "Book",
inventory_image = "default_book.png",
stack_max = 1,
on_use = function(itemstack, player, pointed_thing)
local name = player:get_player_name()
local data = minetest.deserialize(itemstack:get_metadata())
local title = ""
local text = ""
if data then
text = data.text
title = data.title
end
local form = default.ui.get_page("core_notabs")
form = form .. "field[0.5,1.25;8,0;title;Title:;"..minetest.formspec_escape(title).."]"
form = form .. "textarea[0.5,1.75;8,6.75;text;Contents:;"..minetest.formspec_escape(text).."]"
form = form .. default.ui.button_exit(2.75, 7.75, 3, 1, "write", "Write")
minetest.show_formspec(name, "book:book", form)
end,
})
minetest.register_on_player_receive_fields(
function(player, form_name, fields)
if form_name ~= "book:book" or not fields.write then return end
local itemstack = player:get_wielded_item()
local data = minetest.deserialize(itemstack:get_metadata())
if not data then data = {} end
data.text = fields.text
data.title = fields.title
itemstack:set_metadata(minetest.serialize(data))
player:set_wielded_item(itemstack)
end)

View File

@ -0,0 +1,8 @@
Builtin item mod
================
By PilzAdam
Tweaked by Kaadmy, for Pixture
Items are now destroyed by lava and flow with water.
Source license: MIT(originally WTFPL)

View File

@ -0,0 +1 @@
default

148
mods/builtin_item/init.lua Normal file
View File

@ -0,0 +1,148 @@
--
-- Builtin item mod
-- By PilzAdam
-- Tweaked by Kaadmy, for Pixture
--
minetest.register_entity(
":__builtin:item",
{
initial_properties = {
hp_max = 1,
physical = true,
collisionbox = {-0.125, -0.125, -0.125, 0.125, 0.125, 0.125},
collide_with_objects = false,
visual = "sprite",
visual_size = {x=0.15, y=0.15},
textures = {""},
spritediv = {x=1, y=1},
initial_sprite_basepos = {x=0, y=0},
is_visible = false,
timer = 0,
},
itemstring = "",
physical_state = true,
set_item = function(self, itemstring)
self.itemstring = itemstring
local stack = ItemStack(itemstring)
local itemtable = stack:to_table()
local itemname = nil
if itemtable then
itemname = stack:to_table().name
end
local item_texture = nil
local item_type = ""
if minetest.registered_items[itemname] then
item_texture = minetest.registered_items[itemname].inventory_image
item_type = minetest.registered_items[itemname].type
end
local prop = {
is_visible = true,
visual = "sprite",
textures = {"unknown_item.png"}
}
if item_texture and item_texture ~= "" then
prop.visual = "wielditem"
prop.textures = {itemname}
prop.visual_size = {x=0.15, y=0.15}
else
prop.visual = "wielditem"
prop.textures = {itemname}
prop.visual_size = {x=0.15, y=0.15}
prop.automatic_rotate = math.pi * 0.5
end
self.object:set_properties(prop)
end,
get_staticdata = function(self)
--return self.itemstring
return minetest.serialize(
{
itemstring = self.itemstring,
always_collect = self.always_collect,
timer = self.timer,
})
end,
on_activate = function(self, staticdata, dtime_s)
if string.sub(staticdata, 1, string.len("return")) == "return" then
local data = minetest.deserialize(staticdata)
if data and type(data) == "table" then
self.itemstring = data.itemstring
self.always_collect = data.always_collect
self.timer = data.timer
if not self.timer then
self.timer = 0
end
self.timer = self.timer+dtime_s
end
else
self.itemstring = staticdata
end
self.object:set_armor_groups({immortal=1})
self.object:setvelocity({x=0, y=2, z=0})
self.object:setacceleration({x=0, y=-10, z=0})
self:set_item(self.itemstring)
end,
on_step = function(self, dtime)
local time = tonumber(minetest.setting_get("remove_items"))
if not time then time = 600 end
if not self.timer then self.timer = 0 end
self.timer = self.timer + dtime
if time ~= 0 and (self.timer > time) then
self.object:remove()
end
local p = self.object:getpos()
local name = minetest.get_node(p).name
if minetest.registered_nodes[name].damage_per_second > 0 or name == "maptools:igniter" then
minetest.sound_play("builtin_item_lava", {pos = self.object:getpos(), gain = 0.45})
self.object:remove()
return
end
p.y = p.y - 0.3
local nn = minetest.get_node(p).name
-- If node is not registered or node is walkably solid:
if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable then
if self.physical_state then
self.object:setvelocity({x=0,y=0,z=0})
self.object:setacceleration({x=0, y=0, z=0})
self.physical_state = false
self.object:set_properties(
{
physical = false
})
end
else
if not self.physical_state then
self.object:setvelocity({x=0,y=0,z=0})
self.object:setacceleration({x=0, y=-10, z=0})
self.physical_state = true
self.object:set_properties(
{
physical = true
})
end
end
end,
--[[ -- This causes a duplication glitch if a player walks upon an item and clicks on it at the same time:
on_punch = function(self, hitter)
if self.itemstring ~= "" then
local left = hitter:get_inventory():add_item("main", self.itemstring)
if not left:is_empty() then
self.itemstring = left:to_string()
return
end
end
self.object:remove()
end,
--]]
})
default.log("mod:builtin_item", "loaded")

Binary file not shown.

View File

@ -0,0 +1,9 @@
Crafting guide mod
==================
By Kaadmy, for Pixture
This mod adds a crafting guide in your inventory.
Asset license: CC0
Source license: MIT

View File

@ -0,0 +1 @@
default

169
mods/craftingguide/init.lua Normal file
View File

@ -0,0 +1,169 @@
--
-- Crafting guide mod
-- By Kaadmy, for Pixture
--
craftingguide = {}
craftingguide.items = {}
craftingguide.itemlist = {}
craftingguide.users = {} -- {item = selected item, itemno = recipe no., page = page no.}
local page_size = 8 * 4
function craftingguide.get_formspec(name)
local user = craftingguide.users[name]
local page = user.page
local max_pages = math.floor(#craftingguide.itemlist / page_size) + 1
local form = ""
form = form .. default.ui.get_page("core_craftingguide")
form = form .. "label[0.41,1.74;"..user.itemno.."/"..#craftingguide.items[user.item].."]" -- itemno
form = form .. "label[3.9,8.15;"..page.."/"..max_pages.."]" -- page
form = form .. "label[4.4,2.5;"..user.item.."]" -- itemname
local method = craftingguide.items[user.item][user.itemno].type
if method == "normal" or method == "crafting" then
form = form .. "image[4.25,1.5;1,1;craftingguide_method_crafting.png]"
elseif method == "cooking" then
form = form .. "image[4.25,1.5;1,1;craftingguide_method_cooking.png]"
-- fuel recipes are different
-- elseif method == "fuel" then
-- form = form .. "image[4.25,1.5;1,1;craftingguide_method_fuel.png]"
else
form = form .. "image[4.25,1.5;1,1;craftingguide_method_unknown.png]"
form = form .. "label[4.1,1.73;"..method.."]"
end
form = form .. default.ui.fake_itemstack(6.25, 1.5, ItemStack(user.item), "guide_craftresult")
local craftrecipe = {{}, {}, {}}
local recipes = craftingguide.items[user.item]
local recipe = recipes[user.itemno]
print(dump(recipe))
for slot_index, itemname in pairs(recipe.items) do
local x = slot_index - 1
local group = string.match(itemname, "group:(.*)")
if group == nil then
form = form .. default.ui.fake_simple_itemstack(1.25+(x % recipe.width), 0.5+math.floor(x/recipe.width), itemname, "guide_craftgrid_"..itemname)
else
form = form .. default.ui.item_group(1.25+(x % recipe.width), 0.5+math.floor(x/recipe.width), group, "guide_craftgrid_"..itemname)
end
end
local page_start = ((page * page_size) - page_size) + 1
local inv_x = 0
local inv_y = 0
for item_index = page_start, (page_start + page_size) - 1 do
local recipes = craftingguide.items[craftingguide.itemlist[item_index]]
if recipes ~= nil then
local itemname = ItemStack(recipes[1].output):get_name()
form = form .. default.ui.fake_simple_itemstack(0.25 + inv_x, 4 + inv_y, itemname, "guide_item_"..itemname)
inv_x = inv_x + 1
if inv_x >= 8 then
inv_x = 0
inv_y = inv_y + 1
end
else
break
end
end
return form
end
local function receive_fields(player, form_name, fields)
if form_name == "core_craftingguide" and not fields.quit then
local name = player:get_player_name()
local user = craftingguide.users[name]
local page = user.page
local recipes = craftingguide.items[user.item]
local itemno = user.itemno
local max_pages = math.floor(#craftingguide.itemlist / page_size) + 1
if fields.guide_next_recipe and itemno < #recipes then
itemno = itemno + 1
elseif fields.guide_prev_recipe and itemno > 1 then
itemno = itemno - 1
end
if fields.guide_next and page < max_pages then
page = page + 1
elseif fields.guide_prev and page > 1 then
page = page - 1
end
for fieldname, val in pairs(fields) do
local itemname = string.match(fieldname, "guide_item_(.*)")