Compare commits
44 Commits
Author | SHA1 | Date |
---|---|---|
Thndr | 7f0ddeb977 | |
Thndr | 1bd68ed5e9 | |
Thndr | 5bc542df78 | |
Thndr | ab996632c4 | |
Thndr | f3ccef05c5 | |
Thndr | 09eaa443d7 | |
Thndr | 31b7e406d2 | |
Wuzzy | 3cfdb85926 | |
Wuzzy | 44fcf6eb34 | |
Wuzzy | f9b557c2ba | |
Wuzzy | 47c817d75a | |
Wuzzy | a29626881f | |
Wuzzy | e4fbbeddb2 | |
Wuzzy | 1df3d0e42b | |
Wuzzy | 1cb142ec5f | |
Wuzzy | 342202c979 | |
Wuzzy | 0cc038c545 | |
Wuzzy | 0d6610dcee | |
Wuzzy | d691490016 | |
Wuzzy | 1217d9fa88 | |
Wuzzy | e0418553a6 | |
Wuzzy | 3edf880301 | |
Wuzzy | a84f7935fa | |
Wuzzy | 26c9150591 | |
Wuzzy | 720bc6a56f | |
Wuzzy | dcba7e2325 | |
Wuzzy | 66c6b373a5 | |
Wuzzy | 7ca999626d | |
Wuzzy | 5e5dcfaaa3 | |
Wuzzy | 05e3a616b4 | |
Wuzzy | cfac33a94f | |
Wuzzy | 581f0fa2dd | |
Wuzzy | 0b9c0d177c | |
Wuzzy | 3ca01c3149 | |
Wuzzy | ea0c2e9568 | |
Wuzzy | 98b3003e07 | |
Wuzzy | c4558a31ab | |
Wuzzy | 2b3922c972 | |
Wuzzy | 4c8433b41c | |
Wuzzy | 149d1450ef | |
Wuzzy | a9776814a6 | |
Wuzzy | 4f8377b161 | |
Wuzzy | 2f74aea6f5 | |
Wuzzy | b31a717410 |
17
README.md
|
@ -2,7 +2,7 @@
|
||||||
An unofficial Minecraft-like game for Minetest. Forked from MineClone by daredevils.
|
An unofficial Minecraft-like game for Minetest. Forked from MineClone by daredevils.
|
||||||
Developed by Wuzzy and contributors. Not developed or endorsed by Mojang AB.
|
Developed by Wuzzy and contributors. Not developed or endorsed by Mojang AB.
|
||||||
|
|
||||||
Version: 0.48.0
|
Version: 0.49.0
|
||||||
|
|
||||||
### Gameplay
|
### Gameplay
|
||||||
You start in a randomly-generated world made entirely of cubes. You can explore
|
You start in a randomly-generated world made entirely of cubes. You can explore
|
||||||
|
@ -75,13 +75,14 @@ These items do not work yet, but you can get them with `/giveme` for testing:
|
||||||
* Minecart with Command Block: `mcl_minecarts:command_block_minecart`
|
* Minecart with Command Block: `mcl_minecarts:command_block_minecart`
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
This game requires [Minetest](http://minetest.net) to run
|
This game requires [Minetest](http://minetest.net) to run (version 5.0.0 or
|
||||||
(version 0.4.16 or 0.4.17).
|
later). So you need to install Minetest first. Only stable versions of Minetest
|
||||||
So you need to install Minetest first. Only stable versions of Minetest are
|
are officially supported.
|
||||||
officially supported. Minetest 5.0.0 (when released) will NOT be supported (yet).
|
There is no support for running MineClone 2 in development versions of Minetest.
|
||||||
There is no support whatsoever for running MineClone 2 in development versions of Minetest.
|
|
||||||
To install MineClone 2, move this directory into the “games” directory of
|
To install MineClone 2 (if you haven't already), move this directory into the
|
||||||
your Minetest data directory. Consult the help of Minetest to learn more.
|
“games” directory of your Minetest data directory. Consult the help of
|
||||||
|
Minetest to learn more.
|
||||||
|
|
||||||
## Project description
|
## Project description
|
||||||
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.
|
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
-- Some global variables (don't overwrite them!)
|
-- Some global variables (don't overwrite them!)
|
||||||
mcl_vars = {}
|
mcl_vars = {}
|
||||||
|
|
||||||
--- GUI / inventory menu colors
|
--- GUI / inventory menu settings
|
||||||
mcl_vars.gui_slots = "listcolors[#9990;#FFF7;#FFF0;#000;#FFF]"
|
mcl_vars.gui_slots = "listcolors[#9990;#FFF7;#FFF0;#000;#FFF]"
|
||||||
|
-- nonbg is added as formspec prepend in mcl_formspec_prepend
|
||||||
|
mcl_vars.gui_nonbg = mcl_vars.gui_slots
|
||||||
|
|
||||||
|
-- Background stuff must be manually added by mods (no formspec prepend)
|
||||||
mcl_vars.gui_bg = "bgcolor[#080808BB;true]"
|
mcl_vars.gui_bg = "bgcolor[#080808BB;true]"
|
||||||
mcl_vars.gui_bg_img = ""
|
mcl_vars.gui_bg_img = ""
|
||||||
|
|
||||||
mcl_vars.inventory_header = mcl_vars.gui_slots .. mcl_vars.gui_bg
|
mcl_vars.inventory_header = mcl_vars.gui_bg
|
||||||
|
|
||||||
-- Mapgen variables
|
-- Mapgen variables
|
||||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||||
|
|
|
@ -114,9 +114,6 @@ local function get_random_slots(max_slot)
|
||||||
table.insert(slots_out, slots[r])
|
table.insert(slots_out, slots[r])
|
||||||
table.remove(slots, r)
|
table.remove(slots, r)
|
||||||
end
|
end
|
||||||
for s=1, #slots_out do
|
|
||||||
print(slots_out[s])
|
|
||||||
end
|
|
||||||
return slots_out
|
return slots_out
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ minetest.register_entity("drippingwater:drop_water", {
|
||||||
physical = true,
|
physical = true,
|
||||||
collide_with_objects = false,
|
collide_with_objects = false,
|
||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
|
pointable = false,
|
||||||
visual = "cube",
|
visual = "cube",
|
||||||
visual_size = {x=0.05, y=0.1},
|
visual_size = {x=0.05, y=0.1},
|
||||||
textures = {water_tex, water_tex, water_tex, water_tex, water_tex, water_tex},
|
textures = {water_tex, water_tex, water_tex, water_tex, water_tex, water_tex},
|
||||||
|
@ -20,7 +21,7 @@ minetest.register_entity("drippingwater:drop_water", {
|
||||||
initial_sprite_basepos = {x=0, y=0},
|
initial_sprite_basepos = {x=0, y=0},
|
||||||
|
|
||||||
on_activate = function(self, staticdata)
|
on_activate = function(self, staticdata)
|
||||||
self.object:setsprite({x=0,y=0}, 1, 1, true)
|
self.object:set_sprite({x=0,y=0}, 1, 1, true)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
|
@ -28,11 +29,11 @@ minetest.register_entity("drippingwater:drop_water", {
|
||||||
local ownpos = self.object:get_pos()
|
local ownpos = self.object:get_pos()
|
||||||
|
|
||||||
if k==1 then
|
if k==1 then
|
||||||
self.object:setacceleration({x=0, y=-5, z=0})
|
self.object:set_acceleration({x=0, y=-5, z=0})
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
||||||
self.object:setacceleration({x=0, y=-5, z=0})
|
self.object:set_acceleration({x=0, y=-5, z=0})
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
|
if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then
|
||||||
|
@ -58,7 +59,7 @@ minetest.register_entity("drippingwater:drop_lava", {
|
||||||
initial_sprite_basepos = {x=0, y=0},
|
initial_sprite_basepos = {x=0, y=0},
|
||||||
|
|
||||||
on_activate = function(self, staticdata)
|
on_activate = function(self, staticdata)
|
||||||
self.object:setsprite({x=0,y=0}, 1, 0, true)
|
self.object:set_sprite({x=0,y=0}, 1, 0, true)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
|
@ -66,11 +67,11 @@ minetest.register_entity("drippingwater:drop_lava", {
|
||||||
local ownpos = self.object:get_pos()
|
local ownpos = self.object:get_pos()
|
||||||
|
|
||||||
if k==1 then
|
if k==1 then
|
||||||
self.object:setacceleration({x=0, y=-5, z=0})
|
self.object:set_acceleration({x=0, y=-5, z=0})
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
if minetest.get_node({x=ownpos.x, y=ownpos.y +0.5, z=ownpos.z}).name == "air" then
|
||||||
self.object:setacceleration({x=0, y=-5, z=0})
|
self.object:set_acceleration({x=0, y=-5, z=0})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
local S = minetest.get_translator("mcl_boats")
|
||||||
--
|
--
|
||||||
-- Helper functions
|
-- Helper functions
|
||||||
--
|
--
|
||||||
|
@ -69,7 +70,7 @@ function boat.on_rightclick(self, clicker)
|
||||||
mcl_player.player_set_animation(clicker, "stand" , 30)
|
mcl_player.player_set_animation(clicker, "stand" , 30)
|
||||||
local pos = clicker:get_pos()
|
local pos = clicker:get_pos()
|
||||||
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
|
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
|
||||||
clicker:setpos(pos)
|
clicker:set_pos(pos)
|
||||||
elseif not self._driver then
|
elseif not self._driver then
|
||||||
local attach = clicker:get_attach()
|
local attach = clicker:get_attach()
|
||||||
if attach and attach:get_luaentity() then
|
if attach and attach:get_luaentity() then
|
||||||
|
@ -82,7 +83,7 @@ function boat.on_rightclick(self, clicker)
|
||||||
end
|
end
|
||||||
self._driver = clicker
|
self._driver = clicker
|
||||||
clicker:set_attach(self.object, "",
|
clicker:set_attach(self.object, "",
|
||||||
{x = 0, y = 3.75, z = -1}, {x = 0, y = 0, z = 0})
|
{x = 0, y = 0.42, z = -1}, {x = 0, y = 0, z = 0})
|
||||||
clicker:set_properties({ visual_size = driver_visual_size })
|
clicker:set_properties({ visual_size = driver_visual_size })
|
||||||
mcl_player.player_attached[name] = true
|
mcl_player.player_attached[name] = true
|
||||||
minetest.after(0.2, function(name)
|
minetest.after(0.2, function(name)
|
||||||
|
@ -91,7 +92,7 @@ function boat.on_rightclick(self, clicker)
|
||||||
mcl_player.player_set_animation(player, "sit" , 30)
|
mcl_player.player_set_animation(player, "sit" , 30)
|
||||||
end
|
end
|
||||||
end, name)
|
end, name)
|
||||||
clicker:set_look_horizontal(self.object:getyaw())
|
clicker:set_look_horizontal(self.object:get_yaw())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -143,10 +144,10 @@ function boat.on_punch(self, puncher)
|
||||||
end
|
end
|
||||||
|
|
||||||
function boat.on_step(self, dtime)
|
function boat.on_step(self, dtime)
|
||||||
self._v = get_v(self.object:getvelocity()) * get_sign(self._v)
|
self._v = get_v(self.object:get_velocity()) * get_sign(self._v)
|
||||||
if self._driver then
|
if self._driver then
|
||||||
local ctrl = self._driver:get_player_control()
|
local ctrl = self._driver:get_player_control()
|
||||||
local yaw = self.object:getyaw()
|
local yaw = self.object:get_yaw()
|
||||||
if ctrl.up then
|
if ctrl.up then
|
||||||
-- Forwards
|
-- Forwards
|
||||||
self._v = self._v + 0.1
|
self._v = self._v + 0.1
|
||||||
|
@ -174,15 +175,15 @@ function boat.on_step(self, dtime)
|
||||||
end
|
end
|
||||||
if ctrl.left then
|
if ctrl.left then
|
||||||
if self._v < 0 then
|
if self._v < 0 then
|
||||||
self.object:setyaw(yaw - (1 + dtime) * 0.03)
|
self.object:set_yaw(yaw - (1 + dtime) * 0.03)
|
||||||
else
|
else
|
||||||
self.object:setyaw(yaw + (1 + dtime) * 0.03)
|
self.object:set_yaw(yaw + (1 + dtime) * 0.03)
|
||||||
end
|
end
|
||||||
elseif ctrl.right then
|
elseif ctrl.right then
|
||||||
if self._v < 0 then
|
if self._v < 0 then
|
||||||
self.object:setyaw(yaw + (1 + dtime) * 0.03)
|
self.object:set_yaw(yaw + (1 + dtime) * 0.03)
|
||||||
else
|
else
|
||||||
self.object:setyaw(yaw - (1 + dtime) * 0.03)
|
self.object:set_yaw(yaw - (1 + dtime) * 0.03)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -192,15 +193,15 @@ function boat.on_step(self, dtime)
|
||||||
self._animation = 0
|
self._animation = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local velo = self.object:getvelocity()
|
local velo = self.object:get_velocity()
|
||||||
if self._v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
|
if self._v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
|
||||||
self.object:setpos(self.object:get_pos())
|
self.object:set_pos(self.object:get_pos())
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local s = get_sign(self._v)
|
local s = get_sign(self._v)
|
||||||
self._v = self._v - 0.02 * s
|
self._v = self._v - 0.02 * s
|
||||||
if s ~= get_sign(self._v) then
|
if s ~= get_sign(self._v) then
|
||||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
self.object:set_velocity({x = 0, y = 0, z = 0})
|
||||||
self._v = 0
|
self._v = 0
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -220,13 +221,13 @@ function boat.on_step(self, dtime)
|
||||||
else
|
else
|
||||||
new_acce = {x = 0, y = -9.8, z = 0}
|
new_acce = {x = 0, y = -9.8, z = 0}
|
||||||
end
|
end
|
||||||
new_velo = get_velocity(self._v, self.object:getyaw(),
|
new_velo = get_velocity(self._v, self.object:get_yaw(),
|
||||||
self.object:getvelocity().y)
|
self.object:get_velocity().y)
|
||||||
self.object:setpos(self.object:get_pos())
|
self.object:set_pos(self.object:get_pos())
|
||||||
else
|
else
|
||||||
p.y = p.y + 1
|
p.y = p.y + 1
|
||||||
if is_water(p) then
|
if is_water(p) then
|
||||||
local y = self.object:getvelocity().y
|
local y = self.object:get_velocity().y
|
||||||
if y >= 5 then
|
if y >= 5 then
|
||||||
y = 5
|
y = 5
|
||||||
elseif y < 0 then
|
elseif y < 0 then
|
||||||
|
@ -234,31 +235,31 @@ function boat.on_step(self, dtime)
|
||||||
else
|
else
|
||||||
new_acce = {x = 0, y = 5, z = 0}
|
new_acce = {x = 0, y = 5, z = 0}
|
||||||
end
|
end
|
||||||
new_velo = get_velocity(self._v, self.object:getyaw(), y)
|
new_velo = get_velocity(self._v, self.object:get_yaw(), y)
|
||||||
self.object:setpos(self.object:get_pos())
|
self.object:set_pos(self.object:get_pos())
|
||||||
else
|
else
|
||||||
new_acce = {x = 0, y = 0, z = 0}
|
new_acce = {x = 0, y = 0, z = 0}
|
||||||
if math.abs(self.object:getvelocity().y) < 1 then
|
if math.abs(self.object:get_velocity().y) < 1 then
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
pos.y = math.floor(pos.y) + boat_y_offset
|
pos.y = math.floor(pos.y) + boat_y_offset
|
||||||
self.object:setpos(pos)
|
self.object:set_pos(pos)
|
||||||
new_velo = get_velocity(self._v, self.object:getyaw(), 0)
|
new_velo = get_velocity(self._v, self.object:get_yaw(), 0)
|
||||||
else
|
else
|
||||||
new_velo = get_velocity(self._v, self.object:getyaw(),
|
new_velo = get_velocity(self._v, self.object:get_yaw(),
|
||||||
self.object:getvelocity().y)
|
self.object:get_velocity().y)
|
||||||
self.object:setpos(self.object:get_pos())
|
self.object:set_pos(self.object:get_pos())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.object:setvelocity(new_velo)
|
self.object:set_velocity(new_velo)
|
||||||
self.object:setacceleration(new_acce)
|
self.object:set_acceleration(new_acce)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register one entity for all boat types
|
-- Register one entity for all boat types
|
||||||
minetest.register_entity("mcl_boats:boat", boat)
|
minetest.register_entity("mcl_boats:boat", boat)
|
||||||
|
|
||||||
local boat_ids = { "boat", "boat_spruce", "boat_birch", "boat_jungle", "boat_acacia", "boat_dark_oak" }
|
local boat_ids = { "boat", "boat_spruce", "boat_birch", "boat_jungle", "boat_acacia", "boat_dark_oak" }
|
||||||
local names = { "Oak Boat", "Spruce Boat", "Birch Boat", "Jungle Boat", "Acacia Boat", "Dark Oak Boat" }
|
local names = { S("Oak Boat"), S("Spruce Boat"), S("Birch Boat"), S("Jungle Boat"), S("Acacia Boat"), S("Dark Oak Boat") }
|
||||||
local craftstuffs = {}
|
local craftstuffs = {}
|
||||||
if minetest.get_modpath("mcl_core") then
|
if minetest.get_modpath("mcl_core") then
|
||||||
craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood" }
|
craftstuffs = { "mcl_core:wood", "mcl_core:sprucewood", "mcl_core:birchwood", "mcl_core:junglewood", "mcl_core:acaciawood", "mcl_core:darkwood" }
|
||||||
|
@ -273,9 +274,9 @@ for b=1, #boat_ids do
|
||||||
-- Only create one help entry for all boats
|
-- Only create one help entry for all boats
|
||||||
if b == 1 then
|
if b == 1 then
|
||||||
help = true
|
help = true
|
||||||
longdesc = "Boats are used to travel on the surface of water."
|
longdesc = S("Boats are used to travel on the surface of water.")
|
||||||
usagehelp = "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."
|
usagehelp = S("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.")
|
||||||
helpname = "Boat"
|
helpname = S("Boat")
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craftitem(itemstring, {
|
minetest.register_craftitem(itemstring, {
|
||||||
|
|
|
@ -141,9 +141,9 @@ minetest.register_entity(":__builtin:falling_node", {
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
-- Set gravity
|
-- Set gravity
|
||||||
local acceleration = self.object:getacceleration()
|
local acceleration = self.object:get_acceleration()
|
||||||
if not vector.equals(acceleration, {x = 0, y = -10, z = 0}) then
|
if not vector.equals(acceleration, {x = 0, y = -10, z = 0}) then
|
||||||
self.object:setacceleration({x = 0, y = -10, z = 0})
|
self.object:set_acceleration({x = 0, y = -10, z = 0})
|
||||||
end
|
end
|
||||||
-- Turn to actual node when colliding with ground, or continue to move
|
-- Turn to actual node when colliding with ground, or continue to move
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
|
@ -222,7 +222,7 @@ minetest.register_entity(":__builtin:falling_node", {
|
||||||
minetest.check_for_falling(np)
|
minetest.check_for_falling(np)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local vel = self.object:getvelocity()
|
local vel = self.object:get_velocity()
|
||||||
-- Fix position if entity does not move
|
-- Fix position if entity does not move
|
||||||
if vector.equals(vel, {x = 0, y = 0, z = 0}) then
|
if vector.equals(vel, {x = 0, y = 0, z = 0}) then
|
||||||
local npos = vector.round(self.object:get_pos())
|
local npos = vector.round(self.object:get_pos())
|
||||||
|
|
|
@ -98,14 +98,14 @@ minetest.register_globalstep(function(dtime)
|
||||||
local opos = object:get_pos()
|
local opos = object:get_pos()
|
||||||
local vec = vector.subtract(checkpos, opos)
|
local vec = vector.subtract(checkpos, opos)
|
||||||
vec = vector.add(opos, vector.divide(vec, 2))
|
vec = vector.add(opos, vector.divide(vec, 2))
|
||||||
object:moveto(vec)
|
object:move_to(vec)
|
||||||
|
|
||||||
|
|
||||||
--fix eternally falling items
|
--fix eternally falling items
|
||||||
minetest.after(0, function(object)
|
minetest.after(0, function(object)
|
||||||
local lua = object:get_luaentity()
|
local lua = object:get_luaentity()
|
||||||
if lua then
|
if lua then
|
||||||
object:setacceleration({x=0, y=0, z=0})
|
object:set_acceleration({x=0, y=0, z=0})
|
||||||
end
|
end
|
||||||
end, object)
|
end, object)
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ function minetest.handle_node_drops(pos, drops, digger)
|
||||||
if math.random(1,2) == 1 then
|
if math.random(1,2) == 1 then
|
||||||
z = -z
|
z = -z
|
||||||
end
|
end
|
||||||
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
|
obj:set_velocity({x=1/x, y=obj:get_velocity().y, z=1/z})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -285,7 +285,7 @@ function minetest.item_drop(itemstack, dropper, pos)
|
||||||
v.x = v.x*4
|
v.x = v.x*4
|
||||||
v.y = v.y*4 + 2
|
v.y = v.y*4 + 2
|
||||||
v.z = v.z*4
|
v.z = v.z*4
|
||||||
obj:setvelocity(v)
|
obj:set_velocity(v)
|
||||||
-- Force collection delay
|
-- Force collection delay
|
||||||
obj:get_luaentity()._insta_collect = false
|
obj:get_luaentity()._insta_collect = false
|
||||||
return itemstack
|
return itemstack
|
||||||
|
@ -306,6 +306,7 @@ core.register_entity(":__builtin:item", {
|
||||||
physical = true,
|
physical = true,
|
||||||
collide_with_objects = false,
|
collide_with_objects = false,
|
||||||
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
||||||
|
pointable = false,
|
||||||
visual = "wielditem",
|
visual = "wielditem",
|
||||||
visual_size = {x = 0.4, y = 0.4},
|
visual_size = {x = 0.4, y = 0.4},
|
||||||
textures = {""},
|
textures = {""},
|
||||||
|
@ -373,7 +374,7 @@ core.register_entity(":__builtin:item", {
|
||||||
if not self or not self.object or not self.object:get_luaentity() then
|
if not self or not self.object or not self.object:get_luaentity() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local vel = self.object:getvelocity()
|
local vel = self.object:get_velocity()
|
||||||
if vel and vel.x == 0 and vel.z == 0 then
|
if vel and vel.x == 0 and vel.z == 0 then
|
||||||
local x = math.random(1, 5)
|
local x = math.random(1, 5)
|
||||||
if math.random(1,2) == 1 then
|
if math.random(1,2) == 1 then
|
||||||
|
@ -384,7 +385,7 @@ core.register_entity(":__builtin:item", {
|
||||||
z = -z
|
z = -z
|
||||||
end
|
end
|
||||||
local y = math.random(2,4)
|
local y = math.random(2,4)
|
||||||
self.object:setvelocity({x=1/x, y=y, z=1/z})
|
self.object:set_velocity({x=1/x, y=y, z=1/z})
|
||||||
end
|
end
|
||||||
end, self)
|
end, self)
|
||||||
end
|
end
|
||||||
|
@ -444,8 +445,8 @@ core.register_entity(":__builtin:item", {
|
||||||
self._forcetimer = 0
|
self._forcetimer = 0
|
||||||
|
|
||||||
self.object:set_armor_groups({immortal = 1})
|
self.object:set_armor_groups({immortal = 1})
|
||||||
self.object:setvelocity({x = 0, y = 2, z = 0})
|
self.object:set_velocity({x = 0, y = 2, z = 0})
|
||||||
self.object:setacceleration({x = 0, y = -get_gravity(), z = 0})
|
self.object:set_acceleration({x = 0, y = -get_gravity(), z = 0})
|
||||||
self:set_item(self.itemstring)
|
self:set_item(self.itemstring)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
@ -589,8 +590,8 @@ core.register_entity(":__builtin:item", {
|
||||||
|
|
||||||
-- Set new item moving speed accordingly
|
-- Set new item moving speed accordingly
|
||||||
local newv = vector.multiply(shootdir, 3)
|
local newv = vector.multiply(shootdir, 3)
|
||||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
self.object:set_acceleration({x = 0, y = 0, z = 0})
|
||||||
self.object:setvelocity(newv)
|
self.object:set_velocity(newv)
|
||||||
|
|
||||||
disable_physics(self.object, self, false, false)
|
disable_physics(self.object, self, false, false)
|
||||||
|
|
||||||
|
@ -643,8 +644,8 @@ core.register_entity(":__builtin:item", {
|
||||||
local f = 1.39
|
local f = 1.39
|
||||||
-- Set new item moving speed into the direciton of the liquid
|
-- Set new item moving speed into the direciton of the liquid
|
||||||
local newv = vector.multiply(vec, f)
|
local newv = vector.multiply(vec, f)
|
||||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
self.object:set_acceleration({x = 0, y = 0, z = 0})
|
||||||
self.object:setvelocity({x = newv.x, y = -0.22, z = newv.z})
|
self.object:set_velocity({x = newv.x, y = -0.22, z = newv.z})
|
||||||
|
|
||||||
self.physical_state = true
|
self.physical_state = true
|
||||||
self._flowing = true
|
self._flowing = true
|
||||||
|
@ -662,7 +663,7 @@ core.register_entity(":__builtin:item", {
|
||||||
|
|
||||||
-- If node is not registered or node is walkably solid and resting on nodebox
|
-- If node is not registered or node is walkably solid and resting on nodebox
|
||||||
local nn = minetest.get_node({x=p.x, y=p.y-0.5, z=p.z}).name
|
local nn = minetest.get_node({x=p.x, y=p.y-0.5, z=p.z}).name
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:get_velocity()
|
||||||
|
|
||||||
if not core.registered_nodes[nn] or core.registered_nodes[nn].walkable and v.y == 0 then
|
if not core.registered_nodes[nn] or core.registered_nodes[nn].walkable and v.y == 0 then
|
||||||
if self.physical_state then
|
if self.physical_state then
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local S = minetest.get_translator("mcl_minecarts")
|
||||||
|
|
||||||
mcl_minecarts = {}
|
mcl_minecarts = {}
|
||||||
mcl_minecarts.modpath = minetest.get_modpath("mcl_minecarts")
|
mcl_minecarts.modpath = minetest.get_modpath("mcl_minecarts")
|
||||||
mcl_minecarts.speed_max = 10
|
mcl_minecarts.speed_max = 10
|
||||||
|
@ -61,7 +63,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
if puncher:get_player_control().sneak then
|
if puncher:get_player_control().sneak then
|
||||||
if self._driver then
|
if self._driver then
|
||||||
if self._old_pos then
|
if self._old_pos then
|
||||||
self.object:setpos(self._old_pos)
|
self.object:set_pos(self._old_pos)
|
||||||
end
|
end
|
||||||
mcl_player.player_attached[self._driver] = nil
|
mcl_player.player_attached[self._driver] = nil
|
||||||
local player = minetest.get_player_by_name(self._driver)
|
local player = minetest.get_player_by_name(self._driver)
|
||||||
|
@ -98,7 +100,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local vel = self.object:getvelocity()
|
local vel = self.object:get_velocity()
|
||||||
if puncher:get_player_name() == self._driver then
|
if puncher:get_player_name() == self._driver then
|
||||||
if math.abs(vel.x + vel.z) > 7 then
|
if math.abs(vel.x + vel.z) > 7 then
|
||||||
return
|
return
|
||||||
|
@ -121,7 +123,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
end
|
end
|
||||||
|
|
||||||
function cart:on_step(dtime)
|
function cart:on_step(dtime)
|
||||||
local vel = self.object:getvelocity()
|
local vel = self.object:get_velocity()
|
||||||
local update = {}
|
local update = {}
|
||||||
if self._last_float_check == nil then
|
if self._last_float_check == nil then
|
||||||
self._last_float_check = 0
|
self._last_float_check = 0
|
||||||
|
@ -139,7 +141,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
-- Detach driver
|
-- Detach driver
|
||||||
if self._driver then
|
if self._driver then
|
||||||
if self._old_pos then
|
if self._old_pos then
|
||||||
self.object:setpos(self._old_pos)
|
self.object:set_pos(self._old_pos)
|
||||||
end
|
end
|
||||||
mcl_player.player_attached[self._driver] = nil
|
mcl_player.player_attached[self._driver] = nil
|
||||||
local player = minetest.get_player_by_name(self._driver)
|
local player = minetest.get_player_by_name(self._driver)
|
||||||
|
@ -164,7 +166,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
|
|
||||||
if self._punched then
|
if self._punched then
|
||||||
vel = vector.add(vel, self._velocity)
|
vel = vector.add(vel, self._velocity)
|
||||||
self.object:setvelocity(vel)
|
self.object:set_velocity(vel)
|
||||||
self._old_dir.y = 0
|
self._old_dir.y = 0
|
||||||
elseif vector.equals(vel, {x=0, y=0, z=0}) then
|
elseif vector.equals(vel, {x=0, y=0, z=0}) then
|
||||||
return
|
return
|
||||||
|
@ -217,8 +219,8 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
(self._old_vel.x * vel.x < 0 or self._old_vel.z * vel.z < 0) then
|
(self._old_vel.x * vel.x < 0 or self._old_vel.z * vel.z < 0) then
|
||||||
self._old_vel = {x = 0, y = 0, z = 0}
|
self._old_vel = {x = 0, y = 0, z = 0}
|
||||||
self._old_pos = pos
|
self._old_pos = pos
|
||||||
self.object:setvelocity(vector.new())
|
self.object:set_velocity(vector.new())
|
||||||
self.object:setacceleration(vector.new())
|
self.object:set_acceleration(vector.new())
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self._old_vel = vector.new(vel)
|
self._old_vel = vector.new(vel)
|
||||||
|
@ -292,7 +294,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
new_acc = vector.multiply(dir, acc)
|
new_acc = vector.multiply(dir, acc)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.object:setacceleration(new_acc)
|
self.object:set_acceleration(new_acc)
|
||||||
self._old_pos = vector.new(pos)
|
self._old_pos = vector.new(pos)
|
||||||
self._old_dir = vector.new(dir)
|
self._old_dir = vector.new(dir)
|
||||||
self._old_switch = last_switch
|
self._old_switch = last_switch
|
||||||
|
@ -321,7 +323,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
elseif dir.z < 0 then
|
elseif dir.z < 0 then
|
||||||
yaw = 1
|
yaw = 1
|
||||||
end
|
end
|
||||||
self.object:setyaw(yaw * math.pi)
|
self.object:set_yaw(yaw * math.pi)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self._punched then
|
if self._punched then
|
||||||
|
@ -341,9 +343,9 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
|
||||||
end
|
end
|
||||||
self.object:set_animation(anim, 1, 0)
|
self.object:set_animation(anim, 1, 0)
|
||||||
|
|
||||||
self.object:setvelocity(vel)
|
self.object:set_velocity(vel)
|
||||||
if update.pos then
|
if update.pos then
|
||||||
self.object:setpos(pos)
|
self.object:set_pos(pos)
|
||||||
end
|
end
|
||||||
update = nil
|
update = nil
|
||||||
end
|
end
|
||||||
|
@ -387,7 +389,7 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing)
|
||||||
le._railtype = railtype
|
le._railtype = railtype
|
||||||
end
|
end
|
||||||
local cart_dir = mcl_minecarts:get_rail_direction(railpos, {x=1, y=0, z=0}, nil, nil, railtype)
|
local cart_dir = mcl_minecarts:get_rail_direction(railpos, {x=1, y=0, z=0}, nil, nil, railtype)
|
||||||
cart:setyaw(minetest.dir_to_yaw(cart_dir))
|
cart:set_yaw(minetest.dir_to_yaw(cart_dir))
|
||||||
|
|
||||||
if not minetest.settings:get_bool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
|
@ -470,11 +472,11 @@ end
|
||||||
register_minecart(
|
register_minecart(
|
||||||
"mcl_minecarts:minecart",
|
"mcl_minecarts:minecart",
|
||||||
"mcl_minecarts:minecart",
|
"mcl_minecarts:minecart",
|
||||||
"Minecart",
|
S("Minecart"),
|
||||||
"Minecarts can be used for a quick transportion on rails." .. "\n" ..
|
S("Minecarts can be used for a quick transportion on rails.") .. "\n" ..
|
||||||
"Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type.",
|
S("Minecarts only ride on rails and always follow the tracks. At a T-junction with no straight way ahead, they turn left. The speed is affected by the rail type."),
|
||||||
"You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving." .. "\n" ..
|
S("You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.") .. "\n" ..
|
||||||
"To obtain the minecart, punch it while holding down the sneak key.",
|
S("To obtain the minecart, punch it while holding down the sneak key."),
|
||||||
"mcl_minecarts_minecart.b3d",
|
"mcl_minecarts_minecart.b3d",
|
||||||
{"mcl_minecarts_minecart.png"},
|
{"mcl_minecarts_minecart.png"},
|
||||||
"mcl_minecarts_minecart_normal.png",
|
"mcl_minecarts_minecart_normal.png",
|
||||||
|
@ -494,7 +496,7 @@ register_minecart(
|
||||||
self._driver = player_name
|
self._driver = player_name
|
||||||
self._start_pos = self.object:get_pos()
|
self._start_pos = self.object:get_pos()
|
||||||
mcl_player.player_attached[player_name] = true
|
mcl_player.player_attached[player_name] = true
|
||||||
clicker:set_attach(self.object, "", {x=0, y=8.25, z=-2}, {x=0, y=0, z=0})
|
clicker:set_attach(self.object, "", {x=0, y=-1.75, z=-2}, {x=0, y=0, z=0})
|
||||||
mcl_player.player_attached[name] = true
|
mcl_player.player_attached[name] = true
|
||||||
minetest.after(0.2, function(name)
|
minetest.after(0.2, function(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
|
@ -511,7 +513,7 @@ register_minecart(
|
||||||
register_minecart(
|
register_minecart(
|
||||||
"mcl_minecarts:chest_minecart",
|
"mcl_minecarts:chest_minecart",
|
||||||
"mcl_minecarts:chest_minecart",
|
"mcl_minecarts:chest_minecart",
|
||||||
"Minecart with Chest",
|
S("Minecart with Chest"),
|
||||||
nil, nil,
|
nil, nil,
|
||||||
"mcl_minecarts_minecart_chest.b3d",
|
"mcl_minecarts_minecart_chest.b3d",
|
||||||
{ "mcl_chests_normal.png", "mcl_minecarts_minecart.png" },
|
{ "mcl_chests_normal.png", "mcl_minecarts_minecart.png" },
|
||||||
|
@ -523,7 +525,7 @@ register_minecart(
|
||||||
register_minecart(
|
register_minecart(
|
||||||
"mcl_minecarts:furnace_minecart",
|
"mcl_minecarts:furnace_minecart",
|
||||||
"mcl_minecarts:furnace_minecart",
|
"mcl_minecarts:furnace_minecart",
|
||||||
"Minecart with Furnace",
|
S("Minecart with Furnace"),
|
||||||
nil, nil,
|
nil, nil,
|
||||||
"mcl_minecarts_minecart_block.b3d",
|
"mcl_minecarts_minecart_block.b3d",
|
||||||
{
|
{
|
||||||
|
@ -566,7 +568,7 @@ register_minecart(
|
||||||
register_minecart(
|
register_minecart(
|
||||||
"mcl_minecarts:command_block_minecart",
|
"mcl_minecarts:command_block_minecart",
|
||||||
"mcl_minecarts:command_block_minecart",
|
"mcl_minecarts:command_block_minecart",
|
||||||
"Minecart with Command Block",
|
S("Minecart with Command Block"),
|
||||||
nil, nil,
|
nil, nil,
|
||||||
"mcl_minecarts_minecart_block.b3d",
|
"mcl_minecarts_minecart_block.b3d",
|
||||||
{
|
{
|
||||||
|
@ -587,7 +589,7 @@ register_minecart(
|
||||||
register_minecart(
|
register_minecart(
|
||||||
"mcl_minecarts:hopper_minecart",
|
"mcl_minecarts:hopper_minecart",
|
||||||
"mcl_minecarts:hopper_minecart",
|
"mcl_minecarts:hopper_minecart",
|
||||||
"Minecart with Hopper",
|
S("Minecart with Hopper"),
|
||||||
nil, nil,
|
nil, nil,
|
||||||
"mcl_minecarts_minecart_hopper.b3d",
|
"mcl_minecarts_minecart_hopper.b3d",
|
||||||
{
|
{
|
||||||
|
@ -605,7 +607,7 @@ register_minecart(
|
||||||
register_minecart(
|
register_minecart(
|
||||||
"mcl_minecarts:tnt_minecart",
|
"mcl_minecarts:tnt_minecart",
|
||||||
"mcl_minecarts:tnt_minecart",
|
"mcl_minecarts:tnt_minecart",
|
||||||
"Minecart with TNT",
|
S("Minecart with TNT"),
|
||||||
nil, nil,
|
nil, nil,
|
||||||
"mcl_minecarts_minecart_block.b3d",
|
"mcl_minecarts_minecart_block.b3d",
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local S = minetest.get_translator("mcl_minecarts")
|
||||||
|
|
||||||
-- Template rail function
|
-- Template rail function
|
||||||
local register_rail = function(itemstring, tiles, def_extras, creative)
|
local register_rail = function(itemstring, tiles, def_extras, creative)
|
||||||
local groups = {handy=1,pickaxey=1, attached_node=1,rail=1,connect_to_raillike=1,dig_by_water=1,destroy_by_lava_flow=1, transport=1}
|
local groups = {handy=1,pickaxey=1, attached_node=1,rail=1,connect_to_raillike=1,dig_by_water=1,destroy_by_lava_flow=1, transport=1}
|
||||||
|
@ -64,14 +66,14 @@ local rail_rules_long =
|
||||||
|
|
||||||
local rail_rules_short = mesecon.rules.pplate
|
local rail_rules_short = mesecon.rules.pplate
|
||||||
|
|
||||||
local railuse = "Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed."
|
local railuse = S("Place them on the ground to build your railway, the rails will automatically connect to each other and will turn into curves, T-junctions, crossings and slopes as needed.")
|
||||||
|
|
||||||
-- Normal rail
|
-- Normal rail
|
||||||
register_rail("mcl_minecarts:rail",
|
register_rail("mcl_minecarts:rail",
|
||||||
{"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
|
{"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
|
||||||
{
|
{
|
||||||
description = "Rail",
|
description = S("Rail"),
|
||||||
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.",
|
_doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction."),
|
||||||
_doc_items_usagehelp = railuse,
|
_doc_items_usagehelp = railuse,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -80,9 +82,9 @@ register_rail("mcl_minecarts:rail",
|
||||||
register_rail("mcl_minecarts:golden_rail",
|
register_rail("mcl_minecarts:golden_rail",
|
||||||
{"mcl_minecarts_rail_golden.png", "mcl_minecarts_rail_golden_curved.png", "mcl_minecarts_rail_golden_t_junction.png", "mcl_minecarts_rail_golden_crossing.png"},
|
{"mcl_minecarts_rail_golden.png", "mcl_minecarts_rail_golden_curved.png", "mcl_minecarts_rail_golden_t_junction.png", "mcl_minecarts_rail_golden_crossing.png"},
|
||||||
{
|
{
|
||||||
description = "Powered Rail",
|
description = S("Powered Rail"),
|
||||||
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.",
|
_doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts."),
|
||||||
_doc_items_usagehelp = railuse .. "\n" .. "Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.",
|
_doc_items_usagehelp = railuse .. "\n" .. S("Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power."),
|
||||||
_rail_acceleration = -3,
|
_rail_acceleration = -3,
|
||||||
mesecons = {
|
mesecons = {
|
||||||
conductor = {
|
conductor = {
|
||||||
|
@ -118,9 +120,9 @@ register_rail("mcl_minecarts:golden_rail_on",
|
||||||
register_rail("mcl_minecarts:activator_rail",
|
register_rail("mcl_minecarts:activator_rail",
|
||||||
{"mcl_minecarts_rail_activator.png", "mcl_minecarts_rail_activator_curved.png", "mcl_minecarts_rail_activator_t_junction.png", "mcl_minecarts_rail_activator_crossing.png"},
|
{"mcl_minecarts_rail_activator.png", "mcl_minecarts_rail_activator_curved.png", "mcl_minecarts_rail_activator_t_junction.png", "mcl_minecarts_rail_activator_crossing.png"},
|
||||||
{
|
{
|
||||||
description = "Activator Rail",
|
description = S("Activator Rail"),
|
||||||
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.",
|
_doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts."),
|
||||||
_doc_items_usagehelp = railuse .. "\n" .. "To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.",
|
_doc_items_usagehelp = railuse .. "\n" .. S("To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail."),
|
||||||
mesecons = {
|
mesecons = {
|
||||||
conductor = {
|
conductor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
|
@ -157,9 +159,9 @@ register_rail("mcl_minecarts:activator_rail_on",
|
||||||
register_rail("mcl_minecarts:detector_rail",
|
register_rail("mcl_minecarts:detector_rail",
|
||||||
{"mcl_minecarts_rail_detector.png", "mcl_minecarts_rail_detector_curved.png", "mcl_minecarts_rail_detector_t_junction.png", "mcl_minecarts_rail_detector_crossing.png"},
|
{"mcl_minecarts_rail_detector.png", "mcl_minecarts_rail_detector_curved.png", "mcl_minecarts_rail_detector_t_junction.png", "mcl_minecarts_rail_detector_crossing.png"},
|
||||||
{
|
{
|
||||||
description = "Detector Rail",
|
description = S("Detector Rail"),
|
||||||
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms.",
|
_doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. A detector rail is able to detect a minecart above it and powers redstone mechanisms."),
|
||||||
_doc_items_usagehelp = railuse .. "\n" .. "To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.",
|
_doc_items_usagehelp = railuse .. "\n" .. S("To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail."),
|
||||||
mesecons = {
|
mesecons = {
|
||||||
receptor = {
|
receptor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.off,
|
||||||
|
|
|
@ -9,7 +9,7 @@ local MAX_MOB_NAME_LENGTH = 30
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||||
local S, NS = dofile(MP .. "/intllib.lua")
|
local S = minetest.get_translator("mcl_mobs")
|
||||||
mobs.intllib = S
|
mobs.intllib = S
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ local mobs_spawn_chance = tonumber(minetest.settings:get("mobs_spawn_chance") or
|
||||||
if peaceful_only then
|
if peaceful_only then
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
minetest.chat_send_player(player:get_player_name(),
|
minetest.chat_send_player(player:get_player_name(),
|
||||||
S("** Peaceful Mode Active - No Monsters Will Spawn"))
|
S("Peaceful mode active! No monsters will spawn."))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -137,15 +137,15 @@ local set_velocity = function(self, v)
|
||||||
|
|
||||||
-- do not move if mob has been ordered to stay
|
-- do not move if mob has been ordered to stay
|
||||||
if self.order == "stand" then
|
if self.order == "stand" then
|
||||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
self.object:set_velocity({x = 0, y = 0, z = 0})
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local yaw = (self.object:get_yaw() or 0) + self.rotate
|
local yaw = (self.object:get_yaw() or 0) + self.rotate
|
||||||
|
|
||||||
self.object:setvelocity({
|
self.object:set_velocity({
|
||||||
x = sin(yaw) * -v,
|
x = sin(yaw) * -v,
|
||||||
y = self.object:getvelocity().y,
|
y = self.object:get_velocity().y,
|
||||||
z = cos(yaw) * v
|
z = cos(yaw) * v
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -154,7 +154,7 @@ end
|
||||||
-- calculate mob velocity
|
-- calculate mob velocity
|
||||||
local get_velocity = function(self)
|
local get_velocity = function(self)
|
||||||
|
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:get_velocity()
|
||||||
|
|
||||||
return (v.x * v.x + v.z * v.z) ^ 0.5
|
return (v.x * v.x + v.z * v.z) ^ 0.5
|
||||||
end
|
end
|
||||||
|
@ -403,7 +403,7 @@ local item_drop = function(self, cooked)
|
||||||
|
|
||||||
if obj and obj:get_luaentity() then
|
if obj and obj:get_luaentity() then
|
||||||
|
|
||||||
obj:setvelocity({
|
obj:set_velocity({
|
||||||
x = random(-10, 10) / 9,
|
x = random(-10, 10) / 9,
|
||||||
y = 6,
|
y = 6,
|
||||||
z = random(-10, 10) / 9,
|
z = random(-10, 10) / 9,
|
||||||
|
@ -642,7 +642,7 @@ local do_env_damage = function(self)
|
||||||
|
|
||||||
-- don't fall when on ignore, just stand still
|
-- don't fall when on ignore, just stand still
|
||||||
if self.standing_in == "ignore" then
|
if self.standing_in == "ignore" then
|
||||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
self.object:set_velocity({x = 0, y = 0, z = 0})
|
||||||
end
|
end
|
||||||
|
|
||||||
local nodef = minetest.registered_nodes[self.standing_in]
|
local nodef = minetest.registered_nodes[self.standing_in]
|
||||||
|
@ -738,7 +738,7 @@ local do_jump = function(self)
|
||||||
-- something stopping us while moving?
|
-- something stopping us while moving?
|
||||||
if self.state ~= "stand"
|
if self.state ~= "stand"
|
||||||
and get_velocity(self) > 0.5
|
and get_velocity(self) > 0.5
|
||||||
and self.object:getvelocity().y ~= 0 then
|
and self.object:get_velocity().y ~= 0 then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -776,13 +776,13 @@ local do_jump = function(self)
|
||||||
if not nod.name:find("fence")
|
if not nod.name:find("fence")
|
||||||
and not nod.name:find("gate") then
|
and not nod.name:find("gate") then
|
||||||
|
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:get_velocity()
|
||||||
|
|
||||||
v.y = self.jump_height
|
v.y = self.jump_height
|
||||||
|
|
||||||
set_animation(self, "jump") -- only when defined
|
set_animation(self, "jump") -- only when defined
|
||||||
|
|
||||||
self.object:setvelocity(v)
|
self.object:set_velocity(v)
|
||||||
|
|
||||||
-- when in air move forward
|
-- when in air move forward
|
||||||
minetest.after(0.3, function(self, v)
|
minetest.after(0.3, function(self, v)
|
||||||
|
@ -912,7 +912,7 @@ local breed = function(self)
|
||||||
self.on_grown(self)
|
self.on_grown(self)
|
||||||
else
|
else
|
||||||
-- jump when fully grown so as not to fall into ground
|
-- jump when fully grown so as not to fall into ground
|
||||||
self.object:setvelocity({
|
self.object:set_velocity({
|
||||||
x = 0,
|
x = 0,
|
||||||
y = self.jump_height,
|
y = self.jump_height,
|
||||||
z = 0
|
z = 0
|
||||||
|
@ -1041,7 +1041,7 @@ local replace = function(self, pos)
|
||||||
or not self.replace_rate
|
or not self.replace_rate
|
||||||
or not self.replace_what
|
or not self.replace_what
|
||||||
or self.child == true
|
or self.child == true
|
||||||
or self.object:getvelocity().y ~= 0
|
or self.object:get_velocity().y ~= 0
|
||||||
or random(1, self.replace_rate) > 1 then
|
or random(1, self.replace_rate) > 1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -1267,7 +1267,7 @@ local smart_mobs = function(self, s, p, dist, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
s.y = s.y - sheight
|
s.y = s.y - sheight
|
||||||
self.object:setpos({x = s.x, y = s.y + 2, z = s.z})
|
self.object:set_pos({x = s.x, y = s.y + 2, z = s.z})
|
||||||
|
|
||||||
else -- dig 2 blocks to make door toward player direction
|
else -- dig 2 blocks to make door toward player direction
|
||||||
|
|
||||||
|
@ -1670,7 +1670,7 @@ local follow_flop = function(self)
|
||||||
if not flight_check(self, s) then
|
if not flight_check(self, s) then
|
||||||
|
|
||||||
self.state = "flop"
|
self.state = "flop"
|
||||||
self.object:setvelocity({x = 0, y = -5, z = 0})
|
self.object:set_velocity({x = 0, y = -5, z = 0})
|
||||||
|
|
||||||
set_animation(self, "stand")
|
set_animation(self, "stand")
|
||||||
|
|
||||||
|
@ -1944,7 +1944,7 @@ local do_states = function(self, dtime)
|
||||||
self.timer = 0
|
self.timer = 0
|
||||||
self.blinktimer = 0
|
self.blinktimer = 0
|
||||||
self.blinkstatus = false
|
self.blinkstatus = false
|
||||||
self.object:settexturemod("")
|
self.object:set_texture_mod("")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- walk right up to player unless the timer is active
|
-- walk right up to player unless the timer is active
|
||||||
|
@ -1970,9 +1970,9 @@ local do_states = function(self, dtime)
|
||||||
self.blinktimer = 0
|
self.blinktimer = 0
|
||||||
|
|
||||||
if self.blinkstatus then
|
if self.blinkstatus then
|
||||||
self.object:settexturemod("")
|
self.object:set_texture_mod("")
|
||||||
else
|
else
|
||||||
self.object:settexturemod("^[brighten")
|
self.object:set_texture_mod("^[brighten")
|
||||||
end
|
end
|
||||||
|
|
||||||
self.blinkstatus = not self.blinkstatus
|
self.blinkstatus = not self.blinkstatus
|
||||||
|
@ -2026,13 +2026,13 @@ local do_states = function(self, dtime)
|
||||||
local me_y = floor(p1.y)
|
local me_y = floor(p1.y)
|
||||||
local p2 = p
|
local p2 = p
|
||||||
local p_y = floor(p2.y + 1)
|
local p_y = floor(p2.y + 1)
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:get_velocity()
|
||||||
|
|
||||||
if flight_check(self, s) then
|
if flight_check(self, s) then
|
||||||
|
|
||||||
if me_y < p_y then
|
if me_y < p_y then
|
||||||
|
|
||||||
self.object:setvelocity({
|
self.object:set_velocity({
|
||||||
x = v.x,
|
x = v.x,
|
||||||
y = 1 * self.walk_velocity,
|
y = 1 * self.walk_velocity,
|
||||||
z = v.z
|
z = v.z
|
||||||
|
@ -2040,7 +2040,7 @@ local do_states = function(self, dtime)
|
||||||
|
|
||||||
elseif me_y > p_y then
|
elseif me_y > p_y then
|
||||||
|
|
||||||
self.object:setvelocity({
|
self.object:set_velocity({
|
||||||
x = v.x,
|
x = v.x,
|
||||||
y = -1 * self.walk_velocity,
|
y = -1 * self.walk_velocity,
|
||||||
z = v.z
|
z = v.z
|
||||||
|
@ -2049,7 +2049,7 @@ local do_states = function(self, dtime)
|
||||||
else
|
else
|
||||||
if me_y < p_y then
|
if me_y < p_y then
|
||||||
|
|
||||||
self.object:setvelocity({
|
self.object:set_velocity({
|
||||||
x = v.x,
|
x = v.x,
|
||||||
y = 0.01,
|
y = 0.01,
|
||||||
z = v.z
|
z = v.z
|
||||||
|
@ -2057,7 +2057,7 @@ local do_states = function(self, dtime)
|
||||||
|
|
||||||
elseif me_y > p_y then
|
elseif me_y > p_y then
|
||||||
|
|
||||||
self.object:setvelocity({
|
self.object:set_velocity({
|
||||||
x = v.x,
|
x = v.x,
|
||||||
y = -0.01,
|
y = -0.01,
|
||||||
z = v.z
|
z = v.z
|
||||||
|
@ -2241,7 +2241,7 @@ local do_states = function(self, dtime)
|
||||||
vec.y = vec.y * (v / amount)
|
vec.y = vec.y * (v / amount)
|
||||||
vec.z = vec.z * (v / amount)
|
vec.z = vec.z * (v / amount)
|
||||||
|
|
||||||
obj:setvelocity(vec)
|
obj:set_velocity(vec)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2257,12 +2257,12 @@ local falling = function(self, pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- floating in water (or falling)
|
-- floating in water (or falling)
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:get_velocity()
|
||||||
|
|
||||||
if v.y > 0 then
|
if v.y > 0 then
|
||||||
|
|
||||||
-- apply gravity when moving up
|
-- apply gravity when moving up
|
||||||
self.object:setacceleration({
|
self.object:set_acceleration({
|
||||||
x = 0,
|
x = 0,
|
||||||
y = -10,
|
y = -10,
|
||||||
z = 0
|
z = 0
|
||||||
|
@ -2271,14 +2271,14 @@ local falling = function(self, pos)
|
||||||
elseif v.y <= 0 and v.y > self.fall_speed then
|
elseif v.y <= 0 and v.y > self.fall_speed then
|
||||||
|
|
||||||
-- fall downwards at set speed
|
-- fall downwards at set speed
|
||||||
self.object:setacceleration({
|
self.object:set_acceleration({
|
||||||
x = 0,
|
x = 0,
|
||||||
y = self.fall_speed,
|
y = self.fall_speed,
|
||||||
z = 0
|
z = 0
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
-- stop accelerating once max fall speed hit
|
-- stop accelerating once max fall speed hit
|
||||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
self.object:set_acceleration({x = 0, y = 0, z = 0})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- in water then float up
|
-- in water then float up
|
||||||
|
@ -2286,7 +2286,7 @@ local falling = function(self, pos)
|
||||||
|
|
||||||
if self.floats == 1 then
|
if self.floats == 1 then
|
||||||
|
|
||||||
self.object:setacceleration({
|
self.object:set_acceleration({
|
||||||
x = 0,
|
x = 0,
|
||||||
y = -self.fall_speed / (max(1, v.y) ^ 2),
|
y = -self.fall_speed / (max(1, v.y) ^ 2),
|
||||||
z = 0
|
z = 0
|
||||||
|
@ -2296,7 +2296,7 @@ local falling = function(self, pos)
|
||||||
|
|
||||||
-- fall damage onto solid ground
|
-- fall damage onto solid ground
|
||||||
if self.fall_damage == 1
|
if self.fall_damage == 1
|
||||||
and self.object:getvelocity().y == 0 then
|
and self.object:get_velocity().y == 0 then
|
||||||
|
|
||||||
local d = (self.old_y or 0) - self.object:get_pos().y
|
local d = (self.old_y or 0) - self.object:get_pos().y
|
||||||
|
|
||||||
|
@ -2475,7 +2475,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||||
if self.knock_back
|
if self.knock_back
|
||||||
and tflp >= punch_interval then
|
and tflp >= punch_interval then
|
||||||
|
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:get_velocity()
|
||||||
local r = 1.4 - min(punch_interval, 1.4)
|
local r = 1.4 - min(punch_interval, 1.4)
|
||||||
local kb = r * 2.0
|
local kb = r * 2.0
|
||||||
local up = 2
|
local up = 2
|
||||||
|
@ -2496,7 +2496,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||||
kb = kb * 1.5
|
kb = kb * 1.5
|
||||||
end
|
end
|
||||||
|
|
||||||
self.object:setvelocity({
|
self.object:set_velocity({
|
||||||
x = dir.x * kb,
|
x = dir.x * kb,
|
||||||
y = up,
|
y = up,
|
||||||
z = dir.z * kb
|
z = dir.z * kb
|
||||||
|
@ -3562,8 +3562,8 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
|
||||||
inventory_image = invimg,
|
inventory_image = invimg,
|
||||||
groups = grp,
|
groups = grp,
|
||||||
|
|
||||||
_doc_items_longdesc = "This allows you to place a single mob.",
|
_doc_items_longdesc = S("This allows you to place a single mob."),
|
||||||
_doc_items_usagehelp = "Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns.",
|
_doc_items_usagehelp = S("Just place it where you want the mob to appear. Animals will spawn tamed, unless you hold down the sneak key while placing. If you place this on a mob spawner, you change the mob it spawns."),
|
||||||
|
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
|
||||||
|
@ -3588,7 +3588,7 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
if not privs.maphack then
|
if not privs.maphack then
|
||||||
minetest.chat_send_player(name, "You need the “maphack” privilege to change the mob spawner.")
|
minetest.chat_send_player(name, S("You need the “maphack” privilege to change the mob spawner."))
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
mcl_mobspawners.setup_spawner(pointed_thing.under, itemstack:get_name())
|
mcl_mobspawners.setup_spawner(pointed_thing.under, itemstack:get_name())
|
||||||
|
|
|
@ -190,7 +190,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
local acce_y = 0
|
local acce_y = 0
|
||||||
local velo = entity.object:getvelocity()
|
local velo = entity.object:get_velocity()
|
||||||
|
|
||||||
entity.v = get_v(velo) * get_sign(entity.v)
|
entity.v = get_v(velo) * get_sign(entity.v)
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- fix mob rotation
|
-- fix mob rotation
|
||||||
entity.object:setyaw(entity.driver:get_look_horizontal() - entity.rotate)
|
entity.object:set_yaw(entity.driver:get_look_horizontal() - entity.rotate)
|
||||||
|
|
||||||
if can_fly then
|
if can_fly then
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||||
|
|
||||||
if s ~= get_sign(entity.v) then
|
if s ~= get_sign(entity.v) then
|
||||||
|
|
||||||
entity.object:setvelocity({x = 0, y = 0, z = 0})
|
entity.object:set_velocity({x = 0, y = 0, z = 0})
|
||||||
entity.v = 0
|
entity.v = 0
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -348,7 +348,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||||
if math.abs(velo.y) < 1 then
|
if math.abs(velo.y) < 1 then
|
||||||
local pos = entity.object:get_pos()
|
local pos = entity.object:get_pos()
|
||||||
pos.y = math.floor(pos.y) + 0.5
|
pos.y = math.floor(pos.y) + 0.5
|
||||||
entity.object:setpos(pos)
|
entity.object:set_pos(pos)
|
||||||
velo.y = 0
|
velo.y = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -360,8 +360,8 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
|
||||||
new_velo = get_velocity(v, entity.object:get_yaw() - rot_view, velo.y)
|
new_velo = get_velocity(v, entity.object:get_yaw() - rot_view, velo.y)
|
||||||
new_acce.y = new_acce.y + acce_y
|
new_acce.y = new_acce.y + acce_y
|
||||||
|
|
||||||
entity.object:setvelocity(new_velo)
|
entity.object:set_velocity(new_velo)
|
||||||
entity.object:setacceleration(new_acce)
|
entity.object:set_acceleration(new_acce)
|
||||||
|
|
||||||
-- CRASH!
|
-- CRASH!
|
||||||
if enable_crash then
|
if enable_crash then
|
||||||
|
@ -387,7 +387,7 @@ end
|
||||||
function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
|
function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
|
||||||
|
|
||||||
local ctrl = entity.driver:get_player_control()
|
local ctrl = entity.driver:get_player_control()
|
||||||
local velo = entity.object:getvelocity()
|
local velo = entity.object:get_velocity()
|
||||||
local dir = entity.driver:get_look_dir()
|
local dir = entity.driver:get_look_dir()
|
||||||
local yaw = entity.driver:get_look_horizontal() + 1.57 -- offset fix between old and new commands
|
local yaw = entity.driver:get_look_horizontal() + 1.57 -- offset fix between old and new commands
|
||||||
local rot_steer, rot_view = math.pi / 2, 0
|
local rot_steer, rot_view = math.pi / 2, 0
|
||||||
|
@ -397,24 +397,24 @@ function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
|
||||||
end
|
end
|
||||||
|
|
||||||
if ctrl.up then
|
if ctrl.up then
|
||||||
entity.object:setvelocity({
|
entity.object:set_velocity({
|
||||||
x = dir.x * speed,
|
x = dir.x * speed,
|
||||||
y = dir.y * speed + 2,
|
y = dir.y * speed + 2,
|
||||||
z = dir.z * speed
|
z = dir.z * speed
|
||||||
})
|
})
|
||||||
|
|
||||||
elseif ctrl.down then
|
elseif ctrl.down then
|
||||||
entity.object:setvelocity({
|
entity.object:set_velocity({
|
||||||
x = -dir.x * speed,
|
x = -dir.x * speed,
|
||||||
y = dir.y * speed + 2,
|
y = dir.y * speed + 2,
|
||||||
z = -dir.z * speed
|
z = -dir.z * speed
|
||||||
})
|
})
|
||||||
|
|
||||||
elseif not ctrl.down or ctrl.up or ctrl.jump then
|
elseif not ctrl.down or ctrl.up or ctrl.jump then
|
||||||
entity.object:setvelocity({x = 0, y = -2, z = 0})
|
entity.object:set_velocity({x = 0, y = -2, z = 0})
|
||||||
end
|
end
|
||||||
|
|
||||||
entity.object:setyaw(yaw + math.pi + math.pi / 2 - entity.rotate)
|
entity.object:set_yaw(yaw + math.pi + math.pi / 2 - entity.rotate)
|
||||||
|
|
||||||
-- firing arrows
|
-- firing arrows
|
||||||
if ctrl.LMB and ctrl.sneak and shoots then
|
if ctrl.LMB and ctrl.sneak and shoots then
|
||||||
|
@ -431,8 +431,8 @@ function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
|
||||||
ent.owner_id = tostring(entity.object) -- so arrows dont hurt entity you are riding
|
ent.owner_id = tostring(entity.object) -- so arrows dont hurt entity you are riding
|
||||||
local vec = {x = dir.x * 6, y = dir.y * 6, z = dir.z * 6}
|
local vec = {x = dir.x * 6, y = dir.y * 6, z = dir.z * 6}
|
||||||
local yaw = entity.driver:get_look_horizontal()
|
local yaw = entity.driver:get_look_horizontal()
|
||||||
obj:setyaw(yaw + math.pi / 2)
|
obj:set_yaw(yaw + math.pi / 2)
|
||||||
obj:setvelocity(vec)
|
obj:set_velocity(vec)
|
||||||
else
|
else
|
||||||
obj:remove()
|
obj:remove()
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,13 +3,9 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
--THIS IS THE MASTER ITEM LIST TO USE WITH DEFAULT
|
--THIS IS THE MASTER ITEM LIST TO USE WITH DEFAULT
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
local c = mobs_mc.is_item_variable_overridden
|
local c = mobs_mc.is_item_variable_overridden
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--maikerumines throwing code
|
--maikerumines throwing code
|
||||||
--arrow (weapon)
|
--arrow (weapon)
|
||||||
|
@ -116,9 +114,9 @@ local throwing_shoot_arrow = function(itemstack, player)
|
||||||
local playerpos = player:get_pos()
|
local playerpos = player:get_pos()
|
||||||
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --mc
|
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --mc
|
||||||
local dir = player:get_look_dir()
|
local dir = player:get_look_dir()
|
||||||
obj:setvelocity({x=dir.x*22, y=dir.y*22, z=dir.z*22})
|
obj:set_velocity({x=dir.x*22, y=dir.y*22, z=dir.z*22})
|
||||||
obj:setacceleration({x=dir.x*-3, y=-10, z=dir.z*-3})
|
obj:set_acceleration({x=dir.x*-3, y=-10, z=dir.z*-3})
|
||||||
obj:setyaw(player:get_look_yaw()+math.pi)
|
obj:set_yaw(player:get_look_yaw()+math.pi)
|
||||||
minetest.sound_play("throwing_sound", {pos=playerpos})
|
minetest.sound_play("throwing_sound", {pos=playerpos})
|
||||||
if obj:get_luaentity().player == "" then
|
if obj:get_luaentity().player == "" then
|
||||||
obj:get_luaentity().player = player
|
obj:get_luaentity().player = player
|
||||||
|
@ -267,13 +265,13 @@ if c("egg") then
|
||||||
ent.velocity = egg_VELOCITY -- needed for api internal timing
|
ent.velocity = egg_VELOCITY -- needed for api internal timing
|
||||||
ent.switch = 1 -- needed so that egg doesn't despawn straight away
|
ent.switch = 1 -- needed so that egg doesn't despawn straight away
|
||||||
|
|
||||||
obj:setvelocity({
|
obj:set_velocity({
|
||||||
x = dir.x * egg_VELOCITY,
|
x = dir.x * egg_VELOCITY,
|
||||||
y = dir.y * egg_VELOCITY,
|
y = dir.y * egg_VELOCITY,
|
||||||
z = dir.z * egg_VELOCITY
|
z = dir.z * egg_VELOCITY
|
||||||
})
|
})
|
||||||
|
|
||||||
obj:setacceleration({
|
obj:set_acceleration({
|
||||||
x = dir.x * -3,
|
x = dir.x * -3,
|
||||||
y = -egg_GRAVITY,
|
y = -egg_GRAVITY,
|
||||||
z = dir.z * -3
|
z = dir.z * -3
|
||||||
|
@ -351,13 +349,13 @@ if c("snowball") then
|
||||||
ent.velocity = snowball_VELOCITY -- needed for api internal timing
|
ent.velocity = snowball_VELOCITY -- needed for api internal timing
|
||||||
ent.switch = 1 -- needed so that egg doesn't despawn straight away
|
ent.switch = 1 -- needed so that egg doesn't despawn straight away
|
||||||
|
|
||||||
obj:setvelocity({
|
obj:set_velocity({
|
||||||
x = dir.x * snowball_VELOCITY,
|
x = dir.x * snowball_VELOCITY,
|
||||||
y = dir.y * snowball_VELOCITY,
|
y = dir.y * snowball_VELOCITY,
|
||||||
z = dir.z * snowball_VELOCITY
|
z = dir.z * snowball_VELOCITY
|
||||||
})
|
})
|
||||||
|
|
||||||
obj:setacceleration({
|
obj:set_acceleration({
|
||||||
x = dir.x * -3,
|
x = dir.x * -3,
|
||||||
y = -snowball_GRAVITY,
|
y = -snowball_GRAVITY,
|
||||||
z = dir.z * -3
|
z = dir.z * -3
|
||||||
|
|
|
@ -53,7 +53,7 @@ mobs_mc.make_owner_teleport_function = function(dist, teleport_check_interval)
|
||||||
if minetest.registered_nodes[minetest.get_node(telepos).name].walkable == false and
|
if minetest.registered_nodes[minetest.get_node(telepos).name].walkable == false and
|
||||||
minetest.registered_nodes[minetest.get_node(telepos_below).name].walkable == true then
|
minetest.registered_nodes[minetest.get_node(telepos_below).name].walkable == true then
|
||||||
-- Correct position found! Let's teleport.
|
-- Correct position found! Let's teleport.
|
||||||
self.object:setpos(telepos)
|
self.object:set_pos(telepos)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
--MC Heads for minetest
|
--MC Heads for minetest
|
||||||
--maikerumine
|
--maikerumine
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
-- Heads system
|
-- Heads system
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
--################### AGENT
|
--################### AGENT
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:agent", {
|
mobs:register_mob("mobs_mc:agent", {
|
||||||
type = "npc",
|
type = "npc",
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:bat", {
|
mobs:register_mob("mobs_mc:bat", {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
|
|
|
@ -3,11 +3,8 @@
|
||||||
-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models
|
-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models
|
||||||
-- blaze.lua partial copy of mobs_mc/ghast.lua
|
-- blaze.lua partial copy of mobs_mc/ghast.lua
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
--###################
|
--###################
|
||||||
--################### BLAZE
|
--################### BLAZE
|
||||||
--###################
|
--###################
|
||||||
|
@ -101,7 +98,7 @@ mobs:register_arrow("mobs_mc:blaze_fireball", {
|
||||||
if node.name == "air" then
|
if node.name == "air" then
|
||||||
minetest.set_node(pos_above, {name=mobs_mc.items.fire})
|
minetest.set_node(pos_above, {name=mobs_mc.items.fire})
|
||||||
else
|
else
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:get_velocity()
|
||||||
v = vector.normalize(v)
|
v = vector.normalize(v)
|
||||||
local crashpos = vector.subtract(pos, v)
|
local crashpos = vector.subtract(pos, v)
|
||||||
local crashnode = minetest.get_node(crashpos)
|
local crashnode = minetest.get_node(crashpos)
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### CHICKEN
|
--################### CHICKEN
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
local cow_def = {
|
local cow_def = {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
|
@ -100,10 +98,10 @@ mooshroom_def.on_rightclick = function(self, clicker)
|
||||||
minetest.add_item({x=pos.x, y=pos.y+1.4, z=pos.z}, mobs_mc.items.mushroom_red .. " 5")
|
minetest.add_item({x=pos.x, y=pos.y+1.4, z=pos.z}, mobs_mc.items.mushroom_red .. " 5")
|
||||||
end
|
end
|
||||||
|
|
||||||
local oldyaw = self.object:getyaw()
|
local oldyaw = self.object:get_yaw()
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
local cow = minetest.add_entity(pos, "mobs_mc:cow")
|
local cow = minetest.add_entity(pos, "mobs_mc:cow")
|
||||||
cow:setyaw(oldyaw)
|
cow:set_yaw(oldyaw)
|
||||||
|
|
||||||
if not minetest.settings:get_bool("creative_mode") then
|
if not minetest.settings:get_bool("creative_mode") then
|
||||||
item:add_wear(mobs_mc.misc.shears_wear)
|
item:add_wear(mobs_mc.misc.shears_wear)
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### CREEPER
|
--################### CREEPER
|
||||||
|
|
|
@ -8,5 +8,4 @@ mcl_fishing?
|
||||||
bones?
|
bones?
|
||||||
mesecons_materials?
|
mesecons_materials?
|
||||||
mobs_mc_gameconfig?
|
mobs_mc_gameconfig?
|
||||||
intllib?
|
|
||||||
doc_items?
|
doc_items?
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
--################### ENDERDRAGON
|
--################### ENDERDRAGON
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
mobs:register_mob("mobs_mc:12enderdragon", {
|
mobs:register_mob("mobs_mc:12enderdragon", {
|
||||||
|
|
|
@ -10,12 +10,7 @@
|
||||||
-- and they are provoked by looking directly at them.
|
-- and they are provoked by looking directly at them.
|
||||||
-- TODO: Implement MC behaviour.
|
-- TODO: Implement MC behaviour.
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### ENDERMAN
|
--################### ENDERMAN
|
||||||
|
@ -314,7 +309,7 @@ mobs:register_mob("mobs_mc:enderman", {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if telepos then
|
if telepos then
|
||||||
self.object:setpos(telepos)
|
self.object:set_pos(telepos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
--################### ENDERMITE
|
--################### ENDERMITE
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:endermite", {
|
mobs:register_mob("mobs_mc:endermite", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
|
|
|
@ -3,11 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### GHAST
|
--################### GHAST
|
||||||
|
|
|
@ -4,9 +4,7 @@
|
||||||
--################### GUARDIAN
|
--################### GUARDIAN
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:guardian", {
|
mobs:register_mob("mobs_mc:guardian", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
|
|
|
@ -4,9 +4,7 @@
|
||||||
--################### GUARDIAN
|
--################### GUARDIAN
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:guardian_elder", {
|
mobs:register_mob("mobs_mc:guardian_elder", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### HORSE
|
--################### HORSE
|
||||||
|
@ -142,7 +140,7 @@ local horse = {
|
||||||
self.max_speed_reverse = 2
|
self.max_speed_reverse = 2
|
||||||
self.accel = 6
|
self.accel = 6
|
||||||
self.terrain_type = 3
|
self.terrain_type = 3
|
||||||
self.driver_attach_at = {x = 0, y = 7.5, z = -1.75}
|
self.driver_attach_at = {x = 0, y = 4.17, z = -1.75}
|
||||||
self.driver_eye_offset = {x = 0, y = 3, z = 0}
|
self.driver_eye_offset = {x = 0, y = 3, z = 0}
|
||||||
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
|
|
||||||
-- Fallback functions for when `intllib` is not installed.
|
|
||||||
-- Code released under Unlicense <http://unlicense.org>.
|
|
||||||
|
|
||||||
-- Get the latest version of this file at:
|
|
||||||
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
|
||||||
|
|
||||||
local function format(str, ...)
|
|
||||||
local args = { ... }
|
|
||||||
local function repl(escape, open, num, close)
|
|
||||||
if escape == "" then
|
|
||||||
local replacement = tostring(args[tonumber(num)])
|
|
||||||
if open == "" then
|
|
||||||
replacement = replacement..close
|
|
||||||
end
|
|
||||||
return replacement
|
|
||||||
else
|
|
||||||
return "@"..open..num..close
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
|
||||||
end
|
|
||||||
|
|
||||||
local gettext, ngettext
|
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
if intllib.make_gettext_pair then
|
|
||||||
-- New method using gettext.
|
|
||||||
gettext, ngettext = intllib.make_gettext_pair()
|
|
||||||
else
|
|
||||||
-- Old method using text files.
|
|
||||||
gettext = intllib.Getter()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Fill in missing functions.
|
|
||||||
|
|
||||||
gettext = gettext or function(msgid, ...)
|
|
||||||
return format(msgid, ...)
|
|
||||||
end
|
|
||||||
|
|
||||||
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
|
||||||
return format(n==1 and msgid or msgid_plural, ...)
|
|
||||||
end
|
|
||||||
|
|
||||||
return gettext, ngettext
|
|
|
@ -3,11 +3,8 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
--###################
|
--###################
|
||||||
--################### IRON GOLEM
|
--################### IRON GOLEM
|
||||||
--###################
|
--###################
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### LLAMA
|
--################### LLAMA
|
||||||
|
@ -69,7 +67,7 @@ mobs:register_mob("mobs_mc:llama", {
|
||||||
self.max_speed_reverse = 2
|
self.max_speed_reverse = 2
|
||||||
self.accel = 4
|
self.accel = 4
|
||||||
self.terrain_type = 3
|
self.terrain_type = 3
|
||||||
self.driver_attach_at = {x = 0, y = 7.5, z = -1.5}
|
self.driver_attach_at = {x = 0, y = 4.17, z = -1.5}
|
||||||
self.driver_eye_offset = {x = 0, y = 3, z = 0}
|
self.driver_eye_offset = {x = 0, y = 3, z = 0}
|
||||||
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### OCELOT AND CAT
|
--################### OCELOT AND CAT
|
||||||
|
|
|
@ -3,12 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### PARROT
|
--################### PARROT
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:pig", {
|
mobs:register_mob("mobs_mc:pig", {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
|
@ -59,7 +57,7 @@ mobs:register_mob("mobs_mc:pig", {
|
||||||
self.max_speed_reverse = 2
|
self.max_speed_reverse = 2
|
||||||
self.accel = 4
|
self.accel = 4
|
||||||
self.terrain_type = 3
|
self.terrain_type = 3
|
||||||
self.driver_attach_at = {x = 0.0, y = 6.75, z = -1.5}
|
self.driver_attach_at = {x = 0.0, y = 2.75, z = -1.5}
|
||||||
self.driver_eye_offset = {x = 0, y = 3, z = 0}
|
self.driver_eye_offset = {x = 0, y = 3, z = 0}
|
||||||
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### POLARBEAR
|
--################### POLARBEAR
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
local rabbit = {
|
local rabbit = {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### SHEEP
|
--################### SHEEP
|
||||||
|
|
|
@ -3,11 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### SHULKER
|
--################### SHULKER
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
--################### SILVERFISH
|
--################### SILVERFISH
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:silverfish", {
|
mobs:register_mob("mobs_mc:silverfish", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
|
|
|
@ -3,12 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### SKELETON
|
--################### SKELETON
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### WITHER SKELETON
|
--################### WITHER SKELETON
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
-- Returns a function that spawns children in a circle around pos.
|
-- Returns a function that spawns children in a circle around pos.
|
||||||
-- To be used as on_die callback.
|
-- To be used as on_die callback.
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
local snow_trail_frequency = 0.5 -- Time in seconds for checking to add a new snow trail
|
local snow_trail_frequency = 0.5 -- Time in seconds for checking to add a new snow trail
|
||||||
|
|
||||||
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
|
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
|
||||||
|
|
|
@ -3,11 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### SPIDER
|
--################### SPIDER
|
||||||
|
|
|
@ -4,9 +4,7 @@
|
||||||
--################### SQUID
|
--################### SQUID
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:squid", {
|
mobs:register_mob("mobs_mc:squid", {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### VEX
|
--################### VEX
|
||||||
|
|
|
@ -19,9 +19,7 @@
|
||||||
-- TODO: Internal inventory, pick up items, trade with other villagers
|
-- TODO: Internal inventory, pick up items, trade with other villagers
|
||||||
-- TODO: Farm stuff
|
-- TODO: Farm stuff
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
-- playername-indexed table containing the previously used tradenum
|
-- playername-indexed table containing the previously used tradenum
|
||||||
local player_tradenum = {}
|
local player_tradenum = {}
|
||||||
|
@ -595,7 +593,7 @@ local function return_item(itemstack, dropper, pos, inv_p)
|
||||||
v.x = v.x*4
|
v.x = v.x*4
|
||||||
v.y = v.y*4 + 2
|
v.y = v.y*4 + 2
|
||||||
v.z = v.z*4
|
v.z = v.z*4
|
||||||
obj:setvelocity(v)
|
obj:set_velocity(v)
|
||||||
obj:get_luaentity()._insta_collect = false
|
obj:get_luaentity()._insta_collect = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,11 +3,8 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
--###################
|
--###################
|
||||||
--################### EVOKER
|
--################### EVOKER
|
||||||
--###################
|
--###################
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:illusioner", {
|
mobs:register_mob("mobs_mc:illusioner", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
|
|
|
@ -3,11 +3,8 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
--###################
|
--###################
|
||||||
--################### VINDICATOR
|
--################### VINDICATOR
|
||||||
--###################
|
--###################
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
-- TODO: Turn villagers to zombie villager
|
-- TODO: Turn villagers to zombie villager
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### WITCH
|
--################### WITCH
|
||||||
|
|
|
@ -3,18 +3,12 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### WITHER
|
--################### WITHER
|
||||||
--###################
|
--###################
|
||||||
|
|
||||||
|
|
||||||
mobs:register_mob("mobs_mc:wither", {
|
mobs:register_mob("mobs_mc:wither", {
|
||||||
type = "monster",
|
type = "monster",
|
||||||
hp_max = 300,
|
hp_max = 300,
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
local default_walk_chance = 50
|
local default_walk_chance = 50
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,7 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
|
|
||||||
|
|
||||||
--###################
|
--###################
|
||||||
--################### ZOMBIE
|
--################### ZOMBIE
|
||||||
|
|
|
@ -3,11 +3,8 @@
|
||||||
--made for MC like Survival game
|
--made for MC like Survival game
|
||||||
--License for code WTFPL and otherwise stated in readmes
|
--License for code WTFPL and otherwise stated in readmes
|
||||||
|
|
||||||
-- intllib
|
local S = minetest.get_translator("mobs_mc")
|
||||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
|
||||||
local S, NS = dofile(MP.."/intllib.lua")
|
|
||||||
|
|
||||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
|
||||||
--###################
|
--###################
|
||||||
--################### ZOMBIE PIGMAN
|
--################### ZOMBIE PIGMAN
|
||||||
--###################
|
--###################
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
|
||||||
Copyright (C) 2016 - Auke Kok <sofar@foo-projects.org>
|
Copyright (C) 2016 - Auke Kok <sofar@foo-projects.org>
|
||||||
|
@ -10,6 +9,8 @@ of the license, or (at your option) any later version.
|
||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
|
local S = minetest.get_translator("lightning")
|
||||||
|
|
||||||
lightning = {}
|
lightning = {}
|
||||||
|
|
||||||
lightning.interval_low = 17
|
lightning.interval_low = 17
|
||||||
|
@ -163,7 +164,7 @@ lightning.strike = function(pos)
|
||||||
posadd = {x=math.cos(angle),y=0,z=math.sin(angle)}
|
posadd = {x=math.cos(angle),y=0,z=math.sin(angle)}
|
||||||
posadd = vector.normalize(posadd)
|
posadd = vector.normalize(posadd)
|
||||||
local mob = minetest.add_entity(vector.add(pos2, posadd), "mobs_mc:skeleton")
|
local mob = minetest.add_entity(vector.add(pos2, posadd), "mobs_mc:skeleton")
|
||||||
mob:setyaw(angle-math.pi/2)
|
mob:set_yaw(angle-math.pi/2)
|
||||||
angle = angle + (math.pi*2) / 3
|
angle = angle + (math.pi*2) / 3
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -178,7 +179,7 @@ lightning.strike = function(pos)
|
||||||
if obj:is_player() then
|
if obj:is_player() then
|
||||||
-- Player damage
|
-- Player damage
|
||||||
if minetest.get_modpath("mcl_death_messages") then
|
if minetest.get_modpath("mcl_death_messages") then
|
||||||
mcl_death_messages.player_damage(obj, string.format("%s was struck by lightning.", obj:get_player_name()))
|
mcl_death_messages.player_damage(obj, S("@1 was struck by lightning.", obj:get_player_name()))
|
||||||
end
|
end
|
||||||
obj:set_hp(obj:get_hp()-5)
|
obj:set_hp(obj:get_hp()-5)
|
||||||
-- Mobs
|
-- Mobs
|
||||||
|
@ -233,7 +234,7 @@ end)
|
||||||
|
|
||||||
minetest.register_chatcommand("lightning", {
|
minetest.register_chatcommand("lightning", {
|
||||||
params = "[<X> <Y> <Z>]",
|
params = "[<X> <Y> <Z>]",
|
||||||
description = "Let lightning strike at the specified position or yourself",
|
description = S("Let lightning strike at the specified position or yourself"),
|
||||||
privs = { maphack = true },
|
privs = { maphack = true },
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local pos = {}
|
local pos = {}
|
||||||
|
@ -254,7 +255,7 @@ minetest.register_chatcommand("lightning", {
|
||||||
if player then
|
if player then
|
||||||
lightning.strike(player:get_pos())
|
lightning.strike(player:get_pos())
|
||||||
else
|
else
|
||||||
return false, "No position specified and unknown player"
|
return false, S("No position specified and unknown player")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local S = minetest.get_translator("mcl_void_damage")
|
||||||
|
|
||||||
local voidtimer = 0
|
local voidtimer = 0
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
|
@ -24,7 +26,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
local spawn = mcl_spawn.get_spawn_pos(obj)
|
local spawn = mcl_spawn.get_spawn_pos(obj)
|
||||||
obj:set_pos(spawn)
|
obj:set_pos(spawn)
|
||||||
mcl_worlds.dimension_change(obj, mcl_worlds.pos_to_dimension(spawn))
|
mcl_worlds.dimension_change(obj, mcl_worlds.pos_to_dimension(spawn))
|
||||||
minetest.chat_send_player(obj:get_player_name(), "The void is off-limits to you!")
|
minetest.chat_send_player(obj:get_player_name(), S("The void is off-limits to you!"))
|
||||||
else
|
else
|
||||||
obj:remove()
|
obj:remove()
|
||||||
end
|
end
|
||||||
|
@ -32,7 +34,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
-- Damage enabled, not immortal: Deal void damage (4 HP / 0.5 seconds)
|
-- Damage enabled, not immortal: Deal void damage (4 HP / 0.5 seconds)
|
||||||
if obj:get_hp() > 0 then
|
if obj:get_hp() > 0 then
|
||||||
if is_player then
|
if is_player then
|
||||||
mcl_death_messages.player_damage(obj, string.format("%s fell into the endless void.", obj:get_player_name()))
|
mcl_death_messages.player_damage(obj, S("@1 fell into the endless void.", obj:get_player_name()))
|
||||||
end
|
end
|
||||||
obj:set_hp(obj:get_hp() - 4)
|
obj:set_hp(obj:get_hp() - 4)
|
||||||
end
|
end
|
||||||
|
|
|
@ -235,7 +235,7 @@ local initsky = function(player)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- MC-style clouds: Layer 127, thickness 4, fly to the “West”
|
-- MC-style clouds: Layer 127, thickness 4, fly to the “West”
|
||||||
player:set_clouds({height=mcl_worlds.layer_to_y(127), speed={x=-2, y=0}, thickness=4, color="#FFF0FEF"})
|
player:set_clouds({height=mcl_worlds.layer_to_y(127), speed={x=-2, z=0}, thickness=4, color="#FFF0FEF"})
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_joinplayer(initsky)
|
minetest.register_on_joinplayer(initsky)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local S = minetest.get_translator("mcl_weather")
|
||||||
|
|
||||||
-- weather states, 'none' is default, other states depends from active mods
|
-- weather states, 'none' is default, other states depends from active mods
|
||||||
mcl_weather.state = "none"
|
mcl_weather.state = "none"
|
||||||
|
|
||||||
|
@ -182,18 +184,18 @@ mcl_weather.get_weather = function()
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_privilege("weather_manager", {
|
minetest.register_privilege("weather_manager", {
|
||||||
description = "Gives ability to control weather",
|
description = S("Gives ability to control weather"),
|
||||||
give_to_singleplayer = false
|
give_to_singleplayer = false
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Weather command definition. Set
|
-- Weather command definition. Set
|
||||||
minetest.register_chatcommand("weather", {
|
minetest.register_chatcommand("weather", {
|
||||||
params = "(clear | rain | snow | thunder) [<duration>]",
|
params = S("(clear | rain | snow | thunder) [<duration>]"),
|
||||||
description = "Changes the weather to the specified parameter.",
|
description = S("Changes the weather to the specified parameter."),
|
||||||
privs = {weather_manager = true},
|
privs = {weather_manager = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if (param == "") then
|
if (param == "") then
|
||||||
return false, "Error: No weather specified."
|
return false, S("Error: No weather specified.")
|
||||||
end
|
end
|
||||||
local new_weather, end_time
|
local new_weather, end_time
|
||||||
local parse1, parse2 = string.match(param, "(%w+) ?(%d*)")
|
local parse1, parse2 = string.match(param, "(%w+) ?(%d*)")
|
||||||
|
@ -204,13 +206,13 @@ minetest.register_chatcommand("weather", {
|
||||||
new_weather = parse1
|
new_weather = parse1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return false, "Error: Invalid parameters."
|
return false, S("Error: Invalid parameters.")
|
||||||
end
|
end
|
||||||
if parse2 then
|
if parse2 then
|
||||||
if type(tonumber(parse2)) == "number" then
|
if type(tonumber(parse2)) == "number" then
|
||||||
local duration = tonumber(parse2)
|
local duration = tonumber(parse2)
|
||||||
if duration < 1 then
|
if duration < 1 then
|
||||||
return false, "Error: Duration can't be less than 1 second."
|
return false, S("Error: Duration can't be less than 1 second.")
|
||||||
end
|
end
|
||||||
end_time = minetest.get_gametime() + duration
|
end_time = minetest.get_gametime() + duration
|
||||||
end
|
end
|
||||||
|
@ -220,14 +222,14 @@ minetest.register_chatcommand("weather", {
|
||||||
if success then
|
if success then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return false, "Error: Invalid weather specified. Use “clear”, “rain”, “snow” or “thunder”."
|
return false, S("Error: Invalid weather specified. Use “clear”, “rain”, “snow” or “thunder”.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("toggledownfall", {
|
minetest.register_chatcommand("toggledownfall", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Toggles between clear weather and weather with downfall (randomly rain, thunderstorm or snow)",
|
description = S("Toggles between clear weather and weather with downfall (randomly rain, thunderstorm or snow)"),
|
||||||
privs = {weather_manager = true},
|
privs = {weather_manager = true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
-- Currently rain/thunder/snow: Set weather to clear
|
-- Currently rain/thunder/snow: Set weather to clear
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
name = ENVIRONMENT
|
||||||
|
description = Meta-modpack containing environment and nature-related mods for MineClone 2
|
|
@ -0,0 +1 @@
|
||||||
|
name = doc
|
|
@ -315,8 +315,7 @@ function craftguide:get_formspec(player_name, is_fuel)
|
||||||
data.pagemax = max(1, ceil(#data.items / ipp))
|
data.pagemax = max(1, ceil(#data.items / ipp))
|
||||||
|
|
||||||
local formspec = "size["..data.iX..","..(iY+3)..".6;]"..
|
local formspec = "size["..data.iX..","..(iY+3)..".6;]"..
|
||||||
mcl_vars.gui_slots ..
|
mcl_vars.inventory_header..
|
||||||
mcl_vars.gui_bg ..
|
|
||||||
[=[background[1,1;1,1;craftguide_bg.png;true]
|
[=[background[1,1;1,1;craftguide_bg.png;true]
|
||||||
button[2.4,0.21;0.8,0.5;search;?]
|
button[2.4,0.21;0.8,0.5;search;?]
|
||||||
button[3.05,0.21;0.8,0.5;clear;X]
|
button[3.05,0.21;0.8,0.5;clear;X]
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local S = minetest.get_translator("mcl_doc")
|
||||||
|
|
||||||
-- Disable built-in factoids; it is planned to add custom ones as replacements
|
-- Disable built-in factoids; it is planned to add custom ones as replacements
|
||||||
doc.sub.items.disable_core_factoid("node_mining")
|
doc.sub.items.disable_core_factoid("node_mining")
|
||||||
doc.sub.items.disable_core_factoid("tool_capabilities")
|
doc.sub.items.disable_core_factoid("tool_capabilities")
|
||||||
|
@ -14,7 +16,7 @@ end)
|
||||||
-- dig_by_water
|
-- dig_by_water
|
||||||
doc.sub.items.register_factoid("nodes", "drop_destroy", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "drop_destroy", function(itemstring, def)
|
||||||
if def.groups.dig_by_water then
|
if def.groups.dig_by_water then
|
||||||
return "Water can flow into this block and cause it to drop as an item."
|
return S("Water can flow into this block and cause it to drop as an item.")
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
end)
|
end)
|
||||||
|
@ -22,9 +24,9 @@ end)
|
||||||
-- usable by hoes
|
-- usable by hoes
|
||||||
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
||||||
if def.groups.cultivatable == 2 then
|
if def.groups.cultivatable == 2 then
|
||||||
return "This block can be turned into dirt with a hoe."
|
return S("This block can be turned into dirt with a hoe.")
|
||||||
elseif def.groups.cultivatable == 2 then
|
elseif def.groups.cultivatable == 2 then
|
||||||
return "This block can be turned into farmland with a hoe."
|
return S("This block can be turned into farmland with a hoe.")
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
end)
|
end)
|
||||||
|
@ -33,15 +35,15 @@ end)
|
||||||
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
||||||
local datastring = ""
|
local datastring = ""
|
||||||
if def.groups.soil_sapling == 2 then
|
if def.groups.soil_sapling == 2 then
|
||||||
datastring = datastring .. "This block acts as a soil for all saplings." .. "\n"
|
datastring = datastring .. S("This block acts as a soil for all saplings.") .. "\n"
|
||||||
elseif def.groups.soil_sapling == 1 then
|
elseif def.groups.soil_sapling == 1 then
|
||||||
datastring = datastring .. "This block acts as a soil for some saplings." .. "\n"
|
datastring = datastring .. S("This block acts as a soil for some saplings.") .. "\n"
|
||||||
end
|
end
|
||||||
if def.groups.soil_sugarcane then
|
if def.groups.soil_sugarcane then
|
||||||
datastring = datastring .. "Sugar canes will grow on this block." .. "\n"
|
datastring = datastring .. S("Sugar canes will grow on this block.") .. "\n"
|
||||||
end
|
end
|
||||||
if def.groups.soil_nether_wart then
|
if def.groups.soil_nether_wart then
|
||||||
datastring = datastring .. "Nether wart will grow on this block." .. "\n"
|
datastring = datastring .. S("Nether wart will grow on this block.") .. "\n"
|
||||||
end
|
end
|
||||||
return datastring
|
return datastring
|
||||||
end)
|
end)
|
||||||
|
@ -50,9 +52,9 @@ doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
||||||
local formstring = ""
|
local formstring = ""
|
||||||
if def.groups.leafdecay ~= nil then
|
if def.groups.leafdecay ~= nil then
|
||||||
if def.drop ~= "" and def.drop ~= nil and def.drop ~= itemstring then
|
if def.drop ~= "" and def.drop ~= nil and def.drop ~= itemstring then
|
||||||
formstring = string.format("This block quickly decays when there is no wood block of any species within a distance of %d. When decaying, it disappears and may drop one of its regular drops. The block does not decay when the block has been placed by a player.", def.groups.leafdecay)
|
formstring = S("This block quickly decays when there is no wood block of any species within a distance of @1. When decaying, it disappears and may drop one of its regular drops. The block does not decay when the block has been placed by a player.", def.groups.leafdecay)
|
||||||
else
|
else
|
||||||
formstring = string.format("This block quickly decays and disappears when there is no wood block of any species within a distance of %d. The block does not decay when the block has been placed by a player.", def.groups.leafdecay)
|
formstring = S("This block quickly decays and disappears when there is no wood block of any species within a distance of @1. The block does not decay when the block has been placed by a player.", def.groups.leafdecay)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return formstring
|
return formstring
|
||||||
|
@ -62,9 +64,9 @@ end)
|
||||||
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
||||||
local datastring = ""
|
local datastring = ""
|
||||||
if def.groups.place_flowerlike == 1 then
|
if def.groups.place_flowerlike == 1 then
|
||||||
return "This plant can only grow on grass blocks and dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher."
|
return S("This plant can only grow on grass blocks and dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher.")
|
||||||
elseif def.groups.place_flowerlike == 2 then
|
elseif def.groups.place_flowerlike == 2 then
|
||||||
return "This plant can grow on grass blocks, podzol, dirt and coarse dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher."
|
return S("This plant can grow on grass blocks, podzol, dirt and coarse dirt. To survive, it needs to have an unobstructed view to the sky above or be exposed to a light level of 8 or higher.")
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
end)
|
end)
|
||||||
|
@ -72,7 +74,7 @@ end)
|
||||||
-- flammable
|
-- flammable
|
||||||
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
||||||
if def.groups.flammable then
|
if def.groups.flammable then
|
||||||
return "This block is flammable."
|
return S("This block is flammable.")
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
end)
|
end)
|
||||||
|
@ -80,7 +82,7 @@ end)
|
||||||
-- destroys_items
|
-- destroys_items
|
||||||
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
|
||||||
if def.groups.destroys_items then
|
if def.groups.destroys_items then
|
||||||
return "This block destroys any item it touches."
|
return S("This block destroys any item it touches.")
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
end)
|
end)
|
||||||
|
@ -91,25 +93,25 @@ doc.sub.items.register_factoid(nil, "use", function(itemstring, def)
|
||||||
local s = ""
|
local s = ""
|
||||||
if def.groups.eatable and not def._doc_items_usagehelp then
|
if def.groups.eatable and not def._doc_items_usagehelp then
|
||||||
if def.groups.food == 2 then
|
if def.groups.food == 2 then
|
||||||
s = s .. "To eat it, wield it, then rightclick."
|
s = s .. S("To eat it, wield it, then rightclick.")
|
||||||
if def.groups.can_eat_when_full == 1 then
|
if def.groups.can_eat_when_full == 1 then
|
||||||
s = s .. "\n" .. "You can eat this even when your hunger bar is full."
|
s = s .. "\n" .. S("You can eat this even when your hunger bar is full.")
|
||||||
else
|
else
|
||||||
s = s .. "\n" .. "You cannot eat this when your hunger bar is full."
|
s = s .. "\n" .. S("You cannot eat this when your hunger bar is full.")
|
||||||
end
|
end
|
||||||
elseif def.groups.food == 3 then
|
elseif def.groups.food == 3 then
|
||||||
s = s .. "To drink it, wield it, then rightclick."
|
s = s .. S("To drink it, wield it, then rightclick.")
|
||||||
if def.groups.can_eat_when_full ~= 1 then
|
if def.groups.can_eat_when_full ~= 1 then
|
||||||
s = s .. "\n" .. "You cannot drink this when your hunger bar is full."
|
s = s .. "\n" .. S("You cannot drink this when your hunger bar is full.")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
s = s .. "To consume it, wield it, then rightclick."
|
s = s .. S("To consume it, wield it, then rightclick.")
|
||||||
if def.groups.can_eat_when_full ~= 1 then
|
if def.groups.can_eat_when_full ~= 1 then
|
||||||
s = s .. "\n" .. "You cannot consume this when your hunger bar is full."
|
s = s .. "\n" .. S("You cannot consume this when your hunger bar is full.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if def.groups.no_eat_delay ~= 1 then
|
if def.groups.no_eat_delay ~= 1 then
|
||||||
s = s .. "\n" .. "You have to wait for about 2 seconds before you can eat or drink again."
|
s = s .. "\n" .. S("You have to wait for about 2 seconds before you can eat or drink again.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return s
|
return s
|
||||||
|
@ -118,10 +120,10 @@ end)
|
||||||
doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
|
doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
|
||||||
local s = ""
|
local s = ""
|
||||||
if def.groups.eatable and def.groups.eatable > 0 then
|
if def.groups.eatable and def.groups.eatable > 0 then
|
||||||
s = s .. string.format("Hunger points restored: %d", def.groups.eatable)
|
s = s .. S("Hunger points restored: @1", def.groups.eatable)
|
||||||
end
|
end
|
||||||
if def._mcl_saturation and def._mcl_saturation > 0 then
|
if def._mcl_saturation and def._mcl_saturation > 0 then
|
||||||
s = s .. "\n" .. string.format("Saturation points restored: %.1f", def._mcl_saturation)
|
s = s .. "\n" .. S("Saturation points restored: @1%.1f", string.format("%.1f", def._mcl_saturation))
|
||||||
end
|
end
|
||||||
return s
|
return s
|
||||||
end)
|
end)
|
||||||
|
@ -132,12 +134,12 @@ doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
|
||||||
local mdef = minetest.registered_items[def._repair_material]
|
local mdef = minetest.registered_items[def._repair_material]
|
||||||
local desc
|
local desc
|
||||||
if mdef and mdef.description and mdef.description ~= "" then
|
if mdef and mdef.description and mdef.description ~= "" then
|
||||||
return string.format("This item can be repaired at an anvil with: %s.", mdef.description)
|
return S("This item can be repaired at an anvil with: @1.", mdef.description)
|
||||||
elseif def._repair_material == "group:wood" then
|
elseif def._repair_material == "group:wood" then
|
||||||
return "This item can be repaired at an anvil with any wooden planks."
|
return S("This item can be repaired at an anvil with any wooden planks.")
|
||||||
elseif string.sub(def._repair_material, 1, 6) == "group:" then
|
elseif string.sub(def._repair_material, 1, 6) == "group:" then
|
||||||
local group = string.sub(def._repair_material, 7)
|
local group = string.sub(def._repair_material, 7)
|
||||||
return string.format("This item can be repaired at an anvil with any item in the “%s” group.", group)
|
return S("This item can be repaired at an anvil with any item in the “@1” group.", group)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
|
@ -145,7 +147,7 @@ end)
|
||||||
|
|
||||||
doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
|
doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
|
||||||
if minetest.get_item_group(itemstring, "no_rename") == 1 then
|
if minetest.get_item_group(itemstring, "no_rename") == 1 then
|
||||||
return "This item cannot be renamed at an anvil."
|
return S("This item cannot be renamed at an anvil.")
|
||||||
else
|
else
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
@ -154,7 +156,7 @@ end)
|
||||||
doc.sub.items.register_factoid("nodes", "gravity", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "gravity", function(itemstring, def)
|
||||||
local s = ""
|
local s = ""
|
||||||
if minetest.get_item_group(itemstring, "crush_after_fall") == 1 then
|
if minetest.get_item_group(itemstring, "crush_after_fall") == 1 then
|
||||||
s = s .. "This block crushes any block it falls into."
|
s = s .. S("This block crushes any block it falls into.")
|
||||||
end
|
end
|
||||||
return s
|
return s
|
||||||
end)
|
end)
|
||||||
|
@ -162,22 +164,22 @@ end)
|
||||||
doc.sub.items.register_factoid("nodes", "gravity", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "gravity", function(itemstring, def)
|
||||||
local s = ""
|
local s = ""
|
||||||
if minetest.get_item_group(itemstring, "crush_after_fall") == 1 then
|
if minetest.get_item_group(itemstring, "crush_after_fall") == 1 then
|
||||||
s = s .. "When this block falls deeper than 1 block, it causes damage to any player it hits. The damage dealt is B×2−2 hit points with B = number of blocks fallen. The damage can never be more than 40 HP."
|
s = s .. S("When this block falls deeper than 1 block, it causes damage to any player it hits. The damage dealt is B×2−2 hit points with B = number of blocks fallen. The damage can never be more than 40 HP.")
|
||||||
end
|
end
|
||||||
return s
|
return s
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Mining, hardness and all that
|
-- Mining, hardness and all that
|
||||||
doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def)
|
||||||
local pickaxey = { "Diamond Pickaxe", "Iron Pickaxe", "Stone Pickaxe", "Golden Pickaxe", "Wooden Pickaxe" }
|
local pickaxey = { S("Diamond Pickaxe"), S("Iron Pickaxe"), S("Stone Pickaxe"), S("Golden Pickaxe"), S("Wooden Pickaxe") }
|
||||||
local axey = { "Diamond Axe", "Iron Axe", "Stone Axe", "Golden Axe", "Wooden Axe" }
|
local axey = { S("Diamond Axe"), S("Iron Axe"), S("Stone Axe"), S("Golden Axe"), S("Wooden Axe") }
|
||||||
local shovely = { "Diamond Shovel", "Iron Shovel", "Stone Shovel", "Golden Shovel", "Wooden Shovel" }
|
local shovely = { S("Diamond Shovel"), S("Iron Shovel"), S("Stone Shovel"), S("Golden Shovel"), S("Wooden Shovel") }
|
||||||
|
|
||||||
local datastring = ""
|
local datastring = ""
|
||||||
local groups = def.groups
|
local groups = def.groups
|
||||||
if groups then
|
if groups then
|
||||||
if groups.dig_immediate == 3 then
|
if groups.dig_immediate == 3 then
|
||||||
datastring = datastring .. "This block can be mined by any tool instantly." .. "\n"
|
datastring = datastring .. S("This block can be mined by any tool instantly.") .. "\n"
|
||||||
else
|
else
|
||||||
local tool_minable = false
|
local tool_minable = false
|
||||||
|
|
||||||
|
@ -213,7 +215,7 @@ doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def)
|
||||||
end
|
end
|
||||||
|
|
||||||
if tool_minable then
|
if tool_minable then
|
||||||
datastring = "This block can be mined by:\n" .. datastring .. "\n"
|
datastring = S("This block can be mined by:") .. "\n" .. datastring .. "\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -222,9 +224,9 @@ doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def)
|
||||||
hardness = 0
|
hardness = 0
|
||||||
end
|
end
|
||||||
if hardness == -1 then
|
if hardness == -1 then
|
||||||
datastring = datastring .. "Hardness: ∞"
|
datastring = datastring .. S("Hardness: ∞")
|
||||||
else
|
else
|
||||||
datastring = datastring .. string.format("Hardness: %.2f", hardness)
|
datastring = datastring .. S("Hardness: @1", string.format("%.2f", hardness))
|
||||||
end
|
end
|
||||||
local blast = def._mcl_blast_resistance
|
local blast = def._mcl_blast_resistance
|
||||||
if not blast then
|
if not blast then
|
||||||
|
@ -232,7 +234,7 @@ doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def)
|
||||||
end
|
end
|
||||||
-- TODO: Blast resistance as number
|
-- TODO: Blast resistance as number
|
||||||
if blast >= 1000 then
|
if blast >= 1000 then
|
||||||
datastring = datastring .. "\n" .. "This block will not be destroyed by TNT explosions."
|
datastring = datastring .. "\n" .. S("This block will not be destroyed by TNT explosions.")
|
||||||
end
|
end
|
||||||
return datastring
|
return datastring
|
||||||
end)
|
end)
|
||||||
|
@ -240,7 +242,7 @@ end)
|
||||||
-- Special drops when mined by shears
|
-- Special drops when mined by shears
|
||||||
doc.sub.items.register_factoid("nodes", "drops", function(itemstring, def)
|
doc.sub.items.register_factoid("nodes", "drops", function(itemstring, def)
|
||||||
if def._mcl_shears_drop == true then
|
if def._mcl_shears_drop == true then
|
||||||
return "This block drops itself when mined by shears."
|
return S("This block drops itself when mined by shears.")
|
||||||
elseif type(def._mcl_shears_drop) == "table" then
|
elseif type(def._mcl_shears_drop) == "table" then
|
||||||
local drops = {}
|
local drops = {}
|
||||||
for d=1, #def._mcl_shears_drop do
|
for d=1, #def._mcl_shears_drop do
|
||||||
|
@ -255,11 +257,11 @@ doc.sub.items.register_factoid("nodes", "drops", function(itemstring, def)
|
||||||
text = itemname
|
text = itemname
|
||||||
end
|
end
|
||||||
if itemcount > 1 then
|
if itemcount > 1 then
|
||||||
text = string.format("%d×%s", itemcount, text)
|
text = S("@1×@2", itemcount, text)
|
||||||
end
|
end
|
||||||
table.insert(drops, text)
|
table.insert(drops, text)
|
||||||
end
|
end
|
||||||
local ret = string.format("This blocks drops the following when mined by shears: %s", table.concat(drops, ", "))
|
local ret = S("This blocks drops the following when mined by shears: @1", table.concat(drops, S(", ")))
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
return ""
|
return ""
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
doc
|
doc
|
||||||
intllib?
|
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
local S = minetest.get_translator("mcl_doc_basics")
|
||||||
local S
|
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
S = function(s) return s end
|
|
||||||
end
|
|
||||||
|
|
||||||
doc.add_category("basics",
|
doc.add_category("basics",
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,10 +29,7 @@ function awards.save()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local S = function(s) return s end
|
local S = minetest.get_translator("awards")
|
||||||
function awards.set_intllib(locale)
|
|
||||||
S = locale
|
|
||||||
end
|
|
||||||
|
|
||||||
function awards.init()
|
function awards.init()
|
||||||
awards.players = awards.load()
|
awards.players = awards.load()
|
||||||
|
|
|
@ -14,12 +14,7 @@
|
||||||
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
--
|
--
|
||||||
|
|
||||||
local S
|
local S = minetest.get_translator("awards")
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
S = function ( s ) return s end
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_chatcommand("awards", {
|
minetest.register_chatcommand("awards", {
|
||||||
params = S("[c|clear|disable|enable]"),
|
params = S("[c|clear|disable|enable]"),
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
intllib?
|
|
||||||
sfinv?
|
sfinv?
|
||||||
unified_inventory?
|
unified_inventory?
|
||||||
|
|
|
@ -14,18 +14,9 @@
|
||||||
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
local S
|
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
S = function ( s ) return s end
|
|
||||||
end
|
|
||||||
|
|
||||||
dofile(minetest.get_modpath("awards").."/api.lua")
|
dofile(minetest.get_modpath("awards").."/api.lua")
|
||||||
dofile(minetest.get_modpath("awards").."/chat_commands.lua")
|
dofile(minetest.get_modpath("awards").."/chat_commands.lua")
|
||||||
dofile(minetest.get_modpath("awards").."/sfinv.lua")
|
dofile(minetest.get_modpath("awards").."/sfinv.lua")
|
||||||
dofile(minetest.get_modpath("awards").."/unified_inventory.lua")
|
dofile(minetest.get_modpath("awards").."/unified_inventory.lua")
|
||||||
dofile(minetest.get_modpath("awards").."/triggers.lua")
|
dofile(minetest.get_modpath("awards").."/triggers.lua")
|
||||||
awards.set_intllib(S)
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
if minetest.get_modpath("sfinv") then
|
if minetest.get_modpath("sfinv") then
|
||||||
local S
|
local S = minetest.get_translator("awards")
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
S = function ( s ) return s end
|
|
||||||
end
|
|
||||||
|
|
||||||
sfinv.register_page("awards:awards", {
|
sfinv.register_page("awards:awards", {
|
||||||
title = S("Awards"),
|
title = S("Awards"),
|
||||||
|
|
|
@ -14,12 +14,7 @@
|
||||||
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
--
|
--
|
||||||
|
|
||||||
local S
|
local S = minetest.get_translator("awards")
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
S = function ( s ) return s end
|
|
||||||
end
|
|
||||||
|
|
||||||
awards.register_trigger("dig", function(def)
|
awards.register_trigger("dig", function(def)
|
||||||
local tmp = {
|
local tmp = {
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
if minetest.get_modpath("unified_inventory") ~= nil then
|
if minetest.get_modpath("unified_inventory") ~= nil then
|
||||||
local S
|
local S = minetest.get_translator("awards")
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
S = function ( s ) return s end
|
|
||||||
end
|
|
||||||
|
|
||||||
unified_inventory.register_button("awards", {
|
unified_inventory.register_button("awards", {
|
||||||
type = "image",
|
type = "image",
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
awards
|
awards
|
||||||
intllib?
|
|
||||||
|
|
|
@ -3,12 +3,7 @@
|
||||||
-- If true, activates achievements from other Minecraft editions (XBox, PS, etc.)
|
-- If true, activates achievements from other Minecraft editions (XBox, PS, etc.)
|
||||||
local non_pc_achievements = false
|
local non_pc_achievements = false
|
||||||
|
|
||||||
local S
|
local S = minetest.get_translator("mcl_achievements")
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
S = function ( s ) return s end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Achievements from PC Edition
|
-- Achievements from PC Edition
|
||||||
|
|
||||||
|
|
|
@ -1,101 +1,103 @@
|
||||||
|
local S = minetest.get_translator("mcl_death_messages")
|
||||||
|
|
||||||
mcl_death_messages = {}
|
mcl_death_messages = {}
|
||||||
|
|
||||||
-- Death messages
|
-- Death messages
|
||||||
local msgs = {
|
local msgs = {
|
||||||
["arrow"] = {
|
["arrow"] = {
|
||||||
"%s was fatally hit by an arrow.",
|
S("%s was fatally hit by an arrow."),
|
||||||
"%s has been killed with an arrow.",
|
S("%s has been killed with an arrow."),
|
||||||
},
|
},
|
||||||
["arrow_name"] = {
|
["arrow_name"] = {
|
||||||
"%s was shot by an arrow from %s.",
|
S("%s was shot by an arrow from %s."),
|
||||||
},
|
},
|
||||||
["fire"] = {
|
["fire"] = {
|
||||||
"%s has been cooked crisp.",
|
S("%s has been cooked crisp."),
|
||||||
"%s felt the burn.",
|
S("%s felt the burn."),
|
||||||
"%s died in the flames.",
|
S("%s died in the flames."),
|
||||||
"%s died in a fire.",
|
S("%s died in a fire."),
|
||||||
},
|
},
|
||||||
["lava"] = {
|
["lava"] = {
|
||||||
"%s melted in lava.",
|
S("%s melted in lava."),
|
||||||
"%s took a bath in a hot lava tub.",
|
S("%s took a bath in a hot lava tub."),
|
||||||
"%s died in lava.",
|
S("%s died in lava."),
|
||||||
"%s could not survive in lava.",
|
S("%s could not survive in lava."),
|
||||||
},
|
},
|
||||||
["drown"] = {
|
["drown"] = {
|
||||||
"%s forgot to breathe.",
|
S("%s forgot to breathe."),
|
||||||
"%s drowned.",
|
S("%s drowned."),
|
||||||
"%s ran out of oxygen.",
|
S("%s ran out of oxygen."),
|
||||||
},
|
},
|
||||||
["starve"] = {
|
["starve"] = {
|
||||||
"%s starved.",
|
S("%s starved."),
|
||||||
},
|
},
|
||||||
["murder"] = {
|
["murder"] = {
|
||||||
"%s was killed by %s.",
|
S("%s was killed by %s."),
|
||||||
},
|
},
|
||||||
["mob_kill"] = {
|
["mob_kill"] = {
|
||||||
"%s was killed by a mob.",
|
S("%s was killed by a mob."),
|
||||||
},
|
},
|
||||||
["blaze_fireball"] = {
|
["blaze_fireball"] = {
|
||||||
"%s was burned to death by a blaze's fireball.",
|
S("%s was burned to death by a blaze's fireball."),
|
||||||
"%s was killed by a fireball from a blaze.",
|
S("%s was killed by a fireball from a blaze."),
|
||||||
},
|
},
|
||||||
["fire_charge"] = {
|
["fire_charge"] = {
|
||||||
"%s was hit by a fire charge.",
|
S("%s was hit by a fire charge."),
|
||||||
},
|
},
|
||||||
["ghast_fireball"] = {
|
["ghast_fireball"] = {
|
||||||
"A ghast scared %s to death.",
|
S("A ghast scared %s to death."),
|
||||||
"%s has been fireballed by a ghast.",
|
S("%s has been fireballed by a ghast."),
|
||||||
},
|
},
|
||||||
["fall_damage"] = {
|
["fall_damage"] = {
|
||||||
"%s fell from a high cliff.",
|
S("%s fell from a high cliff."),
|
||||||
"%s took fatal fall damage.",
|
S("%s took fatal fall damage."),
|
||||||
"%s fell victim to gravity.",
|
S("%s fell victim to gravity."),
|
||||||
},
|
},
|
||||||
["other"] = {
|
["other"] = {
|
||||||
"%s died.",
|
S("%s died."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local mobkills = {
|
local mobkills = {
|
||||||
["mobs_mc:zombie"] = "%s was killed by a zombie.",
|
["mobs_mc:zombie"] = S("%s was killed by a zombie."),
|
||||||
["mobs_mc:baby_zombie"] = "%s was killed by a baby zombie.",
|
["mobs_mc:baby_zombie"] = S("%s was killed by a baby zombie."),
|
||||||
["mobs_mc:blaze"] = "%s was killed by a blaze.",
|
["mobs_mc:blaze"] = S("%s was killed by a blaze."),
|
||||||
["mobs_mc:slime"] = "%s was killed by a slime.",
|
["mobs_mc:slime"] = S("%s was killed by a slime."),
|
||||||
["mobs_mc:witch"] = "%s was killed by a witch.",
|
["mobs_mc:witch"] = S("%s was killed by a witch."),
|
||||||
["mobs_mc:magma_cube_tiny"] = "%s was killed by a magma cube.",
|
["mobs_mc:magma_cube_tiny"] = S("%s was killed by a magma cube."),
|
||||||
["mobs_mc:magma_cube_small"] = "%s was killed by a magma cube.",
|
["mobs_mc:magma_cube_small"] = S("%s was killed by a magma cube."),
|
||||||
["mobs_mc:magma_cube_big"] = "%s was killed by a magma cube.",
|
["mobs_mc:magma_cube_big"] = S("%s was killed by a magma cube."),
|
||||||
["mobs_mc:wolf"] = "%s was killed by a wolf.",
|
["mobs_mc:wolf"] = S("%s was killed by a wolf."),
|
||||||
["mobs_mc:cat"] = "%s was killed by a cat.",
|
["mobs_mc:cat"] = S("%s was killed by a cat."),
|
||||||
["mobs_mc:ocelot"] = "%s was killed by an ocelot.",
|
["mobs_mc:ocelot"] = S("%s was killed by an ocelot."),
|
||||||
["mobs_mc:ender_dragon"] = "%s was killed by an ender dragon.",
|
["mobs_mc:ender_dragon"] = S("%s was killed by an ender dragon."),
|
||||||
["mobs_mc:wither"] = "%s was killed by a wither.",
|
["mobs_mc:wither"] = S("%s was killed by a wither."),
|
||||||
["mobs_mc:enderman"] = "%s was killed by an enderman.",
|
["mobs_mc:enderman"] = S("%s was killed by an enderman."),
|
||||||
["mobs_mc:endermite"] = "%s was killed by an endermite.",
|
["mobs_mc:endermite"] = S("%s was killed by an endermite."),
|
||||||
["mobs_mc:ghast"] = "%s was killed by a ghast.",
|
["mobs_mc:ghast"] = S("%s was killed by a ghast."),
|
||||||
["mobs_mc:guardian_elder"] = "%s was killed by an elder guardian.",
|
["mobs_mc:guardian_elder"] = S("%s was killed by an elder guardian."),
|
||||||
["mobs_mc:guardian"] = "%s was killed by a guardian.",
|
["mobs_mc:guardian"] = S("%s was killed by a guardian."),
|
||||||
["mobs_mc:iron_golem"] = "%s was killed by an iron golem.",
|
["mobs_mc:iron_golem"] = S("%s was killed by an iron golem."),
|
||||||
["mobs_mc:polar_bear"] = "%s was killed by a polar_bear.",
|
["mobs_mc:polar_bear"] = S("%s was killed by a polar_bear."),
|
||||||
["mobs_mc:killer_bunny"] = "%s was killed by a killer bunny.",
|
["mobs_mc:killer_bunny"] = S("%s was killed by a killer bunny."),
|
||||||
["mobs_mc:shulker"] = "%s was killed by a shulker.",
|
["mobs_mc:shulker"] = S("%s was killed by a shulker."),
|
||||||
["mobs_mc:silverfish"] = "%s was killed by a silverfish.",
|
["mobs_mc:silverfish"] = S("%s was killed by a silverfish."),
|
||||||
["mobs_mc:skeleton"] = "%s was killed by a skeleton.",
|
["mobs_mc:skeleton"] = S("%s was killed by a skeleton."),
|
||||||
["mobs_mc:stray"] = "%s was killed by a stray.",
|
["mobs_mc:stray"] = S("%s was killed by a stray."),
|
||||||
["mobs_mc:slime_tiny"] = "%s was killed by a slime.",
|
["mobs_mc:slime_tiny"] = S("%s was killed by a slime."),
|
||||||
["mobs_mc:slime_small"] = "%s was killed by a slime.",
|
["mobs_mc:slime_small"] = S("%s was killed by a slime."),
|
||||||
["mobs_mc:slime_big"] = "%s was killed by a slime.",
|
["mobs_mc:slime_big"] = S("%s was killed by a slime."),
|
||||||
["mobs_mc:spider"] = "%s was killed by a spider.",
|
["mobs_mc:spider"] = S("%s was killed by a spider."),
|
||||||
["mobs_mc:cave_spider"] = "%s was killed by a cave spider.",
|
["mobs_mc:cave_spider"] = S("%s was killed by a cave spider."),
|
||||||
["mobs_mc:vex"] = "%s was killed by a vex.",
|
["mobs_mc:vex"] = S("%s was killed by a vex."),
|
||||||
["mobs_mc:evoker"] = "%s was killed by an evoker.",
|
["mobs_mc:evoker"] = S("%s was killed by an evoker."),
|
||||||
["mobs_mc:illusioner"] = "%s was killed by an illusioner.",
|
["mobs_mc:illusioner"] = S("%s was killed by an illusioner."),
|
||||||
["mobs_mc:vindicator"] = "%s was killed by a vindicator.",
|
["mobs_mc:vindicator"] = S("%s was killed by a vindicator."),
|
||||||
["mobs_mc:villager_zombie"] = "%s was killed by a zombie villager.",
|
["mobs_mc:villager_zombie"] = S("%s was killed by a zombie villager."),
|
||||||
["mobs_mc:husk"] = "%s was killed by a husk.",
|
["mobs_mc:husk"] = S("%s was killed by a husk."),
|
||||||
["mobs_mc:baby_husk"] = "%s was killed by a baby husk.",
|
["mobs_mc:baby_husk"] = S("%s was killed by a baby husk."),
|
||||||
["mobs_mc:pigman"] = "%s was killed by a zombie pigman.",
|
["mobs_mc:pigman"] = S("%s was killed by a zombie pigman."),
|
||||||
["mobs_mc:baby_pigman"] = "%s was killed by a baby zombie pigman.",
|
["mobs_mc:baby_pigman"] = S("%s was killed by a baby zombie pigman."),
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Select death message
|
-- Select death message
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
mcl_init
|
|
@ -0,0 +1,3 @@
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
player:set_formspec_prepend(mcl_vars.gui_nonbg)
|
||||||
|
end)
|
|
@ -0,0 +1 @@
|
||||||
|
name = mcl_formspec_prepend
|
|
@ -1,3 +1,6 @@
|
||||||
|
local S = minetest.get_translator("mcl_inventory")
|
||||||
|
local F = function(s) return minetest.formspec_escape(S(s)) end
|
||||||
|
|
||||||
-- Prepare player info table
|
-- Prepare player info table
|
||||||
local players = {}
|
local players = {}
|
||||||
|
|
||||||
|
@ -320,29 +323,29 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
|
||||||
player_preview..
|
player_preview..
|
||||||
-- crafting guide button
|
-- crafting guide button
|
||||||
"image_button[9,1;1,1;craftguide_book.png;__mcl_craftguide;]"..
|
"image_button[9,1;1,1;craftguide_book.png;__mcl_craftguide;]"..
|
||||||
"tooltip[__mcl_craftguide;Recipe book]"..
|
"tooltip[__mcl_craftguide;"..F("Recipe book").."]"..
|
||||||
-- help button
|
-- help button
|
||||||
"image_button[9,2;1,1;doc_button_icon_lores.png;__mcl_doc;]"..
|
"image_button[9,2;1,1;doc_button_icon_lores.png;__mcl_doc;]"..
|
||||||
"tooltip[__mcl_doc;Help]"..
|
"tooltip[__mcl_doc;"..F("Help").."]"..
|
||||||
-- skins button
|
-- skins button
|
||||||
"image_button[9,3;1,1;mcl_skins_button.png;__mcl_skins;]"..
|
"image_button[9,3;1,1;mcl_skins_button.png;__mcl_skins;]"..
|
||||||
"tooltip[__mcl_skins;Select player skin]"..
|
"tooltip[__mcl_skins;"..F("Select player skin").."]"..
|
||||||
-- achievements button
|
-- achievements button
|
||||||
"image_button[9,4;1,1;mcl_achievements_button.png;__mcl_achievements;]"..
|
"image_button[9,4;1,1;mcl_achievements_button.png;__mcl_achievements;]"..
|
||||||
"tooltip[__mcl_achievements;Achievements]"
|
"tooltip[__mcl_achievements;"..F("Achievements").."]"
|
||||||
|
|
||||||
-- For shortcuts
|
-- For shortcuts
|
||||||
listrings = listrings ..
|
listrings = listrings ..
|
||||||
"listring[detached:"..playername.."_armor;armor]"..
|
"listring[detached:"..playername.."_armor;armor]"..
|
||||||
"listring[current_player;main]"
|
"listring[current_player;main]"
|
||||||
else
|
else
|
||||||
inv_bg = inv_bg .. "^crafting_inventory_creative_scroll.png"
|
|
||||||
-- Creative inventory slots
|
-- Creative inventory slots
|
||||||
main_list = "list[detached:creative_"..playername..";main;0,1.75;9,5;"..tostring(start_i).."]" ..
|
main_list = "list[detached:creative_"..playername..";main;0,1.75;9,5;"..tostring(start_i).."]" ..
|
||||||
-- ... and scroll bar
|
-- ... and scroll bar
|
||||||
"image_button[9.02,1.76;"..tostring(arrow_height)..",0.6;crafting_creative_up.png;creative_prev;]"..
|
"image[9.033,2.230;0.78,4.525;mcl_inventory_slider_bg.png]"..
|
||||||
"image[9.033," .. tostring(slider_pos) .. ";0.78,"..tostring(slider_height) .. ";crafting_slider.png]"..
|
"image[9.033," .. tostring(slider_pos) .. ";0.78,"..tostring(slider_height) .. ";mcl_inventory_slider.png]"..
|
||||||
"image_button[9.02,6.15;"..tostring(arrow_height)..",0.6;crafting_creative_down.png;creative_next;]"
|
"image_button[9.015,1.77;0.85,0.6;crafting_creative_up.png;creative_prev;]"..
|
||||||
|
"image_button[9.015,6.15;0.85,0.6;crafting_creative_down.png;creative_next;]"
|
||||||
end
|
end
|
||||||
|
|
||||||
local tab_icon = {
|
local tab_icon = {
|
||||||
|
@ -382,35 +385,35 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
|
||||||
"background[-0.19,-0.25;10.5,9.87;"..inv_bg.."]"..
|
"background[-0.19,-0.25;10.5,9.87;"..inv_bg.."]"..
|
||||||
"label[-5,-5;"..name.."]"..
|
"label[-5,-5;"..name.."]"..
|
||||||
tab(name, "blocks") ..
|
tab(name, "blocks") ..
|
||||||
"tooltip[blocks;Building Blocks]"..
|
"tooltip[blocks;"..F("Building Blocks").."]"..
|
||||||
tab(name, "deco") ..
|
tab(name, "deco") ..
|
||||||
"tooltip[deco;Decoration Blocks]"..
|
"tooltip[deco;"..F("Decoration Blocks").."]"..
|
||||||
tab(name, "redstone") ..
|
tab(name, "redstone") ..
|
||||||
"tooltip[redstone;Redstone]"..
|
"tooltip[redstone;"..F("Redstone").."]"..
|
||||||
tab(name, "rail") ..
|
tab(name, "rail") ..
|
||||||
"tooltip[rail;Transportation]"..
|
"tooltip[rail;"..F("Transportation").."]"..
|
||||||
tab(name, "misc") ..
|
tab(name, "misc") ..
|
||||||
"tooltip[misc;Miscellaneous]"..
|
"tooltip[misc;"..F("Miscellaneous").."]"..
|
||||||
tab(name, "nix") ..
|
tab(name, "nix") ..
|
||||||
"tooltip[nix;Search Items]"..
|
"tooltip[nix;"..F("Search Items").."]"..
|
||||||
fnt..
|
fnt..
|
||||||
"list[current_player;main;0,7;9,1;]"..
|
"list[current_player;main;0,7;9,1;]"..
|
||||||
main_list..
|
main_list..
|
||||||
tab(name, "food") ..
|
tab(name, "food") ..
|
||||||
"tooltip[food;Foodstuffs]"..
|
"tooltip[food;"..F("Foodstuffs").."]"..
|
||||||
tab(name, "tools") ..
|
tab(name, "tools") ..
|
||||||
"tooltip[tools;Tools]"..
|
"tooltip[tools;"..F("Tools").."]"..
|
||||||
tab(name, "combat") ..
|
tab(name, "combat") ..
|
||||||
"tooltip[combat;Combat]"..
|
"tooltip[combat;"..F("Combat").."]"..
|
||||||
tab(name, "mobs") ..
|
tab(name, "mobs") ..
|
||||||
"tooltip[mobs;Mobs]"..
|
"tooltip[mobs;"..F("Mobs").."]"..
|
||||||
-- TODO: Add brew
|
-- TODO: Add brew
|
||||||
--tab(name, "brew") ..
|
--tab(name, "brew") ..
|
||||||
--"tooltip[brew;Brewing]"..
|
--"tooltip[brew;"..F("Brewing").."]"..
|
||||||
tab(name, "matr") ..
|
tab(name, "matr") ..
|
||||||
"tooltip[matr;Materials]"..
|
"tooltip[matr;"..F("Materials").."]"..
|
||||||
tab(name, "inv") ..
|
tab(name, "inv") ..
|
||||||
"tooltip[inv;Survival Inventory]"..
|
"tooltip[inv;"..F("Survival Inventory").."]"..
|
||||||
"list[detached:trash;main;9,7;1,1;]"..
|
"list[detached:trash;main;9,7;1,1;]"..
|
||||||
"image[9,7;1,1;crafting_creative_trash.png]"..
|
"image[9,7;1,1;crafting_creative_trash.png]"..
|
||||||
listrings
|
listrings
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
local S = minetest.get_translator("mcl_inventory")
|
||||||
|
local F = function(s) return minetest.formspec_escape(S(s)) end
|
||||||
|
|
||||||
mcl_inventory = {}
|
mcl_inventory = {}
|
||||||
|
|
||||||
local show_armor = minetest.get_modpath("3d_armor") ~= nil
|
local show_armor = minetest.get_modpath("3d_armor") ~= nil
|
||||||
|
@ -20,7 +23,7 @@ local function return_item(itemstack, dropper, pos, inv)
|
||||||
v.x = v.x*4
|
v.x = v.x*4
|
||||||
v.y = v.y*4 + 2
|
v.y = v.y*4 + 2
|
||||||
v.z = v.z*4
|
v.z = v.z*4
|
||||||
obj:setvelocity(v)
|
obj:set_velocity(v)
|
||||||
obj:get_luaentity()._insta_collect = false
|
obj:get_luaentity()._insta_collect = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -101,16 +104,16 @@ local function set_inventory(player, armor_change_only)
|
||||||
"list[current_player;craftpreview;7,1.5;1,1;]"..
|
"list[current_player;craftpreview;7,1.5;1,1;]"..
|
||||||
-- crafting guide button
|
-- crafting guide button
|
||||||
"image_button[4.5,3;1,1;craftguide_book.png;__mcl_craftguide;]"..
|
"image_button[4.5,3;1,1;craftguide_book.png;__mcl_craftguide;]"..
|
||||||
"tooltip[__mcl_craftguide;Recipe book]"..
|
"tooltip[__mcl_craftguide;"..F("Recipe book").."]"..
|
||||||
-- help button
|
-- help button
|
||||||
"image_button[8,3;1,1;doc_button_icon_lores.png;__mcl_doc;]"..
|
"image_button[8,3;1,1;doc_button_icon_lores.png;__mcl_doc;]"..
|
||||||
"tooltip[__mcl_doc;Help]"..
|
"tooltip[__mcl_doc;"..F("Help").."]"..
|
||||||
-- skins button
|
-- skins button
|
||||||
"image_button[3,3;1,1;mcl_skins_button.png;__mcl_skins;]"..
|
"image_button[3,3;1,1;mcl_skins_button.png;__mcl_skins;]"..
|
||||||
"tooltip[__mcl_skins;Select player skin]"..
|
"tooltip[__mcl_skins;"..F("Select player skin").."]"..
|
||||||
-- achievements button
|
-- achievements button
|
||||||
"image_button[7,3;1,1;mcl_achievements_button.png;__mcl_achievements;]"..
|
"image_button[7,3;1,1;mcl_achievements_button.png;__mcl_achievements;]"..
|
||||||
"tooltip[__mcl_achievements;Achievements]"..
|
"tooltip[__mcl_achievements;"..F("Achievements").."]"..
|
||||||
-- for shortcuts
|
-- for shortcuts
|
||||||
"listring[current_player;main]"..
|
"listring[current_player;main]"..
|
||||||
"listring[current_player;craft]"..
|
"listring[current_player;craft]"..
|
||||||
|
|
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 70 B |
After Width: | Height: | Size: 881 B |
After Width: | Height: | Size: 1.1 KiB |
|
@ -1,3 +1,5 @@
|
||||||
|
local S = minetest.get_translator("mcl_comparators")
|
||||||
|
|
||||||
-- Functions that get the input/output rules of the comparator
|
-- Functions that get the input/output rules of the comparator
|
||||||
|
|
||||||
local comparator_get_output_rules = function(node)
|
local comparator_get_output_rules = function(node)
|
||||||
|
@ -223,25 +225,20 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
|
||||||
-- Help
|
-- Help
|
||||||
local longdesc, usagehelp, use_help
|
local longdesc, usagehelp, use_help
|
||||||
if state_strs[state] == "off" and mode == "comp" then
|
if state_strs[state] == "off" and mode == "comp" then
|
||||||
longdesc = "Redstone comparators are multi-purpose redstone components. "..
|
longdesc = S("Redstone comparators are multi-purpose redstone components.").."\n"..
|
||||||
"They can transmit a redstone signal, detect whether a block contains any items and compare multiple signals."
|
S("They can transmit a redstone signal, detect whether a block contains any items and compare multiple signals.")
|
||||||
|
|
||||||
usagehelp = "A redstone comparator has 1 main input, 2 side inputs and 1 output. The output is in "..
|
usagehelp = S("A redstone comparator has 1 main input, 2 side inputs and 1 output. The output is in arrow direction, the main input is in the opposite direction. The other 2 sides are the side inputs.").."\n"..
|
||||||
"arrow direction, the main input is in the opposite direction. The other 2 sides are the side inputs.".."\n"..
|
S("The main input can powered in 2 ways: First, it can be powered directly by redstone power like any other component. Second, it is powered if, and only if a container (like a chest) is placed in front of it and the container contains at least one item.").."\n"..
|
||||||
"The main input can powered in 2 ways: First, it can be powered directly by redstone power like any other component. Second, it is powered if, and only if a container (like chest) is placed in front of it and the container contains at least one item."..
|
S("The side inputs are only powered by normal redstone power. The redstone can operate in two modes: Transmission mode and subtraction mode. It starts in transmission mode and the mode can be changed by a rightclick.").."\n\n"..
|
||||||
"The side inputs are only powered by normal redstone power."..
|
S("Transmission mode:\nThe front torch is unlit and lowered. The output is powered if, and only if the main input is powered. The two side inputs are ignored.").."\n"..
|
||||||
"The redstone can operate in two modes: Transmission mode and subtraction mode. It "..
|
S("Subtraction mode:\nThe front torch is lit. The output is powered if, and only if the main input is powered and none of the side inputs is powered.")
|
||||||
"starts in transmission mode and the mode can be changed by a rightclick.".."\n\n"..
|
|
||||||
"Transmission mode:"..
|
|
||||||
"The front torch is unlit and lowered. The output is powered if, and only if the main input is powered. The two side inputs are ignored.".."\n"..
|
|
||||||
"Subtraction mode:"..
|
|
||||||
"The front torch is lit. The output is powered if, and only if the main input is powered and none of the side inputs is powered."
|
|
||||||
else
|
else
|
||||||
use_help = false
|
use_help = false
|
||||||
end
|
end
|
||||||
|
|
||||||
local nodedef = {
|
local nodedef = {
|
||||||
description = "Redstone Comparator",
|
description = S("Redstone Comparator"),
|
||||||
inventory_image = icon,
|
inventory_image = icon,
|
||||||
wield_image = icon,
|
wield_image = icon,
|
||||||
_doc_items_create_entry = use_help,
|
_doc_items_create_entry = use_help,
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
All node definitions share a lot of code, so this is the reason why there
|
All node definitions share a lot of code, so this is the reason why there
|
||||||
are so many weird tables below.
|
are so many weird tables below.
|
||||||
]]
|
]]
|
||||||
|
local S = minetest.get_translator("mcl_dispensers")
|
||||||
|
|
||||||
-- For after_place_node
|
-- For after_place_node
|
||||||
local setup_dispenser = function(pos)
|
local setup_dispenser = function(pos)
|
||||||
|
@ -281,13 +282,13 @@ local dispenserdef = {
|
||||||
-- Horizontal dispenser
|
-- Horizontal dispenser
|
||||||
|
|
||||||
local horizontal_def = table.copy(dispenserdef)
|
local horizontal_def = table.copy(dispenserdef)
|
||||||
horizontal_def.description = "Dispenser"
|
horizontal_def.description = S("Dispenser")
|
||||||
horizontal_def._doc_items_longdesc = "A dispenser is a block which acts as a redstone component which, when powered with redstone power, dispenses an item. It has a container with 9 inventory slots."
|
horizontal_def._doc_items_longdesc = S("A dispenser is a block which acts as a redstone component which, when powered with redstone power, dispenses an item. It has a container with 9 inventory slots.")
|
||||||
horizontal_def._doc_items_usagehelp = [[Place the dispenser in one of 6 possible directions. The “hole” is where items will fly out of the dispenser. Rightclick the dispenser to access its inventory. Insert the items you wish to dispense. Supply the dispenser with redstone energy once to dispense a single random item.
|
horizontal_def._doc_items_usagehelp = S("Place the dispenser in one of 6 possible directions. The “hole” is where items will fly out of the dispenser. Rightclick the dispenser to access its inventory. Insert the items you wish to dispense. Supply the dispenser with redstone energy once to dispense a single random item.").."\n\n"..
|
||||||
|
|
||||||
The dispenser will do different things, depending on the dispensed item:
|
S("The dispenser will do different things, depending on the dispensed item:").."\n\n"..
|
||||||
|
|
||||||
• Arrows: Are launched
|
S([[• Arrows: Are launched
|
||||||
• Eggs and snowballs: Are thrown
|
• Eggs and snowballs: Are thrown
|
||||||
• Fire charges: Are fired in a straight line
|
• Fire charges: Are fired in a straight line
|
||||||
• Armor: Will be equipped to players and armor stands
|
• Armor: Will be equipped to players and armor stands
|
||||||
|
@ -301,7 +302,7 @@ The dispenser will do different things, depending on the dispensed item:
|
||||||
• TNT: Is placed and ignited
|
• TNT: Is placed and ignited
|
||||||
• Flint and steel: Is used to ignite a fire in air and to ignite TNT
|
• Flint and steel: Is used to ignite a fire in air and to ignite TNT
|
||||||
• Spawn eggs: Will summon the mob they contain
|
• Spawn eggs: Will summon the mob they contain
|
||||||
• Other items: Are simply dropped]]
|
• Other items: Are simply dropped]])
|
||||||
|
|
||||||
horizontal_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
|
horizontal_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
setup_dispenser(pos)
|
setup_dispenser(pos)
|
||||||
|
@ -319,7 +320,7 @@ minetest.register_node("mcl_dispensers:dispenser", horizontal_def)
|
||||||
|
|
||||||
-- Down dispenser
|
-- Down dispenser
|
||||||
local down_def = table.copy(dispenserdef)
|
local down_def = table.copy(dispenserdef)
|
||||||
down_def.description = "Downwards-Facing Dispenser"
|
down_def.description = S("Downwards-Facing Dispenser")
|
||||||
down_def.after_place_node = setup_dispenser
|
down_def.after_place_node = setup_dispenser
|
||||||
down_def.tiles = {
|
down_def.tiles = {
|
||||||
"default_furnace_top.png", "mcl_dispensers_dispenser_front_vertical.png",
|
"default_furnace_top.png", "mcl_dispensers_dispenser_front_vertical.png",
|
||||||
|
@ -334,7 +335,7 @@ minetest.register_node("mcl_dispensers:dispenser_down", down_def)
|
||||||
-- Up dispenser
|
-- Up dispenser
|
||||||
-- The up dispenser is almost identical to the down dispenser , it only differs in textures
|
-- The up dispenser is almost identical to the down dispenser , it only differs in textures
|
||||||
local up_def = table.copy(down_def)
|
local up_def = table.copy(down_def)
|
||||||
up_def.description = "Upwards-Facing Dispenser"
|
up_def.description = S("Upwards-Facing Dispenser")
|
||||||
up_def.tiles = {
|
up_def.tiles = {
|
||||||
"mcl_dispensers_dispenser_front_vertical.png", "default_furnace_bottom.png",
|
"mcl_dispensers_dispenser_front_vertical.png", "default_furnace_bottom.png",
|
||||||
"default_furnace_side.png", "default_furnace_side.png",
|
"default_furnace_side.png", "default_furnace_side.png",
|
||||||
|
|
|
@ -8,6 +8,8 @@ All node definitions share a lot of code, so this is the reason why there
|
||||||
are so many weird tables below.
|
are so many weird tables below.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
local S = minetest.get_translator("mcl_droppers")
|
||||||
|
|
||||||
-- For after_place_node
|
-- For after_place_node
|
||||||
local setup_dropper = function(pos)
|
local setup_dropper = function(pos)
|
||||||
-- Set formspec and inventory
|
-- Set formspec and inventory
|
||||||
|
@ -144,9 +146,9 @@ local dropperdef = {
|
||||||
-- Horizontal dropper
|
-- Horizontal dropper
|
||||||
|
|
||||||
local horizontal_def = table.copy(dropperdef)
|
local horizontal_def = table.copy(dropperdef)
|
||||||
horizontal_def.description = "Dropper"
|
horizontal_def.description = S("Dropper")
|
||||||
horizontal_def._doc_items_longdesc = "A dropper is a redstone component and a container with 9 inventory slots which, when supplied with redstone power, drops an item or puts it into a container in front of it."
|
horizontal_def._doc_items_longdesc = S("A dropper is a redstone component and a container with 9 inventory slots which, when supplied with redstone power, drops an item or puts it into a container in front of it.")
|
||||||
horizontal_def._doc_items_usagehelp = "Droppers can be placed in 6 possible directions, items will be dropped out of the hole. Rightclick the dropper to access its inventory. Supply it with redstone energy once to make the dropper drop or transfer a random item."
|
horizontal_def._doc_items_usagehelp = S("Droppers can be placed in 6 possible directions, items will be dropped out of the hole. Rightclick the dropper to access its inventory. Supply it with redstone energy once to make the dropper drop or transfer a random item.")
|
||||||
horizontal_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
|
horizontal_def.after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||||
setup_dropper(pos)
|
setup_dropper(pos)
|
||||||
orientate_dropper(pos, placer)
|
orientate_dropper(pos, placer)
|
||||||
|
@ -163,7 +165,7 @@ minetest.register_node("mcl_droppers:dropper", horizontal_def)
|
||||||
|
|
||||||
-- Down dropper
|
-- Down dropper
|
||||||
local down_def = table.copy(dropperdef)
|
local down_def = table.copy(dropperdef)
|
||||||
down_def.description = "Downwards-Facing Dropper"
|
down_def.description = S("Downwards-Facing Dropper")
|
||||||
down_def.after_place_node = setup_dropper
|
down_def.after_place_node = setup_dropper
|
||||||
down_def.tiles = {
|
down_def.tiles = {
|
||||||
"default_furnace_top.png", "mcl_droppers_dropper_front_vertical.png",
|
"default_furnace_top.png", "mcl_droppers_dropper_front_vertical.png",
|
||||||
|
@ -178,7 +180,7 @@ minetest.register_node("mcl_droppers:dropper_down", down_def)
|
||||||
-- Up dropper
|
-- Up dropper
|
||||||
-- The up dropper is almost identical to the down dropper, it only differs in textures
|
-- The up dropper is almost identical to the down dropper, it only differs in textures
|
||||||
local up_def = table.copy(down_def)
|
local up_def = table.copy(down_def)
|
||||||
up_def.description = "Upwards-Facing Dropper"
|
up_def.description = S("Upwards-Facing Dropper")
|
||||||
up_def.tiles = {
|
up_def.tiles = {
|
||||||
"mcl_droppers_dropper_front_vertical.png", "default_furnace_bottom.png",
|
"mcl_droppers_dropper_front_vertical.png", "default_furnace_bottom.png",
|
||||||
"default_furnace_side.png", "default_furnace_side.png",
|
"default_furnace_side.png", "default_furnace_side.png",
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local S = minetest.get_translator("mcl_observers")
|
||||||
|
|
||||||
local rules_flat = {
|
local rules_flat = {
|
||||||
{ x = 0, y = 0, z = -1, spread = true },
|
{ x = 0, y = 0, z = -1, spread = true },
|
||||||
}
|
}
|
||||||
|
@ -84,9 +86,9 @@ mesecon.register_node("mcl_observers:observer",
|
||||||
_mcl_hardness = 3.5,
|
_mcl_hardness = 3.5,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description = "Observer",
|
description = S("Observer"),
|
||||||
_doc_items_longdesc = "An observer is a redstone component which observes the block in front of it and sends a very short redstone pulse whenever this block changes.",
|
_doc_items_longdesc = S("An observer is a redstone component which observes the block in front of it and sends a very short redstone pulse whenever this block changes."),
|
||||||
_doc_items_usagehelp = "Place the observer directly in front of the block you want to observe with the “face” looking at the block. The arrow shows you the side of the output, which is at the opposite side of the “face”. The arrow points to it. You need to place your redstone wire or any other component you want to power here.",
|
_doc_items_usagehelp = S("Place the observer directly in front of the block you want to observe with the “face” looking at the block. The arrow shows you the side of the output, which is at the opposite side of the “face”. The arrow points to it. You need to place your redstone wire or any other component you want to power here."),
|
||||||
groups = {pickaxey=1, material_stone=1, not_opaque=1, },
|
groups = {pickaxey=1, material_stone=1, not_opaque=1, },
|
||||||
tiles = {
|
tiles = {
|
||||||
"mcl_observers_observer_top.png^[transformR180", "default_furnace_bottom.png",
|
"mcl_observers_observer_top.png^[transformR180", "default_furnace_bottom.png",
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
local S = minetest.get_translator("mesecons_commandblock")
|
||||||
|
|
||||||
local function construct(pos)
|
local function construct(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
@ -183,33 +184,27 @@ local on_place = function(itemstack, placer, pointed_thing)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("mesecons_commandblock:commandblock_off", {
|
minetest.register_node("mesecons_commandblock:commandblock_off", {
|
||||||
description = "Command Block",
|
description = S("Command Block"),
|
||||||
|
|
||||||
_doc_items_longdesc =
|
_doc_items_longdesc =
|
||||||
"Command blocks are mighty redstone components which are able to alter reality itself. In other words, they cause the server to execute server commands when they are supplied with redstone power.",
|
S("Command blocks are mighty redstone components which are able to alter reality itself. In other words, they cause the server to execute server commands when they are supplied with redstone power."),
|
||||||
_doc_items_usagehelp =
|
_doc_items_usagehelp =
|
||||||
[[To use an already existing command block, just supply it with redstone power and see what happens. This will execute the commands once. To execute the commands again, turn the redstone power off and on again.
|
S("To use an already existing command block, just supply it with redstone power and see what happens. This will execute the commands once. To execute the commands again, turn the redstone power off and on again.").."\n\n"..
|
||||||
|
|
||||||
To place a command block and change the commands, you need to be in Creative Mode and must have the “maphack” privilege. A new command block does not have any commands and does nothing. Rightclick the command block (in Creative Mode!) to edit its commands. Read the help entry “Advanced topics > Server Commands” to understand how they work. Each line contains a single command. You enter them like you would in the console, but without the leading slash. The commands will be executed from top to bottom.
|
S("To place a command block and change the commands, you need to be in Creative Mode and must have the “maphack” privilege. A new command block does not have any commands and does nothing. Rightclick the command block (in Creative Mode!) to edit its commands. Read the help entry “Advanced topics > Server Commands” to understand how they work. Each line contains a single command. You enter them like you would in the console, but without the leading slash. The commands will be executed from top to bottom.").."\n\n"..
|
||||||
|
|
||||||
All commands will be executed on behalf of the player who placed the command block, as if the player typed in the commands. This player is said to be the “commander” of the block.
|
S("All commands will be executed on behalf of the player who placed the command block, as if the player typed in the commands. This player is said to be the “commander” of the block.").."\n\n"..
|
||||||
|
|
||||||
Command blocks support placeholders, insert one of these placerholders and they will be replaced by a player name:
|
S("Command blocks support placeholders, insert one of these placerholders and they will be replaced by a player name:").."\n"..
|
||||||
• “@c”: commander of this command block
|
S("• “@c”: commander of this command block").."\n"..
|
||||||
• “@n” or “@p”: nearest player from the command block
|
S("• “@n” or “@p”: nearest player from the command block").."\n"..
|
||||||
• “@f” farthest player from the command block
|
S("• “@f” farthest player from the command block").."\n"..
|
||||||
• “@r”: random player currently in the world
|
S("• “@r”: random player currently in the world").."\n"..
|
||||||
• “@@”: literal “@” sign
|
S("• “@@”: literal “@” sign").."\n\n"..
|
||||||
|
|
||||||
Example 1:
|
S("Example 1:\n time 12000\nSets the game clock to 12:00").."\n\n"..
|
||||||
time 12000
|
|
||||||
|
|
||||||
Sets the game clock to 12:00
|
S("Example 2:\n give @n mcl_core:apple 5\n→ Gives the nearest player 5 apples"),
|
||||||
|
|
||||||
Example 2:
|
|
||||||
give @n mcl_core:apple 5
|
|
||||||
|
|
||||||
→ Gives the nearest player 5 apples]],
|
|
||||||
|
|
||||||
tiles = {{name="jeija_commandblock_off.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=2}}},
|
tiles = {{name="jeija_commandblock_off.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=2}}},
|
||||||
groups = {creative_breakable=1, mesecon_effector_off=1},
|
groups = {creative_breakable=1, mesecon_effector_off=1},
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
local S = minetest.get_translator("mesecons_delayer")
|
||||||
|
|
||||||
local DELAYS = { 0.1, 0.2, 0.3, 0.4 }
|
local DELAYS = { 0.1, 0.2, 0.3, 0.4 }
|
||||||
local DEFAULT_DELAY = DELAYS[1]
|
local DEFAULT_DELAY = DELAYS[1]
|
||||||
|
|
||||||
|
@ -182,9 +184,9 @@ end
|
||||||
local help, longdesc, usagehelp, icon, on_construct
|
local help, longdesc, usagehelp, icon, on_construct
|
||||||
if i == 1 then
|
if i == 1 then
|
||||||
help = true
|
help = true
|
||||||
longdesc = "Redstone repeaters are versatile redstone components with multiple purposes: 1. They only allow signals to travel in one direction. 2. They delay the signal. 3. Optionally, they can lock their output in one state."
|
longdesc = S("Redstone repeaters are versatile redstone components with multiple purposes: 1. They only allow signals to travel in one direction. 2. They delay the signal. 3. Optionally, they can lock their output in one state.")
|
||||||
usagehelp = "To power a redstone repeater, send a signal in “arrow” direction (the input). The signal goes out on the opposite side (the output) with a delay. To change the delay, rightclick the redstone repeater. The delay is between 0.1 and 0.4 seconds long and can be changed in steps of 0.1 seconds. It is indicated by the position of the moving redstone torch.".."\n"..
|
usagehelp = S("To power a redstone repeater, send a signal in “arrow” direction (the input). The signal goes out on the opposite side (the output) with a delay. To change the delay, rightclick the redstone repeater. The delay is between 0.1 and 0.4 seconds long and can be changed in steps of 0.1 seconds. It is indicated by the position of the moving redstone torch.").."\n"..
|
||||||
"To lock a repeater, send a signal from an adjacent repeater into one of its sides. While locked, the moving redstone torch disappears, the output doesn't change and the input signal is ignored."
|
S("To lock a repeater, send a signal from an adjacent repeater into one of its sides. While locked, the moving redstone torch disappears, the output doesn't change and the input signal is ignored.")
|
||||||
icon = "mesecons_delayer_item.png"
|
icon = "mesecons_delayer_item.png"
|
||||||
|
|
||||||
-- Check sides of constructed repeater and lock it, if required
|
-- Check sides of constructed repeater and lock it, if required
|
||||||
|
@ -219,7 +221,7 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
|
minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
|
||||||
description = "Redstone Repeater",
|
description = S("Redstone Repeater"),
|
||||||
inventory_image = icon,
|
inventory_image = icon,
|
||||||
wield_image = icon,
|
wield_image = icon,
|
||||||
_doc_items_create_entry = help,
|
_doc_items_create_entry = help,
|
||||||
|
@ -292,7 +294,7 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
|
minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), {
|
||||||
description = "Redstone Repeater (Powered)",
|
description = S("Redstone Repeater (Powered)"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {
|
tiles = {
|
||||||
|
@ -366,7 +368,7 @@ end
|
||||||
-- Locked repeater
|
-- Locked repeater
|
||||||
|
|
||||||
minetest.register_node("mesecons_delayer:delayer_off_locked", {
|
minetest.register_node("mesecons_delayer:delayer_off_locked", {
|
||||||
description = "Redstone Repeater (Locked)",
|
description = S("Redstone Repeater (Locked)"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
-- FIXME: Textures of torch and the lock bar overlap. Nodeboxes are (sadly) not suitable for this.
|
-- FIXME: Textures of torch and the lock bar overlap. Nodeboxes are (sadly) not suitable for this.
|
||||||
|
@ -420,7 +422,7 @@ minetest.register_node("mesecons_delayer:delayer_off_locked", {
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("mesecons_delayer:delayer_on_locked", {
|
minetest.register_node("mesecons_delayer:delayer_on_locked", {
|
||||||
description = "Redstone Repeater (Locked, Powered)",
|
description = S("Redstone Repeater (Locked, Powered)"),
|
||||||
_doc_items_create_entry = false,
|
_doc_items_create_entry = false,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = {
|
tiles = {
|
||||||
|
|