Compare commits

..

3 Commits
master ... 0.48

Author SHA1 Message Date
Wuzzy 235c557798 Version 0.48.1 2019-03-07 02:47:56 +01:00
Wuzzy 520df43679 Fix mcl_meshhand race condition 2019-03-07 02:46:21 +01:00
Wuzzy 29449eb8d4 Remove console spam from mcl_loot 2019-03-07 02:46:02 +01:00
1304 changed files with 12791 additions and 28139 deletions

1
API.md
View File

@ -21,7 +21,6 @@ All nodes can have these fields:
* `_mcl_hardness`: Hardness of the block, ranges from 0 to infinity (represented by -1). Determines digging times. Default: 0
* `_mcl_blast_resistance`: How well this block blocks and resists explosions. Default: 0
* `_mcl_falling_node_alternative`: If set to an itemstring, the node will turn into this node before it starts to fall.
* `_mcl_after_falling(pos)`: Called after a falling node finished falling and turned into a node.
Use the `mcl_sounds` mod for the sounds.

View File

@ -5,7 +5,7 @@ Wow, thank you! :-)
But first, some things to note:
MineClone 2's development target is to make a free software clone of Minecraft,
***version 1.11***, ***PC edition***.
***version 1.11*** (later: 1.12), ***PC edition***.
MineClone 2 is maintained by one person. Namely, Wuzzy. You can find me,
Wuzzy, in the Minetest forums (forums.minetest.net), in IRC in the #minetest
@ -26,8 +26,8 @@ For small and medium changes:
* Fork the repository
* Do your change in a new branch
* Upload the repository somewhere where it can be accessed from the Internet and
notify me
* Upload the repository somewhere where it can be accessed from the Internet
* Ask me to pull in your changes (and briefly say what you're changed)
For small changes, sending me a patch is also good.
@ -35,7 +35,7 @@ For big changes: Same as above, but consider notifying me first to avoid
duplicate work and possible tears of rejection. ;-)
## Quality remarks
Again: There is ***no*** guarantee I will accept anything from anybody.
Again: There is ***no*** guarantee I will accept anything from anything.
But I will gladly take in code from others when I feel it saves me work
in the long run.
@ -64,10 +64,10 @@ Depending on what you add, the chances for inclusion vary:
## Coding style guide
* Indentations should reflect the code flow
* Use tabs, not spaces for indentation (tab size = 8)
* Use tabs, not spaces for indentation
* Never use `minetest.env`
## Reporting bugs
Report all bugs and missing Minecraft features here:
<https://git.minetest.land/Wuzzy/MineClone2/issues>
<https://git.minetest.land/Wuzzy/MineClone2-Bugs>

View File

