Merge branch 'master' into formspec-v4
|
@ -0,0 +1,2 @@
|
|||
# Text Editor TMP Files
|
||||
*.swp
|
|
@ -52,17 +52,17 @@ Each mod must provide `mod.conf`.
|
|||
Each mod which add API functions should store functions inside a global table named like the mod.
|
||||
Public functions should not use self references but rather just access the table directly.
|
||||
Functions should be defined in this way:
|
||||
```
|
||||
```lua
|
||||
function mcl_xyz.stuff(param) end
|
||||
```
|
||||
Insteed of this way:
|
||||
```
|
||||
```lua
|
||||
mcl_xyz.stuff = function(param) end
|
||||
```
|
||||
Indentation must be unified, more likely with tabs.
|
||||
|
||||
Time sensitive mods should make a local copy of most used API functions to improve performances.
|
||||
```
|
||||
```lua
|
||||
local vector = vector
|
||||
local get_node = minetest.get_node
|
||||
```
|
||||
|
|
|
@ -149,7 +149,7 @@ These groups are used mostly for informational purposes
|
|||
* `trapdoor=2`: Open trapdoor
|
||||
* `glass=1`: Glass (full cubes only)
|
||||
* `rail=1`: Rail
|
||||
* `music_record`: Music Disc (rating is track ID)
|
||||
* `music_record`: Item is Music Disc
|
||||
* `tnt=1`: Block is TNT
|
||||
* `boat=1`: Boat
|
||||
* `minecart=1`: Minecart
|
||||
|
|
19
README.md
|
@ -1,5 +1,3 @@
|
|||
# (Currently in feature freeze)
|
||||
|
||||
# MineClone 2
|
||||
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
|
||||
Developed by many people. Not developed or endorsed by Mojang AB.
|
||||
|
@ -77,15 +75,16 @@ To install MineClone 2 (if you haven't already), move this directory into the
|
|||
“games” directory of your Minetest data directory. Consult the help of
|
||||
Minetest to learn more.
|
||||
|
||||
## Reporting bugs
|
||||
Please report all bugs and missing Minecraft features here:
|
||||
## Useful links
|
||||
The MineClone2 repository is hosted at Mesehub. To contribute or report issues, head there.
|
||||
|
||||
<https://git.minetest.land/MineClone2/MineClone2/issues>
|
||||
|
||||
## Chatting with the community
|
||||
Join our discord server at:
|
||||
|
||||
<https://discord.gg/xE4z8EEpDC>
|
||||
* Mesehub: <https://git.minetest.land/MineClone2/MineClone2>
|
||||
* Discord: <https://discord.gg/xE4z8EEpDC>
|
||||
* YouTube <https://www.youtube.com/channel/UClI_YcsXMF3KNeJtoBfnk9A>
|
||||
* IRC: <https://web.libera.chat/#mineclone2>
|
||||
* Matrix: <https://app.element.io/#/room/#mc2:matrix.org>
|
||||
* Reddit: <https://www.reddit.com/r/MineClone2/>
|
||||
* Minetest forums: <https://forum.minetest.net/viewtopic.php?f=50&t=16407>
|
||||
|
||||
## Project description
|
||||
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.
|
||||
|
|
|
@ -207,6 +207,10 @@ end
|
|||
function mcl_autogroup.can_harvest(nodename, toolname)
|
||||
local ndef = minetest.registered_nodes[nodename]
|
||||
|
||||
if not ndef then
|
||||
return false
|
||||
end
|
||||
|
||||
if minetest.get_item_group(nodename, "dig_immediate") >= 2 then
|
||||
return true
|
||||
end
|
||||
|
|
|
@ -32,9 +32,9 @@ local singlenode = mg_name == "singlenode"
|
|||
|
||||
-- Calculate mapgen_edge_min/mapgen_edge_max
|
||||
mcl_vars.chunksize = math.max(1, tonumber(minetest.get_mapgen_setting("chunksize")) or 5)
|
||||
mcl_vars.MAP_BLOCKSIZE = math.max(1, core.MAP_BLOCKSIZE or 16)
|
||||
mcl_vars.MAP_BLOCKSIZE = math.max(1, minetest.MAP_BLOCKSIZE or 16)
|
||||
mcl_vars.mapgen_limit = math.max(1, tonumber(minetest.get_mapgen_setting("mapgen_limit")) or 31000)
|
||||
mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, core.MAX_MAP_GENERATION_LIMIT or 31000)
|
||||
mcl_vars.MAX_MAP_GENERATION_LIMIT = math.max(1, minetest.MAX_MAP_GENERATION_LIMIT or 31000)
|
||||
local central_chunk_offset = -math.floor(mcl_vars.chunksize / 2)
|
||||
mcl_vars.central_chunk_offset_in_nodes = central_chunk_offset * mcl_vars.MAP_BLOCKSIZE
|
||||
mcl_vars.chunk_size_in_nodes = mcl_vars.chunksize * mcl_vars.MAP_BLOCKSIZE
|
||||
|
|
|
@ -84,7 +84,7 @@ local function attach_object(self, obj)
|
|||
end
|
||||
end, name)
|
||||
obj:set_look_horizontal(yaw)
|
||||
mcl_tmp_message.message(obj, S("Sneak to dismount"))
|
||||
mcl_title.set(obj, "actionbar", {text=S("Sneak to dismount"), color="white", stay=60})
|
||||
else
|
||||
obj:get_luaentity()._old_visual_size = visual_size
|
||||
end
|
||||
|
|
|
@ -6,6 +6,7 @@ Boats are used to travel on the surface of water.=Les bateaux sont utilisés pou
|
|||
Dark Oak Boat=Bateau en Chêne Noir
|
||||
Jungle Boat=Bateau en Acajou
|
||||
Oak Boat=Bateau en Chêne
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Cliquez de nouveau avec le bouton droit sur le bateau pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet.
|
||||
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Use [Sneak] to leave the boat, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Utilisez [Sneak] pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet.
|
||||
Spruce Boat=Bateau en Sapin
|
||||
Water vehicle=Véhicule aquatique
|
||||
Water vehicle=Véhicule aquatique
|
||||
Sneak to dismount=
|
|
@ -1,7 +1,7 @@
|
|||
name = mcl_boats
|
||||
author = PilzAdam
|
||||
description = Adds drivable boats.
|
||||
depends = mcl_player, flowlib
|
||||
depends = mcl_player, flowlib, mcl_title
|
||||
optional_depends = mcl_core, doc_identifier
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,10 @@ local function deal_falling_damage(self, dtime)
|
|||
end
|
||||
self._hit = self._hit or {}
|
||||
for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do
|
||||
if mcl_util.get_hp(obj) > 0 and not self._hit[obj] then
|
||||
local entity = obj:get_luaentity()
|
||||
if entity and entity.name == "__builtin:item" then
|
||||
obj:remove()
|
||||
elseif mcl_util.get_hp(obj) > 0 and not self._hit[obj] then
|
||||
self._hit[obj] = true
|
||||
local way = self._startpos.y - pos.y
|
||||
local damage = (way - 1) * 2
|
||||
|
|
|
@ -575,7 +575,7 @@ minetest.register_entity(":__builtin:item", {
|
|||
return true
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
on_step = function(self, dtime, moveresult)
|
||||
if self._removed then
|
||||
self.object:set_properties({
|
||||
physical = false
|
||||
|
@ -642,6 +642,18 @@ minetest.register_entity(":__builtin:item", {
|
|||
end
|
||||
end
|
||||
|
||||
-- Destroy item when it collides with a cactus
|
||||
if moveresult and moveresult.collides then
|
||||
for _, collision in pairs(moveresult.collisions) do
|
||||
local pos = collision.node_pos
|
||||
if collision.type == "node" and minetest.get_node(pos).name == "mcl_core:cactus" then
|
||||
self._removed = true
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Push item out when stuck inside solid opaque node
|
||||
if def and def.walkable and def.groups and def.groups.opaque == 1 then
|
||||
local shootdir
|
||||
|
|
|
@ -646,7 +646,7 @@ register_minecart(
|
|||
if player then
|
||||
mcl_player.player_set_animation(player, "sit" , 30)
|
||||
player:set_eye_offset({x=0, y=-5.5, z=0},{x=0, y=-4, z=0})
|
||||
mcl_tmp_message.message(clicker, S("Sneak to dismount"))
|
||||
mcl_title.set(clicker, "actionbar", {text=S("Sneak to dismount"), color="white", stay=60})
|
||||
end
|
||||
end, name)
|
||||
end
|
||||
|
|
|
@ -33,3 +33,4 @@ Activates minecarts when powered=Active les wagonnets lorsqu'il est alimenté
|
|||
Emits redstone power when a minecart is detected=Émet de l'énergie redstone lorsqu'un wagonnet est détecté
|
||||
Vehicle for fast travel on rails=Véhicule pour voyager rapidement sur rails
|
||||
Can be ignited by tools or powered activator rail=Peut être allumé par des outils ou un rail d'activation motorisé
|
||||
Sneak to dismount=
|
|
@ -1,6 +1,6 @@
|
|||
name = mcl_minecarts
|
||||
author = Krock
|
||||
description = Minecarts are vehicles to move players quickly on rails.
|
||||
depends = mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons
|
||||
depends = mcl_title, mcl_explosions, mcl_core, mcl_sounds, mcl_player, mcl_achievements, mcl_chests, mcl_furnaces, mesecons_commandblock, mcl_hoppers, mcl_tnt, mesecons
|
||||
optional_depends = doc_identifier, mcl_wip
|
||||
|
||||
|
|
|
@ -129,6 +129,7 @@ end
|
|||
local api_path = minetest.get_modpath(minetest.get_current_modname()).."/api/mob_functions/"
|
||||
|
||||
--ignite all parts of the api
|
||||
dofile(api_path .. "flow_lib.lua")
|
||||
dofile(api_path .. "ai.lua")
|
||||
dofile(api_path .. "animation.lua")
|
||||
dofile(api_path .. "collision.lua")
|
||||
|
|
|
@ -9,6 +9,8 @@ local minetest_get_item_group = minetest.get_item_group
|
|||
local minetest_get_node = minetest.get_node
|
||||
local minetest_line_of_sight = minetest.line_of_sight
|
||||
local minetest_get_node_light = minetest.get_node_light
|
||||
local minetest_registered_nodes = minetest.registered_nodes
|
||||
local flow = mobs.get_flowing_dir
|
||||
|
||||
local DOUBLE_PI = math.pi * 2
|
||||
local THIRTY_SECONDTH_PI = DOUBLE_PI * 0.03125
|
||||
|
@ -521,8 +523,8 @@ ______ _
|
|||
| _| | | | | |
|
||||
| | | | |_| |
|
||||
\_| |_|\__, |
|
||||
__/ |
|
||||
|___/
|
||||
__/ |
|
||||
|___/
|
||||
]]--
|
||||
|
||||
-- state switching logic (stand, walk, run, attacks)
|
||||
|
@ -675,12 +677,12 @@ end
|
|||
--[[
|
||||
___
|
||||
|_ |
|
||||
| |_ _ _ __ ___ _ __
|
||||
| | | | | '_ ` _ \| '_ \
|
||||
| |_ _ _ __ ___ _ __
|
||||
| | | | | '_ ` _ \| '_ \
|
||||
/\__/ / |_| | | | | | | |_) |
|
||||
\____/ \__,_|_| |_| |_| .__/
|
||||
| |
|
||||
|_|
|
||||
| |
|
||||
|_|
|
||||
]]--
|
||||
|
||||
|
||||
|
@ -787,8 +789,8 @@ ___ ___ _ _ _
|
|||
| |\/| |/ _` | | '_ \ | | / _ \ / _` | |/ __|
|
||||
| | | | (_| | | | | | | |___| (_) | (_| | | (__
|
||||
\_| |_/\__,_|_|_| |_| \_____/\___/ \__, |_|\___|
|
||||
__/ |
|
||||
|___/
|
||||
__/ |
|
||||
|___/
|
||||
]]--
|
||||
|
||||
--the main loop
|
||||
|
@ -1011,6 +1013,19 @@ function mobs.mob_step(self, dtime)
|
|||
end
|
||||
end
|
||||
|
||||
--mobs flow from Crafter
|
||||
local pos = self.object:get_pos()
|
||||
if pos then
|
||||
local flow_dir = flow(pos)
|
||||
if flow_dir then
|
||||
flow_dir = vector.multiply(flow_dir,10)
|
||||
local vel = self.object:get_velocity()
|
||||
local acceleration = vector.new(flow_dir.x-vel.x,flow_dir.y-vel.y,flow_dir.z-vel.z)
|
||||
acceleration = vector.multiply(acceleration, 0.01)
|
||||
self.object:add_velocity(acceleration)
|
||||
end
|
||||
end
|
||||
|
||||
--mob is stunned after being hit
|
||||
if self.pause_timer > 0 then
|
||||
self.pause_timer = self.pause_timer - dtime
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
--this is from https://github.com/HybridDog/builtin_item/blob/e6dfd9dce86503b3cbd1474257eca5f6f6ca71c2/init.lua#L50
|
||||
local
|
||||
minetest,vector,math,pairs,minetest_get_node,vector_subtract,minetest_registered_nodes
|
||||
=
|
||||
minetest,vector,math,pairs,minetest.get_node,vector.subtract,minetest.registered_nodes
|
||||
|
||||
local tab
|
||||
local n
|
||||
local function get_nodes(pos)
|
||||
tab,n = {},1
|
||||
for i = -1,1,2 do
|
||||
for _,p in pairs({
|
||||
{x=pos.x+i, y=pos.y, z=pos.z},
|
||||
{x=pos.x, y=pos.y, z=pos.z+i}
|
||||
}) do
|
||||
tab[n] = {p, minetest_get_node(p)}
|
||||
n = n+1
|
||||
end
|
||||
end
|
||||
return tab
|
||||
end
|
||||
|
||||
|
||||
local data
|
||||
local param2
|
||||
local nd
|
||||
local par2
|
||||
local name
|
||||
local tmp
|
||||
local c_node
|
||||
function mobs.get_flowing_dir(pos)
|
||||
c_node = minetest_get_node(pos).name
|
||||
if c_node ~= "mcl_core:water_flowing" and c_node ~= "mcl_core:water" then
|
||||
return nil
|
||||
end
|
||||
data = get_nodes(pos)
|
||||
param2 = minetest_get_node(pos).param2
|
||||
if param2 > 7 then
|
||||
return nil
|
||||
end
|
||||
if c_node == "mcl_core:water" then
|
||||
for _,i in pairs(data) do
|
||||
nd = i[2]
|
||||
name = nd.name
|
||||
par2 = nd.param2
|
||||
if name == "mcl_core:water_flowing" and par2 == 7 then
|
||||
return(vector_subtract(i[1],pos))
|
||||
end
|
||||
end
|
||||
end
|
||||
for _,i in pairs(data) do
|
||||
nd = i[2]
|
||||
name = nd.name
|
||||
par2 = nd.param2
|
||||
if name == "mcl_core:water_flowing" and par2 < param2 then
|
||||
return(vector_subtract(i[1],pos))
|
||||
end
|
||||
end
|
||||
for _,i in pairs(data) do
|
||||
nd = i[2]
|
||||
name = nd.name
|
||||
par2 = nd.param2
|
||||
if name == "mcl_core:water_flowing" and par2 >= 11 then
|
||||
return(vector_subtract(i[1],pos))
|
||||
end
|
||||
end
|
||||
for _,i in pairs(data) do
|
||||
nd = i[2]
|
||||
name = nd.name
|
||||
par2 = nd.param2
|
||||
tmp = minetest_registered_nodes[name]
|
||||
if tmp and not tmp.walkable and name ~= "mcl_core:water_flowing" and name ~= "mcl_core:water" then
|
||||
return(vector_subtract(i[1],pos))
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
|
@ -32,12 +32,15 @@ end
|
|||
mobs.float = function(self)
|
||||
|
||||
local acceleration = self.object:get_acceleration()
|
||||
if acceleration and acceleration.y ~= 0 then
|
||||
self.object:set_acceleration(vector.new(0,0,0))
|
||||
else
|
||||
|
||||
if not acceleration then
|
||||
return
|
||||
end
|
||||
|
||||
if acceleration.y ~= 0 then
|
||||
self.object:set_acceleration({x=0, y=0, z=0})
|
||||
end
|
||||
|
||||
local current_velocity = self.object:get_velocity()
|
||||
|
||||
local goal_velocity = {
|
||||
|
@ -46,7 +49,7 @@ mobs.float = function(self)
|
|||
z = 0,
|
||||
}
|
||||
|
||||
local new_velocity_addition = vector.subtract(goal_velocity,current_velocity)
|
||||
local new_velocity_addition = vector.subtract(goal_velocity, current_velocity)
|
||||
|
||||
new_velocity_addition.x = 0
|
||||
new_velocity_addition.z = 0
|
||||
|
|
|
@ -190,9 +190,10 @@ Origin of those models:
|
|||
* [Spennnyyy](https://freesound.org/people/Spennnyyy/) (CC0)
|
||||
* `mcl_totems_totem.ogg`
|
||||
* Source: <https://freesound.org/people/Spennnyyy/sounds/323502/>
|
||||
* [Baŝto](https://opengameart.org/users/ba%C5%9Dto)
|
||||
* [Baŝto](https://opengameart.org/users/ba%C5%9Dto) (remixer) and [kantouth](https://freesound.org/people/kantouth/) (original author)
|
||||
* `mobs_mc_skeleton_random.*.ogg` (CC BY 3.0)
|
||||
* Source: <https://opengameart.org/content/walking-skeleton>
|
||||
* Based on: <https://freesound.org/people/kantouth/sounds/115113/>
|
||||
* [spookymodem](https://freesound.org/people/spookymodem/)
|
||||
* `mobs_mc_skeleton_death.ogg` (CC0)
|
||||
* <https://freesound.org/people/spookymodem/sounds/202091/>
|
||||
|
@ -306,4 +307,4 @@ Origin of those models:
|
|||
|
||||
Note: Many of these sounds have been more or less modified to fit the game.
|
||||
|
||||
Sounds not mentioned hre are licensed under CC0.
|
||||
Sounds not mentioned here are licensed under CC0.
|
||||
|
|
|
@ -158,11 +158,11 @@ mobs_mc.tools.check_iron_golem_summon = function(pos)
|
|||
if ok then
|
||||
-- Remove the nodes
|
||||
minetest.remove_node(pos)
|
||||
core.check_for_falling(pos)
|
||||
minetest.check_for_falling(pos)
|
||||
for i=1, 4 do
|
||||
local cpos = vector.add(pos, checks[c][i])
|
||||
minetest.remove_node(cpos)
|
||||
core.check_for_falling(cpos)
|
||||
minetest.check_for_falling(cpos)
|
||||
end
|
||||
-- Summon iron golem
|
||||
local place
|
||||
|
|
|
@ -28,6 +28,7 @@ Pig=
|
|||
Polar Bear=
|
||||
Rabbit=
|
||||
Killer Bunny=
|
||||
The Killer Bunny=
|
||||
Sheep=
|
||||
Shulker=
|
||||
Silverfish=
|
||||
|
|
|
@ -233,4 +233,4 @@ mobs:spawn(spawn_grass)
|
|||
mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "mobs_mc_spawn_icon_rabbit.png", 0)
|
||||
|
||||
-- Note: This spawn egg does not exist in Minecraft
|
||||
mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit.png^[colorize:#FF0000:192", 0) -- TODO: Update inventory image
|
||||
mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit_caerbannog.png", 0)
|
||||
|
|
|
@ -179,9 +179,9 @@ mobs_mc.tools.check_snow_golem_summon = function(pos)
|
|||
minetest.remove_node(pos)
|
||||
minetest.remove_node(b1)
|
||||
minetest.remove_node(b2)
|
||||
core.check_for_falling(pos)
|
||||
core.check_for_falling(b1)
|
||||
core.check_for_falling(b2)
|
||||
minetest.check_for_falling(pos)
|
||||
minetest.check_for_falling(b1)
|
||||
minetest.check_for_falling(b2)
|
||||
local obj = minetest.add_entity(place, "mobs_mc:snowman")
|
||||
if obj then
|
||||
summon_particles(obj)
|
||||
|
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -2,7 +2,7 @@
|
|||
Using it as fuel turns it into: @1.=L'utiliser comme combustible le transforme en : @1.
|
||||
@1 seconds=@1 secondes
|
||||
# Item count times item name
|
||||
%@1×@2=%@1×@
|
||||
@1×@2=@1×@
|
||||
# Itemname (25%)
|
||||
@1 (@2%)=@1 (@2%)
|
||||
# Itemname (<0.5%)
|
||||
|
|
|
@ -155,7 +155,7 @@ end
|
|||
local custom_crafts, craft_types = {}, {}
|
||||
|
||||
function mcl_craftguide.register_craft_type(name, def)
|
||||
local func = "mcl_craftguide.register_craft_guide(): "
|
||||
local func = "mcl_craftguide.register_craft_type(): "
|
||||
assert(name, func .. "'name' field missing")
|
||||
assert(def.description, func .. "'description' field missing")
|
||||
assert(def.icon, func .. "'icon' field missing")
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
# mcl_item_id
|
||||
Show the item ID of an item in the description.
|
||||
With this API, you can register a different name space than "mineclone" for your mod.
|
||||
|
||||
## mcl_item_id.set_mod_namespace(modname, namespace)
|
||||
Set a name space for all items in a mod.
|
||||
|
||||
* param1: the modname
|
||||
* param2: (optional) string of the desired name space, if nil, it is the name of the mod
|
||||
|
||||
## mcl_item_id.get_mod_namespace(modname)
|
||||
Get the name space of a mod registered with mcl_item_id.set_mod_namespace(modname, namespace).
|
||||
|
||||
* param1: the modname
|
||||
|
||||
### Examples:
|
||||
|
||||
The name of the mod is "mod" which registered an item called "mod:itemname".
|
||||
|
||||
* mcl_item_id.set_mod_namespace("mod", "mymod") will show "mymod:itemname" in the description of "mod:itemname"
|
||||
* mcl_item_id.set_mod_namespace(minetest.get_current_modname()) will show "mod:itemname" in the description of "mod:itemname"
|
||||
* mcl_item_id.get_mod_namespace(minetest.get_current_modname()) will return "mod"
|
||||
|
||||
(If no namespace is set by a mod, mcl_item_id.get_mod_namespace(minetest.get_current_modname()) will return "mineclone")
|
|
@ -0,0 +1,62 @@
|
|||
mcl_item_id = {
|
||||
mod_namespaces = {},
|
||||
}
|
||||
|
||||
local game = "mineclone"
|
||||
|
||||
function mcl_item_id.set_mod_namespace(modname, namespace)
|
||||
local namespace = namespace or modname
|
||||
mcl_item_id.mod_namespaces[modname] = namespace
|
||||
end
|
||||
|
||||
function mcl_item_id.get_mod_namespace(modname)
|
||||
local namespace = mcl_item_id.mod_namespaces[modname]
|
||||
if namespace then
|
||||
return namespace
|
||||
else
|
||||
return game
|
||||
end
|
||||
end
|
||||
|
||||
local same_id = {
|
||||
enchanting = { "table" },
|
||||
experience = { "bottle" },
|
||||
heads = { "skeleton", "zombie", "creeper", "wither_skeleton" },
|
||||
mobitems = { "rabbit", "chicken" },
|
||||
walls = {
|
||||
"andesite", "brick", "cobble", "diorite", "endbricks",
|
||||
"granite", "mossycobble", "netherbrick", "prismarine",
|
||||
"rednetherbrick", "redsandstone", "sandstone",
|
||||
"stonebrick", "stonebrickmossy",
|
||||
},
|
||||
wool = {
|
||||
"black", "blue", "brown", "cyan", "green",
|
||||
"grey", "light_blue", "lime", "magenta", "orange",
|
||||
"pink", "purple", "red", "silver", "white", "yellow",
|
||||
},
|
||||
}
|
||||
|
||||
tt.register_snippet(function(itemstring)
|
||||
local def = minetest.registered_items[itemstring]
|
||||
local item_split = itemstring:find(":")
|
||||
local id_string = itemstring:sub(item_split)
|
||||
local id_modname = itemstring:sub(1, item_split - 1)
|
||||
local new_id = game .. id_string
|
||||
local mod_namespace = mcl_item_id.get_mod_namespace(id_modname)
|
||||
for mod, ids in pairs(same_id) do
|
||||
for _, id in pairs(ids) do
|
||||
if itemstring == "mcl_" .. mod .. ":" .. id then
|
||||
new_id = game .. ":" .. id .. "_" .. mod:gsub("s", "")
|
||||
end
|
||||
end
|
||||
end
|
||||
if mod_namespace ~= game then
|
||||
new_id = mod_namespace .. id_string
|
||||
end
|
||||
if mod_namespace ~= id_modname then
|
||||
minetest.register_alias_force(new_id, itemstring)
|
||||
end
|
||||
if minetest.settings:get_bool("mcl_item_id_debug", false) then
|
||||
return new_id, "#555555"
|
||||
end
|
||||
end)
|
|
@ -0,0 +1,3 @@
|
|||
name = mcl_item_id
|
||||
author = NO11
|
||||
depends = tt
|
|
@ -45,3 +45,4 @@ Mining durability: @1=Grabehaltbarkeit: @1
|
|||
Block breaking strength: @1=Blockbruchstärke: @1
|
||||
@1 uses=@1 Verwendungen
|
||||
Unlimited uses=Unbegrenzte Verwendungen
|
||||
Durability: @1=Haltbarkeit: @1
|
||||
|
|
|
@ -45,3 +45,4 @@ Mining durability: @1=
|
|||
Block breaking strength: @1=
|
||||
@1 uses=
|
||||
Unlimited uses=
|
||||
Durability: @1=
|
||||
|
|
|
@ -107,3 +107,8 @@ tt.register_snippet(function(itemstring)
|
|||
end
|
||||
end)
|
||||
|
||||
tt.register_snippet(function(itemstring, _, itemstack)
|
||||
if itemstring:sub(1, 23) == "mcl_fishing:fishing_rod" or itemstring:sub(1, 12) == "mcl_bows:bow" then
|
||||
return S("Durability: @1", S("@1 uses", mcl_util.calculate_durability(itemstack or ItemStack(itemstring))))
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -1,23 +1,26 @@
|
|||
local modname = minetest.get_current_modname()
|
||||
local S = minetest.get_translator(modname)
|
||||
|
||||
mcl_credits = {
|
||||
players = {},
|
||||
}
|
||||
|
||||
mcl_credits.description = "A faithful Open Source clone of Minecraft"
|
||||
mcl_credits.description = S("A faithful Open Source clone of Minecraft")
|
||||
|
||||
-- Sub-lists are sorted by number of commits, but the list should not be rearranged (-> new contributors are just added at the end of the list)
|
||||
mcl_credits.people = {
|
||||
{"Creator of MineClone", 0x0A9400, {
|
||||
{ S("Creator of MineClone"), 0x0A9400, {
|
||||
"davedevils",
|
||||
}},
|
||||
{"Creator of MineClone2", 0xFBF837, {
|
||||
{ S("Creator of MineClone2"), 0xFBF837, {
|
||||
"Wuzzy",
|
||||
}},
|
||||
{"Maintainers", 0xFF51D5, {
|
||||
{ S("Maintainers"), 0xFF51D5, {
|
||||
"Fleckenstein",
|
||||
"kay27",
|
||||
"oilboi",
|
||||
}},
|
||||
{"Developers", 0xF84355, {
|
||||
{ S("Developers"), 0xF84355, {
|
||||
"bzoss",
|
||||
"AFCMS",
|
||||
"epCode",
|
||||
|
@ -30,7 +33,7 @@ mcl_credits.people = {
|
|||
"Code-Sploit",
|
||||
"NO11",
|
||||
}},
|
||||
{"Contributors", 0x52FF00, {
|
||||
{ S("Contributors"), 0x52FF00, {
|
||||
"Laurent Rocher",
|
||||
"HimbeerserverDE",
|
||||
"TechDudie",
|
||||
|
@ -64,7 +67,7 @@ mcl_credits.people = {
|
|||
"NO11",
|
||||
"j45",
|
||||
}},
|
||||
{"Original Mod Authors", 0x343434, {
|
||||
{ S("Original Mod Authors"), 0x343434, {
|
||||
"Wuzzy",
|
||||
"Fleckenstein",
|
||||
"BlockMen",
|
||||
|
@ -96,12 +99,12 @@ mcl_credits.people = {
|
|||
"jordan4ibanez",
|
||||
"paramat",
|
||||
}},
|
||||
{"3D Models", 0x0019FF, {
|
||||
{ S("3D Models"), 0x0019FF, {
|
||||
"22i",
|
||||
"tobyplowy",
|
||||
"epCode",
|
||||
}},
|
||||
{"Textures", 0xFF9705, {
|
||||
{ S("Textures"), 0xFF9705, {
|
||||
"XSSheep",
|
||||
"Wuzzy",
|
||||
"kingoscargames",
|
||||
|
@ -110,7 +113,7 @@ mcl_credits.people = {
|
|||
"yutyo",
|
||||
"NO11",
|
||||
}},
|
||||
{"Translations", 0x00FF60, {
|
||||
{ S("Translations"), 0x00FF60, {
|
||||
"Wuzzy",
|
||||
"Rocher Laurent",
|
||||
"wuniversales",
|
||||
|
@ -142,7 +145,7 @@ function mcl_credits.show(player)
|
|||
ids = {
|
||||
player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
text = "menu_bg.png",
|
||||
text = "credits_bg.png",
|
||||
position = {x = 0, y = 0},
|
||||
alignment = {x = 1, y = 1},
|
||||
scale = {x = -100, y = -100},
|
||||
|
@ -150,13 +153,22 @@ function mcl_credits.show(player)
|
|||
}),
|
||||
player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
text = "Sneak to skip",
|
||||
text = S("Sneak to skip"),
|
||||
position = {x = 1, y = 1},
|
||||
alignment = {x = -1, y = -1},
|
||||
offset = {x = -5, y = -5},
|
||||
z_index = 1001,
|
||||
number = 0xFFFFFF,
|
||||
})
|
||||
}),
|
||||
player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
text = " "..S("Jump to speed up (additionally sprint)"),
|
||||
position = {x = 0, y = 1},
|
||||
alignment = {x = 1, y = -1},
|
||||
offset = {x = -5, y = -5},
|
||||
z_index = 1002,
|
||||
number = 0xFFFFFF,
|
||||
}),
|
||||
},
|
||||
}
|
||||
add_hud_element({
|
||||
|
@ -216,13 +228,22 @@ end)
|
|||
minetest.register_globalstep(function(dtime)
|
||||
for _, huds in pairs(mcl_credits.players) do
|
||||
local player = huds.player
|
||||
if not huds.new and player:get_player_control().sneak then
|
||||
local control = player:get_player_control()
|
||||
if not huds.new and control.sneak then
|
||||
mcl_credits.hide(player)
|
||||
else
|
||||
local moving = {}
|
||||
local any
|
||||
for id, y in pairs(huds.moving) do
|
||||
y = y - 1
|
||||
|
||||
if control.jump then
|
||||
y = y - 2
|
||||
if control.aux1 then
|
||||
y = y - 5
|
||||
end
|
||||
end
|
||||
|
||||
if y > -100 then
|
||||
if id == huds.icon then
|
||||
y = math.max(400, y)
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
# textdomain: mcl_credits
|
||||
3D Models=3D Modelle
|
||||
A faithful Open Source clone of Minecraft=Ein treuer Open-Source-Klon von Minecraft
|
||||
Contributors=Mitwirkende
|
||||
Creator of MineClone=Schöpfer von MineClone
|
||||
Creator of MineClone2=Schöpfer von MineClone2
|
||||
Developers=Entwickler
|
||||
Jump to speed up (additionally sprint)=Springen, um zu beschleunigen (zusätzlich sprinten)
|
||||
Maintainers=Betreuer
|
||||
MineClone5=MineClone5
|
||||
Original Mod Authors=Original-Mod-Autoren
|
||||
Sneak to skip=Schleichen zum Überspringen
|
||||
Textures=Texturen
|
||||
Translations=Übersetzungen
|
|
@ -0,0 +1,14 @@
|
|||
# textdomain: mcl_credits
|
||||
3D Models=
|
||||
A faithful Open Source clone of Minecraft=
|
||||
Contributors=
|
||||
Creator of MineClone=
|
||||
Creator of MineClone2=
|
||||
Developers=
|
||||
Jump to speed up (additionally sprint)=
|
||||
Maintainers=
|
||||
MineClone5=
|
||||
Original Mod Authors=
|
||||
Sneak to skip=
|
||||
Textures=
|
||||
Translations=
|
|
@ -0,0 +1,14 @@
|
|||
# textdomain: mcl_credits
|
||||
3D Models=Modèles 3D
|
||||
A faithful Open Source clone of Minecraft=Un clone open source de Minecraft
|
||||
Contributors=Contributeurs
|
||||
Creator of MineClone=Créateur de MineClone
|
||||
Creator of MineClone2=Créateur de MineClone2
|
||||
Developers=Développeurs
|
||||
Jump to speed up (additionally sprint)=Saut pour accélérer (peut être combiné avec sprint)
|
||||
Maintainers=Mainteneurs
|
||||
MineClone5=MineClone5
|
||||
Original Mod Authors=Auteurs des mods originaux
|
||||
Sneak to skip=Shift pour passer
|
||||
Textures=Textures
|
||||
Translations=Traductions
|
|
@ -0,0 +1,14 @@
|
|||
# textdomain: mcl_credits
|
||||
3D Models=
|
||||
A faithful Open Source clone of Minecraft=
|
||||
Contributors=
|
||||
Creator of MineClone=
|
||||
Creator of MineClone2=
|
||||
Developers=
|
||||
Jump to speed up (additionally sprint)=
|
||||
Maintainers=
|
||||
MineClone5=
|
||||
Original Mod Authors=
|
||||
Sneak to skip=
|
||||
Textures=
|
||||
Translations=
|
|
@ -0,0 +1,14 @@
|
|||
# textdomain: mcl_credits
|
||||
3D Models=
|
||||
A faithful Open Source clone of Minecraft=
|
||||
Contributors=
|
||||
Creator of MineClone=
|
||||
Creator of MineClone2=
|
||||
Developers=
|
||||
Jump to speed up (additionally sprint)=
|
||||
Maintainers=
|
||||
MineClone5=
|
||||
Original Mod Authors=
|
||||
Sneak to skip=
|
||||
Textures=
|
||||
Translations=
|
|
@ -0,0 +1,14 @@
|
|||
# textdomain: mcl_credits
|
||||
3D Models=
|
||||
A faithful Open Source clone of Minecraft=
|
||||
Contributors=
|
||||
Creator of MineClone=
|
||||
Creator of MineClone2=
|
||||
Developers=
|
||||
Jump to speed up (additionally sprint)=
|
||||
Maintainers=
|
||||
MineClone5=
|
||||
Original Mod Authors=
|
||||
Sneak to skip=
|
||||
Textures=
|
||||
Translations=
|
After Width: | Height: | Size: 62 KiB |
|
@ -27,10 +27,9 @@ local function replace_enchanted_books(tbl)
|
|||
end
|
||||
end
|
||||
|
||||
--[[ Populate all the item tables. We only do this once. Note this mod must be
|
||||
loaded after _mcl_autogroup for this to work, because it required certain
|
||||
groups to be set. ]]
|
||||
do
|
||||
--[[ Populate all the item tables. We only do this once. Note this code must be
|
||||
executed after loading all the other mods in order to work. ]]
|
||||
minetest.register_on_mods_loaded(function()
|
||||
for name,def in pairs(minetest.registered_items) do
|
||||
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) and def.description and def.description ~= "" then
|
||||
local function is_redstone(def)
|
||||
|
@ -108,7 +107,7 @@ do
|
|||
table.sort(to_sort)
|
||||
replace_enchanted_books(to_sort)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
local function filter_item(name, description, lang, filter)
|
||||
local desc
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
name = mcl_inventory
|
||||
author = BlockMen
|
||||
description = Adds the player inventory and creative inventory.
|
||||
depends = mcl_init, mcl_formspec, mcl_player
|
||||
optional_depends = _mcl_autogroup, mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide
|
||||
|
||||
depends = mcl_init, mcl_formspec, mcl_enchanting
|
||||
optional_depends = mcl_armor, mcl_brewing, mcl_potions, mcl_enchanting, mcl_craftguide, mcl_player
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
# mcl_title
|
||||
|
||||
Allow mods to show messages in the hud of players.
|
||||
|
||||
## mcl_title.set(player, type, data)
|
||||
|
||||
Show a hud message of `type` to player `player` with `data` as params.
|
||||
|
||||
The element will stay for the per-player param `stay` or `data.stay` (in gametick which is 1/20 second).
|
||||
|
||||
Here is a usage exemple:
|
||||
|
||||
```lua
|
||||
--show a title in the HUD with minecraft color "gold"
|
||||
mcl_title.set(player, "title", {text="dummy text", color="gold"})
|
||||
|
||||
--show a subtitle in the HUD with hex color "#612D2D"
|
||||
mcl_title.set(player, "subtitle", {text="dummy subtitle", color="#612D2D"})
|
||||
|
||||
--show an actionbar in the HUD (above the hotbar) with minecraft color "red"
|
||||
mcl_title.set(player, "subtitle", {text="dummy actionbar", color="red"})
|
||||
|
||||
--show a title in the HUD with minecraft color "gold" staying for 3 seconds (override stay setting)
|
||||
mcl_title.set(player, "title", {text="dummy text", color="gold", stay=60})
|
||||
```
|
||||
|
||||
## mcl_title.remove(player, type)
|
||||
|
||||
Hide HUD element of type `type` for player `player`.
|
||||
|
||||
## mcl_title.clear(player)
|
||||
|
||||
Remove every title/subtitle/actionbar from a player.
|
||||
Basicaly run `mcl_title.remove(player, type)` for every type.
|
||||
|
||||
## mcl_title.params_set(player, params)
|
||||
|
||||
Allow mods to set `stay` and upcomming `fadeIn`/`fadeOut` params.
|
||||
|
||||
```lua
|
||||
mcl_title.params_set(player, {stay = 600}) --elements with no 'data.stay' field will stay during 30s (600/20)
|
||||
```
|
||||
|
||||
## mcl_title.params_get(player)
|
||||
|
||||
Get `stay` and upcomming `fadeIn` and `fadeOut` params of a player as a table.
|
||||
|
||||
```lua
|
||||
mcl_title.params_get(player)
|
||||
```
|
|
@ -0,0 +1,236 @@
|
|||
--Based on:
|
||||
--https://www.digminecraft.com/game_commands/title_command.php
|
||||
--https://youtu.be/oVrtQRO2hpY
|
||||
|
||||
--TODO: use SSCSM to reduce lag and network trafic (just send modchannel messages)
|
||||
--TODO: fadeIn and fadeOut animation (needs engine change: SSCSM or native support)
|
||||
--TODO: allow obfuscating text (needs engine change: SSCSM or native support)
|
||||
--TODO: allow colorizing and styling of part of the text (NEEDS ENGINE CHANGE!!!)
|
||||
--TODO: exactly mc like layout
|
||||
|
||||
--Note that the table storing timeouts use playername as index insteed of player objects (faster)
|
||||
--This is intended in order to speedup the process of removing HUD elements the the timeout is up
|
||||
|
||||
local huds_idx = {}
|
||||
|
||||
local hud_hide_timeouts = {}
|
||||
|
||||
hud_hide_timeouts.title = {}
|
||||
hud_hide_timeouts.subtitle = {}
|
||||
hud_hide_timeouts.actionbar = {}
|
||||
|
||||
huds_idx.title = {}
|
||||
huds_idx.subtitle = {}
|
||||
huds_idx.actionbar = {}
|
||||
|
||||
mcl_title = {}
|
||||
mcl_title.defaults = {fadein = 10, stay = 70, fadeout = 20}
|
||||
mcl_title.layout = {}
|
||||
mcl_title.layout.title = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = -1.3}, size = 7}
|
||||
mcl_title.layout.subtitle = {position = {x = 0.5, y = 0.5}, alignment = {x = 0, y = 1.7}, size = 4}
|
||||
mcl_title.layout.actionbar = {position = {x = 0.5, y = 1}, alignment = {x = 0, y = 0}, size = 1}
|
||||
|
||||
local get_color = mcl_util.get_color
|
||||
|
||||
--local string = string
|
||||
local pairs = pairs
|
||||
|
||||
local function gametick_to_secondes(gametick)
|
||||
if gametick then
|
||||
return gametick / 20
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
--https://github.com/minetest/minetest/blob/b3b075ea02034306256b486dd45410aa765f035a/doc/lua_api.txt#L8477
|
||||
--[[
|
||||
local function style_to_bits(bold, italic)
|
||||
if bold then
|
||||
if italic then
|
||||
return 3
|
||||
else
|
||||
return 1
|
||||
end
|
||||
else
|
||||
if italic then
|
||||
return 2
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
]]
|
||||
|
||||
--PARAMS SYSTEM
|
||||
local player_params = {}
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
--local playername = player:get_player_name()
|
||||
player_params[player] = {
|
||||
stay = mcl_title.defaults.stay,
|
||||
--fadeIn = mcl_title.defaults.fadein,
|
||||
--fadeOut = mcl_title.defaults.fadeout,
|
||||
}
|
||||
local _, hex_color = get_color("white")
|
||||
huds_idx.title[player] = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
position = mcl_title.layout.title.position,
|
||||
alignment = mcl_title.layout.title.alignment,
|
||||
text = "",
|
||||
--style = 0,
|
||||
size = {x = mcl_title.layout.title.size},
|
||||
number = hex_color,
|
||||
z_index = 100,
|
||||
})
|
||||
huds_idx.subtitle[player] = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
position = mcl_title.layout.subtitle.position,
|
||||
alignment = mcl_title.layout.subtitle.alignment,
|
||||
text = "",
|
||||
--style = 0,
|
||||
size = {x = mcl_title.layout.subtitle.size},
|
||||
number = hex_color,
|
||||
z_index = 100,
|
||||
})
|
||||
huds_idx.actionbar[player] = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
position = mcl_title.layout.actionbar.position,
|
||||
offset = {x = 0, y = -210},
|
||||
alignment = mcl_title.layout.actionbar.alignment,
|
||||
--style = 0,
|
||||
text = "",
|
||||
size = {x = mcl_title.layout.actionbar.size},
|
||||
number = hex_color,
|
||||
z_index = 100,
|
||||
})
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local playername = player:get_player_name()
|
||||
|
||||
--remove player params from the list
|
||||
player_params[player] = nil
|
||||
|
||||
--remove HUD idx from the list (HUD elements are removed by the engine)
|
||||
huds_idx.title[player] = nil
|
||||
huds_idx.subtitle[player] = nil
|
||||
huds_idx.actionbar[player] = nil
|
||||
|
||||
--remove timers from list
|
||||
hud_hide_timeouts.title[playername] = nil
|
||||
hud_hide_timeouts.subtitle[playername] = nil
|
||||
hud_hide_timeouts.actionbar[playername] = nil
|
||||
end)
|
||||
|
||||
function mcl_title.params_set(player, data)
|
||||
player_params[player] = {
|
||||
stay = data.stay or mcl_title.defaults.stay,
|
||||
--fadeIn = data.fadeIn or mcl_title.defaults.fadein,
|
||||
--fadeOut = data.fadeOut or mcl_title.defaults.fadeout,
|
||||
}
|
||||
end
|
||||
|
||||
function mcl_title.params_get(player)
|
||||
return player_params[player]
|
||||
end
|
||||
|
||||
--API FUNCTIONS
|
||||
|
||||
function mcl_title.set(player, type, data)
|
||||
if not data.color then
|
||||
data.color = "white"
|
||||
end
|
||||
local _, hex_color = get_color(data.color)
|
||||
if not hex_color then
|
||||
return false
|
||||
end
|
||||
|
||||
player:hud_change(huds_idx[type][player], "text", data.text)
|
||||
player:hud_change(huds_idx[type][player], "number", hex_color)
|
||||
|
||||
--apply bold and italic
|
||||
--player:hud_change(huds_idx[type][player], "style", style_to_bits(data.bold, data.italic))
|
||||
|
||||
hud_hide_timeouts[type][player:get_player_name()] = gametick_to_secondes(data.stay) or gametick_to_secondes(mcl_title.params_get(player).stay)
|
||||
return true
|
||||
end
|
||||
|
||||
function mcl_title.remove(player, type)
|
||||
if player then
|
||||
player:hud_change(huds_idx[type][player], "text", "")
|
||||
--player:hud_change(huds_idx[type][player], "style", 0) --no styling
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_title.clear(player)
|
||||
mcl_title.remove(player, "title")
|
||||
mcl_title.remove(player, "subtitle")
|
||||
mcl_title.remove(player, "actionbar")
|
||||
end
|
||||
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
mcl_title.clear(player)
|
||||
end)
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
local new_timeouts = {
|
||||
title = {},
|
||||
subtitle = {},
|
||||
actionbar = {},
|
||||
}
|
||||
for element, content in pairs(hud_hide_timeouts) do
|
||||
for name, timeout in pairs(content) do
|
||||
timeout = timeout - dtime
|
||||
if timeout <= 0 then
|
||||
local player = minetest.get_player_by_name(name)
|
||||
mcl_title.remove(player, element)
|
||||
else
|
||||
new_timeouts[element][name] = timeout
|
||||
end
|
||||
end
|
||||
end
|
||||
hud_hide_timeouts = new_timeouts
|
||||
end)
|
||||
|
||||
|
||||
--DEBUG STUFF!!
|
||||
--[[
|
||||
minetest.register_chatcommand("title", {
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
mcl_title.set(player, "title", {text=param, color="gold", bold=true, italic=true})
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("subtitle", {
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
mcl_title.set(player, "subtitle", {text=param, color="gold"})
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("actionbar", {
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
mcl_title.set(player, "actionbar", {text=param, color="gold"})
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("timeout", {
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
mcl_title.params_set(player, {stay = 600})
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("all", {
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
mcl_title.params_set(player, {stay = 600})
|
||||
mcl_title.set(player, "title", {text=param, color="gold"})
|
||||
mcl_title.set(player, "subtitle", {text=param, color="gold"})
|
||||
mcl_title.set(player, "actionbar", {text=param, color="gold"})
|
||||
end,
|
||||
})
|
||||
]]
|
|
@ -0,0 +1,4 @@
|
|||
name = mcl_title
|
||||
description = Add an API to add in HUD title
|
||||
depends = mcl_colors
|
||||
author = AFCMS
|
|
@ -1,7 +0,0 @@
|
|||
# mcl_temp_message
|
||||
|
||||
Allow mods to show short messages in the hud of players.
|
||||
|
||||
## mcl_tmp_message.message(player, message)
|
||||
|
||||
Show above the hotbar a hud message <message> to player <player>.
|
|
@ -1,44 +0,0 @@
|
|||
mcl_tmp_message = {}
|
||||
|
||||
local huds = {}
|
||||
local hud_hide_timeouts = {}
|
||||
|
||||
function mcl_tmp_message.message(player, message)
|
||||
local name = player:get_player_name()
|
||||
player:hud_change(huds[name], "text", message)
|
||||
hud_hide_timeouts[name] = 3
|
||||
end
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
huds[player:get_player_name()] = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
position = {x=0.5, y=1},
|
||||
offset = {x = 0, y = -210},
|
||||
alignment = {x=0, y=0},
|
||||
number = 0xFFFFFF ,
|
||||
text = "",
|
||||
z_index = 100,
|
||||
})
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
huds[name] = nil
|
||||
hud_hide_timeouts[name] = nil
|
||||
end)
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
local new_timeouts = {}
|
||||
for name, timeout in pairs(hud_hide_timeouts) do
|
||||
timeout = timeout - dtime
|
||||
if timeout <= 0 then
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
player:hud_change(huds[name], "text", "")
|
||||
end
|
||||
else
|
||||
new_timeouts[name] = timeout
|
||||
end
|
||||
end
|
||||
hud_hide_timeouts = new_timeouts
|
||||
end)
|
|
@ -1,3 +0,0 @@
|
|||
name = mcl_tmp_message
|
||||
author = Fleckenstein
|
||||
description = A simple API to show a temporary message to a player
|
|
@ -19,9 +19,9 @@ local function setup_dispenser(pos)
|
|||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dispenser"))).."]"..
|
||||
"list[current_name;main;3,0.5;3,3;]"..
|
||||
"list[context;main;3,0.5;3,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(3,0.5,3,3)..
|
||||
"listring[current_name;main]"..
|
||||
"listring[context;main]"..
|
||||
"listring[current_player;main]"
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", form)
|
||||
|
@ -129,8 +129,13 @@ local dispenserdef = {
|
|||
dropitem:set_count(1)
|
||||
local stack_id = stacks[r].stackpos
|
||||
local stackdef = stack:get_definition()
|
||||
|
||||
if not stackdef then
|
||||
return
|
||||
end
|
||||
|
||||
local iname = stack:get_name()
|
||||
local igroups = minetest.registered_items[iname].groups
|
||||
local igroups = stackdef.groups
|
||||
|
||||
--[===[ Dispense item ]===]
|
||||
|
||||
|
@ -163,6 +168,60 @@ local dispenserdef = {
|
|||
end
|
||||
|
||||
inv:set_stack("main", stack_id, stack)
|
||||
|
||||
-- Use shears on sheeps
|
||||
elseif igroups.shears then
|
||||
for _, obj in pairs(minetest.get_objects_inside_radius(droppos, 1)) do
|
||||
local entity = obj:get_luaentity()
|
||||
if entity and not entity.child and not entity.gotten then
|
||||
local entname = entity.name
|
||||
local pos = obj:get_pos()
|
||||
local used, texture = false
|
||||
if entname == "mobs_mc:sheep" then
|
||||
minetest.add_item(pos, entity.drops[2].name .. " " .. math.random(1, 3))
|
||||
if not entity.color then
|
||||
entity.color = "unicolor_white"
|
||||
end
|
||||
entity.base_texture = { "blank.png", "mobs_mc_sheep.png" }
|
||||
texture = entity.base_texture
|
||||
entity.drops = {
|
||||
{ name = mobs_mc.items.mutton_raw, chance = 1, min = 1, max = 2 },
|
||||
}
|
||||
used = true
|
||||
elseif entname == "mobs_mc:snowman" then
|
||||
texture = {
|
||||
"mobs_mc_snowman.png",
|
||||
"blank.png", "blank.png",
|
||||
"blank.png", "blank.png",
|
||||
"blank.png", "blank.png",
|
||||
}
|
||||
used = true
|
||||
elseif entname == "mobs_mc:mooshroom" then
|
||||
local droppos = vector.offset(pos, 0, 1.4, 0)
|
||||
if entity.base_texture[1] == "mobs_mc_mooshroom_brown.png" then
|
||||
minetest.add_item(droppos, mobs_mc.items.mushroom_brown .. " 5")
|
||||
else
|
||||
minetest.add_item(droppos, mobs_mc.items.mushroom_red .. " 5")
|
||||
end
|
||||
local oldyaw = obj:get_yaw()
|
||||
obj:remove()
|
||||
local cow = minetest.add_entity(pos, "mobs_mc:cow")
|
||||
cow:set_yaw(oldyaw)
|
||||
obj = cow
|
||||
entity = cow:get_luaentity()
|
||||
used = true
|
||||
end
|
||||
if used then
|
||||
obj:set_properties({ textures = texture })
|
||||
entity.gotten = true
|
||||
minetest.sound_play("mcl_tools_shears_cut", { pos = pos }, true)
|
||||
stack:add_wear(65535 / stackdef._mcl_diggroups.shearsy.uses)
|
||||
inv:set_stack("main", stack_id, stack)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Spawn Egg
|
||||
elseif igroups.spawn_egg then
|
||||
-- Spawn mob
|
||||
|
|
|
@ -20,9 +20,9 @@ local function setup_dropper(pos)
|
|||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dropper"))).."]"..
|
||||
"list[current_name;main;3,0.5;3,3;]"..
|
||||
"list[context;main;3,0.5;3,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(3,0.5,3,3)..
|
||||
"listring[current_name;main]"..
|
||||
"listring[context;main]"..
|
||||
"listring[current_player;main]"
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", form)
|
||||
|
|
|
@ -19,8 +19,8 @@ local function setup_dropper(pos)
|
|||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
"label[3,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Dropper"))).."]"..
|
||||
"list[current_name;main;3,0.5;3,3;]"..
|
||||
"listring[current_name;main]"..
|
||||
"list[context;main;3,0.5;3,3;]"..
|
||||
"listring[context;main]"..
|
||||
"listring[current_player;main]"
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", form)
|
||||
|
|
|
@ -66,7 +66,7 @@ local function piston_remove_pusher(pos, oldnode)
|
|||
|
||||
if pushername == pistonspec.pusher then -- make sure there actually is a pusher
|
||||
minetest.remove_node(pusherpos)
|
||||
core.check_for_falling(pusherpos)
|
||||
minetest.check_for_falling(pusherpos)
|
||||
minetest.sound_play("piston_retract", {
|
||||
pos = pos,
|
||||
max_hear_distance = 31,
|
||||
|
@ -87,7 +87,7 @@ local function piston_remove_base(pos, oldnode)
|
|||
|
||||
if basename == pistonspec.onname then -- make sure there actually is a base node
|
||||
minetest.remove_node(basepos)
|
||||
core.check_for_falling(basepos)
|
||||
minetest.check_for_falling(basepos)
|
||||
minetest.sound_play("piston_retract", {
|
||||
pos = pos,
|
||||
max_hear_distance = 31,
|
||||
|
|
|
@ -53,6 +53,15 @@ local function get_consumed_materials(tool, material)
|
|||
return materials_used
|
||||
end
|
||||
|
||||
local function contains(table, value)
|
||||
for _, i in pairs(table) do
|
||||
if i == value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Given 2 input stacks, tells you which is the tool and which is the material.
|
||||
-- Returns ("tool", input1, input2) if input1 is tool and input2 is material.
|
||||
-- Returns ("material", input2, input1) if input1 is material and input2 is tool.
|
||||
|
@ -60,9 +69,15 @@ end
|
|||
local function distinguish_tool_and_material(input1, input2)
|
||||
local def1 = input1:get_definition()
|
||||
local def2 = input2:get_definition()
|
||||
if def1.type == "tool" and def1._repair_material then
|
||||
local r1 = def1._repair_material
|
||||
local r2 = def2._repair_material
|
||||
if def1.type == "tool" and r1 and type(r1) == "table" and contains(r1, input2) then
|
||||
return "tool", input1, input2
|
||||
elseif def2.type == "tool" and def2._repair_material then
|
||||
elseif def2.type == "tool" and r2 and type(r2) == "table" and contains(r2, input1) then
|
||||
return "material", input2, input1
|
||||
elseif def1.type == "tool" and r1 then
|
||||
return "tool", input1, input2
|
||||
elseif def2.type == "tool" and r2 then
|
||||
return "material", input2, input1
|
||||
else
|
||||
return nil
|
||||
|
@ -121,11 +136,28 @@ local function update_anvil_slots(meta)
|
|||
local distinguished, tool, material = distinguish_tool_and_material(input1, input2)
|
||||
if distinguished then
|
||||
local tooldef = tool:get_definition()
|
||||
local repair = tooldef._repair_material
|
||||
local has_correct_material = false
|
||||
if string.sub(tooldef._repair_material, 1, 6) == "group:" then
|
||||
has_correct_material = minetest.get_item_group(material:get_name(), string.sub(tooldef._repair_material, 7)) ~= 0
|
||||
elseif material:get_name() == tooldef._repair_material then
|
||||
has_correct_material = true
|
||||
local material_name = material:get_name()
|
||||
if type(repair) == "string" then
|
||||
if string.sub(repair, 1, 6) == "group:" then
|
||||
has_correct_material = minetest.get_item_group(material_name, string.sub(repair, 7)) ~= 0
|
||||
elseif material_name == repair then
|
||||
has_correct_material = true
|
||||
end
|
||||
else
|
||||
if contains(repair, material_name) then
|
||||
has_correct_material = true
|
||||
else
|
||||
for _, r in pairs(repair) do
|
||||
if string.sub(r, 1, 6) == "group:" then
|
||||
if minetest.get_item_group(material_name, string.sub(r, 7)) ~= 0 then
|
||||
has_correct_material = true
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if has_correct_material and tool:get_wear() > 0 then
|
||||
local materials_used = get_consumed_materials(tool, material)
|
||||
|
@ -284,6 +316,12 @@ local function damage_anvil_by_falling(pos, distance)
|
|||
end
|
||||
end
|
||||
|
||||
local anvilbox = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -8 / 16, -8 / 16, -6 / 16, 8 / 16, 8 / 16, 6 / 16 },
|
||||
},
|
||||
}
|
||||
local anvildef = {
|
||||
groups = {pickaxey=1, falling_node=1, falling_node_damage=1, crush_after_fall=1, deco_block=1, anvil=1},
|
||||
tiles = {"mcl_anvils_anvil_top_damaged_0.png^[transformR90", "mcl_anvils_anvil_base.png", "mcl_anvils_anvil_side.png"},
|
||||
|
@ -297,11 +335,14 @@ local anvildef = {
|
|||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-8/16, 2/16, -5/16, 8/16, 8/16, 5/16}, -- top
|
||||
{-5/16, -4/16, -2/16, 5/16, 5/16, 2/16}, -- middle
|
||||
{-8/16, -8/16, -5/16, 8/16, -4/16, 5/16}, -- base
|
||||
{ -6 / 16, -8 / 16, -6 / 16, 6 / 16, -4 / 16, 6 / 16 },
|
||||
{ -5 / 16, -4 / 16, -4 / 16, 5 / 16, -3 / 16, 4 / 16 },
|
||||
{ -4 / 16, -3 / 16, -2 / 16, 4 / 16, 2 / 16, 2 / 16 },
|
||||
{ -8 / 16, 2 / 16, -5 / 16, 8 / 16, 8 / 16, 5 / 16 },
|
||||
}
|
||||
},
|
||||
selection_box = anvilbox,
|
||||
collision_box = anvilbox,
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 1200,
|
||||
_mcl_hardness = 5,
|
||||
|
|
Before Width: | Height: | Size: 195 B After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 5.7 KiB |
|
@ -1,5 +1,5 @@
|
|||
name = mcl_armor
|
||||
author = stu
|
||||
description = Adds craftable armor that is visible to other players.
|
||||
depends = mcl_core, mcl_player, mcl_enchanting
|
||||
depends = mcl_core, mcl_player, mcl_enchanting, mcl_damage
|
||||
optional_depends = mcl_fire, ethereal, bakedclay
|
||||
|
|
|
@ -25,6 +25,8 @@ mcl_player.player_register_model("mcl_armor_character.b3d", {
|
|||
sit_mount = {x=484, y=484},
|
||||
die = {x=498, y=498},
|
||||
fly = {x=502, y=581},
|
||||
bow_walk = {x=650, y=670},
|
||||
bow_sneak = {x=675, y=695},
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -55,6 +57,8 @@ mcl_player.player_register_model("mcl_armor_character_female.b3d", {
|
|||
sit_mount = {x=484, y=484},
|
||||
die = {x=498, y=498},
|
||||
fly = {x=502, y=581},
|
||||
bow_walk = {x=650, y=670},
|
||||
bow_sneak = {x=675, y=695},
|
||||
},
|
||||
})
|
||||
|
||||
|
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 409 B |
|
@ -573,7 +573,7 @@ for colorid, colortab in pairs(mcl_banners.colors) do
|
|||
end,
|
||||
})
|
||||
|
||||
if mod_mcl_core and minetest.get_modpath("mcl_wool") then
|
||||
if mod_mcl_core and minetest.get_modpath("mcl_wool") and pattern_name == "" then
|
||||
minetest.register_craft({
|
||||
output = itemstring,
|
||||
recipe = {
|
||||
|
|
|
@ -8,9 +8,6 @@ local N = function(s) return s end
|
|||
-- Maximum number of layers which can be put on a banner by crafting.
|
||||
local max_layers_crafting = 12
|
||||
|
||||
-- Maximum number of layers when banner includes a gradient (workaround, see below).
|
||||
local max_layers_gradient = 3
|
||||
|
||||
-- Max. number lines in the descriptions for the banner layers.
|
||||
-- This is done to avoid huge tooltips.
|
||||
local max_layer_lines = 6
|
||||
|
@ -398,16 +395,6 @@ local function banner_pattern_craft(itemstack, player, old_craft_grid, craft_inv
|
|||
if #layers >= max_layers_crafting then
|
||||
return ItemStack("")
|
||||
end
|
||||
-- Lower layer limit when banner includes any gradient.
|
||||
-- Workaround to circumvent Minetest bug (https://github.com/minetest/minetest/issues/6210)
|
||||
-- TODO: Remove this restriction when bug #6210 is fixed.
|
||||
if #layers >= max_layers_gradient then
|
||||
for l=1, #layers do
|
||||
if layers[l].pattern == "gradient" or layers[l].pattern == "gradient_up" then
|
||||
return ItemStack("")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local matching_pattern
|
||||
local max_i = player:get_inventory():get_size("craft")
|
||||
|
|
|
@ -330,7 +330,7 @@ function mcl_beds.on_rightclick(pos, player, is_top)
|
|||
message = select(2, lay_down(player, ppos, other))
|
||||
end
|
||||
if message then
|
||||
mcl_tmp_message.message(player, message)
|
||||
mcl_title.set(player, "actionbar", {text=message, color="white", stay=60})
|
||||
end
|
||||
else
|
||||
lay_down(player, nil, nil, false)
|
||||
|
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 3.0 KiB |
|
@ -10,9 +10,9 @@ local function active_brewing_formspec(fuel_percent, brew_percent)
|
|||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.75;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.75,9,1)..
|
||||
"list[current_name;fuel;0.5,1.75;1,1;]"..
|
||||
"list[context;fuel;0.5,1.75;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0.5,1.75,1,1).."image[0.5,1.75;1,1;mcl_brewing_fuel_bg.png]"..
|
||||
"list[current_name;input;2.75,0.5;1,1;]"..
|
||||
"list[context;input;2.75,0.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
|
||||
"list[context;stand;4.5,2.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(4.5,2.5,1,1).."image[4.5,2.5;1,1;mcl_brewing_bottle_bg.png]"..
|
||||
|
@ -28,8 +28,8 @@ local function active_brewing_formspec(fuel_percent, brew_percent)
|
|||
(brew_percent)..":mcl_brewing_bubbles_active.png]"..
|
||||
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;fuel]"..
|
||||
"listring[current_name;input]"..
|
||||
"listring[context;fuel]"..
|
||||
"listring[context;input]"..
|
||||
"listring[context;stand]"
|
||||
end
|
||||
|
||||
|
@ -41,9 +41,9 @@ local brewing_formspec = "size[9,8.75]"..
|
|||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.75;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.75,9,1)..
|
||||
"list[current_name;fuel;0.5,1.75;1,1;]"..
|
||||
"list[context;fuel;0.5,1.75;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0.5,1.75,1,1).."image[0.5,1.75;1,1;mcl_brewing_fuel_bg.png]"..
|
||||
"list[current_name;input;2.75,0.5;1,1;]"..
|
||||
"list[context;input;2.75,0.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
|
||||
"list[context;stand;4.5,2.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(4.5,2.5,1,1).."image[4.5,2.5;1,1;mcl_brewing_bottle_bg.png]"..
|
||||
|
@ -56,8 +56,8 @@ local brewing_formspec = "size[9,8.75]"..
|
|||
"image[2.76,1.4;1,2.15;mcl_brewing_bubbles.png]"..
|
||||
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;fuel]"..
|
||||
"listring[current_name;input]"..
|
||||
"listring[context;fuel]"..
|
||||
"listring[context;input]"..
|
||||
"listring[context;stand]"
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_brewing
|
||||
author = bzoss
|
||||
depends = mcl_init, mcl_formspec, mcl_sounds, mcl_potions, mcl_mobitems
|
||||
optional_depends = mcl_core, doc, screwdriver
|
||||
optional_depends = mcl_core, doc, screwdriver, mesecons_mvps
|
||||
|
|
|
@ -9,13 +9,46 @@ Accept folowing params:
|
|||
* string: name of the node to place
|
||||
* function(pos): will returns name of the node to place with pos being the placement position
|
||||
* source_take: table of liquid source node names to take
|
||||
* itemname: itemstring of the new bucket item (or nil if liquid is not takeable)
|
||||
* bucketname: itemstring of the new bucket item
|
||||
* inventory_image: texture of the new bucket item (ignored if itemname == nil)
|
||||
* name: user-visible bucket description
|
||||
* longdesc: long explanatory description (for help)
|
||||
* usagehelp: short usage explanation (for help)
|
||||
* tt_help: very short tooltip help
|
||||
* extra_check(pos, placer): (optional) function(pos) which can returns false to avoid placing the liquid. Placer is object/player who is placing the liquid, can be nil.
|
||||
* extra_check(pos, placer): (optional) function(pos)
|
||||
* groups: optional list of item groups
|
||||
|
||||
This function can be called from any mod (which depends on this one)
|
||||
|
||||
**Usage exemple:**
|
||||
```lua
|
||||
mcl_buckets.register_liquid({
|
||||
bucketname = "dummy:bucket_dummy",
|
||||
--source_place = "dummy:dummy_source",
|
||||
source_place = function(pos)
|
||||
if condition then
|
||||
return "dummy:dummy_source"
|
||||
else
|
||||
return "dummy:dummy_source_nether"
|
||||
end
|
||||
end,
|
||||
source_take = {"dummy:dummy_source"},
|
||||
inventory_image = "bucket_dummy.png",
|
||||
name = S("Dummy liquid Bucket"),
|
||||
longdesc = S("This bucket is filled with a dummy liquid."),
|
||||
usagehelp = S("Place it to empty the bucket and create a dummy liquid source."),
|
||||
tt_help = S("Places a dummy liquid source"),
|
||||
extra_check = function(pos, placer)
|
||||
--pos = pos where the liquid should be placed
|
||||
--placer people who tried to place the bucket (can be nil)
|
||||
|
||||
--no liquid node will be placed
|
||||
--the bucket will not be emptied
|
||||
--return false, false
|
||||
|
||||
--liquid node will be placed
|
||||
--the bucket will be emptied
|
||||
return true, true
|
||||
end,
|
||||
groups = { dummy_group = 123 },
|
||||
})
|
||||
```
|
|
@ -1,9 +1,12 @@
|
|||
Bucket mod.
|
||||
Originally taken from Minetest Game, adapted for MineClone 2.
|
||||
# MineClone2 Bucket (`mcl_bucket`)
|
||||
Originally taken from Minetest Game, adapted for MineClone2.
|
||||
|
||||
This mod add buckets to the game, including an API to register your own (see `API.md`).
|
||||
|
||||
## License
|
||||
|
||||
License of source code:
|
||||
-----------------------
|
||||
Copyright (C) 2011-2012 Kahrl <kahrl@gmx.net>
|
||||
|
||||
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
|
@ -3,6 +3,7 @@ local modname = minetest.get_current_modname()
|
|||
local S = minetest.get_translator(modname)
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
|
||||
-- Compatibility with old bucket mod
|
||||
minetest.register_alias("bucket:bucket_empty", "mcl_buckets:bucket_empty")
|
||||
minetest.register_alias("bucket:bucket_water", "mcl_buckets:bucket_water")
|
||||
minetest.register_alias("bucket:bucket_lava", "mcl_buckets:bucket_lava")
|
||||
|
@ -11,13 +12,24 @@ local mod_doc = minetest.get_modpath("doc")
|
|||
local mod_mcl_core = minetest.get_modpath("mcl_core")
|
||||
--local mod_mclx_core = minetest.get_modpath("mclx_core")
|
||||
|
||||
-- Localize some functions for faster access
|
||||
local vector = vector
|
||||
local math = math
|
||||
local string = string
|
||||
|
||||
local raycast = minetest.raycast
|
||||
local get_node = minetest.get_node
|
||||
local add_node = minetest.add_node
|
||||
local add_item = minetest.add_item
|
||||
|
||||
|
||||
if mod_mcl_core then
|
||||
minetest.register_craft({
|
||||
output = "mcl_buckets:bucket_empty 1",
|
||||
recipe = {
|
||||
{"mcl_core:iron_ingot", "", "mcl_core:iron_ingot"},
|
||||
{"", "mcl_core:iron_ingot", ""},
|
||||
}
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -25,147 +37,218 @@ mcl_buckets = {}
|
|||
mcl_buckets.liquids = {}
|
||||
|
||||
-- Sound helper functions for placing and taking liquids
|
||||
local sound_place = function(itemname, pos)
|
||||
local function sound_place(itemname, pos)
|
||||
local def = minetest.registered_nodes[itemname]
|
||||
if def and def.sounds and def.sounds.place then
|
||||
minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true)
|
||||
end
|
||||
end
|
||||
|
||||
local sound_take = function(itemname, pos)
|
||||
local function sound_take(itemname, pos)
|
||||
local def = minetest.registered_nodes[itemname]
|
||||
if def and def.sounds and def.sounds.dug then
|
||||
minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true)
|
||||
end
|
||||
end
|
||||
|
||||
local place_liquid = function(pos, itemstring)
|
||||
local function place_liquid(pos, itemstring)
|
||||
local fullness = minetest.registered_nodes[itemstring].liquid_range
|
||||
sound_place(itemstring, pos)
|
||||
minetest.add_node(pos, {name=itemstring, param2=fullness})
|
||||
end
|
||||
|
||||
local function give_bucket(new_bucket, itemstack, user)
|
||||
local inv = user:get_inventory()
|
||||
if minetest.is_creative_enabled(user:get_player_name()) then
|
||||
--TODO: is a full bucket added if inv doesn't contain one?
|
||||
return itemstack
|
||||
else
|
||||
if itemstack:get_count() == 1 then
|
||||
return new_bucket
|
||||
else
|
||||
if inv:room_for_item("main", new_bucket) then
|
||||
inv:add_item("main", new_bucket)
|
||||
else
|
||||
add_item(user:get_pos(), new_bucket)
|
||||
end
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local pointable_sources = {}
|
||||
|
||||
local function bucket_raycast(user)
|
||||
--local pos = user:get_pos()
|
||||
local pos = user:get_pos()
|
||||
--local pos = vector.add(user:get_pos(), user:get_bone_position("Head_Control"))
|
||||
pos.y = pos.y + user:get_properties().eye_height
|
||||
local look_dir = user:get_look_dir()
|
||||
look_dir = vector.multiply(look_dir, 5)
|
||||
local pos2 = vector.add(pos, look_dir)
|
||||
|
||||
local ray = raycast(pos, pos2, false, true)
|
||||
if ray then
|
||||
for pointed_thing in ray do
|
||||
if pointed_thing and pointable_sources[get_node(pointed_thing.above).name] then
|
||||
--minetest.chat_send_all("found!")
|
||||
return {under=pointed_thing.under,above=pointed_thing.above}
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
local function get_node_place(source_place, place_pos)
|
||||
local node_place
|
||||
if type(source_place) == "function" then
|
||||
node_place = source_place(place_pos)
|
||||
else
|
||||
node_place = source_place
|
||||
end
|
||||
return node_place
|
||||
end
|
||||
|
||||
local function get_extra_check(check, pos, user)
|
||||
local result
|
||||
local take_bucket
|
||||
if check then
|
||||
result, take_bucket = check(pos, user)
|
||||
if result == nil then result = true end
|
||||
if take_bucket == nil then take_bucket = true end
|
||||
else
|
||||
result = true
|
||||
take_bucket = true
|
||||
end
|
||||
return result, take_bucket
|
||||
end
|
||||
|
||||
local function get_bucket_drop(itemstack, user, take_bucket)
|
||||
-- Handle bucket item and inventory stuff
|
||||
if take_bucket and not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
-- Add empty bucket and put it into inventory, if possible.
|
||||
-- Drop empty bucket otherwise.
|
||||
local new_bucket = ItemStack("mcl_buckets:bucket_empty")
|
||||
if itemstack:get_count() == 1 then
|
||||
return new_bucket
|
||||
else
|
||||
local inv = user:get_inventory()
|
||||
if inv:room_for_item("main", new_bucket) then
|
||||
inv:add_item("main", new_bucket)
|
||||
else
|
||||
add_item(user:get_pos(), new_bucket)
|
||||
end
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
else
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_buckets.register_liquid(def)
|
||||
for i=1, #def.source_take do
|
||||
mcl_buckets.liquids[def.source_take[i]] = {
|
||||
for _,source in ipairs(def.source_take) do
|
||||
mcl_buckets.liquids[source] = {
|
||||
source_place = def.source_place,
|
||||
source_take = def.source_take[i],
|
||||
source_take = source,
|
||||
on_take = def.on_take,
|
||||
itemname = def.itemname,
|
||||
bucketname = def.bucketname,
|
||||
}
|
||||
pointable_sources[source] = true
|
||||
if type(def.source_place) == "string" then
|
||||
mcl_buckets.liquids[def.source_place] = mcl_buckets.liquids[def.source_take[i]]
|
||||
mcl_buckets.liquids[def.source_place] = mcl_buckets.liquids[source]
|
||||
end
|
||||
end
|
||||
|
||||
if def.itemname then
|
||||
minetest.register_craftitem(def.itemname, {
|
||||
description = def.name,
|
||||
_doc_items_longdesc = def.longdesc,
|
||||
_doc_items_usagehelp = def.usagehelp,
|
||||
_tt_help = def.tt_help,
|
||||
inventory_image = def.inventory_image,
|
||||
stack_max = 1,
|
||||
groups = def.groups,
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
-- Must be pointing to node
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
if def.bucketname == nil or def.bucketname == "" then
|
||||
error(string.format("[mcl_bucket] Invalid itemname then registering [%s]!", def.name))
|
||||
end
|
||||
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
local place_pos = pointed_thing.under
|
||||
local nn = node.name
|
||||
local nodedef = minetest.registered_nodes[nn]
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
if user and not user:get_player_control().sneak then
|
||||
if nodedef and nodedef.on_rightclick then
|
||||
return nodedef.on_rightclick(place_pos, node, user, itemstack) or itemstack
|
||||
end
|
||||
end
|
||||
minetest.register_craftitem(def.bucketname, {
|
||||
description = def.name,
|
||||
_doc_items_longdesc = def.longdesc,
|
||||
_doc_items_usagehelp = def.usagehelp,
|
||||
_tt_help = def.tt_help,
|
||||
inventory_image = def.inventory_image,
|
||||
stack_max = 1,
|
||||
groups = def.groups,
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
-- Must be pointing to node
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
local new_stack = mcl_util.call_on_rightclick(itemstack, user, pointed_thing)
|
||||
if new_stack then
|
||||
return new_stack
|
||||
end
|
||||
|
||||
local node_place
|
||||
if type(def.source_place) == "function" then
|
||||
node_place = def.source_place(place_pos)
|
||||
else
|
||||
node_place = def.source_place
|
||||
end
|
||||
-- Check if pointing to a buildable node
|
||||
--local item = itemstack:get_name()
|
||||
local undernode = get_node(pointed_thing.under)
|
||||
local abovenode = get_node(pointed_thing.above)
|
||||
local buildable1 = minetest.registered_nodes[undernode.name] and minetest.registered_nodes[undernode.name].buildable_to
|
||||
local buildable2 = minetest.registered_nodes[abovenode.name] and minetest.registered_nodes[abovenode.name].buildable_to
|
||||
if not buildable1 and not buildable2 then return itemstack end --if both nodes aren't buildable_to, skip
|
||||
|
||||
if def.extra_check and def.extra_check(place_pos, user) == true and nodedef and nodedef.buildable_to then
|
||||
-- buildable; replace the node
|
||||
if buildable1 then
|
||||
local result, take_bucket = get_extra_check(def.extra_check, pointed_thing.under, user)
|
||||
if result then
|
||||
local node_place = get_node_place(def.source_place, pointed_thing.under)
|
||||
local pns = user:get_player_name()
|
||||
if minetest.is_protected(place_pos, pns) then
|
||||
minetest.record_protection_violation(place_pos, pns)
|
||||
|
||||
-- Check protection
|
||||
if minetest.is_protected(pointed_thing.under, pns) then
|
||||
minetest.record_protection_violation(pointed_thing.under, pns)
|
||||
return itemstack
|
||||
end
|
||||
place_liquid(place_pos, node_place)
|
||||
|
||||
-- Place liquid
|
||||
place_liquid(pointed_thing.under, node_place)
|
||||
|
||||
-- Update doc mod
|
||||
if mod_doc and doc.entry_exists("nodes", node_place) then
|
||||
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", node_place)
|
||||
end
|
||||
else
|
||||
-- not buildable to; place the liquid above
|
||||
-- check if the node above can be replaced
|
||||
local abovenode = minetest.get_node(pointed_thing.above)
|
||||
if minetest.registered_nodes[abovenode.name] and minetest.registered_nodes[abovenode.name].buildable_to then
|
||||
local pn = user:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
minetest.record_protection_violation(pointed_thing.above, pn)
|
||||
return itemstack
|
||||
end
|
||||
place_liquid(pointed_thing.above, node_place)
|
||||
if mod_doc and doc.entry_exists("nodes", node_place) then
|
||||
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", node_place)
|
||||
end
|
||||
else
|
||||
-- do not remove the bucket with the liquid
|
||||
return
|
||||
end
|
||||
end
|
||||
return get_bucket_drop(itemstack, user, take_bucket)
|
||||
elseif buildable2 then
|
||||
local result, take_bucket = get_extra_check(def.extra_check, pointed_thing.above, user)
|
||||
if result then
|
||||
local node_place = get_node_place(def.source_place, pointed_thing.above)
|
||||
local pns = user:get_player_name()
|
||||
|
||||
-- Handle bucket item and inventory stuff
|
||||
if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
-- Add empty bucket and put it into inventory, if possible.
|
||||
-- Drop empty bucket otherwise.
|
||||
local new_bucket = ItemStack("mcl_buckets:bucket_empty")
|
||||
if itemstack:get_count() == 1 then
|
||||
return new_bucket
|
||||
else
|
||||
local inv = user:get_inventory()
|
||||
if inv:room_for_item("main", new_bucket) then
|
||||
inv:add_item("main", new_bucket)
|
||||
else
|
||||
minetest.add_item(user:get_pos(), new_bucket)
|
||||
end
|
||||
itemstack:take_item()
|
||||
-- Check protection
|
||||
if minetest.is_protected(pointed_thing.above, pns) then
|
||||
minetest.record_protection_violation(pointed_thing.above, pns)
|
||||
return itemstack
|
||||
end
|
||||
else
|
||||
return
|
||||
end
|
||||
end,
|
||||
_on_dispense = function(stack, pos, droppos, dropnode, dropdir)
|
||||
--local iname = stack:get_name()
|
||||
local buildable = minetest.registered_nodes[dropnode.name].buildable_to or dropnode.name == "mcl_portals:portal"
|
||||
|
||||
--if def.extra_check and def.extra_check(droppos, nil) == false then
|
||||
-- Fail placement of liquid
|
||||
if def.extra_check and def.extra_check(droppos, nil) == true and buildable then
|
||||
-- buildable; replace the node
|
||||
local node_place
|
||||
if type(def.source_place) == "function" then
|
||||
node_place = def.source_place(droppos)
|
||||
else
|
||||
node_place = def.source_place
|
||||
-- Place liquid
|
||||
place_liquid(pointed_thing.above, node_place)
|
||||
|
||||
-- Update doc mod
|
||||
if mod_doc and doc.entry_exists("nodes", node_place) then
|
||||
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", node_place)
|
||||
end
|
||||
place_liquid(droppos, node_place)
|
||||
stack:set_name("mcl_buckets:bucket_empty")
|
||||
end
|
||||
return stack
|
||||
end,
|
||||
})
|
||||
end
|
||||
return get_bucket_drop(itemstack, user, take_bucket)
|
||||
else
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
_on_dispense = function(stack, pos, droppos, dropnode, dropdir)
|
||||
local buildable = minetest.registered_nodes[dropnode.name].buildable_to or dropnode.name == "mcl_portals:portal"
|
||||
if not buildable then return stack end
|
||||
local result, take_bucket = get_extra_check(def.extra_check, droppos, nil)
|
||||
if result then -- Fail placement of liquid if result is false
|
||||
place_liquid(droppos, get_node_place(def.source_place, droppos))
|
||||
end
|
||||
if take_bucket then
|
||||
stack:set_name("mcl_buckets:bucket_empty")
|
||||
end
|
||||
return stack
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craftitem("mcl_buckets:bucket_empty", {
|
||||
|
@ -173,8 +256,7 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", {
|
|||
_doc_items_longdesc = S("A bucket can be used to collect and release liquids."),
|
||||
_doc_items_usagehelp = S("Punch a liquid source to collect it. You can then use the filled bucket to place the liquid somewhere else."),
|
||||
_tt_help = S("Collects liquids"),
|
||||
|
||||
liquids_pointable = true,
|
||||
--liquids_pointable = true,
|
||||
inventory_image = "bucket.png",
|
||||
stack_max = 16,
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
|
@ -184,74 +266,70 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", {
|
|||
end
|
||||
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
local new_stack = mcl_util.call_on_rightclick(itemstack, user, pointed_thing)
|
||||
if new_stack then
|
||||
return new_stack
|
||||
end
|
||||
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
local nn = node.name
|
||||
if user and not user:get_player_control().sneak then
|
||||
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].on_rightclick then
|
||||
return minetest.registered_nodes[nn].on_rightclick(pointed_thing.under, node, user, itemstack) or itemstack
|
||||
end
|
||||
end
|
||||
|
||||
-- Can't steal liquids
|
||||
if minetest.is_protected(pointed_thing.above, user:get_player_name()) then
|
||||
minetest.record_protection_violation(pointed_thing.under, user:get_player_name())
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- Check if pointing to a liquid source
|
||||
local liquiddef = mcl_buckets.liquids[nn]
|
||||
local new_bucket
|
||||
if liquiddef and liquiddef.itemname and (nn == liquiddef.source_take) then
|
||||
|
||||
-- Fill bucket, but not in Creative Mode
|
||||
if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
new_bucket = ItemStack({name = liquiddef.itemname})
|
||||
if liquiddef.on_take then
|
||||
liquiddef.on_take(user)
|
||||
end
|
||||
local liquid_node = bucket_raycast(user)
|
||||
if liquid_node then
|
||||
if minetest.is_protected(liquid_node.above, user:get_player_name()) then
|
||||
minetest.record_protection_violation(liquid_node.above, user:get_player_name())
|
||||
end
|
||||
local liquid_name = get_node(liquid_node.above).name
|
||||
if liquid_name then
|
||||
local liquid_def = mcl_buckets.liquids[liquid_name]
|
||||
if liquid_def then
|
||||
--minetest.chat_send_all("test")
|
||||
-- Fill bucket, but not in Creative Mode
|
||||
-- FIXME: remove this line
|
||||
--if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
if not false then
|
||||
new_bucket = ItemStack({name = liquid_def.bucketname})
|
||||
if liquid_def.on_take then
|
||||
liquid_def.on_take(user)
|
||||
end
|
||||
end
|
||||
add_node(liquid_node.above, {name="air"})
|
||||
sound_take(nn, liquid_node.above)
|
||||
|
||||
minetest.add_node(pointed_thing.under, {name="air"})
|
||||
sound_take(nn, pointed_thing.under)
|
||||
|
||||
if mod_doc and doc.entry_exists("nodes", nn) then
|
||||
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", nn)
|
||||
end
|
||||
|
||||
elseif nn == "mcl_cauldrons:cauldron_3" then
|
||||
-- Take water out of full cauldron
|
||||
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron"})
|
||||
if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
new_bucket = ItemStack("mcl_buckets:bucket_water")
|
||||
end
|
||||
sound_take("mcl_core:water_source", pointed_thing.under)
|
||||
elseif nn == "mcl_cauldrons:cauldron_3r" then
|
||||
-- Take river water out of full cauldron
|
||||
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron"})
|
||||
if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
new_bucket = ItemStack("mcl_buckets:bucket_river_water")
|
||||
end
|
||||
sound_take("mclx_core:river_water_source", pointed_thing.under)
|
||||
end
|
||||
|
||||
-- Add liquid bucket and put it into inventory, if possible.
|
||||
-- Drop new bucket otherwise.
|
||||
if new_bucket then
|
||||
if itemstack:get_count() == 1 then
|
||||
return new_bucket
|
||||
else
|
||||
local inv = user:get_inventory()
|
||||
if inv:room_for_item("main", new_bucket) then
|
||||
inv:add_item("main", new_bucket)
|
||||
if mod_doc and doc.entry_exists("nodes", liquid_name) then
|
||||
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", liquid_name)
|
||||
end
|
||||
if new_bucket then
|
||||
return give_bucket(new_bucket, itemstack, user)
|
||||
end
|
||||
else
|
||||
minetest.add_item(user:get_pos(), new_bucket)
|
||||
minetest.log("error", string.format("[mcl_buckets] Node [%s] has invalid group [_mcl_bucket_pointable]!", liquid_name))
|
||||
end
|
||||
if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
else
|
||||
-- FIXME: replace this ugly code by cauldrons API
|
||||
if nn == "mcl_cauldrons:cauldron_3" then
|
||||
-- Take water out of full cauldron
|
||||
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron"})
|
||||
if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
new_bucket = ItemStack("mcl_buckets:bucket_water")
|
||||
end
|
||||
sound_take("mcl_core:water_source", pointed_thing.under)
|
||||
elseif nn == "mcl_cauldrons:cauldron_3r" then
|
||||
-- Take river water out of full cauldron
|
||||
minetest.set_node(pointed_thing.under, {name="mcl_cauldrons:cauldron"})
|
||||
if not minetest.is_creative_enabled(user:get_player_name()) then
|
||||
new_bucket = ItemStack("mcl_buckets:bucket_river_water")
|
||||
end
|
||||
sound_take("mclx_core:river_water_source", pointed_thing.under)
|
||||
end
|
||||
if new_bucket then
|
||||
return give_bucket(new_bucket, itemstack, user)
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
_on_dispense = function(stack, pos, droppos, dropnode, dropdir)
|
||||
-- Fill empty bucket with liquid or drop bucket if no liquid
|
||||
|
@ -259,9 +337,9 @@ minetest.register_craftitem("mcl_buckets:bucket_empty", {
|
|||
|
||||
local liquiddef = mcl_buckets.liquids[dropnode.name]
|
||||
local new_bucket
|
||||
if liquiddef and liquiddef.itemname and (dropnode.name == liquiddef.source_take) then
|
||||
if liquiddef and liquiddef.bucketname and (dropnode.name == liquiddef.source_take) then
|
||||
-- Fill bucket
|
||||
new_bucket = ItemStack({name = liquiddef.itemname})
|
||||
new_bucket = ItemStack({name = liquiddef.bucketname})
|
||||
sound_take(dropnode.name, droppos)
|
||||
collect_liquid = true
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name = mcl_buckets
|
||||
author = Kahrl
|
||||
description =
|
||||
depends = mcl_worlds
|
||||
depends = mcl_worlds, mcl_util
|
||||
optional_depends = mcl_core, mclx_core, doc
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ local mod_mcl_core = minetest.get_modpath("mcl_core")
|
|||
local mod_mclx_core = minetest.get_modpath("mclx_core")
|
||||
local has_awards = minetest.get_modpath("awards")
|
||||
|
||||
local sound_place = function(itemname, pos)
|
||||
local function sound_place(itemname, pos)
|
||||
local def = minetest.registered_nodes[itemname]
|
||||
if def and def.sounds and def.sounds.place then
|
||||
minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true)
|
||||
|
@ -34,7 +34,7 @@ if mod_mcl_core then
|
|||
awards.unlock(user:get_player_name(), "mcl:hotStuff")
|
||||
end
|
||||
end,
|
||||
itemname = "mcl_buckets:bucket_lava",
|
||||
bucketname = "mcl_buckets:bucket_lava",
|
||||
inventory_image = "bucket_lava.png",
|
||||
name = S("Lava Bucket"),
|
||||
longdesc = S("A bucket can be used to collect and release liquids. This one is filled with hot lava, safely contained inside. Use with caution."),
|
||||
|
@ -46,22 +46,13 @@ if mod_mcl_core then
|
|||
mcl_buckets.register_liquid({
|
||||
source_place = "mcl_core:water_source",
|
||||
source_take = {"mcl_core:water_source"},
|
||||
itemname = "mcl_buckets:bucket_water",
|
||||
bucketname = "mcl_buckets:bucket_water",
|
||||
inventory_image = "bucket_water.png",
|
||||
name = S("Water Bucket"),
|
||||
longdesc = S("A bucket can be used to collect and release liquids. This one is filled with water."),
|
||||
usagehelp = S("Place it to empty the bucket and create a water source."),
|
||||
tt_help = S("Places a water source"),
|
||||
extra_check = function(pos, placer)
|
||||
-- Check protection
|
||||
local placer_name = ""
|
||||
if placer then
|
||||
placer_name = placer:get_player_name()
|
||||
end
|
||||
if placer and minetest.is_protected(pos, placer_name) then
|
||||
minetest.record_protection_violation(pos, placer_name)
|
||||
return false
|
||||
end
|
||||
local nn = minetest.get_node(pos).name
|
||||
-- Pour water into cauldron
|
||||
if minetest.get_item_group(nn, "cauldron") ~= 0 then
|
||||
|
@ -70,13 +61,13 @@ if mod_mcl_core then
|
|||
minetest.set_node(pos, {name="mcl_cauldrons:cauldron_3"})
|
||||
end
|
||||
sound_place("mcl_core:water_source", pos)
|
||||
return false
|
||||
return false, true
|
||||
-- Evaporate water if used in Nether (except on cauldron)
|
||||
else
|
||||
local dim = mcl_worlds.pos_to_dimension(pos)
|
||||
if dim == "nether" then
|
||||
minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true)
|
||||
return false
|
||||
return false, true
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
@ -89,22 +80,13 @@ if mod_mclx_core then
|
|||
mcl_buckets.register_liquid({
|
||||
source_place = "mclx_core:river_water_source",
|
||||
source_take = {"mclx_core:river_water_source"},
|
||||
itemname = "mcl_buckets:bucket_river_water",
|
||||
bucketname = "mcl_buckets:bucket_river_water",
|
||||
inventory_image = "bucket_river_water.png",
|
||||
name = S("River Water Bucket"),
|
||||
longdesc = S("A bucket can be used to collect and release liquids. This one is filled with river water."),
|
||||
usagehelp = S("Place it to empty the bucket and create a river water source."),
|
||||
tt_help = S("Places a river water source"),
|
||||
extra_check = function(pos, placer)
|
||||
-- Check protection
|
||||
local placer_name = ""
|
||||
if placer then
|
||||
placer_name = placer:get_player_name()
|
||||
end
|
||||
if placer and minetest.is_protected(pos, placer_name) then
|
||||
minetest.record_protection_violation(pos, placer_name)
|
||||
return false
|
||||
end
|
||||
local nn = minetest.get_node(pos).name
|
||||
-- Pour into cauldron
|
||||
if minetest.get_item_group(nn, "cauldron") ~= 0 then
|
||||
|
@ -113,13 +95,13 @@ if mod_mclx_core then
|
|||
minetest.set_node(pos, {name="mcl_cauldrons:cauldron_3r"})
|
||||
end
|
||||
sound_place("mcl_core:water_source", pos)
|
||||
return false
|
||||
return false, true
|
||||
else
|
||||
-- Evaporate water if used in Nether (except on cauldron)
|
||||
local dim = mcl_worlds.pos_to_dimension(pos)
|
||||
if dim == "nether" then
|
||||
minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true)
|
||||
return false
|
||||
return false, true
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
|
|
@ -104,7 +104,7 @@ local register_slice = function(level, nodebox, desc)
|
|||
-- Check if we were allowed to eat
|
||||
if newcake:get_name() ~= this or minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
minetest.remove_node(pos)
|
||||
core.check_for_falling(pos)
|
||||
minetest.check_for_falling(pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1108,14 +1108,14 @@ local function formspec_shulker_box(name)
|
|||
end
|
||||
return "size[9,8.75]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", name)).."]"..
|
||||
"list[current_name;main;0,0.5;9,3;]"..
|
||||
"list[context;main;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"listring[current_name;main]"..
|
||||
"listring[context;main]"..
|
||||
"listring[current_player;main]"
|
||||
end
|
||||
|
||||
|
@ -1133,7 +1133,7 @@ for color, desc in pairs(boxtypes) do
|
|||
if mod_doc then
|
||||
if is_canonical then
|
||||
longdesc = S("A shulker box is a portable container which provides 27 inventory slots for any item except shulker boxes. Shulker boxes keep their inventory when broken, so shulker boxes as well as their contents can be taken as a single item. Shulker boxes come in many different colors.")
|
||||
usagehelp = S("To access the inventory of a shulker box, place and right-click it. To take a shulker box and its contents with you, just break and collect it, the items will not fall out.")
|
||||
usagehelp = S("To access the inventory of a shulker box, place and right-click it. To take a shulker box and its contents with you, just break and collect it, the items will not fall out. Place the shulker box again to be able to retrieve its contents.")
|
||||
entry_name = S("Shulker Box")
|
||||
else
|
||||
create_entry = false
|
||||
|
|
|
@ -24,7 +24,7 @@ Red Shulker Box=
|
|||
Grey Shulker Box=
|
||||
Black Shulker Box=
|
||||
A shulker box is a portable container which provides 27 inventory slots for any item except shulker boxes. Shulker boxes keep their inventory when broken, so shulker boxes as well as their contents can be taken as a single item. Shulker boxes come in many different colors.=
|
||||
To access the inventory of a shulker box, place and right-click it. To take a shulker box and its contents with you, just break and collect it, the items will not fall out.=
|
||||
To access the inventory of a shulker box, place and right-click it. To take a shulker box and its contents with you, just break and collect it, the items will not fall out. Place the shulker box again to be able to retrieve its contents.=
|
||||
Shulker Box=
|
||||
Large Chest=
|
||||
Inventory=
|
||||
|
|
|
@ -179,11 +179,12 @@ minetest.register_abm({
|
|||
liquid_flow_action(pos, "lava", function(pos)
|
||||
minetest.remove_node(pos)
|
||||
minetest.sound_play("builtin_item_lava", {pos = pos, gain = 0.25, max_hear_distance = 16}, true)
|
||||
core.check_for_falling(pos)
|
||||
minetest.check_for_falling(pos)
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Cactus mechanisms
|
||||
minetest.register_abm({
|
||||
label = "Cactus growth",
|
||||
nodenames = {"mcl_core:cactus"},
|
||||
|
@ -195,18 +196,31 @@ minetest.register_abm({
|
|||
end,
|
||||
})
|
||||
|
||||
-- Make cactus destroy items
|
||||
minetest.register_abm({
|
||||
label = "Cactus destroy items",
|
||||
label = "Cactus mechanisms",
|
||||
nodenames = {"mcl_core:cactus"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
for _,object in pairs(minetest.get_objects_inside_radius(pos, 0.9)) do
|
||||
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
|
||||
for _, object in pairs(minetest.get_objects_inside_radius(pos, 0.9)) do
|
||||
local entity = object:get_luaentity()
|
||||
if entity and entity.name == "__builtin:item" then
|
||||
object:remove()
|
||||
end
|
||||
end
|
||||
local posses = { { 1, 0 }, { -1, 0 }, { 0, 1 }, { 0, -1 } }
|
||||
for _, p in pairs(posses) do
|
||||
if minetest.registered_nodes[minetest.get_node(vector.new(pos.x + p[1], pos.y, pos.z + p[2])).name].walkable then
|
||||
local posy = pos.y
|
||||
while minetest.get_node(vector.new(pos.x, posy, pos.z)).name == "mcl_core:cactus" do
|
||||
local pos = vector.new(pos.x, posy, pos.z)
|
||||
minetest.remove_node(pos)
|
||||
minetest.add_item(vector.offset(pos, math.random(-0.5, 0.5), 0, math.random(-0.5, 0.5)), "mcl_core:cactus")
|
||||
posy = posy + 1
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -1242,7 +1256,7 @@ minetest.register_abm({
|
|||
if not mcl_core.check_vines_supported(pos, node) then
|
||||
minetest.remove_node(pos)
|
||||
vinedecay_particles(pos, node)
|
||||
core.check_for_falling(pos)
|
||||
minetest.check_for_falling(pos)
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -1404,7 +1418,7 @@ minetest.register_abm({
|
|||
-- Remove node
|
||||
minetest.remove_node(p0)
|
||||
leafdecay_particles(p0, n0)
|
||||
core.check_for_falling(p0)
|
||||
minetest.check_for_falling(p0)
|
||||
|
||||
-- Kill depending vines immediately to skip the vines decay delay
|
||||
local surround = {
|
||||
|
@ -1421,7 +1435,7 @@ minetest.register_abm({
|
|||
if maybe_vine.name == "mcl_core:vine" and (not mcl_core.check_vines_supported(spos, maybe_vine)) then
|
||||
minetest.remove_node(spos)
|
||||
vinedecay_particles(spos, maybe_vine)
|
||||
core.check_for_falling(spos)
|
||||
minetest.check_for_falling(spos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1445,7 +1459,7 @@ minetest.register_abm({
|
|||
minetest.remove_node(p0)
|
||||
vinedecay_particles(p0, node)
|
||||
-- Just in case a falling node happens to float above vines
|
||||
core.check_for_falling(p0)
|
||||
minetest.check_for_falling(p0)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
|
|
@ -221,17 +221,23 @@ Sugar canes are a plant which has some uses in crafting. Sugar canes will slowly
|
|||
Sugar canes can only be placed top of other sugar canes and on top of blocks on which they would grow.=Zuckerrohr kann nur auf Zuckerrohr platziert werden und auf Blöcken, auf denen Zuckerrohr wachsen würde.
|
||||
Sugar comes from sugar canes and is used to make sweet foods.=Zucker kommt von Zuckerrohr und wird benutzt, um süße Lebensmittel zu machen.
|
||||
The stripped trunk of an acacia tree.=Der entrindete Stamm einer Akazie.
|
||||
The stripped trunk of an birch tree.=Der entrindete Stamm einer Birke.
|
||||
The stripped trunk of an dark oak tree.=Der entrindete Stamm einer Schwarzeiche.
|
||||
The stripped trunk of an jungle tree.=Der entrindete Stamm eines Dschungelbaums.
|
||||
The stripped trunk of a birch tree.=Der entrindete Stamm einer Birke.
|
||||
The stripped trunk of a dark oak tree.=Der entrindete Stamm einer Schwarzeiche.
|
||||
The stripped trunk of a jungle tree.=Der entrindete Stamm eines Dschungelbaums.
|
||||
The stripped trunk of an oak tree.=Der entrindete Stamm einer Eiche.
|
||||
The stripped trunk of an spruce tree.=Der entrindete Stamm einer Fichte.
|
||||
The stripped trunk of a spruce tree.=Der entrindete Stamm einer Fichte.
|
||||
The trunk of a birch tree.=Der Baumstamm einer Birke.
|
||||
The trunk of a dark oak tree.=Der Baumstamm einer Schwarzeiche.
|
||||
The trunk of a jungle tree.=Der Baumstamm eines Dschungelbaums.
|
||||
The trunk of a spruce tree.=Der Baumstamm einer Fichte.
|
||||
The trunk of an acacia.=Der Baumstamm einer Akazie.
|
||||
The trunk of an oak tree.=Der Baumstamm einer Eiche.
|
||||
The stripped wood of an acacia tree.=Das entrindete Holz einer Akazie.
|
||||
The stripped wood of a birch tree.=Das entrindete Holz einer Birke.
|
||||
The stripped wood of a dark oak tree.=Das entrindete Holz einer Schwarzeiche.
|
||||
The stripped wood of a jungle tree.=Das entrindete Holz eines Dschungelbaums.
|
||||
The stripped wood of an oak tree.=Das entrindete Holz einer Eiche.
|
||||
The stripped wood of a spruce tree.=Das entrindete Holz einer Fichte.
|
||||
This block consists of a couple of loose stones and can't support itself.=Dieser Block besteht aus ein paar losen Steinchen und kann sich nicht selbst tragen.
|
||||
This is a decorative block surrounded by the bark of a tree trunk.=Dies ist ein dekorativer Block, der von der Rinde eines Baumstamms umgeben ist.
|
||||
This is a decorative block.=Dies ist ein dekorativer Block.
|
||||
|
|
|
@ -109,7 +109,7 @@ Gold Ore=Minerai d'Or
|
|||
Gold nuggets are very small pieces of molten gold; the main purpose is to create gold ingots.=Les pépites d'or sont de très petites pièces d'or en fusion; le but principal est de créer des lingots d'or.
|
||||
Golden Apple=Pomme Dorée
|
||||
Golden apples are precious food items which can be eaten.=Les pommes dorrées sont des aliments précieux qui peuvent être consommés.
|
||||
Granite=Granite
|
||||
Granite=Granit
|
||||
Grass Block=Bloc d'Herbe
|
||||
Grass Path=Chemin d'Herbe
|
||||
Grass paths are a decorative variant of grass blocks. Their top has a different color and they are a bit lower than grass blocks, making them useful to build footpaths. Grass paths can be created with a shovel. A grass path turns into dirt when it is below a solid block.=Les chemins d'herbe sont une variante décorative des blocs d'herbe. Leur sommet a une couleur différente et ils sont un peu plus bas que les blocs d'herbe, ce qui les rend utiles pour construire des sentiers. Les chemins d'herbe peuvent être créés avec une pelle. Un chemin d'herbe se transforme en terre quand il est en dessous d'un bloc solide.
|
||||
|
@ -165,7 +165,7 @@ Podzol=Podzol
|
|||
Podzol is a type of dirt found in taiga forests. Only a few plants are able to survive on it.=Le podzol est un type de terre trouvé dans les forêts de la taïga. Seules quelques plantes peuvent y survivre.
|
||||
Polished Andesite=Andrésite Polie
|
||||
Polished Diorite=Diorite Polie
|
||||
Polished Granite=Granite Polie
|
||||
Polished Granite=Granit Poli
|
||||
Polished Stone=Roche Polie
|
||||
Polished andesite is a decorative building block made from andesite.=L'andésite polie est un bloc de construction décoratif en andésite.
|
||||
Polished diorite is a decorative building block made from diorite.=La diorite polie est un bloc de construction décoratif en diorite.
|
||||
|
|
|
@ -221,17 +221,23 @@ Sugar canes are a plant which has some uses in crafting. Sugar canes will slowly
|
|||
Sugar canes can only be placed top of other sugar canes and on top of blocks on which they would grow.=
|
||||
Sugar comes from sugar canes and is used to make sweet foods.=
|
||||
The stripped trunk of an acacia tree.=
|
||||
The stripped trunk of an birch tree.=
|
||||
The stripped trunk of an dark oak tree.=
|
||||
The stripped trunk of an jungle tree.=
|
||||
The stripped trunk of a birch tree.=
|
||||
The stripped trunk of a dark oak tree.=
|
||||
The stripped trunk of a jungle tree.=
|
||||
The stripped trunk of an oak tree.=
|
||||
The stripped trunk of an spruce tree.=
|
||||
The stripped trunk of a spruce tree.=
|
||||
The trunk of a birch tree.=
|
||||
The trunk of a dark oak tree.=
|
||||
The trunk of a jungle tree.=
|
||||
The trunk of a spruce tree.=
|
||||
The trunk of an acacia.=
|
||||
The trunk of an oak tree.=
|
||||
The stripped wood of an acacia tree.=
|
||||
The stripped wood of a birch tree.=
|
||||
The stripped wood of a dark oak tree.=
|
||||
The stripped wood of a jungle tree.=
|
||||
The stripped wood of an oak tree.=
|
||||
The stripped wood of a spruce tree.=
|
||||
This block consists of a couple of loose stones and can't support itself.=
|
||||
This is a decorative block surrounded by the bark of a tree trunk.=
|
||||
This is a decorative block.=
|
||||
|
|
|
@ -1041,7 +1041,7 @@ for i=1,8 do
|
|||
drop = "mcl_throwing:snowball "..(i+1),
|
||||
_mcl_blast_resistance = 0.1,
|
||||
_mcl_hardness = 0.1,
|
||||
_mcl_silk_touch_drop = {"mcl_core:snow " .. (i+1)},
|
||||
_mcl_silk_touch_drop = {"mcl_core:snow " .. i},
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ if mod_screwdriver then
|
|||
end
|
||||
|
||||
-- Register tree trunk (wood) and bark
|
||||
local function register_tree_trunk(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark, stripped_varient)
|
||||
local function register_tree_trunk(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark, stripped_variant)
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description_trunk,
|
||||
_doc_items_longdesc = longdesc,
|
||||
|
@ -23,7 +23,7 @@ local function register_tree_trunk(subname, description_trunk, description_bark,
|
|||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
_mcl_stripped_varient = stripped_varient,
|
||||
_mcl_stripped_variant = stripped_variant,
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_core:"..subname.."_bark", {
|
||||
|
@ -39,7 +39,7 @@ local function register_tree_trunk(subname, description_trunk, description_bark,
|
|||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
_mcl_hardness = 2,
|
||||
_mcl_stripped_varient = stripped_varient.."_bark",
|
||||
_mcl_stripped_variant = stripped_variant.."_bark",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
@ -52,7 +52,7 @@ local function register_tree_trunk(subname, description_trunk, description_bark,
|
|||
end
|
||||
|
||||
-- Register stripped trunk and stripped wood
|
||||
local function register_stripped_trunk(subname, description_stripped_trunk, description_stripped_bark, longdesc, tile_stripped_inner, tile_stripped_bark)
|
||||
local function register_stripped_trunk(subname, description_stripped_trunk, description_stripped_bark, longdesc, longdesc_wood, tile_stripped_inner, tile_stripped_bark)
|
||||
minetest.register_node("mcl_core:"..subname, {
|
||||
description = description_stripped_trunk,
|
||||
_doc_items_longdesc = longdesc,
|
||||
|
@ -61,7 +61,7 @@ local function register_stripped_trunk(subname, description_stripped_trunk, desc
|
|||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
groups = {handy=1,axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
groups = {handy=1, axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 2,
|
||||
|
@ -70,12 +70,12 @@ local function register_stripped_trunk(subname, description_stripped_trunk, desc
|
|||
|
||||
minetest.register_node("mcl_core:"..subname.."_bark", {
|
||||
description = description_stripped_bark,
|
||||
_doc_items_longdesc = S("This is a decorative block."),
|
||||
_doc_items_longdesc = longdesc_wood,
|
||||
tiles = {tile_stripped_bark},
|
||||
paramtype2 = "facedir",
|
||||
on_place = mcl_util.rotate_axis,
|
||||
stack_max = 64,
|
||||
groups = {handy=1,axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
groups = {handy=1, axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
is_ground_content = false,
|
||||
on_rotate = on_rotate,
|
||||
|
@ -223,13 +223,12 @@ register_tree_trunk("sprucetree", S("Spruce Wood"), S("Spruce Bark"), S("The tru
|
|||
register_tree_trunk("birchtree", S("Birch Wood"), S("Birch Bark"), S("The trunk of a birch tree."), "mcl_core_log_birch_top.png", "mcl_core_log_birch.png", "mcl_core:stripped_birch")
|
||||
register_tree_trunk("jungletree", S("Jungle Wood"), S("Jungle Bark"), S("The trunk of a jungle tree."), "default_jungletree_top.png", "default_jungletree.png", "mcl_core:stripped_jungle")
|
||||
|
||||
register_stripped_trunk("stripped_oak", S("Stripped Oak Log"), S("Stripped Oak Wood"), S("The stripped trunk of an oak tree."), "mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_side.png")
|
||||
register_stripped_trunk("stripped_acacia", S("Stripped Acacia Log"), S("Stripped Acacia Wood"), S("The stripped trunk of an acacia tree."), "mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_side.png")
|
||||
register_stripped_trunk("stripped_dark_oak", S("Stripped Dark Oak Log"), S("Stripped Dark Oak Wood"), S("The stripped trunk of an dark oak tree."), "mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_side.png")
|
||||
register_stripped_trunk("stripped_birch", S("Stripped Birch Log"), S("Stripped Birch Wood"), S("The stripped trunk of an birch tree."), "mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_side.png")
|
||||
register_stripped_trunk("stripped_spruce", S("Stripped Spruce Log"), S("Stripped Spruce Wood"), S("The stripped trunk of an spruce tree."), "mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_side.png")
|
||||
register_stripped_trunk("stripped_jungle", S("Stripped Jungle Log"), S("Stripped Jungle Wood"), S("The stripped trunk of an jungle tree."),"mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_side.png")
|
||||
|
||||
register_stripped_trunk("stripped_oak", S("Stripped Oak Log"), S("Stripped Oak Wood"), S("The stripped trunk of an oak tree."), S("The stripped wood of an oak tree."), "mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_side.png")
|
||||
register_stripped_trunk("stripped_acacia", S("Stripped Acacia Log"), S("Stripped Acacia Wood"), S("The stripped trunk of an acacia tree."), S("The stripped wood of an acacia tree."), "mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_side.png")
|
||||
register_stripped_trunk("stripped_dark_oak", S("Stripped Dark Oak Log"), S("Stripped Dark Oak Wood"), S("The stripped trunk of a dark oak tree."), S("The stripped wood of a dark oak tree."), "mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_side.png")
|
||||
register_stripped_trunk("stripped_birch", S("Stripped Birch Log"), S("Stripped Birch Wood"), S("The stripped trunk of a birch tree."), S("The stripped wood of a birch tree."), "mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_side.png")
|
||||
register_stripped_trunk("stripped_spruce", S("Stripped Spruce Log"), S("Stripped Spruce Wood"), S("The stripped trunk of a spruce tree."), S("The stripped wood of a spruce tree."), "mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_side.png")
|
||||
register_stripped_trunk("stripped_jungle", S("Stripped Jungle Log"), S("Stripped Jungle Wood"), S("The stripped trunk of a jungle tree."), S("The stripped wood of a jungle tree."),"mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_side.png")
|
||||
register_wooden_planks("wood", S("Oak Wood Planks"), {"default_wood.png"})
|
||||
register_wooden_planks("darkwood", S("Dark Oak Wood Planks"), {"mcl_core_planks_big_oak.png"})
|
||||
register_wooden_planks("junglewood", S("Jungle Wood Planks"), {"default_junglewood.png"})
|
||||
|
|
|
@ -6,6 +6,7 @@ local text_color = "#313131"
|
|||
local itemslot_bg = mcl_formspec.get_itemslot_bg
|
||||
|
||||
mcl_crafting_table = {}
|
||||
|
||||
function mcl_crafting_table.show_crafting_form(player)
|
||||
player:get_inventory():set_width("craft", 3)
|
||||
player:get_inventory():set_size("craft", 9)
|
||||
|
@ -30,7 +31,6 @@ function mcl_crafting_table.show_crafting_form(player)
|
|||
)
|
||||
end
|
||||
|
||||
local show_crafting_form = mcl_crafting_table.show_crafting_form --cache function for better performances
|
||||
minetest.register_node("mcl_crafting_table:crafting_table", {
|
||||
description = S("Crafting Table"),
|
||||
_tt_help = S("3×3 crafting grid"),
|
||||
|
@ -43,7 +43,9 @@ minetest.register_node("mcl_crafting_table:crafting_table", {
|
|||
paramtype2 = "facedir",
|
||||
groups = {handy=1,axey=1, deco_block=1, material_wood=1,flammable=-1},
|
||||
on_rightclick = function(pos, node, player, itemstack)
|
||||
show_crafting_form(player)
|
||||
if not player:get_player_control().sneak then
|
||||
mcl_crafting_table.show_crafting_form(player)
|
||||
end
|
||||
end,
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 2.5,
|
||||
|
|
|
@ -138,7 +138,7 @@ local function bone_meal_particle(pos)
|
|||
maxvel = { x = 0, y = 0, z = 0},
|
||||
minacc = { x = 0, y = 0, z = 0},
|
||||
maxacc = { x = 0, y = 0, z = 0},
|
||||
minexptime = 1,
|
||||
minexptime = 1,
|
||||
maxexptime = 4,
|
||||
minsize = 0.7,
|
||||
maxsize = 2.4,
|
||||
|
|
|
@ -7,7 +7,7 @@ Blast Protection=Protection contre les explosions
|
|||
Reduces explosion damage and knockback.=Réduit les dégâts d'explosion et de recul.
|
||||
Channeling=Canalisation
|
||||
Channels a bolt of lightning toward a target. Works only during thunderstorms and if target is unobstructed with opaque blocks.=Canalise un éclair vers une cible. Fonctionne uniquement pendant les orages et si la cible n'est pas obstruée par des blocs opaques.
|
||||
Curse of Binding=Malédiction du lien éterne
|
||||
Curse of Binding=Malédiction du lien éternel
|
||||
Item cannot be removed from armor slots except due to death, breaking or in Creative Mode.=L'objet ne peut pas être retiré des emplacements d'armure sauf en cas de mort, de rupture ou en mode créatif.
|
||||
Curse of Vanishing=Malédiction de disparition
|
||||
Item destroyed on death.=Objet détruit à la mort.
|
||||
|
|
|
@ -453,7 +453,7 @@ function mcl_end.grow_chorus_plant_step(pos, node, pr)
|
|||
end
|
||||
|
||||
--- ABM ---
|
||||
local seed = minetest.get_mapgen_params().seed
|
||||
local seed = minetest.get_mapgen_setting("seed")
|
||||
local pr = PseudoRandom(seed)
|
||||
minetest.register_abm({
|
||||
label = "Chorus plant growth",
|
||||
|
|
|
@ -121,8 +121,54 @@ pumpkin_face_base_def._mcl_armor_mob_range_mob = "mobs_mc:enderman"
|
|||
pumpkin_face_base_def._mcl_armor_element = "head"
|
||||
pumpkin_face_base_def._mcl_armor_texture = "mcl_farming_pumpkin_face.png"
|
||||
pumpkin_face_base_def._mcl_armor_preview = "mcl_farming_pumpkin_face_preview.png"
|
||||
|
||||
if minetest.get_modpath("mcl_armor") then
|
||||
local pumpkin_hud = {}
|
||||
local function add_pumpkin_hud(player)
|
||||
pumpkin_hud[player] = {
|
||||
pumpkin_blur = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
position = {x = 0.5, y = 0.5},
|
||||
scale = {x = -100, y = -100},
|
||||
text = "mcl_farming_pumpkin_hud.png",
|
||||
z_index = -200
|
||||
}),
|
||||
--this is a fake crosshair, because hotbar and crosshair doesn't support z_index
|
||||
--TODO: remove this and add correct z_index values
|
||||
fake_crosshair = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
position = {x = 0.5, y = 0.5},
|
||||
scale = {x = 1, y = 1},
|
||||
text = "crosshair.png",
|
||||
z_index = -100
|
||||
})
|
||||
}
|
||||
end
|
||||
local function remove_pumpkin_hud(player)
|
||||
if pumpkin_hud[player] then
|
||||
player:hud_remove(pumpkin_hud[player].pumpkin_blur)
|
||||
player:hud_remove(pumpkin_hud[player].fake_crosshair)
|
||||
pumpkin_hud[player] = nil
|
||||
end
|
||||
end
|
||||
|
||||
pumpkin_face_base_def.on_secondary_use = mcl_armor.equip_on_use
|
||||
pumpkin_face_base_def._on_equip = add_pumpkin_hud
|
||||
pumpkin_face_base_def._on_unequip = remove_pumpkin_hud
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
if player:get_inventory():get_stack("armor", 2):get_name() == "mcl_farming:pumpkin_face" then
|
||||
add_pumpkin_hud(player)
|
||||
end
|
||||
end)
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
if not minetest.settings:get_bool("mcl_keepInventory") then
|
||||
remove_pumpkin_hud(player)
|
||||
end
|
||||
end)
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
pumpkin_hud[player] = nil
|
||||
end)
|
||||
end
|
||||
|
||||
-- Register stem growth
|
||||
|
|
After Width: | Height: | Size: 20 KiB |
|
@ -0,0 +1,3 @@
|
|||
# textdomain: mcl_fireworks
|
||||
Firework Rocket=
|
||||
Flight Duration:=
|
|
@ -0,0 +1,3 @@
|
|||
# textdomain: mcl_fireworks
|
||||
Firework Rocket=Fusée
|
||||
Flight Duration:=Durée de vol :
|
|
@ -0,0 +1,3 @@
|
|||
# textdomain: mcl_fireworks
|
||||
Firework Rocket=
|
||||
Flight Duration:=
|
|
@ -15,11 +15,11 @@ local function active_formspec(fuel_percent, item_percent)
|
|||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]"..
|
||||
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||
"list[context;src;2.75,0.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
|
||||
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||
"list[context;fuel;2.75,2.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1)..
|
||||
"list[current_name;dst;5.75,1.5;1,1;]"..
|
||||
"list[context;dst;5.75,1.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1)..
|
||||
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
|
||||
(100-fuel_percent)..":default_furnace_fire_fg.png]"..
|
||||
|
@ -29,11 +29,11 @@ local function active_formspec(fuel_percent, item_percent)
|
|||
-- TODO: Add it back when the Minetest bug is fixed.
|
||||
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
|
||||
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
|
||||
"listring[current_name;dst]"..
|
||||
"listring[context;dst]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;src]"..
|
||||
"listring[context;src]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;fuel]"..
|
||||
"listring[context;fuel]"..
|
||||
"listring[current_player;main]"
|
||||
end
|
||||
|
||||
|
@ -44,11 +44,11 @@ local inactive_formspec = "size[9,8.75]"..
|
|||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]"..
|
||||
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||
"list[context;src;2.75,0.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
|
||||
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||
"list[context;fuel;2.75,2.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1)..
|
||||
"list[current_name;dst;5.75,1.5;1,1;]"..
|
||||
"list[context;dst;5.75,1.5;1,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1)..
|
||||
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
|
||||
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
||||
|
@ -56,11 +56,11 @@ local inactive_formspec = "size[9,8.75]"..
|
|||
-- TODO: Add it back when the Minetest bug is fixed.
|
||||
--"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
|
||||
--"tooltip[craftguide;"..minetest.formspec_escape(S("Recipe book")).."]"..
|
||||
"listring[current_name;dst]"..
|
||||
"listring[context;dst]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;src]"..
|
||||
"listring[context;src]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;fuel]"..
|
||||
"listring[context;fuel]"..
|
||||
"listring[current_player;main]"
|
||||
|
||||
local receive_fields = function(pos, formname, fields, sender)
|
||||
|
|
|
@ -5,14 +5,14 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
|||
local mcl_hoppers_formspec =
|
||||
"size[9,7]"..
|
||||
"label[2,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Hopper"))).."]"..
|
||||
"list[current_name;main;2,0.5;5,1;]"..
|
||||
"list[context;main;2,0.5;5,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(2,0.5,5,1)..
|
||||
"label[0,2;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,2.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,2.5,9,3)..
|
||||
"list[current_player;main;0,5.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,5.74,9,1)..
|
||||
"listring[current_name;main]"..
|
||||
"listring[context;main]"..
|
||||
"listring[current_player;main]"
|
||||
|
||||
-- Downwards hopper (base definition)
|
||||
|
|
|
@ -94,7 +94,9 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
local function play_record(pos, itemstack, player)
|
||||
local name = itemstack:get_name()
|
||||
local item_name = itemstack:get_name()
|
||||
-- ensure the jukebox uses the new record names for old records
|
||||
local name = minetest.registered_aliases[item_name] or item_name
|
||||
if mcl_jukebox.registered_records[name] then
|
||||
local cname = player:get_player_name()
|
||||
if active_tracks[cname] then
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
# textdomain: mcl_maps
|
||||
Empty Map=Carte Vierge
|
||||
Empty maps are not useful as maps, but they can be stacked and turned to maps which can be used.=Les cartes vierges ne sont pas utiles en tant que cartes, mais elles peuvent être empilées et transformées en cartes utilisables.
|
||||
Rightclick to start using the map (which can't be stacked anymore).=Clic droit pour commencer à utiliser la carte (qui ne peut plus être empilée).
|
||||
Rightclick to create a filled map (which can't be stacked anymore).=Clic droit pour créer une carte remplie (qui ne peut plus être empilée).
|
||||
Map=Carte
|
||||
Shows a map image.=Affiche une carte.
|
||||
When created, the map saves the nearby area as an image that can be viewed any time by holding the map.=Lors de sa création, la carte sauvegarde le terrain proche sous forme d'image qui peut être consultée n'importe quand en tenant la carte dans la main.
|
||||
Hold the map in your hand. This will display a map on your screen.=Tenez la carte dans votre main. Cela affichera la carte à l'écran.
|
||||
|
|
|
@ -27,7 +27,7 @@ Raw Porkchop=Porc Cru
|
|||
|
||||
A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value.=Un porc cru est la chair d'un porc et peut être mangée en toute sécurité. La cuisson augmentera considérablement sa valeur nutritive.
|
||||
|
||||
Cooked Porkchop=Parc Cuit
|
||||
Cooked Porkchop=Porc Cuit
|
||||
Cooked porkchop is the cooked flesh of a pig and is used as food.=Le porc cuit est la chair cuite d'un porc et est utilisé comme aliment.
|
||||
Raw Rabbit=Lapin Cru
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_portals
|
||||
description = Adds buildable portals to the Nether and End dimensions.
|
||||
depends = mcl_nether, mcl_end, mcl_particles, mcl_spawn
|
||||
depends = mcl_nether, mcl_end, mcl_particles, mcl_spawn, mcl_credits
|
||||
optional_depends = awards, doc
|
||||
|
|
|
@ -4,6 +4,8 @@ local table = table
|
|||
local vector = vector
|
||||
local math = math
|
||||
|
||||
local has_doc = minetest.get_modpath("doc")
|
||||
|
||||
-- Parameters
|
||||
--local SPAWN_MIN = mcl_vars.mg_end_min+70
|
||||
--local SPAWN_MAX = mcl_vars.mg_end_min+98
|
||||
|
@ -307,7 +309,7 @@ minetest.register_node("mcl_portals:end_portal_frame_eye", {
|
|||
description = S("End Portal Frame with Eye of Ender"),
|
||||
_tt_help = S("Used to construct end portals"),
|
||||
_doc_items_create_entry = false,
|
||||
groups = { creative_breakable = 1, deco_block = 1, comparator_signal = 15, end_portal_frame = 2 },
|
||||
groups = { creative_breakable = 1, deco_block = 1, comparator_signal = 15, end_portal_frame = 2, not_in_creative_inventory = 1 },
|
||||
tiles = { "mcl_portals_endframe_top.png^[lowpart:75:mcl_portals_endframe_eye.png", "mcl_portals_endframe_bottom.png", "mcl_portals_endframe_eye.png^mcl_portals_endframe_side.png" },
|
||||
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
|
||||
paramtype2 = "facedir",
|
||||
|
@ -339,7 +341,7 @@ minetest.register_node("mcl_portals:end_portal_frame_eye", {
|
|||
_mcl_hardness = -1,
|
||||
})
|
||||
|
||||
if minetest.get_modpath("doc") then
|
||||
if has_doc then
|
||||
doc.add_entry_alias("nodes", "mcl_portals:end_portal_frame", "nodes", "mcl_portals:end_portal_frame_eye")
|
||||
end
|
||||
|
||||
|
@ -366,7 +368,7 @@ minetest.override_item("mcl_end:ender_eye", {
|
|||
end
|
||||
minetest.set_node(pointed_thing.under, { name = "mcl_portals:end_portal_frame_eye", param2 = node.param2 })
|
||||
|
||||
if minetest.get_modpath("doc") then
|
||||
if has_doc then
|
||||
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", "mcl_portals:end_portal_frame")
|
||||
end
|
||||
minetest.sound_play(
|
||||
|
@ -381,7 +383,7 @@ minetest.override_item("mcl_end:ender_eye", {
|
|||
-- Epic 'portal open' sound effect that can be heard everywhere
|
||||
minetest.sound_play("mcl_portals_open_end_portal", {gain=0.8}, true)
|
||||
end_portal_area(ppos)
|
||||
if minetest.get_modpath("doc") then
|
||||
if has_doc then
|
||||
doc.mark_entry_as_revealed(user:get_player_name(), "nodes", "mcl_portals:portal_end")
|
||||
end
|
||||
end
|
||||
|
@ -389,7 +391,3 @@ minetest.override_item("mcl_end:ender_eye", {
|
|||
return itemstack
|
||||
end,
|
||||
})
|
||||
minetest.override_item("mcl_core:bedrock", {
|
||||
after_destruct = destroy_portal,
|
||||
})
|
||||
|
||||
|
|
|
@ -35,13 +35,13 @@ local function potions_init_icons(player)
|
|||
local name = player:get_player_name()
|
||||
icon_ids[name] = {}
|
||||
for e=1, EFFECT_TYPES do
|
||||
local x = -7 + -38 * e
|
||||
local x = -52 * e - 2
|
||||
local id = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
text = "blank.png",
|
||||
position = { x = 1, y = 0 },
|
||||
offset = { x = x, y = 272 },
|
||||
scale = { x = 2, y = 2 },
|
||||
offset = { x = x, y = 3 },
|
||||
scale = { x = 3, y = 3 },
|
||||
alignment = { x = 1, y = 1 },
|
||||
z_index = 100,
|
||||
})
|
||||
|
|