Compare commits

...

44 Commits
0.48 ... master

Author SHA1 Message Date
Thndr 7f0ddeb977 Upload files to 'tools' 2019-03-10 17:15:01 +00:00
Thndr 1bd68ed5e9 Upload files to 'tools' 2019-03-10 14:36:07 +00:00
Thndr 5bc542df78 Upload files to 'tools' 2019-03-10 06:15:21 +00:00
Thndr ab996632c4 Upload files to 'tools' 2019-03-10 06:12:31 +00:00
Thndr f3ccef05c5 Upload files to 'tools' 2019-03-08 22:19:54 +00:00
Thndr 09eaa443d7 Update conversion_table.csv
Added in Source/Target game columns. At the moment using GAMENAME(game/mod name) eg Minecraft(base) Minetest(MineClone2)
2019-03-08 19:56:39 +00:00
Thndr 31b7e406d2 Updating conversion CSV with unique names per line
In order to prepare the dataset for being used in a more comprehensive conversion tool, the CSV must have a unique name per object/line to ensure that every object that needs a texture, even if a duplicate from already existing textures, is accounted for.
2019-03-08 01:11:22 +00:00
Wuzzy 3cfdb85926 New translation system, part 11: Redstone 2019-03-08 01:07:41 +01:00
Wuzzy 44fcf6eb34 New translation system, part 10: Armor 2019-03-08 00:51:45 +01:00
Wuzzy f9b557c2ba New translation system, part 9: Items, part 5 2019-03-08 00:46:35 +01:00
Wuzzy 47c817d75a New translation system, part 8: Items, part 4 2019-03-08 00:22:28 +01:00
Wuzzy a29626881f New translation system, part 7: Items, part 3 2019-03-08 00:00:09 +01:00
Wuzzy e4fbbeddb2 New translation system, part 6: Items, part 2 2019-03-07 23:40:57 +01:00
Wuzzy 1df3d0e42b Fix some PseudRandom weirdness in mcl_structures 2019-03-07 22:03:34 +01:00
Wuzzy 1cb142ec5f Fix crasher in mcl_inventory 2019-03-07 22:01:45 +01:00
Wuzzy 342202c979 New translation system, part 5: Items, part 1 2019-03-07 21:36:21 +01:00
Wuzzy 0cc038c545 New translation system, part 4: Misc/Player 2019-03-07 21:36:06 +01:00
Wuzzy 0d6610dcee New translation system, part 3: HUD 2019-03-07 21:36:06 +01:00
Wuzzy d691490016 New translation system, part 2: Environment, help 2019-03-07 21:36:00 +01:00
Wuzzy 1217d9fa88 New translation system, part 1: entities 2019-03-07 20:43:39 +01:00
Wuzzy e0418553a6 Version 0.49.0 2019-03-07 13:51:21 +01:00
Wuzzy 3edf880301 Add minimal formspec prepend 2019-03-07 13:05:26 +01:00
Wuzzy a84f7935fa Revert "Utilize formspec prepend"
This reverts commit ea0c2e9568.
2019-03-07 12:42:08 +01:00
Wuzzy 26c9150591 Revert "Use formspec prepend for real"
This reverts commit 3ca01c3149.
2019-03-07 12:42:06 +01:00
Wuzzy 720bc6a56f Revert "Move mcl_formspec_prepend"
This reverts commit 581f0fa2dd.
2019-03-07 12:41:59 +01:00
Wuzzy dcba7e2325 Del. unneeded doc_identifier support 4 armorstand 2019-03-07 04:04:21 +01:00
Wuzzy 66c6b373a5 Make many entities non-pointable 2019-03-07 03:53:06 +01:00
Wuzzy 7ca999626d Restrict v6 generation of ice spikes to snow block 2019-03-06 23:17:06 +01:00
Wuzzy 5e5dcfaaa3 Tweak scrollbar in creative inventory 2019-03-06 08:40:04 +01:00
Wuzzy 05e3a616b4 Fix broken skin init 2019-03-06 07:49:14 +01:00
Wuzzy cfac33a94f Fix settable hand 2019-03-06 07:32:22 +01:00
Wuzzy 581f0fa2dd Move mcl_formspec_prepend 2019-03-06 07:32:13 +01:00
Wuzzy 0b9c0d177c Fix bug in mcl_player.player.get_preview 2019-03-06 07:15:53 +01:00
Wuzzy 3ca01c3149 Use formspec prepend for real 2019-03-06 06:38:25 +01:00
Wuzzy ea0c2e9568 Utilize formspec prepend 2019-03-06 06:35:24 +01:00
Wuzzy 98b3003e07 Fix mcl_meshhand race condition 2019-03-06 06:25:03 +01:00
Wuzzy c4558a31ab Update modpack meta files (MT 5.0.0) 2019-03-06 05:52:31 +01:00
Wuzzy 2b3922c972 Replace deprecated player attribute calls 2019-03-06 05:45:16 +01:00
Wuzzy 4c8433b41c Fix clouds speed parameter (MT 5.0.0) 2019-03-06 05:21:05 +01:00
Wuzzy 149d1450ef Remove console spam from mcl_loot 2019-03-06 05:14:31 +01:00
Wuzzy a9776814a6 Fix player attachment offsets 2019-03-06 05:11:49 +01:00
Wuzzy 4f8377b161 Fix warning in tsm_railcorridors 2019-03-06 05:07:42 +01:00
Wuzzy 2f74aea6f5 Replace deprecated functions 2019-03-06 04:38:57 +01:00
Wuzzy b31a717410 Fix player model for MT 5.0.0 2019-03-06 04:10:40 +01:00
217 changed files with 3789 additions and 1905 deletions

View File