@ -36,11 +36,7 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
* `dig_by_piston=1`: Blocks which will drop as an item when pushed by a piston. They also cannot be pulled by sticky pistons
* `cultivatable=2`: Block will be turned into Farmland by using a hoe on it
* `cultivatable=1`: Block will be turned into Dirt by using a hoe on it
* `flammable`: Block spreads fire
* `flammable>0`: Gets destroyed by fire
* `flammable=-1` Does not get destroyed by fire
* `fire_encouragement`: How quickly this block catches fire
* `fire_flammability`: How fast the block will burn away
* `flammable`: Block helps spreading fire and gets destroyed by nearby fire (rating doesn't matter)
* `spreading_dirt_type=1`: A dirt-type block with a cover (e.g. grass) which may spread to neighbor dirt blocks
* `dirtifies_below_solid=1`: This node turns into dirt immediately when a solid or dirtifier node is placed on top
* `dirtifier=1`: This node turns nodes the above group into dirt when placed above
@ -60,16 +56,6 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
* `anvil`: Anvil. 1: No damage. 2-3: Higher damage levels
* `no_rename=1`: Item cannot be renamed by anvil
* `comparator_signal=X`: If set, this node outputs a constant (!) comparator signal output of strength X.
* `piston=X`: Piston (main body) (1 = normal, 2 = sticky)
* `piston_pusher=X`: Piston pusher (1 = normal, 2 = sticky)
* `hopper=X`: Hopper (1 = downwards, 2 = sideways)
* `portal=1`: Portal (node that teleports players and things by standing inside)
* `end_portal_frame=X`: End portal frame (1 = no eye, 2 = with eye)
* `coral=X`: Coral (any type) (1 = alive, 2 = dead)
* `coral_plant=X`: Coral in the "plant" shape (1 = alive, 2 = dead)
* `coral_fan=X`: Coral fan (1 = alive, 2 = dead)
* `coral_block=X`: Coral block (1 = alive, 2 = dead)
* `coral_species=X`: Specifies the species of a coral; equal X means equal species
#### Footnotes
@ -80,10 +66,8 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
### Groups (mostly) used for crafting recipes
* `sand=1`: Sand (any color)
* `sandstone=1`: Sandstone (any color) and related nodes (chiseled and the like) (only full blocks)
* `normal_sandstone=1`: “Normal” (yellow) sandstone and related nodes (chiseled and the like) (only full blocks)
* `red_sandstone=1`: Red sandstone and related nodes (chiseled and the like) (only full blocks)
* `hardened_clay=1`: Terracotta (any color)
* `sandstone=1`: (Yellow) sandstone and related nodes (chiseled and the like) (only full blocks)
* `redsandstone=1`: Red sandstone and related nodes (chiseled and the like) (only full blocks)
* `quartz_block=1`: Quartz Block and variants (chiseled, pillar, etc.) (only full blocks)
* `stonebrick=1`: Stone Bricks and related nodes (only full blocks)
* `shulker_box=1`: Block is a shulker box

View File

@ -8,6 +8,8 @@ For these features, no easy Lua workaround could be found.
### Lua API
#### Tools/wielded item
- Allow **much** faster liquid flowing ([#2810](https://github.com/minetest/minetest/issues/2810))
- “Lock” hotbar for a brief time after using an item, making it impossible to switch item or to attach/mine/build until the delay is over (For eating with delay)
- Tool charging: Holding down the mouse and releasing it, applying a “power level” (For bow and arrows, more charge = higher arrow range) ([issue 5212](https://github.com/minetest/minetest/issues/5212))
- [Dual Wielding](http://minecraft.gamepedia.com/Dual_wield)
@ -19,6 +21,7 @@ For these features, no easy Lua workaround could be found.
## Interface
- Inventory: Hold down right mouse button while holding an item stack to drop items into the slots as you move the mouse. Makes crafting MUCH faster
- **Much** more informative item tooltips
- Sneak+Leftclick on crafting output crafts as many items as possible and immediately puts it into the player inventory ([issue 5211](https://github.com/minetest/minetest/issues/5211))
- Sneak+click on inventory slot should be able to put items into additional “fallback inventories” if the first inventory is full. Required for large chests
- Sneak+click puts items in different inventories depending on the item type (maybe group-based)? Required for sneak-clicking to armor slots
@ -36,5 +39,8 @@ For these features, a workaround (or hack ;-)) by using Lua is theoretically pos
- Set damage frequency of `damage_per_second`. In Minecraft many things damage players every half-second rather than every second
- Possible to damage players directly when they are with the head inside. This allows to add Minecraft-like suffocation
#### Crafting
- Require tools to be intact in crafting
#### Nice-to-haye
- Utility function to rotate pillar-like nodes, requiring only 3 possible orientations (X, Y, Z). Basically this is `minetest.rotate_node` but with less orientations; the purpur pillar would mess up if a mirrored rotation would be possible. This is already implemented in MCL2, See `mcl_util` for more infos

View File

@ -1,8 +1,8 @@
# MineClone 2
An unofficial Minecraft-like game for Minetest. Forked from MineClone by davedevils.
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.65.2
Version: 0.48.1
### Gameplay
You start in a randomly-generated world made entirely of cubes. You can explore
@ -67,20 +67,21 @@ an explanation.
#### Incomplete items
These items do not work yet, but you can get them with `/giveme` for testing:
* Fishing Rod: `mcl_fishing:fishing_rod`
* Activator Rail: `mcl_minecarts:activator_rail`
* Minecart with Chest: `mcl_minecarts:chest_minecart`
* Minecart with Furnace: `mcl_minecarts:furnace_minecart`
* Minecart with Hopper: `mcl_minecarts:hopper_minecart`
* Minecart with Command Block: `mcl_minecarts:command_block_minecart`
## Installation
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.
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.
## Project description
The main goal of **MineClone 2** is to be a clone of Minecraft and to be released as free software.
@ -182,7 +183,7 @@ Technical differences from Minecraft:
## Reporting bugs
Please report all bugs and missing Minecraft features here:
<https://git.minetest.land/Wuzzy/MineClone2/issues>
<https://git.minetest.land/Wuzzy/MineClone2-Bugs>
## Other readme files
@ -196,26 +197,17 @@ There are so many people to list (sorry). Check out the respective mod directori
### Coding
* [Wuzzy](https://forum.minetest.net/memberlist.php?mode=viewprofile&u=3082): Main programmer of most mods
* davedevils: Creator of MineClone on which MineClone 2 is based on
* daredevils: Creator of MineClone on which MineClone 2 is based on
* [ex-bart](https://github.com/ex-bart): Redstone comparators
* [Rootyjr](https://github.com/Rootyjr): Fishing rod and bugfixes
* [aligator](https://github.com/aligator): Improvement of doors
* [ryvnf](https://github.com/ryvnf): Explosion mechanics
* Lots of other people: TO BE WRITTEN (see mod directories for details)
### Graphics
### Textures
* [XSSheep](http://www.minecraftforum.net/members/XSSheep): Main author; creator of the Pixel Perfection resource pack of Minecraft 1.11
* [Wuzzy](https://forum.minetest.net/memberlist.php?mode=viewprofile&u=3082): Main menu imagery and various edits and additions of texture pack
* [kingoscargames](https://github.com/kingoscargames): Various edits and additions of existing textures
* [leorockway](https://github.com/leorockway): Some edits of mob textures
* [xMrVizzy](https://minecraft.curseforge.com/members/xMrVizzy): Glazed terracotta (textures are subject to be replaced later)
* yutyo <tanakinci2002@gmail.com>: MineClone 2 logo
* Other authors: GUI images
### Translations
* Wuzzy: German
* Rocher Laurent <rocherl@club-internet.fr>: French
* wuniversales: Spanish
* Other authors: GUI images,
### Models
* [22i](https://github.com/22i): Creator of all models
@ -226,7 +218,7 @@ Various sources. See the respective mod directories for details.
### Special thanks
* davedevils for starting MineClone, the original version of this game
* daredevils for starting MineClone, the original version of this game
* celeron55 for creating Minetest
* Minetest's modding community for providing a huge selection of mods, some of which ended up in MineClone 2
* Jordach for the jukebox music compilation from Big Freaking Dig
@ -249,15 +241,13 @@ Here's the detailed legalese for those who need it:
### License of source code
MineClone 2 is a clean-room implementation of Minecraft
and licensed under the
GNU LGPL v2.1 (Wuzzy, davedevils and countless others) (see `LICENSE.txt`).
GNU LGPL v2.1 (Wuzzy, daredevils and countless others) (see `LICENSE.txt`).
MineClone 2 is a direct continuation of the discontinued MineClone
project by davedevils which fell under the same license.
project by daredevils which fell under the same license.
Mods credit:
See `README.txt` or `README.md` in each mod directory for information about other authors.
For mods that do not have such a file, the license is the source code license
of MineClone 2 and the author is Wuzzy.
### License of media (textures and sounds)
No non-free licenses are used anywhere.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,9 +1,7 @@
# This is a game specific minetest.conf file, do not edit
# This is a game specify minetest.conf file, do not edit
# Basic game rules
time_speed = 72
# Player physics
movement_acceleration_default = 2.4
movement_acceleration_air = 1.2
#movement_acceleration_fast = 10
@ -22,12 +20,4 @@ movement_liquid_sink = 23
movement_gravity = 10.4
# Mapgen stuff
# altitude_chill and altitude_dry doesn't go well together with MCL2 biomes
# which already include "snowed" variants as you go higher.
# humid_rivers would cause the MushroomIsland biome to appear frequently around rivers.
mgvalleys_spflags = noaltitude_chill,noaltitude_dry,nohumid_rivers,vary_river_depth
# MCL2-specific stuff
keepInventory = false

View File

@ -1,42 +0,0 @@
# Biome Info API
This document explains the API of this mod.
## v6 mapgen functions
These are functions for the v6 mapgen only.
Use these functions only in worlds in which the v6 mapgen is used.
If you use these in any other mapgen, bad things might happen.
### `biomeinfo.get_v6_humidity(pos)`
Get the biome humidity at pos (for v6 mapgen).
### `biomeinfo.get_v6_heat(pos)`
Get the biome heat/temperature at pos (for v6 mapgen).
### `biomeinfo.get_v6_biome(pos)`
Get the v6 biome at pos.
Returns a string, which is the unique biome name.
Note: This function currently ignores the `biomeblend` v6 mapgen flag,
it just pretends this setting is disabled.
This is normally not a problem, but at areas where biomes blend,
the result is not perfectly accurate and just an estimate.
### `biomeinfo.get_active_v6_biomes()`
Returns a table containing the names of all v6 biomes that are actively
used in the current world, e.g. those that have been activated
by the use of the mapgen v6 flags (`mgv6_spflags`).
### `biomeinfo.all_v6_biomes`
This is a table containing all v6 biomes (as strings), even those that
might not be used in the current world.
### v6 biome names
These are the biome names used in this mod:
* Normal
* Desert
* Jungle
* Tundra
* Taiga

View File

@ -1,11 +0,0 @@
# Biome Info API [`biomeinfo`]
This is an API mod for mod developers to add a couple of missing
biome-related functions.
Currently, this mod only adds v6-related functions.
Most importantly, you can get the heat, humidity and biome in the v6 mapgen.
See `API.md` for the API documentation.
Current version: 1.0.3 (this is a [SemVer](https://semver.org/))
License: MIT License

View File

@ -1,211 +0,0 @@
biomeinfo = {}
-- Copied from mapgen_v6.h
local MGV6_FREQ_HOT = 0.4
local MGV6_FREQ_SNOW = -0.4
local MGV6_FREQ_TAIGA = 0.5
local MGV6_FREQ_JUNGLE = 0.5
-- Biome types
local BT_NORMAL = "Normal"
local BT_TUNDRA = "Tundra"
local BT_TAIGA = "Taiga"
local BT_DESERT = "Desert"
local BT_JUNGLE = "Jungle"
-- Get mapgen settings
local seed = tonumber(minetest.get_mapgen_setting("seed")) or 0
local mgv6_perlin_biome, mgv6_perlin_humidity, mgv6_np_biome
-- v6 default noiseparams are hardcoded here because Minetest doesn't give us those
local mgv6_np_biome_default = {
offset = 0,
scale = 1,
spread = { x = 500, y = 500, z = 500},
seed = 9130,
octaves = 3,
persistence = 0.50,
lacunarity = 2.0,
flags = "eased",
}
local mgv6_np_humidity_default = {
offset = 0.5,
scale = 0.5,
spread = { x = 500, y = 500, z = 500},
seed = 72384,
octaves = 3,
persistence = 0.50,
lacunarity = 2.0,
flags = "eased",
}
local v6_flags_str = minetest.get_mapgen_setting("mgv6_spflags")
if v6_flags_str == nil then
v6_flags_str = ""
end
local v6_flags = string.split(v6_flags_str)
local v6_use_snow_biomes = true
local v6_use_jungles = true
-- TODO: Implement biome blend.
-- Currently we pretend biome blend is disabled.
-- This just makes the calculations inaccurate near biome boundaries,
-- but should be fine otherwise.
local v6_use_biome_blend = false
for f=1, #v6_flags do
local flag = v6_flags[f]:trim()
if flag == "nosnowbiomes" then
v6_use_snow_biomes = false
end
if flag == "snowbiomes" then
v6_use_snow_biomes = true
end
if flag == "nojungles" then
v6_use_jungles = false
end
if flag == "jungles" then
v6_use_jungles = true
end
if flag == "nobiomeblend" then
v6_use_biome_blend = false
end
-- TODO
-- if flag == "biomeblend" then
-- v6_use_biome_blend = true
-- end
end
-- Force-enable jungles when snowbiomes flag is set
if v6_use_snow_biomes then
v6_use_jungles = true
end
local v6_freq_desert = tonumber(minetest.get_mapgen_setting("mgv6_freq_desert") or 0.45)
local NOISE_MAGIC_X = 1619
local NOISE_MAGIC_Y = 31337
local NOISE_MAGIC_Z = 52591
local NOISE_MAGIC_SEED = 1013
local noise2d = function(x, y, seed)
-- TODO: implement noise2d function for biome blend
return 0
--[[
local n = (NOISE_MAGIC_X * x + NOISE_MAGIC_Y * y
+ NOISE_MAGIC_SEED * seed) & 0x7fffffff;
n = (n >> 13) ^ n;
n = (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;
return 1.0 - n / 0x40000000;
]]
end
biomeinfo.all_v6_biomes = {
BT_NORMAL,
BT_DESERT,
BT_JUNGLE,
BT_TUNDRA,
BT_TAIGA
}
local function init_perlins()
if not mgv6_perlin_biome then
mgv6_np_biome = minetest.get_mapgen_setting_noiseparams("mgv6_np_biome")
if not mgv6_np_biome then
mgv6_np_biome = mgv6_np_biome_default
minetest.log("action", "[biomeinfo] Using hardcoded mgv6_np_biome default")
end
mgv6_perlin_biome = minetest.get_perlin(mgv6_np_biome)
end
if not mgv6_perlin_humidity then
local np_humidity = minetest.get_mapgen_setting_noiseparams("mgv6_np_humidity")
if not np_humidity then
np_humidity = mgv6_np_humidity_default
minetest.log("action", "[biomeinfo] Using hardcoded mgv6_np_humidity default")
end
mgv6_perlin_humidity = minetest.get_perlin(np_humidity)
end
end
function biomeinfo.get_active_v6_biomes()
local biomes = { BT_NORMAL, BT_DESERT }
if v6_use_jungles then
table.insert(biomes, BT_JUNGLE)
end
if v6_use_snow_biomes then
table.insert(biomes, BT_TUNDRA)
table.insert(biomes, BT_TAIGA)
end
return biomes
end
function biomeinfo.get_v6_heat(pos)
init_perlins()
if not mgv6_perlin_biome then
return nil
end
local bpos = vector.floor(pos)
-- The temperature noise needs a special offset (see calculateNoise in mapgen_v6.cpp)
return mgv6_perlin_biome:get_2d({x=bpos.x + mgv6_np_biome.spread.x*0.6, y=bpos.z + mgv6_np_biome.spread.z*0.2})
end
function biomeinfo.get_v6_humidity(pos)
init_perlins()
if not mgv6_perlin_humidity then
return nil
end
local bpos = vector.floor(pos)
return mgv6_perlin_humidity:get_2d({x=bpos.x, y=bpos.z})
end
-- Returns the v6 biome at pos.
-- Returns a string representing the biome name.
function biomeinfo.get_v6_biome(pos)
init_perlins()
local bpos = vector.floor(pos)
-- Based on the algorithm MapgenV6::getBiome in mapgen_v6.cpp
local pos2d = {x=bpos.x, y=bpos.z}
if not mgv6_perlin_biome or not mgv6_perlin_humidity then
return "???"
end
local d = biomeinfo.get_v6_heat(bpos)
local h = biomeinfo.get_v6_humidity(bpos)
if (v6_use_snow_biomes) then
local blend
if v6_use_biome_blend then
blend = noise2d(pos2d.x, pos2d.y, seed) / 40
else
blend = 0
end
if (d > MGV6_FREQ_HOT + blend) then
if (h > MGV6_FREQ_JUNGLE + blend) then
return BT_JUNGLE
end
return BT_DESERT
end
if (d < MGV6_FREQ_SNOW + blend) then
if (h > MGV6_FREQ_TAIGA + blend) then
return BT_TAIGA
end
return BT_TUNDRA
end
return BT_NORMAL
end
if (d > v6_freq_desert) then
return BT_DESERT
end
if ((v6_use_biome_blend) and (d > v6_freq_desert - 0.10) and
((noise2d(pos2d.x, pos2d.y, seed) + 1.0) > (v6_freq_desert - d) * 20.0)) then
return BT_DESERT
end
if ((v6_use_jungles) and (h > 0.75)) then
return BT_JUNGLE
end
return BT_NORMAL
end

View File

@ -1,2 +0,0 @@
name = biomeinfo
description = Simple API to get data about biomes.

View File

@ -7,17 +7,15 @@ minetest.check_single_for_falling = function(pos)
local node = minetest.get_node(pos)
if minetest.get_item_group(node.name, "attached_node_facedir") ~= 0 then
local dir = minetest.facedir_to_dir(node.param2)
if dir then
local cpos = vector.add(pos, dir)
local cnode = minetest.get_node(cpos)
if minetest.get_item_group(cnode.name, "solid") == 0 then
minetest.remove_node(pos)
local drops = minetest.get_node_drops(node.name, "")
for dr=1, #drops do
minetest.add_item(pos, drops[dr])
end
ret = true
local cpos = vector.add(pos, dir)
local cnode = minetest.get_node(cpos)
if minetest.get_item_group(cnode.name, "solid") == 0 then
minetest.remove_node(pos)
local drops = minetest.get_node_drops(node.name, "")
for dr=1, #drops do
minetest.add_item(pos, drops[dr])
end
ret = true
end
end

View File

@ -1,383 +0,0 @@
--[[
Explosion API mod for Minetest (adapted to MineClone 2)
This mod is based on the Minetest explosion API mod, but has been changed
to have the same explosion mechanics as Minecraft and work with MineClone.
The computation-intensive parts of the mod has been optimized to allow for
larger explosions and faster world updating.
This mod was created by Elias Astrom <ryvnf@riseup.net> and is released
under the LGPLv2.1 license.
--]]
mcl_explosions = {}
local creative_mode = minetest.settings:get_bool("creative_mode")
local mod_death_messages = minetest.get_modpath("mcl_death_messages") ~= nil
local mod_fire = minetest.get_modpath("mcl_fire") ~= nil
local CONTENT_FIRE = minetest.get_content_id("mcl_fire:fire")
local S = minetest.get_translator("mcl_explosions")
-- Saved sphere explosion shapes for various radiuses
local sphere_shapes = {}
-- Saved node definitions in table using cid-keys for faster look-up.
local node_blastres = {}
local node_on_blast = {}
local node_walkable = {}
-- The step length for the rays (Minecraft uses 0.3)
local STEP_LENGTH = 0.3
-- How many rays to compute entity exposure to explosion
local N_EXPOSURE_RAYS = 16
minetest.register_on_mods_loaded(function()
-- Store blast resistance values by content ids to improve performance.
for name, def in pairs(minetest.registered_nodes) do
node_blastres[minetest.get_content_id(name)] = def._mcl_blast_resistance or 0
node_on_blast[minetest.get_content_id(name)] = def.on_blast
node_walkable[minetest.get_content_id(name)] = def.walkable
end
end)
-- Compute the rays which make up a sphere with radius. Returns a list of rays
-- which can be used to trace explosions. This function is not efficient
-- (especially for larger radiuses), so the generated rays for various radiuses
-- should be cached and reused.
--
-- Should be possible to improve by using a midpoint circle algorithm multiple
-- times to create the sphere, currently uses more of a brute-force approach.
local function compute_sphere_rays(radius)
local rays = {}
local sphere = {}
for i=1, 2 do
for y = -radius, radius do
for z = -radius, radius do
for x = -radius, 0, 1 do
local d = x * x + y * y + z * z
if d <= radius * radius then
local pos = { x = x, y = y, z = z }
sphere[minetest.hash_node_position(pos)] = pos
break
end
end
end
end
end
for i=1,2 do
for x = -radius, radius do
for z = -radius, radius do
for y = -radius, 0, 1 do
local d = x * x + y * y + z * z
if d <= radius * radius then
local pos = { x = x, y = y, z = z }
sphere[minetest.hash_node_position(pos)] = pos
break
end
end
end
end
end
for i=1,2 do
for x = -radius, radius do
for y = -radius, radius do
for z = -radius, 0, 1 do
local d = x * x + y * y + z * z
if d <= radius * radius then
local pos = { x = x, y = y, z = z }
sphere[minetest.hash_node_position(pos)] = pos
break
end
end
end
end
end
for _, pos in pairs(sphere) do
rays[#rays + 1] = vector.normalize(pos)
end
return rays
end
-- Add particles from explosion
--
-- Parameters:
-- pos - The position of the explosion
-- radius - The radius of the explosion
local function add_particles(pos, radius)
minetest.add_particlespawner({
amount = 64,
time = 0.125,
minpos = pos,
maxpos = pos,
minvel = {x = -radius, y = -radius, z = -radius},
maxvel = {x = radius, y = radius, z = radius},
minacc = vector.new(),
maxacc = vector.new(),
minexptime = 0.5,
maxexptime = 1.0,
minsize = radius * 0.5,
maxsize = radius * 1.0,
texture = "tnt_smoke.png",
})
end
-- Traces the rays of an explosion, and updates the environment.
--
-- Parameters:
-- pos - Where the rays in the explosion should start from
-- strength - The strength of each ray
-- raydirs - The directions for each ray
-- radius - The maximum distance each ray will go
-- drop_chance - The chance that destroyed nodes will drop their items
-- fire - If true, 1/3 of destroyed nodes become fire
-- puncher - object that punches other objects (optional)
--
-- Note that this function has been optimized, it contains code which has been
-- inlined to avoid function calls and unnecessary table creation. This was
-- measured to give a significant performance increase.
local function trace_explode(pos, strength, raydirs, radius, drop_chance, fire, puncher)
local vm = minetest.get_voxel_manip()
local emin, emax = vm:read_from_map(vector.subtract(pos, radius),
vector.add(pos, radius))
local emin_x = emin.x
local emin_y = emin.y
local emin_z = emin.z
local ystride = (emax.x - emin_x + 1)
local zstride = ystride * (emax.y - emin_y + 1)
local pos_x = pos.x
local pos_y = pos.y
local pos_z = pos.z
local area = VoxelArea:new {
MinEdge = emin,
MaxEdge = emax
}
local data = vm:get_data()
local destroy = {}
-- Trace rays for environment destruction
for i = 1, #raydirs do
local rpos_x = pos.x
local rpos_y = pos.y
local rpos_z = pos.z
local rdir_x = raydirs[i].x
local rdir_y = raydirs[i].y
local rdir_z = raydirs[i].z
local rstr = (0.7 + math.random() * 0.6) * strength
for r = 0, math.ceil(radius * (1.0 / STEP_LENGTH)) do
local npos_x = math.floor(rpos_x + 0.5)
local npos_y = math.floor(rpos_y + 0.5)
local npos_z = math.floor(rpos_z + 0.5)
local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride +
npos_x - emin_x + 1
local cid = data[idx]
local br = node_blastres[cid]
local hash = (npos_z + 32768) * 65536 * 65536 +
(npos_y + 32768) * 65536 +
npos_x + 32768
rpos_x = rpos_x + STEP_LENGTH * rdir_x
rpos_y = rpos_y + STEP_LENGTH * rdir_y
rpos_z = rpos_z + STEP_LENGTH * rdir_z
rstr = rstr - 0.75 * STEP_LENGTH - (br + 0.3) * STEP_LENGTH
if rstr <= 0 then
break
end
if cid ~= minetest.CONTENT_AIR then
destroy[hash] = idx
end
end
end
-- Entities in radius of explosion
local punch_radius = 2 * strength
local objs = minetest.get_objects_inside_radius(pos, punch_radius)
-- Trace rays for entity damage
for _, obj in pairs(objs) do
local ent = obj:get_luaentity()
-- Ignore items to lower lag
if obj:is_player() or (ent and ent.name ~= '__builtin.item') then
local opos = obj:get_pos()
local collisionbox = nil
if obj:is_player() then
collisionbox = { -0.3, 0.0, -0.3, 0.3, 1.77, 0.3 }
elseif ent.name then
local def = minetest.registered_entities[ent.name]
collisionbox = def.collisionbox
end
if collisionbox then
-- Create rays from random points in the collision box
local x1 = collisionbox[1] * 2
local y1 = collisionbox[2] * 2
local z1 = collisionbox[3] * 2
local x2 = collisionbox[4] * 2
local y2 = collisionbox[5] * 2
local z2 = collisionbox[6] * 2
local x_len = math.abs(x2 - x1)
local y_len = math.abs(y2 - y1)
local z_len = math.abs(z2 - z1)
-- Move object position to the center of its bounding box
opos.x = opos.x + x1 + x2
opos.y = opos.y + y1 + y2
opos.z = opos.z + z1 + z2
-- Count number of rays from collision box which are unobstructed
local count = N_EXPOSURE_RAYS
for i = 1, N_EXPOSURE_RAYS do
local rpos_x = opos.x + math.random() * x_len - x_len / 2
local rpos_y = opos.y + math.random() * y_len - y_len / 2
local rpos_z = opos.z + math.random() * z_len - z_len / 2
local rdir_x = pos.x - rpos_x
local rdir_y = pos.y - rpos_y
local rdir_z = pos.z - rpos_z
local rdir_len = math.hypot(rdir_x, math.hypot(rdir_y, rdir_z))
rdir_x = rdir_x / rdir_len
rdir_y = rdir_y / rdir_len
rdir_z = rdir_z / rdir_len
for i=0, rdir_len / STEP_LENGTH do
rpos_x = rpos_x + rdir_x * STEP_LENGTH
rpos_y = rpos_y + rdir_y * STEP_LENGTH
rpos_z = rpos_z + rdir_z * STEP_LENGTH
local npos_x = math.floor(rpos_x + 0.5)
local npos_y = math.floor(rpos_y + 0.5)
local npos_z = math.floor(rpos_z + 0.5)
local idx = (npos_z - emin_z) * zstride + (npos_y - emin_y) * ystride +
npos_x - emin_x + 1
local cid = data[idx]
local walkable = node_walkable[cid]
if walkable then
count = count - 1
break
end
end
end
-- Punch entity with damage depending on explosion exposure and
-- distance to explosion
local exposure = count / N_EXPOSURE_RAYS
local punch_vec = vector.subtract(opos, pos)
local punch_dir = vector.normalize(punch_vec)
local impact = (1 - vector.length(punch_vec) / punch_radius) * exposure
if impact < 0 then
impact = 0
end
local damage = math.floor((impact * impact + impact) * 7 * strength + 1)
if mod_death_messages and obj:is_player() then
mcl_death_messages.player_damage(obj, S("@1 was caught in an explosion.", obj:get_player_name()))
end
local source = puncher
if not source then
source = obj
end
obj:punch(source, 10, { damage_groups = { full_punch_interval = 1,
fleshy = damage, knockback = impact * 20.0 } }, punch_dir)
if obj:is_player() then
obj:add_player_velocity(vector.multiply(punch_dir, impact * 20))
elseif ent.tnt_knockback then
obj:add_velocity(vector.multiply(punch_dir, impact * 20))
end
end
end
end
-- Remove destroyed blocks and drop items
for hash, idx in pairs(destroy) do
local do_drop = not creative_mode and math.random() <= drop_chance
local on_blast = node_on_blast[data[idx]]
local remove = true
if do_drop or on_blast ~= nil then
local npos = minetest.get_position_from_hash(hash)
if on_blast ~= nil then
remove = on_blast(npos, 1.0)
else
local name = minetest.get_name_from_content_id(data[idx])
local drop = minetest.get_node_drops(name, "")
for _, item in ipairs(drop) do
if type(item) ~= "string" then
item = item:get_name() .. item:get_count()
end
minetest.add_item(npos, item)
end
end
end
if remove then
if mod_fire and fire and math.random(1, 3) == 1 then
data[idx] = CONTENT_FIRE
else
data[idx] = minetest.CONTENT_AIR
end
end
end
-- Log explosion
minetest.log('action', 'Explosion at ' .. minetest.pos_to_string(pos) ..
' with strength ' .. strength .. ' and radius ' .. radius)
-- Update environment
vm:set_data(data)
vm:write_to_map(data)
vm:update_liquids()
end
-- Create an explosion with strength at pos.
--
-- Parameters:
-- pos - The position where the explosion originates from
-- strength - The blast strength of the explosion (a TNT explosion uses 4)
-- info - Table containing information about explosion.
-- puncher - object that is reported as source of punches/damage (optional)
--
-- Values in info:
-- drop_chance - If specified becomes the drop chance of all nodes in the
-- explosion (defaults to 1.0 / strength)
-- no_sound - If true then the explosion will not play a sound
-- no_particle - If true then the explosion will not create particles
-- fire - If true, 1/3 nodes become fire (default: false)
function mcl_explosions.explode(pos, strength, info, puncher)
-- The maximum blast radius (in the air)
local radius = math.ceil(1.3 * strength / (0.3 * 0.75) * 0.3)
if not sphere_shapes[radius] then
sphere_shapes[radius] = compute_sphere_rays(radius)
end
local shape = sphere_shapes[radius]
trace_explode(pos, strength, shape, radius, (info and info.drop_chance) or 1 / strength, info.fire == true, puncher)
if not (info and info.no_sound) then
add_particles(pos, radius)
end
if not (info and info.no_particle) then
minetest.sound_play("tnt_explode", {
pos = pos, gain = 1.0,
max_hear_distance = strength * 16
}, true)
end
end

View File

@ -1,2 +0,0 @@
# textdomain:mcl_explosions
@1 was caught in an explosion.=@1 wurde Opfer einer Explosion.

View File

@ -1,2 +0,0 @@
# textdomain:mcl_explosions
@1 was caught in an explosion.=

View File

@ -1,3 +0,0 @@
name = mcl_explosions
description = A common API to create explosions.
optional_depends = mcl_fire

View File

@ -1,23 +1,12 @@
-- Some global variables (don't overwrite them!)
mcl_vars = {}
--- GUI / inventory menu settings
--- GUI / inventory menu colors
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 ..
"style_type[image_button;border=false;bgimg=mcl_inventory_button9.png;bgimg_pressed=mcl_inventory_button9_pressed.png;bgimg_middle=2,2]"..
"style_type[button;border=false;bgimg=mcl_inventory_button9.png;bgimg_pressed=mcl_inventory_button9_pressed.png;bgimg_middle=2,2]"..
"style_type[field;textcolor=#323232]"..
"style_type[label;textcolor=#323232]"..
"style_type[textarea;textcolor=#323232]"..
"style_type[checkbox;textcolor=#323232]"
mcl_vars.gui_bg = "bgcolor[#080808BB;true]"
mcl_vars.gui_bg_img = ""
-- Background stuff must be manually added by mods (no formspec prepend)
mcl_vars.gui_bg_color = "bgcolor[#00000000]"
mcl_vars.gui_bg_img = "background9[1,1;1,1;mcl_base_textures_background9.png;true;7]"
-- Legacy
mcl_vars.inventory_header = ""
mcl_vars.inventory_header = mcl_vars.gui_slots .. mcl_vars.gui_bg
-- Mapgen variables
local mg_name = minetest.get_mapgen_setting("mg_name")
@ -92,7 +81,7 @@ end
mcl_vars.mg_end_min = -27073 -- Carefully chosen to be at a mapchunk border
mcl_vars.mg_end_max_official = mcl_vars.mg_end_min + minecraft_height_limit
mcl_vars.mg_end_max = mcl_vars.mg_overworld_min - 2000
mcl_vars.mg_end_platform_pos = { x = 100, y = mcl_vars.mg_end_min + 74, z = 0 }
mcl_vars.mg_end_platform_pos = { x = 100, y = mcl_vars.mg_end_min + 80, z = 0 }
-- Realm barrier used to safely separate the End from the void below the Overworld
mcl_vars.mg_realm_barrier_overworld_end_max = mcl_vars.mg_end_max

View File

@ -4,9 +4,6 @@ Licenses of sounds
Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
http://creativecommons.org/licenses/by-sa/4.0/
Creative Commons Attribution 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by/3.0/
@ -89,9 +86,5 @@ Adam_N (CC0 1.0):
player_falling_damage.ogg
Source: <https://www.freesound.org/people/Adam_N/sounds/346692/>
Alecia Shepherd (CC BY-SA 4.0):
mcl_sounds_cloth.ogg
Source: SnowSong sound and music pack <https://opengameart.org/content/snowsong-sound-and-music-pack>
Unknown authors (WTFPL):
pedology_snow_soft_footstep.*.ogg

View File

@ -97,20 +97,6 @@ function mcl_sounds.node_sound_wood_defaults(table)
return table
end
function mcl_sounds.node_sound_wool_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="mcl_sounds_cloth", gain=0.5}
table.dug = table.dug or
{name="mcl_sounds_cloth", gain=1.0}
table.dig = table.dig or
{name="mcl_sounds_cloth", gain=0.9}
table.place = table.dig or
{name="mcl_sounds_cloth", gain=1.0}
mcl_sounds.node_sound_defaults(table)
return table
end
function mcl_sounds.node_sound_leaves_defaults(table)
table = table or {}
table.footstep = table.footstep or
@ -164,5 +150,5 @@ end
-- Player death sound
minetest.register_on_dieplayer(function(player)
-- TODO: Add separate death sound
minetest.sound_play({name="player_damage", gain = 1.0}, {pos=player:get_pos(), max_hear_distance=16}, true)
minetest.sound_play({name="player_damage", gain = 1.0}, {pos=player:get_pos(), max_hear_distance=16})
end)

View File

@ -174,15 +174,14 @@ function mcl_util.move_item(source_inventory, source_list, source_stack_id, dest
if not source_inventory:is_empty(source_list) then
local stack = source_inventory:get_stack(source_list, source_stack_id)
local item = stack:get_name()
if not stack:is_empty() then
local new_stack = ItemStack(stack)
new_stack:set_count(1)
if not destination_inventory:room_for_item(destination_list, new_stack) then
if not destination_inventory:room_for_item(destination_list, item) then
return false
end
stack:take_item()
source_inventory:set_stack(source_list, source_stack_id, stack)
destination_inventory:add_item(destination_list, new_stack)
destination_inventory:add_item(destination_list, item)
return true
end
end
@ -385,7 +384,7 @@ function mcl_util.generate_on_place_plant_function(condition)
if success then
if idef.sounds and idef.sounds.place then
minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1}, true)
minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1})
end
end
itemstack = new_itemstack

0
mods/CORE/modpack.txt Normal file
View File

View File

@ -1,11 +1,11 @@
Walkover
WalkOver
--------
Some mode developers have shown an interest in having an `on_walk_over` event. This is useful for pressure-plates and the like.
Some mode developers have shown an interest in having an on_walk_over event. This is useful for pressure-plates and the like.
See this issue - https://github.com/minetest/minetest/issues/247
I have implemented a server-side version in Lua using globalstep which people might find useful. Of course this would better implemented via a client-based "on walk over", but it is sufficient for my needs now.
I have implemented a server_side version in lua using globalstep which people might find useful. Of course this would better implemented via a client-based "on walk over", but it is sufficient for my needs now.
Example Usage
-------------
@ -19,6 +19,3 @@ Example Usage
})
Credits
-------
Mod created by lordfingle, licensed under Apache License 2.0.

View File

@ -12,17 +12,15 @@ minetest.register_entity("drippingwater:drop_water", {
hp_max = 1,
physical = true,
collide_with_objects = false,
collisionbox = {-0.025,-0.05,-0.025,0.025,-0.01,0.025},
pointable = false,
collisionbox = {0,0,0,0,0,0},
visual = "cube",
visual_size = {x=0.05, y=0.1},
textures = {water_tex, water_tex, water_tex, water_tex, water_tex, water_tex},
spritediv = {x=1, y=1},
initial_sprite_basepos = {x=0, y=0},
static_save = false,
on_activate = function(self, staticdata)
self.object:set_sprite({x=0,y=0}, 1, 1, true)
self.object:setsprite({x=0,y=0}, 1, 1, true)
end,
on_step = function(self, dtime)
@ -30,16 +28,16 @@ minetest.register_entity("drippingwater:drop_water", {
local ownpos = self.object:get_pos()
if k==1 then
self.object:set_acceleration({x=0, y=-5, z=0})
self.object:setacceleration({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:set_acceleration({x=0, y=-5, z=0})
self.object:setacceleration({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:remove()
minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8})
end
end,
})
@ -52,18 +50,15 @@ minetest.register_entity("drippingwater:drop_lava", {
hp_max = 1,
physical = true,
collide_with_objects = false,
collisionbox = {-0.025,-0.05,-0.025,0.025,-0.01,0.025},
glow = math.max(7, minetest.registered_nodes["mcl_core:lava_source"].light_source - 3),
pointable = false,
collisionbox = {0,0,0,0,0,0},
visual = "cube",
visual_size = {x=0.05, y=0.1},
textures = {lava_tex, lava_tex, lava_tex, lava_tex, lava_tex, lava_tex},
spritediv = {x=1, y=1},
initial_sprite_basepos = {x=0, y=0},
static_save = false,
on_activate = function(self, staticdata)
self.object:set_sprite({x=0,y=0}, 1, 0, true)
self.object:setsprite({x=0,y=0}, 1, 0, true)
end,
on_step = function(self, dtime)
@ -71,17 +66,17 @@ minetest.register_entity("drippingwater:drop_lava", {
local ownpos = self.object:get_pos()
if k==1 then
self.object:set_acceleration({x=0, y=-5, z=0})
self.object:setacceleration({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:set_acceleration({x=0, y=-5, z=0})
self.object:setacceleration({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:remove()
minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true)
minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8})
end
end,
})
@ -93,7 +88,7 @@ minetest.register_entity("drippingwater:drop_lava", {
minetest.register_abm(
{
label = "Create water drops",
nodenames = {"group:opaque", "group:leaves"},
nodenames = {"group:solid"},
neighbors = {"group:water"},
interval = 2,
chance = 22,
@ -111,7 +106,7 @@ minetest.register_abm(
minetest.register_abm(
{
label = "Create lava drops",
nodenames = {"group:opaque"},
nodenames = {"group:solid"},
neighbors = {"group:lava"},
interval = 2,
chance = 22,

View File

@ -10,7 +10,8 @@ License of boat model:
GNU GPLv3 <https://www.gnu.org/licenses/gpl-3.0.html>
## Textures
See the main MineClone 2 README.md file to learn more.
All textures are from the Faithful texture pack for Minecraft.
See the main MineClone 2 license to learn more.
## Code
Code based on Minetest Game, licensed under the MIT License (MIT).

View File

@ -1,4 +1,3 @@
local S = minetest.get_translator("mcl_boats")
--
-- Helper functions
--
@ -34,8 +33,6 @@ local boat_visual_size = {x = 3, y = 3}
local driver_visual_size = { x = 1/boat_visual_size.x, y = 1/boat_visual_size.y }
local paddling_speed = 22
local boat_y_offset = 0.35
local boat_y_offset_ground = boat_y_offset + 0.6
local boat_side_offset = 1.001
--
-- Boat entity
@ -72,7 +69,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:set_pos(pos)
clicker:setpos(pos)
elseif not self._driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
@ -85,7 +82,7 @@ function boat.on_rightclick(self, clicker)
end
self._driver = clicker
clicker:set_attach(self.object, "",
{x = 0, y = 0.42, z = -1}, {x = 0, y = 0, z = 0})
{x = 0, y = 3.75, 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)
@ -94,7 +91,7 @@ function boat.on_rightclick(self, clicker)
mcl_player.player_set_animation(player, "sit" , 30)
end
end, name)
clicker:set_look_horizontal(self.object:get_yaw())
clicker:set_look_horizontal(self.object:getyaw())
end
end
@ -146,29 +143,13 @@ function boat.on_punch(self, puncher)
end
function boat.on_step(self, dtime)
self._v = get_v(self.object:get_velocity()) * get_sign(self._v)
local on_water = true
local in_water = false
local v_factor = 1
local v_slowdown = 0.02
local p = self.object:get_pos()
if (not is_water({x=p.x, y=p.y-boat_y_offset, z=p.z})) then
on_water = false
v_factor = 0.5
v_slowdown = 0.04
elseif (is_water({x=p.x, y=p.y-boat_y_offset+1, z=p.z})) then
on_water = false
in_water = true
v_factor = 0.75
v_slowdown = 0.05
end
self._v = get_v(self.object:getvelocity()) * get_sign(self._v)
if self._driver then
local ctrl = self._driver:get_player_control()
local yaw = self.object:get_yaw()
local yaw = self.object:getyaw()
if ctrl.up then
-- Forwards
self._v = self._v + 0.1 * v_factor
self._v = self._v + 0.1
-- Paddling animation
if self._animation ~= 1 then
@ -177,7 +158,7 @@ function boat.on_step(self, dtime)
end
elseif ctrl.down then
-- Backwards
self._v = self._v - 0.1 * v_factor
self._v = self._v - 0.1
-- Paddling animation, reversed
if self._animation ~= -1 then
@ -193,15 +174,15 @@ function boat.on_step(self, dtime)
end
if ctrl.left then
if self._v < 0 then
self.object:set_yaw(yaw - (1 + dtime) * 0.03 * v_factor)
self.object:setyaw(yaw - (1 + dtime) * 0.03)
else
self.object:set_yaw(yaw + (1 + dtime) * 0.03 * v_factor)
self.object:setyaw(yaw + (1 + dtime) * 0.03)
end
elseif ctrl.right then
if self._v < 0 then
self.object:set_yaw(yaw + (1 + dtime) * 0.03 * v_factor)
self.object:setyaw(yaw + (1 + dtime) * 0.03)
else
self.object:set_yaw(yaw - (1 + dtime) * 0.03 * v_factor)
self.object:setyaw(yaw - (1 + dtime) * 0.03)
end
end
else
@ -211,65 +192,73 @@ function boat.on_step(self, dtime)
self._animation = 0
end
end
local s = get_sign(self._v)
if not on_water and not in_water and math.abs(self._v) > 1.0 then
v_slowdown = math.min(math.abs(self._v) - 1.0, v_slowdown * 5)
elseif in_water and math.abs(self._v) > 1.5 then
v_slowdown = math.min(math.abs(self._v) - 1.5, v_slowdown * 5)
local velo = self.object:getvelocity()
if self._v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:get_pos())
return
end
self._v = self._v - v_slowdown * s
local s = get_sign(self._v)
self._v = self._v - 0.02 * s
if s ~= get_sign(self._v) then
self.object:setvelocity({x = 0, y = 0, z = 0})
self._v = 0
return
end
if math.abs(self._v) > 5 then
self._v = 5 * get_sign(self._v)
end
local p = self.object:get_pos()
p.y = p.y - boat_y_offset
local new_velo
local new_acce = {x = 0, y = 0, z = 0}
if not is_water(p) then
-- Not on water or inside water: Free fall
local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
new_acce = {x = 0, y = -9.8, z = 0}
new_velo = get_velocity(self._v, self.object:get_yaw(),
self.object:get_velocity().y)
if (not nodedef) or nodedef.walkable then
self._v = 0
new_acce = {x = 0, y = 1, z = 0}
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())
else
p.y = p.y + 1
if is_water(p) then
-- Inside water: Slowly sink
local y = self.object:get_velocity().y
y = y - 0.01
if y < -0.2 then
y = -0.2
end
new_acce = {x = 0, y = 0, z = 0}
new_velo = get_velocity(self._v, self.object:get_yaw(), y)
else
-- On top of water
new_acce = {x = 0, y = 0, z = 0}
if math.abs(self.object:get_velocity().y) < 0 then
new_velo = get_velocity(self._v, self.object:get_yaw(), 0)
local y = self.object:getvelocity().y
if y >= 5 then
y = 5
elseif y < 0 then
new_acce = {x = 0, y = 20, z = 0}
else
new_velo = get_velocity(self._v, self.object:get_yaw(),
self.object:get_velocity().y)
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())
else
new_acce = {x = 0, y = 0, z = 0}
if math.abs(self.object:getvelocity().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)
else
new_velo = get_velocity(self._v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:get_pos())
end
end
end
-- Terminal velocity: 8 m/s per axis of travel
for _,axis in pairs({"z","y","x"}) do
if math.abs(new_velo[axis]) > 8 then
new_velo[axis] = 8 * get_sign(new_velo[axis])
end
end
self.object:set_velocity(new_velo)
self.object:set_acceleration(new_acce)
self.object:setvelocity(new_velo)
self.object:setacceleration(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 = { S("Oak Boat"), S("Spruce Boat"), S("Birch Boat"), S("Jungle Boat"), S("Acacia Boat"), S("Dark Oak Boat") }
local names = { "Oak Boat", "Spruce Boat", "Birch Boat", "Jungle Boat", "Acacia Boat", "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" }
@ -279,20 +268,18 @@ local images = { "oak", "spruce", "birch", "jungle", "acacia", "dark_oak" }
for b=1, #boat_ids do
local itemstring = "mcl_boats:"..boat_ids[b]
local longdesc, usagehelp, tt_help, help, helpname
local longdesc, usagehelp, help, helpname
help = false
-- Only create one help entry for all boats
if b == 1 then
help = true
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")
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"
end
tt_help = S("Water vehicle")
minetest.register_craftitem(itemstring, {
description = names[b],
_tt_help = tt_help,
_doc_items_create_entry = help,
_doc_items_entry_name = helpname,
_doc_items_longdesc = longdesc,
@ -303,7 +290,7 @@ for b=1, #boat_ids do
stack_max = 1,
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return itemstack
return
end
-- Call on_rightclick if the pointed node defines it
@ -314,17 +301,11 @@ for b=1, #boat_ids do
end
end
local pos = table.copy(pointed_thing.under)
local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
if math.abs(dir.x) > 0.9 or math.abs(dir.z) > 0.9 then
pos = vector.add(pos, vector.multiply(dir, boat_side_offset))
elseif is_water(pos) then
pos = vector.add(pos, vector.multiply(dir, boat_y_offset))
else
pos = vector.add(pos, vector.multiply(dir, boat_y_offset_ground))
if not is_water(pointed_thing.under) then
return
end
local boat = minetest.add_entity(pos, "mcl_boats:boat")
pointed_thing.under.y = pointed_thing.under.y + boat_y_offset
local boat = minetest.add_entity(pointed_thing.under, "mcl_boats:boat")
boat:get_luaentity()._itemstring = itemstring
boat:set_properties({textures = { "mcl_boats_texture_"..images[b].."_boat.png" }})
boat:set_yaw(placer:get_look_horizontal())

View File

@ -1,11 +0,0 @@
# textdomain: mcl_boats
Acacia Boat=Akazienboot
Birch Boat=Birkenboot
Boat=Boot
Boats are used to travel on the surface of water.=Boote werden benutzt, um sich auf der Wasseroberfläche zu bewegen.
Dark Oak Boat=Schwarzeichenboot
Jungle Boat=Dschungelboot
Oak Boat=Eichenboot
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.=Rechtsklicken Sie auf eine Wasserquelle, um das Boot zu platzieren. Rechtsklicken Sie auf das Boot, um es zu betreten. Mit [Links] und [Rechts] lenken, mit [Vorwärts] und [Rückwärts] Geschwindigkeit regeln oder rückwärts fahren. Rechtsklicken Sie erneut auf das Boot, um es zu verlassen, schlagen Sie das Boot, um es als Gegenstand fallen zu lassen.
Spruce Boat=Fichtenboot
Water vehicle=Wasserfahrzeug

View File

@ -1,10 +0,0 @@
# textdomain: mcl_boats
Acacia Boat=Barca de acacia
Birch Boat=Barca de abedul
Boat=Barca
Boats are used to travel on the surface of water.=Las barcas se utilizan para viajar en la superficie del agua.
Dark Oak Boat=Barca de roble oscuro
Jungle Boat=Barca de la selva
Oak Boat=Barca de roble
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.=Haga clic derecho en una fuente de agua para colocar el barco. Haga clic derecho en el barco para entrar. Utilice [Izquierda] y [Derecha] para dirigir, [Adelante] para acelerar y [Atrás] para reducir la velocidad o retroceder. Haga clic derecho en el barco nuevamente para dejarlo, golpee el barco para que se caiga como un artículo.
Spruce Boat=Barca de abeto

View File

@ -1,11 +0,0 @@
# textdomain: mcl_boats
Acacia Boat=Bateau en Acacia
Birch Boat=Bateau en Bouleau
Boat=Bateau
Boats are used to travel on the surface of water.=Les bateaux sont utilisés pour voyager à la surface de l'eau.
Dark Oak Boat=Bateau en Chêne Noir
Jungle Boat=Bateau en Acajou
Oak Boat=Bateau en Chêne
Rightclick on a water source to place the boat. Rightclick the boat to enter it. Use [Left] and [Right] to steer, [Forwards] to speed up and [Backwards] to slow down or move backwards. Rightclick the boat again to leave it, punch the boat to make it drop as an item.=Faites un clic droit sur une source d'eau pour placer le bateau. Faites un clic droit sur le bateau pour y entrer. Utilisez [Gauche] et [Droite] pour diriger, [Avant] pour accélérer et [Arrière] pour ralentir ou reculer. Cliquez de nouveau avec le bouton droit sur le bateau pour le quitter, frappez le bateau pour le faire tomber en tant qu'objet.
Spruce Boat=Bateau en Sapin
Water vehicle=Véhicule aquatique

View File

@ -1,11 +0,0 @@
# textdomain: mcl_boats
Acacia Boat=
Birch Boat=
Boat=
Boats are used to travel on the surface of water.=
Dark Oak Boat=
Jungle Boat=
Oak Boat=
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.=
Spruce Boat=
Water vehicle=

View File

@ -1,4 +1,3 @@
local S = minetest.get_translator("mcl_falling_nodes")
local dmes = minetest.get_modpath("mcl_death_messages") ~= nil
local get_falling_depth = function(self)
@ -49,15 +48,15 @@ local deal_falling_damage = function(self, dtime)
-- TODO: Reduce damage if wearing a helmet
local msg
if minetest.get_item_group(self.node.name, "anvil") ~= 0 then
msg = S("@1 was smashed by a falling anvil.", v:get_player_name())
msg = "%s was smashed by a falling anvil."
else
msg = S("@1 was smashed by a falling block.", v:get_player_name())
msg = "%s was smashed by a falling block."
end
if dmes then
mcl_death_messages.player_damage(v, msg)
mcl_death_messages.player_damage(v, string.format(msg, v:get_player_name()))
end
end
v:set_hp(hp, { type = "punch", from = "mod" })
v:set_hp(hp)
end
end
end
@ -79,30 +78,21 @@ minetest.register_entity(":__builtin:falling_node", {
meta = {},
set_node = function(self, node, meta)
local def = minetest.registered_nodes[node.name]
-- Change falling node if definition tells us to
if def and def._mcl_falling_node_alternative then
node.name = def._mcl_falling_node_alternative
end
local glow
self.node = node
self.meta = meta or {}
-- Set correct entity yaw
if def and node.param2 ~= 0 then
if (def.paramtype2 == "facedir" or def.paramtype2 == "colorfacedir") then
self.object:set_yaw(minetest.dir_to_yaw(minetest.facedir_to_dir(node.param2)))
elseif (def.paramtype2 == "wallmounted" or def.paramtype2 == "colorwallmounted") then
self.object:set_yaw(minetest.dir_to_yaw(minetest.wallmounted_to_dir(node.param2)))
end
if def.light_source then
glow = def.light_source
end
end
self.object:set_properties({
is_visible = true,
textures = {node.name},
glow = glow,
})
local def = core.registered_nodes[node.name]
-- Set correct entity yaw
if def and node.param2 ~= 0 then
if (def.paramtype2 == "facedir" or def.paramtype2 == "colorfacedir") then
self.object:set_yaw(core.dir_to_yaw(core.facedir_to_dir(node.param2)))
elseif (def.paramtype2 == "wallmounted" or def.paramtype2 == "colorwallmounted") then
self.object:set_yaw(core.dir_to_yaw(core.wallmounted_to_dir(node.param2)))
end
end
end,
get_staticdata = function(self)
@ -151,9 +141,9 @@ minetest.register_entity(":__builtin:falling_node", {
on_step = function(self, dtime)
-- Set gravity
local acceleration = self.object:get_acceleration()
local acceleration = self.object:getacceleration()
if not vector.equals(acceleration, {x = 0, y = -10, z = 0}) then
self.object:set_acceleration({x = 0, y = -10, z = 0})
self.object:setacceleration({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()
@ -210,19 +200,15 @@ minetest.register_entity(":__builtin:falling_node", {
for _, callback in pairs(minetest.registered_on_dignodes) do
callback(np, n2)
end
local def = minetest.registered_nodes[self.node.name]
if def then
if minetest.registered_nodes[self.node.name] then
minetest.add_node(np, self.node)
if def._mcl_after_falling then
def._mcl_after_falling(np, get_falling_depth(self))
if minetest.registered_nodes[self.node.name]._mcl_after_falling then
minetest.registered_nodes[self.node.name]._mcl_after_falling(np, get_falling_depth(self))
end
if self.meta then
local meta = minetest.get_meta(np)
meta:from_table(self.meta)
end
if def.sounds and def.sounds.place and def.sounds.place.name then
minetest.sound_play(def.sounds.place, {pos = np}, true)
end
end
else
-- Drop the *falling node* as an item if the destination node is NOT buildable to
@ -236,7 +222,7 @@ minetest.register_entity(":__builtin:falling_node", {
minetest.check_for_falling(np)
return
end
local vel = self.object:get_velocity()
local vel = self.object:getvelocity()
-- 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())
@ -252,14 +238,8 @@ minetest.register_entity(":__builtin:falling_node", {
local npos3 = table.copy(npos)
npos3.y = npos3.y - 1
minetest.add_node(npos3, self.node)
local def = minetest.registered_nodes[self.node.name]
if def then
if def._mcl_after_falling then
def._mcl_after_falling(npos3, get_falling_depth(self))
end
if def.sounds and def.sounds.place and def.sounds.place.name then
minetest.sound_play(def.sounds.place, {pos = np}, true)
end
if minetest.registered_nodes[self.node.name]._mcl_after_falling then
minetest.registered_nodes[self.node.name]._mcl_after_falling(npos3, get_falling_depth(self))
end
deal_falling_damage(self, dtime)
self.object:remove()

View File

@ -1,3 +0,0 @@
# textdomain: mcl_falling_nodes
@1 was smashed by a falling anvil.=@1 wurde von einem fallenden Amboss zerschmettert.
@1 was smashed by a falling block.=@1 wurde von einem fallenden Block zerschmettert.

View File

@ -1,3 +0,0 @@
# textdomain: mcl_falling_nodes
@1 was smashed by a falling anvil.=@1 fue aplastado por la caída de un yunque.
@1 was smashed by a falling block.=@1 fue aplastado por la caída de un bloque.

View File

@ -1,3 +0,0 @@
# textdomain: mcl_falling_nodes
@1 was smashed by a falling anvil.=@1 a été écrasé par une enclume qui tombait.
@1 was smashed by a falling block.=@1 a été écrasé par un bloc qui tombait.

View File

@ -1,3 +0,0 @@
# textdomain: mcl_falling_nodes
@1 was smashed by a falling anvil.=
@1 was smashed by a falling block.=

View File

@ -75,7 +75,7 @@ minetest.register_globalstep(function(dtime)
pos = pos,
max_hear_distance = 16,
gain = 1.0,
}, true)
})
check_pickup_achievements(object, player)
@ -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:move_to(vec)
object:moveto(vec)
--fix eternally falling items
minetest.after(0, function(object)
local lua = object:get_luaentity()
if lua then
object:set_acceleration({x=0, y=0, z=0})
object:setacceleration({x=0, y=0, z=0})
end
end, object)
@ -129,7 +129,7 @@ minetest.register_globalstep(function(dtime)
pos = pos,
max_hear_distance = 16,
gain = 1.0,
}, true)
})
end
check_pickup_achievements(object, player)
object:get_luaentity()._removed = true
@ -212,7 +212,7 @@ function minetest.handle_node_drops(pos, drops, digger)
-- This means there is no digger. This is a special case which allows this function to be called
-- by hand. Creative Mode is intentionally ignored in this case.
local doTileDrops = minetest.settings:get_bool("mcl_doTileDrops", true)
local doTileDrops = minetest.settings:get_bool("mcl_doTileDrops") or true
if (digger ~= nil and minetest.settings:get_bool("creative_mode")) or doTileDrops == false then
return
end
@ -254,13 +254,7 @@ function minetest.handle_node_drops(pos, drops, digger)
local drop_item = ItemStack(item)
drop_item:set_count(1)
for i=1,count do
local dpos = table.copy(pos)
-- Apply offset for plantlike_rooted nodes because of their special shape
if nodedef and nodedef.drawtype == "plantlike_rooted" and nodedef.walkable then
dpos.y = dpos.y + 1
end
-- Spawn item and apply random speed
local obj = minetest.add_item(dpos, drop_item)
local obj = core.add_item(pos, drop_item)
if obj ~= nil then
local x = math.random(1, 5)
if math.random(1,2) == 1 then
@ -270,7 +264,7 @@ function minetest.handle_node_drops(pos, drops, digger)
if math.random(1,2) == 1 then
z = -z
end
obj:set_velocity({x=1/x, y=obj:get_velocity().y, z=1/z})
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
end
end
end
@ -286,12 +280,12 @@ function minetest.item_drop(itemstack, dropper, pos)
cs = 1
end
local item = itemstack:take_item(cs)
local obj = minetest.add_item(p, item)
local obj = core.add_item(p, item)
if obj then
v.x = v.x*4
v.y = v.y*4 + 2
v.z = v.z*4
obj:set_velocity(v)
obj:setvelocity(v)
-- Force collection delay
obj:get_luaentity()._insta_collect = false
return itemstack
@ -306,13 +300,12 @@ if not time_to_live then
time_to_live = 300
end
minetest.register_entity(":__builtin:item", {
core.register_entity(":__builtin:item", {
initial_properties = {
hp_max = 1,
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 = {""},
@ -350,6 +343,8 @@ minetest.register_entity(":__builtin:item", {
count = max_count
self.itemstring = stack:get_name().." "..max_count
end
local s = 0.2 + 0.1 * (count / max_count)
local c = s
local itemtable = stack:to_table()
local itemname = nil
local description = ""
@ -358,18 +353,11 @@ minetest.register_entity(":__builtin:item", {
end
local item_texture = nil
local item_type = ""
local glow
local def = minetest.registered_items[itemname]
if def then
item_texture = def.inventory_image
item_type = def.type
description = def.description
glow = def.light_source
if core.registered_items[itemname] then
item_texture = core.registered_items[itemname].inventory_image
item_type = core.registered_items[itemname].type
description = core.registered_items[itemname].description
end
local s = 0.2 + 0.1 * (count / max_count)
local wield_scale = (def and def.wield_scale and def.wield_scale.x) or 1
local c = s
s = s / wield_scale
local prop = {
is_visible = true,
visual = "wielditem",
@ -378,7 +366,6 @@ minetest.register_entity(":__builtin:item", {
collisionbox = {-c, -c, -c, c, c, c},
automatic_rotate = math.pi * 0.5,
infotext = description,
glow = glow,
}
self.object:set_properties(prop)
if item_drop_settings.random_item_velocity == true then
@ -386,7 +373,7 @@ minetest.register_entity(":__builtin:item", {
if not self or not self.object or not self.object:get_luaentity() then
return
end
local vel = self.object:get_velocity()
local vel = self.object:getvelocity()
if vel and vel.x == 0 and vel.z == 0 then
local x = math.random(1, 5)
if math.random(1,2) == 1 then
@ -397,7 +384,7 @@ minetest.register_entity(":__builtin:item", {
z = -z
end
local y = math.random(2,4)
self.object:set_velocity({x=1/x, y=y, z=1/z})
self.object:setvelocity({x=1/x, y=y, z=1/z})
end
end, self)
end
@ -405,7 +392,7 @@ minetest.register_entity(":__builtin:item", {
end,
get_staticdata = function(self)
return minetest.serialize({
return core.serialize({
itemstring = self.itemstring,
always_collect = self.always_collect,
age = self.age,
@ -417,7 +404,7 @@ minetest.register_entity(":__builtin:item", {
on_activate = function(self, staticdata, dtime_s)
if string.sub(staticdata, 1, string.len("return")) == "return" then
local data = minetest.deserialize(staticdata)
local data = core.deserialize(staticdata)
if data and type(data) == "table" then
self.itemstring = data.itemstring
self.always_collect = data.always_collect
@ -457,8 +444,8 @@ minetest.register_entity(":__builtin:item", {
self._forcetimer = 0
self.object:set_armor_groups({immortal = 1})
self.object:set_velocity({x = 0, y = 2, z = 0})
self.object:set_acceleration({x = 0, y = -get_gravity(), z = 0})
self.object:setvelocity({x = 0, y = 2, z = 0})
self.object:setacceleration({x = 0, y = -get_gravity(), z = 0})
self:set_item(self.itemstring)
end,
@ -522,7 +509,7 @@ minetest.register_entity(":__builtin:item", {
end
local p = self.object:get_pos()
local node = minetest.get_node_or_nil(p)
local node = core.get_node_or_nil(p)
local in_unloaded = (node == nil)
-- If no collector was found for a long enough time, declare the magnet as disabled
@ -545,7 +532,7 @@ minetest.register_entity(":__builtin:item", {
local dg = minetest.get_item_group(nn, "destroys_items")
if (def and (lg ~= 0 or fg ~= 0 or dg == 1)) then
if dg ~= 2 then
minetest.sound_play("builtin_item_lava", {pos = self.object:get_pos(), gain = 0.5}, true)
minetest.sound_play("builtin_item_lava", {pos = self.object:get_pos(), gain = 0.5})
end
self._removed = true
self.object:remove()
@ -555,8 +542,8 @@ minetest.register_entity(":__builtin:item", {
-- Push item out when stuck inside solid opaque node
if def and def.walkable and def.groups and def.groups.opaque == 1 then
local shootdir
local cx = (p.x % 1) - 0.5
local cz = (p.z % 1) - 0.5
local cx = p.x % 1
local cz = p.z % 1
local order = {}
-- First prepare the order in which the 4 sides are to be checked.
@ -564,7 +551,7 @@ minetest.register_entity(":__builtin:item", {
-- 2nd: other direction
-- 3rd and 4th: other axis
local cxcz = function(o, cw, one, zero)
if cw < 0 then
if cw > 0 then
table.insert(o, { [one]=1, y=0, [zero]=0 })
table.insert(o, { [one]=-1, y=0, [zero]=0 })
else
@ -573,7 +560,7 @@ minetest.register_entity(":__builtin:item", {
end
return o
end
if math.abs(cx) < math.abs(cz) then
if math.abs(cx) > math.abs(cz) then
order = cxcz(order, cx, "x", "z")
order = cxcz(order, cz, "z", "x")
else
@ -602,8 +589,8 @@ minetest.register_entity(":__builtin:item", {
-- Set new item moving speed accordingly
local newv = vector.multiply(shootdir, 3)
self.object:set_acceleration({x = 0, y = 0, z = 0})
self.object:set_velocity(newv)
self.object:setacceleration({x = 0, y = 0, z = 0})
self.object:setvelocity(newv)
disable_physics(self.object, self, false, false)
@ -656,8 +643,8 @@ minetest.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:set_acceleration({x = 0, y = 0, z = 0})
self.object:set_velocity({x = newv.x, y = -0.22, z = newv.z})
self.object:setacceleration({x = 0, y = 0, z = 0})
self.object:setvelocity({x = newv.x, y = -0.22, z = newv.z})
self.physical_state = true
self._flowing = true
@ -675,13 +662,13 @@ minetest.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:get_velocity()
local v = self.object:getvelocity()
if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and v.y == 0 then
if not core.registered_nodes[nn] or core.registered_nodes[nn].walkable and v.y == 0 then
if self.physical_state then
local own_stack = ItemStack(self.object:get_luaentity().itemstring)
-- Merge with close entities of the same item
for _, object in ipairs(minetest.get_objects_inside_radius(p, 0.8)) do
for _, object in ipairs(core.get_objects_inside_radius(p, 0.8)) do
local obj = object:get_luaentity()
if obj and obj.name == "__builtin:item"
and obj.physical_state == false then
@ -701,3 +688,7 @@ minetest.register_entity(":__builtin:item", {
-- Note: on_punch intentionally left out. The player should *not* be able to collect items by punching
})
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "mcl_item_entity loaded")
end

View File

@ -3,6 +3,12 @@ mcl_minecarts
Based on the mod "boost_carts" by Krock.
Target: Run smoothly and do not use too much CPU.
TODO:
- Minecraft-like physics
- Add activator rail
- Add more rail textures
- Add loaded minecarts
License of source code:
-----------------------
MIT License
@ -17,5 +23,10 @@ Authors/licenses of media files:
Minecart model:
22i (GPLv3)
Texture files (CC BY-SA 3.0):
Wuzzy (based on Pixel Perfection 1.11, MIT License):
carts_rail_crossing_pwr.png
carts_rail_curved_pwr.png
carts_rail_t_junction_pwr.png
Other texture files (CC BY-SA 3.0:
XSSheep

View File

@ -1,4 +1,3 @@
mcl_explosions
mcl_core
mcl_sounds
mcl_player

View File

@ -1,5 +1,3 @@
local S = minetest.get_translator("mcl_minecarts")
mcl_minecarts = {}
mcl_minecarts.modpath = minetest.get_modpath("mcl_minecarts")
mcl_minecarts.speed_max = 10
@ -8,50 +6,10 @@ mcl_minecarts.check_float_time = 15
dofile(mcl_minecarts.modpath.."/functions.lua")
dofile(mcl_minecarts.modpath.."/rails.lua")
local function detach_driver(self)
if not self._driver then
return
end
mcl_player.player_attached[self._driver] = nil
local player = minetest.get_player_by_name(self._driver)
self._driver = nil
self._start_pos = nil
if player then
player:set_detach()
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
mcl_player.player_set_animation(player, "stand" , 30)
end
end
local function activate_tnt_minecart(self, timer)
if self._boomtimer then
return
end
self.object:set_armor_groups({immortal=1})
if timer then
self._boomtimer = timer
else
self._boomtimer = tnt.BOOMTIMER
end
self.object:set_properties({textures = {
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_minecarts_minecart.png",
}})
self._blinktimer = tnt.BLINKTIMER
minetest.sound_play("tnt_ignite", {pos = self.object:get_pos(), gain = 1.0, max_hear_distance = 15}, true)
end
local activate_normal_minecart = detach_driver
-- Table for item-to-entity mapping. Keys: itemstring, Values: Corresponding entity ID
local entity_mapping = {}
local function register_entity(entity_id, mesh, textures, drop, on_rightclick, on_activate_by_rail)
local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
local cart = {
physical = false,
collisionbox = {-10/16., -0.5, -10/16, 10/16, 0.25, 10/16},
@ -67,10 +25,6 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
_velocity = {x=0, y=0, z=0}, -- only used on punch
_start_pos = nil, -- Used to calculate distance for “On A Rail” achievement
_last_float_check = nil, -- timestamp of last time the cart was checked to be still on a rail
_fueltime = nil, -- how many seconds worth of fuel is left. Only used by minecart with furnace
_boomtimer = nil, -- how many seconds are left before exploding
_blinktimer = nil, -- how many seconds are left before TNT blinking
_blink = false, -- is TNT blink texture active?
_old_dir = {x=0, y=0, z=0},
_old_pos = nil,
_old_vel = {x=0, y=0, z=0},
@ -79,21 +33,11 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
}
function cart:on_activate(staticdata, dtime_s)
-- Initialize
local data = minetest.deserialize(staticdata)
if type(data) == "table" then
self._railtype = data._railtype
end
self.object:set_armor_groups({immortal=1})
-- Activate cart if on activator rail
if self.on_activate_by_rail then
local pos = self.object:get_pos()
local node = minetest.get_node(vector.floor(pos))
if node.name == "mcl_minecarts:activator_rail_on" then
self:on_activate_by_rail()
end
end
end
function cart:on_punch(puncher, time_from_last_punch, tool_capabilities, direction)
@ -114,13 +58,17 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
return
end
-- Punch+sneak: Pick up minecart (unless TNT was ignited)
if puncher:get_player_control().sneak and not self._boomtimer then
if puncher:get_player_control().sneak then
if self._driver then
if self._old_pos then
self.object:set_pos(self._old_pos)
self.object:setpos(self._old_pos)
end
mcl_player.player_attached[self._driver] = nil
local player = minetest.get_player_by_name(self._driver)
if player then
player:set_detach()
player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
end
detach_driver(self)
end
-- Disable detector rail
@ -150,7 +98,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
return
end
local vel = self.object:get_velocity()
local vel = self.object:getvelocity()
if puncher:get_player_name() == self._driver then
if math.abs(vel.x + vel.z) > 7 then
return
@ -172,10 +120,8 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
self._punched = true
end
cart.on_activate_by_rail = on_activate_by_rail
function cart:on_step(dtime)
local vel = self.object:get_velocity()
local vel = self.object:getvelocity()
local update = {}
if self._last_float_check == nil then
self._last_float_check = 0
@ -193,7 +139,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
-- Detach driver
if self._driver then
if self._old_pos then
self.object:set_pos(self._old_pos)
self.object:setpos(self._old_pos)
end
mcl_player.player_attached[self._driver] = nil
local player = minetest.get_player_by_name(self._driver)
@ -203,15 +149,8 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
end
end
-- Explode if already ignited
if self._boomtimer then
self.object:remove()
mcl_explosions.explode(pos, 4, { drop_chance = 1.0 })
return
end
-- Drop items and remove cart entity
if not minetest.settings:get_bool("creative_mode") then
if not minetest.settings:get_bool("creative_mode") then
for d=1, #drop do
minetest.add_item(self.object:get_pos(), drop[d])
end
@ -223,74 +162,11 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
self._last_float_check = 0
end
-- Update furnace stuff
if self._fueltime and self._fueltime > 0 then
self._fueltime = self._fueltime - dtime
if self._fueltime <= 0 then
self.object:set_properties({textures =
{
"default_furnace_top.png",
"default_furnace_top.png",
"default_furnace_front.png",
"default_furnace_side.png",
"default_furnace_side.png",
"default_furnace_side.png",
"mcl_minecarts_minecart.png",
}})
self._fueltime = 0
end
end
local has_fuel = self._fueltime and self._fueltime > 0
-- Update TNT stuff
if self._boomtimer then
-- Explode
self._boomtimer = self._boomtimer - dtime
local pos = self.object:get_pos()
if self._boomtimer <= 0 then
self.object:remove()
mcl_explosions.explode(pos, 4, { drop_chance = 1.0 })
return
else
tnt.smoke_step(pos)
end
end
if self._blinktimer then
self._blinktimer = self._blinktimer - dtime
if self._blinktimer <= 0 then
self._blink = not self._blink
if self._blink then
self.object:set_properties({textures =
{
"default_tnt_top.png",
"default_tnt_bottom.png",
"default_tnt_side.png",
"default_tnt_side.png",
"default_tnt_side.png",
"default_tnt_side.png",
"mcl_minecarts_minecart.png",
}})
else
self.object:set_properties({textures =
{
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_tnt_blink.png",
"mcl_minecarts_minecart.png",
}})
end
self._blinktimer = tnt.BLINKTIMER
end
end
if self._punched then
vel = vector.add(vel, self._velocity)
self.object:set_velocity(vel)
self.object:setvelocity(vel)
self._old_dir.y = 0
elseif vector.equals(vel, {x=0, y=0, z=0}) and (not has_fuel) then
elseif vector.equals(vel, {x=0, y=0, z=0}) then
return
end
@ -301,7 +177,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
if self._old_pos and not self._punched then
local flo_pos = vector.floor(pos)
local flo_old = vector.floor(self._old_pos)
if vector.equals(flo_pos, flo_old) and (not has_fuel) then
if vector.equals(flo_pos, flo_old) then
return
-- Prevent querying the same node over and over again
end
@ -309,7 +185,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
if not rou_pos then
rou_pos = vector.round(pos)
end
local rou_old = vector.round(self._old_pos)
rou_old = vector.round(self._old_pos)
if not node then
node = minetest.get_node(rou_pos)
end
@ -326,10 +202,6 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
minetest.swap_node(rou_old, newnode)
mesecon.receptor_off(rou_old)
end
-- Activate minecart if on activator rail
if node_old.name == "mcl_minecarts:activator_rail_on" and self.on_activate_by_rail then
self:on_activate_by_rail()
end
end
local ctrl, player = nil, nil
@ -345,8 +217,8 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
(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:set_velocity(vector.new())
self.object:set_acceleration(vector.new())
self.object:setvelocity(vector.new())
self.object:setacceleration(vector.new())
return
end
self._old_vel = vector.new(vel)
@ -383,7 +255,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
end
local new_acc = {x=0, y=0, z=0}
if vector.equals(dir, {x=0, y=0, z=0}) and not has_fuel then
if vector.equals(dir, {x=0, y=0, z=0}) then
vel = {x=0, y=0, z=0}
update.vel = true
else
@ -411,9 +283,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
local acc = dir.y * -1.8
local speed_mod = minetest.registered_nodes[minetest.get_node(pos).name]._rail_acceleration
if has_fuel then
acc = acc + 0.2
elseif speed_mod and speed_mod ~= 0 then
if speed_mod and speed_mod ~= 0 then
acc = acc + speed_mod
else
acc = acc - 0.4
@ -422,7 +292,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
new_acc = vector.multiply(dir, acc)
end
self.object:set_acceleration(new_acc)
self.object:setacceleration(new_acc)
self._old_pos = vector.new(pos)
self._old_dir = vector.new(dir)
self._old_switch = last_switch
@ -451,7 +321,7 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
elseif dir.z < 0 then
yaw = 1
end
self.object:set_yaw(yaw * math.pi)
self.object:setyaw(yaw * math.pi)
end
if self._punched then
@ -471,9 +341,9 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick, o
end
self.object:set_animation(anim, 1, 0)
self.object:set_velocity(vel)
self.object:setvelocity(vel)
if update.pos then
self.object:set_pos(pos)
self.object:setpos(pos)
end
update = nil
end
@ -517,7 +387,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:set_yaw(minetest.dir_to_yaw(cart_dir))
cart:setyaw(minetest.dir_to_yaw(cart_dir))
if not minetest.settings:get_bool("creative_mode") then
itemstack:take_item()
@ -526,7 +396,7 @@ mcl_minecarts.place_minecart = function(itemstack, pointed_thing)
end
local register_craftitem = function(itemstring, entity_id, description, tt_help, longdesc, usagehelp, icon, creative)
local register_craftitem = function(itemstring, entity_id, description, longdesc, usagehelp, icon, creative)
entity_mapping[itemstring] = entity_id
local groups = { minecart = 1, transport = 1 }
@ -566,7 +436,6 @@ local register_craftitem = function(itemstring, entity_id, description, tt_help,
groups = groups,
}
def.description = description
def._tt_help = tt_help
def._doc_items_longdesc = longdesc
def._doc_items_usagehelp = usagehelp
def.inventory_image = icon
@ -589,9 +458,9 @@ Register a minecart
* on_activate_by_rail: Called when above activator rail
* creative: If false, don't show in Creative Inventory
]]
local function register_minecart(itemstring, entity_id, description, tt_help, longdesc, usagehelp, mesh, textures, icon, drop, on_rightclick, on_activate_by_rail, creative)
register_entity(entity_id, mesh, textures, drop, on_rightclick, on_activate_by_rail)
register_craftitem(itemstring, entity_id, description, tt_help, longdesc, usagehelp, icon, creative)
local function register_minecart(itemstring, entity_id, description, longdesc, usagehelp, mesh, textures, icon, drop, on_rightclick, on_activate_by_rail, creative)
register_entity(entity_id, mesh, textures, drop, on_rightclick)
register_craftitem(itemstring, entity_id, description, longdesc, usagehelp, icon, creative)
if minetest.get_modpath("doc_identifier") ~= nil then
doc.sub.identifier.register_object(entity_id, "craftitems", itemstring)
end
@ -601,13 +470,11 @@ end
register_minecart(
"mcl_minecarts:minecart",
"mcl_minecarts:minecart",
S("Minecart"),
S("Vehicle for fast travel on rails"),
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.") .. "\n" ..
S("If it moves over a powered activator rail, you'll get ejected."),
"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.",
"mcl_minecarts_minecart.b3d",
{"mcl_minecarts_minecart.png"},
"mcl_minecarts_minecart_normal.png",
@ -619,12 +486,15 @@ register_minecart(
end
local player_name = clicker:get_player_name()
if self._driver and player_name == self._driver then
detach_driver(self)
self._driver = nil
self._start_pos = nil
clicker:set_detach()
clicker:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0})
elseif not self._driver then
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=-1.75, z=-2}, {x=0, y=0, z=0})
clicker:set_attach(self.object, "", {x=0, y=8.25, 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)
@ -634,15 +504,15 @@ register_minecart(
end
end, name)
end
end, activate_normal_minecart
end
)
-- Minecart with Chest
register_minecart(
"mcl_minecarts:chest_minecart",
"mcl_minecarts:chest_minecart",
S("Minecart with Chest"),
nil, nil, nil,
"Minecart with Chest",
nil, nil,
"mcl_minecarts_minecart_chest.b3d",
{ "mcl_chests_normal.png", "mcl_minecarts_minecart.png" },
"mcl_minecarts_minecart_chest.png",
@ -653,12 +523,8 @@ register_minecart(
register_minecart(
"mcl_minecarts:furnace_minecart",
"mcl_minecarts:furnace_minecart",
S("Minecart with Furnace"),
nil,
S("A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel."),
S("Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.") .. "\n" ..
S("To obtain the minecart and furnace, punch them while holding down the sneak key."),
"Minecart with Furnace",
nil, nil,
"mcl_minecarts_minecart_block.b3d",
{
"default_furnace_top.png",
@ -685,20 +551,13 @@ register_minecart(
if not minetest.settings:get_bool("creative_mode") then
held:take_item()
local index = clicker:get_wield_index()
local index = clicker:get_wielded_index()
local inv = clicker:get_inventory()
inv:set_stack("main", index, held)
end
self.object:set_properties({textures =
{
"default_furnace_top.png",
"default_furnace_top.png",
"default_furnace_front_active.png",
"default_furnace_side.png",
"default_furnace_side.png",
"default_furnace_side.png",
"mcl_minecarts_minecart.png",
}})
-- DEBUG
minetest.chat_send_player(clicker:get_player_name(), "Fuel: " .. tostring(self._fueltime))
end
end, nil, false
)
@ -707,8 +566,8 @@ register_minecart(
register_minecart(
"mcl_minecarts:command_block_minecart",
"mcl_minecarts:command_block_minecart",
S("Minecart with Command Block"),
nil, nil, nil,
"Minecart with Command Block",
nil, nil,
"mcl_minecarts_minecart_block.b3d",
{
"jeija_commandblock_off.png^[verticalframe:2:0",
@ -728,8 +587,8 @@ register_minecart(
register_minecart(
"mcl_minecarts:hopper_minecart",
"mcl_minecarts:hopper_minecart",
S("Minecart with Hopper"),
nil, nil, nil,
"Minecart with Hopper",
nil, nil,
"mcl_minecarts_minecart_hopper.b3d",
{
"mcl_hoppers_hopper_inside.png",
@ -746,11 +605,8 @@ register_minecart(
register_minecart(
"mcl_minecarts:tnt_minecart",
"mcl_minecarts:tnt_minecart",
S("Minecart with TNT"),
S("Vehicle for fast travel on rails").."\n"..S("Can be ignited by tools or powered activator rail"),
S("A minecart with TNT is an explosive vehicle that travels on rail."),
S("Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.") .. "\n" ..
S("To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited."),
"Minecart with TNT",
nil, nil,
"mcl_minecarts_minecart_block.b3d",
{
"default_tnt_top.png",
@ -763,25 +619,8 @@ register_minecart(
},
"mcl_minecarts_minecart_tnt.png",
{"mcl_minecarts:minecart", "mcl_tnt:tnt"},
-- Ingite
function(self, clicker)
if not clicker or not clicker:is_player() then
return
end
if self._boomtimer then
return
end
local held = clicker:get_wielded_item()
if held:get_name() == "mcl_fire:flint_and_steel" then
if not minetest.settings:get_bool("creative_mode") then
held:add_wear(65535/65) -- 65 uses
local index = clicker:get_wield_index()
local inv = clicker:get_inventory()
inv:set_stack("main", index, held)
end
activate_tnt_minecart(self)
end
end, activate_tnt_minecart)
nil, nil, false
)
minetest.register_craft({
@ -792,25 +631,8 @@ minetest.register_craft({
},
})
minetest.register_craft({
output = "mcl_minecarts:tnt_minecart",
recipe = {
{"mcl_tnt:tnt"},
{"mcl_minecarts:minecart"},
},
})
-- TODO: Re-enable crafting of special minecarts when they have been implemented
if false then
minetest.register_craft({
output = "mcl_minecarts:furnace_minecart",
recipe = {
{"mcl_furnaces:furnace"},
{"mcl_minecarts:minecart"},
},
})
minetest.register_craft({
output = "mcl_minecarts:hopper_minecart",
recipe = {
@ -827,4 +649,19 @@ minetest.register_craft({
},
})
minetest.register_craft({
output = "mcl_minecarts:tnt_minecart",
recipe = {
{"mcl_tnt:tnt"},
{"mcl_minecarts:minecart"},
},
})
minetest.register_craft({
output = "mcl_minecarts:furnace_minecart",
recipe = {
{"mcl_furnaces:furnace"},
{"mcl_minecarts:minecart"},
},
})
end

View File

@ -1,35 +0,0 @@
# textdomain: mcl_minecarts
Minecart=Lore
Minecarts can be used for a quick transportion on rails.=Loren können für eine schnelle Fahrt auf Schienen benutzt werden.
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.=Loren fahren nur auf Schienen und bleiben immer auf der Strecke. An einer Einmündung ohne einem Weg nach vorne fahren sie nach links. Die Geschwindigkeit hängt vom Schienentyp ab.
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Sie können die Lore auf Schienen platzieren. Rechtsklicken, um einzusteigen.
To obtain the minecart, punch it while holding down the sneak key.=Um die Lore aufzusammeln, schlagen Sie sie, während Sie die Schleichen-Taste gedrückt halten.
A minecart with TNT is an explosive vehicle that travels on rail.=Eine Lore mit TNT ist ein explosives Fahrzeug, das auf Schienen fährt.
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=Auf Schienen platzieren. Zuschlagen zum Bewegen. Das TNT wird mit einem Feuerzeug angezündet, oder, wenn die Lore sich auf einer bestromten Aktivierungsschiene befindet.
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=Um die Lore und das TNT zu erhalten, schlagen Sie sie, während Sie die Schleichtaste drücken. Das ist nicht möglich, wenn das TNT bereits gezündet wurde.
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=Eine Lore mit Ofen ist ein Fahrzeug, das auf Rädern fährt. Sie kann mit Brennstoff angetrieben werden.
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=Auf Schienen platzieren. Wird Kohle eingefügt, wird der Ofen für eine lange Zeit brennen und die Lore wird fähig sein, sich selbst anzutreiben. Zuschlagen, um die Bewegung einzuläuten.
To obtain the minecart and furnace, punch them while holding down the sneak key.=Um die Lore und den Ofen zu erhalten, schlagen Sie zu, während Sie die Schleichtaste drücken.
Minecart with Chest=Lore mit Truhe
Minecart with Furnace=Lore mit Ofen
Minecart with Command Block=Lore mit Befehlsblock
Minecart with Hopper=Lore mit Trichter
Minecart with TNT=Lore mit TNT
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.=Bauen Sie sie auf den Boden, um Ihr Schienennetzwerk zu errichten, die Schienen werden sich automatisch verbinden und sich nach Bedarf in Kurven, Einmündungen, Kreuzungen und Steigungen verwandeln.
Rail=Schiene
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Schienen können benutzt werden, um Strecken für Loren zu bauen. Normale Schienen werden Loren aufgrund von Reibung leicht verlangsamen.
Powered Rail=Antriebsschiene
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Schienen können benutzt werden, um Strecken für Loren zu bauen. Antriebsschienen können Loren beschleunigen und abbremsen.
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Ohne Redstone-Energie wird die Schiene Loren abbremsen. Mit Redstone-Energie wird sie sie beschleunigen.
Activator Rail=Aktivierungsschiene
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Schienen können benutzt werden, um Strecken für Loren zu bauen. Aktivierungsschienen werden benutzt, um besondere Loren zu aktivieren.
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Wenn diese Schiene mit Redstone-Energie versorgt wird, werden alle Loren, die sie passieren, aktiviert.
Detector Rail=Sensorschiene
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.=Schienen können benutzt werden, um Strecken für Loren zu bauen. Eine Sensorschiene kann eine Lore erkennen und versorgt Redstone-Mechanismen.
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Um eine Lore zu erkennen und die Redstone-Energie zu aktivieren, verbinden Sie die Schiene mit Redstonestaub oder Redstone-Mechanismen und schicken Sie eine beliebige Lore über die Schiene.
Track for minecarts=Strecke für Loren
Speed up when powered, slow down when not powered=Beschleunigt, wenn bestromt, sonst verlangsamt es
Activates minecarts when powered=Aktiviert Loren, wenn bestromt
Emits redstone power when a minecart is detected=Gibt ein Redstonesignal aus, wenn eine Lore erfasst wird
Vehicle for fast travel on rails=Fahrzeug zum schnellen Transport auf Schienen
Can be ignited by tools or powered activator rail=Kann mit Werkzeugen oder bestromten Aktivierungsschienen angezündet werden

View File

@ -1,23 +0,0 @@
# textdomain: mcl_minecarts
Minecart=Vagoneta
Minecarts can be used for a quick transportion on rails.=Las vagonetas se pueden usar para transportarse rápido en los rieles.
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.=Las vagonetas solo viajan en rieles y siempre siguen las pistas. En un cruce en T sin camino recto, giran a la izquierda. La velocidad se ve afectada por el tipo de riel.
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Puedes colocar el vagoneta en los rieles. Haga clic derecho para insertarlo. Golpea para que se mueva.
To obtain the minecart, punch it while holding down the sneak key.=Para obtener el vagoneta, golpéalo mientras mantienes presionada la tecla.
Minecart with Chest=Vagoneta con cofre
Minecart with Furnace=Vagoneta con horno
Minecart with Command Block=Vagoneta con bloque de comandos
Minecart with Hopper=Vagoneta con tolva
Minecart with TNT=Vagoneta con dinamita
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.=Colóquelos en el suelo para construir su ferrocarril, los rieles se conectarán automáticamente entre sí y se convertirán en curvas, uniones en T, cruces y pendientes según sea necesario.
Rail=Raíl
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Los rieles se pueden usar para construir vías de transporte para vagonetas. Los rieles normales ralentizan ligeramente las vagonetas debido a la fricción.
Powered Rail=Raíl propulsor
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Los rieles se pueden usar para construir vías de transporte para vagonetas. Los railes propulsores pueden acelerar y frenar las vagonetas.
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Sin energía de redstone, el riel frenará las vagonetas. Para hacer que este riel acelere las vagonetas, aliméntalo con redstone.
Activator Rail=Raíl activador
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Los rieles se pueden usar para construir vías de transporte para vagonetas. Los railes activador se utilizan para activar una vagoneta especial.
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Para hacer que este riel active las vagonetas, enciéndelo con energía de redstone y envía una vagoneta sobre este pedazo de riel.
Detector Rail=Raíl detector
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.=Los rieles se pueden usar para construir vías de transporte para vagonetas. Un raíl detector puede detectar una vagoneta sobre él y alimenta los mecanismos de redstone.
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Para detectar una vagoneta y proporcionar energía de redstone, conéctelo a los senderos de redstone o mecanismos de redstone y envíe cualquier vagoneta sobre el riel.

View File

@ -1,35 +0,0 @@
# textdomain: mcl_minecarts
Minecart=Wagonnet
Minecarts can be used for a quick transportion on rails.=Les wagonnets peuvent être utilisés pour un transport rapide sur rails.
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.=Les wagonnets roulent uniquement sur des rails et suivent toujours les pistes. À un carrefour en T sans voie directe, ils tournent à gauche. La vitesse dépend du type de rail.
You can place the minecart on rails. Right-click it to enter it. Punch it to get it moving.=Vous pouvez placer le wagonnet sur des rails. Faites un clic droit dessus pour entrer dedans. Frappez-le pour le faire bouger.
To obtain the minecart, punch it while holding down the sneak key.=Pour obtenir la wagonnet, frappez-le tout en maintenant la touche furtive enfoncée.
A minecart with TNT is an explosive vehicle that travels on rail.=Un wagonnet avec de la TNT est un véhicule explosif qui se déplace sur rail.
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=Placez-le sur des rails. Frappez-le pour le déplacer. Le TNT est allumé avec un briquet ou lorsque le minecart est sur un rail d'activation alimenté.
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=Pour obtenir la wagonnet et la TNT, frappez-les tout en maintenant la touche furtive enfoncée. Vous ne pouvez pas faire cela si le TNT a été allumé.
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=Une wagonnet avec un four est un véhicule qui se déplace sur rails. Il peut se propulser avec du carburant.
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=Placez-le sur des rails. Si vous lui donnez du charbon, le four commencera à brûler pendant longtemps et le wagonnet pourra se déplacer. Frappez-le pour le faire bouger.
To obtain the minecart and furnace, punch them while holding down the sneak key.=Pour obtenir le wagonnet et le four, frappez-les tout en maintenant la touche furtive enfoncée.
Minecart with Chest=Wagonnet avec Coffre
Minecart with Furnace=Wagonnet avec Four
Minecart with Command Block=Wagonnet avec Bloc de Commande
Minecart with Hopper=Wagonnet avec Entonoir
Minecart with TNT=Wagonnet avec TNT
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.=Placez-les sur le sol pour construire votre chemin de fer, les rails se connecteront automatiquement les uns aux autres et se transformeront en courbes, en jonctions en T, en traversées et en pentes au besoin.
Rail=Rail
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=Les rails peuvent être utilisés pour construire des voies de transport pour les wagonnets. Les rails ralentissent légèrement les wagonnets en raison de la friction.
Powered Rail=Rail allimenté
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=Les rails peuvent être utilisés pour construire des voies de transport pour les wagonnets. Les rails motorisés sont capables d'accélérer et de freiner les wagonnets.
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=Sans énergie de redstone, le rail freinera les wagonnets. Pour que ce rail accélère les minecarts, alimentez-le avec une source d'énergie redstone.
Activator Rail=Rail d'activation
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=Les rails peuvent être utilisés pour construire des voies de transport pour les wagonnets. Des rails activateurs sont utilisés pour activer des wagonnets spéciaux.
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=Pour activer ce rail, activez les wagonnets, alimentez-le avec de l'énergie redstone et envoyez un wagonnet sur ce morceau de rail.
Detector Rail=Rail de détection
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.=Les rails peuvent être utilisés pour construire des voies de transport pour les wagonnets. Un rail de détection est capable de détecter un wagonnet au-dessus et alimente les mécanismes de redstone.
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=Pour détecter un wagonnet et fournir une alimentation redstone, connectez-le aux câble redstone ou aux mécanismes redstone et envoyez n'importe quel wagonnet sur le rail.
Track for minecarts=Piste pour wagonnets
Speed up when powered, slow down when not powered=Accélérez lorsqu'il est alimenté, ralentissez lorsqu'il n'est pas alimenté
Activates minecarts when powered=Active les wagonnets lorsqu'il est alimenté
Emits redstone power when a minecart is detected=Émet de l'énergie redstone lorsqu'un wagonnet est détecté
Vehicle for fast travel on rails=Véhicule pour voyager rapidement sur rails
Can be ignited by tools or powered activator rail=Peut être allumé par des outils ou un rail d'activation motorisé

View File

@ -1,35 +0,0 @@
# textdomain: mcl_minecarts
Minecart=
Minecarts can be used for a quick transportion on rails.=
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.=
To obtain the minecart, punch it while holding down the sneak key.=
A minecart with TNT is an explosive vehicle that travels on rail.=
Place it on rails. Punch it to move it. The TNT is ignited with a flint and steel or when the minecart is on an powered activator rail.=
To obtain the minecart and TNT, punch them while holding down the sneak key. You can't do this if the TNT was ignited.=
A minecart with furnace is a vehicle that travels on rails. It can propel itself with fuel.=
Place it on rails. If you give it some coal, the furnace will start burning for a long time and the minecart will be able to move itself. Punch it to get it moving.=
To obtain the minecart and furnace, punch them while holding down the sneak key.=
Minecart with Chest=
Minecart with Furnace=
Minecart with Command Block=
Minecart with Hopper=
Minecart with TNT=
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.=
Rail=
Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.=
Powered Rail=
Rails can be used to build transport tracks for minecarts. Powered rails are able to accelerate and brake minecarts.=
Without redstone power, the rail will brake minecarts. To make this rail accelerate minecarts, power it with redstone power.=
Activator Rail=
Rails can be used to build transport tracks for minecarts. Activator rails are used to activate special minecarts.=
To make this rail activate minecarts, power it with redstone power and send a minecart over this piece of rail.=
Detector Rail=
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.=
To detect a minecart and provide redstone power, connect it to redstone trails or redstone mechanisms and send any minecart over the rail.=
Track for minecarts=
Speed up when powered, slow down when not powered=
Activates minecarts when powered=
Emits redstone power when a minecart is detected=
Vehicle for fast travel on rails=
Can be ignited by tools or powered activator rail=

View File

@ -1,8 +1,6 @@
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=minetest.raillike_group("rail"),dig_by_water=1,destroy_by_lava_flow=1, transport=1}
local groups = {handy=1,pickaxey=1, attached_node=1,rail=1,connect_to_raillike=1,dig_by_water=1,destroy_by_lava_flow=1, transport=1}
if creative == false then
groups.not_in_creative_inventory = 1
end
@ -66,15 +64,14 @@ local rail_rules_long =
local rail_rules_short = mesecon.rules.pplate
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.")
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."
-- Normal rail
register_rail("mcl_minecarts:rail",
{"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
{
description = S("Rail"),
_tt_help = S("Track for minecarts"),
_doc_items_longdesc = S("Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction."),
description = "Rail",
_doc_items_longdesc = "Rails can be used to build transport tracks for minecarts. Normal rails slightly slow down minecarts due to friction.",
_doc_items_usagehelp = railuse,
}
)
@ -83,10 +80,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 = S("Powered Rail"),
_tt_help = S("Track for minecarts").."\n"..S("Speed up when powered, slow down when not powered"),
_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."),
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.",
_rail_acceleration = -3,
mesecons = {
conductor = {
@ -122,20 +118,21 @@ 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 = S("Activator Rail"),
_tt_help = S("Track for minecarts").."\n"..S("Activates minecarts when powered"),
_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."),
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.",
mesecons = {
conductor = {
state = mesecon.state.off,
offstate = "mcl_minecarts:activator_rail",
onstate = "mcl_minecarts:activator_rail_on",
rules = rail_rules_long,
},
},
}
},
-- Hidden from creative because no cart is using this rail so far.
-- TODO: Remove this when the activator rail has become useful.
false
)
-- Activator rail (on)
@ -150,20 +147,6 @@ register_rail("mcl_minecarts:activator_rail_on",
onstate = "mcl_minecarts:activator_rail_on",
rules = rail_rules_long,
},
effector = {
-- Activate minecarts
action_on = function(pos, node)
local pos2 = { x = pos.x, y =pos.y + 1, z = pos.z }
local objs = minetest.get_objects_inside_radius(pos2, 1)
for _, o in pairs(objs) do
local l = o:get_luaentity()
if l and string.sub(l.name, 1, 14) == "mcl_minecarts:" and l.on_activate_by_rail then
l:on_activate_by_rail()
end
end
end,
},
},
drop = "mcl_minecarts:activator_rail",
},
@ -174,10 +157,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 = S("Detector Rail"),
_tt_help = S("Track for minecarts").."\n"..S("Emits redstone power when a minecart is detected"),
_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."),
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.",
mesecons = {
receptor = {
state = mesecon.state.off,
@ -223,6 +205,9 @@ minetest.register_craft({
}
})
-- Activator rail crafting is disabled until it becomes useful.
-- TODO: Enable crafting as needed.
if false then
minetest.register_craft({
output = "mcl_minecarts:activator_rail 6",
recipe = {
@ -231,6 +216,7 @@ minetest.register_craft({
{"mcl_core:iron_ingot", "mcl_core:stick", "mcl_core:iron_ingot"},
}
})
end
minetest.register_craft({
output = "mcl_minecarts:detector_rail 6",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 249 B

File diff suppressed because it is too large Load Diff

View File

@ -28,19 +28,10 @@ functions needed for the mob to work properly which contains the following:
"monster" attacks player or npc on sight.
"npc" walk around and will defend themselves if hit first, they
kill monsters.
'hp_min' the minimum health value the mob can spawn with.
'hp_max' the maximum health value the mob can spawn with.
'breath_max' The maximum breath value the mob can spawn with and can have.
If -1 (default), mob does not take drowning damage.
'breathes_in_water' If true, mob loses breath when not in water. Otherwise,
mob loses breath when inside a node with `drowning` attribute
set (default: false).
'armor' entity armor groups (see lua_api.txt). If table, a list of
armor groups like for entities. If number, set value of
'fleshy' armor group only.
Note: The 'immortal=1' armor group will automatically be added
since this mod handles health and damage manually.
Default: 100 (mob will take full dmg from 'fleshy' hits)
'hp_min' has the minimum health value the mob can spawn with.
'hp_max' has the maximum health value the mob can spawn with.
'armor' holds strength of mob, 100 is normal, lower is more powerful
and needs more hits and better weapons to kill.
'passive' when true allows animals to defend themselves when hit,
otherwise they amble onwards.
'walk_velocity' is the speed that your mob can walk around.
@ -50,12 +41,10 @@ functions needed for the mob to work properly which contains the following:
'jump' when true allows your mob to jump updwards.
'jump_height' holds the height your mob can jump, 0 to disable jumping.
'stepheight' height of a block that your mob can easily walk up onto,
defaults to 0.6.
defaults to 1.1.
'fly' when true allows your mob to fly around instead of walking.
'fly_in' holds the node name or a table of node names in which the
mob flies (or swims) around in. The special name
'__airlike' stands for all nodes with 'walkable=false'
that are not liquids
'fly_in' holds the node name that the mob flies (or swims) around
in e.g. "air" or "default:water_source".
'runaway' if true causes animals to turn and run away when hit.
'view_range' how many nodes in distance the mob can see a player.
'damage' how many health points the mob does to a player or another
@ -67,11 +56,9 @@ functions needed for the mob to work properly which contains the following:
'fall_speed' has the maximum speed the mob can fall at, default is -10.
'fall_damage' when true causes falling to inflict damage.
'water_damage' holds the damage per second infliced to mobs when standing in
water (default: 0).
water.
'lava_damage' holds the damage per second inflicted to mobs when standing
in lava (default: 8).
'fire_damage' holds the damage per second inflicted to mobs when standing
in fire (default: 1).
in lava or fire.
'light_damage' holds the damage per second inflicted to mobs when it's too
bright (above 13 light).
'suffocation' when true causes mobs to suffocate inside solid blocks (2 damage per second).
@ -91,8 +78,6 @@ functions needed for the mob to work properly which contains the following:
punches when nearby.
'group_attack' when true has same mob type grouping together to attack
offender.
[MCL2 extension:] When a table, this is a list of
mob types that will get alerted as well (besides same mob type)
'attack_type' tells the api what a mob does when attacking the player
or another mob:
'dogfight' is a melee attack when player is within mob reach.
@ -129,6 +114,10 @@ functions needed for the mob to work properly which contains the following:
e.g. {"player", "mobs_animal:chicken"}.
'runaway_from' contains a table with mob names to run away from, add
"player" to list to runaway from player also.
'blood_amount' contains the number of blood droplets to appear when
mob is hit.
'blood_texture' has the texture name to use for droplets e.g.
"mobs_blood.png", or table {"blood1.png", "blood2.png"}
'pathfinding' set to 1 for mobs to use pathfinder feature to locate
player, set to 2 so they can build/break also (only
works with dogfight attack and when 'mobs_griefing'
@ -142,7 +131,6 @@ functions needed for the mob to work properly which contains the following:
'makes_footstep_sound' when true you can hear mobs walking.
'sounds' this is a table with sounds of the mob
'distance' maximum distance sounds can be heard, default is 10.
'base_pitch' base pitch to use adult mobs, default is 1.0 (MCL2 extension)
'random' played randomly from time to time.
also played for overfeeding animal.
'war_cry' what you hear when mob starts to attack player. (currently disabled)
@ -154,9 +142,6 @@ functions needed for the mob to work properly which contains the following:
'fuse' sound played when mob explode timer starts.
'explode' sound played when mob explodes.
Note: For all sounds except fuse and explode, the pitch is slightly randomized from the base pitch
The pitch of children is 50% higher.
'drops' table of items that are dropped when mob is killed, fields are:
'name' name of item to drop.
'chance' chance of drop, 1 for always, 2 for 1-in-2 chance etc.
@ -171,9 +156,7 @@ functions needed for the mob to work properly which contains the following:
'mesh' uses separate object file to define mob.
'visual_size' has the size of the mob, defaults to {x = 1, y = 1}
'collisionbox' has the box in which mob can be interacted with the
world e.g. {-0.5, -0.5, -0.5, 0.5, 0.8, 0.5}.
NOTE: Due to a workaround, the upper Y coordinate will be forced
to a minimum value of 0.79.
world e.g. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
'selectionbox' has the box in which player can interact with mob
'textures' holds a table list of textures to be used for mob, or you
could use multiple lists inside another table for random
@ -226,22 +209,12 @@ functions needed for the mob to work properly which contains the following:
MineClone 2 extensions:
'spawn_class' Classification of mod for the spawning algorithm:
"hostile", "passive", "ambient" or "water"
'ignores_nametag' if true, mob cannot be named by nametag
'rain_damage' damage per second if mob is standing in rain (default: 0)
'sunlight_damage' holds the damage per second inflicted to mobs when they
are in direct sunlight
'spawn_small_alternative': name of a smaller mob to use as replacement if
spawning fails due to space requirements
'glow' same as in entity definition
'child' if true, spawn mob as child
'shoot_arrow(self, pos, dir)' function that is called when mob wants to shoot an arrow.
You can spawn your own arrow here. pos is mob position,
dir is mob's aiming direction
'sounds_child' same as sounds, but for childs. If not defined, childs will use same
sound as adults but with higher pitch
Node Replacement
----------------
@ -261,9 +234,8 @@ eating.
'replace_rate' how random should the replace rate be (typically 10)
'replace_offset' +/- value to check specific node to replace
'on_replace(self, pos, oldnode, newnode)'
is called when mob is about to replace a node. Also called
when not actually replacing due to mobs_griefing setting being false.
'on_replace(self, pos, oldnode, newnode)' is called when mob is about to
replace a node.
'self' ObjectRef of mob
'pos' Position of node to replace
'oldnode' Current node
@ -317,18 +289,12 @@ for each mob.
'self.health' contains current health of mob (cannot exceed
self.hp_max)
'self.breath' contains current breath of mob, if mob takes drowning
damage at all (cannot exceed self.breath_max). Breath
decreases by 1 each second while in a node with drowning
damage and increases by 1 each second otherwise.
'self.texture_list' contains list of all mob textures
'self.child_texture' contains mob child texture when growing up
'self.base_texture' contains current skin texture which was randomly
selected from textures list
'self.gotten' this is used to track whether some special item has been
gotten from the mob, for example, wool from sheep.
Initialized as false, and the mob must set this value
manually.
'self.gotten' this is used for obtaining milk from cow and wool from
sheep
'self.horny' when animal fed enough it is set to true and animal can
breed with same animal
'self.hornytimer' background timer that controls breeding functions and
@ -430,9 +396,6 @@ This function registers a arrow for mobs with the attack type shoot.
'hit_mob' a function that is called when the arrow hits a mob;
this function should hurt the mob, the parameters are
(self, mob)
'hit_object' a function that is called when the arrow hits an object
that is neither a player nor a mob. this function should
hurt the object, the parameters are (self, object)
'hit_node' a function that is called when the arrow hits a node, the
parameters are (self, pos, node)
'tail' when set to 1 adds a trail or tail to mob arrows
@ -466,6 +429,8 @@ This function registers a spawn egg which can be used by admin to properly spawn
Explosion Function
------------------
mobs:explosion(pos, radius) -- DEPRECATED!!! use mobs:boom() instead
mobs:boom(self, pos, radius)
'self' mob entity
'pos' centre position of explosion
@ -608,13 +573,19 @@ External Settings for "minetest.conf"
'enable_damage' if true monsters will attack players (default is true)
'only_peaceful_mobs' if true only animals will spawn in game (default is
false)
'mobs_disable_blood' if false, damage effects appear when mob is hit (default
'mobs_disable_blood' if false blood effects appear when mob is hit (default
is false)
'mobs_spawn_protected' if set to false then mobs will not spawn in protected
areas (default is true)
'remove_far_mobs' if true then untamed mobs that are outside players
visual range will be removed (default is true)
'mobname' can change specific mob chance rate (0 to disable) and
spawn number e.g. mobs_animal:cow = 1000,5
'mob_difficulty' sets difficulty level (health and hit damage
multiplied by this number), defaults to 1.0.
'mob_spawn_chance' multiplies chance of all mobs spawning and can be set
'mob_show_health' if false then punching mob will not show health status
(true by default)
'mob_chance_multiplier' multiplies chance of all mobs spawning and can be set
to 0.5 to have mobs spawn more or 2.0 to spawn less.
e.g. 1 in 7000 * 0.5 = 1 in 3500 so better odds of
spawning.

View File

@ -1,12 +1,11 @@
local S = minetest.get_translator("mcl_mobs")
local S = mobs.intllib
-- name tag
minetest.register_craftitem("mcl_mobs:nametag", {
description = S("Name Tag"),
_tt_help = S("Give names to mobs").."\n"..S("Set name at anvil"),
_doc_items_longdesc = S("A name tag is an item to name a mob."),
_doc_items_usagehelp = S("Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag."),
_doc_items_usagehelp = S("Before you use the name tag, you need to set a name at an anvil. Now you can use the name tag to name a mob with a rightclick. This uses up the name tag."),
inventory_image = "mobs_nametag.png",
wield_image = "mobs_nametag.png",
stack_max = 64,

View File

@ -0,0 +1,9 @@
mcl_core
mcl_weather?
mcl_tnt?
mcl_hunger?
invisibility?
intllib?
lucky_block?
cmi?
doc_identifier?

View File

@ -9,3 +9,5 @@ dofile(path .. "/mount.lua")
-- Mob Items
dofile(path .. "/crafts.lua")
minetest.log("action", "[MOD] Mobs Redo: MineClone 2 Edition loaded")

View File

@ -0,0 +1,45 @@
-- 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

@ -0,0 +1,131 @@
# Mobs Redo translation.
# Copyright (C) 2017 TenPlus1
# This file is distributed under the same license as the mobs package.
# Wuzzy <Wuzzy@mail.ru>, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: mobs\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-02 16:48+0200\n"
"PO-Revision-Date: 2017-07-02 14:27+0200\n"
"Last-Translator: Wuzzy <almikes@aol.com>\n"
"Language-Team: \n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.2\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: api.lua
msgid "** Peaceful Mode Active - No Monsters Will Spawn"
msgstr ""
#: api.lua
msgid "Mob has been protected!"
msgstr "Kreatur wurde geschützt!"
#: api.lua
msgid "@1 (Tamed)"
msgstr "@1 (Gezähmt)"
#: api.lua
msgid "Not tamed!"
msgstr "Nicht gezähmt!"
#: api.lua
msgid "@1 is owner!"
msgstr "@1 ist der Besitzer!"
#: api.lua
msgid "Missed!"
msgstr "Daneben!"
#: api.lua
msgid "Already protected!"
msgstr "Bereits geschützt!"
#: api.lua
msgid "@1 at full health (@2)"
msgstr "@1 bei voller Gesundheit (@2)"
#: api.lua
msgid "@1 has been tamed!"
msgstr "@1 wurde gezähmt!"
#: api.lua
msgid "Enter name:"
msgstr "Namen eingeben:"
#: api.lua
msgid "Rename"
msgstr "Umbenennen"
#: crafts.lua
msgid "Name Tag"
msgstr "Namensschild"
#: crafts.lua
msgid "Leather"
msgstr "Leder"
#: crafts.lua
msgid "Raw Meat"
msgstr "Rohes Fleisch"
#: crafts.lua
msgid "Meat"
msgstr "Fleisch"
#: crafts.lua
msgid "Lasso (right-click animal to put in inventory)"
msgstr "Lasso (Rechtsklick auf Tier, um es zu nehmen)"
#: crafts.lua
msgid "Net (right-click animal to put in inventory)"
msgstr "Netz (Rechtsklick auf Tier, um es zu nehmen)"
#: crafts.lua
msgid "Steel Shears (right-click to shear)"
msgstr "Stahlschere (Rechtsklick zum Scheren)"
#: crafts.lua
msgid "Mob Protection Rune"
msgstr "Kreaturschutzrune"
#: crafts.lua
msgid "Saddle"
msgstr "Sattel"
#: crafts.lua
msgid "Mob Fence"
msgstr "Kreaturen Zaun"
#: spawner.lua
msgid "Mob Spawner"
msgstr "Kreaturenspawner"
#: spawner.lua
msgid "Mob MinLight MaxLight Amount PlayerDist"
msgstr "Kreatur MinLicht MaxLicht Menge SpielerEntfng"
#: spawner.lua
msgid "Spawner Not Active (enter settings)"
msgstr "Nicht aktiv (Einstellungen eingeben)"
#: spawner.lua
msgid "Spawner Active (@1)"
msgstr "Spawner aktiv (@1)"
#: spawner.lua
msgid "Mob Spawner settings failed!"
msgstr "Kreaturenspawner-Einstellungen gescheitert!"
#: spawner.lua
msgid ""
"Syntax: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] "
"distance[1-20] y_offset[-10 to 10]”"
msgstr ""
"Syntax: „name min_licht[0-14] max_licht[0-14] max_mobs_im_gebiet[0 zum "
"Deaktivieren] distanz[1-20] y_versatz[-10 bis 10]“"

View File

@ -0,0 +1,128 @@
# Mobs Redo translation.
# Copyright (C) 2017 TenPlus1
# This file is distributed under the same license as the mobs package.
# Wuzzy <Wuzzy@mail.ru>, 2017
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-16 16:48+0200\n"
"PO-Revision-Date: 2017-07-16 16:48+0200\n"
"Last-Translator: Aleks <alexsinteck@icqmail.com>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: api.lua
msgid "** Peaceful Mode Active - No Monsters Will Spawn"
msgstr ""
#: api.lua
msgid "Mob has been protected!"
msgstr "El mob ha sido protegido!"
#: api.lua
msgid "@1 (Tamed)"
msgstr "@1 (Domesticado)"
#: api.lua
msgid "Not tamed!"
msgstr "No domesticado!"
#: api.lua
msgid "@1 is owner!"
msgstr "@1 es el dueño!"
#: api.lua
msgid "Missed!"
msgstr "Perdido!"
#: api.lua
msgid "Already protected!"
msgstr "Ya está protegido!"
#: api.lua
msgid "@1 at full health (@2)"
msgstr "@1 con salud llena (@2)"
#: api.lua
msgid "@1 has been tamed!"
msgstr "@1 ha sido domesticado!"
#: api.lua
msgid "Enter name:"
msgstr "Ingrese nombre:"
#: api.lua
msgid "Rename"
msgstr "Renombrar"
#: crafts.lua
msgid "Name Tag"
msgstr "Nombrar etiqueta"
#: crafts.lua
msgid "Leather"
msgstr "Cuero"
#: crafts.lua
msgid "Raw Meat"
msgstr "Carne cruda"
#: crafts.lua
msgid "Meat"
msgstr "Carne"
#: crafts.lua
msgid "Lasso (right-click animal to put in inventory)"
msgstr "Lazo (click derecho en animal para colocar en inventario)"
#: crafts.lua
msgid "Net (right-click animal to put in inventory)"
msgstr "Red (click derecho en animal para colocar en inventario)"
#: crafts.lua
msgid "Steel Shears (right-click to shear)"
msgstr "Tijera de acero (click derecho para esquilar)"
#: crafts.lua
msgid "Mob Protection Rune"
msgstr "Runa de protección de Mob"
#: crafts.lua
msgid "Saddle"
msgstr "Montura"
#: crafts.lua
msgid "Mob Fence"
msgstr ""
#: spawner.lua
msgid "Mob Spawner"
msgstr "Generador de Mob"
#: spawner.lua
msgid "Mob MinLight MaxLight Amount PlayerDist"
msgstr "Mob LuzMin LuzMax Cantidad DistJugador"
#: spawner.lua
msgid "Spawner Not Active (enter settings)"
msgstr "Generador no activo (ingrese config)"
#: spawner.lua
msgid "Spawner Active (@1)"
msgstr "Generador activo (@1)"
#: spawner.lua
msgid "Mob Spawner settings failed!"
msgstr "Configuracion de generador de Mob falló!"
#: spawner.lua
msgid ""
"Syntax: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] "
"distance[1-20] y_offset[-10 to 10]”"
msgstr "Sintaxis: “nombre luz_min[0-14] luz_max[0-14] max_mobs_en_area[0 para deshabilitar] "
"distancia[1-20] compensacion[-10 a 10]”"

View File

@ -0,0 +1,129 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-29 09:13+0200\n"
"PO-Revision-Date: 2017-07-29 09:20+0200\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.12\n"
"Last-Translator: fat115 <fat115@framasoft.org>\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Language: fr\n"
#: api.lua
msgid "** Peaceful Mode Active - No Monsters Will Spawn"
msgstr "** Mode pacifique activé - Aucun monstre ne sera généré"
#: api.lua
msgid "Mob has been protected!"
msgstr "L'animal a été protégé !"
#: api.lua
msgid "@1 (Tamed)"
msgstr "@1 (apprivoisé)"
#: api.lua
msgid "Not tamed!"
msgstr "Non-apprivoisé !"
#: api.lua
msgid "@1 is owner!"
msgstr "Appartient à @1 !"
#: api.lua
msgid "Missed!"
msgstr "Raté !"
#: api.lua
msgid "Already protected!"
msgstr "Déjà protégé !"
#: api.lua
msgid "@1 at full health (@2)"
msgstr "@1 est en pleine forme (@2) "
#: api.lua
msgid "@1 has been tamed!"
msgstr "@1 a été apprivoisé ! "
#: api.lua
msgid "Enter name:"
msgstr "Saisissez un nom :"
#: api.lua
msgid "Rename"
msgstr "Renommer"
#: crafts.lua
msgid "Name Tag"
msgstr "Étiquette pour collier"
#: crafts.lua
msgid "Leather"
msgstr "Cuir"
#: crafts.lua
msgid "Raw Meat"
msgstr "Viande crue"
#: crafts.lua
msgid "Meat"
msgstr "Viande"
#: crafts.lua
msgid "Lasso (right-click animal to put in inventory)"
msgstr "Lasso (clic droit sur l'animal pour le mettre dans l'inventaire)"
#: crafts.lua
msgid "Net (right-click animal to put in inventory)"
msgstr "Filet (clic droit sur l'animal pour le mettre dans l'inventaire)"
#: crafts.lua
msgid "Steel Shears (right-click to shear)"
msgstr "Ciseaux à laine (clic droit pour tondre)"
#: crafts.lua
msgid "Mob Protection Rune"
msgstr "Rune de protection des animaux"
#: crafts.lua
msgid "Saddle"
msgstr "Selle"
#: crafts.lua
msgid "Mob Fence"
msgstr "Clôture à animaux"
#: spawner.lua
msgid "Mob Spawner"
msgstr "Générateur de mob"
#: spawner.lua
msgid "Mob MinLight MaxLight Amount PlayerDist"
msgstr "Mob MinLumière MaxLumière Quantité DistanceJoueur"
#: spawner.lua
msgid "Spawner Not Active (enter settings)"
msgstr "Générateur non actif (entrez les paramètres)"
#: spawner.lua
msgid "Spawner Active (@1)"
msgstr "Générateur actif (@1)"
#: spawner.lua
msgid "Mob Spawner settings failed!"
msgstr "Echec des paramètres du générateur"
#: spawner.lua
msgid ""
"Syntax: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] "
"distance[1-20] y_offset[-10 to 10]”"
msgstr "Syntaxe : “nom min_lumière[0-14] max_lumière[0-14] max_mobs_dans_zone[0 pour désactiver] distance[1-20] décalage_y[-10 à 10]“"

View File

@ -0,0 +1,131 @@
# ITALIAN LOCALE FILE FOR THE MOBS REDO MODULE
# Copyright (c) 2014 Krupnov Pavel and 2016 TenPlus1
# This file is distributed under the same license as the MOBS REDO package.
# Hamlet <h4mlet@riseup.net>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Italian locale file for the Mobs Redo module\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-02 16:48+0200\n"
"PO-Revision-Date: 2017-08-18 12:18+0100\n"
"Last-Translator: H4mlet <h4mlet@riseup.net>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.10\n"
#: api.lua
msgid "** Peaceful Mode Active - No Monsters Will Spawn"
msgstr ""
#: api.lua
msgid "Mob has been protected!"
msgstr "Il mob è stato protetto!"
#: api.lua
msgid "@1 (Tamed)"
msgstr "@1 (Addomesticat*)"
#: api.lua
msgid "Not tamed!"
msgstr "Non addomesticat*!"
#: api.lua
msgid "@1 is owner!"
msgstr "Proprietari* @1!"
#: api.lua
msgid "Missed!"
msgstr "Mancat*!"
#: api.lua
msgid "Already protected!"
msgstr "Già protett*!"
#: api.lua
msgid "@1 at full health (@2)"
msgstr "@1 in piena salute (@2)"
#: api.lua
msgid "@1 has been tamed!"
msgstr "@1 è stat* addomesticat*!"
#: api.lua
msgid "Enter name:"
msgstr "Inserire il nome:"
#: api.lua
msgid "Rename"
msgstr "Rinominare"
#: crafts.lua
msgid "Name Tag"
msgstr "Targhetta"
#: crafts.lua
msgid "Leather"
msgstr "Pelle"
#: crafts.lua
msgid "Raw Meat"
msgstr "Carne cruda"
#: crafts.lua
msgid "Meat"
msgstr "Carne"
#: crafts.lua
msgid "Lasso (right-click animal to put in inventory)"
msgstr "Lazo (click di destro per mettere l'animale nell'inventario)"
#: crafts.lua
msgid "Net (right-click animal to put in inventory)"
msgstr "Rete (click destro per mettere l'animale nell'inventario)"
#: crafts.lua
msgid "Steel Shears (right-click to shear)"
msgstr "Cesoie d'acciaio (click destro per tosare)"
#: crafts.lua
msgid "Mob Protection Rune"
msgstr "Runa di protezione per mob"
#: crafts.lua
msgid "Saddle"
msgstr "Sella"
#: crafts.lua
msgid "Mob Fence"
msgstr ""
#: spawner.lua
msgid "Mob Spawner"
msgstr "Generatore di mob"
#: spawner.lua
msgid "Mob MinLight MaxLight Amount PlayerDist"
msgstr "Mob LuceMin LuceMax Ammontare DistGiocat."
#: spawner.lua
msgid "Spawner Not Active (enter settings)"
msgstr "Generatore inattivo (inserire le impostazioni)"
#: spawner.lua
msgid "Spawner Active (@1)"
msgstr "Generatore attivo (@1)"
#: spawner.lua
msgid "Mob Spawner settings failed!"
msgstr "Impostazioni del generatore di mob fallite!"
#: spawner.lua
msgid ""
"Syntax: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] "
"distance[1-20] y_offset[-10 to 10]”"
msgstr ""
"Sintassi: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 per "
"disabilitare] distance[1-20] y_offset[-10 to 10]”"

View File

@ -1,11 +0,0 @@
# textdomain: mcl_mobs
Peaceful mode active! No monsters will spawn.=Friedlicher Modus aktiv! Es werden keine Monster auftauchen.
This allows you to place a single mob.=Damit kann man einen Mob platzieren.
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.=Platzieren Sie dies einfach dort, wo der Mob auftauchen soll. Tiere werden zahm erscheinen, außer, wenn Sie beim Platzieren die Schlichtaste drücken. Platzieren Sie dies auf einem Mobspawner, um den Mob im Mobspawner zu wechseln.
You need the “maphack” privilege to change the mob spawner.=Sie brauchen das „maphack“-Privileg, um den Mobspawner ändern zu können.
Name Tag=Namensschild
A name tag is an item to name a mob.=Ein Namensschild ist ein Gegenstand, um einen Mob zu benennen.
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Bevor Sie ein Namensschild benutzen können, müssen Sie ihn an einem Amboss benennen. Dann können können Sie das Namensschild benutztn, um einen Mob zu benennen. Das wird das Namensschild verbrauchen.
Only peaceful mobs allowed!=Nur friedliche Mobs erlaubt!
Give names to mobs=Benennt Mobs
Set name at anvil=Namen am Amboss setzen

View File

@ -1,9 +0,0 @@
# textdomain: mcl_mobs
Peaceful mode active! No monsters will spawn.=¡Modo pacífico activo! No aparecerán monstruos.
This allows you to place a single mob.=Esto le permite colocar un solo animal.
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.=Simplemente colóquelo donde desea que aparezcan los animales. Los animales aparecerán domesticados, a menos que mantenga presionada la tecla de sigilo mientras coloca. Si coloca esto en un engendrador de animales, cambia el animal que genera.
You need the “maphack” privilege to change the mob spawner.=Necesita el privilegio "maphack" para cambiar el generador de animales.
Name Tag=Etiqueta
A name tag is an item to name a mob.=Una etiqueta es un elemento para nombrar una animal.
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Antes de usar la etiqueta, debe establecer un nombre en un yunque. Luego puede usar la etiqueta para nombrar un animal. Esto usa la etiqueta.
Only peaceful mobs allowed!=¡Solo se permiten animales pacíficos!

View File

@ -1,11 +0,0 @@
# textdomain: mcl_mobs
Peaceful mode active! No monsters will spawn.=Mode paisible actif! Aucun monstre n'apparaîtra.
This allows you to place a single mob.=Cela vous permet de placer un seul mob.
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.=Placez-le là où vous voulez que le mob apparaisse. Les animaux apparaîtront apprivoisés, sauf si vous maintenez la touche furtive enfoncée pendant le placement. Si vous le placez sur un générateur de mob, vous changez le mob qu'il génère.
You need the “maphack” privilege to change the mob spawner.=Vous avez besoin du privilège "maphack" pour changer le générateur de mob.
Name Tag=Étiquette de nom
A name tag is an item to name a mob.=Une étiquette de nom est un élément pour nommer un mob.
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=Avant d'utiliser l'étiquette de nom, vous devez définir un nom sur une enclume. Ensuite, vous pouvez utiliser l'étiquette de nom pour nommer un mob. Cela utilise l'étiquette de nom.
Only peaceful mobs allowed!=Seuls les mobs pacifiques sont autorisées!
Give names to mobs=Donne des noms aux mobs
Set name at anvil=Définir le nom sur l'enclume

View File

@ -0,0 +1,131 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-05 23:40+0800\n"
"PO-Revision-Date: 2018-02-05 23:51+0800\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.6\n"
"Last-Translator: MuhdNurHidayat (MNH48) <mnh48mail@gmail.com>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language: ms\n"
#: api.lua
msgid "** Peaceful Mode Active - No Monsters Will Spawn"
msgstr "** Mod Aman Diaktifkan - Tiada Raksasa Akan Muncul"
#: api.lua
msgid "Mob has been protected!"
msgstr "Mob telah pun dilindungi!"
#: api.lua
msgid "@1 (Tamed)"
msgstr "@1 (Jinak)"
#: api.lua
msgid "Not tamed!"
msgstr "Belum dijinakkan!"
#: api.lua
msgid "@1 is owner!"
msgstr "Ini hak milik @1!"
#: api.lua
msgid "Missed!"
msgstr "Terlepas!"
#: api.lua
msgid "Already protected!"
msgstr "Telah dilindungi!"
#: api.lua
msgid "@1 at full health (@2)"
msgstr "Mata kesihatan @1 telah penuh (@2)"
#: api.lua
msgid "@1 has been tamed!"
msgstr "@1 telah dijinakkan!"
#: api.lua
msgid "Enter name:"
msgstr "Masukkan nama:"
#: api.lua
msgid "Rename"
msgstr "Namakan semula"
#: crafts.lua
msgid "Name Tag"
msgstr "Tanda Nama"
#: crafts.lua
msgid "Leather"
msgstr "Kulit"
#: crafts.lua
msgid "Raw Meat"
msgstr "Daging Mentah"
#: crafts.lua
msgid "Meat"
msgstr "Daging Bakar"
#: crafts.lua
msgid "Lasso (right-click animal to put in inventory)"
msgstr "Tanjul (klik-kanan haiwan untuk masukkan ke inventori)"
#: crafts.lua
msgid "Net (right-click animal to put in inventory)"
msgstr "Jaring (klik-kanan haiwan untuk masukkan ke inventori)"
#: crafts.lua
msgid "Steel Shears (right-click to shear)"
msgstr "Ketam Keluli (klik-kanan untuk mengetam bulu biri-biri)"
#: crafts.lua
msgid "Mob Protection Rune"
msgstr "Rune Perlindungan Mob"
#: crafts.lua
msgid "Saddle"
msgstr "Pelana"
#: crafts.lua
msgid "Mob Fence"
msgstr "Pagar Mob"
#: spawner.lua
msgid "Mob Spawner"
msgstr "Pewujud Mob"
#: spawner.lua
msgid "Mob MinLight MaxLight Amount PlayerDist"
msgstr "Mob CahayaMin CahayaMax Amaun JarakPemain"
#: spawner.lua
msgid "Spawner Not Active (enter settings)"
msgstr "Pewujud Mob Tidak Aktif (masukkan tetapan)"
#: spawner.lua
msgid "Spawner Active (@1)"
msgstr "Pewujud Mob Aktif (@1)"
#: spawner.lua
msgid "Mob Spawner settings failed!"
msgstr "Penetapan Pewujud Mob gagal!"
#: spawner.lua
msgid ""
"Syntax: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] "
"distance[1-20] y_offset[-10 to 10]”"
msgstr ""
"Sintaks: \"nama cahaya_minimum[0-14] cahaya_maksimum[0-14] "
"amaun_mob_maksimum[0 untuk lumpuhkan] jarak[1-20] ketinggian[-10 hingga 10]\""

View File

@ -0,0 +1,133 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: mobs\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-02 16:48+0200\n"
"PO-Revision-Date: 2017-07-02 14:55+0200\n"
"Last-Translator: Wuzzy <almikes@aol.com>\n"
"Language-Team: \n"
"Language: pt\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.2\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: api.lua
msgid "** Peaceful Mode Active - No Monsters Will Spawn"
msgstr ""
#: api.lua
msgid "Mob has been protected!"
msgstr ""
#: api.lua
msgid "@1 (Tamed)"
msgstr ""
#: api.lua
msgid "Not tamed!"
msgstr "Indomesticado!"
#: api.lua
msgid "@1 is owner!"
msgstr "Dono @1!"
#: api.lua
msgid "Missed!"
msgstr "Faltou!"
#: api.lua
msgid "Already protected!"
msgstr ""
#: api.lua
msgid "@1 at full health (@2)"
msgstr "@1 em plena saude (@2)"
#: api.lua
msgid "@1 has been tamed!"
msgstr "@1 foi domesticado!"
#: api.lua
msgid "Enter name:"
msgstr "Insira um nome:"
#: api.lua
msgid "Rename"
msgstr "Renomear"
#: crafts.lua
msgid "Name Tag"
msgstr "Etiqueta"
#: crafts.lua
msgid "Leather"
msgstr "Couro"
#: crafts.lua
msgid "Raw Meat"
msgstr "Carne crua"
#: crafts.lua
msgid "Meat"
msgstr "Carne"
#: crafts.lua
#, fuzzy
msgid "Lasso (right-click animal to put in inventory)"
msgstr "Laço (clique-direito no animal para por no inventario)"
#: crafts.lua
msgid "Net (right-click animal to put in inventory)"
msgstr "Net (clique-direito no animal para por no inventario)"
#: crafts.lua
msgid "Steel Shears (right-click to shear)"
msgstr "Tesoura de Aço (clique-direito para tosquiar)"
#: crafts.lua
msgid "Mob Protection Rune"
msgstr ""
#: crafts.lua
msgid "Saddle"
msgstr ""
#: crafts.lua
msgid "Mob Fence"
msgstr ""
#: spawner.lua
msgid "Mob Spawner"
msgstr "Spawnador de Mob"
#: spawner.lua
msgid "Mob MinLight MaxLight Amount PlayerDist"
msgstr "Mob LuzMinima LuzMaxima Valor DistJogador"
#: spawner.lua
msgid "Spawner Not Active (enter settings)"
msgstr "Spawnador Inativo (configurar)"
#: spawner.lua
msgid "Spawner Active (@1)"
msgstr "Spawnador Ativo (@1)"
#: spawner.lua
msgid "Mob Spawner settings failed!"
msgstr "Configuraçao de Spawnador do Mob falhou!"
#: spawner.lua
#, fuzzy
msgid ""
"Syntax: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] "
"distance[1-20] y_offset[-10 to 10]”"
msgstr ""
"> nome luz_min[0-14] luz_max[0-14] max_mobs_na_area[0 para desabilitar] "
"distancia[1-20] y_offset[-10 a 10]"

View File

@ -0,0 +1,129 @@
# Russian translation for the mobs_redo mod.
# Copyright (C) 2018 TenPlus1
# This file is distributed under the same license as the mobs_redo package.
# Oleg720 <olegsiriak@yandex.ru>, 2017.
# CodeXP <codexp@gmx.net>, 2018.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-13 15:47+0200\n"
"PO-Revision-Date: 2018-03-23 22:22+0100\n"
"Last-Translator: CodeXP <codexp@gmx.net>\n"
"Language-Team: \n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: api.lua
msgid "** Peaceful Mode Active - No Monsters Will Spawn"
msgstr "** Мирный модус активирован - монстры не спаунятся"
#: api.lua
msgid "Mob has been protected!"
msgstr "Моб защищен!"
#: api.lua
msgid "@1 (Tamed)"
msgstr "@1 (Прирученный)"
#: api.lua
msgid "Not tamed!"
msgstr "Не прирученный"
#: api.lua
msgid "@1 is owner!"
msgstr "@1 владелец"
#: api.lua
msgid "Missed!"
msgstr "Промазал!"
#: api.lua
msgid "Already protected!"
msgstr "Уже защищен!"
#: api.lua
msgid "@1 at full health (@2)"
msgstr "@1 при полном здоровье (@2)"
#: api.lua
msgid "@1 has been tamed!"
msgstr "@1 приручен"
#: api.lua
msgid "Enter name:"
msgstr "Введите имя:"
#: api.lua
msgid "Rename"
msgstr "Переименовать"
#: crafts.lua
msgid "Name Tag"
msgstr "Новый тэг"
#: crafts.lua
msgid "Leather"
msgstr "Кожа"
#: crafts.lua
msgid "Raw Meat"
msgstr "Сырое мясо"
#: crafts.lua
msgid "Meat"
msgstr "Мясо"
#: crafts.lua
msgid "Lasso (right-click animal to put in inventory)"
msgstr "Лассо (Правый клик - положить животное в инвентарь)"
#: crafts.lua
msgid "Net (right-click animal to put in inventory)"
msgstr "Сеть (Правый клик - положить животное в инвентарь)"
#: crafts.lua
msgid "Steel Shears (right-click to shear)"
msgstr "Ножницы (Правый клик - подстричь)"
#: crafts.lua
msgid "Mob Protection Rune"
msgstr "Защитная руна мобов"
#: crafts.lua
msgid "Saddle"
msgstr "Седло"
#: crafts.lua
msgid "Mob Fence"
msgstr "Забор от мобов"
#: spawner.lua
msgid "Mob Spawner"
msgstr "Спаунер моба"
#: spawner.lua
msgid "Mob MinLight MaxLight Amount PlayerDist"
msgstr ""
#: spawner.lua
msgid "Spawner Not Active (enter settings)"
msgstr "Спаунер не активен (введите настройки)"
#: spawner.lua
msgid "Spawner Active (@1)"
msgstr "Активные спаунер (@1)"
#: spawner.lua
msgid "Mob Spawner settings failed!"
msgstr "Настройки спаунера моба провалились"
#: spawner.lua
msgid ""
"Syntax: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] "
"distance[1-20] y_offset[-10 to 10]”"
msgstr ""

View File

@ -0,0 +1,128 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-02 16:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: api.lua
msgid "** Peaceful Mode Active - No Monsters Will Spawn"
msgstr ""
#: api.lua
msgid "Mob has been protected!"
msgstr ""
#: api.lua
msgid "@1 (Tamed)"
msgstr ""
#: api.lua
msgid "Not tamed!"
msgstr ""
#: api.lua
msgid "@1 is owner!"
msgstr ""
#: api.lua
msgid "Missed!"
msgstr ""
#: api.lua
msgid "Already protected!"
msgstr ""
#: api.lua
msgid "@1 at full health (@2)"
msgstr ""
#: api.lua
msgid "@1 has been tamed!"
msgstr ""
#: api.lua
msgid "Enter name:"
msgstr ""
#: api.lua
msgid "Rename"
msgstr ""
#: crafts.lua
msgid "Name Tag"
msgstr ""
#: crafts.lua
msgid "Leather"
msgstr ""
#: crafts.lua
msgid "Raw Meat"
msgstr ""
#: crafts.lua
msgid "Meat"
msgstr ""
#: crafts.lua
msgid "Lasso (right-click animal to put in inventory)"
msgstr ""
#: crafts.lua
msgid "Net (right-click animal to put in inventory)"
msgstr ""
#: crafts.lua
msgid "Steel Shears (right-click to shear)"
msgstr ""
#: crafts.lua
msgid "Mob Protection Rune"
msgstr ""
#: crafts.lua
msgid "Saddle"
msgstr ""
#: crafts.lua
msgid "Mob Fence"
msgstr ""
#: spawner.lua
msgid "Mob Spawner"
msgstr ""
#: spawner.lua
msgid "Mob MinLight MaxLight Amount PlayerDist"
msgstr ""
#: spawner.lua
msgid "Spawner Not Active (enter settings)"
msgstr ""
#: spawner.lua
msgid "Spawner Active (@1)"
msgstr ""
#: spawner.lua
msgid "Mob Spawner settings failed!"
msgstr ""
#: spawner.lua
msgid ""
"Syntax: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] "
"distance[1-20] y_offset[-10 to 10]”"
msgstr ""

View File

@ -1,11 +0,0 @@
# textdomain: mcl_mobs
Peaceful mode active! No monsters will spawn.=
This allows you to place a single mob.=
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.=
You need the “maphack” privilege to change the mob spawner.=
Name Tag=
A name tag is an item to name a mob.=
Before you use the name tag, you need to set a name at an anvil. Then you can use the name tag to name a mob. This uses up the name tag.=
Only peaceful mobs allowed!=
Give names to mobs=
Set name at anvil=

View File

@ -0,0 +1,133 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: mobs\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-02 16:48+0200\n"
"PO-Revision-Date: 2017-07-02 14:56+0200\n"
"Last-Translator: Wuzzy <almikes@aol.com>\n"
"Language-Team: \n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.2\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: api.lua
msgid "** Peaceful Mode Active - No Monsters Will Spawn"
msgstr ""
#: api.lua
msgid "Mob has been protected!"
msgstr ""
#: api.lua
msgid "@1 (Tamed)"
msgstr ""
#: api.lua
msgid "Not tamed!"
msgstr "Evcil değil!"
#: api.lua
msgid "@1 is owner!"
msgstr "Sahibi @1!"
#: api.lua
msgid "Missed!"
msgstr "Kaçırdın!"
#: api.lua
msgid "Already protected!"
msgstr ""
#: api.lua
msgid "@1 at full health (@2)"
msgstr "@1 tam canında (@2)"
#: api.lua
msgid "@1 has been tamed!"
msgstr "@1 tamamen evcilleştirilmiştir!"
#: api.lua
msgid "Enter name:"
msgstr "İsim gir:"
#: api.lua
msgid "Rename"
msgstr "Yeniden adlandır"
#: crafts.lua
msgid "Name Tag"
msgstr "İsim etiketi"
#: crafts.lua
msgid "Leather"
msgstr "Deri"
#: crafts.lua
msgid "Raw Meat"
msgstr "Çiğ et"
#: crafts.lua
msgid "Meat"
msgstr "Et"
#: crafts.lua
#, fuzzy
msgid "Lasso (right-click animal to put in inventory)"
msgstr "Kement (hayvana sağ tıklayarak envantere koy)"
#: crafts.lua
msgid "Net (right-click animal to put in inventory)"
msgstr "Ağ (hayvana sağ tıklayarak envantere koy)"
#: crafts.lua
msgid "Steel Shears (right-click to shear)"
msgstr "Çelik makas (sağ tıklayarak kes)"
#: crafts.lua
msgid "Mob Protection Rune"
msgstr ""
#: crafts.lua
msgid "Saddle"
msgstr ""
#: crafts.lua
msgid "Mob Fence"
msgstr "Canavar Yaratıcı"
#: spawner.lua
msgid "Mob Spawner"
msgstr "Canavar Yaratıcı"
#: spawner.lua
msgid "Mob MinLight MaxLight Amount PlayerDist"
msgstr "Mob MinIşık MaxIşık Miktar OyuncuMesafesi"
#: spawner.lua
msgid "Spawner Not Active (enter settings)"
msgstr "Yaratıcı aktif değil (ayarlara gir)"
#: spawner.lua
msgid "Spawner Active (@1)"
msgstr "Yaratıcı aktif (@1)"
#: spawner.lua
msgid "Mob Spawner settings failed!"
msgstr "Yaratıcı ayarları uygulanamadı."
#: spawner.lua
#, fuzzy
msgid ""
"Syntax: “name min_light[0-14] max_light[0-14] max_mobs_in_area[0 to disable] "
"distance[1-20] y_offset[-10 to 10]”"
msgstr ""
"> isim min_isik[0-14] max_isik[0-14] alandaki_max_canavar_sayisi[kapatmak "
"icin 0] mesafe[1-20] y_cikinti[-10 ve 10 arası]"

View File

@ -1,2 +1 @@
name = mcl_mobs
optional_depends = mcl_weather, mcl_explosions, mcl_hunger, mcl_worlds, invisibility, lucky_block, cmi, doc_identifier, mcl_armor

View File

@ -121,7 +121,7 @@ end)
function mobs.attach(entity, player)
local attach_at, eye_offset
local attach_at, eye_offset = {}, {}
entity.player_rotation = entity.player_rotation or {x = 0, y = 0, z = 0}
entity.driver_attach_at = entity.driver_attach_at or {x = 0, y = 0, z = 0}
@ -183,14 +183,14 @@ end
function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
local rot_view = 0
local rot_steer, rot_view = math.pi/2, 0
if entity.player_rotation.y == 90 then
rot_view = math.pi/2
rot_steer, rot_view = 0, math.pi/2
end
local acce_y = 0
local velo = entity.object:get_velocity()
local velo = entity.object:getvelocity()
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:set_yaw(entity.driver:get_look_horizontal() - entity.rotate)
entity.object:setyaw(entity.driver:get_look_horizontal() - entity.rotate)
if can_fly then
@ -262,7 +262,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
return
end
-- set moving animation
if moving_anim then
mobs:set_animation(entity, moving_anim)
@ -275,7 +275,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
if s ~= get_sign(entity.v) then
entity.object:set_velocity({x = 0, y = 0, z = 0})
entity.object:setvelocity({x = 0, y = 0, z = 0})
entity.v = 0
return
end
@ -293,7 +293,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
-- Set position, velocity and acceleration
local p = entity.object:get_pos()
local new_velo
local new_velo = {x = 0, y = 0, z = 0}
local new_acce = {x = 0, y = -9.8, z = 0}
p.y = p.y - 0.5
@ -318,7 +318,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
minetest.sound_play("default_punch", {
object = entity.object,
max_hear_distance = 5
}, true)
})
entity.object:punch(entity.object, 1.0, {
full_punch_interval = 1.0,
@ -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:set_pos(pos)
entity.object:setpos(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:set_velocity(new_velo)
entity.object:set_acceleration(new_acce)
entity.object:setvelocity(new_velo)
entity.object:setacceleration(new_acce)
-- CRASH!
if enable_crash then
@ -387,29 +387,34 @@ end
function mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim)
local ctrl = entity.driver:get_player_control()
local velo = entity.object:get_velocity()
local velo = entity.object:getvelocity()
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
if entity.player_rotation.y == 90 then
rot_steer, rot_view = 0, math.pi / 2
end
if ctrl.up then
entity.object:set_velocity({
entity.object:setvelocity({
x = dir.x * speed,
y = dir.y * speed + 2,
z = dir.z * speed
})
elseif ctrl.down then
entity.object:set_velocity({
entity.object:setvelocity({
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:set_velocity({x = 0, y = -2, z = 0})
entity.object:setvelocity({x = 0, y = -2, z = 0})
end
entity.object:set_yaw(yaw + math.pi + math.pi / 2 - entity.rotate)
entity.object:setyaw(yaw + math.pi + math.pi / 2 - entity.rotate)
-- firing arrows
if ctrl.LMB and ctrl.sneak and shoots then
@ -426,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:set_yaw(yaw + math.pi / 2)
obj:set_velocity(vec)
obj:setyaw(yaw + math.pi / 2)
obj:setvelocity(vec)
else
obj:remove()
end

View File

@ -1,276 +0,0 @@
mcl_paintings = {}
dofile(minetest.get_modpath(minetest.get_current_modname()).."/paintings.lua")
local S = minetest.get_translator("mcl_paintings")
local wood = "[combine:16x16:-192,0=mcl_paintings_paintings.png"
-- Check if there's a painting for provided painting size.
-- If yes, returns the arguments.
-- If not, returns the next smaller available painting.
local shrink_painting = function(x, y)
if x > 4 or y > 4 then
return nil
end
local xstart = x
local painting
while not painting do
painting = mcl_paintings.paintings[y] and mcl_paintings.paintings[y][x]
if type(painting) == "table" then
break
elseif type(painting) == "number" then
x = painting
painting = nil
else
x = xstart
y = y - 1
end
if y < 1 then
return nil
end
end
if type(painting) == "table" then
return x, y
end
end
local get_painting = function(x, y, motive)
local painting = mcl_paintings.paintings[y] and mcl_paintings.paintings[y][x] and mcl_paintings.paintings[y][x][motive]
if not painting then
return nil
end
local px, py = -painting.cx, -painting.cy
local sx, sy = 16*x, 16*y
return "[combine:"..sx.."x"..sy..":"..px..","..py.."=mcl_paintings_paintings.png"
end
local get_random_painting = function(x, y)
if not mcl_paintings.paintings[y] or not mcl_paintings.paintings[y][x] then
return nil
end
local max = #mcl_paintings.paintings[y][x]
if max < 1 then
return nil
end
local r = math.random(1, max)
return get_painting(x, y, r), r
end
local size_to_minmax = function(size)
local min, max
if size == 2 then
min = -0.5
max = 1.5
elseif size == 3 then
min = -1.5
max = 1.5
elseif size == 4 then
min = -1.5
max = 2.5
else
min = -0.5
max = 0.5
end
return min, max
end
local size_to_minmax_entity = function(size)
return -size/2, size/2
end
local set_entity = function(object)
local ent = object:get_luaentity()
local wallm = ent._facing
local xsize = ent._xsize
local ysize = ent._ysize
local exmin, exmax = size_to_minmax_entity(xsize)
local eymin, eymax = size_to_minmax_entity(ysize)
local visual_size = { x=xsize-0.0001, y=ysize-0.0001, z=1/32 }
if not ent._xsize or not ent._ysize or not ent._motive then
minetest.log("error", "[mcl_paintings] Painting loaded with missing painting values!")
return
end
local painting = get_painting(xsize, ysize, ent._motive)
if not painting then
minetest.log("error", "[mcl_paintings] No painting found for size "
..xsize..","..ysize..", motive number "..ent._motive.."!")
return
end
if wallm == 4 or wallm == 5 then
object:set_properties({
selectionbox = { exmin, eymin, -1/64, exmax, eymax, 1/64 },
visual_size = visual_size,
textures = { wood, wood, wood, wood, painting, wood },
})
else
object:set_properties({
selectionbox = { -1/64, eymin, exmin, 1/64, eymax, exmax },
visual_size = visual_size,
textures = { wood, wood, wood, wood, painting, wood },
})
end
local dir = minetest.wallmounted_to_dir(wallm)
if not dir then
return
end
object:set_yaw(minetest.dir_to_yaw(dir))
end
minetest.register_entity("mcl_paintings:painting", {
visual = "cube",
visual_size = { x=0.999, y=0.999, z=1/32 },
selectionbox = { -1/64, -0.5, -0.5, 1/64, 0.5, 0.5 },
physical = false,
collide_with_objects = false,
textures = { wood, wood, wood, wood, wood, wood },
hp_max = 1,
_motive = 0,
_pos = nil,
_facing = 2,
_xsize = 1,
_ysize = 1,
on_activate = function(self, staticdata)
if staticdata and staticdata ~= "" then
local data = minetest.deserialize(staticdata)
if data then
self._facing = data._facing
self._pos = data._pos
self._motive = data._motive
self._xsize = data._xsize
self._ysize = data._ysize
end
end
set_entity(self.object)
end,
get_staticdata = function(self)
local data = {
_facing = self._facing,
_pos = self._pos,
_motive = self._motive,
_xsize = self._xsize,
_ysize = self._ysize,
}
return minetest.serialize(data)
end,
on_death = function(self, killer)
-- Drop as item on death
if not minetest.settings:get_bool("creative_mode") then
local pos = self._pos
if not pos then
pos = self.object:get_pos()
end
minetest.add_item(pos, "mcl_paintings:painting")
end
end,
})
minetest.register_craftitem("mcl_paintings:painting", {
description = S("Painting"),
inventory_image = "mcl_paintings_painting.png",
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return itemstack
end
local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
dir = vector.normalize(dir)
if dir.y ~= 0 then
-- Ceiling/floor paintings are not supported
return itemstack
end
local wallm = minetest.dir_to_wallmounted(dir)
if wallm then
local ppos = pointed_thing.above
local xmax
local ymax = 4
local xmaxes = {}
local ymaxed = false
local negative = dir.x < 0 or dir.z > 0
-- Check maximum possible painting size
local t
for y=0,3 do
for x=0,3 do
local k = x
if negative then
k = -k
end
if dir.z ~= 0 then
t = {x=k,y=y,z=0}
else
t = {x=0,y=y,z=k}
end
local unode = minetest.get_node(vector.add(pointed_thing.under, t))
local anode = minetest.get_node(vector.add(ppos, t))
local udef = minetest.registered_nodes[unode.name]
local adef = minetest.registered_nodes[anode.name]
if (not (udef and udef.walkable)) or (not adef or adef.walkable) then
xmaxes[y+1] = x
if x == 0 and not ymaxed then
ymax = y
ymaxed = true
end
break
end
end
if not xmaxes[y] then
xmaxes[y] = 4
end
end
xmax = math.max(unpack(xmaxes))
local xsize, ysize = xmax, ymax
xsize, ysize = shrink_painting(xsize, ysize)
if not xsize then
return itemstack
end
local _, exmax = size_to_minmax_entity(xsize)
local _, eymax = size_to_minmax_entity(ysize)
local pposa = vector.subtract(ppos, vector.multiply(dir, 0.5-2/64))
local pexmax
local peymax = eymax - 0.5
if negative then
pexmax = -exmax + 0.5
else
pexmax = exmax - 0.5
end
if dir.z ~= 0 then
pposa = vector.add(pposa, {x=pexmax, y=peymax, z=0})
else
pposa = vector.add(pposa, {x=0, y=peymax, z=pexmax})
end
local painting, pid = get_random_painting(xsize, ysize)
if not painting then
minetest.log("error", "[mcl_paintings] No painting found for size "..xsize..","..ysize.."!")
return itemstack
end
local staticdata = {
_facing = wallm,
_pos = ppos,
_motive = pid,
_xsize = xsize,
_ysize = ysize,
}
local obj = minetest.add_entity(pposa, "mcl_paintings:painting", minetest.serialize(staticdata))
if not obj then
return itemstack
end
else
return itemstack
end
if not minetest.settings:get_bool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
})
minetest.register_craft({
output = "mcl_paintings:painting",
recipe = {
{ "mcl_core:stick", "mcl_core:stick", "mcl_core:stick" },
{ "mcl_core:stick", "group:wool", "mcl_core:stick" },
{ "mcl_core:stick", "mcl_core:stick", "mcl_core:stick" },
}
})

View File

@ -1,2 +0,0 @@
# textdomain:mcl_paintings
Painting=Gemälde

View File

@ -1,2 +0,0 @@
# textdomain:mcl_paintings
Painting=

View File

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

View File

@ -1,55 +0,0 @@
local TS = 16 -- texture size
mcl_paintings.paintings = {
[1] = {
[1] = {
{ cx = 0, cy = 0 },
{ cx = TS, cy = 0 },
{ cx = 2*TS, cy = 0 },
{ cx = 3*TS, cy = 0 },
{ cx = 4*TS, cy = 0 },
{ cx = 5*TS, cy = 0 },
{ cx = 6*TS, cy = 0 },
},
[2] = {
{ cx = 0, cy = 2*TS },
{ cx = 2*TS, cy = 2*TS },
{ cx = 4*TS, cy = 2*TS },
{ cx = 6*TS, cy = 2*TS },
{ cx = 8*TS, cy = 2*TS },
},
[3] = 2,
[4] = 2,
},
[2] = {
[1] = {
{ cx = 0, cy = 4*TS },
{ cx = TS, cy = 4*TS },
},
[2] = {
{ cx = 0, cy = 8*TS },
{ cx = 2*TS, cy = 8*TS },
{ cx = 4*TS, cy = 8*TS },
{ cx = 6*TS, cy = 8*TS },
{ cx = 8*TS, cy = 8*TS },
{ cx = 10*TS, cy = 8*TS },
},
[3] = 2,
[4] = {
{ cx = 0, cy = 6*TS },
},
},
[3] = {
[4] = {
{ cx = 12*TS, cy = 4*TS },
{ cx = 12*TS, cy = 7*TS },
},
},
[4] = {
[4] = {
{ cx = 0, cy = 12*TS },
{ cx = 4*TS, cy = 12*TS },
{ cx = 8*TS, cy = 12*TS },
},
},
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@ -157,7 +157,6 @@ mobs_mc.follow = {
chicken = { "farming:seed_wheat", "farming:seed_cotton" }, -- seeds in general
parrot = { "farming:seed_wheat", "farming:seed_cotton" }, -- seeds in general
horse = { mobs_mc.items.apple, mobs_mc.items.sugar, mobs_mc.items.wheat, mobs_mc.items.hay_bale, mobs_mc.items.golden_apple, mobs_mc.items.golden_carrot },
llama = { mobs_mc.items.wheat, mobs_mc.items.hay_bale, },
pig = { mobs_mc.items.potato, mobs_mc.items.carrot, mobs_mc.items.carrot_on_a_stick,
mobs_mc.items.apple, -- Minetest Game extra
},
@ -279,8 +278,8 @@ mobs_mc.spawn = {
-- These probably don't need overrides
mushroom_island = { mobs_mc.items.mycelium, "mcl_core:mycelium" },
nether_fortress = { mobs_mc.items.nether_brick_block, "mcl_nether:nether_brick", },
nether = { mobs_mc.items.netherrack, "mcl_nether:netherrack", },
nether_fortress = { mobs_mc.items.nether_brick_block, "mcl_nether:nether_brick", "mcl_portals:nether_air" },
nether = { mobs_mc.items.netherrack, "mcl_nether:netherrack", "mcl_portals:nether_air" },
nether_portal = { mobs_mc.items.nether_portal, "mcl_portals:portal" },
water = { mobs_mc.items.water_source, "mcl_core:water_source", "default:water_source" },
}

View File

@ -3,20 +3,21 @@
--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
-- NOTE: Most strings intentionally not marked for translation, other mods already have these items.
-- TODO: Remove this file eventually, most items are already outsourced in other mods.
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local c = mobs_mc.is_item_variable_overridden
-- Blaze
if c("blaze_rod") then
minetest.register_craftitem("mobs_mc:blaze_rod", {
description = "Blaze Rod",
_doc_items_longdesc = "This is a crafting component dropped from dead blazes.",
description = S("Blaze Rod"),
_doc_items_longdesc = S("This is a crafting component dropped from dead blazes."),
wield_image = "mcl_mobitems_blaze_rod.png",
inventory_image = "mcl_mobitems_blaze_rod.png",
})
@ -42,8 +43,8 @@ end
if c("blaze_powder") then
minetest.register_craftitem("mobs_mc:blaze_powder", {
description = "Blaze Powder",
_doc_items_longdesc = "This item is mainly used for brewing potions and crafting.",
description = S("Blaze Powder"),
_doc_items_longdesc = S("This item is mainly used for brewing potions and crafting."),
wield_image = "mcl_mobitems_blaze_powder.png",
inventory_image = "mcl_mobitems_blaze_powder.png",
})
@ -59,8 +60,8 @@ end
-- Chicken
if c("chicken_raw") then
minetest.register_craftitem("mobs_mc:chicken_raw", {
description = "Raw Chicken",
_doc_items_longdesc = "Raw chicken is a food item and can be eaten safely. Cooking it will increase its nutritional value.",
description = S("Raw Chicken"),
_doc_items_longdesc = S("Raw chicken is a food item and can be eaten safely. Cooking it will increase its nutritional value."),
inventory_image = "mcl_mobitems_chicken_raw.png",
groups = { food = 2, eatable = 2 },
on_use = minetest.item_eat(2),
@ -69,8 +70,8 @@ end
if c("chicken_cooked") then
minetest.register_craftitem("mobs_mc:chicken_cooked", {
description = "Cooked Chicken",
_doc_items_longdesc = "A cooked chicken is a healthy food item which can be eaten.",
description = S("Cooked Chicken"),
_doc_items_longdesc = S("A cooked chicken is a healthy food item which can be eaten."),
inventory_image = "mcl_mobitems_chicken_cooked.png",
groups = { food = 2, eatable = 6 },
on_use = minetest.item_eat(6),
@ -88,8 +89,8 @@ end
if c("feather") then
minetest.register_craftitem("mobs_mc:feather", {
description = "Feather",
_doc_items_longdesc = "Feathers are used in crafting and are dropped from chickens.",
description = S("Feather"),
_doc_items_longdesc = S("Feathers are used in crafting and are dropped from chickens."),
inventory_image = "mcl_mobitems_feather.png",
})
end
@ -97,8 +98,8 @@ end
-- Cow and mooshroom
if c("beef_raw") then
minetest.register_craftitem("mobs_mc:beef_raw", {
description = "Raw Beef",
_doc_items_longdesc = "Raw beef is the flesh from cows and can be eaten safely. Cooking it will greatly increase its nutritional value.",
description = S("Raw Beef"),
_doc_items_longdesc = S("Raw beef is the flesh from cows and can be eaten safely. Cooking it will greatly increase its nutritional value."),
inventory_image = "mcl_mobitems_beef_raw.png",
groups = { food = 2, eatable = 3 },
on_use = minetest.item_eat(3),
@ -107,8 +108,8 @@ end
if c("beef_cooked") then
minetest.register_craftitem("mobs_mc:beef_cooked", {
description = "Steak",
_doc_items_longdesc = "Steak is cooked beef from cows and can be eaten.",
description = S("Steak"),
_doc_items_longdesc = S("Steak is cooked beef from cows and can be eaten."),
inventory_image = "mcl_mobitems_beef_cooked.png",
groups = { food = 2, eatable = 8 },
on_use = minetest.item_eat(8),
@ -128,8 +129,8 @@ end
if c("milk") then
-- milk
minetest.register_craftitem("mobs_mc:milk_bucket", {
description = "Milk",
_doc_items_longdesc = "Milk is a food item obtained by using a bucket on a cow.",
description = S("Milk"),
_doc_items_longdesc = S("Milk is a food item obtained by using a bucket on a cow."),
inventory_image = "mobs_bucket_milk.png",
groups = { food = 3, eatable = 1 },
on_use = minetest.item_eat(1, "bucket:bucket_empty"),
@ -139,8 +140,8 @@ end
if c("bowl") then
minetest.register_craftitem("mobs_mc:bowl", {
description = "Bowl",
_doc_items_longdesc = "Bowls are mainly used to hold tasty soups.",
description = S("Bowl"),
_doc_items_longdesc = S("Bowls are mainly used to hold tasty soups."),
inventory_image = "mcl_core_bowl.png",
})
@ -161,8 +162,8 @@ end
if c("mushroom_stew") then
minetest.register_craftitem("mobs_mc:mushroom_stew", {
description = "Mushroom Stew",
_doc_items_longdesc = "Mushroom stew is a healthy soup.",
description = S("Mushroom Stew"),
_doc_items_longdesc = S("Mushroom stew is a healthy soup."),
inventory_image = "farming_mushroom_stew.png",
groups = { food = 3, eatable = 6 },
on_use = minetest.item_eat(6, "mobs_mc:bowl"),
@ -180,7 +181,7 @@ if c("dragon_egg") then
--ender dragon
minetest.register_node("mobs_mc:dragon_egg", {
description = "Dragon Egg",
description = S("Dragon Egg"),
tiles = {
"mcl_end_dragon_egg.png",
"mcl_end_dragon_egg.png",
@ -224,7 +225,7 @@ end
-- Enderman
if c("ender_eye") then
minetest.register_craftitem("mobs_mc:ender_eye", {
description = "Eye of Ender",
description = S("Eye of Ender"),
_doc_items_longdesc = longdesc_craftitem,
inventory_image = "mcl_end_ender_eye.png",
groups = { craftitem = 1 },
@ -242,8 +243,8 @@ end
-- Ghast
if c("ghast_tear") then
minetest.register_craftitem("mobs_mc:ghast_tear", {
description = "Ghast Tear",
_doc_items_longdesc = "A ghast tear is an item used in potion brewing. It is dropped from dead ghasts.",
description = S("Ghast Tear"),
_doc_items_longdesc = S("A ghast tear is an item used in potion brewing. It is dropped from dead ghasts."),
wield_image = "mcl_mobitems_ghast_tear.png",
inventory_image = "mcl_mobitems_ghast_tear.png",
groups = { brewitem = 1 },
@ -254,16 +255,27 @@ end
if c("saddle") then
-- Overwrite the saddle from Mobs Redo
minetest.register_craftitem(":mobs:saddle", {
description = "Saddle",
_doc_items_longdesc = "Saddles can be put on horses, donkeys, mules and pigs in order to mount them.",
_doc_items_usagehelp = "Rightclick an animal while holding a saddle to put on the saddle. You can now mount the animal by rightclicking it again.",
description = S("Saddle"),
_doc_items_longdesc = S("Saddles can be put on horses, donkeys, mules and pigs in order to mount them."),
_doc_items_usagehelp = S("Rightclick an animal while holding a saddle to put on the saddle. You can now mount the animal by rightclicking it again."),
inventory_image = "mcl_mobitems_saddle.png",
stack_max = 1,
})
end
if c("saddle") and c("lether") and c("string") and c("iron_ingot") then
minetest.register_craft({
output = "mobs_mc:saddle",
recipe = {
{"mobs:leather", "mobs:leather", "mobs:leather"},
{"farming:string", "", "farming:string"},
{"default:steel_ingot", "", "default:steel_ingot"}
},
})
end
-- Horse Armor
local horse_armor_use = S("Place it on a horse to put on the horse armor. Donkeys and mules can't wear horse armor.")
local horse_armor_use = S("Rightclick a horse to put on the horse armor. Donkeys and mules can't wear horse armor.")
-- TODO: Balance the horse armor strength, compare with MC armor strength
if c("iron_horse_armor") then
minetest.register_craftitem("mobs_mc:iron_horse_armor", {
@ -272,9 +284,6 @@ if c("iron_horse_armor") then
_doc_items_usagehelp = horse_armor_use,
inventory_image = "mobs_mc_iron_horse_armor.png",
_horse_overlay_image = "mobs_mc_horse_armor_iron.png",
sounds = {
_mcl_armor_equip = "mcl_armor_equip_iron",
},
stack_max = 1,
groups = { horse_armor = 85 },
})
@ -286,9 +295,6 @@ if c("gold_horse_armor") then
_doc_items_usagehelp = horse_armor_use,
inventory_image = "mobs_mc_gold_horse_armor.png",
_horse_overlay_image = "mobs_mc_horse_armor_gold.png",
sounds = {
_mcl_armor_equip = "mcl_armor_equip_iron",
},
stack_max = 1,
groups = { horse_armor = 60 },
})
@ -300,9 +306,6 @@ if c("diamond_horse_armor") then
_doc_items_usagehelp = horse_armor_use,
inventory_image = "mobs_mc_diamond_horse_armor.png",
_horse_overlay_image = "mobs_mc_horse_armor_diamond.png",
sounds = {
_mcl_armor_equip = "mcl_armor_equip_diamond",
},
stack_max = 1,
groups = { horse_armor = 45 },
})
@ -311,8 +314,8 @@ end
-- Pig
if c("porkchop_raw") then
minetest.register_craftitem("mobs_mc:porkchop_raw", {
description = "Raw Porkchop",
_doc_items_longdesc = "A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value.",
description = S("Raw Porkchop"),
_doc_items_longdesc = S("A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value."),
inventory_image = "mcl_mobitems_porkchop_raw.png",
groups = { food = 2, eatable = 3 },
on_use = minetest.item_eat(3),
@ -321,7 +324,7 @@ end
if c("porkchop_cooked") then
minetest.register_craftitem("mobs_mc:porkchop_cooked", {
description = "Cooked Porkchop",
description = S("Cooked Porkchop"),
_doc_items_longdesc = "Cooked porkchop is the cooked flesh of a pig and is used as food.",
inventory_image = "mcl_mobitems_porkchop_cooked.png",
groups = { food = 2, eatable = 8 },
@ -340,9 +343,9 @@ end
if c("carrot_on_a_stick") then
minetest.register_tool("mobs_mc:carrot_on_a_stick", {
description = "Carrot on a Stick",
_doc_items_longdesc = "A carrot on a stick can be used on saddled pigs to ride them. Pigs will also follow anyone who holds a carrot on a stick near them.",
_doc_items_usagehelp = "Rightclick a saddled pig with the carrot on a stick to mount it. You can now ride it like a horse.",
description = S("Carrot on a Stick"),
_doc_items_longdesc = S("A carrot on a stick can be used on saddled pigs to ride them. Pigs will also follow anyone who holds a carrot on a stick near them."),
_doc_items_usagehelp = S("Rightclick a saddled pig with the carrot on a stick to mount it. You can now ride it like a horse."),
wield_image = "mcl_mobitems_carrot_on_a_stick.png",
inventory_image = "mcl_mobitems_carrot_on_a_stick.png",
sounds = { breaks = "default_tool_breaks" },
@ -382,8 +385,8 @@ end
-- Rabbit
if c("rabbit_raw") then
minetest.register_craftitem("mobs_mc:rabbit_raw", {
description = "Raw Rabbit",
_doc_items_longdesc = "Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it will increase its nutritional value.",
description = S("Raw Rabbit"),
_doc_items_longdesc = S("Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it will increase its nutritional value."),
inventory_image = "mcl_mobitems_rabbit_raw.png",
groups = { food = 2, eatable = 3 },
on_use = minetest.item_eat(3),
@ -392,8 +395,8 @@ end
if c("rabbit_cooked") then
minetest.register_craftitem("mobs_mc:rabbit_cooked", {
description = "Cooked Rabbit",
_doc_items_longdesc = "This is a food item which can be eaten.",
description = S("Cooked Rabbit"),
_doc_items_longdesc = S("This is a food item which can be eaten."),
inventory_image = "mcl_mobitems_rabbit_cooked.png",
groups = { food = 2, eatable = 5 },
on_use = minetest.item_eat(5),
@ -411,8 +414,8 @@ end
if c("rabbit_hide") then
minetest.register_craftitem("mobs_mc:rabbit_hide", {
description = "Rabbit Hide",
_doc_items_longdesc = "Rabbit hide is used to create leather.",
description = S("Rabbit Hide"),
_doc_items_longdesc = S("Rabbit hide is used to create leather."),
inventory_image = "mcl_mobitems_rabbit_hide.png"
})
end
@ -429,8 +432,8 @@ end
if c("rabbit_foot") then
minetest.register_craftitem("mobs_mc:rabbit_foot", {
description = "Rabbit's Foot",
_doc_items_longdesc = "This item is used in brewing.",
description = S("Rabbit's Foot"),
_doc_items_longdesc = S("This item is used in brewing."),
inventory_image = "mcl_mobitems_rabbit_foot.png"
})
end
@ -438,8 +441,8 @@ end
-- Sheep
if c("mutton_raw") then
minetest.register_craftitem("mobs_mc:mutton_raw", {
description = "Raw Mutton",
_doc_items_longdesc = "Raw mutton is the flesh from a sheep and can be eaten safely. Cooking it will greatly increase its nutritional value.",
description = S("Raw Mutton"),
_doc_items_longdesc = S("Raw mutton is the flesh from a sheep and can be eaten safely. Cooking it will greatly increase its nutritional value."),
inventory_image = "mcl_mobitems_mutton_raw.png",
groups = { food = 2, eatable = 4 },
on_use = minetest.item_eat(4),
@ -448,8 +451,8 @@ end
if c("mutton_cooked") then
minetest.register_craftitem("mobs_mc:mutton_cooked", {
description = "Cooked Mutton",
_doc_items_longdesc = "Cooked mutton is the cooked flesh from a sheep and is used as food.",
description = S("Cooked Mutton"),
_doc_items_longdesc = S("Cooked mutton is the cooked flesh from a sheep and is used as food."),
inventory_image = "mcl_mobitems_mutton_cooked.png",
groups = { food = 2, eatable = 8 },
on_use = minetest.item_eat(8),
@ -468,8 +471,8 @@ end
-- Shulker
if c("shulker_shell") then
minetest.register_craftitem("mobs_mc:shulker_shell", {
description = "Shulker Shell",
_doc_items_longdesc = "Shulker shells are used in crafting. They are dropped from dead shulkers.",
description = S("Shulker Shell"),
_doc_items_longdesc = S("Shulker shells are used in crafting. They are dropped from dead shulkers."),
inventory_image = "mcl_mobitems_shulker_shell.png",
groups = { craftitem = 1 },
})
@ -478,8 +481,8 @@ end
-- Magma cube
if c("magma_cream") then
minetest.register_craftitem("mobs_mc:magma_cream", {
description = "Magma Cream",
_doc_items_longdesc = "Magma cream is a crafting component.",
description = S("Magma Cream"),
_doc_items_longdesc = S("Magma cream is a crafting component."),
wield_image = "mcl_mobitems_magma_cream.png",
inventory_image = "mcl_mobitems_magma_cream.png",
groups = { brewitem = 1 },
@ -489,8 +492,8 @@ end
-- Slime
if c("slimeball") then
minetest.register_craftitem("mobs_mc:slimeball", {
description = "Slimeball",
_doc_items_longdesc = "Slimeballs are used in crafting. They are dropped from slimes.",
description = S("Slimeball"),
_doc_items_longdesc = S("Slimeballs are used in crafting. They are dropped from slimes."),
inventory_image = "mcl_mobitems_slimeball.png"
})
if minetest.get_modpath("mesecons_materials") then
@ -504,8 +507,8 @@ end
-- Spider
if c("spider_eye") then
minetest.register_craftitem("mobs_mc:spider_eye", {
description = "Spider Eye",
_doc_items_longdesc = "Spider eyes are used mainly in crafting and brewing. Spider eyes can be eaten, but they poison you and reduce your health by 2 hit points.",
description = S("Spider Eye"),
_doc_items_longdesc = S("Spider eyes are used mainly in crafting and brewing. Spider eyes can be eaten, but they poison you and reduce your health by 2 hit points."),
inventory_image = "mcl_mobitems_spider_eye.png",
wield_image = "mcl_mobitems_spider_eye.png",
-- Simplified poisonous food
@ -521,7 +524,6 @@ if c("totem") then
-- Totem of Undying
minetest.register_craftitem("mobs_mc:totem", {
description = S("Totem of Undying"),
_tt_help = minetest.colorize("#00FF00", S("Protects you from death while wielding it")),
_doc_items_longdesc = S("A totem of undying is a rare artifact which may safe you from certain death."),
_doc_items_usagehelp = S("The totem only works while you hold it in your hand. If you receive fatal damage, you are saved from death and you get a second chance with 1 HP. The totem is destroyed in the process, however."),
inventory_image = "mcl_totems_totem.png",
@ -557,7 +559,7 @@ if c("totem") then
player:set_wielded_item(wield)
end
-- Effects
minetest.sound_play({name = "mcl_totems_totem", gain=1}, {pos=ppos, max_hear_distance=16}, true)
minetest.sound_play({name = "mcl_totems_totem", gain=1}, {pos=ppos, max_hear_distance=16})
-- Big totem overlay
if not hud_totem[player:get_player_name()] then
@ -567,7 +569,6 @@ if c("totem") then
position = { x=0.5, y=1 },
scale = { x=17, y=17 },
offset = { x=0, y=-178 },
z_index = 100,
})
minetest.after(3, function(name)
local player = minetest.get_player_by_name(name)
@ -592,8 +593,8 @@ end
-- Rotten flesh
if c("rotten_flesh") then
minetest.register_craftitem("mobs_mc:rotten_flesh", {
description = "Rotten Flesh",
_doc_items_longdesc = "Yuck! This piece of flesh clearly has seen better days. Eating it will only poison you and reduces your health by 4 hit points. But tamed wolves can eat it just fine.",
description = S("Rotten Flesh"),
_doc_items_longdesc = S("Yuck! This piece of flesh clearly has seen better days. Eating it will only poison you and reduces your health by 4 hit points. But tamed wolves can eat it just fine."),
inventory_image = "mcl_mobitems_rotten_flesh.png",
-- Simplified poisonous food
groups = { food = 2, eatable = -4 },
@ -604,8 +605,8 @@ end
-- Misc.
if c("nether_star") then
minetest.register_craftitem("mobs_mc:nether_star", {
description = "Nether Star",
_doc_items_longdesc = "A nether star is a crafting component. It is dropped from the Wither.",
description = S("Nether Star"),
_doc_items_longdesc = S("A nether star is a crafting component. It is dropped from the Wither."),
inventory_image = "mcl_mobitems_nether_star.png"
})
end
@ -633,9 +634,9 @@ end
if c("bone") then
minetest.register_craftitem("mobs_mc:bone", {
description = "Bone",
_doc_items_longdesc = "Bones can be used to tame wolves so they will protect you. They are also useful as a crafting ingredient.",
_doc_items_usagehelp = "Hold the bone in your hand near wolves to attract them. Rightclick the wolf to give it a bone and tame it.",
description = S("Bone"),
_doc_items_longdesc = S("Bones can be used to tame wolves so they will protect you. They are also useful as a crafting ingredient."),
_doc_items_usagehelp = S("Hold the bone in your hand near wolves to attract them. Rightclick the wolf to give it a bone and tame it."),
inventory_image = "mcl_mobitems_bone.png"
})
if minetest.get_modpath("bones") then

View File

@ -3,10 +3,9 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- NOTE: Strings intentionally not marked for translation, other mods already have these items.
-- TODO: Remove this file eventually, all items here are already outsourced in other mods.
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--maikerumines throwing code
--arrow (weapon)
@ -15,18 +14,15 @@ local c = mobs_mc.is_item_variable_overridden
minetest.register_node("mobs_mc:arrow_box", {
drawtype = "nodebox",
is_ground_content = false,
node_box = {
type = "fixed",
fixed = {
-- Shaft
{-6.5/17, -1.5/17, -1.5/17, -4.5/17, 1.5/17, 1.5/17},
{-4.5/17, -0.5/17, -0.5/17, 5.5/17, 0.5/17, 0.5/17},
{5.5/17, -1.5/17, -1.5/17, 6.5/17, 1.5/17, 1.5/17},
-- Tip
{-6.5/17, -1.5/17, -1.5/17, 6.5/17, 1.5/17, 1.5/17},
--Spitze
{-4.5/17, 2.5/17, 2.5/17, -3.5/17, -2.5/17, -2.5/17},
{-8.5/17, 0.5/17, 0.5/17, -6.5/17, -0.5/17, -0.5/17},
-- Fletching
--Federn
{6.5/17, 1.5/17, 1.5/17, 7.5/17, 2.5/17, 2.5/17},
{7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17},
{7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17},
@ -39,16 +35,7 @@ minetest.register_node("mobs_mc:arrow_box", {
}
},
tiles = {"mcl_bows_arrow.png^[transformFX", "mcl_bows_arrow.png^[transformFX", "mcl_bows_arrow_back.png", "mcl_bows_arrow_front.png", "mcl_bows_arrow.png", "mcl_bows_arrow.png^[transformFX"},
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {not_in_creative_inventory=1, dig_immediate=3},
node_placement_prediction = "",
on_construct = function(pos)
minetest.log("error", "[mobs_mc] Trying to construct mobs_mc:arrow_box at "..minetest.pos_to_string(pos))
minetest.remove_node(pos)
end,
drop = "",
groups = {not_in_creative_inventory=1},
})
local THROWING_ARROW_ENTITY={
@ -85,7 +72,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "mobs_mc:arrow_entity" and obj:get_luaentity().name ~= "__builtin:item" then
local damage = 3
minetest.sound_play("damage", {pos = pos}, true)
minetest.sound_play("damage", {pos = pos})
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=damage},
@ -94,7 +81,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
end
else
local damage = 3
minetest.sound_play("damage", {pos = pos}, true)
minetest.sound_play("damage", {pos = pos})
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=damage},
@ -106,7 +93,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
if self.lastpos.x~=nil then
if node.name ~= "air" then
minetest.sound_play("bowhit1", {pos = pos}, true)
minetest.sound_play("bowhit1", {pos = pos})
minetest.add_item(self.lastpos, 'mobs_mc:arrow')
self.object:remove()
end
@ -129,10 +116,10 @@ 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: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}, true)
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)
minetest.sound_play("throwing_sound", {pos=playerpos})
if obj:get_luaentity().player == "" then
obj:get_luaentity().player = player
end
@ -145,9 +132,9 @@ end
if c("arrow") then
minetest.register_craftitem("mobs_mc:arrow", {
description = "Arrow",
_doc_items_longdesc = "Arrows are ammunition for bows.",
_doc_items_usagehelp = "To use arrows as ammunition for a bow, put them in the inventory slot following the bow. Slots are counted left to right, top to bottom.",
description = S("Arrow"),
_doc_items_longdesc = S("Arrows are ammunition for bows."),
_doc_items_usagehelp = S("To use arrows as ammunition for a bow, put them in the inventory slot following the bow. Slots are counted left to right, top to bottom."),
inventory_image = "mcl_bows_arrow_inv.png",
})
end
@ -165,9 +152,9 @@ end
if c("bow") then
minetest.register_tool("mobs_mc:bow_wood", {
description = "Bow",
_doc_items_longdesc = "Bows are ranged weapons to shoot arrows at your foes.",
_doc_items_usagehelp = "To use the bow, you first need to have at least one arrow in slot following the bow. Leftclick to shoot. Each hit deals 3 damage.",
description = S("Bow"),
_doc_items_longdesc = S("Bows are ranged weapons to shoot arrows at your foes."),
_doc_items_usagehelp = S("To use the bow, you first need to have at least one arrow in slot following the bow. Leftclick to shoot. Each hit deals 3 damage."),
inventory_image = "mcl_bows_bow.png",
on_use = function(itemstack, user, pointed_thing)
if throwing_shoot_arrow(itemstack, user, pointed_thing) then
@ -210,8 +197,8 @@ if c("egg") then
}, nil)
end,
hit_mob = function(self, mob)
mob:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
hit_mob = function(self, player)
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {},
}, nil)
@ -266,7 +253,7 @@ if c("egg") then
pos = playerpos,
gain = 1.0,
max_hear_distance = 5,
}, true)
})
local obj = minetest.add_entity({
x = playerpos.x,
@ -280,13 +267,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:set_velocity({
obj:setvelocity({
x = dir.x * egg_VELOCITY,
y = dir.y * egg_VELOCITY,
z = dir.z * egg_VELOCITY
})
obj:set_acceleration({
obj:setacceleration({
x = dir.x * -3,
y = -egg_GRAVITY,
z = dir.z * -3
@ -304,8 +291,8 @@ if c("egg") then
end
minetest.register_craftitem("mobs_mc:egg", {
description = "Egg",
_doc_items_longdesc = "Eggs can be thrown and break on impact. There is a small chance that 1 or even 4 chicks will pop out",
description = S("Egg"),
_doc_items_longdesc = S("Eggs can be thrown and break on impact. There is a small chance that 1 or even 4 chicks will pop out"),
_doc_items_usagehelp = how_to_throw,
inventory_image = "mobs_chicken_egg.png",
on_use = mobs_shoot_egg,
@ -364,13 +351,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:set_velocity({
obj:setvelocity({
x = dir.x * snowball_VELOCITY,
y = dir.y * snowball_VELOCITY,
z = dir.z * snowball_VELOCITY
})
obj:set_acceleration({
obj:setacceleration({
x = dir.x * -3,
y = -snowball_GRAVITY,
z = dir.z * -3
@ -390,8 +377,8 @@ if c("snowball") then
-- Snowball
minetest.register_craftitem("mobs_mc:snowball", {
description = "Snowball",
_doc_items_longdesc = "Snowballs can be thrown at your enemies. A snowball deals 3 damage to blazes, but is harmless to anything else.",
description = S("Snowball"),
_doc_items_longdesc = S("Snowballs can be thrown at your enemies. A snowball deals 3 damage to blazes, but is harmless to anything else."),
_doc_items_usagehelp = how_to_throw,
inventory_image = "mcl_throwing_snowball.png",
on_use = mobs_shoot_snowball,
@ -399,3 +386,7 @@ if c("snowball") then
end
--end maikerumine code
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC mobs loaded")
end

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:set_pos(telepos)
self.object:setpos(telepos)
return
end
end

View File

@ -1,10 +1,9 @@
--MC Heads for minetest
--maikerumine
-- NOTE: Strings intentionally not marked for translation, other mods already have these items.
-- TODO: Remove this file eventually, all items here are already outsourced in other mods.
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
-- Heads system
@ -56,7 +55,7 @@ local function addhead(mobname, desc, longdesc)
end
-- Add heads
addhead("zombie", "Zombie Head", "A zombie head is a small decorative block which resembles the head of a zombie.")
addhead("creeper", "Creeper Head", "A creeper head is a small decorative block which resembles the head of a creeper.")
addhead("skeleton", "Skeleton Skull", "A skeleton skull is a small decorative block which resembles the skull of a skeleton.")
addhead("wither_skeleton", "Wither Skeleton Skull", "A wither skeleton skull is a small decorative block which resembles the skull of a wither skeleton.")
addhead("zombie", S("Zombie Head"), S("A zombie head is a small decorative block which resembles the head of a zombie."))
addhead("creeper", S("Creeper Head"), S("A creeper head is a small decorative block which resembles the head of a creeper."))
addhead("skeleton", S("Skeleton Skull"), S("A skeleton skull is a small decorative block which resembles the skull of a skeleton."))
addhead("wither_skeleton", S("Wither Skeleton Skull"), S("A wither skeleton skull is a small decorative block which resembles the skull of a wither skeleton."))

View File

@ -81,9 +81,6 @@ Origin of those models:
* PilzAdam and Wuzzy (CC0)
* `mobs_mc_chicken_lay_egg.ogg`
* [AGFX](http://www.freesound.org/people/DrMinky/sounds/) (CC0)
* `mobs_mc_chicken_child.ogg`
* Source: <https://freesound.org/people/AGFX/sounds/43380/>
* Randomation (CC0)
* `green_slime_damage.ogg`
* `green_slime_attack.ogg`

View File

@ -2,12 +2,14 @@
--################### AGENT
--###################
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
mobs:register_mob("mobs_mc:agent", {
type = "npc",
spawn_class = "passive",
passive = true,
stepheight = 1.2,
hp_min = 20,
hp_max = 20,
armor = 100,
@ -19,7 +21,6 @@ mobs:register_mob("mobs_mc:agent", {
},
-- TODO: sounds
visual_size = {x=3, y=3},
walk_chance = 0,
walk_velocity = 0.6,
run_velocity = 2,
jump = true,
@ -37,3 +38,7 @@ mobs:register_mob("mobs_mc:agent", {
})
mobs:register_egg("mobs_mc:agent", S("Agent"), "mobs_mc_spawn_icon_agent.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Agent loaded")
end

View File

@ -1,10 +1,11 @@
--License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
mobs:register_mob("mobs_mc:bat", {
type = "animal",
spawn_class = "ambient",
can_despawn = true,
passive = true,
hp_min = 6,
@ -41,10 +42,14 @@ mobs:register_mob("mobs_mc:bat", {
]]
},
water_damage = 1,
lava_damage = 4,
light_damage = 0,
fall_damage = 0,
view_range = 16,
fly = true,
fly_in = "air",
})
@ -66,3 +71,8 @@ mobs:spawn_specific("mobs_mc:bat", mobs_mc.spawn.solid, {"air"}, 0, maxlight, 20
-- spawn eggs
mobs:register_egg("mobs_mc:bat", S("Bat"), "mobs_mc_spawn_icon_bat.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Bat loaded")
end

View File

@ -3,8 +3,11 @@
-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models
-- blaze.lua partial copy of mobs_mc/ghast.lua
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### BLAZE
--###################
@ -12,7 +15,6 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:blaze", {
type = "monster",
spawn_class = "hostile",
hp_min = 20,
hp_max = 20,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.79, 0.3},
@ -22,7 +24,6 @@ mobs:register_mob("mobs_mc:blaze", {
textures = {
{"mobs_mc_blaze.png"},
},
armor = { fleshy = 100, snowball_vulnerable = 100 },
visual_size = {x=3, y=3},
sounds = {
random = "mobs_mc_blaze_breath",
@ -55,7 +56,6 @@ mobs:register_mob("mobs_mc:blaze", {
-- MC Wiki: takes 1 damage every half second while in water
water_damage = 2,
lava_damage = 0,
fire_damage = 0,
fall_damage = 0,
fall_speed = -2.25,
light_damage = 0,
@ -63,13 +63,13 @@ mobs:register_mob("mobs_mc:blaze", {
attack_type = "dogshoot",
arrow = "mobs_mc:blaze_fireball",
shoot_interval = 3.5,
shoot_offset = 1.0,
passive = false,
jump = true,
jump_height = 4,
fly = true,
fear_height = 0,
glow = 14,
jump_chance = 98,
fear_height = 120,
blood_amount = 0,
})
mobs:spawn_specific("mobs_mc:blaze", mobs_mc.spawn.nether_fortress, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 5000, 3, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max)
@ -79,7 +79,7 @@ mobs:register_arrow("mobs_mc:blaze_fireball", {
visual = "sprite",
visual_size = {x = 0.3, y = 0.3},
textures = {"mcl_fire_fire_charge.png"},
velocity = 15,
velocity = 12,
-- Direct hit, no fire... just plenty of pain
hit_player = function(self, player)
@ -89,28 +89,19 @@ mobs:register_arrow("mobs_mc:blaze_fireball", {
}, nil)
end,
hit_mob = function(self, mob)
mob:punch(self.object, 1.0, {
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 5},
}, nil)
end,
hit_object = function(self, object)
local lua = object:get_luaentity()
if lua then
if lua.name == "mcl_minecarts:tnt_minecart" then
lua:on_activate_by_rail(2)
end
end
end,
-- Node hit, make fire
hit_node = function(self, pos, node)
if node.name == "air" then
minetest.set_node(pos_above, {name=mobs_mc.items.fire})
else
local v = self.object:get_velocity()
local v = self.object:getvelocity()
v = vector.normalize(v)
local crashpos = vector.subtract(pos, v)
local crashnode = minetest.get_node(crashpos)
@ -125,3 +116,12 @@ mobs:register_arrow("mobs_mc:blaze_fireball", {
-- spawn eggs
mobs:register_egg("mobs_mc:blaze", S("Blaze"), "mobs_mc_spawn_icon_blaze.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Blaze loaded")
end

View File

@ -1,6 +1,11 @@
--License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### CHICKEN
@ -10,7 +15,6 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:chicken", {
type = "animal",
spawn_class = "passive",
hp_min = 4,
hp_max = 4,
@ -36,6 +40,9 @@ mobs:register_mob("mobs_mc:chicken", {
min = 0,
max = 2,},
},
water_damage = 1,
lava_damage = 4,
light_damage = 0,
fall_damage = 0,
fall_speed = -2.25,
sounds = {
@ -43,12 +50,6 @@ mobs:register_mob("mobs_mc:chicken", {
-- TODO: death, damage
distance = 16,
},
sounds_child = {
random = "mobs_mc_chicken_child",
damage = "mobs_mc_chicken_child",
death = "mobs_mc_chicken_child",
distance = 16,
},
animation = {
stand_speed = 25, walk_speed = 25, run_speed = 50,
stand_start = 0, stand_end = 0,
@ -87,7 +88,7 @@ mobs:register_mob("mobs_mc:chicken", {
pos = pos,
gain = 1.0,
max_hear_distance = 16,
}, true)
})
end,
})
@ -97,3 +98,7 @@ mobs:spawn_specific("mobs_mc:chicken", mobs_mc.spawn.grassland, {"air"}, 9, mine
-- spawn eggs
mobs:register_egg("mobs_mc:chicken", S("Chicken"), "mobs_mc_spawn_icon_chicken.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC chicken loaded")
end

View File

@ -1,10 +1,11 @@
--License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local cow_def = {
type = "animal",
spawn_class = "passive",
hp_min = 10,
hp_max = 10,
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.39, 0.45},
@ -27,6 +28,9 @@ local cow_def = {
min = 0,
max = 2,},
},
water_damage = 1,
lava_damage = 5,
light_damage = 0,
runaway = true,
sounds = {
random = "mobs_mc_cow",
@ -88,7 +92,7 @@ mooshroom_def.on_rightclick = function(self, clicker)
-- Use shears to get mushrooms and turn mooshroom into cow
if item:get_name() == mobs_mc.items.shears then
local pos = self.object:get_pos()
minetest.sound_play("shears", {pos = pos}, true)
minetest.sound_play("shears", {pos = pos})
if self.base_texture[1] == "mobs_mc_mooshroom_brown.png" then
minetest.add_item({x=pos.x, y=pos.y+1.4, z=pos.z}, mobs_mc.items.mushroom_brown .. " 5")
@ -96,10 +100,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:get_yaw()
local oldyaw = self.object:getyaw()
self.object:remove()
local cow = minetest.add_entity(pos, "mobs_mc:cow")
cow:set_yaw(oldyaw)
cow:setyaw(oldyaw)
if not minetest.settings:get_bool("creative_mode") then
item:add_wear(mobs_mc.misc.shears_wear)
@ -136,9 +140,16 @@ mobs:register_mob("mobs_mc:mooshroom", mooshroom_def)
-- Spawning
mobs:spawn_specific("mobs_mc:cow", mobs_mc.spawn.grassland, {"air"}, 9, minetest.LIGHT_MAX+1, 30, 17000, 10, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific("mobs_mc:mooshroom", mobs_mc.spawn.mushroom_island, {"air"}, 9, minetest.LIGHT_MAX+1, 30, 17000, 5, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific("mobs_mc:cow", mobs_mc.spawn.grassland, {"air"}, 9, minetest.LIGHT_MAX+1, 30, 17000, 20, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific("mobs_mc:mooshroom", mobs_mc.spawn.mushroom_island, {"air"}, 9, minetest.LIGHT_MAX+1, 30, 17000, 10, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
-- compatibility
mobs:alias_mob("mobs_animal:cow", "mobs_mc:cow")
-- spawn egg
mobs:register_egg("mobs_mc:cow", S("Cow"), "mobs_mc_spawn_icon_cow.png", 0)
mobs:register_egg("mobs_mc:mooshroom", S("Mooshroom"), "mobs_mc_spawn_icon_mooshroom.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Cow loaded")
end

View File

@ -1,6 +1,11 @@
--License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### CREEPER
@ -11,7 +16,6 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:creeper", {
type = "monster",
spawn_class = "hostile",
hp_min = 20,
hp_max = 20,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.69, 0.3},
@ -36,8 +40,9 @@ mobs:register_mob("mobs_mc:creeper", {
runaway_from = { "mobs_mc:ocelot", "mobs_mc:cat" },
attack_type = "explode",
explosion_strength = 3,
explosion_radius = 3,
reach = 4,
explosion_damage_radius = 7,
explosion_timer = 1.5,
allow_fuse_reset = true,
stop_to_explode = true,
@ -57,19 +62,19 @@ mobs:register_mob("mobs_mc:creeper", {
item:add_wear(1000)
-- Tool break sound
if item:get_count() == 0 and wdef.sound and wdef.sound.breaks then
minetest.sound_play(wdef.sound.breaks, {pos = clicker:get_pos(), gain = 0.5}, true)
minetest.sound_play(wdef.sound.breaks, {pos = clicker:get_pos(), gain = 0.5})
end
clicker:set_wielded_item(item)
end
self._forced_explosion_countdown_timer = self.explosion_timer
minetest.sound_play(self.sounds.attack, {pos = self.object:get_pos(), gain = 1, max_hear_distance = 16}, true)
minetest.sound_play(self.sounds.attack, {pos = self.object:get_pos(), gain = 1, max_hear_distance = 16})
end
end,
do_custom = function(self, dtime)
if self._forced_explosion_countdown_timer ~= nil then
self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
if self._forced_explosion_countdown_timer <= 0 then
mobs:boom(self, self.object:get_pos(), self.explosion_strength)
mobs:explosion(self.object:get_pos(), self.explosion_radius, 0, 1, self.sounds.explode)
self.object:remove()
end
end
@ -114,11 +119,21 @@ mobs:register_mob("mobs_mc:creeper", {
},
floats = 1,
fear_height = 4,
lava_damage = 4,
light_damage = 0,
view_range = 16,
blood_amount = 0,
})
mobs:spawn_specific("mobs_mc:creeper", mobs_mc.spawn.solid, {"air"}, 0, 7, 20, 16500, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.overworld_max)
-- compatibility
mobs:alias_mob("mobs:creeper", "mobs_mc:creeper")
-- spawn eggs
mobs:register_egg("mobs_mc:creeper", S("Creeper"), "mobs_mc_spawn_icon_creeper.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Creeper loaded")
end

View File

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

View File

@ -2,11 +2,41 @@
--################### ENDERDRAGON
--###################
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--[[
mobs:register_mob("mobs_mc:12enderdragon", {
type = "animal",
passive = true,
runaway = true,
stepheight = 1.2,
hp_min = 30,
hp_max = 60,
armor = 150,
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
visual = "mesh",
mesh = "enderdragon.b3d",
textures = {
{"enderdragon.png"},
},
visual_size = {x=1, y=1},
walk_velocity = 0.6,
run_velocity = 2,
jump = true,
animation = {
speed_normal = 25, speed_run = 50,
stand_start = 0, stand_end = 20,
walk_start = 0, walk_end = 20,
run_start = 0, run_end = 20,
},
})
mobs:register_egg("mobs_mc:12enderdragon", "Enderdragon", "enderdragon_inv.png", 0)
]]
mobs:register_mob("mobs_mc:enderdragon", {
type = "monster",
spawn_class = "hostile",
pathfinding = 1,
attacks_animals = true,
walk_chance = 100,
@ -33,7 +63,11 @@ mobs:register_mob("mobs_mc:enderdragon", {
damage = 10,
jump = true,
jump_height = 14,
stepheight = 1.2,
jump_chance = 100,
fear_height = 120,
fly = true,
fly_in = {"air"},
dogshoot_switch = 1,
dogshoot_count_max =5,
dogshoot_count2_max = 5,
@ -45,19 +79,21 @@ mobs:register_mob("mobs_mc:enderdragon", {
min = 1,
max = 1},
},
water_damage = 0,
lava_damage = 0,
fire_damage = 0,
light_damage = 0,
on_rightclick = nil,
attack_type = "dogshoot",
arrow = "mobs_mc:dragon_fireball",
arrow = "mobs_mc:fireball2",
shoot_interval = 0.5,
shoot_offset = -1.0,
shoot_offset = -1,
animation = {
fly_speed = 8, stand_speed = 8,
stand_start = 0, stand_end = 20,
walk_start = 0, walk_end = 20,
run_start = 0, run_end = 20,
},
blood_amount = 0,
ignores_nametag = true,
})
@ -65,33 +101,87 @@ mobs:register_mob("mobs_mc:enderdragon", {
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
-- dragon fireball (projectile)
mobs:register_arrow("mobs_mc:dragon_fireball", {
mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
visual = "sprite",
visual_size = {x = 1.25, y = 1.25},
visual_size = {x = 1, y = 1},
--textures = {"transparent.png"},
textures = {"mese_egg.png"},
velocity = 10,
on_step = function(self, dtime)
local pos = self.object:get_pos()
local n = minetest.get_node(pos).name
if self.timer == 0 then
self.timer = os.time()
end
if os.time() - self.timer > 8 or minetest.is_protected(pos, "") then
self.object:remove()
end
local objects = minetest.get_objects_inside_radius(pos, 1)
for _,obj in ipairs(objects) do
local name = self.name
if name~="mobs_mc:roar_of_the_dragon2" and name ~= "mobs_mc:enderdragon" then
obj:set_hp(obj:get_hp()-0.05)
if (obj:get_hp() <= 0) then
if (not obj:is_player()) and name ~= self.object:get_luaentity().name then
obj:remove()
end
end
end
end
if mobs_griefing then
minetest.set_node(pos, {name="air"})
if math.random(1,2)==1 then
local dx = math.random(-1,1)
local dy = math.random(-1,1)
local dz = math.random(-1,1)
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
minetest.set_node(p, {name="air"})
end
end
end
})
--GOOD LUCK LOL!
-- fireball (weapon)
mobs:register_arrow(":mobs_mc:fireball2", {
visual = "sprite",
visual_size = {x = 1.5, y = 1.5},
textures = {"mobs_mc_dragon_fireball.png"},
--textures = {"mobs_skeleton2_front.png^[makealpha:255,255,255 "},
velocity = 6,
-- direct hit, no fire... just plenty of pain
hit_player = function(self, player)
minetest.sound_play("tnt_explode", {pos = player:get_pos(), gain = 1.5, max_hear_distance = 2*64})
player:punch(self.object, 1.0, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 12},
damage_groups = {fleshy = 6},
}, nil)
end,
hit_mob = function(self, mob)
minetest.sound_play("tnt_explode", {pos = mob:get_pos(), gain = 1.5, max_hear_distance = 2*64}, true)
minetest.sound_play("tnt_explode", {pos = mob:get_pos(), gain = 1.5, max_hear_distance = 2*64})
mob:punch(self.object, 1.0, {
full_punch_interval = 0.5,
damage_groups = {fleshy = 12},
}, nil)
end,
-- node hit, explode
-- node hit, bursts into flame
hit_node = function(self, pos, node)
mobs:boom(self, pos, 2)
mobs:explosion(pos, 3, 0, 1)
--from tnt
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
end
})
mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0, true)
mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0)

View File

@ -10,7 +10,12 @@
-- and they are provoked by looking directly at them.
-- TODO: Implement MC behaviour.
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### ENDERMAN
@ -168,9 +173,9 @@ local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
mobs:register_mob("mobs_mc:enderman", {
-- TODO: Endermen should be classified as passive
type = "monster",
spawn_class = "passive",
passive = false,
pathfinding = 1,
stepheight = 1.2,
hp_min = 40,
hp_max = 40,
collisionbox = {-0.3, -0.01, -0.3, 0.3, 2.89, 0.3},
@ -255,7 +260,7 @@ mobs:register_mob("mobs_mc:enderman", {
self.animation = select_enderman_animation("block")
mobs:set_animation(self, self.animation.current)
if def.sounds and def.sounds.dug then
minetest.sound_play(def.sounds.dug, {pos = take_pos, max_hear_distance = 16}, true)
minetest.sound_play(def.sounds.dug, {pos = take_pos, max_hear_distance = 16})
end
end
end
@ -276,7 +281,7 @@ mobs:register_mob("mobs_mc:enderman", {
self.animation = select_enderman_animation("normal")
mobs:set_animation(self, self.animation.current)
if def.sounds and def.sounds.place then
minetest.sound_play(def.sounds.place, {pos = place_pos, max_hear_distance = 16}, true)
minetest.sound_play(def.sounds.place, {pos = place_pos, max_hear_distance = 16})
end
self._taken_node = ""
end
@ -309,7 +314,7 @@ mobs:register_mob("mobs_mc:enderman", {
end
end
if telepos then
self.object:set_pos(telepos)
self.object:setpos(telepos)
end
end
end,
@ -320,11 +325,14 @@ mobs:register_mob("mobs_mc:enderman", {
end
end,
water_damage = 8,
lava_damage = 4,
light_damage = 0,
-- TODO: Increase view range when it detects being seen
-- Low view range to emulate that behaviour somehow
view_range = 4,
fear_height = 4,
attack_type = "dogfight",
blood_amount = 0,
})
@ -337,3 +345,9 @@ mobs:spawn_specific("mobs_mc:enderman", mobs_mc.spawn.solid, {"air"}, 0, 7, 30,
-- spawn eggs
mobs:register_egg("mobs_mc:enderman", S("Enderman"), "mobs_mc_spawn_icon_enderman.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Enderman loaded")
end

View File

@ -2,11 +2,12 @@
--################### ENDERMITE
--###################
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
mobs:register_mob("mobs_mc:endermite", {
type = "monster",
spawn_class = "hostile",
passive = false,
hp_min = 8,
hp_max = 8,
@ -28,10 +29,14 @@ mobs:register_mob("mobs_mc:endermite", {
walk_velocity = 1,
run_velocity = 2,
jump = true,
water_damage = 0,
lava_damage = 4,
light_damage = 0,
fear_height = 4,
view_range = 16,
damage = 2,
reach = 1,
blood_amount = 0,
})
mobs:register_egg("mobs_mc:endermite", S("Endermite"), "mobs_mc_spawn_icon_endermite.png", 0)

View File

@ -3,7 +3,11 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### GHAST
@ -12,7 +16,6 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:ghast", {
type = "monster",
spawn_class = "hostile",
pathfinding = 1,
group_attack = true,
hp_min = 10,
@ -54,12 +57,17 @@ mobs:register_mob("mobs_mc:ghast", {
walk_start = 0, walk_end = 40,
run_start = 0, run_end = 40,
},
lava_damage = 4,
light_damage = 0,
fall_damage = 0,
view_range = 100,
--attack_type = "dogshoot",
attack_type = "dogshoot",
arrow = "mobs_mc:fireball",
arrow = "mobs_monster:fireball",
shoot_interval = 3.5,
shoot_offset = -5,
shoot_offset = 1,
--'dogshoot_switch' allows switching between shoot and dogfight modes inside dogshoot using timer (1 = shoot, 2 = dogfight)
--'dogshoot_count_max' number of seconds before switching above modes.
dogshoot_switch = 1,
dogshoot_count_max =1,
passive = false,
@ -67,36 +75,40 @@ mobs:register_mob("mobs_mc:ghast", {
jump_height = 4,
floats=1,
fly = true,
fly_in = {"air"},
jump_chance = 98,
fear_height = 120,
blood_amount = 0,
})
mobs:spawn_specific("mobs_mc:ghast", mobs_mc.spawn.nether, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 18000, 2, mobs_mc.spawn_height.nether_min, mobs_mc.spawn_height.nether_max)
-- fireball (projectile)
mobs:register_arrow("mobs_mc:fireball", {
-- fireball (weapon)
mobs:register_arrow(":mobs_monster:fireball", {
visual = "sprite",
visual_size = {x = 1, y = 1},
visual_size = {x = 0.5, y = 0.5},
textures = {"mcl_fire_fire_charge.png"},
velocity = 15,
velocity = 6,
-- direct hit, no fire... just plenty of pain
hit_player = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 6},
damage_groups = {fleshy = 8},
}, nil)
mobs:boom(self, self.object:get_pos(), 1, true)
end,
hit_mob = function(self, mob)
mob:punch(self.object, 1.0, {
hit_mob = function(self, player)
player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 6},
damage_groups = {fleshy = 8},
}, nil)
mobs:boom(self, self.object:get_pos(), 1, true)
end,
-- node hit, bursts into flame
hit_node = function(self, pos, node)
mobs:boom(self, pos, 1, true)
mobs:explosion(pos, 1, 1, 0)
end
})
@ -105,3 +117,7 @@ mobs:register_arrow("mobs_mc:fireball", {
-- spawn eggs
mobs:register_egg("mobs_mc:ghast", S("Ghast"), "mobs_mc_spawn_icon_ghast.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Ghast loaded")
end

View File

@ -4,14 +4,14 @@
--################### GUARDIAN
--###################
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
mobs:register_mob("mobs_mc:guardian", {
type = "monster",
spawn_class = "hostile",
hp_min = 30,
hp_max = 30,
breath_max = -1,
passive = false,
attack_type = "dogfight",
pathfinding = 1,
@ -39,12 +39,10 @@ mobs:register_mob("mobs_mc:guardian", {
run_start = 0, run_end = 20,
},
drops = {
-- Greatly increased amounts of prismarine
{name = mobs_mc.items.prismarine_shard,
chance = 1,
min = 0,
max = 32,},
-- TODO: Reduce of drops when ocean monument is ready.
max = 2,},
-- The following drops are approximations
-- Fish / prismarine crystal
@ -55,7 +53,7 @@ mobs:register_mob("mobs_mc:guardian", {
{name = mobs_mc.items.prismarine_crystals,
chance = 4,
min = 1,
max = 2,},
max = 1,},
-- Rare drop: fish
{name = mobs_mc.items.fish_raw,
@ -77,13 +75,16 @@ mobs:register_mob("mobs_mc:guardian", {
},
fly = true,
fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source },
stepheight = 0.1,
jump = false,
view_range = 16,
water_damage = 0,
lava_damage = 4,
light_damage = 0,
blood_amount = 0,
})
-- Spawning disabled due to size issues
-- TODO: Re-enable spawning
--mobs:spawn_specific("mobs_mc:guardian", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water - 10)
mobs:spawn_specific("mobs_mc:guardian", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 25000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water - 10)
-- spawn eggs
mobs:register_egg("mobs_mc:guardian", S("Guardian"), "mobs_mc_spawn_icon_guardian.png", 0)

View File

@ -4,14 +4,14 @@
--################### GUARDIAN
--###################
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
mobs:register_mob("mobs_mc:guardian_elder", {
type = "monster",
spawn_class = "hostile",
hp_min = 80,
hp_max = 80,
breath_max = -1,
passive = false,
attack_type = "dogfight",
pathfinding = 1,
@ -39,14 +39,10 @@ mobs:register_mob("mobs_mc:guardian_elder", {
run_start = 0, run_end = 20,
},
drops = {
-- TODO: Reduce # of drops when ocean monument is ready.
-- Greatly increased amounts of prismarine
{name = mobs_mc.items.prismarine_shard,
chance = 1,
min = 1,
max = 64,},
min = 0,
max = 2,},
-- TODO: Only drop if killed by player
{name = mobs_mc.items.wet_sponge,
chance = 1,
@ -60,9 +56,9 @@ mobs:register_mob("mobs_mc:guardian_elder", {
min = 1,
max = 1,},
{name = mobs_mc.items.prismarine_crystals,
chance = 1,
chance = 4,
min = 1,
max = 10,},
max = 1,},
-- Rare drop: fish
{name = mobs_mc.items.fish_raw,
@ -84,13 +80,16 @@ mobs:register_mob("mobs_mc:guardian_elder", {
},
fly = true,
fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source },
stepheight = 0.1,
jump = false,
water_damage = 0,
lava_damage = 4,
light_damage = 0,
view_range = 16,
blood_amount = 0,
})
-- Spawning disabled due to size issues
-- TODO: Re-enable spawning
-- mobs:spawn_specific("mobs_mc:guardian_elder", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water-18)
mobs:spawn_specific("mobs_mc:guardian_elder", mobs_mc.spawn.water, mobs_mc.spawn_water, 0, minetest.LIGHT_MAX+1, 30, 40000, 2, mobs_mc.spawn_height.overworld_min, mobs_mc.spawn_height.water-18)
-- spawn eggs
mobs:register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "mobs_mc_spawn_icon_guardian_elder.png", 0)

View File

@ -3,7 +3,9 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--###################
--################### HORSE
@ -84,7 +86,6 @@ end
-- Horse
local horse = {
type = "animal",
spawn_class = "passive",
visual = "mesh",
mesh = "mobs_mc_horse.b3d",
visual_size = {x=3.0, y=3.0},
@ -117,6 +118,8 @@ local horse = {
hp_min = 15,
hp_max = 30,
floats = 1,
lava_damage = 4,
water_damage = 1,
makes_footstep_sound = true,
jump = true,
jump_height = 5.75, -- can clear 2.5 blocks
@ -139,7 +142,7 @@ local horse = {
self.max_speed_reverse = 2
self.accel = 6
self.terrain_type = 3
self.driver_attach_at = {x = 0, y = 4.17, z = -1.75}
self.driver_attach_at = {x = 0, y = 7.5, 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
@ -185,36 +188,14 @@ local horse = {
end
local item = clicker:get_wielded_item()
local iname = item:get_name()
local heal = 0
if can_breed(self.name) then
if can_breed(self.name) and (item:get_name() == mobs_mc.items.golden_apple or item:get_name() == mobs_mc.items.golden_carrot) then
-- Breed horse with golden apple or golden carrot
if (iname == mobs_mc.items.golden_apple) then
heal = 10
elseif (iname == mobs_mc.items.golden_carrot) then
heal = 4
end
if heal > 0 and mobs:feed_tame(self, clicker, heal, true, false) then
return
end
if mobs:feed_tame(self, clicker, 1, true, false) then return end
end
-- Feed/tame with anything else
if (iname == mobs_mc.items.sugar) then
heal = 1
elseif (iname == mobs_mc.items.wheat) then
heal = 2
elseif (iname == mobs_mc.items.apple) then
heal = 3
elseif (iname == mobs_mc.items.hay_bale) then
heal = 20
end
if heal > 0 and mobs:feed_tame(self, clicker, heal, false, true) then
return
end
if mobs:protect(self, clicker) then
return
end
-- TODO: Different health bonus for feeding
if mobs:feed_tame(self, clicker, 1, false, true) then return end
if mobs:protect(self, clicker) then return end
-- Make sure tamed horse is mature and being clicked by owner only
if self.tamed and not self.child and self.owner == clicker:get_player_name() then
@ -228,7 +209,7 @@ local horse = {
-- Put on saddle if tamed
elseif not self.driver and not self._saddle
and iname == mobs_mc.items.saddle then
and clicker:get_wielded_item():get_name() == mobs_mc.items.saddle then
-- Put on saddle and take saddle from player's inventory
local w = clicker:get_wielded_item()
@ -246,17 +227,16 @@ local horse = {
local tex = horse_extra_texture(self)
self.base_texture = tex
self.object:set_properties({textures = self.base_texture})
minetest.sound_play({name = "mcl_armor_equip_leather"}, {gain=0.5, max_hear_distance=12, pos=self.object:get_pos()}, true)
-- Put on horse armor if tamed
elseif can_equip_horse_armor(self.name) and not self.driver and not self._horse_armor
and minetest.get_item_group(iname, "horse_armor") > 0 then
and minetest.get_item_group(clicker:get_wielded_item():get_name(), "horse_armor") > 0 then
-- Put on armor and take armor from player's inventory
local armor = minetest.get_item_group(iname, "horse_armor")
self._horse_armor = iname
local w = clicker:get_wielded_item()
local armor = minetest.get_item_group(w:get_name(), "horse_armor")
self._horse_armor = w:get_name()
if not minetest.settings:get_bool("creative_mode") then
w:take_item()
clicker:set_wielded_item(w)
@ -276,10 +256,7 @@ local horse = {
local tex = horse_extra_texture(self)
self.base_texture = tex
self.object:set_properties({textures = self.base_texture})
local def = w:get_definition()
if def.sounds and def.sounds._mcl_armor_equip then
minetest.sound_play({name = def.sounds._mcl_armor_equip}, {gain=0.5, max_hear_distance=12, pos=self.object:get_pos()}, true)
end
-- Mount horse
elseif not self.driver and self._saddle then
@ -288,7 +265,7 @@ local horse = {
mobs.attach(self, clicker)
-- Used to capture horse
elseif not self.driver and iname ~= "" then
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end
end
@ -349,7 +326,6 @@ mobs:register_mob("mobs_mc:horse", horse)
-- Skeleton horse
local skeleton_horse = table.copy(horse)
skeleton_horse.breath_max = -1
skeleton_horse.textures = {{"blank.png", "mobs_mc_horse_skeleton.png", "blank.png"}}
skeleton_horse.drops = {
{name = mobs_mc.items.bone,
@ -363,11 +339,11 @@ skeleton_horse.sounds = {
damage = "mobs_mc_skeleton_hurt",
distance = 16,
}
skeleton_horse.blood_amount = 0
mobs:register_mob("mobs_mc:skeleton_horse", skeleton_horse)
-- Zombie horse
local zombie_horse = table.copy(horse)
zombie_horse.breath_max = -1
zombie_horse.textures = {{"blank.png", "mobs_mc_horse_zombie.png", "blank.png"}}
zombie_horse.drops = {
{name = mobs_mc.items.rotten_flesh,
@ -426,8 +402,11 @@ mobs:register_mob("mobs_mc:mule", mule)
--===========================
--Spawn Function
mobs:spawn_specific("mobs_mc:horse", mobs_mc.spawn.grassland_savanna, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15000, 4, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific("mobs_mc:donkey", mobs_mc.spawn.grassland_savanna, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15000, 4, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific("mobs_mc:horse", mobs_mc.spawn.grassland_savanna, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15000, 12, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max)
mobs:spawn_specific("mobs_mc:donkey", mobs_mc.spawn.grassland_savanna, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 15000, 12, mobs_mc.spawn_height.water+3, mobs_mc.spawn_height.overworld_max)
-- compatibility
mobs:alias_mob("mobs:horse", "mobs_mc:horse")
-- spawn eggs
mobs:register_egg("mobs_mc:horse", S("Horse"), "mobs_mc_spawn_icon_horse.png", 0)
@ -435,3 +414,8 @@ mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "mobs_mc_spawn_
mobs:register_egg("mobs_mc:zombie_horse", S("Zombie Horse"), "mobs_mc_spawn_icon_horse_zombie.png", 0)
mobs:register_egg("mobs_mc:donkey", S("Donkey"), "mobs_mc_spawn_icon_donkey.png", 0)
mobs:register_egg("mobs_mc:mule", S("Mule"), "mobs_mc_spawn_icon_mule.png", 0)
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Horse loaded")
end

View File

@ -98,3 +98,7 @@ COLISIONBOX in minetest press f5 to see where you are looking at then put these
--]]
--
--
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "[MOD] mobs_mc loaded")
end

View File

@ -0,0 +1,45 @@
-- 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,8 +3,11 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc")
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### IRON GOLEM
--###################
@ -13,11 +16,9 @@ local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:iron_golem", {
type = "npc",
spawn_class = "passive",
passive = true,
hp_min = 100,
hp_max = 100,
breath_max = -1,
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.69, 0.7},
visual = "mesh",
mesh = "mobs_mc_iron_golem.b3d",
@ -50,6 +51,9 @@ mobs:register_mob("mobs_mc:iron_golem", {
min = 0,
max = 2,},
},
water_damage = 0,
lava_damage = 4,
light_damage = 0,
fall_damage = 0,
animation = {
stand_speed = 15, walk_speed = 15, run_speed = 25, punch_speed = 15,
@ -59,6 +63,7 @@ mobs:register_mob("mobs_mc:iron_golem", {
punch_start = 40, punch_end = 50,
},
jump = true,
blood_amount = 0,
})
@ -173,3 +178,7 @@ mobs_mc.tools.check_iron_golem_summon = function(pos)
end
end
end
if minetest.settings:get_bool("log_mods") then
minetest.log("action", "MC Iron Golem loaded")
end

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