Compare commits
53 Commits
Author | SHA1 | Date | |
---|---|---|---|
5e0c49345a | |||
584718a2a7 | |||
46b6cee1fc | |||
7e5dc6c374 | |||
30e57bcc99 | |||
e0673908bf | |||
7ea81f0906 | |||
49ad1c1bf7 | |||
ff80b87783 | |||
e106fd51ca | |||
18d0bdd2bb | |||
60ccb522d4 | |||
d0aa09dd8d | |||
13dfc2c0e9 | |||
1e628ed92a | |||
b468a23f60 | |||
7d63db1703 | |||
f85e9ba691 | |||
fa485f7d63 | |||
da9579846c | |||
8dc6b0124e | |||
4602bd5999 | |||
a3e92c4524 | |||
72f9f64c04 | |||
8bf344e461 | |||
a32751800c | |||
d47201f813 | |||
f2255ccba0 | |||
16b625d963 | |||
bb76f17703 | |||
104018d711 | |||
5e2902fd92 | |||
43b1608f86 | |||
abdc707f28 | |||
15e2470493 | |||
07d3981d61 | |||
d0a98b5331 | |||
195fec2689 | |||
664b45ac75 | |||
b3f4f406c4 | |||
9559f695ec | |||
919c9d152b | |||
253af00743 | |||
579c279be2 | |||
15740ffd3d | |||
a5dcf123e0 | |||
d5fcae085d | |||
3e2781bc00 | |||
e134282093 | |||
428a8127cb | |||
04e560328f | |||
c971ec7dc7 | |||
d09d8f02a4 |
@ -1,7 +1,7 @@
|
|||||||
The main game for the Minetest game engine [minetest_game]
|
The main game for the Minetest game engine [minetest_game]
|
||||||
==========================================================
|
==========================================================
|
||||||
|
|
||||||
To build the wholeness of the Minetest project, insert this repository as
|
To use this game with Minetest, insert this repository as
|
||||||
/games/minetest_game
|
/games/minetest_game
|
||||||
in the Minetest Engine.
|
in the Minetest Engine.
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ The minetest_game github master HEAD is generally compatible with the github
|
|||||||
master HEAD of minetest.
|
master HEAD of minetest.
|
||||||
|
|
||||||
Additionally, when the minetest engine is tagged to be a certain version (eg.
|
Additionally, when the minetest engine is tagged to be a certain version (eg.
|
||||||
0.4.dev-20120326), minetest_game is tagged with the version too.
|
0.4.10), minetest_game is tagged with the version too.
|
||||||
|
|
||||||
When stable releases are made, minetest_game is packaged and made available in
|
When stable releases are made, minetest_game is packaged and made available in
|
||||||
http://minetest.net/download.php
|
http://minetest.net/download.php
|
||||||
@ -50,4 +50,3 @@ http://creativecommons.org/licenses/by-sa/3.0/
|
|||||||
|
|
||||||
License of menu/header.png
|
License of menu/header.png
|
||||||
Copyright (C) 2013 BlockMen CC BY-3.0
|
Copyright (C) 2013 BlockMen CC BY-3.0
|
||||||
|
|
||||||
|
199
game_api.txt
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
minetest_game API
|
||||||
|
======================
|
||||||
|
GitHub Repo: https://github.com/minetest/minetest_game
|
||||||
|
|
||||||
|
Introduction
|
||||||
|
------------
|
||||||
|
The minetest_game gamemode offers multiple new possibilities in addition to Minetest's built-in API, allowing you to
|
||||||
|
add new plants to farming mod, buckets for new liquids, new stairs and custom panes.
|
||||||
|
For information on the Minetest API, visit https://github.com/minetest/minetest/blob/master/doc/lua_api.txt
|
||||||
|
Please note:
|
||||||
|
[XYZ] refers to a section the Minetest API
|
||||||
|
[#ABC] refers to a section in this document
|
||||||
|
^ Explanation for line above
|
||||||
|
|
||||||
|
Bucket API
|
||||||
|
----------
|
||||||
|
The bucket API allows registering new types of buckets for non-default liquids.
|
||||||
|
|
||||||
|
bucket.register_liquid(
|
||||||
|
"default:lava_source", -- Source node name
|
||||||
|
"default:lava_flowing", -- Flowing node name
|
||||||
|
"bucket:bucket_lava", -- Name to be used for bucket
|
||||||
|
"bucket_lava.png", -- Bucket texture (for wielditem and inventory_image)
|
||||||
|
"Lava Bucket" -- Bucket description
|
||||||
|
)
|
||||||
|
|
||||||
|
Doors API
|
||||||
|
---------
|
||||||
|
The doors mod allows modders to register custom doors.
|
||||||
|
|
||||||
|
doors.register_door(name, def)
|
||||||
|
^ name: "Door name"
|
||||||
|
^ def: See [#Door definition]
|
||||||
|
|
||||||
|
#Door definition
|
||||||
|
----------------
|
||||||
|
{
|
||||||
|
description = "Door description",
|
||||||
|
inventory_image = "mod_door_inv.png",
|
||||||
|
groups = {group = 1},
|
||||||
|
tiles_bottom: [Tile definition],
|
||||||
|
^ the tiles of the bottom part of the door {front, side}
|
||||||
|
tiles_top: [Tile definition],
|
||||||
|
^ the tiles of the bottom part of the door {front, side}
|
||||||
|
node_box_bottom = regular nodebox, see [Node boxes], OPTIONAL,
|
||||||
|
node_box_top = regular nodebox, see [Node boxes], OPTIONAL,
|
||||||
|
selection_box_bottom = regular nodebox, see [Node boxes], OPTIONAL,
|
||||||
|
selection_box_top = regular nodebox, see [Node boxes], OPTIONAL,
|
||||||
|
only_placer_can_open = true/false,
|
||||||
|
^ If true, only placer can open the door (locked for others)
|
||||||
|
}
|
||||||
|
|
||||||
|
Farming API
|
||||||
|
-----------
|
||||||
|
The farming API allows you to easily register plants and hoes.
|
||||||
|
|
||||||
|
farming.register_hoe(name, hoe definition)
|
||||||
|
-> Register a new hoe, see [#hoe definition]
|
||||||
|
|
||||||
|
farming.register_plant(name, Plant definition)
|
||||||
|
-> Register a new growing plant, see [#Plant definition]
|
||||||
|
|
||||||
|
#Hoe Definition
|
||||||
|
---------------
|
||||||
|
{
|
||||||
|
description = "", -- Description for tooltip
|
||||||
|
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
|
||||||
|
max_uses = 30, -- Uses until destroyed
|
||||||
|
recipe = { -- Craft recipe
|
||||||
|
{"air", "air", "air"},
|
||||||
|
{"", "group:stick"},
|
||||||
|
{"", "group:stick"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Plant definition
|
||||||
|
-----------------
|
||||||
|
{
|
||||||
|
description = "", -- Description of seed item
|
||||||
|
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
|
||||||
|
steps = 8, -- How many steps the plant has to grow, until it can be harvested
|
||||||
|
^ Always provide a plant texture for ech step, format: modname_plantname_i.png (i = stepnumber)
|
||||||
|
minlight = 13, -- Minimum light to grow
|
||||||
|
maxlight = LIGHT_MAX -- Maximum light to grow
|
||||||
|
}
|
||||||
|
|
||||||
|
Stairs API
|
||||||
|
----------
|
||||||
|
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
|
||||||
|
delivered with minetest_game, to keep them compatible with other mods.
|
||||||
|
|
||||||
|
stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
|
||||||
|
-> Registers a stair.
|
||||||
|
-> subname: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
|
||||||
|
-> recipeitem: Item used in the craft recipe, e.g. "default:cobble"
|
||||||
|
-> groups: see [Known damage and digging time defining groups]
|
||||||
|
-> images: see [Tile definition]
|
||||||
|
-> description: used for the description field in the stair's definition
|
||||||
|
-> sounds: see [#Default sounds]
|
||||||
|
|
||||||
|
stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
|
||||||
|
-> Registers a slabs
|
||||||
|
-> subname: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
|
||||||
|
-> recipeitem: Item used in the craft recipe, e.g. "default:cobble"
|
||||||
|
-> groups: see [Known damage and digging time defining groups]
|
||||||
|
-> images: see [Tile definition]
|
||||||
|
-> description: used for the description field in the stair's definition
|
||||||
|
-> sounds: see [#Default sounds]
|
||||||
|
|
||||||
|
stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
|
||||||
|
-> A wrapper for stairs.register_stair and stairs.register_slab
|
||||||
|
-> Uses almost the same arguments as stairs.register_stair
|
||||||
|
-> desc_stair: Description for stair node
|
||||||
|
-> desc_slab: Description for slab node
|
||||||
|
|
||||||
|
Xpanes API
|
||||||
|
----------
|
||||||
|
Creates panes that automatically connect to each other
|
||||||
|
|
||||||
|
xpanes.register_pane(subname, def)
|
||||||
|
-> subname: used for nodename. Result: "xpanes:subname_{1..16}"
|
||||||
|
-> def: See [#Pane definition]
|
||||||
|
|
||||||
|
#Pane definition
|
||||||
|
----------------
|
||||||
|
{
|
||||||
|
textures = {"texture_Bottom_top", "texture_left_right", "texture_front_back"},
|
||||||
|
^ More tiles aren't supported
|
||||||
|
groups = {group = rating},
|
||||||
|
^ Uses the known node groups, see [Known damage and digging time defining groups]
|
||||||
|
sounds = SoundSpec,
|
||||||
|
^ See [#Default sounds]
|
||||||
|
recipe = {{"","","","","","","","",""}},
|
||||||
|
^ Recipe field only
|
||||||
|
on_construct = function(pos)
|
||||||
|
update_pane(pos, "pane")
|
||||||
|
end,
|
||||||
|
^ Required to handle rotation correctly
|
||||||
|
}
|
||||||
|
|
||||||
|
Default sounds
|
||||||
|
--------------
|
||||||
|
Sounds inside the default table can be used within the sounds field of node definitions.
|
||||||
|
|
||||||
|
default.node_sound_defaults()
|
||||||
|
default.node_sound_stone_defaults()
|
||||||
|
default.node_sound_dirt_defaults()
|
||||||
|
default.node_sound_sand_defaults()
|
||||||
|
default.node_sound_wood_defaults()
|
||||||
|
default.node_sound_leaves_defaults()
|
||||||
|
default.node_sound_glass_defaults()
|
||||||
|
|
||||||
|
Player API
|
||||||
|
----------
|
||||||
|
The player API can register player models and update the player's appearence
|
||||||
|
|
||||||
|
default.player_register_model(name, def)
|
||||||
|
^ Register a new model to be used by players.
|
||||||
|
-> name: model filename such as "character.x", "foo.b3d", etc.
|
||||||
|
-> def: See [#Model definition]
|
||||||
|
|
||||||
|
default.registered_player_models[name]
|
||||||
|
^ Get a model's definition
|
||||||
|
-> see [#Model definition]
|
||||||
|
|
||||||
|
default.player_set_model(player, model_name)
|
||||||
|
^ Change a player's model
|
||||||
|
-> player: PlayerRef
|
||||||
|
-> model_name: model registered with player_register_model()
|
||||||
|
|
||||||
|
default.player_set_animation(player, anim_name [, speed])
|
||||||
|
^ Applies an animation to a player
|
||||||
|
-> anim_name: name of the animation.
|
||||||
|
-> speed: frames per second. If nil, default from the model is used
|
||||||
|
|
||||||
|
default.player_set_textures(player, textures)
|
||||||
|
^ Sets player textures
|
||||||
|
-> player: PlayerRef
|
||||||
|
-> textures: array of textures
|
||||||
|
^ If <textures> is nil, the default textures from the model def are used
|
||||||
|
|
||||||
|
default.player_get_animation(player)
|
||||||
|
^ Returns a table containing fields "model", "textures" and "animation".
|
||||||
|
^ Any of the fields of the returned table may be nil.
|
||||||
|
-> player: PlayerRef
|
||||||
|
|
||||||
|
Model Definition
|
||||||
|
----------------
|
||||||
|
{
|
||||||
|
animation_speed = 30, -- Default animation speed, in FPS.
|
||||||
|
textures = {"character.png", }, -- Default array of textures.
|
||||||
|
visual_size = {x=1, y=1,}, -- Used to scale the model.
|
||||||
|
animations = {
|
||||||
|
-- <anim_name> = { x=<start_frame>, y=<end_frame>, },
|
||||||
|
foo = { x= 0, y=19, },
|
||||||
|
bar = { x=20, y=39, },
|
||||||
|
-- ...
|
||||||
|
},
|
||||||
|
}
|
BIN
menu/icon.png
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 5.6 KiB |
6
minetest.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
mgv6_spflags = biomeblend, jungles
|
||||||
|
|
||||||
|
movement_liquid_sink = 25
|
||||||
|
movement_speed_jump = 6.2
|
||||||
|
movement_liquid_fluidity = 0.8
|
||||||
|
movement_liquid_fluidity_smooth = 2
|
16
mods/boats/README.txt
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
Minetest 0.4 mod: boats
|
||||||
|
=======================
|
||||||
|
by PilzAdam, slightly modified for NeXt
|
||||||
|
|
||||||
|
License of source code:
|
||||||
|
-----------------------
|
||||||
|
WTFPL
|
||||||
|
|
||||||
|
License of media (textures and sounds):
|
||||||
|
---------------------------------------
|
||||||
|
WTFPL
|
||||||
|
|
||||||
|
Authors of media files:
|
||||||
|
-----------------------
|
||||||
|
textures: Zeg9
|
||||||
|
model: thetoon and Zeg9, modified by PavelS(SokolovPavel)
|
@ -1,2 +1 @@
|
|||||||
default
|
default
|
||||||
|
|
208
mods/boats/init.lua
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
|
||||||
|
--
|
||||||
|
-- Helper functions
|
||||||
|
--
|
||||||
|
|
||||||
|
local function is_water(pos)
|
||||||
|
local nn = minetest.get_node(pos).name
|
||||||
|
return minetest.get_item_group(nn, "water") ~= 0
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get_sign(i)
|
||||||
|
if i == 0 then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return i/math.abs(i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get_velocity(v, yaw, y)
|
||||||
|
local x = -math.sin(yaw)*v
|
||||||
|
local z = math.cos(yaw)*v
|
||||||
|
return {x=x, y=y, z=z}
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get_v(v)
|
||||||
|
return math.sqrt(v.x^2+v.z^2)
|
||||||
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Boat entity
|
||||||
|
--
|
||||||
|
|
||||||
|
local boat = {
|
||||||
|
physical = true,
|
||||||
|
collisionbox = {-0.6,-0.4,-0.6, 0.6,0.3,0.6},
|
||||||
|
visual = "mesh",
|
||||||
|
mesh = "boat.x",
|
||||||
|
textures = {"default_wood.png"},
|
||||||
|
|
||||||
|
driver = nil,
|
||||||
|
v = 0,
|
||||||
|
last_v = 0,
|
||||||
|
removed = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function boat.on_rightclick(self, clicker)
|
||||||
|
if not clicker or not clicker:is_player() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local name = clicker:get_player_name()
|
||||||
|
if self.driver and clicker == self.driver then
|
||||||
|
self.driver = nil
|
||||||
|
clicker:set_detach()
|
||||||
|
default.player_attached[name] = false
|
||||||
|
default.player_set_animation(clicker, "stand" , 30)
|
||||||
|
elseif not self.driver then
|
||||||
|
self.driver = clicker
|
||||||
|
clicker:set_attach(self.object, "", {x=0,y=11,z=-3}, {x=0,y=0,z=0})
|
||||||
|
default.player_attached[name] = true
|
||||||
|
minetest.after(0.2, function()
|
||||||
|
default.player_set_animation(clicker, "sit" , 30)
|
||||||
|
end)
|
||||||
|
self.object:setyaw(clicker:get_look_yaw()-math.pi/2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function boat.on_activate(self, staticdata, dtime_s)
|
||||||
|
self.object:set_armor_groups({immortal=1})
|
||||||
|
if staticdata then
|
||||||
|
self.v = tonumber(staticdata)
|
||||||
|
end
|
||||||
|
self.last_v = self.v
|
||||||
|
end
|
||||||
|
|
||||||
|
function boat.get_staticdata()
|
||||||
|
return tostring(v)
|
||||||
|
end
|
||||||
|
|
||||||
|
function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, direction)
|
||||||
|
if not puncher or not puncher:is_player() or self.removed then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
puncher:set_detach()
|
||||||
|
default.player_attached[puncher:get_player_name()] = false
|
||||||
|
|
||||||
|
self.removed = true
|
||||||
|
-- delay remove to ensure player is detached
|
||||||
|
minetest.after(0.1,function()
|
||||||
|
self.object:remove()
|
||||||
|
end)
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
puncher:get_inventory():add_item("main", "boats:boat")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function boat.on_step(self, dtime)
|
||||||
|
self.v = get_v(self.object:getvelocity())*get_sign(self.v)
|
||||||
|
if self.driver then
|
||||||
|
local ctrl = self.driver:get_player_control()
|
||||||
|
local yaw = self.object:getyaw()
|
||||||
|
if ctrl.up then
|
||||||
|
self.v = self.v+0.1
|
||||||
|
end
|
||||||
|
if ctrl.down then
|
||||||
|
self.v = self.v-0.08
|
||||||
|
end
|
||||||
|
if ctrl.left then
|
||||||
|
if ctrl.down then
|
||||||
|
self.object:setyaw(yaw-math.pi/120-dtime*math.pi/120)
|
||||||
|
else
|
||||||
|
self.object:setyaw(yaw+math.pi/120+dtime*math.pi/120)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if ctrl.right then
|
||||||
|
if ctrl.down then
|
||||||
|
self.object:setyaw(yaw+math.pi/120+dtime*math.pi/120)
|
||||||
|
else
|
||||||
|
self.object:setyaw(yaw-math.pi/120-dtime*math.pi/120)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local velo = self.object:getvelocity()
|
||||||
|
if self.v == 0 and velo.x == 0 and velo.z == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local s = get_sign(self.v)
|
||||||
|
self.v = self.v - 0.02*s
|
||||||
|
if s ~= get_sign(self.v) then
|
||||||
|
self.object:setvelocity({x=0, y=0, z=0})
|
||||||
|
self.v = 0
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if math.abs(self.v) > 4.5 then
|
||||||
|
self.v = 4.5*get_sign(self.v)
|
||||||
|
end
|
||||||
|
|
||||||
|
local p = self.object:getpos()
|
||||||
|
p.y = p.y-0.5
|
||||||
|
local new_velo = {x=0,y=0,z=0}
|
||||||
|
local new_acce = {x=0,y=0,z=0}
|
||||||
|
if not is_water(p) then
|
||||||
|
if minetest.registered_nodes[minetest.env:get_node(p).name].walkable then
|
||||||
|
self.v = 0
|
||||||
|
end
|
||||||
|
new_acce = {x=0, y=-10, z=0}
|
||||||
|
new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y)
|
||||||
|
else
|
||||||
|
p.y = p.y+1
|
||||||
|
if is_water(p) then
|
||||||
|
new_acce = {x=0, y=3, z=0}
|
||||||
|
local y = self.object:getvelocity().y
|
||||||
|
if y > 2 then
|
||||||
|
y = 2
|
||||||
|
end
|
||||||
|
if y < 0 then
|
||||||
|
self.object:setacceleration({x=0, y=10, z=0})
|
||||||
|
end
|
||||||
|
new_velo = get_velocity(self.v, self.object:getyaw(), y)
|
||||||
|
else
|
||||||
|
new_acce = {x=0, y=0, z=0}
|
||||||
|
if math.abs(self.object:getvelocity().y) < 1 then
|
||||||
|
local pos = self.object:getpos()
|
||||||
|
pos.y = math.floor(pos.y)+0.5
|
||||||
|
self.object:setpos(pos)
|
||||||
|
new_velo = get_velocity(self.v, self.object:getyaw(), 0)
|
||||||
|
else
|
||||||
|
new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self.object:setvelocity(new_velo)
|
||||||
|
self.object:setacceleration(new_acce)
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_entity("boats:boat", boat)
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_craftitem("boats:boat", {
|
||||||
|
description = "Boat",
|
||||||
|
inventory_image = "boat_inventory.png",
|
||||||
|
wield_image = "boat_wield.png",
|
||||||
|
wield_scale = {x=2, y=2, z=1},
|
||||||
|
liquids_pointable = true,
|
||||||
|
|
||||||
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
if pointed_thing.type ~= "node" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if not is_water(pointed_thing.under) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
pointed_thing.under.y = pointed_thing.under.y+0.5
|
||||||
|
minetest.add_entity(pointed_thing.under, "boats:boat")
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
itemstack:take_item()
|
||||||
|
end
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "boats:boat",
|
||||||
|
recipe = {
|
||||||
|
{"", "", ""},
|
||||||
|
{"group:wood", "", "group:wood"},
|
||||||
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
|
},
|
||||||
|
})
|
11110
mods/boats/models/boat.x
Normal file
BIN
mods/boats/textures/boat_inventory.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
mods/boats/textures/boat_wield.png
Normal file
After Width: | Height: | Size: 847 B |
@ -51,10 +51,34 @@ minetest.register_node("bones:bones", {
|
|||||||
|
|
||||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if meta:get_string("owner") ~= "" and meta:get_inventory():is_empty("main") then
|
if meta:get_inventory():is_empty("main") then
|
||||||
meta:set_string("infotext", meta:get_string("owner").."'s old bones")
|
minetest.remove_node(pos)
|
||||||
meta:set_string("formspec", "")
|
end
|
||||||
meta:set_string("owner", "")
|
end,
|
||||||
|
|
||||||
|
on_punch = function(pos, node, player)
|
||||||
|
if(not is_owner(pos, player:get_player_name())) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local inv = minetest.get_meta(pos):get_inventory()
|
||||||
|
local player_inv = player:get_inventory()
|
||||||
|
local has_space = true
|
||||||
|
|
||||||
|
for i=1,inv:get_size("main") do
|
||||||
|
local stk = inv:get_stack("main", i)
|
||||||
|
if player_inv:room_for_item("main", stk) then
|
||||||
|
inv:set_stack("main", i, nil)
|
||||||
|
player_inv:add_item("main", stk)
|
||||||
|
else
|
||||||
|
has_space = false
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- remove bones if player emptied them
|
||||||
|
if has_space then
|
||||||
|
minetest.remove_node(pos)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -82,23 +106,34 @@ minetest.register_on_dieplayer(function(player)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local player_inv = player:get_inventory()
|
||||||
|
if player_inv:is_empty("main") and
|
||||||
|
player_inv:is_empty("craft") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
pos.x = math.floor(pos.x+0.5)
|
pos.x = math.floor(pos.x+0.5)
|
||||||
pos.y = math.floor(pos.y+0.5)
|
pos.y = math.floor(pos.y+0.5)
|
||||||
pos.z = math.floor(pos.z+0.5)
|
pos.z = math.floor(pos.z+0.5)
|
||||||
local param2 = minetest.dir_to_facedir(player:get_look_dir())
|
local param2 = minetest.dir_to_facedir(player:get_look_dir())
|
||||||
|
local player_name = player:get_player_name()
|
||||||
|
local player_inv = player:get_inventory()
|
||||||
|
|
||||||
local nn = minetest.get_node(pos).name
|
local nn = minetest.get_node(pos).name
|
||||||
if minetest.registered_nodes[nn].can_dig and
|
if minetest.registered_nodes[nn].can_dig and
|
||||||
not minetest.registered_nodes[nn].can_dig(pos, player) then
|
not minetest.registered_nodes[nn].can_dig(pos, player) then
|
||||||
local player_inv = player:get_inventory()
|
|
||||||
|
|
||||||
|
-- drop items instead of delete
|
||||||
for i=1,player_inv:get_size("main") do
|
for i=1,player_inv:get_size("main") do
|
||||||
player_inv:set_stack("main", i, nil)
|
minetest.add_item(pos, player_inv:get_stack("main", i))
|
||||||
end
|
end
|
||||||
for i=1,player_inv:get_size("craft") do
|
for i=1,player_inv:get_size("craft") do
|
||||||
player_inv:set_stack("craft", i, nil)
|
minetest.add_item(pos, player_inv:get_stack("craft", i))
|
||||||
end
|
end
|
||||||
|
-- empty lists main and craft
|
||||||
|
player_inv:set_list("main", {})
|
||||||
|
player_inv:set_list("craft", {})
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -107,23 +142,27 @@ minetest.register_on_dieplayer(function(player)
|
|||||||
|
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local player_inv = player:get_inventory()
|
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
|
|
||||||
local empty_list = inv:get_list("main")
|
|
||||||
inv:set_list("main", player_inv:get_list("main"))
|
inv:set_list("main", player_inv:get_list("main"))
|
||||||
player_inv:set_list("main", empty_list)
|
|
||||||
|
|
||||||
for i=1,player_inv:get_size("craft") do
|
for i=1,player_inv:get_size("craft") do
|
||||||
inv:add_item("main", player_inv:get_stack("craft", i))
|
local stack = player_inv:get_stack("craft", i)
|
||||||
player_inv:set_stack("craft", i, nil)
|
if inv:room_for_item("main", stack) then
|
||||||
|
inv:add_item("main", stack)
|
||||||
|
else
|
||||||
|
--drop if no space left
|
||||||
|
minetest.add_item(pos, stack)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
player_inv:set_list("main", {})
|
||||||
|
player_inv:set_list("craft", {})
|
||||||
|
|
||||||
meta:set_string("formspec", "size[8,9;]"..
|
meta:set_string("formspec", "size[8,9;]"..
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
"list[current_name;main;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]")
|
"list[current_player;main;0,5;8,4;]")
|
||||||
meta:set_string("infotext", player:get_player_name().."'s fresh bones")
|
meta:set_string("infotext", player_name.."'s fresh bones")
|
||||||
meta:set_string("owner", player:get_player_name())
|
meta:set_string("owner", player_name)
|
||||||
meta:set_int("time", 0)
|
meta:set_int("time", 0)
|
||||||
|
|
||||||
local timer = minetest.get_node_timer(pos)
|
local timer = minetest.get_node_timer(pos)
|
||||||
|
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 187 B |
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 163 B |
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 169 B |
@ -72,9 +72,14 @@ trash:set_size("main", 1)
|
|||||||
creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
|
creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
|
||||||
pagenum = math.floor(pagenum)
|
pagenum = math.floor(pagenum)
|
||||||
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1)
|
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1)
|
||||||
player:set_inventory_formspec("size[13,7.5]"..
|
player:set_inventory_formspec(
|
||||||
|
"size[13,7.5]"..
|
||||||
--"image[6,0.6;1,2;player.png]"..
|
--"image[6,0.6;1,2;player.png]"..
|
||||||
"list[current_player;main;5,3.5;8,4;]"..
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"list[current_player;main;5,3.5;8,1;]"..
|
||||||
|
"list[current_player;main;5,4.75;8,3;8]"..
|
||||||
"list[current_player;craft;8,0;3,3;]"..
|
"list[current_player;craft;8,0;3,3;]"..
|
||||||
"list[current_player;craftpreview;12,1;1,1;]"..
|
"list[current_player;craftpreview;12,1;1,1;]"..
|
||||||
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
|
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
|
||||||
@ -82,7 +87,9 @@ creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
|
|||||||
"button[0.3,6.5;1.6,1;creative_prev;<<]"..
|
"button[0.3,6.5;1.6,1;creative_prev;<<]"..
|
||||||
"button[2.7,6.5;1.6,1;creative_next;>>]"..
|
"button[2.7,6.5;1.6,1;creative_next;>>]"..
|
||||||
"label[5,1.5;Trash:]"..
|
"label[5,1.5;Trash:]"..
|
||||||
"list[detached:creative_trash;main;5,2;1,1;]")
|
"list[detached:creative_trash;main;5,2;1,1;]"..
|
||||||
|
default.get_hotbar_bg(5,3.5)
|
||||||
|
)
|
||||||
end
|
end
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
-- If in creative mode, modify player's inventory forms
|
-- If in creative mode, modify player's inventory forms
|
||||||
|
@ -27,7 +27,6 @@ Cisoun's WTFPL texture pack:
|
|||||||
default_chest_lock.png
|
default_chest_lock.png
|
||||||
default_chest_side.png
|
default_chest_side.png
|
||||||
default_chest_top.png
|
default_chest_top.png
|
||||||
default_stone_brick.png
|
|
||||||
default_dirt.png
|
default_dirt.png
|
||||||
default_grass.png
|
default_grass.png
|
||||||
default_grass_side.png
|
default_grass_side.png
|
||||||
@ -38,23 +37,14 @@ Cisoun's WTFPL texture pack:
|
|||||||
default_sapling.png
|
default_sapling.png
|
||||||
default_sign_wall.png
|
default_sign_wall.png
|
||||||
default_stone.png
|
default_stone.png
|
||||||
default_tool_mesepick.png
|
|
||||||
default_tool_steelpick.png
|
|
||||||
default_tool_steelshovel.png
|
|
||||||
default_tool_stonepick.png
|
|
||||||
default_tool_stoneshovel.png
|
|
||||||
default_tool_woodpick.png
|
|
||||||
default_tool_woodshovel.png
|
|
||||||
default_tree.png
|
default_tree.png
|
||||||
default_tree_top.png
|
default_tree_top.png
|
||||||
default_water.png
|
default_water.png
|
||||||
|
|
||||||
Originating from G4JC's Almost MC Texture Pack:
|
Originating from G4JC's Almost MC Texture Pack:
|
||||||
default_wood.png
|
|
||||||
default_torch.png
|
default_torch.png
|
||||||
default_torch_on_ceiling.png
|
default_torch_on_ceiling.png
|
||||||
default_torch_on_floor.png
|
default_torch_on_floor.png
|
||||||
default_cobble.png
|
|
||||||
|
|
||||||
VanessaE's animated torches (WTFPL):
|
VanessaE's animated torches (WTFPL):
|
||||||
default_torch_animated.png
|
default_torch_animated.png
|
||||||
@ -80,11 +70,7 @@ VanessaE (WTFPL):
|
|||||||
|
|
||||||
Calinou (CC BY-SA):
|
Calinou (CC BY-SA):
|
||||||
default_brick.png
|
default_brick.png
|
||||||
default_clay_brick.png
|
|
||||||
default_papyrus.png
|
default_papyrus.png
|
||||||
default_tool_steelsword.png
|
|
||||||
default_bronze_ingot.png
|
|
||||||
default_copper_ingot.png
|
|
||||||
default_copper_lump.png
|
default_copper_lump.png
|
||||||
default_mineral_copper.png
|
default_mineral_copper.png
|
||||||
|
|
||||||
@ -101,21 +87,8 @@ PilzAdam (WTFPL):
|
|||||||
default_obsidian_glass.png
|
default_obsidian_glass.png
|
||||||
default_obsidian_shard.png
|
default_obsidian_shard.png
|
||||||
default_mossycobble.png
|
default_mossycobble.png
|
||||||
default_gold_ingot.png
|
|
||||||
default_gold_lump.png
|
default_gold_lump.png
|
||||||
default_mineral_gold.png
|
default_mineral_gold.png
|
||||||
default_diamond.png
|
|
||||||
default_tool_diamondpick.png
|
|
||||||
default_tool_diamondsword.png
|
|
||||||
default_tool_diamondshovel.png
|
|
||||||
default_tool_diamondaxe.png
|
|
||||||
default_tool_meseaxe.png
|
|
||||||
default_tool_meseshovel.png
|
|
||||||
default_tool_mesesword.png
|
|
||||||
default_tool_bronzeaxe.png
|
|
||||||
default_tool_bronzepick.png
|
|
||||||
default_tool_bronzeshovel.png
|
|
||||||
default_tool_bronzesword.png
|
|
||||||
default_snowball.png
|
default_snowball.png
|
||||||
|
|
||||||
jojoa1997 (WTFPL):
|
jojoa1997 (WTFPL):
|
||||||
@ -135,10 +108,33 @@ Zeg9 (CC BY-SA 3.0):
|
|||||||
default_copper_block.png
|
default_copper_block.png
|
||||||
default_bronze_block.png
|
default_bronze_block.png
|
||||||
default_gold_block.png
|
default_gold_block.png
|
||||||
default_diamond_block.png
|
|
||||||
|
|
||||||
kaeza (WTFPL):
|
paramat (CC BY-SA 3.0):
|
||||||
|
wieldhand.png, based on character.png by Jordach (CC BY-SA 3.0)
|
||||||
|
|
||||||
|
brunob.santos (CC BY-SA 4.0):
|
||||||
|
default_desert_cobble.png
|
||||||
|
|
||||||
|
BlockMen (CC BY-SA 3.0):
|
||||||
|
default_stone_brick.png
|
||||||
|
default_wood.png
|
||||||
|
default_cobble.png
|
||||||
|
default_clay_brick.png
|
||||||
|
default_tool_steelsword.png
|
||||||
|
default_bronze_ingot.png
|
||||||
|
default_copper_ingot.png
|
||||||
|
default_gold_ingot.png
|
||||||
|
default_diamond.png
|
||||||
|
default_diamond_block.png
|
||||||
|
default_tool_*.png
|
||||||
|
default_lava_source_animated.png
|
||||||
|
default_lava_flowing_animated.png
|
||||||
|
default_book.png
|
||||||
|
default_paper.png
|
||||||
|
default_stick.png
|
||||||
bubble.png
|
bubble.png
|
||||||
|
heart.png
|
||||||
|
gui_*.png
|
||||||
|
|
||||||
Glass breaking sounds (CC BY 3.0):
|
Glass breaking sounds (CC BY 3.0):
|
||||||
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
|
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
-- legacy (Minetest 0.4 mod)
|
-- aliases (Minetest 0.4 mod)
|
||||||
-- Provides as much backwards-compatibility as feasible
|
-- Provides alias for most default items
|
||||||
|
|
||||||
--
|
|
||||||
-- Aliases to support loading 0.3 and old 0.4 worlds and inventories
|
|
||||||
--
|
|
||||||
|
|
||||||
minetest.register_alias("stone", "default:stone")
|
minetest.register_alias("stone", "default:stone")
|
||||||
minetest.register_alias("stone_with_coal", "default:stone_with_coal")
|
minetest.register_alias("stone_with_coal", "default:stone_with_coal")
|
||||||
@ -69,39 +65,3 @@ minetest.register_alias("lump_of_iron", "default:iron_lump")
|
|||||||
minetest.register_alias("lump_of_clay", "default:clay_lump")
|
minetest.register_alias("lump_of_clay", "default:clay_lump")
|
||||||
minetest.register_alias("steel_ingot", "default:steel_ingot")
|
minetest.register_alias("steel_ingot", "default:steel_ingot")
|
||||||
minetest.register_alias("clay_brick", "default:clay_brick")
|
minetest.register_alias("clay_brick", "default:clay_brick")
|
||||||
minetest.register_alias("scorched_stuff", "default:scorched_stuff")
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Old items
|
|
||||||
--
|
|
||||||
|
|
||||||
minetest.register_craftitem(":rat", {
|
|
||||||
description = "Rat",
|
|
||||||
inventory_image = "rat.png",
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craftitem(":cooked_rat", {
|
|
||||||
description = "Cooked rat",
|
|
||||||
inventory_image = "cooked_rat.png",
|
|
||||||
on_use = minetest.item_eat(6),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craftitem(":firefly", {
|
|
||||||
description = "Firefly",
|
|
||||||
inventory_image = "firefly.png",
|
|
||||||
groups = {not_in_creative_inventory=1},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "cooking",
|
|
||||||
output = "cooked_rat",
|
|
||||||
recipe = "rat",
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "cooking",
|
|
||||||
output = "scorched_stuff",
|
|
||||||
recipe = "cooked_rat",
|
|
||||||
})
|
|
||||||
|
|
||||||
-- END
|
|
@ -208,6 +208,60 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:axe_wood',
|
||||||
|
recipe = {
|
||||||
|
{'group:wood', 'group:wood'},
|
||||||
|
{'default:stick', 'group:wood'},
|
||||||
|
{'default:stick',''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:axe_stone',
|
||||||
|
recipe = {
|
||||||
|
{'group:stone', 'group:stone'},
|
||||||
|
{'default:stick', 'group:stone'},
|
||||||
|
{'default:stick', ''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:axe_steel',
|
||||||
|
recipe = {
|
||||||
|
{'default:steel_ingot', 'default:steel_ingot'},
|
||||||
|
{'default:stick', 'default:steel_ingot'},
|
||||||
|
{'default:stick', ''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:axe_bronze',
|
||||||
|
recipe = {
|
||||||
|
{'default:bronze_ingot', 'default:bronze_ingot'},
|
||||||
|
{'default:stick', 'default:bronze_ingot'},
|
||||||
|
{'default:stick', ''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:axe_mese',
|
||||||
|
recipe = {
|
||||||
|
{'default:mese_crystal', 'default:mese_crystal'},
|
||||||
|
{'default:stick', 'default:mese_crystal'},
|
||||||
|
{'default:stick', ''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'default:axe_diamond',
|
||||||
|
recipe = {
|
||||||
|
{'default:diamond', 'default:diamond'},
|
||||||
|
{'default:stick', 'default:diamond'},
|
||||||
|
{'default:stick', ''},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:sword_wood',
|
output = 'default:sword_wood',
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -416,7 +470,7 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:sandstonebrick',
|
output = 'default:sandstonebrick 4',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:sandstone', 'default:sandstone'},
|
{'default:sandstone', 'default:sandstone'},
|
||||||
{'default:sandstone', 'default:sandstone'},
|
{'default:sandstone', 'default:sandstone'},
|
||||||
@ -520,7 +574,7 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:stonebrick',
|
output = 'default:stonebrick 4',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:stone', 'default:stone'},
|
{'default:stone', 'default:stone'},
|
||||||
{'default:stone', 'default:stone'},
|
{'default:stone', 'default:stone'},
|
||||||
@ -528,7 +582,7 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:desert_stonebrick',
|
output = 'default:desert_stonebrick 4',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:desert_stone', 'default:desert_stone'},
|
{'default:desert_stone', 'default:desert_stone'},
|
||||||
{'default:desert_stone', 'default:desert_stone'},
|
{'default:desert_stone', 'default:desert_stone'},
|
||||||
@ -581,6 +635,12 @@ minetest.register_craft({
|
|||||||
recipe = "default:cobble",
|
recipe = "default:cobble",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "cooking",
|
||||||
|
output = "default:desert_stone",
|
||||||
|
recipe = "default:desert_cobble",
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
output = "default:steel_ingot",
|
output = "default:steel_ingot",
|
||||||
|
@ -81,11 +81,6 @@ minetest.register_craftitem("default:clay_brick", {
|
|||||||
inventory_image = "default_clay_brick.png",
|
inventory_image = "default_clay_brick.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("default:scorched_stuff", {
|
|
||||||
description = "Scorched Stuff",
|
|
||||||
inventory_image = "default_scorched_stuff.png",
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craftitem("default:obsidian_shard", {
|
minetest.register_craftitem("default:obsidian_shard", {
|
||||||
description = "Obsidian Shard",
|
description = "Obsidian Shard",
|
||||||
inventory_image = "default_obsidian_shard.png",
|
inventory_image = "default_obsidian_shard.png",
|
||||||
|
@ -266,6 +266,19 @@ minetest.register_abm({
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--
|
||||||
|
-- dig upwards
|
||||||
|
--
|
||||||
|
|
||||||
|
function default.dig_up(pos, node, digger)
|
||||||
|
if digger == nil then return end
|
||||||
|
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||||
|
local nn = minetest.get_node(np)
|
||||||
|
if nn.name == node.name then
|
||||||
|
minetest.node_dig(np, nn, digger)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Leafdecay
|
-- Leafdecay
|
||||||
--
|
--
|
||||||
|
@ -11,6 +11,30 @@ LIGHT_MAX = 14
|
|||||||
-- Definitions made by this mod that other mods can use too
|
-- Definitions made by this mod that other mods can use too
|
||||||
default = {}
|
default = {}
|
||||||
|
|
||||||
|
-- GUI related stuff
|
||||||
|
default.gui_bg = "bgcolor[#080808BB;true]"
|
||||||
|
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
|
||||||
|
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
|
||||||
|
|
||||||
|
function default.get_hotbar_bg(x,y)
|
||||||
|
local out = ""
|
||||||
|
for i=0,7,1 do
|
||||||
|
out = out .."image["..x+i..","..y..";1,1;gui_hb_bg.png]"
|
||||||
|
end
|
||||||
|
return out
|
||||||
|
end
|
||||||
|
|
||||||
|
default.gui_suvival_form = "size[8,8.5]"..
|
||||||
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"list[current_player;main;0,4.25;8,1;]"..
|
||||||
|
"list[current_player;main;0,5.5;8,3;8]"..
|
||||||
|
"list[current_player;craft;1.75,0.5;3,3;]"..
|
||||||
|
"list[current_player;craftpreview;5.75,1.5;1,1;]"..
|
||||||
|
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
||||||
|
default.get_hotbar_bg(0,4.25)
|
||||||
|
|
||||||
-- Load files
|
-- Load files
|
||||||
dofile(minetest.get_modpath("default").."/functions.lua")
|
dofile(minetest.get_modpath("default").."/functions.lua")
|
||||||
dofile(minetest.get_modpath("default").."/nodes.lua")
|
dofile(minetest.get_modpath("default").."/nodes.lua")
|
||||||
@ -20,3 +44,4 @@ dofile(minetest.get_modpath("default").."/crafting.lua")
|
|||||||
dofile(minetest.get_modpath("default").."/mapgen.lua")
|
dofile(minetest.get_modpath("default").."/mapgen.lua")
|
||||||
dofile(minetest.get_modpath("default").."/player.lua")
|
dofile(minetest.get_modpath("default").."/player.lua")
|
||||||
dofile(minetest.get_modpath("default").."/trees.lua")
|
dofile(minetest.get_modpath("default").."/trees.lua")
|
||||||
|
dofile(minetest.get_modpath("default").."/aliases.lua")
|
||||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.7 KiB |
@ -15,7 +15,7 @@ minetest.register_node("default:desert_stone", {
|
|||||||
tiles = {"default_desert_stone.png"},
|
tiles = {"default_desert_stone.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {cracky=3, stone=1},
|
groups = {cracky=3, stone=1},
|
||||||
drop = 'default:desert_stone',
|
drop = 'default:desert_cobble',
|
||||||
legacy_mineral = true,
|
legacy_mineral = true,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
@ -255,10 +255,10 @@ minetest.register_node("default:junglewood", {
|
|||||||
minetest.register_node("default:jungleleaves", {
|
minetest.register_node("default:jungleleaves", {
|
||||||
description = "Jungle Leaves",
|
description = "Jungle Leaves",
|
||||||
drawtype = "allfaces_optional",
|
drawtype = "allfaces_optional",
|
||||||
|
waving = 1,
|
||||||
visual_scale = 1.3,
|
visual_scale = 1.3,
|
||||||
tiles = {"default_jungleleaves.png"},
|
tiles = {"default_jungleleaves.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
waving = 1,
|
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
|
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
|
||||||
drop = {
|
drop = {
|
||||||
@ -299,6 +299,7 @@ minetest.register_node("default:junglesapling", {
|
|||||||
minetest.register_node("default:junglegrass", {
|
minetest.register_node("default:junglegrass", {
|
||||||
description = "Jungle Grass",
|
description = "Jungle Grass",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
|
waving = 1,
|
||||||
visual_scale = 1.3,
|
visual_scale = 1.3,
|
||||||
tiles = {"default_junglegrass.png"},
|
tiles = {"default_junglegrass.png"},
|
||||||
inventory_image = "default_junglegrass.png",
|
inventory_image = "default_junglegrass.png",
|
||||||
@ -318,10 +319,10 @@ minetest.register_node("default:junglegrass", {
|
|||||||
minetest.register_node("default:leaves", {
|
minetest.register_node("default:leaves", {
|
||||||
description = "Leaves",
|
description = "Leaves",
|
||||||
drawtype = "allfaces_optional",
|
drawtype = "allfaces_optional",
|
||||||
|
waving = 1,
|
||||||
visual_scale = 1.3,
|
visual_scale = 1.3,
|
||||||
tiles = {"default_leaves.png"},
|
tiles = {"default_leaves.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
waving = 1,
|
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
|
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
|
||||||
drop = {
|
drop = {
|
||||||
@ -349,7 +350,10 @@ minetest.register_node("default:cactus", {
|
|||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {snappy=1,choppy=3,flammable=2},
|
groups = {snappy=1,choppy=3,flammable=2},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
on_place = minetest.rotate_node
|
on_place = minetest.rotate_node,
|
||||||
|
after_dig_node = function(pos, node, metadata, digger)
|
||||||
|
default.dig_up(pos, node, digger)
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:papyrus", {
|
minetest.register_node("default:papyrus", {
|
||||||
@ -367,14 +371,77 @@ minetest.register_node("default:papyrus", {
|
|||||||
},
|
},
|
||||||
groups = {snappy=3,flammable=2},
|
groups = {snappy=3,flammable=2},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
after_dig_node = function(pos, node, metadata, digger)
|
||||||
|
default.dig_up(pos, node, digger)
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
default.bookshelf_formspec =
|
||||||
|
"size[8,7;]"..
|
||||||
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"list[context;books;0,0.3;8,2;]"..
|
||||||
|
"list[current_player;main;0,2.85;8,1;]"..
|
||||||
|
"list[current_player;main;0,4.08;8,3;8]"..
|
||||||
|
default.get_hotbar_bg(0,2.85)
|
||||||
|
|
||||||
minetest.register_node("default:bookshelf", {
|
minetest.register_node("default:bookshelf", {
|
||||||
description = "Bookshelf",
|
description = "Bookshelf",
|
||||||
tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
|
tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
|
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_construct = function(pos)
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
meta:set_string("formspec", default.bookshelf_formspec)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
inv:set_size("books", 8*2)
|
||||||
|
end,
|
||||||
|
can_dig = function(pos,player)
|
||||||
|
local meta = minetest.env:get_meta(pos);
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
return inv:is_empty("books")
|
||||||
|
end,
|
||||||
|
|
||||||
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
if listname == "books" then
|
||||||
|
if stack:get_name() == "default:book" then
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
local stack = inv:get_stack(from_list, from_index)
|
||||||
|
local to_stack = inv:get_stack(to_list, to_index)
|
||||||
|
if to_list == "books" then
|
||||||
|
if stack:get_name() == "default:book" and to_stack:is_empty() then
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
minetest.log("action", player:get_player_name()..
|
||||||
|
" moves stuff in bookshelf at "..minetest.pos_to_string(pos))
|
||||||
|
end,
|
||||||
|
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
|
minetest.log("action", player:get_player_name()..
|
||||||
|
" moves stuff to bookshelf at "..minetest.pos_to_string(pos))
|
||||||
|
end,
|
||||||
|
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
|
minetest.log("action", player:get_player_name()..
|
||||||
|
" takes stuff from bookshelf at "..minetest.pos_to_string(pos))
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:glass", {
|
minetest.register_node("default:glass", {
|
||||||
@ -389,12 +456,13 @@ minetest.register_node("default:glass", {
|
|||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local fence_texture = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126"
|
||||||
minetest.register_node("default:fence_wood", {
|
minetest.register_node("default:fence_wood", {
|
||||||
description = "Wooden Fence",
|
description = "Wooden Fence",
|
||||||
drawtype = "fencelike",
|
drawtype = "fencelike",
|
||||||
tiles = {"default_wood.png"},
|
tiles = {"default_wood.png"},
|
||||||
inventory_image = "default_fence.png",
|
inventory_image = fence_texture,
|
||||||
wield_image = "default_fence.png",
|
wield_image = fence_texture,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
selection_box = {
|
selection_box = {
|
||||||
@ -665,15 +733,25 @@ minetest.register_node("default:sign_wall", {
|
|||||||
|
|
||||||
default.chest_formspec =
|
default.chest_formspec =
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
default.gui_bg..
|
||||||
"list[current_player;main;0,5;8,4;]"
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"list[current_name;main;0,0.3;8,4;]"..
|
||||||
|
"list[current_player;main;0,4.85;8,1;]"..
|
||||||
|
"list[current_player;main;0,6.08;8,3;8]"..
|
||||||
|
default.get_hotbar_bg(0,4.85)
|
||||||
|
|
||||||
function default.get_locked_chest_formspec(pos)
|
function default.get_locked_chest_formspec(pos)
|
||||||
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
|
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
|
||||||
local formspec =
|
local formspec =
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
"list[nodemeta:".. spos .. ";main;0,0;8,4;]"..
|
default.gui_bg..
|
||||||
"list[current_player;main;0,5;8,4;]"
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"..
|
||||||
|
"list[current_player;main;0,4.85;8,1;]"..
|
||||||
|
"list[current_player;main;0,6.08;8,3;8]"..
|
||||||
|
default.get_hotbar_bg(0,4.85)
|
||||||
return formspec
|
return formspec
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -750,10 +828,6 @@ minetest.register_node("default:chest_locked", {
|
|||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
|
||||||
" tried to access a locked chest belonging to "..
|
|
||||||
meta:get_string("owner").." at "..
|
|
||||||
minetest.pos_to_string(pos))
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
return count
|
return count
|
||||||
@ -761,10 +835,6 @@ minetest.register_node("default:chest_locked", {
|
|||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
|
||||||
" tried to access a locked chest belonging to "..
|
|
||||||
meta:get_string("owner").." at "..
|
|
||||||
minetest.pos_to_string(pos))
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
@ -772,18 +842,10 @@ minetest.register_node("default:chest_locked", {
|
|||||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
|
||||||
" tried to access a locked chest belonging to "..
|
|
||||||
meta:get_string("owner").." at "..
|
|
||||||
minetest.pos_to_string(pos))
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
|
||||||
minetest.log("action", player:get_player_name()..
|
|
||||||
" moves stuff in locked chest at "..minetest.pos_to_string(pos))
|
|
||||||
end,
|
|
||||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" moves stuff to locked chest at "..minetest.pos_to_string(pos))
|
" moves stuff to locked chest at "..minetest.pos_to_string(pos))
|
||||||
@ -804,25 +866,54 @@ minetest.register_node("default:chest_locked", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
function default.get_furnace_active_formspec(pos, percent)
|
function default.furnace_active(pos, percent, item_percent)
|
||||||
local formspec =
|
local formspec =
|
||||||
"size[8,9]"..
|
"size[8,8.5]"..
|
||||||
"image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
|
default.gui_bg..
|
||||||
|
default.gui_bg_img..
|
||||||
|
default.gui_slots..
|
||||||
|
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||||
|
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||||
|
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
|
||||||
(100-percent)..":default_furnace_fire_fg.png]"..
|
(100-percent)..":default_furnace_fire_fg.png]"..
|
||||||
"list[current_name;fuel;2,3;1,1;]"..
|
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:"..
|
||||||
"list[current_name;src;2,1;1,1;]"..
|
(item_percent*100)..":gui_furnace_arrow_fg.png^[transformR270]"..
|
||||||
"list[current_name;dst;5,1;2,2;]"..
|
"list[current_name;dst;4.75,0.96;2,2;]"..
|
||||||
"list[current_player;main;0,5;8,4;]"
|
"list[current_player;main;0,4.25;8,1;]"..
|
||||||
|
"list[current_player;main;0,5.5;8,3;8]"..
|
||||||
|
default.get_hotbar_bg(0,4.25)
|
||||||
return formspec
|
return formspec
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function default.get_furnace_active_formspec(pos, percent)
|
||||||
|
local meta = minetest.get_meta(pos)local inv = meta:get_inventory()
|
||||||
|
local srclist = inv:get_list("src")
|
||||||
|
local cooked = nil
|
||||||
|
local aftercooked = nil
|
||||||
|
if srclist then
|
||||||
|
cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||||
|
end
|
||||||
|
local item_percent = 0
|
||||||
|
if cooked then
|
||||||
|
item_percent = meta:get_float("src_time")/cooked.time
|
||||||
|
end
|
||||||
|
|
||||||
|
return default.furnace_active(pos, percent, item_percent)
|
||||||
|
end
|
||||||
|
|
||||||
default.furnace_inactive_formspec =
|
default.furnace_inactive_formspec =
|
||||||
"size[8,9]"..
|
"size[8,8.5]"..
|
||||||
"image[2,2;1,1;default_furnace_fire_bg.png]"..
|
default.gui_bg..
|
||||||
"list[current_name;fuel;2,3;1,1;]"..
|
default.gui_bg_img..
|
||||||
"list[current_name;src;2,1;1,1;]"..
|
default.gui_slots..
|
||||||
"list[current_name;dst;5,1;2,2;]"..
|
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||||
"list[current_player;main;0,5;8,4;]"
|
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||||
|
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
|
||||||
|
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
||||||
|
"list[current_name;dst;4.75,0.96;2,2;]"..
|
||||||
|
"list[current_player;main;0,4.25;8,1;]"..
|
||||||
|
"list[current_player;main;0,5.5;8,3;8]"..
|
||||||
|
default.get_hotbar_bg(0,4.25)
|
||||||
|
|
||||||
minetest.register_node("default:furnace", {
|
minetest.register_node("default:furnace", {
|
||||||
description = "Furnace",
|
description = "Furnace",
|
||||||
@ -855,6 +946,9 @@ minetest.register_node("default:furnace", {
|
|||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if listname == "fuel" then
|
if listname == "fuel" then
|
||||||
@ -873,6 +967,9 @@ minetest.register_node("default:furnace", {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local stack = inv:get_stack(from_list, from_index)
|
local stack = inv:get_stack(from_list, from_index)
|
||||||
@ -891,12 +988,33 @@ minetest.register_node("default:furnace", {
|
|||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
return stack:get_count()
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:furnace_active", {
|
minetest.register_node("default:furnace_active", {
|
||||||
description = "Furnace",
|
description = "Furnace",
|
||||||
tiles = {"default_furnace_top.png", "default_furnace_bottom.png", "default_furnace_side.png",
|
tiles = {
|
||||||
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_front_active.png"},
|
"default_furnace_top.png",
|
||||||
|
"default_furnace_bottom.png",
|
||||||
|
"default_furnace_side.png",
|
||||||
|
"default_furnace_side.png",
|
||||||
|
"default_furnace_side.png",
|
||||||
|
{
|
||||||
|
image = "default_furnace_front_active.png",
|
||||||
|
backface_culling = false,
|
||||||
|
animation = {
|
||||||
|
type = "vertical_frames",
|
||||||
|
aspect_w = 16,
|
||||||
|
aspect_h = 16,
|
||||||
|
length = 1.5
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
light_source = 8,
|
light_source = 8,
|
||||||
drop = "default:furnace",
|
drop = "default:furnace",
|
||||||
@ -926,6 +1044,9 @@ minetest.register_node("default:furnace_active", {
|
|||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if listname == "fuel" then
|
if listname == "fuel" then
|
||||||
@ -944,6 +1065,9 @@ minetest.register_node("default:furnace_active", {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local stack = inv:get_stack(from_list, from_index)
|
local stack = inv:get_stack(from_list, from_index)
|
||||||
@ -962,6 +1086,12 @@ minetest.register_node("default:furnace_active", {
|
|||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
return stack:get_count()
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
local function swap_node(pos,name)
|
local function swap_node(pos,name)
|
||||||
@ -1042,7 +1172,7 @@ minetest.register_abm({
|
|||||||
fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
|
fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
|
||||||
end
|
end
|
||||||
|
|
||||||
if fuel.time <= 0 then
|
if not fuel or fuel.time <= 0 then
|
||||||
meta:set_string("infotext","Furnace out of fuel")
|
meta:set_string("infotext","Furnace out of fuel")
|
||||||
swap_node(pos,"default:furnace")
|
swap_node(pos,"default:furnace")
|
||||||
meta:set_string("formspec", default.furnace_inactive_formspec)
|
meta:set_string("formspec", default.furnace_inactive_formspec)
|
||||||
@ -1073,6 +1203,14 @@ minetest.register_node("default:cobble", {
|
|||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_node("default:desert_cobble", {
|
||||||
|
description = "Desert Cobblestone",
|
||||||
|
tiles = {"default_desert_cobble.png"},
|
||||||
|
is_ground_content = true,
|
||||||
|
groups = {cracky=3, stone=2},
|
||||||
|
sounds = default.node_sound_stone_defaults(),
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_node("default:mossycobble", {
|
minetest.register_node("default:mossycobble", {
|
||||||
description = "Mossy Cobblestone",
|
description = "Mossy Cobblestone",
|
||||||
tiles = {"default_mossycobble.png"},
|
tiles = {"default_mossycobble.png"},
|
||||||
@ -1223,12 +1361,12 @@ minetest.register_node("default:apple", {
|
|||||||
minetest.register_node("default:dry_shrub", {
|
minetest.register_node("default:dry_shrub", {
|
||||||
description = "Dry Shrub",
|
description = "Dry Shrub",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
|
waving = 1,
|
||||||
visual_scale = 1.0,
|
visual_scale = 1.0,
|
||||||
tiles = {"default_dry_shrub.png"},
|
tiles = {"default_dry_shrub.png"},
|
||||||
inventory_image = "default_dry_shrub.png",
|
inventory_image = "default_dry_shrub.png",
|
||||||
wield_image = "default_dry_shrub.png",
|
wield_image = "default_dry_shrub.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
waving = 1,
|
|
||||||
walkable = false,
|
walkable = false,
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
@ -1243,6 +1381,7 @@ minetest.register_node("default:dry_shrub", {
|
|||||||
minetest.register_node("default:grass_1", {
|
minetest.register_node("default:grass_1", {
|
||||||
description = "Grass",
|
description = "Grass",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
|
waving = 1,
|
||||||
tiles = {"default_grass_1.png"},
|
tiles = {"default_grass_1.png"},
|
||||||
-- use a bigger inventory image
|
-- use a bigger inventory image
|
||||||
inventory_image = "default_grass_3.png",
|
inventory_image = "default_grass_3.png",
|
||||||
@ -1265,68 +1404,14 @@ minetest.register_node("default:grass_1", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:grass_2", {
|
for i=2,5 do
|
||||||
|
minetest.register_node("default:grass_"..i, {
|
||||||
description = "Grass",
|
description = "Grass",
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
tiles = {"default_grass_2.png"},
|
waving = 1,
|
||||||
inventory_image = "default_grass_2.png",
|
tiles = {"default_grass_"..i..".png"},
|
||||||
wield_image = "default_grass_2.png",
|
inventory_image = "default_grass_"..i..".png",
|
||||||
paramtype = "light",
|
wield_image = "default_grass_"..i..".png",
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
is_ground_content = true,
|
|
||||||
drop = "default:grass_1",
|
|
||||||
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
minetest.register_node("default:grass_3", {
|
|
||||||
description = "Grass",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = {"default_grass_3.png"},
|
|
||||||
inventory_image = "default_grass_3.png",
|
|
||||||
wield_image = "default_grass_3.png",
|
|
||||||
paramtype = "light",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
is_ground_content = true,
|
|
||||||
drop = "default:grass_1",
|
|
||||||
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("default:grass_4", {
|
|
||||||
description = "Grass",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = {"default_grass_4.png"},
|
|
||||||
inventory_image = "default_grass_4.png",
|
|
||||||
wield_image = "default_grass_4.png",
|
|
||||||
paramtype = "light",
|
|
||||||
walkable = false,
|
|
||||||
buildable_to = true,
|
|
||||||
is_ground_content = true,
|
|
||||||
drop = "default:grass_1",
|
|
||||||
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("default:grass_5", {
|
|
||||||
description = "Grass",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
tiles = {"default_grass_5.png"},
|
|
||||||
inventory_image = "default_grass_5.png",
|
|
||||||
wield_image = "default_grass_5.png",
|
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
@ -1339,6 +1424,7 @@ minetest.register_node("default:grass_5", {
|
|||||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_node("default:ice", {
|
minetest.register_node("default:ice", {
|
||||||
description = "Ice",
|
description = "Ice",
|
||||||
|
@ -84,6 +84,7 @@ local player_model = {}
|
|||||||
local player_textures = {}
|
local player_textures = {}
|
||||||
local player_anim = {}
|
local player_anim = {}
|
||||||
local player_sneak = {}
|
local player_sneak = {}
|
||||||
|
default.player_attached = {}
|
||||||
|
|
||||||
function default.player_get_animation(player)
|
function default.player_get_animation(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
@ -140,7 +141,16 @@ end
|
|||||||
|
|
||||||
-- Update appearance when the player joins
|
-- Update appearance when the player joins
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
default.player_attached[player:get_player_name()] = false
|
||||||
default.player_set_model(player, "character.x")
|
default.player_set_model(player, "character.x")
|
||||||
|
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
|
||||||
|
|
||||||
|
-- set GUI
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
player:set_inventory_formspec(default.gui_suvival_form)
|
||||||
|
end
|
||||||
|
player:hud_set_hotbar_image("gui_hotbar.png")
|
||||||
|
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
minetest.register_on_leaveplayer(function(player)
|
||||||
@ -159,7 +169,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local model_name = player_model[name]
|
local model_name = player_model[name]
|
||||||
local model = model_name and models[model_name]
|
local model = model_name and models[model_name]
|
||||||
if model then
|
if model and not default.player_attached[name] then
|
||||||
local controls = player:get_player_control()
|
local controls = player:get_player_control()
|
||||||
local walking = false
|
local walking = false
|
||||||
local animation_speed_mod = model.animation_speed or 30
|
local animation_speed_mod = model.animation_speed or 30
|
||||||
|
Before Width: | Height: | Size: 273 B After Width: | Height: | Size: 544 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 639 B |
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 596 B |
Before Width: | Height: | Size: 562 B After Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 649 B After Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 546 B |
Before Width: | Height: | Size: 761 B After Width: | Height: | Size: 682 B |
Before Width: | Height: | Size: 864 B After Width: | Height: | Size: 780 B |
Before Width: | Height: | Size: 709 B After Width: | Height: | Size: 638 B |
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 217 B After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 337 B After Width: | Height: | Size: 333 B |
Before Width: | Height: | Size: 113 B After Width: | Height: | Size: 83 B |
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 585 B After Width: | Height: | Size: 323 B |
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 453 B |
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 234 B |
BIN
mods/default/textures/default_desert_cobble.png
Normal file
After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 647 B |
Before Width: | Height: | Size: 367 B After Width: | Height: | Size: 280 B |
Before Width: | Height: | Size: 483 B After Width: | Height: | Size: 405 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 397 B |
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 913 B After Width: | Height: | Size: 835 B |
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 482 B |
BIN
mods/default/textures/default_fence_overlay.png
Normal file
After Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 602 B |
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 803 B After Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 602 B |
Before Width: | Height: | Size: 604 B After Width: | Height: | Size: 602 B |
Before Width: | Height: | Size: 978 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 906 B After Width: | Height: | Size: 693 B |
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 259 B |
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 199 B |
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 657 B |
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 229 B |
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 470 B |
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 219 B |
Before Width: | Height: | Size: 490 B After Width: | Height: | Size: 371 B |
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 193 B |
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 193 B |
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 736 B |
Before Width: | Height: | Size: 834 B After Width: | Height: | Size: 811 B |
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 297 B |
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 685 B |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 193 B |
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 302 B |
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 121 B |
Before Width: | Height: | Size: 907 B After Width: | Height: | Size: 141 B |