@ -2,7 +2,7 @@
An unofficial Minecraft-like game for Minetest. Forked from MineClone by daredevils.
Developed by Wuzzy and contributors. Not developed or endorsed by Mojang AB.
Version: 0.48.0
Version: 0.49.0
### Gameplay
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`
## Installation
This game requires [Minetest](http://minetest.net) to run
(version 0.4.16 or 0.4.17).
So you need to install Minetest first. Only stable versions of Minetest are
officially supported. Minetest 5.0.0 (when released) will NOT be supported (yet).
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
your Minetest data directory. Consult the help of Minetest to learn more.
This game requires [Minetest](http://minetest.net) to run (version 5.0.0 or
later). So you need to install Minetest first. Only stable versions of Minetest
are officially supported.
There is no support for running MineClone 2 in development versions of Minetest.
To install MineClone 2 (if you haven't already), move this directory into the
“games” directory of your Minetest data directory. Consult the help of
Minetest to learn more.
## Project description
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.

View File

@ -1,12 +1,16 @@
-- Some global variables (don't overwrite them!)
mcl_vars = {}
--- GUI / inventory menu colors
--- GUI / inventory menu settings
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_img = ""
mcl_vars.inventory_header = mcl_vars.gui_slots .. mcl_vars.gui_bg
mcl_vars.inventory_header = mcl_vars.gui_bg
-- Mapgen variables
local mg_name = minetest.get_mapgen_setting("mg_name")

View File

@ -114,9 +114,6 @@ local function get_random_slots(max_slot)
table.insert(slots_out, slots[r])
table.remove(slots, r)
end
for s=1, #slots_out do
print(slots_out[s])
end
return slots_out
end

View File

View File

@ -13,6 +13,7 @@ minetest.register_entity("drippingwater:drop_water", {
physical = true,
collide_with_objects = false,
collisionbox = {0,0,0,0,0,0},
pointable = false,
visual = "cube",
visual_size = {x=0.05, y=0.1},
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},
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,
on_step = function(self, dtime)
@ -28,11 +29,11 @@ minetest.register_entity("drippingwater:drop_water", {
local ownpos = self.object:get_pos()
if k==1 then
self.object:setacceleration({x=0, y=-5, z=0})
self.object:set_acceleration({x=0, y=-5, z=0})
end
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
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},
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,
on_step = function(self, dtime)
@ -66,11 +67,11 @@ minetest.register_entity("drippingwater:drop_lava", {
local ownpos = self.object:get_pos()
if k==1 then
self.object:setacceleration({x=0, y=-5, z=0})
self.object:set_acceleration({x=0, y=-5, z=0})
end
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

View File

@ -1,3 +1,4 @@
local S = minetest.get_translator("mcl_boats")
--
-- Helper functions
--
@ -69,7 +70,7 @@ function boat.on_rightclick(self, clicker)
mcl_player.player_set_animation(clicker, "stand" , 30)
local pos = clicker:get_pos()
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
clicker:setpos(pos)
clicker:set_pos(pos)
elseif not self._driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
@ -82,7 +83,7 @@ function boat.on_rightclick(self, clicker)
end
self._driver = clicker
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 })
mcl_player.player_attached[name] = true
minetest.after(0.2, function(name)
@ -91,7 +92,7 @@ function boat.on_rightclick(self, clicker)
mcl_player.player_set_animation(player, "sit" , 30)
end
end, name)
clicker:set_look_horizontal(self.object:getyaw())
clicker:set_look_horizontal(self.object:get_yaw())
end
end
@ -143,10 +144,10 @@ function boat.on_punch(self, puncher)
end
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
local ctrl = self._driver:get_player_control()
local yaw = self.object:getyaw()
local yaw = self.object:get_yaw()
if ctrl.up then
-- Forwards
self._v = self._v + 0.1
@ -174,15 +175,15 @@ function boat.on_step(self, dtime)
end
if ctrl.left then
if self._v < 0 then
self.object:setyaw(yaw - (1 + dtime) * 0.03)
self.object:set_yaw(yaw - (1 + dtime) * 0.03)
else
self.object:setyaw(yaw + (1 + dtime) * 0.03)
self.object:set_yaw(yaw + (1 + dtime) * 0.03)
end
elseif ctrl.right then
if self._v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03)
self.object:set_yaw(yaw + (1 + dtime) * 0.03)
else
self.object:setyaw(yaw - (1 + dtime) * 0.03)
self.object:set_yaw(yaw - (1 + dtime) * 0.03)
end
end
else
@ -192,15 +193,15 @@ function boat.on_step(self, dtime)
self._animation = 0
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
self.object:setpos(self.object:get_pos())
self.object:set_pos(self.object:get_pos())
return
end
local s = get_sign(self._v)
self._v = self._v - 0.02 * s
if s ~= get_sign(self._v) then
self.object:setvelocity({x = 0, y = 0, z = 0})
self.object:set_velocity({x = 0, y = 0, z = 0})
self._v = 0
return
end
@ -220,13 +221,13 @@ function boat.on_step(self, dtime)
else
new_acce = {x = 0, y = -9.8, z = 0}
end
new_velo = get_velocity(self._v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:get_pos())
new_velo = get_velocity(self._v, self.object:get_yaw(),
self.object:get_velocity().y)
self.object:set_pos(self.object:get_pos())
else
p.y = p.y + 1
if is_water(p) then
local y = self.object:getvelocity().y
local y = self.object:get_velocity().y
if y >= 5 then
y = 5
elseif y < 0 then
@ -234,31 +235,31 @@ function boat.on_step(self, dtime)
else
new_acce = {x = 0, y = 5, z = 0}
end
new_velo = get_velocity(self._v, self.object:getyaw(), y)
self.object:setpos(self.object:get_pos())
new_velo = get_velocity(self._v, self.object:get_yaw(), y)
self.object:set_pos(self.object:get_pos())
else
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()
pos.y = math.floor(pos.y) + boat_y_offset
self.object:setpos(pos)
new_velo = get_velocity(self._v, self.object:getyaw(), 0)
self.object:set_pos(pos)
new_velo = get_velocity(self._v, self.object:get_yaw(), 0)
else
new_velo = get_velocity(self._v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:get_pos())
new_velo = get_velocity(self._v, self.object:get_yaw(),
self.object:get_velocity().y)
self.object:set_pos(self.object:get_pos())
end
end
end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce)
self.object:set_velocity(new_velo)
self.object:set_acceleration(new_acce)
end
-- Register one entity for all boat types
minetest.register_entity("mcl_boats:boat", boat)
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 = {}
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" }
@ -273,9 +274,9 @@ for b=1, #boat_ids do
-- Only create one help entry for all boats
if b == 1 then
help = true
longdesc = "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."
helpname = "Boat"
longdesc = S("Boats are used to travel on the surface of water.")
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 = S("Boat")
end
minetest.register_craftitem(itemstring, {

View File

@ -141,9 +141,9 @@ minetest.register_entity(":__builtin:falling_node", {
on_step = function(self, dtime)
-- 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
self.object:setacceleration({x = 0, y = -10, z = 0})
self.object:set_acceleration({x = 0, y = -10, z = 0})
end
-- Turn to actual node when colliding with ground, or continue to move
local pos = self.object:get_pos()
@ -222,7 +222,7 @@ minetest.register_entity(":__builtin:falling_node", {
minetest.check_for_falling(np)
return
end
local vel = self.object:getvelocity()
local vel = self.object:get_velocity()
-- Fix position if entity does not move
if vector.equals(vel, {x = 0, y = 0, z = 0}) then
local npos = vector.round(self.object:get_pos())

View File

@ -98,14 +98,14 @@ minetest.register_globalstep(function(dtime)
local opos = object:get_pos()
local vec = vector.subtract(checkpos, opos)
vec = vector.add(opos, vector.divide(vec, 2))
object:moveto(vec)
object:move_to(vec)
--fix eternally falling items
minetest.after(0, function(object)
local lua = object:get_luaentity()
if lua then
object:setacceleration({x=0, y=0, z=0})
object:set_acceleration({x=0, y=0, z=0})
end
end, object)
@ -264,7 +264,7 @@ function minetest.handle_node_drops(pos, drops, digger)
if math.random(1,2) == 1 then
z = -z
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
@ -285,7 +285,7 @@ function minetest.item_drop(itemstack, dropper, pos)
v.x = v.x*4
v.y = v.y*4 + 2
v.z = v.z*4
obj:setvelocity(v)
obj:set_velocity(v)
-- Force collection delay
obj:get_luaentity()._insta_collect = false
return itemstack
@ -306,6 +306,7 @@ core.register_entity(":__builtin:item", {
physical = true,
collide_with_objects = false,
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
pointable = false,
visual = "wielditem",
visual_size = {x = 0.4, y = 0.4},
textures = {""},
@ -373,7 +374,7 @@ core.register_entity(":__builtin:item", {
if not self or not self.object or not self.object:get_luaentity() then
return
end
local vel = self.object:getvelocity()
local vel = self.object:get_velocity()
if vel and vel.x == 0 and vel.z == 0 then
local x = math.random(1, 5)
if math.random(1,2) == 1 then
@ -384,7 +385,7 @@ core.register_entity(":__builtin:item", {
z = -z
end
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, self)
end
@ -444,8 +445,8 @@ core.register_entity(":__builtin:item", {
self._forcetimer = 0
self.object:set_armor_groups({immortal = 1})
self.object:setvelocity({x = 0, y = 2, z = 0})
self.object:setacceleration({x = 0, y = -get_gravity(), z = 0})
self.object:set_velocity({x = 0, y = 2, z = 0})
self.object:set_acceleration({x = 0, y = -get_gravity(), z = 0})
self:set_item(self.itemstring)
end,
@ -589,8 +590,8 @@ core.register_entity(":__builtin:item", {
-- Set new item moving speed accordingly
local newv = vector.multiply(shootdir, 3)
self.object:setacceleration({x = 0, y = 0, z = 0})
self.object:setvelocity(newv)
self.object:set_acceleration({x = 0, y = 0, z = 0})
self.object:set_velocity(newv)
disable_physics(self.object, self, false, false)
@ -643,8 +644,8 @@ core.register_entity(":__builtin:item", {
local f = 1.39
-- Set new item moving speed into the direciton of the liquid
local newv = vector.multiply(vec, f)
self.object:setacceleration({x = 0, y = 0, z = 0})
self.object:setvelocity({x = newv.x, y = -0.22, z = newv.z})
self.object:set_acceleration({x = 0, y = 0, z = 0})
self.object:set_velocity({x = newv.x, y = -0.22, z = newv.z})
self.physical_state = 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
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 self.physical_state then

View File

@ -1,3 +1,5 @@
local S = minetest.get_translator("mcl_minecarts")
mcl_minecarts = {}
mcl_minecarts.modpath = minetest.get_modpath("mcl_minecarts")
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 self._driver then
if self._old_pos then
self.object:setpos(self._old_pos)
self.object:set_pos(self._old_pos)
end
mcl_player.player_attached[self._driver] = nil
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
end
local vel = self.object:getvelocity()
local vel = self.object:get_velocity()
if puncher:get_player_name() == self._driver then
if math.abs(vel.x + vel.z) > 7 then
return
@ -121,7 +123,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
end
function cart:on_step(dtime)
local vel = self.object:getvelocity()
local vel = self.object:get_velocity()
local update = {}
if self._last_float_check == nil then
self._last_float_check = 0
@ -139,7 +141,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
-- Detach driver
if self._driver then
if self._old_pos then
self.object:setpos(self._old_pos)
self.object:set_pos(self._old_pos)
end
mcl_player.player_attached[self._driver] = nil
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
vel = vector.add(vel, self._velocity)
self.object:setvelocity(vel)
self.object:set_velocity(vel)
self._old_dir.y = 0
elseif vector.equals(vel, {x=0, y=0, z=0}) then
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 = 0, y = 0, z = 0}
self._old_pos = pos
self.object:setvelocity(vector.new())
self.object:setacceleration(vector.new())
self.object:set_velocity(vector.new())
self.object:set_acceleration(vector.new())
return
end
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)
end
self.object:setacceleration(new_acc)
self.object:set_acceleration(new_acc)
self._old_pos = vector.new(pos)
self._old_dir = vector.new(dir)
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
yaw = 1
end
self.object:setyaw(yaw * math.pi)
self.object:set_yaw(yaw * math.pi)
end
if self._punched then
@ -341,9 +343,9 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
end
self.object:set_animation(anim, 1, 0)
self.object:setvelocity(vel)
self.object:set_velocity(vel)
if update.pos then
self.object:setpos(pos)
self.object:set_pos(pos)
end
update = nil
end
@ -387,7 +389,7 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing)
le._railtype = railtype
end
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
itemstack:take_item()
@ -470,11 +472,11 @@ end
register_minecart(
"mcl_minecarts:minecart",
"mcl_minecarts:minecart",
"Minecart",
"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.",
"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("Minecart"),
S("Minecarts can be used for a quick transportion on rails.") .. "\n" ..
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."),
S("You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.") .. "\n" ..
S("To obtain the minecart, punch it while holding down the sneak key."),
"mcl_minecarts_minecart.b3d",
{"mcl_minecarts_minecart.png"},
"mcl_minecarts_minecart_normal.png",
@ -494,7 +496,7 @@ register_minecart(
self._driver = player_name
self._start_pos = self.object:get_pos()
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
minetest.after(0.2, function(name)
local player = minetest.get_player_by_name(name)
@ -511,7 +513,7 @@ register_minecart(
register_minecart(
"mcl_minecarts:chest_minecart",
"mcl_minecarts:chest_minecart",
"Minecart with Chest",
S("Minecart with Chest"),
nil, nil,
"mcl_minecarts_minecart_chest.b3d",
{ "mcl_chests_normal.png", "mcl_minecarts_minecart.png" },
@ -523,7 +525,7 @@ register_minecart(
register_minecart(
"mcl_minecarts:furnace_minecart",
"mcl_minecarts:furnace_minecart",
"Minecart with Furnace",
S("Minecart with Furnace"),
nil, nil,
"mcl_minecarts_minecart_block.b3d",
{
@ -566,7 +568,7 @@ register_minecart(
register_minecart(
"mcl_minecarts:command_block_minecart",
"mcl_minecarts:command_block_minecart",
"Minecart with Command Block",
S("Minecart with Command Block"),
nil, nil,
"mcl_minecarts_minecart_block.b3d",
{
@ -587,7 +589,7 @@ register_minecart(
register_minecart(
"mcl_minecarts:hopper_minecart",
"mcl_minecarts:hopper_minecart",
"Minecart with Hopper",
S("Minecart with Hopper"),
nil, nil,
"mcl_minecarts_minecart_hopper.b3d",
{
@ -605,7 +607,7 @@ register_minecart(
register_minecart(
"mcl_minecarts:tnt_minecart",
"mcl_minecarts:tnt_minecart",
"Minecart with TNT",
S("Minecart with TNT"),
nil, nil,
"mcl_minecarts_minecart_block.b3d",
{

View File

@ -1,3 +1,5 @@
local S = minetest.get_translator("mcl_minecarts")
-- Template rail function
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}
@ -64,14 +66,14 @@ local rail_rules_long =
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
register_rail("mcl_minecarts:rail",
{"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
{
description = "Rail",
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.",
description = S("Rail"),
_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,
}
)
@ -80,9 +82,9 @@ register_rail("mcl_minecarts: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"},
{
description = "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_usagehelp = railuse .. "\n" .. "Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.",
description = S("Powered Rail"),
_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" .. S("Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power."),
_rail_acceleration = -3,
mesecons = {
conductor = {
@ -118,9 +120,9 @@ register_rail("mcl_minecarts:golden_rail_on",
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"},
{
description = "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_usagehelp = railuse .. "\n" .. "To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.",
description = S("Activator Rail"),
_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" .. S("To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail."),
mesecons = {
conductor = {
state = mesecon.state.off,
@ -157,9 +159,9 @@ register_rail("mcl_minecarts:activator_rail_on",
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"},
{
description = "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_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.",
description = S("Detector Rail"),
_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" .. 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 = {
receptor = {
state = mesecon.state.off,

View File

@ -9,7 +9,7 @@ local MAX_MOB_NAME_LENGTH = 30
-- Intllib
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
@ -71,7 +71,7 @@ local mobs_spawn_chance = tonumber(minetest.settings:get("mobs_spawn_chance") or
if peaceful_only then
minetest.register_on_joinplayer(function(player)
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
@ -137,15 +137,15 @@ local set_velocity = function(self, v)
-- do not move if mob has been ordered to stay
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
end
local yaw = (self.object:get_yaw() or 0) + self.rotate
self.object:setvelocity({
self.object:set_velocity({
x = sin(yaw) * -v,
y = self.object:getvelocity().y,
y = self.object:get_velocity().y,
z = cos(yaw) * v
})
end
@ -154,7 +154,7 @@ end
-- calculate mob velocity
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
end
@ -403,7 +403,7 @@ local item_drop = function(self, cooked)
if obj and obj:get_luaentity() then
obj:setvelocity({
obj:set_velocity({
x = random(-10, 10) / 9,
y = 6,
z = random(-10, 10) / 9,
@ -642,7 +642,7 @@ local do_env_damage = function(self)
-- don't fall when on ignore, just stand still
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
local nodef = minetest.registered_nodes[self.standing_in]
@ -738,7 +738,7 @@ local do_jump = function(self)
-- something stopping us while moving?
if self.state ~= "stand"
and get_velocity(self) > 0.5
and self.object:getvelocity().y ~= 0 then
and self.object:get_velocity().y ~= 0 then
return false
end
@ -776,13 +776,13 @@ local do_jump = function(self)
if not nod.name:find("fence")
and not nod.name:find("gate") then
local v = self.object:getvelocity()
local v = self.object:get_velocity()
v.y = self.jump_height
set_animation(self, "jump") -- only when defined
self.object:setvelocity(v)
self.object:set_velocity(v)
-- when in air move forward
minetest.after(0.3, function(self, v)
@ -912,7 +912,7 @@ local breed = function(self)
self.on_grown(self)
else
-- jump when fully grown so as not to fall into ground
self.object:setvelocity({
self.object:set_velocity({
x = 0,
y = self.jump_height,
z = 0
@ -1041,7 +1041,7 @@ local replace = function(self, pos)
or not self.replace_rate
or not self.replace_what
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
return
end
@ -1267,7 +1267,7 @@ local smart_mobs = function(self, s, p, dist, dtime)
end
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
@ -1670,7 +1670,7 @@ local follow_flop = function(self)
if not flight_check(self, s) then
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")
@ -1944,7 +1944,7 @@ local do_states = function(self, dtime)
self.timer = 0
self.blinktimer = 0
self.blinkstatus = false
self.object:settexturemod("")
self.object:set_texture_mod("")
end
-- walk right up to player unless the timer is active
@ -1970,9 +1970,9 @@ local do_states = function(self, dtime)
self.blinktimer = 0
if self.blinkstatus then
self.object:settexturemod("")
self.object:set_texture_mod("")
else
self.object:settexturemod("^[brighten")
self.object:set_texture_mod("^[brighten")
end
self.blinkstatus = not self.blinkstatus
@ -2026,13 +2026,13 @@ local do_states = function(self, dtime)
local me_y = floor(p1.y)
local p2 = p
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 me_y < p_y then
self.object:setvelocity({
self.object:set_velocity({
x = v.x,
y = 1 * self.walk_velocity,
z = v.z
@ -2040,7 +2040,7 @@ local do_states = function(self, dtime)
elseif me_y > p_y then
self.object:setvelocity({
self.object:set_velocity({
x = v.x,
y = -1 * self.walk_velocity,
z = v.z
@ -2049,7 +2049,7 @@ local do_states = function(self, dtime)
else
if me_y < p_y then
self.object:setvelocity({
self.object:set_velocity({
x = v.x,
y = 0.01,
z = v.z
@ -2057,7 +2057,7 @@ local do_states = function(self, dtime)
elseif me_y > p_y then
self.object:setvelocity({
self.object:set_velocity({
x = v.x,
y = -0.01,
z = v.z
@ -2241,7 +2241,7 @@ local do_states = function(self, dtime)
vec.y = vec.y * (v / amount)
vec.z = vec.z * (v / amount)
obj:setvelocity(vec)
obj:set_velocity(vec)
end
end
end
@ -2257,12 +2257,12 @@ local falling = function(self, pos)
end
-- floating in water (or falling)
local v = self.object:getvelocity()
local v = self.object:get_velocity()
if v.y > 0 then
-- apply gravity when moving up
self.object:setacceleration({
self.object:set_acceleration({
x = 0,
y = -10,
z = 0
@ -2271,14 +2271,14 @@ local falling = function(self, pos)
elseif v.y <= 0 and v.y > self.fall_speed then
-- fall downwards at set speed
self.object:setacceleration({
self.object:set_acceleration({
x = 0,
y = self.fall_speed,
z = 0
})
else
-- 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
-- in water then float up
@ -2286,7 +2286,7 @@ local falling = function(self, pos)
if self.floats == 1 then
self.object:setacceleration({
self.object:set_acceleration({
x = 0,
y = -self.fall_speed / (max(1, v.y) ^ 2),
z = 0
@ -2296,7 +2296,7 @@ local falling = function(self, pos)
-- fall damage onto solid ground
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
@ -2475,7 +2475,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
if self.knock_back
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 kb = r * 2.0
local up = 2
@ -2496,7 +2496,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
kb = kb * 1.5
end
self.object:setvelocity({
self.object:set_velocity({
x = dir.x * kb,
y = up,
z = dir.z * kb
@ -3562,8 +3562,8 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
inventory_image = invimg,
groups = grp,
_doc_items_longdesc = "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_longdesc = S("This allows you to place a single mob."),
_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)
@ -3588,7 +3588,7 @@ function mobs:register_egg(mob, desc, background, addegg, no_creative)
return itemstack
end
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
end
mcl_mobspawners.setup_spawner(pointed_thing.under, itemstack:get_name())

View File

@ -190,7 +190,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
end
local acce_y = 0
local velo = entity.object:getvelocity()
local velo = entity.object:get_velocity()
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
-- 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
@ -275,7 +275,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
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
return
end
@ -348,7 +348,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
if math.abs(velo.y) < 1 then
local pos = entity.object:get_pos()
pos.y = math.floor(pos.y) + 0.5
entity.object:setpos(pos)
entity.object:set_pos(pos)
velo.y = 0
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_acce.y = new_acce.y + acce_y
entity.object:setvelocity(new_velo)
entity.object:setacceleration(new_acce)
entity.object:set_velocity(new_velo)
entity.object:set_acceleration(new_acce)
-- CRASH!
if enable_crash then
@ -387,7 +387,7 @@ end
function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
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 yaw = entity.driver:get_look_horizontal() + 1.57 -- offset fix between old and new commands
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
if ctrl.up then
entity.object:setvelocity({
entity.object:set_velocity({
x = dir.x * speed,
y = dir.y * speed + 2,
z = dir.z * speed
})
elseif ctrl.down then
entity.object:setvelocity({
entity.object:set_velocity({
x = -dir.x * speed,
y = dir.y * speed + 2,
z = -dir.z * speed
})
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
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
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
local vec = {x = dir.x * 6, y = dir.y * 6, z = dir.z * 6}
local yaw = entity.driver:get_look_horizontal()
obj:setyaw(yaw + math.pi / 2)
obj:setvelocity(vec)
obj:set_yaw(yaw + math.pi / 2)
obj:set_velocity(vec)
else
obj:remove()
end

View File

@ -3,13 +3,9 @@
--made for MC like Survival game
--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
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
local c = mobs_mc.is_item_variable_overridden

View File

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--maikerumines throwing code
--arrow (weapon)
@ -116,9 +114,9 @@ local throwing_shoot_arrow = function(itemstack, player)
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 dir = player:get_look_dir()
obj:setvelocity({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:setyaw(player:get_look_yaw()+math.pi)
obj:set_velocity({x=dir.x*22, y=dir.y*22, z=dir.z*22})
obj:set_acceleration({x=dir.x*-3, y=-10, z=dir.z*-3})
obj:set_yaw(player:get_look_yaw()+math.pi)
minetest.sound_play("throwing_sound", {pos=playerpos})
if obj:get_luaentity().player == "" then
obj:get_luaentity().player = player
@ -267,13 +265,13 @@ if c("egg") then
ent.velocity = egg_VELOCITY -- needed for api internal timing
ent.switch = 1 -- needed so that egg doesn't despawn straight away
obj:setvelocity({
obj:set_velocity({
x = dir.x * egg_VELOCITY,
y = dir.y * egg_VELOCITY,
z = dir.z * egg_VELOCITY
})
obj:setacceleration({
obj:set_acceleration({
x = dir.x * -3,
y = -egg_GRAVITY,
z = dir.z * -3
@ -351,13 +349,13 @@ if c("snowball") then
ent.velocity = snowball_VELOCITY -- needed for api internal timing
ent.switch = 1 -- needed so that egg doesn't despawn straight away
obj:setvelocity({
obj:set_velocity({
x = dir.x * snowball_VELOCITY,
y = dir.y * snowball_VELOCITY,
z = dir.z * snowball_VELOCITY
})
obj:setacceleration({
obj:set_acceleration({
x = dir.x * -3,
y = -snowball_GRAVITY,
z = dir.z * -3

View File

@ -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
minetest.registered_nodes[minetest.get_node(telepos_below).name].walkable == true then
-- Correct position found! Let's teleport.
self.object:setpos(telepos)
self.object:set_pos(telepos)
return
end
end

View File

@ -1,9 +1,7 @@
--MC Heads for minetest
--maikerumine
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
-- Heads system

View File

@ -2,9 +2,7 @@
--################### AGENT
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:agent", {
type = "npc",

View File

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:bat", {
type = "animal",

View File

@ -3,11 +3,8 @@
-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models
-- blaze.lua partial copy of mobs_mc/ghast.lua
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### BLAZE
--###################
@ -101,7 +98,7 @@ mobs:register_arrow("mobs_mc:blaze_fireball", {
if node.name == "air" then
minetest.set_node(pos_above, {name=mobs_mc.items.fire})
else
local v = self.object:getvelocity()
local v = self.object:get_velocity()
v = vector.normalize(v)
local crashpos = vector.subtract(pos, v)
local crashnode = minetest.get_node(crashpos)

View File

@ -1,11 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### CHICKEN

View File

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
local cow_def = {
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")
end
local oldyaw = self.object:getyaw()
local oldyaw = self.object:get_yaw()
self.object:remove()
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
item:add_wear(mobs_mc.misc.shears_wear)

View File

@ -1,11 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### CREEPER

View File

@ -8,5 +8,4 @@ mcl_fishing?
bones?
mesecons_materials?
mobs_mc_gameconfig?
intllib?
doc_items?

View File

@ -2,9 +2,7 @@
--################### ENDERDRAGON
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--[[
mobs:register_mob("mobs_mc:12enderdragon", {

View File

@ -10,12 +10,7 @@
-- and they are provoked by looking directly at them.
-- TODO: Implement MC behaviour.
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### ENDERMAN
@ -314,7 +309,7 @@ mobs:register_mob("mobs_mc:enderman", {
end
end
if telepos then
self.object:setpos(telepos)
self.object:set_pos(telepos)
end
end
end,

View File

@ -2,9 +2,7 @@
--################### ENDERMITE
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:endermite", {
type = "monster",

View File

@ -3,11 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### GHAST

View File

@ -4,9 +4,7 @@
--################### GUARDIAN
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:guardian", {
type = "monster",

View File

@ -4,9 +4,7 @@
--################### GUARDIAN
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:guardian_elder", {
type = "monster",

View File

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### HORSE
@ -142,7 +140,7 @@ local horse = {
self.max_speed_reverse = 2
self.accel = 6
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_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
end

View File

@ -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

View File

@ -3,11 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### IRON GOLEM
--###################

View File

@ -1,6 +1,4 @@
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### LLAMA
@ -69,7 +67,7 @@ mobs:register_mob("mobs_mc:llama", {
self.max_speed_reverse = 2
self.accel = 4
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_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
end

View File

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### OCELOT AND CAT

View File

@ -3,12 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### PARROT

View File

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:pig", {
type = "animal",
@ -59,7 +57,7 @@ mobs:register_mob("mobs_mc:pig", {
self.max_speed_reverse = 2
self.accel = 4
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_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
end

View File

@ -1,10 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### POLARBEAR

View File

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
local rabbit = {
type = "animal",

View File

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### SHEEP

View File

@ -3,11 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### SHULKER

View File

@ -2,9 +2,7 @@
--################### SILVERFISH
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:silverfish", {
type = "monster",

View File

@ -3,12 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### SKELETON

View File

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### WITHER SKELETON

View File

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
-- Returns a function that spawns children in a circle around pos.
-- To be used as on_die callback.

View File

@ -3,9 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
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

View File

@ -3,11 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### SPIDER

View File

@ -4,9 +4,7 @@
--################### SQUID
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:squid", {
type = "animal",

View File

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### VEX

View File

@ -19,9 +19,7 @@
-- TODO: Internal inventory, pick up items, trade with other villagers
-- TODO: Farm stuff
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
-- playername-indexed table containing the previously used tradenum
local player_tradenum = {}
@ -595,7 +593,7 @@ local function return_item(itemstack, dropper, pos, inv_p)
v.x = v.x*4
v.y = v.y*4 + 2
v.z = v.z*4
obj:setvelocity(v)
obj:set_velocity(v)
obj:get_luaentity()._insta_collect = false
end
end

View File

@ -3,11 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### EVOKER
--###################

View File

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:illusioner", {
type = "monster",

View File

@ -3,11 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### VINDICATOR
--###################

View File

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
-- TODO: Turn villagers to zombie villager

View File

@ -3,11 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### WITCH

View File

@ -3,18 +3,12 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### WITHER
--###################
mobs:register_mob("mobs_mc:wither", {
type = "monster",
hp_max = 300,

View File

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
local default_walk_chance = 50

View File

@ -3,12 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### ZOMBIE

View File

@ -3,11 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### ZOMBIE PIGMAN
--###################

View File

@ -1,4 +1,3 @@
--[[
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.interval_low = 17
@ -163,7 +164,7 @@ lightning.strike = function(pos)
posadd = {x=math.cos(angle),y=0,z=math.sin(angle)}
posadd = vector.normalize(posadd)
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
end
@ -178,7 +179,7 @@ lightning.strike = function(pos)
if obj:is_player() then
-- Player damage
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
obj:set_hp(obj:get_hp()-5)
-- Mobs
@ -233,7 +234,7 @@ end)
minetest.register_chatcommand("lightning", {
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 },
func = function(name, param)
local pos = {}
@ -254,7 +255,7 @@ minetest.register_chatcommand("lightning", {
if player then
lightning.strike(player:get_pos())
else
return false, "No position specified and unknown player"
return false, S("No position specified and unknown player")
end
end
return true

View File

@ -1,3 +1,5 @@
local S = minetest.get_translator("mcl_void_damage")
local voidtimer = 0
minetest.register_globalstep(function(dtime)
@ -24,7 +26,7 @@ minetest.register_globalstep(function(dtime)
local spawn = mcl_spawn.get_spawn_pos(obj)
obj:set_pos(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
obj:remove()
end
@ -32,7 +34,7 @@ minetest.register_globalstep(function(dtime)
-- Damage enabled, not immortal: Deal void damage (4 HP / 0.5 seconds)
if obj:get_hp() > 0 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
obj:set_hp(obj:get_hp() - 4)
end

View File

@ -235,7 +235,7 @@ local initsky = function(player)
end
-- 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
minetest.register_on_joinplayer(initsky)

View File

@ -1,3 +1,5 @@
local S = minetest.get_translator("mcl_weather")
-- weather states, 'none' is default, other states depends from active mods
mcl_weather.state = "none"
@ -182,18 +184,18 @@ mcl_weather.get_weather = function()
end
minetest.register_privilege("weather_manager", {
description = "Gives ability to control weather",
description = S("Gives ability to control weather"),
give_to_singleplayer = false
})
-- Weather command definition. Set
minetest.register_chatcommand("weather", {
params = "(clear | rain | snow | thunder) [<duration>]",
description = "Changes the weather to the specified parameter.",
params = S("(clear | rain | snow | thunder) [<duration>]"),
description = S("Changes the weather to the specified parameter."),
privs = {weather_manager = true},
func = function(name, param)
if (param == "") then
return false, "Error: No weather specified."
return false, S("Error: No weather specified.")
end
local new_weather, end_time
local parse1, parse2 = string.match(param, "(%w+) ?(%d*)")
@ -204,13 +206,13 @@ minetest.register_chatcommand("weather", {
new_weather = parse1
end
else
return false, "Error: Invalid parameters."
return false, S("Error: Invalid parameters.")
end
if parse2 then
if type(tonumber(parse2)) == "number" then
local duration = tonumber(parse2)
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_time = minetest.get_gametime() + duration
end
@ -220,14 +222,14 @@ minetest.register_chatcommand("weather", {
if success then
return true
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
})
minetest.register_chatcommand("toggledownfall", {
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},
func = function(name, param)
-- Currently rain/thunder/snow: Set weather to clear

View File

@ -0,0 +1,2 @@
name = ENVIRONMENT
description = Meta-modpack containing environment and nature-related mods for MineClone 2

View File

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

View File

@ -315,8 +315,7 @@ function craftguide:get_formspec(player_name, is_fuel)
data.pagemax = max(1, ceil(#data.items / ipp))
local formspec = "size["..data.iX..","..(iY+3)..".6;]"..
mcl_vars.gui_slots ..
mcl_vars.gui_bg ..
mcl_vars.inventory_header..
[=[background[1,1;1,1;craftguide_bg.png;true]
button[2.4,0.21;0.8,0.5;search;?]
button[3.05,0.21;0.8,0.5;clear;X]

View File

@ -1,3 +1,5 @@
local S = minetest.get_translator("mcl_doc")
-- 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("tool_capabilities")
@ -14,7 +16,7 @@ end)
-- dig_by_water
doc.sub.items.register_factoid("nodes", "drop_destroy", function(itemstring, def)
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
return ""
end)
@ -22,9 +24,9 @@ end)
-- usable by hoes
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
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
return "This block can be turned into farmland with a hoe."
return S("This block can be turned into farmland with a hoe.")
end
return ""
end)
@ -33,15 +35,15 @@ end)
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
local datastring = ""
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
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
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
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
return datastring
end)
@ -50,9 +52,9 @@ doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
local formstring = ""
if def.groups.leafdecay ~= nil 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
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
return formstring
@ -62,9 +64,9 @@ end)
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
local datastring = ""
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
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
return ""
end)
@ -72,7 +74,7 @@ end)
-- flammable
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
if def.groups.flammable then
return "This block is flammable."
return S("This block is flammable.")
end
return ""
end)
@ -80,7 +82,7 @@ end)
-- destroys_items
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
if def.groups.destroys_items then
return "This block destroys any item it touches."
return S("This block destroys any item it touches.")
end
return ""
end)
@ -91,25 +93,25 @@ doc.sub.items.register_factoid(nil, "use", function(itemstring, def)
local s = ""
if def.groups.eatable and not def._doc_items_usagehelp 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
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
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
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
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
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
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
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
return s
@ -118,10 +120,10 @@ end)
doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
local s = ""
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
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
return s
end)
@ -132,12 +134,12 @@ doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
local mdef = minetest.registered_items[def._repair_material]
local desc
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
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
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
return ""
@ -145,7 +147,7 @@ end)
doc.sub.items.register_factoid(nil, "groups", function(itemstring, def)
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
return ""
end
@ -154,7 +156,7 @@ end)
doc.sub.items.register_factoid("nodes", "gravity", function(itemstring, def)
local s = ""
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
return s
end)
@ -162,22 +164,22 @@ end)
doc.sub.items.register_factoid("nodes", "gravity", function(itemstring, def)
local s = ""
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×22 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×22 hit points with B = number of blocks fallen. The damage can never be more than 40 HP.")
end
return s
end)
-- Mining, hardness and all that
doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def)
local pickaxey = { "Diamond Pickaxe", "Iron Pickaxe", "Stone Pickaxe", "Golden Pickaxe", "Wooden Pickaxe" }
local axey = { "Diamond Axe", "Iron Axe", "Stone Axe", "Golden Axe", "Wooden Axe" }
local shovely = { "Diamond Shovel", "Iron Shovel", "Stone Shovel", "Golden Shovel", "Wooden Shovel" }
local pickaxey = { S("Diamond Pickaxe"), S("Iron Pickaxe"), S("Stone Pickaxe"), S("Golden Pickaxe"), S("Wooden Pickaxe") }
local axey = { S("Diamond Axe"), S("Iron Axe"), S("Stone Axe"), S("Golden Axe"), S("Wooden Axe") }
local shovely = { S("Diamond Shovel"), S("Iron Shovel"), S("Stone Shovel"), S("Golden Shovel"), S("Wooden Shovel") }
local datastring = ""
local groups = def.groups
if groups 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
local tool_minable = false
@ -213,7 +215,7 @@ doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def)
end
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
@ -222,9 +224,9 @@ doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def)
hardness = 0
end
if hardness == -1 then
datastring = datastring .. "Hardness: ∞"
datastring = datastring .. S("Hardness: ∞")
else
datastring = datastring .. string.format("Hardness: %.2f", hardness)
datastring = datastring .. S("Hardness: @1", string.format("%.2f", hardness))
end
local blast = def._mcl_blast_resistance
if not blast then
@ -232,7 +234,7 @@ doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def)
end
-- TODO: Blast resistance as number
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
return datastring
end)
@ -240,7 +242,7 @@ end)
-- Special drops when mined by shears
doc.sub.items.register_factoid("nodes", "drops", function(itemstring, def)
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
local drops = {}
for d=1, #def._mcl_shears_drop do
@ -255,11 +257,11 @@ doc.sub.items.register_factoid("nodes", "drops", function(itemstring, def)
text = itemname
end
if itemcount > 1 then
text = string.format("%d×%s", itemcount, text)
text = S("@1×@2", itemcount, text)
end
table.insert(drops, text)
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
end
return ""

View File

@ -1,2 +1 @@
doc
intllib?

View File

@ -1,10 +1,4 @@
-- Boilerplate to support localized strings if intllib mod is installed.
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function(s) return s end
end
local S = minetest.get_translator("mcl_doc_basics")
doc.add_category("basics",
{

View File

View File

@ -29,10 +29,7 @@ function awards.save()
end
end
local S = function(s) return s end
function awards.set_intllib(locale)
S = locale
end
local S = minetest.get_translator("awards")
function awards.init()
awards.players = awards.load()

View File

@ -14,12 +14,7 @@
-- 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
local S = minetest.get_translator("awards")
minetest.register_chatcommand("awards", {
params = S("[c|clear|disable|enable]"),

View File

@ -1,3 +1,2 @@
intllib?
sfinv?
unified_inventory?

View File

@ -14,18 +14,9 @@
-- 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").."/chat_commands.lua")
dofile(minetest.get_modpath("awards").."/sfinv.lua")
dofile(minetest.get_modpath("awards").."/unified_inventory.lua")
dofile(minetest.get_modpath("awards").."/triggers.lua")
awards.set_intllib(S)

View File

@ -1,10 +1,5 @@
if minetest.get_modpath("sfinv") then
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function ( s ) return s end
end
local S = minetest.get_translator("awards")
sfinv.register_page("awards:awards", {
title = S("Awards"),

View File

@ -14,12 +14,7 @@
-- 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
local S = minetest.get_translator("awards")
awards.register_trigger("dig", function(def)
local tmp = {

View File

@ -1,10 +1,5 @@
if minetest.get_modpath("unified_inventory") ~= nil then
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function ( s ) return s end
end
local S = minetest.get_translator("awards")
unified_inventory.register_button("awards", {
type = "image",

View File

@ -1,2 +1 @@
awards
intllib?

View File

@ -3,12 +3,7 @@
-- If true, activates achievements from other Minecraft editions (XBox, PS, etc.)
local non_pc_achievements = false
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function ( s ) return s end
end
local S = minetest.get_translator("mcl_achievements")
-- Achievements from PC Edition

View File

@ -1,101 +1,103 @@
local S = minetest.get_translator("mcl_death_messages")
mcl_death_messages = {}
-- Death messages
local msgs = {
["arrow"] = {
"%s was fatally hit by an arrow.",
"%s has been killed with an arrow.",
S("%s was fatally hit by an arrow."),
S("%s has been killed with an arrow."),
},
["arrow_name"] = {
"%s was shot by an arrow from %s.",
S("%s was shot by an arrow from %s."),
},
["fire"] = {
"%s has been cooked crisp.",
"%s felt the burn.",
"%s died in the flames.",
"%s died in a fire.",
S("%s has been cooked crisp."),
S("%s felt the burn."),
S("%s died in the flames."),
S("%s died in a fire."),
},
["lava"] = {
"%s melted in lava.",
"%s took a bath in a hot lava tub.",
"%s died in lava.",
"%s could not survive in lava.",
S("%s melted in lava."),
S("%s took a bath in a hot lava tub."),
S("%s died in lava."),
S("%s could not survive in lava."),
},
["drown"] = {
"%s forgot to breathe.",
"%s drowned.",
"%s ran out of oxygen.",
S("%s forgot to breathe."),
S("%s drowned."),
S("%s ran out of oxygen."),
},
["starve"] = {
"%s starved.",
S("%s starved."),
},
["murder"] = {
"%s was killed by %s.",
S("%s was killed by %s."),
},
["mob_kill"] = {
"%s was killed by a mob.",
S("%s was killed by a mob."),
},
["blaze_fireball"] = {
"%s was burned to death by a blaze's fireball.",
"%s was killed by a fireball from a blaze.",
S("%s was burned to death by a blaze's fireball."),
S("%s was killed by a fireball from a blaze."),
},
["fire_charge"] = {
"%s was hit by a fire charge.",
S("%s was hit by a fire charge."),
},
["ghast_fireball"] = {
"A ghast scared %s to death.",
"%s has been fireballed by a ghast.",
S("A ghast scared %s to death."),
S("%s has been fireballed by a ghast."),
},
["fall_damage"] = {
"%s fell from a high cliff.",
"%s took fatal fall damage.",
"%s fell victim to gravity.",
S("%s fell from a high cliff."),
S("%s took fatal fall damage."),
S("%s fell victim to gravity."),
},
["other"] = {
"%s died.",
S("%s died."),
}
}
local mobkills = {
["mobs_mc:zombie"] = "%s was killed by a zombie.",
["mobs_mc:baby_zombie"] = "%s was killed by a baby zombie.",
["mobs_mc:blaze"] = "%s was killed by a blaze.",
["mobs_mc:slime"] = "%s was killed by a slime.",
["mobs_mc:witch"] = "%s was killed by a witch.",
["mobs_mc:magma_cube_tiny"] = "%s was killed by a magma cube.",
["mobs_mc:magma_cube_small"] = "%s was killed by a magma cube.",
["mobs_mc:magma_cube_big"] = "%s was killed by a magma cube.",
["mobs_mc:wolf"] = "%s was killed by a wolf.",
["mobs_mc:cat"] = "%s was killed by a cat.",
["mobs_mc:ocelot"] = "%s was killed by an ocelot.",
["mobs_mc:ender_dragon"] = "%s was killed by an ender dragon.",
["mobs_mc:wither"] = "%s was killed by a wither.",
["mobs_mc:enderman"] = "%s was killed by an enderman.",
["mobs_mc:endermite"] = "%s was killed by an endermite.",
["mobs_mc:ghast"] = "%s was killed by a ghast.",
["mobs_mc:guardian_elder"] = "%s was killed by an elder guardian.",
["mobs_mc:guardian"] = "%s was killed by a guardian.",
["mobs_mc:iron_golem"] = "%s was killed by an iron golem.",
["mobs_mc:polar_bear"] = "%s was killed by a polar_bear.",
["mobs_mc:killer_bunny"] = "%s was killed by a killer bunny.",
["mobs_mc:shulker"] = "%s was killed by a shulker.",
["mobs_mc:silverfish"] = "%s was killed by a silverfish.",
["mobs_mc:skeleton"] = "%s was killed by a skeleton.",
["mobs_mc:stray"] = "%s was killed by a stray.",
["mobs_mc:slime_tiny"] = "%s was killed by a slime.",
["mobs_mc:slime_small"] = "%s was killed by a slime.",
["mobs_mc:slime_big"] = "%s was killed by a slime.",
["mobs_mc:spider"] = "%s was killed by a spider.",
["mobs_mc:cave_spider"] = "%s was killed by a cave spider.",
["mobs_mc:vex"] = "%s was killed by a vex.",
["mobs_mc:evoker"] = "%s was killed by an evoker.",
["mobs_mc:illusioner"] = "%s was killed by an illusioner.",
["mobs_mc:vindicator"] = "%s was killed by a vindicator.",
["mobs_mc:villager_zombie"] = "%s was killed by a zombie villager.",
["mobs_mc:husk"] = "%s was killed by a husk.",
["mobs_mc:baby_husk"] = "%s was killed by a baby husk.",
["mobs_mc:pigman"] = "%s was killed by a zombie pigman.",
["mobs_mc:baby_pigman"] = "%s was killed by a baby zombie pigman.",
["mobs_mc:zombie"] = S("%s was killed by a zombie."),
["mobs_mc:baby_zombie"] = S("%s was killed by a baby zombie."),
["mobs_mc:blaze"] = S("%s was killed by a blaze."),
["mobs_mc:slime"] = S("%s was killed by a slime."),
["mobs_mc:witch"] = S("%s was killed by a witch."),
["mobs_mc:magma_cube_tiny"] = S("%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("%s was killed by a magma cube."),
["mobs_mc:wolf"] = S("%s was killed by a wolf."),
["mobs_mc:cat"] = S("%s was killed by a cat."),
["mobs_mc:ocelot"] = S("%s was killed by an ocelot."),
["mobs_mc:ender_dragon"] = S("%s was killed by an ender dragon."),
["mobs_mc:wither"] = S("%s was killed by a wither."),
["mobs_mc:enderman"] = S("%s was killed by an enderman."),
["mobs_mc:endermite"] = S("%s was killed by an endermite."),
["mobs_mc:ghast"] = S("%s was killed by a ghast."),
["mobs_mc:guardian_elder"] = S("%s was killed by an elder guardian."),
["mobs_mc:guardian"] = S("%s was killed by a guardian."),
["mobs_mc:iron_golem"] = S("%s was killed by an iron golem."),
["mobs_mc:polar_bear"] = S("%s was killed by a polar_bear."),
["mobs_mc:killer_bunny"] = S("%s was killed by a killer bunny."),
["mobs_mc:shulker"] = S("%s was killed by a shulker."),
["mobs_mc:silverfish"] = S("%s was killed by a silverfish."),
["mobs_mc:skeleton"] = S("%s was killed by a skeleton."),
["mobs_mc:stray"] = S("%s was killed by a stray."),
["mobs_mc:slime_tiny"] = S("%s was killed by a slime."),
["mobs_mc:slime_small"] = S("%s was killed by a slime."),
["mobs_mc:slime_big"] = S("%s was killed by a slime."),
["mobs_mc:spider"] = S("%s was killed by a spider."),
["mobs_mc:cave_spider"] = S("%s was killed by a cave spider."),
["mobs_mc:vex"] = S("%s was killed by a vex."),
["mobs_mc:evoker"] = S("%s was killed by an evoker."),
["mobs_mc:illusioner"] = S("%s was killed by an illusioner."),
["mobs_mc:vindicator"] = S("%s was killed by a vindicator."),
["mobs_mc:villager_zombie"] = S("%s was killed by a zombie villager."),
["mobs_mc:husk"] = S("%s was killed by a husk."),
["mobs_mc:baby_husk"] = S("%s was killed by a baby husk."),
["mobs_mc:pigman"] = S("%s was killed by a zombie pigman."),
["mobs_mc:baby_pigman"] = S("%s was killed by a baby zombie pigman."),
}
-- Select death message

View File

@ -0,0 +1 @@
mcl_init

View File

@ -0,0 +1,3 @@
minetest.register_on_joinplayer(function(player)
player:set_formspec_prepend(mcl_vars.gui_nonbg)
end)

View File

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

View File

@ -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
local players = {}
@ -320,29 +323,29 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
player_preview..
-- crafting guide button
"image_button[9,1;1,1;craftguide_book.png;__mcl_craftguide;]"..
"tooltip[__mcl_craftguide;Recipe book]"..
"tooltip[__mcl_craftguide;"..F("Recipe book").."]"..
-- help button
"image_button[9,2;1,1;doc_button_icon_lores.png;__mcl_doc;]"..
"tooltip[__mcl_doc;Help]"..
"tooltip[__mcl_doc;"..F("Help").."]"..
-- skins button
"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
"image_button[9,4;1,1;mcl_achievements_button.png;__mcl_achievements;]"..
"tooltip[__mcl_achievements;Achievements]"
"tooltip[__mcl_achievements;"..F("Achievements").."]"
-- For shortcuts
listrings = listrings ..
"listring[detached:"..playername.."_armor;armor]"..
"listring[current_player;main]"
else
inv_bg = inv_bg .. "^crafting_inventory_creative_scroll.png"
-- Creative inventory slots
main_list = "list[detached:creative_"..playername..";main;0,1.75;9,5;"..tostring(start_i).."]" ..
-- ... and scroll bar
"image_button[9.02,1.76;"..tostring(arrow_height)..",0.6;crafting_creative_up.png;creative_prev;]"..
"image[9.033," .. tostring(slider_pos) .. ";0.78,"..tostring(slider_height) .. ";crafting_slider.png]"..
"image_button[9.02,6.15;"..tostring(arrow_height)..",0.6;crafting_creative_down.png;creative_next;]"
"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) .. ";mcl_inventory_slider.png]"..
"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
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.."]"..
"label[-5,-5;"..name.."]"..
tab(name, "blocks") ..
"tooltip[blocks;Building Blocks]"..
"tooltip[blocks;"..F("Building Blocks").."]"..
tab(name, "deco") ..
"tooltip[deco;Decoration Blocks]"..
"tooltip[deco;"..F("Decoration Blocks").."]"..
tab(name, "redstone") ..
"tooltip[redstone;Redstone]"..
"tooltip[redstone;"..F("Redstone").."]"..
tab(name, "rail") ..
"tooltip[rail;Transportation]"..
"tooltip[rail;"..F("Transportation").."]"..
tab(name, "misc") ..
"tooltip[misc;Miscellaneous]"..
"tooltip[misc;"..F("Miscellaneous").."]"..
tab(name, "nix") ..
"tooltip[nix;Search Items]"..
"tooltip[nix;"..F("Search Items").."]"..
fnt..
"list[current_player;main;0,7;9,1;]"..
main_list..
tab(name, "food") ..
"tooltip[food;Foodstuffs]"..
"tooltip[food;"..F("Foodstuffs").."]"..
tab(name, "tools") ..
"tooltip[tools;Tools]"..
"tooltip[tools;"..F("Tools").."]"..
tab(name, "combat") ..
"tooltip[combat;Combat]"..
"tooltip[combat;"..F("Combat").."]"..
tab(name, "mobs") ..
"tooltip[mobs;Mobs]"..
"tooltip[mobs;"..F("Mobs").."]"..
-- TODO: Add brew
--tab(name, "brew") ..
--"tooltip[brew;Brewing]"..
--"tooltip[brew;"..F("Brewing").."]"..
tab(name, "matr") ..
"tooltip[matr;Materials]"..
"tooltip[matr;"..F("Materials").."]"..
tab(name, "inv") ..
"tooltip[inv;Survival Inventory]"..
"tooltip[inv;"..F("Survival Inventory").."]"..
"list[detached:trash;main;9,7;1,1;]"..
"image[9,7;1,1;crafting_creative_trash.png]"..
listrings

View File

@ -1,3 +1,6 @@
local S = minetest.get_translator("mcl_inventory")
local F = function(s) return minetest.formspec_escape(S(s)) end
mcl_inventory = {}
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.y = v.y*4 + 2
v.z = v.z*4
obj:setvelocity(v)
obj:set_velocity(v)
obj:get_luaentity()._insta_collect = false
end
end
@ -101,16 +104,16 @@ local function set_inventory(player, armor_change_only)
"list[current_player;craftpreview;7,1.5;1,1;]"..
-- crafting guide button
"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
"image_button[8,3;1,1;doc_button_icon_lores.png;__mcl_doc;]"..
"tooltip[__mcl_doc;Help]"..
"tooltip[__mcl_doc;"..F("Help").."]"..
-- skins button
"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
"image_button[7,3;1,1;mcl_achievements_button.png;__mcl_achievements;]"..
"tooltip[__mcl_achievements;Achievements]"..
"tooltip[__mcl_achievements;"..F("Achievements").."]"..
-- for shortcuts
"listring[current_player;main]"..
"listring[current_player;craft]"..

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 B

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

View File

@ -1,3 +1,5 @@
local S = minetest.get_translator("mcl_comparators")
-- Functions that get the input/output rules of the comparator
local comparator_get_output_rules = function(node)
@ -223,25 +225,20 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do
-- Help
local longdesc, usagehelp, use_help
if state_strs[state] == "off" and mode == "comp" then
longdesc = "Redstone comparators are multi-purpose redstone components. "..
"They can transmit a redstone signal, detect whether a block contains any items and compare multiple signals."
longdesc = S("Redstone comparators are multi-purpose redstone components.").."\n"..
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 "..
"arrow direction, the main input is in the opposite direction. The other 2 sides are the side inputs.".."\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."..
"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"..
"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."
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"..
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"..
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"..
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"..
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.")
else
use_help = false
end
local nodedef = {
description = "Redstone Comparator",
description = S("Redstone Comparator"),
inventory_image = icon,
wield_image = icon,
_doc_items_create_entry = use_help,

View File

@ -7,6 +7,7 @@
All node definitions share a lot of code, so this is the reason why there
are so many weird tables below.
]]
local S = minetest.get_translator("mcl_dispensers")
-- For after_place_node
local setup_dispenser = function(pos)
@ -281,13 +282,13 @@ local dispenserdef = {
-- Horizontal dispenser
local horizontal_def = table.copy(dispenserdef)
horizontal_def.description = "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_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.description = S("Dispenser")
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 = 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
Fire charges: Are fired in a straight line
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
Flint and steel: Is used to ignite a fire in air and to ignite TNT
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)
setup_dispenser(pos)
@ -319,7 +320,7 @@ minetest.register_node("mcl_dispensers:dispenser", horizontal_def)
-- Down dispenser
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.tiles = {
"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
-- The up dispenser is almost identical to the down dispenser , it only differs in textures
local up_def = table.copy(down_def)
up_def.description = "Upwards-Facing Dispenser"
up_def.description = S("Upwards-Facing Dispenser")
up_def.tiles = {
"mcl_dispensers_dispenser_front_vertical.png", "default_furnace_bottom.png",
"default_furnace_side.png", "default_furnace_side.png",

View File

@ -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.
]]
local S = minetest.get_translator("mcl_droppers")
-- For after_place_node
local setup_dropper = function(pos)
-- Set formspec and inventory
@ -144,9 +146,9 @@ local dropperdef = {
-- Horizontal dropper
local horizontal_def = table.copy(dropperdef)
horizontal_def.description = "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_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.description = S("Dropper")
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 = 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)
setup_dropper(pos)
orientate_dropper(pos, placer)
@ -163,7 +165,7 @@ minetest.register_node("mcl_droppers:dropper", horizontal_def)
-- Down dropper
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.tiles = {
"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
-- The up dropper is almost identical to the down dropper, it only differs in textures
local up_def = table.copy(down_def)
up_def.description = "Upwards-Facing Dropper"
up_def.description = S("Upwards-Facing Dropper")
up_def.tiles = {
"mcl_droppers_dropper_front_vertical.png", "default_furnace_bottom.png",
"default_furnace_side.png", "default_furnace_side.png",

View File

@ -1,3 +1,5 @@
local S = minetest.get_translator("mcl_observers")
local rules_flat = {
{ x = 0, y = 0, z = -1, spread = true },
}
@ -84,9 +86,9 @@ mesecon.register_node("mcl_observers:observer",
_mcl_hardness = 3.5,
},
{
description = "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_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.",
description = S("Observer"),
_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 = 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, },
tiles = {
"mcl_observers_observer_top.png^[transformR180", "default_furnace_bottom.png",

View File

@ -1,3 +1,4 @@
local S = minetest.get_translator("mesecons_commandblock")
local function construct(pos)
local meta = minetest.get_meta(pos)
@ -183,33 +184,27 @@ local on_place = function(itemstack, placer, pointed_thing)
end
minetest.register_node("mesecons_commandblock:commandblock_off", {
description = "Command Block",
description = S("Command Block"),
_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 =
[[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:
@c: commander of this command block
@n or @p: nearest player from the command block
@f farthest player from the command block
@r: random player currently in the world
@@: literal @ sign
S("Command blocks support placeholders, insert one of these placerholders and they will be replaced by a player name:").."\n"..
S("• “@c”: commander of this command block").."\n"..
S("• “@n” or “@p”: nearest player from the command block").."\n"..
S("• “@f” farthest player from the command block").."\n"..
S("• “@r”: random player currently in the world").."\n"..
S("• “@@”: literal “@” sign").."\n\n"..
Example 1:
time 12000
S("Example 1:\n time 12000\nSets the game clock to 12:00").."\n\n"..
Sets the game clock to 12:00
Example 2:
give @n mcl_core:apple 5
Gives the nearest player 5 apples]],
S("Example 2:\n give @n mcl_core:apple 5\n→ Gives the nearest player 5 apples"),
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},

View File

@ -1,3 +1,5 @@
local S = minetest.get_translator("mesecons_delayer")
local DELAYS = { 0.1, 0.2, 0.3, 0.4 }
local DEFAULT_DELAY = DELAYS[1]
@ -182,9 +184,9 @@ end
local help, longdesc, usagehelp, icon, on_construct
if i == 1 then
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."
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"..
"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."
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 = 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"..
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"
-- Check sides of constructed repeater and lock it, if required
@ -219,7 +221,7 @@ else
end
minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
description = "Redstone Repeater",
description = S("Redstone Repeater"),
inventory_image = icon,
wield_image = icon,
_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), {
description = "Redstone Repeater (Powered)",
description = S("Redstone Repeater (Powered)"),
_doc_items_create_entry = false,
drawtype = "nodebox",
tiles = {
@ -366,7 +368,7 @@ end
-- Locked repeater
minetest.register_node("mesecons_delayer:delayer_off_locked", {
description = "Redstone Repeater (Locked)",
description = S("Redstone Repeater (Locked)"),
_doc_items_create_entry = false,
drawtype = "nodebox",
-- 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", {
description = "Redstone Repeater (Locked, Powered)",
description = S("Redstone Repeater (Locked, Powered)"),
_doc_items_create_entry = false,
drawtype = "nodebox",
tiles = {

Some files were not shown because too many files have changed in this diff Show More